1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556 |
- if "$ZSH/tools/require_tool.sh" emacs 23 2>/dev/null ; then
- export EMACS_PLUGIN_LAUNCHER="$ZSH/plugins/emacs/emacsclient.sh"
-
- export EDITOR="${EDITOR:-${EMACS_PLUGIN_LAUNCHER}}"
- alias emacs="$EMACS_PLUGIN_LAUNCHER --no-wait"
- alias e=emacs
-
- alias eeval="$EMACS_PLUGIN_LAUNCHER --eval"
-
- alias eframe='emacsclient --alternate-editor "" --create-frame'
-
- alias emasc=emacs
- alias emcas=emacs
-
-
- function efile {
- local cmd="(buffer-file-name (window-buffer))"
- "$EMACS_PLUGIN_LAUNCHER" --eval "$cmd" | tr -d \"
- }
- # Write to standard output the directory of the file
- # opened in the the current buffer
- function ecd {
- local cmd="(let ((buf-name (buffer-file-name (window-buffer))))
- (if buf-name (file-name-directory buf-name)))"
- local dir="$($EMACS_PLUGIN_LAUNCHER --eval $cmd | tr -d \")"
- if [ -n "$dir" ] ;then
- echo "$dir"
- else
- echo "can not deduce current buffer filename." >/dev/stderr
- return 1
- fi
- }
- fi
|