From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stephen Berman Newsgroups: gmane.emacs.bugs 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 Message-ID: <87h9xvruan.fsf@rosalinde.fritz.box> References: <87lhn7s522.fsf@rosalinde.fritz.box> <83lhn789tq.fsf@gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1416417094 17025 80.91.229.3 (19 Nov 2014 17:11:34 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 19 Nov 2014 17:11:34 +0000 (UTC) Cc: paul@tilk.co, 19102@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed Nov 19 18:11:25 2014 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Xr8mp-0007RE-R5 for geb-bug-gnu-emacs@m.gmane.org; Wed, 19 Nov 2014 18:11:23 +0100 Original-Received: from localhost ([::1]:59766 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xr8mp-0008N4-65 for geb-bug-gnu-emacs@m.gmane.org; Wed, 19 Nov 2014 12:11:23 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:53393) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xr8mg-0008GB-DQ for bug-gnu-emacs@gnu.org; Wed, 19 Nov 2014 12:11:20 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Xr8mW-0001Vm-Ln for bug-gnu-emacs@gnu.org; Wed, 19 Nov 2014 12:11:14 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:41268) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xr8mW-0001Ue-Dc for bug-gnu-emacs@gnu.org; Wed, 19 Nov 2014 12:11:04 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1Xr8mV-00022Q-UJ for bug-gnu-emacs@gnu.org; Wed, 19 Nov 2014 12:11:04 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Stephen Berman Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 19 Nov 2014 17:11:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 19102 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 19102-submit@debbugs.gnu.org id=B19102.14164170297773 (code B ref 19102); Wed, 19 Nov 2014 17:11:03 +0000 Original-Received: (at 19102) by debbugs.gnu.org; 19 Nov 2014 17:10:29 +0000 Original-Received: from localhost ([127.0.0.1]:38479 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Xr8lw-00021I-TS for submit@debbugs.gnu.org; Wed, 19 Nov 2014 12:10:29 -0500 Original-Received: from mout.gmx.net ([212.227.15.18]:54448) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Xr8lu-000219-Se for 19102@debbugs.gnu.org; Wed, 19 Nov 2014 12:10:27 -0500 Original-Received: from rosalinde.fritz.box ([89.245.64.17]) by mail.gmx.com (mrgmx003) with ESMTPSA (Nemesis) id 0McEI3-1XZByQ0Dnr-00JeH7; Wed, 19 Nov 2014 18:09:53 +0100 In-Reply-To: <83lhn789tq.fsf@gnu.org> (Eli Zaretskii's message of "Wed, 19 Nov 2014 17:54:41 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux) X-Provags-ID: V03:K0:5SjkuPNkhTDjSTok4fWor1uv389WvYlyAFhGxgtXdNA3E6BU1ES jMYoQL/j8GuZUOt00kT5Q6TtTPyD6n3NH3ctfVXFZCjmMVRIiDVcdP8hJQ9BY8LbMy0RMxW UU445eHcl/C0fs3Zxpjl8jDAR40OlBSPKJBKNTLygKYM4XyKxp5X5MLLRZUDAV3xrGxJQ0F ULusa9lXsBpLKXvo1axDQ== X-UI-Out-Filterresults: notjunk:1; X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:96247 On Wed, 19 Nov 2014 17:54:41 +0200 Eli Zaretskii wrote: >> From: Stephen Berman >> 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