X-Loop: help-debbugs@HIDDEN Subject: bug#24991: 25.1; 7 bugs in kmacro-step-edit-macro Resent-From: Gemini Lasswell <gazally@HIDDEN> Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> Resent-CC: bug-gnu-emacs@HIDDEN Resent-Date: Tue, 22 Nov 2016 22:12:02 +0000 Resent-Message-ID: <handler.24991.B.147985266511436 <at> debbugs.gnu.org> Resent-Sender: help-debbugs@HIDDEN X-GNU-PR-Message: report 24991 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: 24991 <at> debbugs.gnu.org X-Debbugs-Original-To: bug-gnu-emacs@HIDDEN Received: via spool by submit <at> debbugs.gnu.org id=B.147985266511436 (code B ref -1); Tue, 22 Nov 2016 22:12:02 +0000 Received: (at submit) by debbugs.gnu.org; 22 Nov 2016 22:11:05 +0000 Received: from localhost ([127.0.0.1]:38659 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1c9JHM-0002yL-7w for submit <at> debbugs.gnu.org; Tue, 22 Nov 2016 17:11:05 -0500 Received: from eggs.gnu.org ([208.118.235.92]:57401) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <gazally@HIDDEN>) id 1c9JHK-0002xr-2a for submit <at> debbugs.gnu.org; Tue, 22 Nov 2016 17:11:02 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from <gazally@HIDDEN>) id 1c9JHD-0003Jw-Lj for submit <at> debbugs.gnu.org; Tue, 22 Nov 2016 17:10:56 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,FREEMAIL_FROM autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:57510) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from <gazally@HIDDEN>) id 1c9JHD-0003Jm-IY for submit <at> debbugs.gnu.org; Tue, 22 Nov 2016 17:10:55 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:48372) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from <gazally@HIDDEN>) id 1c9JHB-000250-Rg for bug-gnu-emacs@HIDDEN; Tue, 22 Nov 2016 17:10:55 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from <gazally@HIDDEN>) id 1c9JH8-0003HJ-JF for bug-gnu-emacs@HIDDEN; Tue, 22 Nov 2016 17:10:53 -0500 Received: from aibo.runbox.com ([91.220.196.211]:54253) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from <gazally@HIDDEN>) id 1c9JH8-0003GB-8Y for bug-gnu-emacs@HIDDEN; Tue, 22 Nov 2016 17:10:50 -0500 Received: from [10.9.9.211] (helo=mailfront11.runbox.com) by bars.runbox.com with esmtp (Exim 4.71) (envelope-from <gazally@HIDDEN>) id 1c9JH6-0003kX-Eo for bug-gnu-emacs@HIDDEN; Tue, 22 Nov 2016 23:10:48 +0100 Received: from c-24-22-244-161.hsd1.wa.comcast.net ([24.22.244.161] helo=rainbow.local) by mailfront11.runbox.com with esmtpsa (uid:179284 ) (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) id 1c9JGp-0002wB-LV for bug-gnu-emacs@HIDDEN; Tue, 22 Nov 2016 23:10:32 +0100 From: Gemini Lasswell <gazally@HIDDEN> Date: Tue, 22 Nov 2016 14:10:21 -0800 Message-ID: <m2shqjqi7m.fsf@HIDDEN> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x [fuzzy] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -4.1 (----) X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -4.1 (----) 1. It is possible to change a numeric argument during step-editing, but the number gets inserted into the buffer. F3 C-u 3 a RET F4 C-x C-k SPC SPC R 8 ! F4 Result: during the step-editing process the 8 gets inserted into the buffer instead of being passed as an argument to self-insert-command. The editing of the macro is successful however: running the macro after editing will insert 8 a's. If you use C-3 instead of C-u 3, kmacro-step-edit-macro also fails to pass the numeric argument during editing: F3 C-3 a RET F4 C-x C-k SPC R C-8 ! F4 2. Appending to the end of a macro doesn't work. F3 a RET F4 C-x C-k SPC SPC A b RET C-j F4 Result: "After 0 kbd macro iterations: Keyboard macro terminated by a command ringing the bell" in the echo area. If you use C-x C-k C-v to show the macro in the echo area, it shows: "Last macro: a RET <nil> b RET". 3. Skipping or deleting every event in the macro produces an empty macro. F3 hello F4 C-x C-k SPC C-k C-x C-k C-v Result: "Last macro:" appears in the echo area. If you try C-x C-k SPC again, nothing happens, because the head of the kmacro ring (the variable last-kbd-macro) is set to "". According to the commentary at the beginning of kmacro.el, an empty macro should never be added to the macro ring. It is also possible to make an empty macro by skipping the macro events individually by typing d repeatedly instead of C-k, or by deleting events by replacing them with nothing by repeatedly typing r C-j. 4. A macro which uses a negative universal argument is corrupted by step-editing. F3 hello C-u - M-u F4 C-x C-k SPC SPC ! F4 Result: "After 0 kbd macro iterations: funcall-interactively: Negative repetition argument -1". The text "hello" is inserted in the buffer by the last F4 instead of "HELLO". C-x C-k C-v will reveal that the macro has been changed to "Last macro: hello C-u - \365". In this case, the bug does not occur if you use C-- in the macro instead of C-u -. 5. Step-editing corrupts a macro which uses quoted-insert. F3 C-q 17051 i there F4 C-x C-k SPC SPC ! F4 Result: "After 0 kbd macro iterations: read-quoted-char: Args out of range: [], 0". C-x C-k C-v will reveal that the macro has been truncated. Step-edit works as expected if you define the macro this way instead: F3 C-q 17051 RET i there F4 6. The prompt disappears when trying to edit a quoted-insert command, and then the C-j used to end a replaced sequence gets inserted into the macro. F3 C-q 17051 RET i there RET F4 C-x C-k SPC r C-q 17052 C-j C-j ! F4 Result: kmacro-step-edit-macro's minibuffer prompt disappears when you type C-q. But step-edit is still active. Instead of the first C-j exiting replace mode, it exits quoted-insert and inserts the C-j (LFD) in the macro. The LFD in the macro causes the F4 to send you to *Backtrace* headed by this message: "Debugger entered--Lisp error: (void-variable =E1=B8=AA)". Comment: It could probably be argued that inserting the line feed is the expected behavior of quoted-insert, but it's pretty confusing from a user's point of view. Since kmacro-step-edit-macro has special case code already to handle quoted-insert, that special case code could make sure LFD doesn't end up in the macro. 7. Replacing C-w with M-w produces an unexpected result. F3 abc C-b C-b C-SPC C-f C-w C-e C-y RET F4 C-x C-k C-SPC TAB TAB TAB TAB r M-w C-j ! F4 Result: "ab=C3=B7cb" is inserted in the buffer by the F4. In GNU Emacs 25.1.1 (x86_64-apple-darwin15.6.0, NS appkit-1404.47 Version 1= 0.11.6 (Build 15G1004)) of 2016-10-09 built on rainbow.local Windowing system distributor 'Apple', version 10.3.1404 Configured using: 'configure --disable-dependency-tracking --disable-silent-rules --enable-locallisppath=3D/usr/local/share/emacs/site-lisp --infodir=3D/usr/local/Cellar/emacs/25.1/share/info/emacs --prefix=3D/usr/local/Cellar/emacs/25.1 --without-x --with-xml2 --without-dbus --with-gnutls --with-imagemagick --with-rsvg --with-ns --disable-ns-self-contained' Configured features: JPEG RSVG IMAGEMAGICK NOTIFY ACL GNUTLS LIBXML2 ZLIB TOOLKIT_SCROLL_BARS NS Important settings: value of $LANG: en_US.UTF-8 locale-coding-system: utf-8-unix Major mode: Lisp Interaction Minor modes in effect: tooltip-mode: t global-eldoc-mode: t electric-indent-mode: t mouse-wheel-mode: t tool-bar-mode: t menu-bar-mode: t file-name-shadow-mode: t global-font-lock-mode: t font-lock-mode: t blink-cursor-mode: t auto-composition-mode: t auto-encryption-mode: t auto-compression-mode: t line-number-mode: t transient-mark-mode: t Recent messages: next-line: End of buffer [2 times] Defining kbd macro... Keyboard macro defined After 0 kbd macro iterations: undefined: Keyboard macro terminated by a com= mand ringing the bell Defining kbd macro... Mark set Keyboard macro defined Defining kbd macro... Mark set [2 times] Keyboard macro defined Load-path shadows: None found. Features: (debug ido seq byte-opt gv bytecomp byte-compile cconv ispell novice rect pp shadow sort mail-extr emacsbug message dired format-spec rfc822 mml mml-sec password-cache epg epg-config gnus-util mm-decode mm-bodies mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader sendmail rfc2047 rfc2045 ietf-drums mm-util help-fns mail-prsvr mail-utils cl-seq cl-extra help-mode easymenu edmacro cl-loaddefs pcase cl-lib kmacro time-date mule-util tooltip eldoc electric uniquify ediff-hook vc-hooks lisp-float-type mwheel ns-win ucs-normalize term/common-win tool-bar dnd fontset image regexp-opt fringe tabulated-list newcomment elisp-mode lisp-mode prog-mode register page menu-bar rfn-eshadow timer select scroll-bar mouse jit-lock font-lock syntax facemenu font-core frame 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 charscript case-table epa-hook jka-cmpr-hook help simple abbrev minibuffer 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 kqueue cocoa ns multi-tty make-network-process emacs) Memory information: ((conses 16 217601 34764) (symbols 48 21346 5) (miscs 40 136 419) (strings 32 22114 4019) (string-bytes 1 637033) (vectors 16 35956) (vector-slots 8 684530 15007) (floats 8 193 526) (intervals 56 675 195) (buffers 976 22))
Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.505 (Entity 5.505) Content-Type: text/plain; charset=utf-8 X-Loop: help-debbugs@HIDDEN From: help-debbugs@HIDDEN (GNU bug Tracking System) To: Gemini Lasswell <gazally@HIDDEN> Subject: bug#24991: Acknowledgement (25.1; 7 bugs in kmacro-step-edit-macro) Message-ID: <handler.24991.B.147985266511436.ack <at> debbugs.gnu.org> References: <m2shqjqi7m.fsf@HIDDEN> X-Gnu-PR-Message: ack 24991 X-Gnu-PR-Package: emacs Reply-To: 24991 <at> debbugs.gnu.org Date: Tue, 22 Nov 2016 22:12:02 +0000 Thank you for filing a new bug report with debbugs.gnu.org. This is an automatically generated reply to let you know your message has been received. Your message is being forwarded to the package maintainers and other interested parties for their attention; they will reply in due course. Your message has been sent to the package maintainer(s): bug-gnu-emacs@HIDDEN If you wish to submit further information on this problem, please send it to 24991 <at> debbugs.gnu.org. Please do not send mail to help-debbugs@HIDDEN unless you wish to report a problem with the Bug-tracking system. --=20 24991: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D24991 GNU Bug Tracking System Contact help-debbugs@HIDDEN with problems
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997 nCipher Corporation Ltd,
1994-97 Ian Jackson.