GNU bug report logs -
#4820
23.1.50; [PATCH] todo-mode.el
Previous Next
To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 4820 in the body.
You can then email your comments to 4820 AT debbugs.gnu.org in the normal way.
Toggle the display of automated, internal messages from the tracker.
Report forwarded
to
bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>
:
bug#4820
; Package
emacs
.
(Wed, 28 Oct 2009 12:25:05 GMT)
Full text and
rfc822 format available.
Acknowledgement sent
to
Stephen Berman <stephen.berman <at> gmx.net>
:
New bug report received and forwarded. Copy sent to
Emacs Bugs <bug-gnu-emacs <at> gnu.org>
.
(Wed, 28 Oct 2009 12:25:05 GMT)
Full text and
rfc822 format available.
Message #5 received at submit <at> emacsbugs.donarmstrong.com (full text, mbox):
[Message part 1 (text/plain, inline)]
Here are two bugs in todo-mode.el; a patch is attached.
1. emacs -Q with no existing file as the value of todo-file-do
2. M-x todo-show
3. Type `e' (todo-edit-item)
=> Args out of range: 60, 61
This is because there is no todo item, so when todo-edit-item calls
todo-item-string, todo-item-start returns (point-min), which is 61, and
todo-item-end returns (1- (line-beginning-position)), i.e. 60, which
raises the args-out-of-range error on buffer-substring in
todo-item-string. The attached fix to todo-edit-item checks whether
there is a todo item to edit and throws an error if not. This is
consistent with other Todo mode commands, e.g. todo-{raise, lower,
delete, file}-item.
1. emacs -Q
2. M-x todo-show
3. Type `i' and at the prompt a todo item, e.g "test", then RET to
display the item in the TODO buffer in the category "Todo"; note that
narrowing is in effect, as required by Todo mode.
4. Type `t' to display the Todo top priorities list in a window below
the window displaying the TODO buffer.
5. In the TODO buffer type `E' on the item to put it in Todo Edit mode
in the buffer *TODO Edit*.
6. Type C-x k to kill *TODO Edit* and return to the TODO buffer, which
remains unchanged.
7. In the TODO buffer type `t' again.
=> Now narrowing is no longer in effect in the TODO buffer.
This is because todo-top-priorities, although it calls widen within
save-restriction, subsequently calls set-buffer, with the result, after
the call to make-indirect-buffer in todo-edit-multiline (step 5 above),
that narrowing is not restored. The causal chain here is not quite
clear to me: in (elisp)Current Buffer there is a warning to use
set-buffer within save-current-buffer or save-excursion to guarantee
restoration, and in fact in todo-top-priorities set-buffer is within
save-excursion, but that is outside of the save-restriction. If the
order of save-excursion and save-restriction is switched, then narrowing
is correctly restored after step 7 above; however, this order is
discouraged in (elisp)Narrowing. But putting save-current-buffer
between save-restriction and set-buffer also restores narrowing, so this
is what the attached patch does. (I don't know why the failure to
restore narrowing is conditioned by make-indirect-buffer; I asked about
this on emacs-devel but have not yet gotten any response.) In addition,
the use of save-excursion appears to be gratuitous here: point is
already moved by the preceding call to todo-show, and subsequent code
concerns the temporary top priorities buffer. But moving todo-show
inside save-excursion does prevent point from being relocated, so I made
this change as well in the patch.
2009-10-28 Stephen Berman <stephen.berman <at> gmx.net>
* calendar/todo-mode.el (todo-edit-item): Signal an error if there
is no item to edit. (Bug#XXXX)
(todo-top-priorities): Restore point and restore narrowing in Todo
buffer. (Bug#XXXX)
[Message part 2 (text/plain, attachment)]
Reply sent
to
Glenn Morris <rgm <at> gnu.org>
:
You have taken responsibility.
(Sat, 31 Oct 2009 02:30:27 GMT)
Full text and
rfc822 format available.
Notification sent
to
Stephen Berman <stephen.berman <at> gmx.net>
:
bug acknowledged by developer.
(Sat, 31 Oct 2009 02:30:28 GMT)
Full text and
rfc822 format available.
Message #10 received at 4820-done <at> emacsbugs.donarmstrong.com (full text, mbox):
Thanks; applied.
Information forwarded
to
bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>
:
bug#4820
; Package
emacs
.
(Tue, 03 Nov 2009 22:35:04 GMT)
Full text and
rfc822 format available.
Acknowledgement sent
to
Stefan Monnier <monnier <at> IRO.UMontreal.CA>
:
Extra info received and forwarded to list. Copy sent to
Emacs Bugs <bug-gnu-emacs <at> gnu.org>
.
(Tue, 03 Nov 2009 22:35:06 GMT)
Full text and
rfc822 format available.
Message #15 received at 4820 <at> emacsbugs.donarmstrong.com (full text, mbox):
> 1. emacs -Q with no existing file as the value of todo-file-do
> 2. M-x todo-show
> 3. Type `e' (todo-edit-item)
> => Args out of range: 60, 61
I've installed a different fix, which may not result in a clean error
message, but was needed for other reasons anyway.
> 1. emacs -Q
> 2. M-x todo-show
> 3. Type `i' and at the prompt a todo item, e.g "test", then RET to
> display the item in the TODO buffer in the category "Todo"; note that
> narrowing is in effect, as required by Todo mode.
> 4. Type `t' to display the Todo top priorities list in a window below
> the window displaying the TODO buffer.
> 5. In the TODO buffer type `E' on the item to put it in Todo Edit mode
> in the buffer *TODO Edit*.
> 6. Type C-x k to kill *TODO Edit* and return to the TODO buffer, which
> remains unchanged.
> 7. In the TODO buffer type `t' again.
> => Now narrowing is no longer in effect in the TODO buffer.
Thank you. I believe the fix to save-restriction I just installed
should make this workaround unnecessary.
Stefan
bug archived.
Request was from
Debbugs Internal Request <help-debbugs <at> gnu.org>
to
internal_control <at> emacsbugs.donarmstrong.com
.
(Wed, 02 Dec 2009 15:24:13 GMT)
Full text and
rfc822 format available.
This bug report was last modified 15 years and 203 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.