On Tue, 25 Nov 2014 21:43:02 -0500 Stefan Monnier wrote: >> + (maybe-forward-char (lambda () >> + (and (eobp) (not (bolp)) (newline)) >> + (and (eolp) (not (bolp)) (forward-char 1)))) > > If we add a newline, we know don't want to do a `forward-char'. So: Oops, you commented on the last version of my patch, which, however, I had already considered superseded by the last version of the command subsequently posted by Paul Rankin, which in effect already addressed your concerns. Rather than repost the diff for the latter, I'm appending the two corrected versions of outline-move-subtree-down to facilitate comparison and deciding which to use. The only thing I added to both is a condition for triggering the user-error, since the message doesn't seem appropriate when you try to move a subtree down at eob or up at bob (if you don't think it's worth avoiding the message there, I'll remove the condition). Here's the version of my patch with your improvements: