emacs-diffs
[Top][All Lists]
Advanced

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

master 62fbeed: Make `bookmark--unfontify' more robust


From: Lars Ingebrigtsen
Subject: master 62fbeed: Make `bookmark--unfontify' more robust
Date: Mon, 5 Jul 2021 09:09:52 -0400 (EDT)

branch: master
commit 62fbeed9a91429a852fed882d8bf30bc04377bf0
Author: Lars Ingebrigtsen <larsi@gnus.org>
Commit: Lars Ingebrigtsen <larsi@gnus.org>

    Make `bookmark--unfontify' more robust
    
    * lisp/bookmark.el (bookmark--unfontify): Don't bug out if there's
    no fontification recorded (bug#49341).
---
 lisp/bookmark.el | 22 +++++++++++-----------
 1 file changed, 11 insertions(+), 11 deletions(-)

diff --git a/lisp/bookmark.el b/lisp/bookmark.el
index 31e41a9..52b96fd 100644
--- a/lisp/bookmark.el
+++ b/lisp/bookmark.el
@@ -467,18 +467,18 @@ See user option `bookmark-fontify'."
   "Remove a bookmark's colorized overlay.
 BM is a bookmark as returned from function `bookmark-get-bookmark'.
 See user option `bookmark-fontify'."
-  (let ((filename (assq 'filename bm))
-        (pos      (assq 'position bm))
+  (let ((filename (cdr (assq 'filename bm)))
+        (pos (cdr (assq 'position bm)))
         overlays found temp)
-    (when filename (setq filename (expand-file-name (cdr filename))))
-    (when pos (setq pos (cdr pos)))
-    (dolist (buf (buffer-list))
-      (with-current-buffer buf
-        (when (equal filename buffer-file-name)
-          (setq overlays (overlays-at pos))
-          (while (and (not found) (setq temp (pop overlays)))
-            (when (eq 'bookmark (overlay-get temp 'category))
-              (delete-overlay (setq found temp)))))))))
+    (when (and pos filename)
+      (setq filename (expand-file-name filename))
+      (dolist (buf (buffer-list))
+        (with-current-buffer buf
+          (when (equal filename buffer-file-name)
+            (setq overlays (overlays-at pos))
+            (while (and (not found) (setq temp (pop overlays)))
+              (when (eq 'bookmark (overlay-get temp 'category))
+                (delete-overlay (setq found temp))))))))))
 
 (defun bookmark-completing-read (prompt &optional default)
   "Prompting with PROMPT, read a bookmark name in completion.



reply via email to

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