From: Lars Ingebrigtsen Date: Mon, 5 Jul 2021 13:09:45 +0000 (+0200) Subject: Make `bookmark--unfontify' more robust X-Git-Tag: emacs-28.0.90~1954 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=62fbeed9a91429a852fed882d8bf30bc04377bf0;p=emacs.git Make `bookmark--unfontify' more robust * lisp/bookmark.el (bookmark--unfontify): Don't bug out if there's no fontification recorded (bug#49341). --- diff --git a/lisp/bookmark.el b/lisp/bookmark.el index 31e41a9273c..52b96fd2038 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.