GNU bug report logs - #60817
28.2; `x-focus-frame' causes spurious input events causes edebug not showing intermediate results

Previous Next

Package: emacs;

Reported by: "Farblos" <AKFKQU.9DF7RP <at> vodafonemail.de>

Date: Sat, 14 Jan 2023 21:56:01 UTC

Severity: normal

Found in version 28.2

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 60817 in the body.
You can then email your comments to 60817 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#60817; Package emacs. (Sat, 14 Jan 2023 21:56:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to "Farblos" <AKFKQU.9DF7RP <at> vodafonemail.de>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Sat, 14 Jan 2023 21:56:02 GMT) Full text and rfc822 format available.

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

From: "Farblos" <AKFKQU.9DF7RP <at> vodafonemail.de>
To: bug-gnu-emacs <at> gnu.org
Subject: 28.2; `x-focus-frame' causes spurious input events causes edebug not
 showing intermediate results
Date: Sat, 14 Jan 2023 22:55:15 +0100
This is Emacs 28.2 from the Debian emacs-lucid package running on fvwm3
on Xorg.  I guess that either the lucid toolkit or fvwm3 is part of the
problem here, since I cannot reproduce this on a gtk3 Emacs.

To demonstrate the problem:

  emacs -Q
  M-x find-function fundamental-mode RET
  C-u C-M-x                           ; instrument function
  C-x 4 b *Messages* RET              ; show message buffer
  C-x o
  M-x fundamental-mode RET            ; call function

Then step through function `fundamental-mode' in edebug using SPC.
While doing so I do not get the intermediate evaluation results
displayed, but rather only the message "Stop".  My message buffer looks
like this after stepping through the function:

  fundamental-mode
  Stop

  Result: nil
  Stop

  Stop

  Result: nil
  Stop

Meaning: These permanent "Stop" messages hide the intermediate
results.  I haven't found much information on this on the net,
only the following thread on gnu.emacs.help:

  https://groups.google.com/g/gnu.emacs.help/c/ojSN-PgNvxg

The cause seems to be the call to function `x-focus-frame' in
function `edebug--display-1':

  (if (not (memq (framep (selected-frame)) '(nil t pc)))
      (x-focus-frame (selected-frame)))

When I instrument that snippet to

  (when (not (memq (framep (selected-frame)) '(nil t pc)))
    (message "input-pending-pre: %S" (input-pending-p))
    (x-focus-frame (selected-frame))
    (message "input-pending-pst: %S" (input-pending-p)))

my message buffer looks like this instead:

  fundamental-mode
  input-pending-pre: t
  input-pending-pst: t
  Stop

  input-pending-pre: nil
  input-pending-pst: t
  Result: nil
  Stop

  input-pending-pre: nil
  input-pending-pst: t
  Stop

  input-pending-pre: nil
  input-pending-pst: t
  Result: nil
  Stop

That spurious pending input caused by `x-focus-frame' triggers
the following snippet later in function `edebug--display-1':

  (when (input-pending-p)
    (setq edebug-stop t)
    (setq edebug-execution-mode 'step) ; for `edebug-overlay-arrow'
    (edebug-stop))

which causes the "Stop" messages.

The following hack works around the problem, at least most of the time,
as the exact behavior also seems to depend on timing:

  (define-advice x-focus-frame (:after (&rest _dummy) emacs-fix)
    "Discards any spurious input to avoid stop events in edebug."
    (let ((backtrace-frame (backtrace-frame 1 'x-focus-frame)))
      (when (and (listp backtrace-frame)
                 (eq (nth 1 backtrace-frame) 'edebug--display-1))
        ;; a little sleep seems to make work-around safer
        (sleep-for 0 50)
        (discard-input))))

If you cannot reproduce (which is rather likely) pls let me know what I
should do to follow up on this.

In GNU Emacs 28.2 (build 2, x86_64-pc-linux-gnu, X toolkit, cairo version 1.16.0, Xaw3d scroll bars)
 of 2022-12-20, modified by Debian built on x86-csail-01
Windowing system distributor 'The X.Org Foundation', version 11.0.12101005
System Description: Debian GNU/Linux bookworm/sid

Configured using:
 'configure --build x86_64-linux-gnu --prefix=/usr
 --sharedstatedir=/var/lib --libexecdir=/usr/libexec
 --localstatedir=/var/lib --infodir=/usr/share/info
 --mandir=/usr/share/man --with-libsystemd --with-pop=yes
 --enable-locallisppath=/etc/emacs:/usr/local/share/emacs/28.2/site-lisp:/usr/local/share/emacs/site-lisp:/usr/share/emacs/28.2/site-lisp:/usr/share/emacs/site-lisp
 --with-sound=alsa --without-gconf --with-mailutils
 --with-native-compilation --build x86_64-linux-gnu --prefix=/usr
 --sharedstatedir=/var/lib --libexecdir=/usr/libexec
 --localstatedir=/var/lib --infodir=/usr/share/info
 --mandir=/usr/share/man --with-libsystemd --with-pop=yes
 --enable-locallisppath=/etc/emacs:/usr/local/share/emacs/28.2/site-lisp:/usr/local/share/emacs/site-lisp:/usr/share/emacs/28.2/site-lisp:/usr/share/emacs/site-lisp
 --with-sound=alsa --without-gconf --with-mailutils
 --with-native-compilation --with-x=yes --with-x-toolkit=lucid
 --with-toolkit-scroll-bars --without-gsettings 'CFLAGS=-g -O2
 -ffile-prefix-map=/build/emacs-OltuXQ/emacs-28.2+1=. -fstack-protector-strong
 -Wformat -Werror=format-security -Wall' 'CPPFLAGS=-Wdate-time
 -D_FORTIFY_SOURCE=2' LDFLAGS=-Wl,-z,relro'

Configured features:
ACL CAIRO DBUS FREETYPE GIF GLIB GMP GNUTLS GPM HARFBUZZ JPEG JSON LCMS2
LIBOTF LIBSELINUX LIBSYSTEMD LIBXML2 M17N_FLT MODULES NATIVE_COMP NOTIFY
INOTIFY PDUMPER PNG RSVG SECCOMP SOUND THREADS TIFF TOOLKIT_SCROLL_BARS
X11 XAW3D XDBE XIM XPM LUCID ZLIB

Important settings:
  value of $LC_COLLATE: POSIX
  value of $LC_TIME: POSIX
  value of $LANG: en_US.UTF-8
  locale-coding-system: utf-8-unix

Major mode: Outline

Minor modes in effect:
  shell-dirtrack-mode: t
  display-time-mode: t
  delete-selection-mode: t
  tooltip-mode: t
  show-paren-mode: t
  mouse-wheel-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  line-number-mode: t

Load-path shadows:
~/work/elisp/refold hides ~/etc/elisp/refold
~/work/elisp/precious-text hides ~/etc/elisp/precious-text
~/work/elisp/patch hides ~/etc/elisp/patch
~/work/elisp/bbdb-diary hides ~/etc/elisp/bbdb-diary
/usr/share/emacs/site-lisp/elpa/htmlize-1.56/htmlize hides /usr/share/emacs/site-lisp/elpa-src/htmlize-1.56/htmlize
/usr/share/emacs/site-lisp/elpa/htmlize-1.56/htmlize-autoloads hides /usr/share/emacs/site-lisp/elpa-src/htmlize-1.56/htmlize-autoloads
/usr/share/emacs/site-lisp/elpa/htmlize-1.56/htmlize-pkg hides /usr/share/emacs/site-lisp/elpa-src/htmlize-1.56/htmlize-pkg
/usr/share/emacs/site-lisp/elpa/markdown-mode-2.5/markdown-mode-pkg hides /usr/share/emacs/site-lisp/elpa-src/markdown-mode-2.5/markdown-mode-pkg
/usr/share/emacs/site-lisp/elpa/markdown-mode-2.5/markdown-mode hides /usr/share/emacs/site-lisp/elpa-src/markdown-mode-2.5/markdown-mode
/usr/share/emacs/site-lisp/elpa/markdown-mode-2.5/markdown-mode-autoloads hides /usr/share/emacs/site-lisp/elpa-src/markdown-mode-2.5/markdown-mode-autoloads
/usr/share/emacs/site-lisp/elpa/muse-3.20/muse-xml-common hides /usr/share/emacs/site-lisp/elpa-src/muse-3.20/muse-xml-common
/usr/share/emacs/site-lisp/elpa/muse-3.20/muse-http hides /usr/share/emacs/site-lisp/elpa-src/muse-3.20/muse-http
/usr/share/emacs/site-lisp/elpa/muse-3.20/muse-poem hides /usr/share/emacs/site-lisp/elpa-src/muse-3.20/muse-poem
/usr/share/emacs/site-lisp/elpa/muse-3.20/muse-backlink hides /usr/share/emacs/site-lisp/elpa-src/muse-3.20/muse-backlink
/usr/share/emacs/site-lisp/elpa/muse-3.20/muse-wiki hides /usr/share/emacs/site-lisp/elpa-src/muse-3.20/muse-wiki
/usr/share/emacs/site-lisp/elpa/muse-3.20/muse-split hides /usr/share/emacs/site-lisp/elpa-src/muse-3.20/muse-split
/usr/share/emacs/site-lisp/elpa/muse-3.20/muse-latex hides /usr/share/emacs/site-lisp/elpa-src/muse-3.20/muse-latex
/usr/share/emacs/site-lisp/elpa/muse-3.20/muse-ipc hides /usr/share/emacs/site-lisp/elpa-src/muse-3.20/muse-ipc
/usr/share/emacs/site-lisp/elpa/muse-3.20/muse-context hides /usr/share/emacs/site-lisp/elpa-src/muse-3.20/muse-context
/usr/share/emacs/site-lisp/elpa/muse-3.20/muse-project hides /usr/share/emacs/site-lisp/elpa-src/muse-3.20/muse-project
/usr/share/emacs/site-lisp/elpa/muse-3.20/muse-regexps hides /usr/share/emacs/site-lisp/elpa-src/muse-3.20/muse-regexps
/usr/share/emacs/site-lisp/elpa/muse-3.20/muse-groff hides /usr/share/emacs/site-lisp/elpa-src/muse-3.20/muse-groff
/usr/share/emacs/site-lisp/elpa/muse-3.20/httpd hides /usr/share/emacs/site-lisp/elpa-src/muse-3.20/httpd
/usr/share/emacs/site-lisp/elpa/muse-3.20/muse-pkg hides /usr/share/emacs/site-lisp/elpa-src/muse-3.20/muse-pkg
/usr/share/emacs/site-lisp/elpa/muse-3.20/muse-import-xml hides /usr/share/emacs/site-lisp/elpa-src/muse-3.20/muse-import-xml
/usr/share/emacs/site-lisp/elpa/muse-3.20/cgi hides /usr/share/emacs/site-lisp/elpa-src/muse-3.20/cgi
/usr/share/emacs/site-lisp/elpa/muse-3.20/muse-texinfo hides /usr/share/emacs/site-lisp/elpa-src/muse-3.20/muse-texinfo
/usr/share/emacs/site-lisp/elpa/muse-3.20/muse-autoloads hides /usr/share/emacs/site-lisp/elpa-src/muse-3.20/muse-autoloads
/usr/share/emacs/site-lisp/elpa/muse-3.20/muse-colors hides /usr/share/emacs/site-lisp/elpa-src/muse-3.20/muse-colors
/usr/share/emacs/site-lisp/elpa/muse-3.20/muse hides /usr/share/emacs/site-lisp/elpa-src/muse-3.20/muse
/usr/share/emacs/site-lisp/elpa/muse-3.20/muse-import-docbook hides /usr/share/emacs/site-lisp/elpa-src/muse-3.20/muse-import-docbook
/usr/share/emacs/site-lisp/elpa/muse-3.20/muse-blosxom hides /usr/share/emacs/site-lisp/elpa-src/muse-3.20/muse-blosxom
/usr/share/emacs/site-lisp/elpa/muse-3.20/muse-mode hides /usr/share/emacs/site-lisp/elpa-src/muse-3.20/muse-mode
/usr/share/emacs/site-lisp/elpa/muse-3.20/muse-html hides /usr/share/emacs/site-lisp/elpa-src/muse-3.20/muse-html
/usr/share/emacs/site-lisp/elpa/muse-3.20/muse-import-latex hides /usr/share/emacs/site-lisp/elpa-src/muse-3.20/muse-import-latex
/usr/share/emacs/site-lisp/elpa/muse-3.20/muse-protocols hides /usr/share/emacs/site-lisp/elpa-src/muse-3.20/muse-protocols
/usr/share/emacs/site-lisp/elpa/muse-3.20/htmlize-hack hides /usr/share/emacs/site-lisp/elpa-src/muse-3.20/htmlize-hack
/usr/share/emacs/site-lisp/elpa/muse-3.20/muse-xml hides /usr/share/emacs/site-lisp/elpa-src/muse-3.20/muse-xml
/usr/share/emacs/site-lisp/elpa/muse-3.20/muse-message hides /usr/share/emacs/site-lisp/elpa-src/muse-3.20/muse-message
/usr/share/emacs/site-lisp/elpa/muse-3.20/muse-protocol-iw hides /usr/share/emacs/site-lisp/elpa-src/muse-3.20/muse-protocol-iw
/usr/share/emacs/site-lisp/elpa/muse-3.20/muse-latex2png hides /usr/share/emacs/site-lisp/elpa-src/muse-3.20/muse-latex2png
/usr/share/emacs/site-lisp/elpa/muse-3.20/muse-ikiwiki hides /usr/share/emacs/site-lisp/elpa-src/muse-3.20/muse-ikiwiki
/usr/share/emacs/site-lisp/elpa/muse-3.20/muse-mathml hides /usr/share/emacs/site-lisp/elpa-src/muse-3.20/muse-mathml
/usr/share/emacs/site-lisp/elpa/muse-3.20/muse-cite hides /usr/share/emacs/site-lisp/elpa-src/muse-3.20/muse-cite
/usr/share/emacs/site-lisp/elpa/muse-3.20/muse-docbook hides /usr/share/emacs/site-lisp/elpa-src/muse-3.20/muse-docbook
/usr/share/emacs/site-lisp/elpa/muse-3.20/muse-journal hides /usr/share/emacs/site-lisp/elpa-src/muse-3.20/muse-journal
/usr/share/emacs/site-lisp/elpa/muse-3.20/muse-book hides /usr/share/emacs/site-lisp/elpa-src/muse-3.20/muse-book
/usr/share/emacs/site-lisp/elpa/muse-3.20/muse-publish hides /usr/share/emacs/site-lisp/elpa-src/muse-3.20/muse-publish
/usr/share/emacs/site-lisp/elpa/simple-httpd-1.5.1/simple-httpd hides /usr/share/emacs/site-lisp/elpa-src/simple-httpd-1.5.1/simple-httpd
/usr/share/emacs/site-lisp/elpa/simple-httpd-1.5.1/simple-httpd-pkg hides /usr/share/emacs/site-lisp/elpa-src/simple-httpd-1.5.1/simple-httpd-pkg
/usr/share/emacs/site-lisp/elpa/simple-httpd-1.5.1/simple-httpd-autoloads hides /usr/share/emacs/site-lisp/elpa-src/simple-httpd-1.5.1/simple-httpd-autoloads

Features:
(align compare-w diff-mode log-edit add-log bbdb-diary dabbrev log-view
pcvs-util org-element avl-tree generator ol-eww eww xdg url-queue mm-url
ol-rmail ol-mhe ol-irc ol-info ol-gnus nnselect gnus-search gnus-art
mm-uu mml2015 mm-view mml-smime smime dig gnus-sum shr kinsoku svg dom
gnus-group gnus-undo gnus-start gnus-dbus dbus xml gnus-cloud nnimap
nnmail mail-source utf7 netrc nnoo gnus-spec gnus-int gnus-range
gnus-win ol-docview doc-view image-mode exif ol-bibtex ol-bbdb ol-w3m
ol-doi org-link-doi org ob ob-tangle ob-ref ob-lob ob-table ob-exp
org-macro org-footnote org-src ob-comint org-pcomplete org-list
org-faces org-entities org-version ob-emacs-lisp ob-core ob-eval
org-table oc-basic bibtex ol org-keys oc org-compat org-macs
org-loaddefs format-spec shadow sort mail-extr emacsbug message rmc puny
dired dired-loaddefs rfc822 mml mml-sec epa epg rfc6068 epg-config
mm-decode mm-bodies mm-encode mail-parse rfc2231 gmm-utils mailheader
sendmail noutline outline bbdb-mua gnus nnheader gnus-util rmail
rmail-loaddefs rfc2047 rfc2045 ietf-drums mail-utils mm-util mail-prsvr
tex-mode latexenc bbdb-tex shell pcomplete files-x grep compile comint
ansi-color ring rect bbdb-migrate bbdb-com pcase crm mailabbrev bbdb
derived bbdb-site timezone vc-filewise ediff ediff-merg ediff-mult
ediff-wind ediff-diff ediff-help ediff-init ediff-util vc eieio-opt
shortdoc text-property-search ede/speedbar ede/files ede ede/detect
ede/base ede/auto ede/source eieio-base eieio-speedbar speedbar ezimage
dframe eieio-custom cedet mule-util info edebug cal-coptic cal-julian
help-fns radix-tree cl-print debug backtrace thingatpt misearch
multi-isearch vc-dispatcher parse-time iso8601 time-date vc-cvs vc-rcs
refold easy-mmode cus-edit pp cus-start wid-edit jka-compr appt
diary-lib diary-loaddefs cal-menu calendar cal-loaddefs comp comp-cstr
warnings rx cl-extra help-mode patch find-func time delsel cus-load
server advice finder-inf bbdb-loaddefs muse-autoloads package browse-url
url url-proxy url-privacy url-expand url-methods url-history url-cookie
url-domsuf url-util mailcap 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
iso-transl tooltip eldoc paren electric uniquify ediff-hook vc-hooks
lisp-float-type elisp-mode 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 lisp-mode prog-mode register page tab-bar menu-bar
rfn-eshadow isearch easymenu timer select scroll-bar mouse jit-lock
font-lock syntax 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 emoji-zwj charscript
charprop case-table epa-hook jka-cmpr-hook help simple abbrev obarray
cl-preloaded nadvice button loaddefs faces cus-face macroexp files
window text-properties overlay sha1 md5 base64 format env code-pages
mule custom widget hashtable-print-readable backquote threads dbusbind
inotify lcms2 dynamic-setting font-render-setting cairo x-toolkit x
multi-tty make-network-process native-compile emacs)

Memory information:
((conses 16 704166 122624)
 (symbols 48 28618 68)
 (strings 32 126343 6802)
 (string-bytes 1 4754220)
 (vectors 16 64650)
 (vector-slots 8 1765583 103981)
 (floats 8 572 696)
 (intervals 56 46854 1402)
 (buffers 992 46))







Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#60817; Package emacs. (Sun, 15 Jan 2023 06:25:02 GMT) Full text and rfc822 format available.

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

From: Eli Zaretskii <eliz <at> gnu.org>
To: "Farblos" <AKFKQU.9DF7RP <at> vodafonemail.de>
Cc: 60817 <at> debbugs.gnu.org
Subject: Re: bug#60817: 28.2;
 `x-focus-frame' causes spurious input events causes edebug not
 showing intermediate results
Date: Sun, 15 Jan 2023 08:23:58 +0200
> Date: Sat, 14 Jan 2023 22:55:15 +0100
> From:  "Farblos" via "Bug reports for GNU Emacs,
>  the Swiss army knife of text editors" <bug-gnu-emacs <at> gnu.org>
> 
> This is Emacs 28.2 from the Debian emacs-lucid package running on fvwm3
> on Xorg.  I guess that either the lucid toolkit or fvwm3 is part of the
> problem here, since I cannot reproduce this on a gtk3 Emacs.
> 
> To demonstrate the problem:
> 
>   emacs -Q
>   M-x find-function fundamental-mode RET
>   C-u C-M-x                           ; instrument function
>   C-x 4 b *Messages* RET              ; show message buffer
>   C-x o
>   M-x fundamental-mode RET            ; call function
> 
> Then step through function `fundamental-mode' in edebug using SPC.
> While doing so I do not get the intermediate evaluation results
> displayed, but rather only the message "Stop".  My message buffer looks
> like this after stepping through the function:
> 
>   fundamental-mode
>   Stop
> 
>   Result: nil
>   Stop
> 
>   Stop
> 
>   Result: nil
>   Stop
> 
> Meaning: These permanent "Stop" messages hide the intermediate
> results.  I haven't found much information on this on the net,
> only the following thread on gnu.emacs.help:
> 
>   https://groups.google.com/g/gnu.emacs.help/c/ojSN-PgNvxg
> 
> The cause seems to be the call to function `x-focus-frame' in
> function `edebug--display-1':
> 
>   (if (not (memq (framep (selected-frame)) '(nil t pc)))
>       (x-focus-frame (selected-frame)))
> 
> When I instrument that snippet to
> 
>   (when (not (memq (framep (selected-frame)) '(nil t pc)))
>     (message "input-pending-pre: %S" (input-pending-p))
>     (x-focus-frame (selected-frame))
>     (message "input-pending-pst: %S" (input-pending-p)))
> 
> my message buffer looks like this instead:
> 
>   fundamental-mode
>   input-pending-pre: t
>   input-pending-pst: t
>   Stop
> 
>   input-pending-pre: nil
>   input-pending-pst: t
>   Result: nil
>   Stop
> 
>   input-pending-pre: nil
>   input-pending-pst: t
>   Stop
> 
>   input-pending-pre: nil
>   input-pending-pst: t
>   Result: nil
>   Stop
> 
> That spurious pending input caused by `x-focus-frame' triggers
> the following snippet later in function `edebug--display-1':
> 
>   (when (input-pending-p)
>     (setq edebug-stop t)
>     (setq edebug-execution-mode 'step) ; for `edebug-overlay-arrow'
>     (edebug-stop))
> 
> which causes the "Stop" messages.

AFAIU, input-pending-p should filter out focus events, so I don't
think I understand why you see this.  Can you try this in Emacs 29 or
the master branch of the Emacs Git repository, so we make sure this
problem was not fixed already?  If it still happens in those newer
versions, maybe you can step with GDB through get_input_pending, when
it's called from input-pending-p, and through readable_events called
by get_input_pending, and see why focus events aren't filtered out?




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#60817; Package emacs. (Sat, 21 Jan 2023 20:05:01 GMT) Full text and rfc822 format available.

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

From: Farblos <akfkqu.9df7rp <at> vodafonemail.de>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 60817 <at> debbugs.gnu.org
Subject: Re: bug#60817: 28.2; `x-focus-frame' causes spurious input events
 causes edebug not showing intermediate results
Date: Sat, 21 Jan 2023 21:03:41 +0100
On 2023-01-15  07:23, Eli Zaretskii wrote:

> AFAIU, input-pending-p should filter out focus events, so I don't
> think I understand why you see this.  Can you try this in Emacs 29 or
> the master branch of the Emacs Git repository, so we make sure this
> problem was not fixed already?  If it still happens in those newer
> versions, maybe you can step with GDB through get_input_pending, when
> it's called from input-pending-p, and through readable_events called
> by get_input_pending, and see why focus events aren't filtered out?

I used printf debugging and, admittedly, even back in Emacs 27 for now, 
since I have the Debian toolchain ready for that.  I reduced the test 
case to this:

(defun testcase ()
  (interactive)
  (message "pre: %S" (input-pending-p))
  (x-focus-frame (selected-frame))
  (sleep-for 0.5)
  (message "pst: %S" (input-pending-p)))

The error ("pst: t") reproduces only after touching some part of the 
modeline that provides a tooltip.

And the offending event that causes `input-pending-p' to become t is 
*not* a focus event (I can see indeed these getting filtered in 
readable_events) but rather a HELP_EVENT.  So as soon as one has touched 
the modeline, the call to `x-focus-frame' produces these HELP_EVENTS.

Does that ring a bell?  Any new directions where I should look at?

I'll try setting up a build environment for a newer Emacs when I find 
the time to do so.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#60817; Package emacs. (Sat, 21 Jan 2023 21:37:02 GMT) Full text and rfc822 format available.

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

From: Farblos <akfkqu.9df7rp <at> vodafonemail.de>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 60817 <at> debbugs.gnu.org
Subject: Re: bug#60817: 28.2; `x-focus-frame' causes spurious input events
 causes edebug not showing intermediate results
Date: Sat, 21 Jan 2023 22:36:16 +0100
On 2023-01-21  21:03, Farblos wrote:
> I used printf debugging and, admittedly, even back in Emacs 27 for now, 
> since I have the Debian toolchain ready for that.  I reduced the test 
> case to this:

Bit the bullet and cloned master, compiled it, and: Bug *does not* 
reproduce.

Only after seeing that HELP_EVENT in Emacs 27 I understood that hovering 
over the modeline is a necessary precondition to reliably reproduce this 
issue.  So without debugging in Emacs 27 I wouldn't have been able to 
ensure that the bug is gone in master ...

Feel free to close this issue.  Optionally: If you happen to have an 
explanation why this bug is gone, I'd really appreciate that.

Thanks for developing Emacs!




Reply sent to Eli Zaretskii <eliz <at> gnu.org>:
You have taken responsibility. (Thu, 26 Jan 2023 07:48:02 GMT) Full text and rfc822 format available.

Notification sent to "Farblos" <AKFKQU.9DF7RP <at> vodafonemail.de>:
bug acknowledged by developer. (Thu, 26 Jan 2023 07:48:02 GMT) Full text and rfc822 format available.

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

From: Eli Zaretskii <eliz <at> gnu.org>
To: Farblos <akfkqu.9df7rp <at> vodafonemail.de>
Cc: 60817-done <at> debbugs.gnu.org
Subject: Re: bug#60817: 28.2; `x-focus-frame' causes spurious input events
 causes edebug not showing intermediate results
Date: Thu, 26 Jan 2023 09:47:58 +0200
> Date: Sat, 21 Jan 2023 22:36:16 +0100
> From: Farblos <akfkqu.9df7rp <at> vodafonemail.de>
> Cc: 60817 <at> debbugs.gnu.org
> 
> On 2023-01-21  21:03, Farblos wrote:
> > I used printf debugging and, admittedly, even back in Emacs 27 for now, 
> > since I have the Debian toolchain ready for that.  I reduced the test 
> > case to this:
> 
> Bit the bullet and cloned master, compiled it, and: Bug *does not* 
> reproduce.
> 
> Only after seeing that HELP_EVENT in Emacs 27 I understood that hovering 
> over the modeline is a necessary precondition to reliably reproduce this 
> issue.  So without debugging in Emacs 27 I wouldn't have been able to 
> ensure that the bug is gone in master ...
> 
> Feel free to close this issue.  Optionally: If you happen to have an 
> explanation why this bug is gone, I'd really appreciate that.

I'm afraid I don't know what change fixed this, and the problem
doesn't reproduce in my configuration, so I have difficulty trying
this out in different versions to try to answer that question.

So I'll just close the bug.  Thanks for testing the current codebase.




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Thu, 23 Feb 2023 12:24:06 GMT) Full text and rfc822 format available.

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

Previous Next


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