From unknown Fri Jun 20 07:20:55 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#67046 <67046@debbugs.gnu.org> To: bug#67046 <67046@debbugs.gnu.org> Subject: Status: 29.1.50; map-y-or-n-p infinite loops if it's at the end of a kmacro Reply-To: bug#67046 <67046@debbugs.gnu.org> Date: Fri, 20 Jun 2025 14:20:55 +0000 retitle 67046 29.1.50; map-y-or-n-p infinite loops if it's at the end of a = kmacro reassign 67046 emacs submitter 67046 Spencer Baugh severity 67046 normal thanks From debbugs-submit-bounces@debbugs.gnu.org Fri Nov 10 11:44:24 2023 Received: (at submit) by debbugs.gnu.org; 10 Nov 2023 16:44:24 +0000 Received: from localhost ([127.0.0.1]:50741 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1r1UcJ-0000uH-Iz for submit@debbugs.gnu.org; Fri, 10 Nov 2023 11:44:24 -0500 Received: from lists.gnu.org ([2001:470:142::17]:40252) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1r1UcF-0000tt-If for submit@debbugs.gnu.org; Fri, 10 Nov 2023 11:44:22 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1r1UbV-0005GJ-Tx for bug-gnu-emacs@gnu.org; Fri, 10 Nov 2023 11:43:33 -0500 Received: from mxout5.mail.janestreet.com ([64.215.233.18]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1r1UbQ-0001xZ-Ii for bug-gnu-emacs@gnu.org; Fri, 10 Nov 2023 11:43:32 -0500 From: Spencer Baugh To: bug-gnu-emacs@gnu.org Subject: 29.1.50; map-y-or-n-p infinite loops if it's at the end of a kmacro Date: Fri, 10 Nov 2023 11:43:25 -0500 Message-ID: MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=64.215.233.18; envelope-from=sbaugh@janestreet.com; helo=mxout5.mail.janestreet.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: 0.9 (/) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.1 (/) For example, if you record a kmacro which does C-x s, then when you repeat the kmacro and there are more buffers which could be saved, the kmacro will hang instead of either completing or erroring. Straightforward minimal reproduction: (execute-kbd-macro (kbd "M-: (map-y-or-n-p SPC \"\" SPC #'ignore SPC '(1)) RET")) This hangs in a loop around read-event and has to be interrupted with C-g. The loop in question in map-y-or-n-p: (while (progn (setq char (read-event)) ;; If we get -1, from end of keyboard ;; macro, try again. (equal char -1))) I'll fix this in a followup patch. In GNU Emacs 29.1.50 (build 15, x86_64-pc-linux-gnu, X toolkit, cairo version 1.15.12, Xaw scroll bars) of 2023-10-25 built on Repository revision: 5cbca757f620c7b4ca31776711a247b8f266c36e Repository branch: emacs-29 Windowing system distributor 'The X.Org Foundation', version 11.0.12011000 System Description: Rocky Linux 8.8 (Green Obsidian) Configured using: 'configure --config-cache --with-x-toolkit=lucid --with-gif=ifavailable' Configured features: CAIRO DBUS FREETYPE GLIB GMP GNUTLS GSETTINGS HARFBUZZ JPEG JSON LIBSELINUX LIBSYSTEMD LIBXML2 MODULES NOTIFY INOTIFY PDUMPER PNG RSVG SECCOMP SOUND SQLITE3 THREADS TIFF TOOLKIT_SCROLL_BARS X11 XDBE XIM XINPUT2 XPM LUCID ZLIB Important settings: value of $LANG: en_US.UTF-8 locale-coding-system: utf-8-unix Major mode: Lisp Interaction Minor modes in effect: delete-selection-mode: t global-so-long-mode: t pixel-scroll-precision-mode: t jane-fe-minor-mode: t jane-fe-jenga-minor-mode: t editorconfig-mode: t which-function-mode: t global-git-commit-mode: t magit-auto-revert-mode: t shell-dirtrack-mode: t server-mode: t windmove-mode: t savehist-mode: t save-place-mode: t tooltip-mode: t global-eldoc-mode: t eldoc-mode: t show-paren-mode: t electric-indent-mode: t mouse-wheel-mode: t tab-bar-mode: t menu-bar-mode: t file-name-shadow-mode: t context-menu-mode: t global-font-lock-mode: t font-lock-mode: t blink-cursor-mode: t line-number-mode: t transient-mark-mode: t auto-composition-mode: t auto-encryption-mode: t auto-compression-mode: t Features: (shadow mail-extr emacsbug magit-imenu git-rebase face-remap pcmpl-git vc-bzr vc-src vc-sccs vc-svn vc-cvs vc-rcs log-view cus-start dabbrev cl-print macros vc-git vc-fe vc-hg vc-dir vc vc-dispatcher cc-mode cc-fonts cc-guess cc-menus cc-cmds cc-styles cc-align cc-engine cc-vars cc-defs mule-util sort display-line-numbers find-dired pulse bug-reference shortdoc help-fns radix-tree tabify man sh-script treesit misearch multi-isearch executable org-element org-persist org-id org-refile avl-tree generator oc-basic ol-eww eww xdg url-queue mm-url ol-rmail ol-mhe ol-irc ol-info ol-gnus nnselect gnus-art mm-uu mml2015 mm-view mml-smime smime gnutls dig gnus-sum shr pixel-fill kinsoku url-file svg dom gnus-group gnus-undo gnus-start gnus-dbus dbus xml gnus-cloud nnimap nnmail mail-source utf7 nnoo gnus-spec gnus-int gnus-range gnus-win ol-docview doc-view jka-compr image-mode exif ol-bibtex bibtex ol-bbdb ol-w3m ol-doi org-link-doi goto-addr delsel so-long jane-fe-read-feature pixel-scroll cua-base tramp tramp-loaddefs trampver tramp-integration tramp-compat parse-time iso8601 ffap jane-merlin merlin-imenu let-alist merlin-xref merlin-cap merlin jane-async-merlin jane-completion grep jane-common jane-comint org-protocol jane-fe-project xref files-x jane-fe-menu ecaml_plugin view gopcaml magit-bookmark bookmark image+ advice image-file image-converter editorconfig editorconfig-core editorconfig-core-handle editorconfig-fnmatch whitespace jane-auto-modes vba-mode markdown-mode color jane jane-yasnippet jane-micro-features ert ewoc debug backtrace jane-diff unified-test-mode shell-file core core-buffer core-error jane-sexp jane-python jane-ocaml jane-tuareg-theme tuareg tuareg-compat tuareg-opam skeleton flymake-proc flymake warnings thingatpt smie caml-types caml-help caml-emacs find-file compile jane-cr jane-codeium jane-align jane-deprecated jane-smerge gnu-elpa-keyring-update jane-ocp-indent ocp-indent jane-eglot yasnippet-autoloads swiper-autoloads htmlize-autoloads eglot-autoloads editorconfig-autoloads codeium-autoloads jane-autoloads jane-util ob-shell page-ext dired-x magit-extras project magit-submodule magit-obsolete magit-blame magit-stash magit-reflog magit-bisect magit-push magit-pull magit-fetch magit-clone magit-remote magit-commit magit-sequence magit-notes magit-worktree magit-tag magit-merge magit-branch magit-reset magit-files magit-refs magit-status magit magit-repos magit-apply magit-wip magit-log which-func imenu magit-diff smerge-mode diff diff-mode git-commit log-edit message sendmail yank-media puny dired dired-loaddefs rfc822 mml mml-sec epa derived epg rfc6068 epg-config mm-decode mm-bodies mm-encode mail-parse rfc2231 rfc2047 rfc2045 ietf-drums mailabbrev gmm-utils mailheader pcvs-util add-log magit-core magit-autorevert autorevert filenotify magit-margin magit-transient magit-process with-editor shell server magit-mode transient edmacro kmacro magit-git magit-section magit-utils crm dash gnus nnheader gnus-util text-property-search mail-utils range mm-util mail-prsvr cl-extra help-mode windmove org ob ob-tangle ob-ref ob-lob ob-table ob-exp org-macro org-src ob-comint org-pcomplete pcomplete org-list org-footnote org-faces org-entities time-date noutline outline ob-emacs-lisp ob-core ob-eval org-cycle org-table ol rx org-fold org-fold-core org-keys oc org-loaddefs find-func cal-menu calendar cal-loaddefs org-version org-compat org-macs format-spec gdb-mi bindat gud easy-mmode comint ansi-osc ansi-color ring vundo modus-vivendi-theme modus-themes pcase savehist saveplace cus-edit pp cus-load icons wid-edit adaptive-wrap-autoloads csv-mode-autoloads cyberpunk-theme-autoloads evil-autoloads exwm-autoloads helm-autoloads helm-core-autoloads async-autoloads ivy-autoloads magit-autoloads git-commit-autoloads finder-inf magit-section-autoloads dash-autoloads popup-autoloads url-http-ntlm-autoloads url-auth vc-hgcmd-autoloads vundo-autoloads info with-editor-autoloads xelb-autoloads package browse-url url url-proxy url-privacy url-expand url-methods url-history url-cookie generate-lisp-file url-domsuf url-util mailcap url-handlers url-parse auth-source cl-seq eieio eieio-core cl-macs password-cache json subr-x map byte-opt gv bytecomp byte-compile url-vars cl-loaddefs cl-lib rmc iso-transl tooltip cconv 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 nadvice seq simple cl-generic indonesian philippine 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 abbrev obarray oclosure cl-preloaded button loaddefs theme-loaddefs faces cus-face macroexp files window text-properties overlay sha1 md5 base64 format env code-pages mule custom widget keymap hashtable-print-readable backquote threads dbusbind inotify dynamic-setting system-font-setting font-render-setting cairo x-toolkit xinput2 x multi-tty make-network-process emacs) Memory information: ((conses 16 894359 138172) (symbols 48 53718 0) (strings 32 244206 27230) (string-bytes 1 7923236) (vectors 16 139411) (vector-slots 8 2276866 106367) (floats 8 660 496) (intervals 56 29358 1203) (buffers 976 85)) From debbugs-submit-bounces@debbugs.gnu.org Fri Nov 10 11:48:25 2023 Received: (at 67046) by debbugs.gnu.org; 10 Nov 2023 16:48:25 +0000 Received: from localhost ([127.0.0.1]:50752 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1r1UgD-00012V-9L for submit@debbugs.gnu.org; Fri, 10 Nov 2023 11:48:25 -0500 Received: from mxout5.mail.janestreet.com ([64.215.233.18]:49929) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1r1UgA-00011o-6M for 67046@debbugs.gnu.org; Fri, 10 Nov 2023 11:48:24 -0500 From: Spencer Baugh To: 67046@debbugs.gnu.org Subject: Re: bug#67046: 29.1.50; map-y-or-n-p infinite loops if it's at the end of a kmacro In-Reply-To: (Spencer Baugh's message of "Fri, 10 Nov 2023 11:43:25 -0500") References: Date: Fri, 10 Nov 2023 11:47:36 -0500 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 67046 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) --=-=-= Content-Type: text/plain Patch: --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=0001-Don-t-infinite-loop-in-map-y-or-n-p-if-at-the-end-of.patch >From d7aa9644b308a936926b1074d0f6eac3e425b011 Mon Sep 17 00:00:00 2001 From: Spencer Baugh Date: Fri, 10 Nov 2023 11:27:10 -0500 Subject: [PATCH] Don't infinite loop in map-y-or-n-p if at the end of kmacro Previously, if map-y-or-n-p got -1 from read-event (indicating no input due to the end of a keyboard macro), it would just infinite loop. Now it behaves like other commands which use read-event/read-char/etc, and just errors when we try to look up -1 in our keymap and find nothing. Also, just for the sake of users, print a slightly prettier message when this happens. * lisp/emacs-lisp/map-ynp.el (map-y-or-n-p): Don't loop if we reach the end of a keyboard macro. (Bug#67046) --- lisp/emacs-lisp/map-ynp.el | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/lisp/emacs-lisp/map-ynp.el b/lisp/emacs-lisp/map-ynp.el index cb1cc88e78f..fffb199e2ea 100644 --- a/lisp/emacs-lisp/map-ynp.el +++ b/lisp/emacs-lisp/map-ynp.el @@ -168,16 +168,14 @@ map-y-or-n-p (key-description (vector help-char))) (if minibuffer-auto-raise (raise-frame (window-frame (minibuffer-window)))) - (while (progn - (setq char (read-event)) - ;; If we get -1, from end of keyboard - ;; macro, try again. - (equal char -1))) + (setq char (read-event)) ;; Show the answer to the question. (message "%s(y, n, !, ., q, %sor %s) %s" prompt user-keys (key-description (vector help-char)) - (single-key-description char))) + (if (equal char -1) + "[end-of-keyboard-macro]" + (single-key-description char)))) (setq def (lookup-key map (vector char)))) (cond ((eq def 'exit) (setq next (lambda () nil))) -- 2.39.3 --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Fri Nov 10 13:56:44 2023 Received: (at 67046) by debbugs.gnu.org; 10 Nov 2023 18:56:44 +0000 Received: from localhost ([127.0.0.1]:50864 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1r1WgO-0004Ty-93 for submit@debbugs.gnu.org; Fri, 10 Nov 2023 13:56:44 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:46936) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1r1WgK-0004Th-9f for 67046@debbugs.gnu.org; Fri, 10 Nov 2023 13:56:42 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1r1Wfa-00010a-47; Fri, 10 Nov 2023 13:55:54 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=7nqvX/0EMI8UgcGza8KtVOCmBJwKrBKEBKLtAZcTnzc=; b=Rh/DL5dBiSwu oFkopjuwjg6+kJzheB4QLwHQJEihwaAvHmF6pz6ZI3QL6zMpSyTcEZMTj89tHmESFIv+/lK0CuUBe o7yFZO4s7vrEMP7M5/QO2PpelXf70D9gjZrb5XWKmHxjIFcXyDu2snMdUTyTwKIMKzIh9vqpZb/Na U+Wg1yWzJOQlRlaGE01W5rmdoONuFJgp8n6rlC5mIwCajON+uY2zuVIPvWdvYaqyHfwKzCbeP/twJ hHMR0WHe+AR6jLXD6MEWmIjgrcCNrzVpK9ynIGam+pb10/4pgEGKf+o7ZyzwsoE3Yia8gFA4HDw77 kMLt410RB4JZd+KXdRHLtQ==; Date: Fri, 10 Nov 2023 20:55:48 +0200 Message-Id: <83il69xwsr.fsf@gnu.org> From: Eli Zaretskii To: Spencer Baugh , Stefan Monnier In-Reply-To: (message from Spencer Baugh on Fri, 10 Nov 2023 11:47:36 -0500) Subject: Re: bug#67046: 29.1.50; map-y-or-n-p infinite loops if it's at the end of a kmacro References: X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 67046 Cc: 67046@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Spencer Baugh > Date: Fri, 10 Nov 2023 11:47:36 -0500 > > >From d7aa9644b308a936926b1074d0f6eac3e425b011 Mon Sep 17 00:00:00 2001 > From: Spencer Baugh > Date: Fri, 10 Nov 2023 11:27:10 -0500 > Subject: [PATCH] Don't infinite loop in map-y-or-n-p if at the end of kmacro > > Previously, if map-y-or-n-p got -1 from read-event (indicating no > input due to the end of a keyboard macro), it would just infinite > loop. > > Now it behaves like other commands which use read-event/read-char/etc, > and just errors when we try to look up -1 in our keymap and find > nothing. > > Also, just for the sake of users, print a slightly prettier message > when this happens. > > * lisp/emacs-lisp/map-ynp.el (map-y-or-n-p): Don't loop if we reach > the end of a keyboard macro. (Bug#67046) You have removed the loop, so now the "try again" part is no longer working. How can we be sure this doesn't introduce some regression? Do you understand why this loop was added, in commit 3f72fac865? If so, can you explain why it was needed? I have added Stefan to the discussion. From debbugs-submit-bounces@debbugs.gnu.org Fri Nov 10 17:36:13 2023 Received: (at 67046) by debbugs.gnu.org; 10 Nov 2023 22:36:14 +0000 Received: from localhost ([127.0.0.1]:50999 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1r1a6n-0001px-Ik for submit@debbugs.gnu.org; Fri, 10 Nov 2023 17:36:13 -0500 Received: from mxout2.mail.janestreet.com ([38.105.200.79]:54505) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1r1a6j-0001pf-GF for 67046@debbugs.gnu.org; Fri, 10 Nov 2023 17:36:12 -0500 From: Spencer Baugh To: Eli Zaretskii Subject: Re: bug#67046: 29.1.50; map-y-or-n-p infinite loops if it's at the end of a kmacro In-Reply-To: <83il69xwsr.fsf@gnu.org> (Eli Zaretskii's message of "Fri, 10 Nov 2023 20:55:48 +0200") References: <83il69xwsr.fsf@gnu.org> Date: Fri, 10 Nov 2023 17:35:23 -0500 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.5 (/) X-Debbugs-Envelope-To: 67046 Cc: 67046@debbugs.gnu.org, Stefan Monnier X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.5 (-) Eli Zaretskii writes: >> From: Spencer Baugh >> Date: Fri, 10 Nov 2023 11:47:36 -0500 >> >> >From d7aa9644b308a936926b1074d0f6eac3e425b011 Mon Sep 17 00:00:00 2001 >> From: Spencer Baugh >> Date: Fri, 10 Nov 2023 11:27:10 -0500 >> Subject: [PATCH] Don't infinite loop in map-y-or-n-p if at the end of kmacro >> >> Previously, if map-y-or-n-p got -1 from read-event (indicating no >> input due to the end of a keyboard macro), it would just infinite >> loop. >> >> Now it behaves like other commands which use read-event/read-char/etc, >> and just errors when we try to look up -1 in our keymap and find >> nothing. >> >> Also, just for the sake of users, print a slightly prettier message >> when this happens. >> >> * lisp/emacs-lisp/map-ynp.el (map-y-or-n-p): Don't loop if we reach >> the end of a keyboard macro. (Bug#67046) > > You have removed the loop, so now the "try again" part is no longer > working. Yep. > How can we be sure this doesn't introduce some regression? I'm not certain, but the behavior as written is a completely inert infinite loop, just sitting and spamming read-event over and over forever and maxing out the CPU. It seems hard for this to be correct behavior. > Do you understand why this loop was added, in commit 3f72fac865? I do not. > If so, can you explain why it was needed? Maybe this was some kind of XEmacs confusion? I don't know the full history of keyboard macros, but perhaps in XEmacs read-event would start returning keyboard input again after starting to return -1. (In GNU Emacs, AFAICT, it's always been the case that read-event returns -1 forever after we run out of input in the keyboard macro, but haven't yet actually returned from the command loop) Or it was just a bug from the start. From debbugs-submit-bounces@debbugs.gnu.org Tue Nov 14 17:13:04 2023 Received: (at 67046) by debbugs.gnu.org; 14 Nov 2023 22:13:04 +0000 Received: from localhost ([127.0.0.1]:34270 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1r31ea-0001SB-Ab for submit@debbugs.gnu.org; Tue, 14 Nov 2023 17:13:04 -0500 Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:11116) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1r31eY-0001Rd-Mf for 67046@debbugs.gnu.org; Tue, 14 Nov 2023 17:13:03 -0500 Received: from pmg2.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id 9A410807A4; Tue, 14 Nov 2023 17:12:14 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1699999933; bh=l/XFmqj2r74QuqnbNMF3uSxoBgsPZ7Mj+5+/OIdWIWE=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=TkpHXUSXr9y5uiMikYZqNyKX2DnVz39jV61uZmyyLxuB/EMuhXLcWb3i6Zk4r9iyy 5ptIjAgcskwhB4uuH7RlS1bDqcy3dxD6WYqgRMVFfNumebdPx+3Qd/+Resh1Lbl+VE dhZIXPrPPJFRVPxsW73FDk9/A1GfynBDgmQ4lykm5sS6gsfMRqnU8KWP2gdpiySRLT loPApMft1KgOq7Hy9CzIVyTF3/TtXFXBDN1M7oXxvBfFPIhpFGZ1PtTQYfacxavkX6 9hZAMxmOYE+jiqxX9IEXVsD+h4mjMUrTGM6Io7Almtd2oljHqcWVPlDXguMmVI0nnY JmCbnyOCyJmvw== Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id 94723803D3; Tue, 14 Nov 2023 17:12:13 -0500 (EST) Received: from lechazo (lechon.iro.umontreal.ca [132.204.27.242]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 81C761202CE; Tue, 14 Nov 2023 17:12:13 -0500 (EST) From: Stefan Monnier To: Spencer Baugh Subject: Re: bug#67046: 29.1.50; map-y-or-n-p infinite loops if it's at the end of a kmacro In-Reply-To: (Spencer Baugh's message of "Fri, 10 Nov 2023 17:35:23 -0500") Message-ID: References: <83il69xwsr.fsf@gnu.org> Date: Tue, 14 Nov 2023 17:09:45 -0500 User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-SPAM-INFO: Spam detection results: 0 ALL_TRUSTED -1 Passed through trusted hosts only via SMTP AWL 0.091 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DKIM_SIGNED 0.1 Message has a DKIM or DK signature, not necessarily valid DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's domain DKIM_VALID_EF -0.1 Message has a valid DKIM or DK signature from envelope-from domain T_SCC_BODY_TEXT_LINE -0.01 - X-SPAM-LEVEL: X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 67046 Cc: Eli Zaretskii , 67046@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) >> How can we be sure this doesn't introduce some regression? > I'm not certain, but the behavior as written is a completely inert > infinite loop, just sitting and spamming read-event over and over > forever and maxing out the CPU. It seems hard for this to be correct > behavior. Agreed. >> Do you understand why this loop was added, in commit 3f72fac865? > I do not. Neither do I. The handling of keyboard macro wasn't very different from what we have now, so by my reading of the code it suffered from the same inf-loop as the one we're discussing. I see that Gerd fixed that commit a week later by removing a `not` which strongly suggests the code wasn't tested very much, if at all. > Maybe this was some kind of XEmacs confusion? I don't know the full > history of keyboard macros, but perhaps in XEmacs read-event would start > returning keyboard input again after starting to return -1. (In GNU > Emacs, AFAICT, it's always been the case that read-event returns -1 > forever after we run out of input in the keyboard macro, but haven't yet > actually returned from the command loop) Reading the code I'm wondering how come we don't get into inf-loops more often when executing macros that stop in the middle of a recursive edit, or minibuffer input, or ... Stefan From debbugs-submit-bounces@debbugs.gnu.org Wed Nov 15 10:57:23 2023 Received: (at 67046) by debbugs.gnu.org; 15 Nov 2023 15:57:23 +0000 Received: from localhost ([127.0.0.1]:52966 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1r3IGY-00018Z-Gk for submit@debbugs.gnu.org; Wed, 15 Nov 2023 10:57:23 -0500 Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:42745) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1r3IGW-00018L-KB for 67046@debbugs.gnu.org; Wed, 15 Nov 2023 10:57:21 -0500 Received: from pmg3.iro.umontreal.ca (localhost [127.0.0.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id B30EC440AF7; Wed, 15 Nov 2023 07:19:41 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1700050780; bh=vM9i1nZaasGcxp2gxgzok4MX59iFXfzKcwAc30C2oGY=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=SQRLBYK5u0w4lw7/3H600Y+XpNDGOvWMmc5HtENsksS4FHbp0b4tkOPv5/ZKm60it 02Wtjp1490X2X5LnWaGlq7SqLkWqcdWAGtUmz28diXJcZ9T9jTqrWHANiN1SwAbijF ijLaPsyyJV3SdDFd+7zDDgCH9yFbH9TCYUsJCX9DnSwVkSF8RW5daLDbEidF+ZwnN0 kU766p1EiUp0+Y7pffPEHFpDr8Ix10LcxB/xcqpRvBW5W9sfdSs3kdsOKU6T9l529l 5bUHB9BW5cVwkBrgRqS0JrxZvDW1xgfNHAo+jkQRRpFQ9aoAtXzJPfDhML/Tdngqve UghF+MxRsO7Hw== Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id C2EA5440A68; Wed, 15 Nov 2023 07:19:40 -0500 (EST) Received: from pastel (unknown [45.72.227.120]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 89B151202FC; Wed, 15 Nov 2023 07:19:40 -0500 (EST) From: Stefan Monnier To: Eli Zaretskii Subject: Re: bug#67046: 29.1.50; map-y-or-n-p infinite loops if it's at the end of a kmacro In-Reply-To: <83h6lnrzpv.fsf@gnu.org> (Eli Zaretskii's message of "Wed, 15 Nov 2023 14:02:52 +0200") Message-ID: References: <83il69xwsr.fsf@gnu.org> <83h6lnrzpv.fsf@gnu.org> Date: Wed, 15 Nov 2023 07:19:34 -0500 User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-SPAM-INFO: Spam detection results: 0 ALL_TRUSTED -1 Passed through trusted hosts only via SMTP AWL 0.026 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DKIM_SIGNED 0.1 Message has a DKIM or DK signature, not necessarily valid DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's domain DKIM_VALID_EF -0.1 Message has a valid DKIM or DK signature from envelope-from domain T_SCC_BODY_TEXT_LINE -0.01 - X-SPAM-LEVEL: X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 67046 Cc: sbaugh@janestreet.com, 67046@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > So what is the path forward? > Should we install the change on master and cross our fingers? Yes, the change is safe. Stefan From debbugs-submit-bounces@debbugs.gnu.org Wed Nov 15 11:28:10 2023 Received: (at 67046) by debbugs.gnu.org; 15 Nov 2023 16:28:11 +0000 Received: from localhost ([127.0.0.1]:53130 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1r3IkM-00028Z-FU for submit@debbugs.gnu.org; Wed, 15 Nov 2023 11:28:10 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:58120) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1r3IQj-0001QS-U8 for 67046@debbugs.gnu.org; Wed, 15 Nov 2023 11:07:54 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1r3Ebn-0000cF-Td; Wed, 15 Nov 2023 07:03:16 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=Q8/JNGr9nHNhNvhcc6d08xb7qiVdNYDkJln3SP8zTZM=; b=Sz/7+IgfhgQv EyMuElJzGu2WkGf8U9IhxvfPVEZGNxq455O3WcSoJnNNpBFeqev2bqqKVOSEGNzZlbTgQP8wAgLSw W7SBwSWJ8OJYdbuAJfNTos4KQdXut9rGTkIOazCAgaoWAkh4OiqVqTOSxGmAdQJidxkV+8B8JLs7I B6kXgOkpqzME7nIZJz5fAhiQiolNj5KFz63d7ZdCo9WrX+Nix4qZQuCiziaoy9sLlkC0QLO+/tYRY NzPrGbuIQCm95sChzpKZXt17gpTTNNHps5aqhZU/bkAFqzUQyUpUyXPHq1yq36/hnCQDcribQCuRG T/XXWYSvk5zv8zvMShBDMw==; Date: Wed, 15 Nov 2023 14:02:52 +0200 Message-Id: <83h6lnrzpv.fsf@gnu.org> From: Eli Zaretskii To: Stefan Monnier In-Reply-To: (message from Stefan Monnier on Tue, 14 Nov 2023 17:09:45 -0500) Subject: Re: bug#67046: 29.1.50; map-y-or-n-p infinite loops if it's at the end of a kmacro References: <83il69xwsr.fsf@gnu.org> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 67046 Cc: sbaugh@janestreet.com, 67046@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Stefan Monnier > Cc: Eli Zaretskii , 67046@debbugs.gnu.org > Date: Tue, 14 Nov 2023 17:09:45 -0500 > > >> How can we be sure this doesn't introduce some regression? > > I'm not certain, but the behavior as written is a completely inert > > infinite loop, just sitting and spamming read-event over and over > > forever and maxing out the CPU. It seems hard for this to be correct > > behavior. > > Agreed. > > >> Do you understand why this loop was added, in commit 3f72fac865? > > I do not. > > Neither do I. The handling of keyboard macro wasn't very different from > what we have now, so by my reading of the code it suffered from the same > inf-loop as the one we're discussing. > > I see that Gerd fixed that commit a week later by removing a `not` which > strongly suggests the code wasn't tested very much, if at all. > > > Maybe this was some kind of XEmacs confusion? I don't know the full > > history of keyboard macros, but perhaps in XEmacs read-event would start > > returning keyboard input again after starting to return -1. (In GNU > > Emacs, AFAICT, it's always been the case that read-event returns -1 > > forever after we run out of input in the keyboard macro, but haven't yet > > actually returned from the command loop) > > Reading the code I'm wondering how come we don't get into inf-loops > more often when executing macros that stop in the middle of a recursive > edit, or minibuffer input, or ... So what is the path forward? Should we install the change on master and cross our fingers? From debbugs-submit-bounces@debbugs.gnu.org Wed Nov 15 12:17:25 2023 Received: (at 67046-done) by debbugs.gnu.org; 15 Nov 2023 17:17:25 +0000 Received: from localhost ([127.0.0.1]:53484 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1r3JW1-0006Us-0u for submit@debbugs.gnu.org; Wed, 15 Nov 2023 12:17:25 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:41618) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1r3JVy-0006Ue-Bt for 67046-done@debbugs.gnu.org; Wed, 15 Nov 2023 12:17:23 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1r3JVq-0001IW-7w; Wed, 15 Nov 2023 12:17:16 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=9Xva5cCdUlUjBEYUYbMbno6UgFCUvypoebhaTtsoyC0=; b=Pehfwrz41mhB 5n1haIst/JN+jvMYek8fnPzt7+Rpw89CWZ7dNYO4lWKctG4tIz1SAQwJmUKwnigTm/zcQOp/kzjUp TmviK0flYkWFjUwU4eEkkkIen43qoauxCWP9NuFJk5dyhqTlKSMrfqS9R47Z37yB+ApiVho++RuG1 mwBio8wuxg3MwMfopRMxOUbIl4ChkNHiJZGh1pnqIu+zMGQcWI8gkDlddEDzXEKIFuh5WsU5Ys1J2 89l1BuRHQb4GpxBIVe+amoNKqADDdnbNl6yT+9ypBSz/0U1sOpR+BnIOOPrh4ZMjqRwZQgf58wW1w bHHFOgnU7fV5kHcSpQcFLA==; Date: Wed, 15 Nov 2023 19:17:03 +0200 Message-Id: <83cywbq6ls.fsf@gnu.org> From: Eli Zaretskii To: Stefan Monnier In-Reply-To: (message from Stefan Monnier on Wed, 15 Nov 2023 07:19:34 -0500) Subject: Re: bug#67046: 29.1.50; map-y-or-n-p infinite loops if it's at the end of a kmacro References: <83il69xwsr.fsf@gnu.org> <83h6lnrzpv.fsf@gnu.org> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 67046-done Cc: sbaugh@janestreet.com, 67046-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Stefan Monnier > Cc: sbaugh@janestreet.com, 67046@debbugs.gnu.org > Date: Wed, 15 Nov 2023 07:19:34 -0500 > > > So what is the path forward? > > Should we install the change on master and cross our fingers? > > Yes, the change is safe. Thanks, installed on master, and closing the bug. From unknown Fri Jun 20 07:20:55 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Thu, 14 Dec 2023 12:24:11 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator