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: Thu, 20 Nov 2014 11:08:13 +0100 Message-ID: <87r3wytcaa.fsf@rosalinde.fritz.box> References: <87lhn7s522.fsf@rosalinde.fritz.box> <83lhn789tq.fsf@gnu.org> <87h9xvruan.fsf@rosalinde.fritz.box> <83tx1v6mur.fsf@gnu.org> <87a93nrlql.fsf@rosalinde.fritz.box> <83lhn76iex.fsf@gnu.org> <8761easv3s.fsf@rosalinde.fritz.box> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1416478771 32184 80.91.229.3 (20 Nov 2014 10:19:31 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 20 Nov 2014 10:19:31 +0000 (UTC) Cc: 19102@debbugs.gnu.org To: Paul Rankin Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Nov 20 11:19:24 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 1XrOpc-0004P1-Jx for geb-bug-gnu-emacs@m.gmane.org; Thu, 20 Nov 2014 11:19:20 +0100 Original-Received: from localhost ([::1]:34444 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XrOfu-0005x9-31 for geb-bug-gnu-emacs@m.gmane.org; Thu, 20 Nov 2014 05:09:18 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:51867) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XrOfk-0005x0-AM for bug-gnu-emacs@gnu.org; Thu, 20 Nov 2014 05:09:13 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XrOfe-0005dT-ST for bug-gnu-emacs@gnu.org; Thu, 20 Nov 2014 05:09:08 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:41860) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XrOfe-0005dN-Ol for bug-gnu-emacs@gnu.org; Thu, 20 Nov 2014 05:09:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1XrOfe-0000HM-57 for bug-gnu-emacs@gnu.org; Thu, 20 Nov 2014 05:09:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Stephen Berman Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 20 Nov 2014 10:09:02 +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.14164781031022 (code B ref 19102); Thu, 20 Nov 2014 10:09:02 +0000 Original-Received: (at 19102) by debbugs.gnu.org; 20 Nov 2014 10:08:23 +0000 Original-Received: from localhost ([127.0.0.1]:39073 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XrOf1-0000GP-26 for submit@debbugs.gnu.org; Thu, 20 Nov 2014 05:08:23 -0500 Original-Received: from mout.gmx.net ([212.227.17.20]:49237) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XrOey-0000GH-Py for 19102@debbugs.gnu.org; Thu, 20 Nov 2014 05:08:21 -0500 Original-Received: from rosalinde.fritz.box ([89.245.126.188]) by mail.gmx.com (mrgmx102) with ESMTPSA (Nemesis) id 0Las1k-1YFPkL3ofA-00kMEM; Thu, 20 Nov 2014 11:08:14 +0100 In-Reply-To: (Paul Rankin's message of "Thu, 20 Nov 2014 16:46:22 +1000") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux) X-Provags-ID: V03:K0:zL0yS0yfDZjSTaSaI9OoyRu4RmAMVebseMi+vYpbv+DEmofyzDa a1B0ove5lqwTIscOoADg+s1UcfiFVAePzYlvqou3T83zHPkw5IqlecLDjTTu+T67M0htv9o b4NZIVpS+0MsjkFCC5hJnFPynb9Z4uG4Rc41I+BmwcHagAjC8rLmw/605uq2hrz4ZYG2w+S P2Vtt3tTDyvFqTuj0I4yw== 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:96313 On Thu, 20 Nov 2014 16:46:22 +1000 Paul Rankin wrote: > Stephen Berman writes: > >> On Wed, 19 Nov 2014 22:32:06 +0200 Eli Zaretskii wrote: >> >>>> From: Stephen Berman >>>> Cc: paul@tilk.co, 19102@debbugs.gnu.org >>>> Date: Wed, 19 Nov 2014 21:14:42 +0100 >>>> >>>> > Wouldn't using eolp instead of the comparison solve that problem more >>>> > easily? >>>> >>>> Well, that eliminates the wrong-type-argument error in the current code, >>>> but it instead signals "End of buffer" >>> >>> From forward-char? If so, you could avoid the call if eobp. Or wrap >>> the call in condition-case and ignore errors. >> >> Those solutions work only if there's an empty line after the last >> subtree. If there isn't, I can't see any way other than my patch. >> >>>> Do you see any other problems with the patch or more room for >>>> improvement? >>> >>> I was worried by the complexity of maybe-forward-char, but maybe now >>> it is much simpler. >> >> I simplified it just a bit more, but that's all I can think of. I also >> had overlooked a side-effect of the error signaled when trying to move >> the last subtree down: it leaves a dangling newline; this is avoided >> using with-demoted-errors. The revised patch is appended. >> >> Steve Berman > > Sorry if there is some very obvious reason I'm missing, but can't we > just change > > (= (char-after) ?\n) > > to > > (eq (char-after) ?\n) > > ...? This has the same effect as Eli's suggestion of not calling forward-char at eob or wrapping it in condition-case: 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. Steve Berman