]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix removal of bookmark's fringe mark in Info and Dired
authorEli Zaretskii <eliz@gnu.org>
Mon, 25 Mar 2024 13:51:07 +0000 (15:51 +0200)
committerEshel Yaron <me@eshelyaron.com>
Wed, 27 Mar 2024 20:38:45 +0000 (21:38 +0100)
* lisp/bookmark.el (bookmark-buffer-file-name): Support Info
buffers.
(bookmark--remove-fringe-mark): Call 'bookmark-buffer-file-name'
instead of using 'buffer-file-name', which could be nil.
(Bug#69974)

(cherry picked from commit 7fba25cf5344f5c3507aedf59e6ae099e7662508)

lisp/bookmark.el

index b9668099d9ca985331c190924aa7e3fc38e59afb..e3feabde5c98782fa134053e7bf4766de4d78648 100644 (file)
@@ -515,10 +515,11 @@ See user option `bookmark-fringe-mark'."
         (non-essential t)
         overlays found temp)
     (when (and pos filename)
-      (setq filename (expand-file-name filename))
+      (setq filename (abbreviate-file-name (expand-file-name filename)))
       (dolist (buf (buffer-list))
         (with-current-buffer buf
-          (when (equal filename buffer-file-name)
+          (when (equal filename
+                       (ignore-errors (bookmark-buffer-file-name)))
             (setq overlays
                   (save-excursion
                     (goto-char pos)
@@ -1249,6 +1250,8 @@ it to the name of the bookmark currently being set, advancing
      (if (stringp dired-directory)
          dired-directory
        (car dired-directory)))
+    ((and (boundp 'Info-current-file) (stringp Info-current-file))
+     Info-current-file)
     (t (error "Buffer not visiting a file or directory")))))
 
 (defvar bookmark--watch-already-asked-mtime nil