summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--lisp/acdw.el13
1 files changed, 13 insertions, 0 deletions
diff --git a/lisp/acdw.el b/lisp/acdw.el index 472b4ab..d3b0bf9 100644 --- a/lisp/acdw.el +++ b/lisp/acdw.el
@@ -671,5 +671,18 @@ When called with PREFIX, just kill Emacs without confirmation."
671 (ignore-errors 671 (ignore-errors
672 (delete-frame)))) 672 (delete-frame))))
673 673
674
675;;; cribbed
676
677;; https://jao.io/blog/2021-09-08-high-signal-to-noise-emacs-command.html
678(defun jao-buffer-same-mode (&rest modes)
679 "Pop to a buffer with a mode among MODES, or the current one if not given."
680 (interactive)
681 (let* ((modes (or modes (list major-mode)))
682 (pred (lambda (b)
683 (let ((b (get-buffer (if (consp b) (car b) b))))
684 (member (buffer-local-value 'major-mode b) modes)))))
685 (pop-to-buffer (read-buffer "Buffer: " nil t pred))))
686
674(provide 'acdw) 687(provide 'acdw)
675;;; acdw.el ends here 688;;; acdw.el ends here