]> git.eshelyaron.com Git - emacs.git/commitdiff
Make bookmark fringe marks evaporate
authorLars Ingebrigtsen <larsi@gnus.org>
Wed, 15 Sep 2021 07:58:41 +0000 (09:58 +0200)
committerLars Ingebrigtsen <larsi@gnus.org>
Wed, 15 Sep 2021 07:58:45 +0000 (09:58 +0200)
* lisp/bookmark.el (bookmark--set-fringe-mark): Make the bookmark
evaporate when a buffer is erased (like, for instance, when doing
`revert-buffer' in a vc buffer).

lisp/bookmark.el

index 719fc98f76896c5295bc4e97fbd1538ff151f617..0a079482ca9e19426f4559c13c04337dbb189aa4 100644 (file)
@@ -459,8 +459,9 @@ In other words, return all information but the name."
 (defun bookmark--set-fringe-mark ()
   "Apply a colorized overlay to the bookmarked location.
 See user option `bookmark-set-fringe-mark'."
-  (let ((bm (make-overlay (point-at-bol) (point-at-bol))))
+  (let ((bm (make-overlay (point-at-bol) (1+ (point-at-bol)))))
     (overlay-put bm 'category 'bookmark)
+    (overlay-put bm 'evaporate t)
     (overlay-put bm 'before-string
                  (propertize
                   "x" 'display