unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Trey Peacock <gpg@treypeacock.com>
To: Lars Ingebrigtsen <larsi@gnus.org>
Cc: Boruch Baum <boruch_baum@gmx.com>, 49341@debbugs.gnu.org
Subject: bug#49341: 28.0.50; bookmark--unfontify with nil filename throws wrong-type error
Date: Sun, 04 Jul 2021 16:31:13 +0000	[thread overview]
Message-ID: <87sg0uvy63.fsf@treypeacock.com> (raw)
In-Reply-To: <87zgv22ndi.fsf@gnus.org>

"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)))
  bookmark-delete("temp-book")
  load-with-code-conversion("/home/morpheus/.config/emacs/test-init.el" "/home/morpheus/.config/emacs/test-init.el" nil t)
  command-line-1(("-l" "/home/morpheus/.config/emacs/test-init.el"))
  command-line()
  normal-top-level()
```

```
(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	other threads:[~2021-07-04 16:31 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-02 21:08 bug#49341: 28.0.50; bookmark--unfontify with nil filename throws wrong-type error Trey Peacock
2021-07-03  6:08 ` Eli Zaretskii
2021-07-03  7:23   ` Trey Peacock
2021-07-04 13:56     ` Lars Ingebrigtsen
2021-07-04 16:31       ` Trey Peacock [this message]
2021-07-05 13:10         ` Lars Ingebrigtsen
2021-07-05 16:35           ` Trey Peacock
2021-07-05 19:47             ` Lars Ingebrigtsen
2021-07-04 17:12   ` Boruch Baum
2021-07-04 18:35     ` Basil L. Contovounesios

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87sg0uvy63.fsf@treypeacock.com \
    --to=gpg@treypeacock.com \
    --cc=49341@debbugs.gnu.org \
    --cc=boruch_baum@gmx.com \
    --cc=larsi@gnus.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).