diff options
Diffstat (limited to 'init.org')
-rw-r--r-- | init.org | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -1034,7 +1034,7 @@ #+end_src *** same mode #+begin_src emacs-lisp - (defun jao-buffer-same-mode (&optional mode pre-fn) + (defun jao-buffer-same-mode (&optional mode pre-fn switch-fn) (interactive) (let* ((mode (or mode major-mode)) (modes (if (symbolp mode) (list mode) mode)) @@ -1044,7 +1044,7 @@ ',modes)))) (buff (read-buffer "Buffer: " nil t pred))) (when pre-fn (funcall pre-fn)) - (pop-to-buffer buff))) + (if switch-fn (funcall switch-fn buff) (pop-to-buffer buff)))) (global-set-key (kbd "C-c C-b") #'jao-buffer-same-mode) #+end_src *** projects |