[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#49341: 28.0.50; bookmark--unfontify with nil filename throws wrong-t

From: Trey Peacock
Subject: bug#49341: 28.0.50; bookmark--unfontify with nil filename throws wrong-type error
Date: Sun, 04 Jul 2021 16:31:13 +0000

"Lars Ingebrigtsen" <larsi@gnus.org> writes:

> Can you post the backtrace you get, too?  (With `debug-on-error' set.)

Debugger entered--Lisp error: (wrong-type-argument integer-or-marker-p nil)
  bookmark--unfontify(("temp-book" (url
  . "emacs+burly+windows:?%28%28%28min-height%20.%204%2...") (handler
  . burly-bookmark-handler)))
"/home/morpheus/.config/emacs/test-init.el" nil t)
  command-line-1(("-l" "/home/morpheus/.config/emacs/test-init.el"))

(defun bookmark--unfontify (bm)
  "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))
        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)))))))))

The bookmark has no 'filename' in its alist, so the value is nil. When
compared to any non file-backed buffer in the buffer-list that will
cause `(setq overlays (overlay-at pos))`. This results in the error with
`(overlays-at nil)`.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]