unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#49341: 28.0.50; bookmark--unfontify with nil filename throws wrong-type error
@ 2021-07-02 21:08 Trey Peacock
  2021-07-03  6:08 ` Eli Zaretskii
  0 siblings, 1 reply; 10+ messages in thread
From: Trey Peacock @ 2021-07-02 21:08 UTC (permalink / raw)
  To: 49341


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






^ permalink raw reply	[flat|nested] 10+ messages in thread

* bug#49341: 28.0.50; bookmark--unfontify with nil filename throws wrong-type error
  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 17:12   ` Boruch Baum
  0 siblings, 2 replies; 10+ messages in thread
From: Eli Zaretskii @ 2021-07-03  6:08 UTC (permalink / raw)
  To: Trey Peacock, Boruch Baum; +Cc: 49341

> Date: Fri, 02 Jul 2021 21:08:06 +0000
> From: Trey Peacock <gpg@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.





^ permalink raw reply	[flat|nested] 10+ messages in thread

* bug#49341: 28.0.50; bookmark--unfontify with nil filename throws wrong-type error
  2021-07-03  6:08 ` Eli Zaretskii
@ 2021-07-03  7:23   ` Trey Peacock
  2021-07-04 13:56     ` Lars Ingebrigtsen
  2021-07-04 17:12   ` Boruch Baum
  1 sibling, 1 reply; 10+ messages in thread
From: Trey Peacock @ 2021-07-03  7:23 UTC (permalink / raw)
  To: Eli Zaretskii, Boruch Baum; +Cc: 49341

"Eli Zaretskii" <eliz@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.






^ permalink raw reply	[flat|nested] 10+ messages in thread

* bug#49341: 28.0.50; bookmark--unfontify with nil filename throws wrong-type error
  2021-07-03  7:23   ` Trey Peacock
@ 2021-07-04 13:56     ` Lars Ingebrigtsen
  2021-07-04 16:31       ` Trey Peacock
  0 siblings, 1 reply; 10+ messages in thread
From: Lars Ingebrigtsen @ 2021-07-04 13:56 UTC (permalink / raw)
  To: Trey Peacock; +Cc: Boruch Baum, 49341

Trey Peacock <gpg@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





^ permalink raw reply	[flat|nested] 10+ messages in thread

* bug#49341: 28.0.50; bookmark--unfontify with nil filename throws wrong-type error
  2021-07-04 13:56     ` Lars Ingebrigtsen
@ 2021-07-04 16:31       ` Trey Peacock
  2021-07-05 13:10         ` Lars Ingebrigtsen
  0 siblings, 1 reply; 10+ messages in thread
From: Trey Peacock @ 2021-07-04 16:31 UTC (permalink / raw)
  To: Lars Ingebrigtsen; +Cc: Boruch Baum, 49341

"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)`.






^ permalink raw reply	[flat|nested] 10+ messages in thread

* bug#49341: 28.0.50; bookmark--unfontify with nil filename throws wrong-type error
  2021-07-03  6:08 ` Eli Zaretskii
  2021-07-03  7:23   ` Trey Peacock
@ 2021-07-04 17:12   ` Boruch Baum
  2021-07-04 18:35     ` Basil L. Contovounesios
  1 sibling, 1 reply; 10+ messages in thread
From: Boruch Baum @ 2021-07-04 17:12 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: Trey Peacock, 49341

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





^ permalink raw reply	[flat|nested] 10+ messages in thread

* bug#49341: 28.0.50; bookmark--unfontify with nil filename throws wrong-type error
  2021-07-04 17:12   ` Boruch Baum
@ 2021-07-04 18:35     ` Basil L. Contovounesios
  0 siblings, 0 replies; 10+ messages in thread
From: Basil L. Contovounesios @ 2021-07-04 18:35 UTC (permalink / raw)
  To: Boruch Baum; +Cc: Trey Peacock, 49341

Boruch Baum <boruch_baum@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





^ permalink raw reply	[flat|nested] 10+ messages in thread

* bug#49341: 28.0.50; bookmark--unfontify with nil filename throws wrong-type error
  2021-07-04 16:31       ` Trey Peacock
@ 2021-07-05 13:10         ` Lars Ingebrigtsen
  2021-07-05 16:35           ` Trey Peacock
  0 siblings, 1 reply; 10+ messages in thread
From: Lars Ingebrigtsen @ 2021-07-05 13:10 UTC (permalink / raw)
  To: Trey Peacock; +Cc: Boruch Baum, 49341

Trey Peacock <gpg@treypeacock.com> writes:

> "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")

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





^ permalink raw reply	[flat|nested] 10+ messages in thread

* bug#49341: 28.0.50; bookmark--unfontify with nil filename throws wrong-type error
  2021-07-05 13:10         ` Lars Ingebrigtsen
@ 2021-07-05 16:35           ` Trey Peacock
  2021-07-05 19:47             ` Lars Ingebrigtsen
  0 siblings, 1 reply; 10+ messages in thread
From: Trey Peacock @ 2021-07-05 16:35 UTC (permalink / raw)
  To: Lars Ingebrigtsen; +Cc: Boruch Baum, 49341

"Lars Ingebrigtsen" <larsi@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!






^ permalink raw reply	[flat|nested] 10+ messages in thread

* bug#49341: 28.0.50; bookmark--unfontify with nil filename throws wrong-type error
  2021-07-05 16:35           ` Trey Peacock
@ 2021-07-05 19:47             ` Lars Ingebrigtsen
  0 siblings, 0 replies; 10+ messages in thread
From: Lars Ingebrigtsen @ 2021-07-05 19:47 UTC (permalink / raw)
  To: Trey Peacock; +Cc: Boruch Baum, 49341

Trey Peacock <gpg@treypeacock.com> writes:

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





^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2021-07-05 19:47 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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
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

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).