GNU bug report logs - #69259
30.0.50; (get-pos-property 9483 'cursor-intangible) gives args-out-of-range error in folded magit buffer

Previous Next

Package: emacs;

Reported by: StrawberryTea <look <at> strawberrytea.xyz>

Date: Sun, 18 Feb 2024 21:19:02 UTC

Severity: normal

Found in version 30.0.50

Done: Eli Zaretskii <eliz <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


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

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 69259 <at> debbugs.gnu.org, Jonas Bernoulli <jonas <at> bernoul.li>,
 StrawberryTea <look <at> strawberrytea.xyz>
Subject: Re: bug#69259: 30.0.50; (get-pos-property 9483 'cursor-intangible)
 gives args-out-of-range error in folded magit buffer
Date: Wed, 21 Feb 2024 09:30:06 -0500
Eli wrote:
> I think cursor-sensor is written under the assumption that the
> selected window's buffer is also the current buffer, and if so,
> magit-post-command-hook should abide by that protocol.  Stefan, am I
> right?

Not `cursor-sensor.el` in its entirety, but
`cursor-sensor-move-to-tangible` presumes that it is called with the
current-buffer already set to (window-buffer window).

StrawberryTea wrote:
> Why exactly are the window-buffer and the current-buffer different?

Good question.  AFAIK the code that runs `post-command-hook` normally
tries to avoid such situations.

> I think this has to do with persp-mode.  My guess is that when it sets
> the new window configuration, the current-buffer is not updated to the
> new window’s buffer immediately.

Could be a "bad citizen" on `post-command-hook`, indeed, which messes up
subsequent functions on the hook.  Maybe the code that runs
`post-command-hook` should be more careful to (re)set current-buffer
after each function, but it seems easier to fix the rare functions which
mess it up.


        Stefan





This bug report was last modified 1 year and 145 days ago.

Previous Next


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