emacs-diffs
[Top][All Lists]
Advanced

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

master 142961b 1/2: When bookmark is overwritten, unfontify its previous


From: Lars Ingebrigtsen
Subject: master 142961b 1/2: When bookmark is overwritten, unfontify its previous position
Date: Sun, 25 Jul 2021 06:23:39 -0400 (EDT)

branch: master
commit 142961bcdfb202ca3347a085e55c87b164bb2fb9
Author: Christopher League <league@contrapunctus.net>
Commit: Lars Ingebrigtsen <larsi@gnus.org>

    When bookmark is overwritten, unfontify its previous position
    
    * lisp/bookmark.el (bookmark-store): When the bookmark-fontify option
    is non-nil, setting or jumping to bookmarks will colorize them using
    `bookmark-face'.  With this change, overwriting a bookmark will remove
    the fontification at its former position (bug#49725).
---
 lisp/bookmark.el | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/lisp/bookmark.el b/lisp/bookmark.el
index 52b96fd..ff9b8ab 100644
--- a/lisp/bookmark.el
+++ b/lisp/bookmark.el
@@ -561,10 +561,14 @@ old one."
     (set-text-properties 0 (length stripped-name) nil stripped-name)
     (if (and (not no-overwrite)
              (bookmark-get-bookmark stripped-name 'noerror))
-        ;; already existing bookmark under that name and
-        ;; no prefix arg means just overwrite old bookmark
-        ;; Use the new (NAME . ALIST) format.
-        (setcdr (bookmark-get-bookmark stripped-name) alist)
+        ;; Already existing bookmark under that name and
+        ;; no prefix arg means just overwrite old bookmark.
+        (let ((bm (bookmark-get-bookmark stripped-name)))
+          ;; First clean up if previously location was fontified.
+          (when bookmark-fontify
+            (bookmark--unfontify bm))
+          ;; Modify using the new (NAME . ALIST) format.
+          (setcdr bm alist))
 
       ;; otherwise just cons it onto the front (either the bookmark
       ;; doesn't exist already, or there is no prefix arg.  In either



reply via email to

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