Last active
October 12, 2015 12:08
-
-
Save taktamur/4024602 to your computer and use it in GitHub Desktop.
zshにてemacsをdaemonモードで起動したり終了したりする関数定義(Mac)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#===================== | |
# emacsの設定(zsh,Mac) | |
#===================== | |
# emacsはportでemacs-appをインストール、emacs24.2.1 | |
alias emacs=/Applications/MacPorts/Emacs.app/Contents/MacOS/Emacs | |
alias emacsclient=/Applications/MacPorts/Emacs.app/Contents/MacOS/bin/emacsclient | |
# デーモンモードで起動させ、それに接続する | |
# 素のemacsをオーバーライドしないように、関数名をEとした。 | |
function E(){ | |
# if [[ ]] はzshでのif短縮形 | |
if [[ 0 -eq `ps ax | grep Emacs | grep daemon | wc -l` ]] emacs --daemon | |
emacsclient -t $*; | |
} | |
# emacs.d/以下をいじっているとしょっちゅう再起動したくなるのでコマンド化 | |
function kill-emacs(){ | |
emacsclient -e "(kill-emacs)" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment