From: Eli Zaretskii <eliz@gnu.org>
To: StrawberryTea <look@strawberrytea.xyz>,
Stefan Monnier <monnier@iro.umontreal.ca>
Cc: 69259@debbugs.gnu.org, Jonas Bernoulli <jonas@bernoul.li>
Subject: 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 14:31:21 +0200 [thread overview]
Message-ID: <86zfvum21y.fsf@gnu.org> (raw)
In-Reply-To: <871q97b09m.fsf@strawberrytea.xyz> (message from StrawberryTea on Tue, 20 Feb 2024 09:42:36 -0600)
> From: StrawberryTea <look@strawberrytea.xyz>
> Cc: 69259@debbugs.gnu.org
> Date: Tue, 20 Feb 2024 09:42:36 -0600
>
> Hi Eli. I inserted a print function into magit-post-command-hook:
>
> (defadvice! cae-magit-section-post-command-hook-a (oldfun)
> :around #’magit-section-post-command-hook
> (condition-case e
> (funcall oldfun)
> (error
> (+log “magit-post-command-hook error:”
> (current-buffer) (selected-window) (buffer-narrowed-p) (point-min)
> (point-max) (buffer-size)))))
>
> and it outputted this:
> Values: magit-post-command-hook error:, magit: emacs, #<window 156 on
> *Messages*>, nil, 1, 20993, 20992 Eli Zaretskii <eliz@gnu.org>
>
> So basically, the situation is that the (current-buffer) is magit: emacs whereas
> the window is on \*Messages\* and so when we call (get-pos-property pos
> ’cursor-intangible), it uses a point value from magit: emacs on the messages
> buffer.
>
> Why exactly are the window-buffer and the current-buffer different? 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.
It is more likely that the post-command-hook was somehow invoked
inside with-selected-window or save-window-excursion or something like
that.
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?
next prev parent reply other threads:[~2024-02-21 12:31 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-02-18 21:08 bug#69259: 30.0.50; (get-pos-property 9483 'cursor-intangible) gives args-out-of-range error in folded magit buffer StrawberryTea
2024-02-19 12:27 ` Eli Zaretskii
2024-02-20 15:42 ` StrawberryTea
2024-02-21 12:31 ` Eli Zaretskii [this message]
2024-02-21 14:30 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-02-21 23:29 ` StrawberryTea
2024-02-22 6:42 ` Eli Zaretskii
2024-02-22 15:17 ` Jonas Bernoulli via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-02-22 15:30 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-02-22 17:15 ` StrawberryTea
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=86zfvum21y.fsf@gnu.org \
--to=eliz@gnu.org \
--cc=69259@debbugs.gnu.org \
--cc=jonas@bernoul.li \
--cc=look@strawberrytea.xyz \
--cc=monnier@iro.umontreal.ca \
/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).