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." the buffer if it is being displayed in another window."
(interactive) (interactive)
(let (new-dir) (let (new-dir)
(cond ((string-match-p "^\\*scratch\\*" (buffer-name)) (if (string-match-p "^\\*scratch\\*" (buffer-name))
(erase-buffer)) (message "Already in the scratch buffer")
(t (setq new-dir (narf/project-root))
(setq new-dir (narf/project-root)) (if (> (length (get-buffer-window-list (current-buffer) nil nil)) 1)
(if (> (length (get-buffer-window-list (current-buffer) nil nil)) 1) (bury-buffer)
(bury-buffer) (kill-this-buffer)))
(kill-this-buffer))))
(if (narf/popup-p (selected-window)) (if (narf/popup-p (selected-window))
(narf/popup-close) (narf/popup-close)
(unless (narf/real-buffer-p (current-buffer)) (unless (narf/real-buffer-p (current-buffer))