From unknown Sat Aug 16 16:57:12 2025 X-Loop: owner@emacsbugs.donarmstrong.com Subject: bug#2084: 23.0.60; todo-insert-item-here bug + patch Reply-To: Stephen Berman , 2084@debbugs.gnu.org Resent-From: Stephen Berman Original-Sender: steve@escher.local.home Resent-To: bug-submit-list@lists.donarmstrong.com Resent-CC: Emacs Bugs Resent-Date: Tue, 27 Jan 2009 15:15:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-Emacs-PR-Message: report 2084 X-Emacs-PR-Package: emacs X-Emacs-PR-Keywords: Received: via spool by submit@emacsbugs.donarmstrong.com id=B.123306893813949 (code B ref -1); Tue, 27 Jan 2009 15:15:03 +0000 Received: (at submit) by emacsbugs.donarmstrong.com; 27 Jan 2009 15:08:58 +0000 X-Spam-Checker-Version: SpamAssassin 3.2.5-bugs.debian.org_2005_01_02 (2008-06-10) on rzlab.ucr.edu X-Spam-Level: X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. X-Spam-Status: No, score=0.1 required=4.0 tests=FOURLA,MURPHY_DRUGS_REL8 autolearn=no version=3.2.5-bugs.debian.org_2005_01_02 Received: from fencepost.gnu.org (fencepost.gnu.org [140.186.70.10]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id n0RF8sxn013943 for ; Tue, 27 Jan 2009 07:08:56 -0800 Received: from mail.gnu.org ([199.232.76.166]:57626 helo=mx10.gnu.org) by fencepost.gnu.org with esmtp (Exim 4.67) (envelope-from ) id 1LRpX1-000759-I7 for emacs-pretest-bug@gnu.org; Tue, 27 Jan 2009 10:07:15 -0500 Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60) (envelope-from ) id 1LRpYY-0005aI-WB for emacs-pretest-bug@gnu.org; Tue, 27 Jan 2009 10:08:52 -0500 Received: from mail.gmx.net ([213.165.64.20]:46756) by monty-python.gnu.org with smtp (Exim 4.60) (envelope-from ) id 1LRpYY-0005Zs-FN for emacs-pretest-bug@gnu.org; Tue, 27 Jan 2009 10:08:50 -0500 Received: (qmail invoked by alias); 27 Jan 2009 15:08:47 -0000 Received: from i59F57C0C.versanet.de (EHLO escher.local.home) [89.245.124.12] by mail.gmx.net (mp033) with SMTP; 27 Jan 2009 16:08:47 +0100 X-Authenticated: #20778731 X-Provags-ID: V01U2FsdGVkX1/86MIyqoT80E+QGOvaMVCsbh3PvWeAFm35EwyR02 /6eCBqZazc0UYW Received: by escher.local.home (Postfix, from userid 1000) id CF07B1D1242; Tue, 27 Jan 2009 16:08:45 +0100 (CET) From: Stephen Berman To: emacs-pretest-bug@gnu.org Sender: steve@escher.local.home Date: Tue, 27 Jan 2009 16:08:45 +0100 Message-ID: <878wowyef6.fsf@escher.local.home> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (gnu/linux) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Y-GMX-Trusted: 0 X-FuHaFi: 0.55 X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) --=-=-= The following bug, reported in http://lists.gnu.org/archive/html/bug-gnu-emacs/2001-11/msg00234.html, still exists in the CVS trunk: From: Daniel Ortmann Subject: todo-mode: pressing "I" when at the end of the line inserts the todo information at the END of the current line To: bug-gnu-emacs@gnu.org Date: 06 Nov 2001 12:36:08 -0600 > Pressing "I" when at the end of the line inserts the todo information at > the END of the current line. It should add the new information to the > FRONT of the current line. In http://lists.gnu.org/archive/html/bug-gnu-emacs/2001-11/msg00429.html I pointed out that `I' (todo-insert-item-here) in fact inserts a new Todo entry anywhere and that, while this behavior is strictly consistent with the doc string, it is generally undesirable, and provided a patch to restrict the entry point. The patch was not committed to CVS, which is just as well, since it was deficient. Nevertheless, the existing definition remains buggy -- it could result in making the new entry inaccessible to Todo mode commands. For example, let a Todo mode category contain the following: */* 2009-01-27 15:30 steve: This is item1. Place point between "is" and "item1", type `I' and at the prompt `This is item2.'; now the category looks like this: */* 2009-01-27 15:30 steve: This is*/* 2009-01-27 15:30 steve: This is item2. item1. The new entry is not recognized as such by Todo mode commands. The attached patch fixes this by consistently inserting the new entry directly above the current entry (unless point is on an empty line, then it inserts the new entry there). 2009-01-20 Stephen Berman * calendar/todo-mode.el (todo-insert-item-here): Prevent insertion of a new entry inside of an existing entry. Minor code cleanup. --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=todo-insert-item-here.diff Content-Description: todo-mode patch *** emacs/lisp/calendar/todo-mode.el.~1.72.~ 2009-01-09 11:48:58.000000000 +0100 --- emacs/lisp/calendar/todo-mode.el 2009-01-20 21:30:15.000000000 +0100 *************** *** 610,625 **** (defalias 'todo-cmd-inst 'todo-insert-item) (defun todo-insert-item-here () ! "Insert new TODO list entry under the cursor." ! (interactive "") ! (save-excursion ! (if (not (derived-mode-p 'todo-mode)) (todo-show)) ! (let* ((new-item (concat todo-prefix " " ! (read-from-minibuffer ! "New TODO entry: " ! (if todo-entry-prefix-function ! (funcall todo-entry-prefix-function)))))) ! (insert (concat new-item "\n"))))) (defun todo-more-important-p (line) "Ask whether entry is more important than the one at LINE." --- 610,629 ---- (defalias 'todo-cmd-inst 'todo-insert-item) (defun todo-insert-item-here () ! "Insert a new TODO list entry directly above the entry at point. ! If point is on an empty line, insert the entry there." ! (interactive) ! (if (not (derived-mode-p 'todo-mode)) (todo-show)) ! (let ((new-item (concat todo-prefix " " ! (read-from-minibuffer ! "New TODO entry: " ! (if todo-entry-prefix-function ! (funcall todo-entry-prefix-function)))))) ! (unless (and (bolp) (eolp)) (goto-char (todo-item-start))) ! (insert (concat new-item "\n")) ! (backward-char) ! ;; put point at start of new entry ! (goto-char (todo-item-start)))) (defun todo-more-important-p (line) "Ask whether entry is more important than the one at LINE." --=-=-=-- From unknown Sat Aug 16 16:57:12 2025 MIME-Version: 1.0 X-Mailer: MIME-tools 5.420 (Entity 5.420) X-Loop: owner@emacsbugs.donarmstrong.com From: help-debbugs@gnu.org (Emacs bug Tracking System) To: Stephen Berman Subject: bug#2084 closed by Chong Yidong (Re: 23.0.60; todo-insert-item-here bug + patch) Message-ID: References: <87bptscc9v.fsf@cyd.mit.edu> <878wowyef6.fsf@escher.local.home> X-Emacs-PR-Message: they-closed 2084 X-Emacs-PR-Package: emacs Reply-To: 2084@debbugs.gnu.org Date: Wed, 28 Jan 2009 04:05:06 +0000 Content-Type: multipart/mixed; boundary="----------=_1233115506-16305-1" This is a multi-part message in MIME format... ------------=_1233115506-16305-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" This is an automatic notification regarding your bug report which was filed against the emacs package: #2084: 23.0.60; todo-insert-item-here bug + patch It has been closed by Chong Yidong . Their explanation is attached below along with your original report. If this explanation is unsatisfactory and you have not received a better one in a separate message then please contact Chong Yidong by replying to this email. --=20 2084: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D2084 Emacs Bug Tracking System Contact help-debbugs@gnu.org with problems ------------=_1233115506-16305-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at 2084-done) by emacsbugs.donarmstrong.com; 28 Jan 2009 03:57:56 +0000 X-Spam-Checker-Version: SpamAssassin 3.2.5-bugs.debian.org_2005_01_02 (2008-06-10) on rzlab.ucr.edu X-Spam-Level: X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. X-Spam-Status: No, score=0.0 required=4.0 tests=MURPHY_DRUGS_REL8 autolearn=ham version=3.2.5-bugs.debian.org_2005_01_02 Received: from cyd.mit.edu (CYD.MIT.EDU [18.115.2.24]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id n0S3vnIG014661 for <2084-done@emacsbugs.donarmstrong.com>; Tue, 27 Jan 2009 19:57:50 -0800 Received: by cyd.mit.edu (Postfix, from userid 1000) id 31C5D57E205; Tue, 27 Jan 2009 22:58:20 -0500 (EST) From: Chong Yidong To: Stephen Berman Cc: 2084-done@debbugs.gnu.org Subject: Re: 23.0.60; todo-insert-item-here bug + patch Date: Tue, 27 Jan 2009 22:58:20 -0500 Message-ID: <87bptscc9v.fsf@cyd.mit.edu> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii > The new entry is not recognized as such by Todo mode commands. The > attached patch fixes this by consistently inserting the new entry > directly above the current entry (unless point is on an empty line, > then it inserts the new entry there). Applied, thanks. ------------=_1233115506-16305-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at submit) by emacsbugs.donarmstrong.com; 27 Jan 2009 15:08:58 +0000 X-Spam-Checker-Version: SpamAssassin 3.2.5-bugs.debian.org_2005_01_02 (2008-06-10) on rzlab.ucr.edu X-Spam-Level: X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. X-Spam-Status: No, score=0.1 required=4.0 tests=FOURLA,MURPHY_DRUGS_REL8 autolearn=no version=3.2.5-bugs.debian.org_2005_01_02 Received: from fencepost.gnu.org (fencepost.gnu.org [140.186.70.10]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id n0RF8sxn013943 for ; Tue, 27 Jan 2009 07:08:56 -0800 Received: from mail.gnu.org ([199.232.76.166]:57626 helo=mx10.gnu.org) by fencepost.gnu.org with esmtp (Exim 4.67) (envelope-from ) id 1LRpX1-000759-I7 for emacs-pretest-bug@gnu.org; Tue, 27 Jan 2009 10:07:15 -0500 Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60) (envelope-from ) id 1LRpYY-0005aI-WB for emacs-pretest-bug@gnu.org; Tue, 27 Jan 2009 10:08:52 -0500 Received: from mail.gmx.net ([213.165.64.20]:46756) by monty-python.gnu.org with smtp (Exim 4.60) (envelope-from ) id 1LRpYY-0005Zs-FN for emacs-pretest-bug@gnu.org; Tue, 27 Jan 2009 10:08:50 -0500 Received: (qmail invoked by alias); 27 Jan 2009 15:08:47 -0000 Received: from i59F57C0C.versanet.de (EHLO escher.local.home) [89.245.124.12] by mail.gmx.net (mp033) with SMTP; 27 Jan 2009 16:08:47 +0100 X-Authenticated: #20778731 X-Provags-ID: V01U2FsdGVkX1/86MIyqoT80E+QGOvaMVCsbh3PvWeAFm35EwyR02 /6eCBqZazc0UYW Received: by escher.local.home (Postfix, from userid 1000) id CF07B1D1242; Tue, 27 Jan 2009 16:08:45 +0100 (CET) From: Stephen Berman To: emacs-pretest-bug@gnu.org Subject: 23.0.60; todo-insert-item-here bug + patch Sender: steve@escher.local.home Date: Tue, 27 Jan 2009 16:08:45 +0100 Message-ID: <878wowyef6.fsf@escher.local.home> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (gnu/linux) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Y-GMX-Trusted: 0 X-FuHaFi: 0.55 X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) --=-=-= The following bug, reported in http://lists.gnu.org/archive/html/bug-gnu-emacs/2001-11/msg00234.html, still exists in the CVS trunk: From: Daniel Ortmann Subject: todo-mode: pressing "I" when at the end of the line inserts the todo information at the END of the current line To: bug-gnu-emacs@gnu.org Date: 06 Nov 2001 12:36:08 -0600 > Pressing "I" when at the end of the line inserts the todo information at > the END of the current line. It should add the new information to the > FRONT of the current line. In http://lists.gnu.org/archive/html/bug-gnu-emacs/2001-11/msg00429.html I pointed out that `I' (todo-insert-item-here) in fact inserts a new Todo entry anywhere and that, while this behavior is strictly consistent with the doc string, it is generally undesirable, and provided a patch to restrict the entry point. The patch was not committed to CVS, which is just as well, since it was deficient. Nevertheless, the existing definition remains buggy -- it could result in making the new entry inaccessible to Todo mode commands. For example, let a Todo mode category contain the following: */* 2009-01-27 15:30 steve: This is item1. Place point between "is" and "item1", type `I' and at the prompt `This is item2.'; now the category looks like this: */* 2009-01-27 15:30 steve: This is*/* 2009-01-27 15:30 steve: This is item2. item1. The new entry is not recognized as such by Todo mode commands. The attached patch fixes this by consistently inserting the new entry directly above the current entry (unless point is on an empty line, then it inserts the new entry there). 2009-01-20 Stephen Berman * calendar/todo-mode.el (todo-insert-item-here): Prevent insertion of a new entry inside of an existing entry. Minor code cleanup. --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=todo-insert-item-here.diff Content-Description: todo-mode patch *** emacs/lisp/calendar/todo-mode.el.~1.72.~ 2009-01-09 11:48:58.000000000 +0100 --- emacs/lisp/calendar/todo-mode.el 2009-01-20 21:30:15.000000000 +0100 *************** *** 610,625 **** (defalias 'todo-cmd-inst 'todo-insert-item) (defun todo-insert-item-here () ! "Insert new TODO list entry under the cursor." ! (interactive "") ! (save-excursion ! (if (not (derived-mode-p 'todo-mode)) (todo-show)) ! (let* ((new-item (concat todo-prefix " " ! (read-from-minibuffer ! "New TODO entry: " ! (if todo-entry-prefix-function ! (funcall todo-entry-prefix-function)))))) ! (insert (concat new-item "\n"))))) (defun todo-more-important-p (line) "Ask whether entry is more important than the one at LINE." --- 610,629 ---- (defalias 'todo-cmd-inst 'todo-insert-item) (defun todo-insert-item-here () ! "Insert a new TODO list entry directly above the entry at point. ! If point is on an empty line, insert the entry there." ! (interactive) ! (if (not (derived-mode-p 'todo-mode)) (todo-show)) ! (let ((new-item (concat todo-prefix " " ! (read-from-minibuffer ! "New TODO entry: " ! (if todo-entry-prefix-function ! (funcall todo-entry-prefix-function)))))) ! (unless (and (bolp) (eolp)) (goto-char (todo-item-start))) ! (insert (concat new-item "\n")) ! (backward-char) ! ;; put point at start of new entry ! (goto-char (todo-item-start)))) (defun todo-more-important-p (line) "Ask whether entry is more important than the one at LINE." --=-=-=-- ------------=_1233115506-16305-1--