From e64253adc84b62a01660e7de276ba61711f7421f Mon Sep 17 00:00:00 2001 From: Guangxiong Lin Date: Sun, 20 Mar 2022 18:41:45 +0800 Subject: Improve emacsclient --- bin/ek | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100755 bin/ek (limited to 'bin/ek') diff --git a/bin/ek b/bin/ek new file mode 100755 index 0000000..4420327 --- /dev/null +++ b/bin/ek @@ -0,0 +1,12 @@ +#!/usr/bin/env bash + +server_running () { + emacsclient -a "false" -e "(boundp 'server-process)" +} + +if [ "t" == "$(server_running)" ]; then + emacsclient -e '(kill-emacs)' + echo "Emacs server is killed" +else + echo "Emacs server is not running" +fi -- cgit v1.2.3