From unknown Sun Aug 10 16:50:04 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#43068 <43068@debbugs.gnu.org> To: bug#43068 <43068@debbugs.gnu.org> Subject: Status: 28.0.50; RET in todo-edit-mode indents too much Reply-To: bug#43068 <43068@debbugs.gnu.org> Date: Sun, 10 Aug 2025 23:50:04 +0000 retitle 43068 28.0.50; RET in todo-edit-mode indents too much reassign 43068 emacs submitter 43068 Stephen Berman severity 43068 normal thanks From debbugs-submit-bounces@debbugs.gnu.org Thu Aug 27 07:40:08 2020 Received: (at submit) by debbugs.gnu.org; 27 Aug 2020 11:40:08 +0000 Received: from localhost ([127.0.0.1]:41913 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kBGGF-0005P9-M2 for submit@debbugs.gnu.org; Thu, 27 Aug 2020 07:40:08 -0400 Received: from lists.gnu.org ([209.51.188.17]:52248) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kBGGC-0005Oy-EI for submit@debbugs.gnu.org; Thu, 27 Aug 2020 07:40:07 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41924) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kBGG8-0007Vm-S5 for bug-gnu-emacs@gnu.org; Thu, 27 Aug 2020 07:40:04 -0400 Received: from mout.gmx.net ([212.227.17.22]:53309) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kBGG3-0005qX-Ut for bug-gnu-emacs@gnu.org; Thu, 27 Aug 2020 07:40:00 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1598528393; bh=Cm9nDSxNGs/EEIoWDa61yc12FCrs6iuH6RsyUgkyuIc=; h=X-UI-Sender-Class:From:To:Subject:Date; b=KxViCbgjMPsXMrwRKtQiXdUY2EJreyqzCTehNoX8YWxHjn9ChBGQTjPzlEZM+vioQ WfzipnBkPsZ6OW7k5ZB0RO9rcV7tZ55axeBw0NWM6G5o8pWU7DqGIbfDyikO21mzhv 1u6aDb6kS3m5NGi4ce9R8lcTfuU+/aljAbKPF9L8= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from strobe-jhalfs ([178.1.125.104]) by mail.gmx.com (mrgmx105 [212.227.17.168]) with ESMTPSA (Nemesis) id 1Mqs0X-1kxGGn3NE9-00mpNO for ; Thu, 27 Aug 2020 13:39:52 +0200 From: Stephen Berman To: bug-gnu-emacs@gnu.org Subject: 28.0.50; RET in todo-edit-mode indents too much Date: Thu, 27 Aug 2020 13:39:51 +0200 Message-ID: <871rjs5nco.fsf@gmx.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Provags-ID: V03:K1:u86pgR2BZKDs94EEKLfCt18PzX5YgogyK/BMw4zrDwFM+W0XPed a0vutH8gTINuz6rlmtoG8Vb49DxottmLeNn0ZnfARNWgo9fl0mLwZVnfm4zjfsRjM4O8WeU Yfz6CurEC7VV94eYrS0h1t1p7fbCh1PL4qO8DkfX/qVde1U6cEAh/1CycJiCF0djNFcQM58 QidA5NiWK7/VSE8oZXb8w== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:CrxLHa94blw=:W6ewo5HjdRIJB6zIKsDB/p vvpkr/IW+R1GyMyFhbpb6IA5WykQ1ujJgUxbHUpUiF8aaJuldBLppg/4CKAxm3uWFD1Ott26V 0yPoETyChUGrAKD3Vrnp8Pb7y3j5BWMI0u6xHnknGUw2Lbq00E4Sbo4L+q0afswO141Hun21a B0BKFSbqAUqVO75eIgl1HIrsYq/UAklNmQm1lvLafzimiCX4+hq9cxOMPcwx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cV4Hcw3THjNExA== Received-SPF: pass client-ip=212.227.17.22; envelope-from=stephen.berman@gmx.net; helo=mout.gmx.net X-detected-operating-system: by eggs.gnu.org: First seen = 2020/08/27 07:39:53 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] 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: -0.1 (/) 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.4 (--) 0. emacs -Q 1. M-x todo-show RET (This will either visit an existing todo file or, if there isn't one, prompt to create it, along with its first category and item. Point will then be on the item.) 2. Type `em' to edit the item at point in todo-edit-mode. 3. Type RET to add a new line to the item. => This should insert a single tab 3 columns wide (the default value of todo-indent-to-here) at the start of the new line to satisfy the todo-mode file format, but instead two tabs are inserted (which also satisfies the format but is superfluous and here unexpected -- that is the bug). In todo-edit-mode `newline' (bound to RET) is remapped to `newline-and-indent' and indent-line-function is set to todo-indent, which calles `indent-to' with `todo-indent-to-here' as args. So typing RET inserts a tab 3 columns wide (by default). But by default electric-indent-mode is enabled and that calls indent-according-to-mode, which on typing RET again inserts a tab. Hence, two tabs. When the rewrite of todo-mode.el was added to Emacs (2013-06-19) electric-indent-mode was still disabled by default, and I hadn't been using it and it didn't occur to me that it could interact badly with todo-mode (and there haven't been bug reports about that till now). After the default was changed to enable electric-indent-mode (2013-11-29), I added the line `(electric-indent-mode -1)' to my init file, so I never saw the two tabs in my use of todo-mode. But recently I removed that line from my init file and then ran into this issue. Setting electric-indent-inhibit to t in todo-edit-mode does not fix the issue: it prevents reindentation but still calls indent-according-to-mode from electric-indent-post-self-insert-function, so two tabs are still inserted. But adding the line `(electric-indent-local-mode -1)' to todo-edit-mode does do the job. However, I think a different approach is better. Currently, `newline' is remapped to `newline-and-indent' not only in todo-edit-mode but also in todo-mode, and `indent-line-function' is set to `todo-indent' in both of these modes and well as in todo-archive-mode and todo-filtered-items-mode. But all of these modes except for todo-edit-mode are read-only modes, so inserting a newline by typing RET isn't even possible in them, therefore those settings are useless in those modes and it was a mistake to have them there at all. Moreover, todo-edit-quit, which is called to exit todo-edit-mode, runs a format check that inserts a tab at the beginning of each non-initial line of the edited item if they don't begin with whitespace; this makes using `newline-and-indent' unnecessary to ensure a proper format. (The doc string of todo-edit-quit doesn't explicitly say a tab is inserted, only "make sure the following lines are indented", but that seems sufficient. When editing an entire todo file instead of a single item, the format check simply signals a user error if there are non-initial item lines lacking initial whitespace, because editing an entire file risks corrupting the file format in various ways.) So my preference is to clean up and simplify todo-mode.el by removing the remapping of `newline' and only setting `indent-line-function' to `todo-indent' in todo-edit-mode. Then, typing RET in todo-edit-mode inserts a single tab if electric-indent-mode is enabled, and if it is disabled, no tab is inserted on typing RET, but one is then inserted by todo-edit-quit, thus preserving the required todo-mode file format. I will commit a patch for this to master, as well as three tests of indentation in todo mode, referencing the number of this bug report. (Ironically, till now the todo mode data file in the Emacs test directory contained a multiline item whose non-initial lines begin with two tabs: I wrote this file in a clean environment in which electric-indent-mode was enabled (as it is by default), but didn't notice the extra tabs until I wrote the tests accompanying the fix for this bug report. I've removed those extra tabs as part of the commit.) In GNU Emacs 28.0.50 (build 19, x86_64-pc-linux-gnu, GTK+ Version 3.24.17, cairo version 1.17.3) of 2020-08-27 built on strobe-jhalfs Repository revision: 4cf5d2ebee5ac45a435c991e4c0ad12be619d26b Repository branch: master Windowing system distributor 'The X.Org Foundation', version 11.0.12008000 System Description: Linux From Scratch SVN-20200401 Configured using: 'configure 'CFLAGS=-Og -g3' PKG_CONFIG_PATH=/opt/qt5/lib/pkgconfig' Configured features: XPM JPEG TIFF GIF PNG RSVG CAIRO SOUND DBUS GSETTINGS GLIB NOTIFY INOTIFY ACL GNUTLS LIBXML2 FREETYPE HARFBUZZ ZLIB TOOLKIT_SCROLL_BARS GTK3 X11 XDBE XIM MODULES THREADS LIBSYSTEMD PDUMPER LCMS2 From debbugs-submit-bounces@debbugs.gnu.org Thu Aug 27 08:03:48 2020 Received: (at 43068-done) by debbugs.gnu.org; 27 Aug 2020 12:03:48 +0000 Received: from localhost ([127.0.0.1]:41974 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kBGd9-0008Ek-Fy for submit@debbugs.gnu.org; Thu, 27 Aug 2020 08:03:47 -0400 Received: from mout.gmx.net ([212.227.17.22]:44475) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kBGd8-0008EY-8c for 43068-done@debbugs.gnu.org; Thu, 27 Aug 2020 08:03:46 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1598529820; bh=4YnXrmq4PLJAtUDakXiR1nctB9hNRRl10SlBDskQ8zc=; h=X-UI-Sender-Class:From:To:Subject:References:Date:In-Reply-To; b=hYHNPEAT8ywLjvwGr193RBbQt1i6p5+ZZ/RQnfTEHPHZVSnUtO0irH2giWIbi7eER FsFhg/8DEb/5ozaeAPjb24YUzBNAB3+SsGJY6vdQUGyyX53IpJtwV5cCp27euEyryd 706FV7kR66tAy3EhPsM4ENCn2btJ8Ux1HWqr2iJ0= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from strobe-jhalfs ([178.1.125.104]) by mail.gmx.com (mrgmx104 [212.227.17.168]) with ESMTPSA (Nemesis) id 1N8obG-1keKwH44Os-015rUl for <43068-done@debbugs.gnu.org>; Thu, 27 Aug 2020 14:03:40 +0200 From: Stephen Berman To: 43068-done@debbugs.gnu.org Subject: Re: bug#43068: 28.0.50; RET in todo-edit-mode indents too much References: <871rjs5nco.fsf@gmx.net> Date: Thu, 27 Aug 2020 14:03:39 +0200 In-Reply-To: <871rjs5nco.fsf@gmx.net> (Stephen Berman's message of "Thu, 27 Aug 2020 13:39:51 +0200") Message-ID: <87wo1k47ok.fsf@gmx.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Provags-ID: V03:K1:8DT+QS2Q8t8hPu1GvI18m4hIe9dz1TIR241FRbrM7ZHK0/P/syz UyrotAKYm7d8/MCXYseH2xXPD+bHUF1EqkZJf1XSr9HMf7I8N5zDtkn54VcdrqyZVupkoGY mtUslcBLZFip6R+ZRvjl17BqfSG9158u5Q4alNDqsX0PY2jVfHgCUfLltA0pfUkTQbS653A /dmtSeSIjCq6E2gG6A/4A== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:CL9OYfvKd7E=:J6EsK3g/np0ncim31iABdg 1TtlKs5fQqXCi0YivluyNekf9UaGGD+adeY0dHzPlrOatrDND3BXtq9RrMEFrIJz6YEfvHzCW oLCfJB596Qd5Eq4+iZTekvbae0tKOxEN5g1PxDLlK+KY/smClfWH8GH5bLBdusAovD7ZStTug pdydDMXYaWHtLuhcF3GfzBB8yu+G9aGld6EOvFv+nnVeooILmnMjNBuLoyY6UJpKesKgslAlL /UrxiCZzb02ubZEzCiSBtmZ0ipjc7Rym3C3f8Y7Fvh+2C3Cmaf5ik4TTm+URreqpV1UY/Mpdq t7jxRuzv0g0VOLOJJpNk+qtodxCmv3BH6xWA38CVoeIeGT9f4XAURb/1fxmvliVOdVMR+Ukxc iMh7TO/9SuQAiB0RQZTOEzG20N3UIhBv6rEHp9ldHVjBxXJxMaOtpE6z/t01H7Wj29DMpgov1 oAKCgc4zF62IbZdRYNVxkQPG2nEKMq7+h3WMZWqFc4JQcGucQ9Cxbca2KzDqOvlsYt0dg3gNO Bn0Q05RKJXvzCvB8s17iLag/JPj9ty36qxZ0DssAiQra/ciUoFFH5zK4JUBwoWlEOylqmwhX6 PUjLjmUhNcwr6HxtWvVkODGDxmRGbh/CXK264vz9HfmwAMedpLiDeO7N7xHN48g7riaS9EBGF qQBM5Zo0woonipEcFnT07ikcgUCS0iBsekRCVHNMHRJ18TlgPqUP1qenrnXH/tRspkDz0xw67 WuPrYc9Xv4ezvjWottH/tuD2owzwwQdZN29rI7lt6rSEcpf7xeSBYZ772uTv9TP7AwAnyJINm 1uvIndMospgEWrd7eyXgIPXgxaxDlhJ/F2/OANH5tw/iODlCyqTYfPH7yF/PdRxGVv6Z2htl4 TlpIgjMIlqskQrF08PMJup9UG06DSLz40neOqPxTTuQGknZEdDl6Q0m1MuskgI9lZOoMIWNxr 4vgP4YXL1QckvtKUIIwQkV+hvVuTGtkiAnri+PsmtCxKihP1FD+3yy7aAjt4JGo9oDX+oWQsT dPtSmPraHGVzgMw9IJ8ZK8YJMUcyVDmjiyzn/6DVXeL0ZCLA0VA8jOfvVQ0RC/nAoLx/6ifi/ yqjFdIpfmHP2eFqMz5Xa4PPx4WCb+2o2ciWdFkIEg4hKt0DydYYKdJkewfsR6Wv64a08HKJ6Y iZKoxvi/vHIkt64NCQR9pgnzMbJV+lWI1TZE0fKbd/nEBuHbNdKVRd7SBZ/tKumSU/xocUjuj VRMKcx/jWWSVEGeAEKoNUBs3GjWAaxPhig+Yf5A== X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 43068-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 Thu, 27 Aug 2020 13:39:51 +0200 Stephen Berman wrote: > 0. emacs -Q > 1. M-x todo-show RET > (This will either visit an existing todo file or, if there isn't one, > prompt to create it, along with its first category and item. Point > will then be on the item.) > 2. Type `em' to edit the item at point in todo-edit-mode. > 3. Type RET to add a new line to the item. > => This should insert a single tab 3 columns wide (the default value > of todo-indent-to-here) at the start of the new line to satisfy the > todo-mode file format, but instead two tabs are inserted (which also > satisfies the format but is superfluous and here unexpected -- that > is the bug). [...] > I will commit a patch for this to master, as well as three tests of > indentation in todo mode, referencing the number of this bug report. Done in commit ed3c971534 and closing. Steve Berman From unknown Sun Aug 10 16:50:04 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Fri, 25 Sep 2020 11:24:04 +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