From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Paul Rankin 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 16:46:22 +1000 Message-ID: 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 1416466104 15235 80.91.229.3 (20 Nov 2014 06:48:24 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 20 Nov 2014 06:48:24 +0000 (UTC) Cc: 19102@debbugs.gnu.org To: Stephen Berman Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Nov 20 07:48:18 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 1XrLXN-00015f-JG for geb-bug-gnu-emacs@m.gmane.org; Thu, 20 Nov 2014 07:48:17 +0100 Original-Received: from localhost ([::1]:33843 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XrLXN-00029p-68 for geb-bug-gnu-emacs@m.gmane.org; Thu, 20 Nov 2014 01:48:17 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:36164) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XrLXF-00029e-DC for bug-gnu-emacs@gnu.org; Thu, 20 Nov 2014 01:48:14 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XrLX8-0005Zz-9A for bug-gnu-emacs@gnu.org; Thu, 20 Nov 2014 01:48:09 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:41728) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XrLX8-0005ZC-5B for bug-gnu-emacs@gnu.org; Thu, 20 Nov 2014 01:48:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1XrLX7-0003il-NQ for bug-gnu-emacs@gnu.org; Thu, 20 Nov 2014 01:48:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Paul Rankin Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 20 Nov 2014 06:48:01 +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.141646602614232 (code B ref 19102); Thu, 20 Nov 2014 06:48:01 +0000 Original-Received: (at 19102) by debbugs.gnu.org; 20 Nov 2014 06:47:06 +0000 Original-Received: from localhost ([127.0.0.1]:38941 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XrLWD-0003hU-Ki for submit@debbugs.gnu.org; Thu, 20 Nov 2014 01:47:05 -0500 Original-Received: from out4-smtp.messagingengine.com ([66.111.4.28]:39989) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XrLW7-0003h1-RY for 19102@debbugs.gnu.org; Thu, 20 Nov 2014 01:47:04 -0500 Original-Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.nyi.internal (Postfix) with ESMTP id 617D420608; Thu, 20 Nov 2014 01:46:59 -0500 (EST) Original-Received: from frontend1 ([10.202.2.160]) by compute3.internal (MEProxy); Thu, 20 Nov 2014 01:46:59 -0500 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=tilk.co; h= x-sasl-enc:references:from:to:cc:subject:in-reply-to:date :message-id:mime-version:content-type; s=mesmtp; bh=JMT50i4HegTp IzTzzneE7+bzxGE=; b=qZM6h3EA4+miH8wpvU1BwqX4IjkXrYtvqsCXmJxxKoJD YTVD2p6kCNFr7GByQJD1ZduceGA+ZCoSVRZjYedzoGdfbrgVN5fHpKFOm8L7nxkG HLv4tZzeL64E4Q9mx2o8h+B25Y00e9PXKGxG/G8jrRX/tBe0QEA4oSclbgAq0gQ= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=x-sasl-enc:references:from:to:cc:subject :in-reply-to:date:message-id:mime-version:content-type; s= smtpout; bh=JMT50i4HegTpIzTzzneE7+bzxGE=; b=TluNTgnwUEImhdd6unJg cN63E5IloYSCjrwdAnXlr4+gOHjpH52/d1RyXYWsO7ifcpPNeeqw7ejSMgff9tUG Hl1jbzBi7qM5Yz5RCNWoIU/AVKJT47cNlqfYJZPNLUYMgDR3X/keW3d6PmPfgLXM Hiz06OmVjE72BqH+s+cB9Oo= X-Sasl-enc: OHtajJDNJSni6cN418Km8bSpCo6dyOIzucpPhTmZK9vB 1416466018 Original-Received: from Paul-Rankins-MacBook-Pro.local (unknown [202.0.190.43]) by mail.messagingengine.com (Postfix) with ESMTPA id D5B27C00011; Thu, 20 Nov 2014 01:46:56 -0500 (EST) In-reply-to: <8761easv3s.fsf@rosalinde.fritz.box> 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:96307 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) ...? -- Paul W. Rankin http://www.paulwrankin.com