summaryrefslogtreecommitdiffhomepage
path: root/init.org
diff options
context:
space:
mode:
Diffstat (limited to 'init.org')
-rw-r--r--init.org4
1 files changed, 2 insertions, 2 deletions
diff --git a/init.org b/init.org
index acb9342..c0f1016 100644
--- a/init.org
+++ b/init.org
@@ -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