bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#19102: 24.4; outline-move-subtree-up/down error at last and second-l


From: Stephen Berman
Subject: bug#19102: 24.4; outline-move-subtree-up/down error at last and second-last subtree
Date: Wed, 19 Nov 2014 18:09:52 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux)

On Wed, 19 Nov 2014 17:54:41 +0200 Eli Zaretskii <eliz@gnu.org> wrote:

>> From: Stephen Berman <stephen.berman@gmx.net>
>> Date: Wed, 19 Nov 2014 14:17:25 +0100
>> Cc: 19102@debbugs.gnu.org
>> 
>> The following patch (against master) seems to fix this, though it could
>> probably be done more elegantly.
>
> Thanks.  Can you explain why the problem happened in the first place?

The error occurs when the sexp `(= (char-after) ?\n)' in
outline-move-subtree-down is evaluated at eob.  This can happen either
when calling outline-move-subtree-down on either of the last two
subtrees, or when calling outline-move-subtree-up on the last subtree.
There are two triggers: (i) finding the end point of the subtree to be
moved up or down, and (ii) finding the insertion point to move the
selected subtree down to.  The patch avoids the error by making sure
there is a line after the final subtree, adding it if necessary and then
deleting the added line after the move.

>> +    ;; Make sure we can move forward when needed (bug#19102).
>
> Please only mention the bug number in comments if the code or the rest
> of the comment text do not speak for themselves, and there are some
> subtle issues here that can only be understood by reading the bug
> discussion.  Otherwise, the bug number will appear in the commit log,
> so no need to put it in the code.

That occurred to me when I made the ChangeLog entry in my local tree; if
the patch is accepted, I'll remove the bug number from the comment.

Steve Berman





reply via email to

[Prev in Thread] Current Thread [Next in Thread]