Emacs: support for waiting client 'emw'
This is useful for program that need a graphical waiting instance of emacsclient like dwb's external editor.master
parent
d0baf84d34
commit
f9f1db4d15
|
@ -42,7 +42,7 @@ adblocker-filterlist=~/.config/dwb/adblock_lists
|
||||||
proxy=false
|
proxy=false
|
||||||
user-agent=
|
user-agent=
|
||||||
full-content-zoom=true
|
full-content-zoom=true
|
||||||
editor=emacsclient -a "" -c dwb_uri
|
editor=emw dwb_uri
|
||||||
enable-accelerated-compositing=false
|
enable-accelerated-compositing=false
|
||||||
enable-private-browsing=false
|
enable-private-browsing=false
|
||||||
enable-favicon=true
|
enable-favicon=true
|
||||||
|
|
28
.scripts/em
28
.scripts/em
|
@ -2,10 +2,34 @@
|
||||||
## Note: we do not use the (-a "") parameters of emacsclient to auto start the
|
## Note: we do not use the (-a "") parameters of emacsclient to auto start the
|
||||||
## daemon since we want to pass additional parameters to emacs.
|
## daemon since we want to pass additional parameters to emacs.
|
||||||
|
|
||||||
if [ "${0##*/}" = "emc" ] || [ -z "$DISPLAY" ]; then
|
if [ "$1" = "--help" ] || [ "$1" = "-h" ]; then
|
||||||
|
cat <<EOF
|
||||||
|
Usage: ${0##*/} [FILES]
|
||||||
|
|
||||||
|
Start emacsclient in terminal or in X window if possible. If server is not
|
||||||
|
found, it is started with --no-site-file parameter.
|
||||||
|
|
||||||
|
Calling script can have different names.
|
||||||
|
* emc: emacs instance is opened in current terminal.
|
||||||
|
* emw: if graphical, tell client to wait.
|
||||||
|
|
||||||
|
All emacsclient(1) options are supported.
|
||||||
|
|
||||||
|
$(emacsclient --help)
|
||||||
|
|
||||||
|
EOF
|
||||||
|
exit
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ "${0##*/}" = "emc" ] || [ -z "$DISPLAY" ] || \
|
||||||
|
[ "$(emacs --batch -Q --eval='(if (fboundp '"'"'tool-bar-mode) (message "X") (message "TTY"))' 2>&1)" = TTY ]; then
|
||||||
param="-t"
|
param="-t"
|
||||||
else
|
else
|
||||||
param=$(emacs --batch -Q --eval='(if (fboundp '"'"'tool-bar-mode) (message "-nc") (message "-t"))' 2>&1)
|
if [ "${0##*/}" = "emw" ]; then
|
||||||
|
param="-c"
|
||||||
|
else
|
||||||
|
param="-nc"
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
[ ! -e /tmp/emacs$(id -u)/server ] && emacs --daemon --no-site-file
|
[ ! -e /tmp/emacs$(id -u)/server ] && emacs --daemon --no-site-file
|
||||||
|
|
Loading…
Reference in New Issue