From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stephen Berman Newsgroups: gmane.emacs.bugs,gmane.emacs.pretest.bugs Subject: bug#2084: 23.0.60; todo-insert-item-here bug + patch Date: Tue, 27 Jan 2009 16:08:45 +0100 Message-ID: <878wowyef6.fsf@escher.local.home> Reply-To: Stephen Berman , 2084@emacsbugs.donarmstrong.com NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: ger.gmane.org 1233069840 11232 80.91.229.12 (27 Jan 2009 15:24:00 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 27 Jan 2009 15:24:00 +0000 (UTC) To: emacs-pretest-bug@gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Jan 27 16:25:14 2009 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1LRpoB-0005eF-3R for geb-bug-gnu-emacs@m.gmane.org; Tue, 27 Jan 2009 16:25:00 +0100 Original-Received: from localhost ([127.0.0.1]:48129 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LRpmt-0008C9-02 for geb-bug-gnu-emacs@m.gmane.org; Tue, 27 Jan 2009 10:23:39 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LRpmo-0008Bt-HR for bug-gnu-emacs@gnu.org; Tue, 27 Jan 2009 10:23:34 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LRpmm-0008BM-Ak for bug-gnu-emacs@gnu.org; Tue, 27 Jan 2009 10:23:33 -0500 Original-Received: from [199.232.76.173] (port=47876 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LRpmm-0008BJ-5t for bug-gnu-emacs@gnu.org; Tue, 27 Jan 2009 10:23:32 -0500 Original-Received: from rzlab.ucr.edu ([138.23.92.77]:42504) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1LRpml-0007dm-If for bug-gnu-emacs@gnu.org; Tue, 27 Jan 2009 10:23:31 -0500 Original-Received: from rzlab.ucr.edu (rzlab.ucr.edu [127.0.0.1]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id n0RFNTdq017722; Tue, 27 Jan 2009 07:23:29 -0800 Original-Received: (from debbugs@localhost) by rzlab.ucr.edu (8.13.8/8.13.8/Submit) id n0RFF37K015281; Tue, 27 Jan 2009 07:15:03 -0800 X-Loop: owner@emacsbugs.donarmstrong.com Resent-From: Stephen Berman Original-Sender: steve@escher.local.home Resent-To: bug-submit-list@donarmstrong.com Resent-CC: Emacs Bugs Resent-Date: Tue, 27 Jan 2009 15:15:03 +0000 Resent-Message-ID: Resent-Sender: owner@emacsbugs.donarmstrong.com X-Emacs-PR-Message: report 2084 X-Emacs-PR-Package: emacs X-Emacs-PR-Keywords: Original-Received: via spool by submit@emacsbugs.donarmstrong.com id=B.123306893813949 (code B ref -1); Tue, 27 Jan 2009 15:15:03 +0000 Original-Received: (at submit) by emacsbugs.donarmstrong.com; 27 Jan 2009 15:08:58 +0000 X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. Original-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 Original-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 Original-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 Original-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 Original-Received: (qmail invoked by alias); 27 Jan 2009 15:08:47 -0000 Original-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 Original-Received: by escher.local.home (Postfix, from userid 1000) id CF07B1D1242; Tue, 27 Jan 2009 16:08:45 +0100 (CET) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (gnu/linux) 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) X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) Resent-Date: Tue, 27 Jan 2009 10:23:33 -0500 X-BeenThere: bug-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:24619 gmane.emacs.pretest.bugs:23788 Archived-At: --=-=-= 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." --=-=-=--