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

From: Eli Zaretskii <[email-masked]>
Date: Fri, 21 Nov 2014 21:56:07 +0200

> From: Stephen Berman <[email-masked]>
> Cc: [email-masked],  [email-masked]
> Date: Fri, 21 Nov 2014 18:31:19 +0100
> 
> >> But can C-g really take effect here?
> >> There is no place in the function where execution halts to wait for user
> >> feedback.
> >
> > C-g sets a flag that is checked by evaluation.
> 
> I don't understand how this could result in C-g taking effect before the
> function finishes; could you elaborate?

C-g sets a "quit" flag.  When Lisp evaluation takes place and the quit
flag is set, the Lisp interpreter throws to top-level, thus
interrupting whatever function was running.

> I think that, once the non-file buffer case is taken into account (and
> not doing means moving a subtree can corrupt the outline by putting two
> headers on the same line), the cleanest fix is basically the one Paul
> Rankin proposed in his last post.  I've attached it as a diff against
> emacs-24, where I assume the fix should be committed (I added a comment
> and tweaked the function Paul posted to avoid irrelevant changes to the
> current code, and also restricted the error handling by making it a
> user-error and having it signal only when the user attempts to move over
> a higher outline level, avoiding an inappropriate message at bob or
> eob).  Does this patch qualify as a tiny change, or does Paul have a
> copyright assignment on file (I don't have access to the file)?

I don't see his assignment.  IMO, this patch is borderline wrt being
"tiny"; I'll let Stefan judge.