From f9f1db4d15d13c6954912d0bacc6388a9c290a32 Mon Sep 17 00:00:00 2001 From: Pierre Neidhardt Date: Tue, 22 Apr 2014 16:34:17 +0200 Subject: [PATCH] Emacs: support for waiting client 'emw' This is useful for program that need a graphical waiting instance of emacsclient like dwb's external editor. --- .config/dwb/settings | 2 +- .scripts/em | 28 ++++++++++++++++++++++++++-- 2 files changed, 27 insertions(+), 3 deletions(-) diff --git a/.config/dwb/settings b/.config/dwb/settings index 43740e0f..45fd4c24 100644 --- a/.config/dwb/settings +++ b/.config/dwb/settings @@ -42,7 +42,7 @@ adblocker-filterlist=~/.config/dwb/adblock_lists proxy=false user-agent= full-content-zoom=true -editor=emacsclient -a "" -c dwb_uri +editor=emw dwb_uri enable-accelerated-compositing=false enable-private-browsing=false enable-favicon=true diff --git a/.scripts/em b/.scripts/em index 410c3aae..e0f9a591 100755 --- a/.scripts/em +++ b/.scripts/em @@ -2,10 +2,34 @@ ## 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" ] || [ -z "$DISPLAY" ]; then +if [ "$1" = "--help" ] || [ "$1" = "-h" ]; then + cat <&1)" = TTY ]; then param="-t" 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 [ ! -e /tmp/emacs$(id -u)/server ] && emacs --daemon --no-site-file