Don't erase scratch buffer

This commit is contained in:
Henrik Lissner 2016-04-19 03:17:16 -04:00
parent 4c52462282
commit 17590a394b

View File

@ -96,13 +96,12 @@ Inspired from http://demonastery.org/2013/04/emacs-evil-narrow-region/"
the buffer if it is being displayed in another window."
(interactive)
(let (new-dir)
(cond ((string-match-p "^\\*scratch\\*" (buffer-name))
(erase-buffer))
(t
(setq new-dir (narf/project-root))
(if (> (length (get-buffer-window-list (current-buffer) nil nil)) 1)
(bury-buffer)
(kill-this-buffer))))
(if (string-match-p "^\\*scratch\\*" (buffer-name))
(message "Already in the scratch buffer")
(setq new-dir (narf/project-root))
(if (> (length (get-buffer-window-list (current-buffer) nil nil)) 1)
(bury-buffer)
(kill-this-buffer)))
(if (narf/popup-p (selected-window))
(narf/popup-close)
(unless (narf/real-buffer-p (current-buffer))