Update scratch buffer PWD on kill-buffer

This commit is contained in:
Henrik Lissner 2016-01-22 19:28:14 -05:00
parent 3a1d0b2b47
commit 48be4bb23e

View file

@ -163,14 +163,17 @@ left, create a scratch buffer."
(continue t)) (continue t))
(if (or (= realc 0) (if (or (= realc 0)
(and (= realc 1) (eq (car real-buffers) (current-buffer)))) (and (= realc 1) (eq (car real-buffers) (current-buffer))))
(progn (switch-to-buffer "*scratch*") (progn
(message "Nowhere to go")) (narf|update-scratch-buffer-cwd)
(switch-to-buffer "*scratch*")
(message "Nowhere to go"))
(funcall move-func) (funcall move-func)
(while (and continue (< i max)) (while (and continue (< i max))
(let ((current-buffer (current-buffer))) (let ((current-buffer (current-buffer)))
(cond ((eq current-buffer start-buffer) (cond ((eq current-buffer start-buffer)
(if scratch-default (when scratch-default
(switch-to-buffer "*scratch*")) (narf|update-scratch-buffer-cwd)
(switch-to-buffer "*scratch*"))
(setq continue nil)) (setq continue nil))
((not (memq current-buffer real-buffers)) ((not (memq current-buffer real-buffers))
(funcall move-func)) (funcall move-func))