unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#2084: 23.0.60; todo-insert-item-here bug + patch
@ 2009-01-27 15:08 ` Stephen Berman
  2009-01-28  4:05   ` bug#2084: marked as done (23.0.60; todo-insert-item-here bug + patch) Emacs bug Tracking System
  0 siblings, 1 reply; 2+ messages in thread
From: Stephen Berman @ 2009-01-27 15:08 UTC (permalink / raw)
  To: emacs-pretest-bug

[-- Attachment #1: Type: text/plain, Size: 1807 bytes --]

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 <dortmann@lsil.com>
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  <stephen.berman@gmx.net>

	* calendar/todo-mode.el (todo-insert-item-here): Prevent insertion
	of a new entry inside of an existing entry.  Minor code cleanup.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: todo-mode patch --]
[-- Type: text/x-patch, Size: 1569 bytes --]

*** 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."

^ permalink raw reply	[flat|nested] 2+ messages in thread

* bug#2084: marked as done (23.0.60; todo-insert-item-here bug + patch)
  2009-01-27 15:08 ` bug#2084: 23.0.60; todo-insert-item-here bug + patch Stephen Berman
@ 2009-01-28  4:05   ` Emacs bug Tracking System
  0 siblings, 0 replies; 2+ messages in thread
From: Emacs bug Tracking System @ 2009-01-28  4:05 UTC (permalink / raw)
  To: Chong Yidong

[-- Attachment #1: Type: text/plain, Size: 870 bytes --]


Your message dated Tue, 27 Jan 2009 22:58:20 -0500
with message-id <87bptscc9v.fsf@cyd.mit.edu>
and subject line Re: 23.0.60; todo-insert-item-here bug + patch
has caused the Emacs bug report #2084,
regarding 23.0.60; todo-insert-item-here bug + patch
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact owner@emacsbugs.donarmstrong.com
immediately.)


-- 
2084: http://emacsbugs.donarmstrong.com/cgi-bin/bugreport.cgi?bug=2084
Emacs Bug Tracking System
Contact owner@emacsbugs.donarmstrong.com with problems

[-- Attachment #2: Type: message/rfc822, Size: 5790 bytes --]

[-- Attachment #2.1.1: Type: text/plain, Size: 1807 bytes --]

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 <dortmann@lsil.com>
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  <stephen.berman@gmx.net>

	* calendar/todo-mode.el (todo-insert-item-here): Prevent insertion
	of a new entry inside of an existing entry.  Minor code cleanup.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2.1.2: todo-mode patch --]
[-- Type: text/x-patch, Size: 1569 bytes --]

*** 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."

[-- Attachment #3: Type: message/rfc822, Size: 1334 bytes --]

From: Chong Yidong <cyd@stupidchicken.com>
To: Stephen Berman <stephen.berman@gmx.net>
Cc: 2084-done@emacsbugs.donarmstrong.com
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>

> 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.


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2009-01-28  4:05 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <87bptscc9v.fsf@cyd.mit.edu>
2009-01-27 15:08 ` bug#2084: 23.0.60; todo-insert-item-here bug + patch Stephen Berman
2009-01-28  4:05   ` bug#2084: marked as done (23.0.60; todo-insert-item-here bug + patch) Emacs bug Tracking System

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).