GNU bug report logs - #19102
24.4; outline-move-subtree-up/down error at last and second-last subtree

Previous Next

Package: emacs;

Reported by: Paul Rankin <paul <at> tilk.co>

Date: Wed, 19 Nov 2014 08:34:01 UTC

Severity: normal

Found in version 24.4

Done: Stephen Berman <stephen.berman <at> gmx.net>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Stephen Berman <stephen.berman <at> gmx.net>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: paul <at> tilk.co, 19102 <at> debbugs.gnu.org
Subject: bug#19102: 24.4; outline-move-subtree-up/down error at last and second-last subtree
Date: Fri, 21 Nov 2014 11:32:20 +0100
On Thu, 20 Nov 2014 18:21:03 +0200 Eli Zaretskii <eliz <at> gnu.org> wrote:

>> From: Stephen Berman <stephen.berman <at> gmx.net>
>> Cc: Eli Zaretskii <eliz <at> gnu.org>,  19102 <at> debbugs.gnu.org
>> Date: Thu, 20 Nov 2014 11:08:13 +0100
>> 
>> outline-move-subtree-up/down works if there's an empty line after
>> the last subtree, but if not, it puts the last two subtree headers
>> on the same line.
>
> Does it make sense to fix outline-move-subtree-up/down so that they
> also work when there's no empty line after the last subtree?  That's

It didn't occur to me before, but your question prompted me to check and
I see outline-mode derives from text-mode, which sets
require-final-newline to mode-require-final-newline, so I guess the
assumption is indeed that files in outline-mode should end in a newline.

> one thing that looks inelegant in your patch, and might also cause
> some (minor) trouble: what if the user types C-g before this function
> finishes?

We could avoid the trouble by wrapping the newline call in
unwind-protect, couldn't we?  But can C-g really take effect here?
There is no place in the function where execution halts to wait for user
feedback.  Maybe with an outline containing an enormous number of
subtrees the calculations could take long enough to make C-g interrupt
it, though I tried and failed to do it moving over 500 subtrees.  But I
guess those are idle speculations, it does seem that just keeping a
final newline added by the function is the simplest (and perhaps best)
fix, so I guess we should commit some version of that fix and see if
anyone complains.

Steve Berman




This bug report was last modified 10 years and 237 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.