From 56e3bafd57484e43455cac9ca5ced7ab374b5c59 Mon Sep 17 00:00:00 2001 From: Magic_RB Date: Sat, 16 Sep 2023 20:11:39 +0200 Subject: [PATCH] Fix issue with ~dirvish-ignore-display-buffer~ When ~dirvish-ignore-display-buffer~ was called with a buffer name which does not exists (why?) it would throw an error. This broke ~lv-message~ among other things. Signed-off-by: Magic_RB --- emacs-lisp/dirvish.org | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/emacs-lisp/dirvish.org b/emacs-lisp/dirvish.org index ffb4af7..692dbca 100644 --- a/emacs-lisp/dirvish.org +++ b/emacs-lisp/dirvish.org @@ -99,11 +99,12 @@ Dirvish has an issue with ~switch-to-buffer-obey-display-actions~, so advise ~sw #+begin_src emacs-lisp :tangle no (defun dirvish-side-buffer-p (buffer-or-name) "Return t if BUFFER-OR-NAME is a dirvish buffer and a side buffer." - (with-current-buffer buffer-or-name - (let ((dv (dirvish-curr))) + (when (get-buffer buffer-or-name) + (with-current-buffer buffer-or-name + (let ((dv (dirvish-curr))) (if (and dv (member 'side (dv-type dv))) t - nil)))) + nil))))) (defun dirvish-ignore-display-buffer (original-function buffer-or-name &rest original-arguments) (let ((switch-to-buffer-obey-display-actions (not (dirvish-side-buffer-p buffer-or-name))))