Emacs: modified 'em' launcher so that emacs daemon can accept arguments.

This expects a socket at /tmp/emacs$(id -u)/server.
master
Pierre Neidhardt 2014-02-23 19:01:36 +01:00
parent e60118f890
commit 836792d14f
3 changed files with 12 additions and 20 deletions

View File

@ -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 "$@"

View File

@ -1,2 +0,0 @@
#!/bin/sh
emacsclient -a "" -t "$@"

1
.scripts/emc Symbolic link
View File

@ -0,0 +1 @@
em

View File

@ -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.
--------------------------------------------------------------------------------