From 48be4bb23e430b1bb96a83b2d6d464328ebfd14e Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Fri, 22 Jan 2016 19:28:14 -0500 Subject: [PATCH] Update scratch buffer PWD on kill-buffer --- core/lib/defuns-buffers.el | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/core/lib/defuns-buffers.el b/core/lib/defuns-buffers.el index 633e49857..8fe9d739a 100644 --- a/core/lib/defuns-buffers.el +++ b/core/lib/defuns-buffers.el @@ -163,14 +163,17 @@ left, create a scratch buffer." (continue t)) (if (or (= realc 0) (and (= realc 1) (eq (car real-buffers) (current-buffer)))) - (progn (switch-to-buffer "*scratch*") - (message "Nowhere to go")) + (progn + (narf|update-scratch-buffer-cwd) + (switch-to-buffer "*scratch*") + (message "Nowhere to go")) (funcall move-func) (while (and continue (< i max)) (let ((current-buffer (current-buffer))) (cond ((eq current-buffer start-buffer) - (if scratch-default - (switch-to-buffer "*scratch*")) + (when scratch-default + (narf|update-scratch-buffer-cwd) + (switch-to-buffer "*scratch*")) (setq continue nil)) ((not (memq current-buffer real-buffers)) (funcall move-func))