From 62fbeed9a91429a852fed882d8bf30bc04377bf0 Mon Sep 17 00:00:00 2001 From: Lars Ingebrigtsen Date: Mon, 5 Jul 2021 15:09:45 +0200 Subject: [PATCH] Make `bookmark--unfontify' more robust * lisp/bookmark.el (bookmark--unfontify): Don't bug out if there's no fontification recorded (bug#49341). --- lisp/bookmark.el | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) 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. -- 2.39.2