aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristopher League2021-07-25 09:37:36 +0200
committerLars Ingebrigtsen2021-07-25 12:23:33 +0200
commit142961bcdfb202ca3347a085e55c87b164bb2fb9 (patch)
tree533ef9d2c8d3e83c61f7d832508040e33f29aba3
parent0577bd0cf9aca220c0ecba217ac9a9522ffa990d (diff)
downloademacs-142961bcdfb202ca3347a085e55c87b164bb2fb9.tar.gz
emacs-142961bcdfb202ca3347a085e55c87b164bb2fb9.zip
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).
-rw-r--r--lisp/bookmark.el12
1 files changed, 8 insertions, 4 deletions
diff --git a/lisp/bookmark.el b/lisp/bookmark.el
index 52b96fd2038..ff9b8ab1388 100644
--- a/lisp/bookmark.el
+++ b/lisp/bookmark.el
@@ -561,10 +561,14 @@ old one."
561 (set-text-properties 0 (length stripped-name) nil stripped-name) 561 (set-text-properties 0 (length stripped-name) nil stripped-name)
562 (if (and (not no-overwrite) 562 (if (and (not no-overwrite)
563 (bookmark-get-bookmark stripped-name 'noerror)) 563 (bookmark-get-bookmark stripped-name 'noerror))
564 ;; already existing bookmark under that name and 564 ;; Already existing bookmark under that name and
565 ;; no prefix arg means just overwrite old bookmark 565 ;; no prefix arg means just overwrite old bookmark.
566 ;; Use the new (NAME . ALIST) format. 566 (let ((bm (bookmark-get-bookmark stripped-name)))
567 (setcdr (bookmark-get-bookmark stripped-name) alist) 567 ;; First clean up if previously location was fontified.
568 (when bookmark-fontify
569 (bookmark--unfontify bm))
570 ;; Modify using the new (NAME . ALIST) format.
571 (setcdr bm alist))
568 572
569 ;; otherwise just cons it onto the front (either the bookmark 573 ;; otherwise just cons it onto the front (either the bookmark
570 ;; doesn't exist already, or there is no prefix arg. In either 574 ;; doesn't exist already, or there is no prefix arg. In either