emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/consult b9c5d9e816 1/2: Remove bookmark preview message


From: ELPA Syncer
Subject: [elpa] externals/consult b9c5d9e816 1/2: Remove bookmark preview messages (Fix #414)
Date: Thu, 4 Aug 2022 04:57:25 -0400 (EDT)

branch: externals/consult
commit b9c5d9e816c498231b61a15f870dc166a26d1d46
Author: Daniel Mendler <mail@daniel-mendler.de>
Commit: Daniel Mendler <mail@daniel-mendler.de>

    Remove bookmark preview messages (Fix #414)
    
    The message "No preview for <bookmark-type>" occurs way too often. 
Therefore we
    better remove it entirely. Preview error messages in exceptional situations 
are
    kept.
---
 consult-xref.el |  3 +--
 consult.el      | 19 +++++++++----------
 2 files changed, 10 insertions(+), 12 deletions(-)

diff --git a/consult-xref.el b/consult-xref.el
index 6a0dc03bc2..2494efe591 100644
--- a/consult-xref.el
+++ b/consult-xref.el
@@ -75,8 +75,7 @@
                          (xref-location-line loc)
                          (if (eq type 'xref-file-location)
                              (xref-file-location-column loc)
-                           0)))
-                       (_ (message "No preview for %s" type) nil)))))))))
+                           0)))))))))))
 
 (defun consult-xref--group (cand transform)
   "Return title for CAND or TRANSFORM the candidate."
diff --git a/consult.el b/consult.el
index 65a70529ca..aff1553c4a 100644
--- a/consult.el
+++ b/consult.el
@@ -3507,16 +3507,15 @@ There exists no equivalent of this command in Emacs 28."
         (funcall open))
       (funcall
        preview action
-       (when-let (bm (and cand (eq action 'preview) (assoc cand 
bookmark-alist)))
-         (let ((handler (or (bookmark-get-handler bm) 
#'bookmark-default-handler)))
-           ;; Only preview bookmarks with the default handler.
-           (if-let* ((file (and (eq handler #'bookmark-default-handler)
-                                (bookmark-get-filename bm)))
-                     (pos (bookmark-get-position bm))
-                     (buf (funcall open file)))
-               (set-marker (make-marker) pos buf)
-             (message "No preview for %s" handler)
-             nil)))))))
+       ;; Only preview bookmarks with the default handler.
+       (when-let* ((bm (and cand (eq action 'preview) (assoc cand 
bookmark-alist)))
+                   (handler (bookmark-get-handler bm))
+                   (file (and (or (not handler)
+                                  (eq handler #'bookmark-default-handler))
+                              (bookmark-get-filename bm)))
+                   (pos (bookmark-get-position bm))
+                   (buf (funcall open file)))
+         (set-marker (make-marker) pos buf))))))
 
 (defun consult--bookmark-action (bm)
   "Open BM via `consult--buffer-action'."



reply via email to

[Prev in Thread] Current Thread [Next in Thread]