GNU bug report logs - #38740
28.0.50; cursor-sensor-mode error in post-command-hook

Previous Next

Package: emacs;

Reported by: Evgeny Zajcev <lg.zevlg <at> gmail.com>

Date: Wed, 25 Dec 2019 13:24:02 UTC

Severity: normal

Found in version 28.0.50

Done: Eli Zaretskii <eliz <at> gnu.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 38740 in the body.
You can then email your comments to 38740 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#38740; Package emacs. (Wed, 25 Dec 2019 13:24:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Evgeny Zajcev <lg.zevlg <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Wed, 25 Dec 2019 13:24:02 GMT) Full text and rfc822 format available.

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

From: Evgeny Zajcev <lg.zevlg <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: 28.0.50; cursor-sensor-mode error in post-command-hook
Date: Wed, 25 Dec 2019 16:23:11 +0300
[Message part 1 (text/plain, inline)]
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

Thanks

------
In GNU Emacs 28.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.18.9)
 of 2019-12-25 built on wrt
Repository revision: 7c5d6a2afc6c23a7fff8456f506ee2aa2d37a3b9
Repository branch: master
Windowing system distributor 'The X.Org Foundation', version 11.0.11804000
System Description: Ubuntu 16.04.1 LTS

Recent messages:
Mark set
Mark saved where search started
Mark set
uncompressing help.el.gz...done
Note: file is write protected
uncompressing window.el.gz...done
Note: file is write protected
Mark activated
next-line: End of buffer [2 times]
Mark set [4 times]

Configured using:
 'configure --with-modules'

Configured features:
XPM JPEG TIFF GIF PNG RSVG SOUND DBUS GSETTINGS GLIB NOTIFY INOTIFY
GNUTLS LIBXML2 FREETYPE HARFBUZZ LIBOTF XFT ZLIB TOOLKIT_SCROLL_BARS
GTK3 X11 XDBE XIM MODULES THREADS JSON PDUMPER LCMS2 GMP

Important settings:
  value of $LC_MONETARY: ru_RU.UTF-8
  value of $LC_NUMERIC: ru_RU.UTF-8
  value of $LC_TIME: ru_RU.UTF-8
  value of $LANG: en_US.UTF-8
  locale-coding-system: utf-8-unix

Major mode: Lisp Interaction

Minor modes in effect:
  icomplete-mode: t
  save-place-mode: t
  pyvenv-mode: t
  shell-dirtrack-mode: t
  display-time-mode: t
  global-undo-tree-mode: t
  undo-tree-mode: t
  override-global-mode: t
  cl-old-struct-compat-mode: t
  global-eldoc-mode: t
  eldoc-mode: t
  mouse-wheel-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  column-number-mode: t
  line-number-mode: t
  auto-fill-function: do-auto-fill
  transient-mark-mode: t

Load-path shadows:
/home/lg/.emacs.d/elpa/circe-20180105.1158/tracking hides
/home/lg/.emacs.d/elpa/tracking-20171210.2102/tracking
/home/lg/.emacs.d/elpa/circe-20180105.1158/shorten hides
/home/lg/.emacs.d/elpa/tracking-20171210.2102/shorten

Features:
(shadow sort mail-extr emacsbug sendmail misearch multi-isearch
jka-compr find-func cursor-sensor exwm-wconf winner exwm-misc exwm
exwm-match exwm-input xcb-keysyms exwm-manage exwm-floating xcb-cursor
xcb-render exwm-layout exwm-workspace exwm-core xcb-ewmh xcb-icccm xcb
xcb-xproto xcb-types work desktop frameset gnus-demon nntp gnus-group
gnus-undo gnus-start gnus-cloud nnimap nnmail mail-source utf7 netrc
gnus-spec gnus-win nnoo gnus-int gnus-range message rfc822 mml mml-sec
epa epg epg-config mm-decode mm-bodies mm-encode mailabbrev gmm-utils
mailheader gnus nnheader gnus-util rmail rmail-loaddefs
text-property-search mail-utils autoinsert cal-menu calendar
cal-loaddefs icomplete saveplace cython-mode company-capf company pcase
help-fns radix-tree elpy find-file-in-project ivy delsel ivy-overlay
ffap windmove diff-mode elpy-shell pyvenv elpy-profile elpy-django
elpy-refactor python tramp-sh tramp tramp-loaddefs trampver
tramp-integration tramp-compat parse-time iso8601 time-date ls-lisp
format-spec grep files-x etags fileloop generator xref project cus-edit
cus-start cus-load wid-edit python-mode info-look which-func imenu shell
pcomplete hippie-exp flymake-proc flymake warnings thingatpt compile
cc-cmds cc-engine cc-vars cc-defs dot-mode gist dired dired-loaddefs
gh-gist gh-oauth gh-api logito gh-cache pcache gh-auth gh-url url-http
url-auth mail-parse rfc2231 rfc2047 rfc2045 mm-util ietf-drums
mail-prsvr url-gw nsm rmc puny timezone eieio-base server time
google-translate google-translate-default-ui google-translate-core-ui
google-translate-core google-translate-tk url url-proxy url-privacy
url-expand url-methods url-history url-cookie url-domsuf url-util
mailcap whitespace undo-tree diff ido comint ansi-color ring avoid
ibuffer-vc ibuf-ext ibuffer ibuffer-loaddefs edmacro kmacro
browse-kill-ring derived cl cl-extra help-mode use-package
use-package-ensure use-package-delight use-package-diminish
use-package-bind-key bind-key easy-mmode use-package-core tex-site
gh-common gh-profile rx s marshal eieio-compat dash advice info package
easymenu browse-url url-handlers url-parse auth-source cl-seq eieio
eieio-core cl-macs eieio-loaddefs password-cache json subr-x map
url-vars seq byte-opt gv bytecomp byte-compile cconv cl-loaddefs cl-lib
tooltip eldoc electric uniquify ediff-hook vc-hooks lisp-float-type
mwheel term/x-win x-win term/common-win x-dnd tool-bar dnd fontset image
regexp-opt fringe tabulated-list replace newcomment text-mode elisp-mode
lisp-mode prog-mode register page tab-bar menu-bar rfn-eshadow isearch
timer select scroll-bar mouse jit-lock font-lock syntax facemenu
font-core term/tty-colors frame minibuffer cl-generic cham georgian
utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean
japanese eucjp-ms cp51932 hebrew greek romanian slovak czech european
ethiopic indian cyrillic chinese composite charscript charprop
case-table epa-hook jka-cmpr-hook help simple abbrev obarray
cl-preloaded nadvice loaddefs button faces cus-face macroexp files
text-properties overlay sha1 md5 base64 format env code-pages mule
custom widget hashtable-print-readable backquote threads dbusbind
inotify lcms2 dynamic-setting system-font-setting font-render-setting
move-toolbar gtk x-toolkit x multi-tty make-network-process emacs)

Memory information:
((conses 16 404633 73335)
 (symbols 48 34773 1)
 (strings 32 103486 2565)
 (string-bytes 1 3713081)
 (vectors 16 48517)
 (vector-slots 8 743695 36310)
 (floats 8 263 191)
 (intervals 56 1236 239)
 (buffers 1000 19)
 (heap 1024 38267 2970))

-- 
lg
[Message part 2 (text/html, inline)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#38740; Package emacs. (Wed, 05 Feb 2020 20:25:02 GMT) Full text and rfc822 format available.

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

From: Federico Tedin <federicotedin <at> gmail.com>
To: Evgeny Zajcev <lg.zevlg <at> gmail.com>
Cc: 38740 <at> debbugs.gnu.org
Subject: Re: bug#38740: 28.0.50; cursor-sensor-mode error in post-command-hook
Date: Wed, 05 Feb 2020 21:24:35 +0100
[Message part 1 (text/plain, inline)]
> 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.

- Fede

[cursor.patch (text/x-diff, attachment)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#38740; Package emacs. (Sat, 15 Feb 2020 08:28:02 GMT) Full text and rfc822 format available.

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

From: Eli Zaretskii <eliz <at> gnu.org>
To: Federico Tedin <federicotedin <at> gmail.com>
Cc: lg.zevlg <at> gmail.com, 38740 <at> debbugs.gnu.org
Subject: Re: bug#38740: 28.0.50; cursor-sensor-mode error in post-command-hook
Date: Sat, 15 Feb 2020 10:27:02 +0200
> From: Federico Tedin <federicotedin <at> gmail.com>
> Date: Wed, 05 Feb 2020 21:24:35 +0100
> Cc: 38740 <at> 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.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#38740; Package emacs. (Sat, 15 Feb 2020 12:27:01 GMT) Full text and rfc822 format available.

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

From: Federico Tedin <federicotedin <at> gmail.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: lg.zevlg <at> gmail.com, 38740 <at> debbugs.gnu.org
Subject: Re: bug#38740: 28.0.50; cursor-sensor-mode error in post-command-hook
Date: Sat, 15 Feb 2020 13:26:40 +0100
> LGTM, thanks.

Good to hear. Would it be possible for me get write access to the Git repo?
That way I can install this myself and the Tempo stuff as well (after
addressing the corrections you mentioned). And related to that, this fix
in particular should go into emacs-27, right?

Thanks




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#38740; Package emacs. (Mon, 17 Feb 2020 21:05:02 GMT) Full text and rfc822 format available.

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

From: Federico Tedin <federicotedin <at> gmail.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: lg.zevlg <at> gmail.com, 38740 <at> debbugs.gnu.org
Subject: Re: bug#38740: 28.0.50; cursor-sensor-mode error in post-command-hook
Date: Mon, 17 Feb 2020 22:04:36 +0100
[Message part 1 (text/plain, inline)]
Eli Zaretskii <eliz <at> gnu.org> writes:

>> From: Federico Tedin <federicotedin <at> gmail.com>
>> Date: Wed, 05 Feb 2020 21:24:35 +0100
>> Cc: 38740 <at> 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

[0001-Fix-cursor-sensor-detect-when-current-buf-selected-w.patch (text/x-patch, attachment)]

Reply sent to Eli Zaretskii <eliz <at> gnu.org>:
You have taken responsibility. (Fri, 21 Feb 2020 09:13:01 GMT) Full text and rfc822 format available.

Notification sent to Evgeny Zajcev <lg.zevlg <at> gmail.com>:
bug acknowledged by developer. (Fri, 21 Feb 2020 09:13:01 GMT) Full text and rfc822 format available.

Message #22 received at 38740-done <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Federico Tedin <federicotedin <at> gmail.com>
Cc: 38740-done <at> debbugs.gnu.org, lg.zevlg <at> gmail.com
Subject: Re: bug#38740: 28.0.50; cursor-sensor-mode error in post-command-hook
Date: Fri, 21 Feb 2020 11:12:23 +0200
> From: Federico Tedin <federicotedin <at> gmail.com>
> Cc: lg.zevlg <at> gmail.com,  38740 <at> debbugs.gnu.org
> Date: Mon, 17 Feb 2020 22:04:36 +0100
> 
> I'm attaching the patch again but with the correct commit message
> formatting.

Thanks, installed on the emacs-27 branch.




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Fri, 20 Mar 2020 11:24:06 GMT) Full text and rfc822 format available.

This bug report was last modified 4 years and 31 days ago.

Previous Next


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