From 69c3ddf33a7938b92d3c8979582c12a8ccc5806d Mon Sep 17 00:00:00 2001 From: Peng Li Date: Sat, 2 Jul 2016 21:30:03 +0800 Subject: [PATCH] emacs - fix bug of sd/toggle-eshell-here default-directory --- emacs.d/config.org | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/emacs.d/config.org b/emacs.d/config.org index 91b18bd..20411af 100644 --- a/emacs.d/config.org +++ b/emacs.d/config.org @@ -1271,15 +1271,17 @@ Quickly start eshll in split window below, refer [[http://www.howardism.org/Tech (delete-window) (select-window (sd/window-has-eshell))) (progn - (split-window-vertically (- (/ (window-total-height) 3))) - (other-window 1) - (unless (and (boundp 'eshell-buffer-name) (get-buffer eshell-buffer-name)) - (eshell)) - (switch-to-buffer eshell-buffer-name) - (goto-char (point-max)) - (eshell-kill-input) - (insert (format "cd %s" default-directory)) - (eshell-send-input)))) + (let ((dir default-directory)) + + (split-window-vertically (- (/ (window-total-height) 3))) + (other-window 1) + (unless (and (boundp 'eshell-buffer-name) (get-buffer eshell-buffer-name)) + (eshell)) + (switch-to-buffer eshell-buffer-name) + (goto-char (point-max)) + (eshell-kill-input) + (insert (format "cd %s" dir)) + (eshell-send-input))))) (global-unset-key (kbd "M-`")) (global-set-key (kbd "M-`") 'sd/toggle-eshell-here) -- 2.11.0