From debbugs-submit-bounces@debbugs.gnu.org Tue May 14 09:18:34 2024 Received: (at submit) by debbugs.gnu.org; 14 May 2024 13:18:34 +0000 Received: from localhost ([127.0.0.1]:39305 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1s6s37-0004uy-LR for submit@debbugs.gnu.org; Tue, 14 May 2024 09:18:34 -0400 Received: from lists.gnu.org ([209.51.188.17]:46664) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1s6s33-0004us-An for submit@debbugs.gnu.org; Tue, 14 May 2024 09:18:32 -0400 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 1s6s2w-0004y4-80 for bug-gnu-emacs@gnu.org; Tue, 14 May 2024 09:18:23 -0400 Received: from mout.gmx.net ([212.227.15.18]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1s6s2o-0002Kv-6S for bug-gnu-emacs@gnu.org; Tue, 14 May 2024 09:18:21 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmx.net; s=s31663417; t=1715692691; x=1716297491; i=stephen.berman@gmx.net; bh=2TWri34DNKO2G7CQUnn04PlgqywSIIRjPOn4wtFAUkE=; h=X-UI-Sender-Class:From:To:Subject:Date:Message-ID:MIME-Version: Content-Type:cc:content-transfer-encoding:content-type:date:from: message-id:mime-version:reply-to:subject:to; b=WmcwOCpNNGummX7WVLig1jvmpjMWb5aq2lnkHB1Q9ankv7OpURNHru3yd7i4r8bS rISqEKzK4cxlw0FrUqR+0+GkLSx/a94Y5q0iJDH+3Oo5jCHKvBM/N73Bn/knVy3DD aMD4wNO2k/AIJiktvWFS4rxaI7kNNSlZ52Y5aMB4Wg5hFtAOqvDTSte83uzHNfZER yIAqVePNtN6VnxBFUp81u1AEMBQgzEvXJ5zLS+jwiJ7s1bwPPgfU6c+eefQzB1rC2 2+9tGMJZ/M8yUm9T8gB6UeHzXZkfUE798tQFDeMGknqSgIMJAASyaIcCqlM/nj2Eq tlDSCFAyK7JKOV9i5w== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Received: from strobelfs ([88.130.50.190]) by mail.gmx.net (mrgmx004 [212.227.17.190]) with ESMTPSA (Nemesis) id 1MS3mz-1rzM5Z48tP-00SNUx for ; Tue, 14 May 2024 15:18:11 +0200 From: Stephen Berman To: bug-gnu-emacs@gnu.org Subject: 30.0.50; todo-mode item insertion bug X-Debbugs-Cc: Date: Tue, 14 May 2024 15:18:03 +0200 Message-ID: <878r0ch6r8.fsf@gmx.net> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Provags-ID: V03:K1:O1FvtyPJmCBqD44s2gTvowKWUm/f+YU6jwGShLjTv+/UG3Ian8s TdJ/+Cm1fwYx16bqrUU27+TD0UI/J5VbPN3JUT/zdoKG4FyQA+kKTcsmtN9h5qGxrvwvW6z RYFOm5uDXOKFEow4gO1bWme2TewYw2Kyg/oGCegbDXzY36XqD2FXTRN5+jaB35jY5/kPt9n yRn4arDkdFMpYVmpFx6Hw== X-Spam-Flag: NO UI-OutboundReport: notjunk:1;M01:P0:Q1lIqDuM6Ro=;jI1D2Y6uTrAwnl34yQDhi0KdE7R KbK03li42b04OK7UKLGbUNatb14fKrxdeo1jeEWWwW5s6SOVMfEKTCa2a7T0mswp422/ovyzC GhCuRyCw+DMMkgfjCUBXeju3WZGkRZ6sbTB46zXdxHH/fZrNkGCs8IrArVEIn5Jlnv1bItWX6 rHb/gWfppvNjNYcewVleHTpkuLRMfqMUoh8lMBDB+fubvF20rk7+/07yNkOXyQhczgEIU3NLA 7pdyPztVH3fmCJMqTcolBcPVR4nhbcJQCDg/1aecYcvnkwdjFHfQqqfmjGu2e5x4kwkBfdSBS U/C6lsIXf8jti3OWYGE0md9lUqBaCMf9ESmsa2ojphIaeNMT9Ua44tKcGSTx7fXpRfLoGKTRb AVkJyTgQ34ThwmGw2YGB/3vqdZMKTFSijnZdRlXxPlBJdPt3pOStRvRyP5o2yOYP8w+xcKHAi RdY4BlTEmRsLeK7SVmJ7FnLjsfgH4v6Yx7sPkGIBopUY8zNKwVkDC6KBD7wL+uhNv0M95Ao97 vtRB1To6E//QYN61bVg1yV8QaydkPbs3sDXxS01bvq0wiOuT5ofPjbHJE9SDL//ydv3NcYALS rT0g2JMMnRuI1/vkKKjnlNdv2AKSWeJUEx9yQ9d0oYnxJ6MxQJux4lYNXInPDsP3bxQ7oYWP1 4GSSxpgCxoEt6EHZuG8+8Gg1LmJP+37knVSh7lyykBtfwSCOop9WqoDpA6v4n49cbPaS+EhlV B6tK4rJgk4oAtBPufr4SyIWLZP1vlc9IM6uA5PvH7znJrwW+jyLArzbgMkWp4g8tTrmjKBQ2M PD9fNiRIgkNqARsO0sHqFSSVHr4FlzNcvz4mClM3eSHgA= Received-SPF: pass client-ip=212.227.15.18; envelope-from=stephen.berman@gmx.net; helo=mout.gmx.net X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.3 (-) 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: -2.3 (--) --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable 0. emacs -Q (If you don't use todo-mode and don't want to change ~/.emacs.d by carrying out the following recipe, you can start Emacs with e.g. `HOME=3D/tmp/user emacs -Q'.) 1. Type `M-x todo-show'. If you have not already created a todo file in todo-mode, respond to the successive prompts to enter a todo file name, a category, and an item, e.g. "todo RET test RET test RET". If you do already have a todo file, by typing `M-x todo-show' you are now visiting it in todo-mode. =20=20=20 2. Now in the current todo category type `i' to initiate an item insertion command. This displays the following prompt in the echo area: Press a key (so far =E2=80=98i=E2=80=99): { i=3D>default p=3D>copy } { = y=3D>diary k=3D>nonmarking } { c=3D>calendar d=3D>date n=3D>dayname } t=3D>= time { h=3D>here r=3D>region } You build an item insertion command by successively typing a key from one or more of the groups in the prompt (details are in the Todo manual). You can skip a group but you cannot enter a key out of the given order. So e.g. `i y c t h' and `i k r' are valid item insertion commands, but `i c y' and `i t k' are invalid. 3. If you do enter `i c y' you get the error message "y is undefined" and the item insertion command construction is broken off. That's fine, because `y' has been entered out of order for item insertion and is otherwise not a key for a todo-mode command. =20=20=20 4. Now comes the bug: If you enter `i t k', after pressing `k' the item at point is highlighted and the echo area displays the prompt "Permanently delete this item? (y or no)". This is because `k' is also bound in todo-mode to the command for deleting an item; it can only be part of a item insertion command when it is entered before any item insertion key from a later group (thus, `i k t k' is also invalid and has the same effect as `i t k'). Likewise, typing `i t p', `i t n' or `i t d' breaks off the item insertion command and executes a non-insertion todo-mode command. And if you mistakenly type a key that is not an item insertion key but is bound in todo-mode, e.g. `m' in the sequence `i m', then the todo-mode command it is bound to is executed. Such unintended command execution is at least confusing, and in the worst case can result in data loss (e.g. with `k' if the user is inattentive). The attached patch prevents the unintended execution of a todo-mode command due to mistaken or out-of-order item insertion key input. In that case a message is displayed, e.g. "=E2=80=98k=E2=80=99 is not a valid = remaining item insertion key" (the word "remaining" is meant to indicate that the key is not valid at this point in the sequence), and the construction of the item insertion command breaks off. Instead of breaking off the key input, a more user-friendly fix might be to continue prompting to enter the item insertion keys as long as an invalid key is entered, but I haven't found a way to do that within the current implemention, which uses set-transient-map, and changing the implemention seems non-trivial and trying to do that just to slightly increase the user-friendliness is probably more effort than it's worth. But if someone sees a straightforward way to do that, I'm all ears. Otherwise, if there are no objections within a few days I will install the attached patch to master (the bug has existed since the use of set-transient-map (then still called set-temporary-overlay-map) was added to todo-mode.el in commit f3a66082). --=-=-= Content-Type: text/x-patch Content-Disposition: attachment Content-Description: todo-mode.el patch diff --git a/lisp/calendar/todo-mode.el b/lisp/calendar/todo-mode.el index 12287299a7f..36f1982f447 100644 --- a/lisp/calendar/todo-mode.el +++ b/lisp/calendar/todo-mode.el @@ -5794,7 +5794,24 @@ todo-insert-item--next-param (apply #'todo-insert-item--basic (nconc arg parlist))))) ;; Operate on a copy of the parameter list so the original is ;; not consumed, thus available for the next key typed. - (params0 params)) + (params0 params) + (tm-keys (let (l) + (map-keymap (lambda (key _binding) + (push key l)) + todo-mode-map) + l))) + ;; Initially assign each key in todo-mode-map a function identifying + ;; it as invalid for item insertion, thus preventing mistakenly + ;; pressing a key from executing an unwanted different todo-mode + ;; command (bug#xxxx); the actual item insertion keys are redefined + ;; when looping over the item insertion parameters. + (dolist (k tm-keys) + (when (characterp k) + (define-key map (string k) + (lambda () + (interactive) + (message (concat "`%s' is not a valid remaining item insertion key") + (string k)))))) (when last (if (memq last '(default copy)) (progn --=-=-= Content-Type: text/plain In GNU Emacs 30.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.41, cairo version 1.18.0) of 2024-05-08 built on strobelfs Repository revision: e020f4e9ce5d98438033fea098d943c311b0fa3d Repository branch: master Windowing system distributor 'The X.Org Foundation', version 11.0.12101013 System Description: Linux From Scratch r12.1-53 Configured using: 'configure -C 'CFLAGS=-Og -g3' PKG_CONFIG_PATH=/opt/qt5/lib/pkgconfig' Configured features: ACL CAIRO DBUS FREETYPE GIF GLIB GMP GNUTLS GPM GSETTINGS HARFBUZZ JPEG LCMS2 LIBSYSTEMD LIBXML2 MODULES NATIVE_COMP NOTIFY INOTIFY PDUMPER PNG RSVG SECCOMP SOUND SQLITE3 THREADS TIFF TOOLKIT_SCROLL_BARS TREE_SITTER WEBP X11 XDBE XIM XINPUT2 XPM GTK3 ZLIB --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Tue May 21 05:10:45 2024 Received: (at 70937-done) by debbugs.gnu.org; 21 May 2024 09:10:45 +0000 Received: from localhost ([127.0.0.1]:48043 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1s9LW9-0005qZ-Gn for submit@debbugs.gnu.org; Tue, 21 May 2024 05:10:45 -0400 Received: from mout.gmx.net ([212.227.15.18]:36503) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1s9LW6-0005qP-A6 for 70937-done@debbugs.gnu.org; Tue, 21 May 2024 05:10:43 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmx.net; s=s31663417; t=1716282631; x=1716887431; i=stephen.berman@gmx.net; bh=V5NwuJ3I2prBAA6Jwn5aYW0ui4WbKkzw6iWa3RLWWHU=; h=X-UI-Sender-Class:From:To:Subject:In-Reply-To:References:Date: Message-ID:MIME-Version:Content-Type:Content-Transfer-Encoding:cc: content-transfer-encoding:content-type:date:from:message-id: mime-version:reply-to:subject:to; b=LY0C5oOvNutp8Z+s+nZCn5brEvzxdzXDQfnS2kKjZTyvPhd0sSr5PWsAbcA7x12a +Z8j1q+Hpd2rw0bfJ+SgopR60Af1K0nnhwYTXGVk6lw+aL/aLIshesGm/1DvAuICZ F0jjHIAjVJ5RdIMstd1MvDShj9LNeZXdguH4IH34oE42xsaI2rrfBxmEvvNDWRUFa vGnneN62ut0YqFCpGJxD4DKPPEIvnJ8T9h7hAC32YZvVLTNKTG7FtZmCIi9+cni6d ZqqWfv1ZRmYsdFyKIf7xaU/ctCSFcAfERm9/fm2CKGuOpwlWmbOGVIg5ZhTurVvLh yZQD9eW8J7jjmJTRrA== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Received: from strobelfs ([88.130.49.175]) by mail.gmx.net (mrgmx005 [212.227.17.190]) with ESMTPSA (Nemesis) id 1MpDJd-1stOWG0mzv-00qhYX for <70937-done@debbugs.gnu.org>; Tue, 21 May 2024 11:10:31 +0200 From: Stephen Berman To: 70937-done@debbugs.gnu.org Subject: Re: bug#70937: 30.0.50; todo-mode item insertion bug In-Reply-To: <878r0ch6r8.fsf@gmx.net> (Stephen Berman's message of "Tue, 14 May 2024 15:18:03 +0200") References: <878r0ch6r8.fsf@gmx.net> Date: Tue, 21 May 2024 11:10:30 +0200 Message-ID: <87ttiro7i1.fsf@gmx.net> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Provags-ID: V03:K1:F5VBjw5HG8lMjV8imwU3XIQlQA7qt2CXoEU7w3hsod5h3FekJaw oyiHPSoFQNiIdbYpWtZclDvNmSmWhGbmgdfF/vOVa680SSe7PFFagjpqoOjittaZK5vKKIs wHAjxvL0psm8mVhhfPFrqpyitbYtZGBmnxPwrEzpAFlabdpySUtOL5SSRkbvViyRcEZdvAK P/vrfJqXJYhkXobuCkQjQ== X-Spam-Flag: NO UI-OutboundReport: notjunk:1;M01:P0:H0QsBHDYspA=;wFfI+TXwGZRrFfPckqLeWbE/HiQ Xx8eyiAqgciG0wf9ALIf7famHiBLra6VQLQJwMqKU1RxPlzHsaU+XP+oLS/OOPwa1t1J4zQ/O 4pDcHrLOUJU2MQS+bDBNqgKAPPKlui/nmWzC32cu11hS/AISKdvbNesbS5GJKMrHUNwnrJx3O yTqRypcLZ7TK1x4BlCK2g93i6nLGUFWQqC/qvw0yCrgdyZcZc0EL5bXXfOCpAX9byJLdOm7fU evT9lXgnDQj0bGUS0THfAaht31UAqEjTBI7WJftoBBqD5Hg2UrsiwuHB420lLF1KXGgQllpcI dpdFsEHThCfpTEzgrhFSGBz7zQiQfVkhj4vgAbzdJ/SNl9QXJP/fQC7XCn46lE2H4M9HHZi25 7OIGFizyxjhu4vrhi0uWcMcdr8L5qL6psg7Bg/TE7iFhlzPfmqKWqP223AKARVQdLEyMMXioR nnoZOZOHY0bm9/DwJBqdBotMdGhZfBmOSo+KbzcWxrxx1E2Oq6vXKbNAjdIkEVGsQLy0FdGuf /qcKDnHEZOruv88whoapkJl/4zWjz4teEemks1WmlNRXW4bDbzVKdx+WZ2nu0hSbLzjBUvj8e IyQ0XtcnqMTApuHUGOnaULBZHNK7knQ3s8D8y+IbPMFONgN134Z0X8GAI9OQVAji8o8e2fPYR AlPklLz0Vs8jGkOhdL4h7Xr95r5QTqL0FU2EUm/izxPPLHzyJ4sN+E4RlIV4TfA80Q/HEJnxj m6htArIVhj0RCXGaZGUpH2eQL+ExaOvhy5TI2acg6ai6NXxN+0G7vVUz39mCLuROtl2wM5xUU mtBevwJCNraPaQLyFP7dsVF7zQBYt70njiDmUBoFJSSaU= X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 70937-done 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.7 (-) On Tue, 14 May 2024 15:18:03 +0200 Stephen Berman = wrote: [...] > The attached patch prevents the unintended execution of a todo-mode > command due to mistaken or out-of-order item insertion key input. In > that case a message is displayed, e.g. "=E2=80=98k=E2=80=99 is not a vali= d remaining > item insertion key" (the word "remaining" is meant to indicate that the > key is not valid at this point in the sequence), and the construction of > the item insertion command breaks off. [...] > [I]f there are no objections within a few days I will install > the attached patch to master [...] I've seen no objections, so I installed the patch as commit 7f80070232a and am closing this bug. Steve Berman From unknown Mon Jun 23 07:51:05 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Tue, 18 Jun 2024 11:24:07 +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