Don't change scratch major mode if buffer exists
This commit is contained in:
parent
de7eb40337
commit
a111f4802d
|
@ -879,10 +879,12 @@ is nonempty."
|
|||
(defun spacemacs/switch-to-scratch-buffer ()
|
||||
"Switch to the `*scratch*' buffer. Create it first if needed."
|
||||
(interactive)
|
||||
(let ((exists (get-buffer "*scratch*")))
|
||||
(switch-to-buffer (get-buffer-create "*scratch*"))
|
||||
(when (and (not (eq major-mode dotspacemacs-scratch-mode))
|
||||
(when (and (not exists)
|
||||
(not (eq major-mode dotspacemacs-scratch-mode))
|
||||
(fboundp dotspacemacs-scratch-mode))
|
||||
(funcall dotspacemacs-scratch-mode)))
|
||||
(funcall dotspacemacs-scratch-mode))))
|
||||
|
||||
;; http://stackoverflow.com/questions/11847547/emacs-regexp-count-occurrences
|
||||
(defun how-many-str (regexp str)
|
||||
|
|
Loading…
Reference in a new issue