From 836792d14f881bccc55e4157f6b8b113d91c5ba7 Mon Sep 17 00:00:00 2001 From: Pierre Neidhardt Date: Sun, 23 Feb 2014 19:01:36 +0100 Subject: [PATCH] Emacs: modified 'em' launcher so that emacs daemon can accept arguments. This expects a socket at /tmp/emacs$(id -u)/server. --- .scripts/em | 18 ++++++++++-------- .scripts/emc | 3 +-- README.md | 11 +---------- 3 files changed, 12 insertions(+), 20 deletions(-) mode change 100755 => 120000 .scripts/emc diff --git a/.scripts/em b/.scripts/em index 209d4618..41de1dfd 100755 --- a/.scripts/em +++ b/.scripts/em @@ -1,12 +1,14 @@ #!/bin/sh -if [ -z "$DISPLAY" ]; then - IS_GRAPHICAL=true +## Note: we do not use the (-a "") parameters of emacsclient to auto start the +## daemon since we want to pass additional parameters to emacs. + +if [ "${0##*/}" = "emc" ]; then + param="-t" +elif [ -z "$DISPLAY" ]; then + param="-nc" else - IS_GRAPHICAL=$(emacs --batch -Q --eval='(if (fboundp '"'"'tool-bar-mode) (message "true") (message "false"))' 2>&1) + param=$(emacs --batch -Q --eval='(if (fboundp '"'"'tool-bar-mode) (message "-nc") (message "-t"))' 2>&1) fi -if $IS_GRAPHICAL; then - emacsclient -a "" -nc "$@" -else - emacsclient -a "" -t "$@" -fi +[ ! -e /tmp/emacs$(id -u)/server ] && emacs --daemon --no-site-file +emacsclient $param "$@" diff --git a/.scripts/emc b/.scripts/emc deleted file mode 100755 index 7c932c1d..00000000 --- a/.scripts/emc +++ /dev/null @@ -1,2 +0,0 @@ -#!/bin/sh -emacsclient -a "" -t "$@" diff --git a/.scripts/emc b/.scripts/emc new file mode 120000 index 00000000..d87a5b31 --- /dev/null +++ b/.scripts/emc @@ -0,0 +1 @@ +em \ No newline at end of file diff --git a/README.md b/README.md index 12763289..720a9aed 100644 --- a/README.md +++ b/README.md @@ -217,15 +217,6 @@ been using. Known issues ============ -Emacs ------ - -* When linum is on in very large files (5000+ lines), beginning-of-buffer is - extremly slow when called from a shortcut, but not when called from the - command mini-buffer. - -* xclip mode will sometimes prevent yanking from working properly. - Scripts ------- @@ -243,7 +234,7 @@ URxvt text was copied will make it hang (and crash). * There is a bug with Xft anti-aliased font that prevent w3m image preview from - working (too bad for ranger). + working (too bad for ranger). Use non-Xft fonts as a workaround. --------------------------------------------------------------------------------