bloated emacs configuration
git clone git://git.ckyln.com/~cem/emacs.d.git
Log | Files | Refs | README

commit 9af7105d40b0153fc8fca3795392035d661998ea
parent 9b86efedb79c3bc4a54f4222cc3f7ef1245e2d25
Author: Cem Keylan <cem@ckyln.com>
Date:   Sun, 29 Mar 2020 17:37:07 +0300

add emc

Minit.org | 26+++++++++++++++++++++-----
1 file changed, 21 insertions(+), 5 deletions(-)

diff --git a/init.org b/init.org @@ -199,13 +199,29 @@ computers. (setq diary-file "~/Org/agenda/diary") #+END_SRC ** Starting the server -I usually use the graphical environment provided by Emacs, but -from time to time I need to launch emacsclien from the console. -I have a basic alias on my =~/.aliases= file like this. +I used to have an alias for running emacsclient, now I +use a tiny script for it. +#+NAME: emc +#+BEGIN_SRC sh :tangle emc :tangle-mode (identity #o755) + #!/bin/sh + + EMACSCLIENT_EXTRA_OPTIONS="${EMACSCLIENT_EXTRA_OPTIONS}" + tty >/dev/null 2>&1 && EMACSCLIENT_EXTRA_OPTIONS="$EMACSCLIENT_EXTRA_OPTIONS -nw" + + for opt in "$@" ; do + EMACSCLIENT_EXTRA_OPTIONS="$EMACSCLIENT_EXTRA_OPTIONS $opt" + done + + # We want word splitting + # shellcheck disable=2086 + emacsclient --alternate-editor='' -c $EMACSCLIENT_EXTRA_OPTIONS +#+END_SRC + +You can install the generated emc script by doing + #+BEGIN_SRC sh :tangle no -alias em="emacsclient -c -nw -a 'vim'" + install -Dm755 -t /usr/local/bin emc #+END_SRC -This fallbacks to vim if the emacs server is unavailable. #+BEGIN_SRC emacs-lisp (require 'server)