GNU bug report logs - #49341
28.0.50; bookmark--unfontify with nil filename throws wrong-type error

Previous Next

Package: emacs;

Reported by: Trey Peacock <gpg <at> treypeacock.com>

Date: Fri, 2 Jul 2021 21:09:02 UTC

Severity: normal

Tags: moreinfo

Found in version 28.0.50

Fixed in version 28.1

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 49341 in the body.
You can then email your comments to 49341 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#49341; Package emacs. (Fri, 02 Jul 2021 21:09:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Trey Peacock <gpg <at> treypeacock.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Fri, 02 Jul 2021 21:09:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Trey Peacock <gpg <at> treypeacock.com>
To: bug-gnu-emacs <at> gnu.org
Subject: 28.0.50; bookmark--unfontify with nil filename throws wrong-type error
Date: Fri, 02 Jul 2021 21:08:06 +0000
I am unable to use `bookmark-delete` with bookmarks that do not return
alist values for 'filename or 'position when called with
`bookmark-get-bookmark`. I believe it is due to the May 4th commit
ab6cb65cb2b6d11a7b690dfcea8d98611290fad9 where bookmark--unfontify was
introduced. The unfontify function is unable to handle nil values for
these fields and results in calling `(overlay-at pos)` which shows a
wrong-type error.



--
Trey Peacock
treypeacock.com





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#49341; Package emacs. (Sat, 03 Jul 2021 06:10:01 GMT) Full text and rfc822 format available.

Message #8 received at 49341 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Trey Peacock <gpg <at> treypeacock.com>, Boruch Baum <boruch_baum <at> gmx.com>
Cc: 49341 <at> debbugs.gnu.org
Subject: Re: bug#49341: 28.0.50;
 bookmark--unfontify with nil filename throws wrong-type error
Date: Sat, 03 Jul 2021 09:08:58 +0300
> Date: Fri, 02 Jul 2021 21:08:06 +0000
> From: Trey Peacock <gpg <at> treypeacock.com>
> 
> I am unable to use `bookmark-delete` with bookmarks that do not return
> alist values for 'filename or 'position when called with
> `bookmark-get-bookmark`.

Can you show a recipe for reproducing the problem, please?

> I believe it is due to the May 4th commit
> ab6cb65cb2b6d11a7b690dfcea8d98611290fad9 where bookmark--unfontify
> was introduced. The unfontify function is unable to handle nil
> values for these fields and results in calling `(overlay-at pos)`
> which shows a wrong-type error.

Boruch, could you please take a look?

Thanks.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#49341; Package emacs. (Sat, 03 Jul 2021 07:24:02 GMT) Full text and rfc822 format available.

Message #11 received at 49341 <at> debbugs.gnu.org (full text, mbox):

From: Trey Peacock <gpg <at> treypeacock.com>
To: Eli Zaretskii <eliz <at> gnu.org>, Boruch Baum <boruch_baum <at> gmx.com>
Cc: 49341 <at> debbugs.gnu.org
Subject: Re: bug#49341: 28.0.50;
 bookmark--unfontify with nil filename throws wrong-type error
Date: Sat, 03 Jul 2021 07:23:32 +0000
"Eli Zaretskii" <eliz <at> gnu.org> writes:

> Can you show a recipe for reproducing the problem, please?

emacs -Q -l temp.el

temp.el

```
(require 'package)
(add-to-list 'package-archives
             '("melpa" . "https://melpa.org/packages/") t)

(package-initialize)
(package-install 'use-package)
(package-install 'quelpa-use-package)
(quelpa
 '(quelpa-use-package
   :fetcher git
   :url "https://github.com/quelpa/quelpa-use-package.git"))
(require 'quelpa-use-package)
(use-package burly
  :quelpa (burly :fetcher github :repo "alphapapa/burly.el"))

(split-window-horizontally)
(switch-to-buffer "*Messages*")
(burly-bookmark-windows "temp")
(bookmark-delete "temp-book")
```

This should throw the wrong type error.





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#49341; Package emacs. (Sun, 04 Jul 2021 13:58:02 GMT) Full text and rfc822 format available.

Message #14 received at 49341 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Trey Peacock <gpg <at> treypeacock.com>
Cc: Eli Zaretskii <eliz <at> gnu.org>, Boruch Baum <boruch_baum <at> gmx.com>,
 49341 <at> debbugs.gnu.org
Subject: Re: bug#49341: 28.0.50; bookmark--unfontify with nil filename
 throws wrong-type error
Date: Sun, 04 Jul 2021 15:56:57 +0200
Trey Peacock <gpg <at> treypeacock.com> writes:

> This should throw the wrong type error.

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

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#49341; Package emacs. (Sun, 04 Jul 2021 16:32:01 GMT) Full text and rfc822 format available.

Message #17 received at 49341 <at> debbugs.gnu.org (full text, mbox):

From: Trey Peacock <gpg <at> treypeacock.com>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: Eli Zaretskii <eliz <at> gnu.org>, Boruch Baum <boruch_baum <at> gmx.com>,
 49341 <at> debbugs.gnu.org
Subject: Re: 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 <at> 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)`.





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#49341; Package emacs. (Sun, 04 Jul 2021 17:14:01 GMT) Full text and rfc822 format available.

Message #20 received at 49341 <at> debbugs.gnu.org (full text, mbox):

From: Boruch Baum <boruch_baum <at> gmx.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: Trey Peacock <gpg <at> treypeacock.com>, 49341 <at> debbugs.gnu.org
Subject: Re: bug#49341: 28.0.50; bookmark--unfontify with nil filename throws
 wrong-type error
Date: Sun, 4 Jul 2021 13:12:59 -0400
On 2021-07-03 09:08, Eli Zaretskii wrote:
> Boruch, could you please take a look?

Basil has owned this, since[1].

See my specific warning to him about this very condition[2].

Both 2021-05-05.

[1] https://debbugs.gnu.org/cgi/bugreport.cgi?bug=48179#66
[2] https://debbugs.gnu.org/cgi/bugreport.cgi?bug=48179#72

--
hkp://keys.gnupg.net
CA45 09B5 5351 7C11 A9D1  7286 0036 9E45 1595 8BC0




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#49341; Package emacs. (Sun, 04 Jul 2021 18:36:02 GMT) Full text and rfc822 format available.

Message #23 received at 49341 <at> debbugs.gnu.org (full text, mbox):

From: "Basil L. Contovounesios" <contovob <at> tcd.ie>
To: Boruch Baum <boruch_baum <at> gmx.com>
Cc: Eli Zaretskii <eliz <at> gnu.org>, Trey Peacock <gpg <at> treypeacock.com>,
 49341 <at> debbugs.gnu.org
Subject: Re: bug#49341: 28.0.50; bookmark--unfontify with nil filename
 throws wrong-type error
Date: Sun, 04 Jul 2021 19:35:37 +0100
Boruch Baum <boruch_baum <at> gmx.com> writes:

> On 2021-07-03 09:08, Eli Zaretskii wrote:
>> Boruch, could you please take a look?
>
> Basil has owned this, since[1].

No he has not, he is confused about the origin of this bizarre idea, and
he has repeatedly explained as much in the very same discussion:

https://bugs.gnu.org/48179#129
https://bugs.gnu.org/48179#135
https://bugs.gnu.org/48179#141

The entire extent of Basil's practical involvement in this feature has
been and wishes to remain a handful of minor documentation and style
fixes:

; Fix and simplify last change in bookmark.el.
7d0067f297 2021-05-04 10:54:24 +0100
https://git.sv.gnu.org/cgit/emacs.git/commit/?id=7d0067f297b131c98a5198eb52d49891a83ac5aa

> See my specific warning to him about this very condition[2].
>
> Both 2021-05-05.
>
> [1] https://debbugs.gnu.org/cgi/bugreport.cgi?bug=48179#66
> [2] https://debbugs.gnu.org/cgi/bugreport.cgi?bug=48179#72

Thanks,

-- 
Basil




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#49341; Package emacs. (Mon, 05 Jul 2021 13:11:01 GMT) Full text and rfc822 format available.

Message #26 received at 49341 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Trey Peacock <gpg <at> treypeacock.com>
Cc: Eli Zaretskii <eliz <at> gnu.org>, Boruch Baum <boruch_baum <at> gmx.com>,
 49341 <at> debbugs.gnu.org
Subject: Re: bug#49341: 28.0.50; bookmark--unfontify with nil filename
 throws wrong-type error
Date: Mon, 05 Jul 2021 15:10:26 +0200
Trey Peacock <gpg <at> treypeacock.com> writes:

> "Lars Ingebrigtsen" <larsi <at> 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")

Thanks; I've now pushed a change that should make `bookmark--unfontify'
more robust.  Can you check whether this fixes this problem?

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Added tag(s) moreinfo. Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Mon, 05 Jul 2021 13:11:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#49341; Package emacs. (Mon, 05 Jul 2021 16:37:02 GMT) Full text and rfc822 format available.

Message #31 received at 49341 <at> debbugs.gnu.org (full text, mbox):

From: Trey Peacock <gpg <at> treypeacock.com>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: Eli Zaretskii <eliz <at> gnu.org>, Boruch Baum <boruch_baum <at> gmx.com>,
 49341 <at> debbugs.gnu.org
Subject: Re: bug#49341: 28.0.50;
 bookmark--unfontify with nil filename throws wrong-type error
Date: Mon, 05 Jul 2021 16:35:49 +0000
"Lars Ingebrigtsen" <larsi <at> gnus.org> writes:

> Thanks; I've now pushed a change that should make `bookmark--unfontify'
> more robust.  Can you check whether this fixes this problem?

Yes, this change has fixed the issue I was seeing. Thanks!





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#49341; Package emacs. (Mon, 05 Jul 2021 19:48:01 GMT) Full text and rfc822 format available.

Message #34 received at 49341 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Trey Peacock <gpg <at> treypeacock.com>
Cc: Eli Zaretskii <eliz <at> gnu.org>, Boruch Baum <boruch_baum <at> gmx.com>,
 49341 <at> debbugs.gnu.org
Subject: Re: bug#49341: 28.0.50; bookmark--unfontify with nil filename
 throws wrong-type error
Date: Mon, 05 Jul 2021 21:47:10 +0200
Trey Peacock <gpg <at> treypeacock.com> writes:

> "Lars Ingebrigtsen" <larsi <at> gnus.org> writes:
>
>> Thanks; I've now pushed a change that should make `bookmark--unfontify'
>> more robust.  Can you check whether this fixes this problem?
>
> Yes, this change has fixed the issue I was seeing. Thanks!

Thanks for checking; I'm closing this bug report, then.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




bug marked as fixed in version 28.1, send any further explanations to 49341 <at> debbugs.gnu.org and Trey Peacock <gpg <at> treypeacock.com> Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Mon, 05 Jul 2021 19:48:01 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Tue, 03 Aug 2021 11:24:07 GMT) Full text and rfc822 format available.

This bug report was last modified 2 years and 238 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.