Created
September 27, 2011 06:30
-
-
Save yoshinari-nomura/1244467 to your computer and use it in GitHub Desktop.
Small aliases to get along with Emacs buffer.
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
## Invoke the ``dired'' of current working directory in Emacs buffer. | |
function dired () { | |
emacsclient -e "(dired \"$PWD\")" | |
} | |
## Chdir to the ``default-directory'' of currently opened in Emacs buffer. | |
function cde () { | |
EMACS_CWD=`emacsclient -e " | |
(expand-file-name | |
(with-current-buffer | |
(nth 1 | |
(assoc 'buffer-list | |
(nth 1 (nth 1 (current-frame-configuration))))) | |
default-directory))" | sed 's/^"\(.*\)"$/\1/'` | |
echo "chdir to $EMACS_CWD" | |
cd "$EMACS_CWD" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
ありがとうございます!
elscreen 使っていると、(current-frame-configuration) から buffer-list を取得できないので、
fork して修正してみました☆