bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#38740: 28.0.50; cursor-sensor-mode error in post-command-hook


From: Federico Tedin
Subject: bug#38740: 28.0.50; cursor-sensor-mode error in post-command-hook
Date: Mon, 17 Feb 2020 22:04:36 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (darwin)

Eli Zaretskii <eliz@gnu.org> writes:

>> From: Federico Tedin <federicotedin@gmail.com>
>> Date: Wed, 05 Feb 2020 21:24:35 +0100
>> Cc: 38740@debbugs.gnu.org
>> 
>> > Evaluating next form in scratch buffer:
>> >
>> >     (with-help-window "TEST"
>> >       (set-buffer standard-output)
>> >       (cursor-sensor-mode 1)
>> >       (insert "here"))
>> >
>> > Results in error:
>> >
>> >     Error in post-command-hook (cursor-sensor--detect): (args-out-of-range 
>> > 354582)
>> >
>> > Looks like cursor-sensor uses scratch's window instead of "TEST" buffer 
>> > window.
>> >
>> > I do not remember getting such error in Emacs 26, 27
>> 
>> I found that `cursor-sensor--detect' reads the point position from the
>> buffer displayed in the selected window, and then tries to read text
>> properties in that position in the current buffer. In your example,
>> those two buffers are not the same, the buffer at `standard-output'
>> isn't being displayed yet. I'm attaching a short patch that checks for
>> this case.
>
> LGTM, thanks.

I'm attaching the patch again but with the correct commit message
formatting.

- Fede

Attachment: 0001-Fix-cursor-sensor-detect-when-current-buf-selected-w.patch
Description: patch


reply via email to

[Prev in Thread] Current Thread [Next in Thread]