Last active
January 15, 2016 09:27
-
-
Save hage/5d1ef65115255052ec5b to your computer and use it in GitHub Desktop.
cdeとelscreen-separate-buffer-listの相性が悪い ref: http://qiita.com/__hage/items/2dd732b4dd68e124e8bd
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
function cde () { | |
EMACS_CWD=`emacsclient -e "(return-current-working-directory-to-shell)" | sed 's/^"\(.*\)"$/\1/'` | |
echo "chdir to $EMACS_CWD" | |
cd "$EMACS_CWD" | |
} |
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
function cde () { | |
EMACS_CWD=`emacsclient -e "(return-current-working-directory-to-shell)" | sed 's/^"\(.*\)"$/\1/'` | |
echo "chdir to $EMACS_CWD" | |
cd "$EMACS_CWD" | |
} |
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
(defun return-current-working-directory-to-shell () | |
(expand-file-name | |
(with-current-buffer | |
(if (featurep 'elscreen) | |
(let* ((frame-confs (elscreen-get-frame-confs (selected-frame))) | |
(num (nth 1 (assoc 'screen-history frame-confs))) | |
(cur-window-conf | |
(assoc 'window-configuration | |
(assoc num (assoc 'screen-property frame-confs)))) | |
(marker (nth 2 cur-window-conf))) | |
(marker-buffer marker)) | |
(nth 1 | |
(assoc 'buffer-list | |
(nth 1 (nth 1 (current-frame-configuration)))))) | |
default-directory))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment