From unknown Mon Aug 18 11:25:14 2025 X-Loop: help-debbugs@gnu.org Subject: bug#19102: 24.4; outline-move-subtree-up/down error at last and second-last subtree Resent-From: Paul Rankin Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 19 Nov 2014 08:34:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 19102 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: 19102@debbugs.gnu.org X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.141638598312357 (code B ref -1); Wed, 19 Nov 2014 08:34:01 +0000 Received: (at submit) by debbugs.gnu.org; 19 Nov 2014 08:33:03 +0000 Received: from localhost ([127.0.0.1]:37805 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Xr0hC-0003DF-SY for submit@debbugs.gnu.org; Wed, 19 Nov 2014 03:33:03 -0500 Received: from eggs.gnu.org ([208.118.235.92]:57124) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Xr0eA-00036f-Eq for submit@debbugs.gnu.org; Wed, 19 Nov 2014 03:29:55 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Xr0e4-0002A0-4I for submit@debbugs.gnu.org; Wed, 19 Nov 2014 03:29:54 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,T_DKIM_INVALID autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:54704) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xr0e4-00029w-16 for submit@debbugs.gnu.org; Wed, 19 Nov 2014 03:29:48 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58832) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xr0dy-0005sL-DY for bug-gnu-emacs@gnu.org; Wed, 19 Nov 2014 03:29:47 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Xr0ds-00028h-TV for bug-gnu-emacs@gnu.org; Wed, 19 Nov 2014 03:29:42 -0500 Received: from out4-smtp.messagingengine.com ([66.111.4.28]:54029) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xr0ds-00028T-LV for bug-gnu-emacs@gnu.org; Wed, 19 Nov 2014 03:29:36 -0500 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id A551B20C59; Wed, 19 Nov 2014 03:29:34 -0500 (EST) Received: from frontend2 ([10.202.2.161]) by compute4.internal (MEProxy); Wed, 19 Nov 2014 03:29:34 -0500 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=tilk.co; h= x-sasl-enc:from:to:subject:date:message-id:mime-version :content-type; s=mesmtp; bh=wb8kuqRKZm1IuEr0UCMUbBHEWDQ=; b=A2d4 buO5nH4Qw0p9VP47CQ7iN+ZVssNOnIDWMbC8P+VEyzEV4pPszshE+b5CGaYIsqf0 bjQ3E9mv2OvJff5bCBN2VzRaUJrC28rjaHLeqNSClf1It6Weqwuxckm0rFMnS468 U2QmuhQ/VQCRobHLvkHfiM6e8jcvQO5iU+qwc5E= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=x-sasl-enc:from:to:subject:date :message-id:mime-version:content-type; s=smtpout; bh=wb8kuqRKZm1 IuEr0UCMUbBHEWDQ=; b=HNNWIbijcjo3lZqpUFEg5cqYKhdD9d7L+2brBQwQPSH OfScB7uA4PVyiu6goxn7aYZGSyeBhX5OBjQqABNb9nEYl067TYF271QUH9uxu+u+ OEL/9+3RS6287s7XI8hbCn7ranHs3uAeKjxmVocY+J9mgNOLKFeRxOrGbYTXtvoY = X-Sasl-enc: xkqIfOABcMM78mhPMvjmRANTM6lBfWji15Qszp91qkJO 1416385773 Received: from Paul-Rankins-MacBook-Pro.local (unknown [202.0.190.43]) by mail.messagingengine.com (Postfix) with ESMTPA id 38AC16800F8 for ; Wed, 19 Nov 2014 03:29:32 -0500 (EST) From: Paul Rankin Date: Wed, 19 Nov 2014 18:29:01 +1000 Message-ID: MIME-Version: 1.0 Content-Type: text/plain X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -5.0 (-----) X-Mailman-Approved-At: Wed, 19 Nov 2014 03:33:01 -0500 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) 1. emacs -Q 2. M-x switch-to-buffer RET test 3. M-x outline-mode 4. insert: * one * two * three 5. position point at "* three" 6. M-x outline-move-subtree-up => Wrong type argument: number-or-marker-p, nil 7. position point at "* two" 8. M-x outline-move-subtree-down => Wrong type argument: number-or-marker-p, nil Expected behaviour: - at 6. subtree "* three" should move above "* two" - or at 8. subtree "* two" should move below "* three" In GNU Emacs 24.4.1 (x86_64-apple-darwin14.0.0, NS apple-appkit-1343.14) of 2014-10-21 on Paul-Rankins-MacBook-Pro.local Windowing system distributor `Apple', version 10.3.1343 Configured using: `configure --prefix=/usr/local/Cellar/emacs/24.4 --enable-locallisppath=/usr/local/share/emacs/site-lisp --infodir=/usr/local/Cellar/emacs/24.4/share/info/emacs --without-dbus --with-gnutls --with-ns --disable-ns-self-contained' Important settings: value of $LANG: en_AU.UTF-8 locale-coding-system: utf-8-unix Major mode: Outline Minor modes in effect: tooltip-mode: t electric-indent-mode: t mouse-wheel-mode: t tool-bar-mode: t menu-bar-mode: t file-name-shadow-mode: t global-font-lock-mode: t font-lock-mode: t blink-cursor-mode: t auto-composition-mode: t auto-encryption-mode: t auto-compression-mode: t line-number-mode: t transient-mark-mode: t Recent input: M-x s w i t b u t e s t M-x o u t l i n e SPC m o d s-v M-x o u t l i n e SPC m o v e u p M-x o u t l i n e SPC m o v e d o M-x r e p o r t Recent messages: For information about GNU Emacs and the GNU system, type C-h C-a. You can run the command `switch-to-buffer' with C-x b Mark set outline-move-subtree-up: Wrong type argument: number-or-marker-p, nil call-interactively: Wrong type argument: number-or-marker-p, nil Load-path shadows: None found. Features: (shadow sort gnus-util mail-extr emacsbug message format-spec rfc822 mml easymenu mml-sec mm-decode mm-bodies mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader sendmail rfc2047 rfc2045 ietf-drums mm-util help-fns mail-prsvr mail-utils noutline outline easy-mmode time-date tooltip electric uniquify ediff-hook vc-hooks lisp-float-type mwheel ns-win tool-bar dnd fontset image regexp-opt fringe tabulated-list newcomment lisp-mode prog-mode register page menu-bar rfn-eshadow timer select scroll-bar mouse jit-lock font-lock syntax facemenu font-core frame cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean japanese hebrew greek romanian slovak czech european ethiopic indian cyrillic chinese case-table epa-hook jka-cmpr-hook help simple abbrev minibuffer nadvice loaddefs button faces cus-face macroexp files text-properties overlay sha1 md5 base64 format env code-pages mule custom widget hashtable-print-readable backquote make-network-process cocoa ns multi-tty emacs) Memory information: ((conses 16 73311 8272) (symbols 48 17397 0) (miscs 40 41 170) (strings 32 10116 4888) (string-bytes 1 269187) (vectors 16 9102) (vector-slots 8 374266 16740) (floats 8 54 226) (intervals 56 204 0) (buffers 960 13)) -- Paul W. Rankin http://www.paulwrankin.com Before printing this email please take a moment to think about the environment. Just stop and think about it. Think about the last time you were walking alone in a forest, how you felt at peace, how a wave of clarity seemed to overcome you and you had to stop and reevaluate your life, what you're doing with the limited time you have here. "Damn," you thought, "life is so precious. I should really be doing ______." Are you doing that now? Why not? Go on, pick up your computer and throw it out the window! It'll be great, like that scene from Network where everyone starts yelling "I'M MAD AS HELL AND I'M NOT GOING TO TAKE THIS ANY MORE." That'll be you, but it will be real. Now's your moment. -- Paul W. Rankin http://www.paulwrankin.com From unknown Mon Aug 18 11:25:14 2025 X-Loop: help-debbugs@gnu.org Subject: bug#19102: 24.4; outline-move-subtree-up/down error at last and second-last subtree Resent-From: Stephen Berman Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 19 Nov 2014 13:18: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: To: Paul Rankin Cc: 19102@debbugs.gnu.org Received: via spool by 19102-submit@debbugs.gnu.org id=B19102.141640305312147 (code B ref 19102); Wed, 19 Nov 2014 13:18:01 +0000 Received: (at 19102) by debbugs.gnu.org; 19 Nov 2014 13:17:33 +0000 Received: from localhost ([127.0.0.1]:37941 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Xr58W-00039q-IJ for submit@debbugs.gnu.org; Wed, 19 Nov 2014 08:17:33 -0500 Received: from mout.gmx.net ([212.227.17.21]:61818) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Xr58T-00039h-FI for 19102@debbugs.gnu.org; Wed, 19 Nov 2014 08:17:30 -0500 Received: from rosalinde.fritz.box ([89.245.64.17]) by mail.gmx.com (mrgmx103) with ESMTPSA (Nemesis) id 0ML6XF-1XrMFa0vGz-000LvA; Wed, 19 Nov 2014 14:17:27 +0100 From: Stephen Berman References: Date: Wed, 19 Nov 2014 14:17:25 +0100 In-Reply-To: (Paul Rankin's message of "Wed, 19 Nov 2014 18:29:01 +1000") Message-ID: <87lhn7s522.fsf@rosalinde.fritz.box> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Provags-ID: V03:K0:DB444QybU4sztuMHvHgk+ZL2YVfKwbZug9CJmm5Ioiu+9CAz+HD o08Iv1Mr9jdX6VQGGBQ8dqY2KxKTMxV7rsNb/KbzMecmKersEtdZTxJvl0Q4jOXZH28khT3 vPGJOfW9SWG5LPgdy3Eznq54/pUyeVVEwPzuz242SV0Y6oRFccD2piD4aoHcOZ30NcgOheF Rz1qHD/2tGZHCmIDL5Mnw== X-UI-Out-Filterresults: notjunk:1; X-Spam-Score: -0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.0 (/) --=-=-= Content-Type: text/plain On Wed, 19 Nov 2014 18:29:01 +1000 Paul Rankin wrote: > 1. emacs -Q > 2. M-x switch-to-buffer RET test > 3. M-x outline-mode > 4. insert: > * one > * two > * three > 5. position point at "* three" > 6. M-x outline-move-subtree-up > => Wrong type argument: number-or-marker-p, nil > 7. position point at "* two" > 8. M-x outline-move-subtree-down > => Wrong type argument: number-or-marker-p, nil > > Expected behaviour: > > - at 6. subtree "* three" should move above "* two" > - or at 8. subtree "* two" should move below "* three" The following patch (against master) seems to fix this, though it could probably be done more elegantly. Steve Berman --=-=-= Content-Type: text/x-patch Content-Disposition: inline Content-Description: bug#19102 patch diff --git a/lisp/outline.el b/lisp/outline.el index c7cad31..bfed982 100644 --- a/lisp/outline.el +++ b/lisp/outline.el @@ -649,17 +649,27 @@ the match data is set appropriately." 'outline-get-last-sibling)) (ins-point (make-marker)) (cnt (abs arg)) + ;; Make sure we can move forward when needed (bug#19102). + (maybe-forward-char (lambda () + (when (and (eobp) (not (bolp))) + (newline)) + (unless (bolp) + (if (= (char-after) ?\n) + (forward-char 1))))) + (empty-last-line (save-excursion + (goto-char (point-max)) + (and (bolp) (eolp)))) beg end folded) - ;; Select the tree + ;; Select the tree. (outline-back-to-heading) (setq beg (point)) (save-match-data (save-excursion (outline-end-of-heading) (setq folded (outline-invisible-p))) (outline-end-of-subtree)) - (if (= (char-after) ?\n) (forward-char 1)) + (funcall maybe-forward-char) (setq end (point)) - ;; Find insertion point, with error handling + ;; Find insertion point, with error handling. (goto-char beg) (while (> cnt 0) (or (funcall movfunc) @@ -667,14 +677,19 @@ the match data is set appropriately." (error "Cannot move past superior level"))) (setq cnt (1- cnt))) (if (> arg 0) - ;; Moving forward - still need to move over subtree + ;; Moving forward - still need to move over subtree. (progn (outline-end-of-subtree) - (if (= (char-after) ?\n) (forward-char 1)))) + (funcall maybe-forward-char))) (move-marker ins-point (point)) (insert (delete-and-extract-region beg end)) (goto-char ins-point) (if folded (hide-subtree)) - (move-marker ins-point nil))) + (move-marker ins-point nil) + ;; Clean up if necessary. + (save-excursion + (goto-char (point-max)) + (when (and (bolp) (eolp) (not empty-last-line)) + (delete-char -1))))) (defun outline-end-of-heading () (if (re-search-forward outline-heading-end-regexp nil 'move) --=-=-=-- From unknown Mon Aug 18 11:25:14 2025 X-Loop: help-debbugs@gnu.org Subject: bug#19102: 24.4; outline-move-subtree-up/down error at last and second-last subtree Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 19 Nov 2014 15:55: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: To: Stephen Berman Cc: paul@tilk.co, 19102@debbugs.gnu.org Reply-To: Eli Zaretskii Received: via spool by 19102-submit@debbugs.gnu.org id=B19102.141641249032653 (code B ref 19102); Wed, 19 Nov 2014 15:55:01 +0000 Received: (at 19102) by debbugs.gnu.org; 19 Nov 2014 15:54:50 +0000 Received: from localhost ([127.0.0.1]:38450 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Xr7ak-0008Ub-6D for submit@debbugs.gnu.org; Wed, 19 Nov 2014 10:54:50 -0500 Received: from mtaout25.012.net.il ([80.179.55.181]:47465) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Xr7ah-0008UQ-0j for 19102@debbugs.gnu.org; Wed, 19 Nov 2014 10:54:48 -0500 Received: from conversion-daemon.mtaout25.012.net.il by mtaout25.012.net.il (HyperSendmail v2007.08) id <0NFA00600MCX3Y00@mtaout25.012.net.il> for 19102@debbugs.gnu.org; Wed, 19 Nov 2014 17:50:21 +0200 (IST) Received: from HOME-C4E4A596F7 ([87.69.4.28]) by mtaout25.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0NFA003ADMNXUK30@mtaout25.012.net.il>; Wed, 19 Nov 2014 17:50:21 +0200 (IST) Date: Wed, 19 Nov 2014 17:54:41 +0200 From: Eli Zaretskii In-reply-to: <87lhn7s522.fsf@rosalinde.fritz.box> X-012-Sender: halo1@inter.net.il Message-id: <83lhn789tq.fsf@gnu.org> References: <87lhn7s522.fsf@rosalinde.fritz.box> X-Spam-Score: 1.0 (+) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 1.0 (+) > 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? > + ;; 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. From unknown Mon Aug 18 11:25:14 2025 X-Loop: help-debbugs@gnu.org Subject: bug#19102: 24.4; outline-move-subtree-up/down error at last and second-last subtree 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: To: Eli Zaretskii Cc: paul@tilk.co, 19102@debbugs.gnu.org Received: via spool by 19102-submit@debbugs.gnu.org id=B19102.14164170297773 (code B ref 19102); Wed, 19 Nov 2014 17:11:03 +0000 Received: (at 19102) by debbugs.gnu.org; 19 Nov 2014 17:10:29 +0000 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 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 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 From: Stephen Berman References: <87lhn7s522.fsf@rosalinde.fritz.box> <83lhn789tq.fsf@gnu.org> Date: Wed, 19 Nov 2014 18:09:52 +0100 In-Reply-To: <83lhn789tq.fsf@gnu.org> (Eli Zaretskii's message of "Wed, 19 Nov 2014 17:54:41 +0200") Message-ID: <87h9xvruan.fsf@rosalinde.fritz.box> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Provags-ID: V03:K0:5SjkuPNkhTDjSTok4fWor1uv389WvYlyAFhGxgtXdNA3E6BU1ES jMYoQL/j8GuZUOt00kT5Q6TtTPyD6n3NH3ctfVXFZCjmMVRIiDVcdP8hJQ9BY8LbMy0RMxW UU445eHcl/C0fs3Zxpjl8jDAR40OlBSPKJBKNTLygKYM4XyKxp5X5MLLRZUDAV3xrGxJQ0F ULusa9lXsBpLKXvo1axDQ== X-UI-Out-Filterresults: notjunk:1; X-Spam-Score: -0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.0 (/) 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 From unknown Mon Aug 18 11:25:14 2025 X-Loop: help-debbugs@gnu.org Subject: bug#19102: 24.4; outline-move-subtree-up/down error at last and second-last subtree Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 19 Nov 2014 18:57: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: To: Stephen Berman Cc: paul@tilk.co, 19102@debbugs.gnu.org Reply-To: Eli Zaretskii Received: via spool by 19102-submit@debbugs.gnu.org id=B19102.141642337828074 (code B ref 19102); Wed, 19 Nov 2014 18:57:01 +0000 Received: (at 19102) by debbugs.gnu.org; 19 Nov 2014 18:56:18 +0000 Received: from localhost ([127.0.0.1]:38598 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XrAQM-0007Ik-EG for submit@debbugs.gnu.org; Wed, 19 Nov 2014 13:56:18 -0500 Received: from mtaout29.012.net.il ([80.179.55.185]:53484) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XrAQK-0007Ic-Q0 for 19102@debbugs.gnu.org; Wed, 19 Nov 2014 13:56:17 -0500 Received: from conversion-daemon.mtaout29.012.net.il by mtaout29.012.net.il (HyperSendmail v2007.08) id <0NFA00F00V3G3900@mtaout29.012.net.il> for 19102@debbugs.gnu.org; Wed, 19 Nov 2014 20:54:24 +0200 (IST) Received: from HOME-C4E4A596F7 ([87.69.4.28]) by mtaout29.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0NFA00BOGV6O7U30@mtaout29.012.net.il>; Wed, 19 Nov 2014 20:54:24 +0200 (IST) Date: Wed, 19 Nov 2014 20:56:12 +0200 From: Eli Zaretskii In-reply-to: <87h9xvruan.fsf@rosalinde.fritz.box> X-012-Sender: halo1@inter.net.il Message-id: <83tx1v6mur.fsf@gnu.org> References: <87lhn7s522.fsf@rosalinde.fritz.box> <83lhn789tq.fsf@gnu.org> <87h9xvruan.fsf@rosalinde.fritz.box> X-Spam-Score: 1.0 (+) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 1.0 (+) > From: Stephen Berman > Cc: paul@tilk.co, 19102@debbugs.gnu.org > Date: Wed, 19 Nov 2014 18:09:52 +0100 > > On Wed, 19 Nov 2014 17:54:41 +0200 Eli Zaretskii wrote: > > 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. Wouldn't using eolp instead of the comparison solve that problem more easily? From unknown Mon Aug 18 11:25:14 2025 X-Loop: help-debbugs@gnu.org Subject: bug#19102: 24.4; outline-move-subtree-up/down error at last and second-last subtree Resent-From: Stephen Berman Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 19 Nov 2014 20:15: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: To: Eli Zaretskii Cc: paul@tilk.co, 19102@debbugs.gnu.org Received: via spool by 19102-submit@debbugs.gnu.org id=B19102.141642809013920 (code B ref 19102); Wed, 19 Nov 2014 20:15:03 +0000 Received: (at 19102) by debbugs.gnu.org; 19 Nov 2014 20:14:50 +0000 Received: from localhost ([127.0.0.1]:38684 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XrBeL-0003cS-Jt for submit@debbugs.gnu.org; Wed, 19 Nov 2014 15:14:49 -0500 Received: from mout.gmx.net ([212.227.17.20]:55003) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XrBeI-0003cI-FL for 19102@debbugs.gnu.org; Wed, 19 Nov 2014 15:14:47 -0500 Received: from rosalinde.fritz.box ([89.245.64.17]) by mail.gmx.com (mrgmx101) with ESMTPSA (Nemesis) id 0M1BMy-1Y6N7S3Wky-00tAHk; Wed, 19 Nov 2014 21:14:42 +0100 From: Stephen Berman References: <87lhn7s522.fsf@rosalinde.fritz.box> <83lhn789tq.fsf@gnu.org> <87h9xvruan.fsf@rosalinde.fritz.box> <83tx1v6mur.fsf@gnu.org> Date: Wed, 19 Nov 2014 21:14:42 +0100 In-Reply-To: <83tx1v6mur.fsf@gnu.org> (Eli Zaretskii's message of "Wed, 19 Nov 2014 20:56:12 +0200") Message-ID: <87a93nrlql.fsf@rosalinde.fritz.box> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Provags-ID: V03:K0:L9BgNRojbSHZtiJcwYQ2lEoTmBCvxAc6wdaJY1OtgB2V3IyY8Ph +L3wc9pRcTfLQ7cwg/J5rAUkIcZYfY273SssEc8ipKtmngstyZq81s04ZOROCYOsfwXzNhk HujcnV0jnAq6KpbJQJSNAngf/sx36CigAh/hE3J8i99PmLFUal1cazBjb4qaSc8Pc8wSXtD /wRu/eY74r0B1yaPz+kWw== X-UI-Out-Filterresults: notjunk:1; X-Spam-Score: -0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.0 (/) On Wed, 19 Nov 2014 20:56:12 +0200 Eli Zaretskii wrote: >> From: Stephen Berman >> Cc: paul@tilk.co, 19102@debbugs.gnu.org >> Date: Wed, 19 Nov 2014 18:09:52 +0100 >> >> On Wed, 19 Nov 2014 17:54:41 +0200 Eli Zaretskii wrote: >> > 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. > > 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" and still fails to move the subtree in the cases I listed. But using eolp in place of the comparison in my patch is fine, and cleaner, so thanks. Do you see any other problems with the patch or more room for improvement? Steve Berman From unknown Mon Aug 18 11:25:14 2025 X-Loop: help-debbugs@gnu.org Subject: bug#19102: 24.4; outline-move-subtree-up/down error at last and second-last subtree Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 19 Nov 2014 20:33: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: To: Stephen Berman Cc: paul@tilk.co, 19102@debbugs.gnu.org Reply-To: Eli Zaretskii Received: via spool by 19102-submit@debbugs.gnu.org id=B19102.141642913415664 (code B ref 19102); Wed, 19 Nov 2014 20:33:02 +0000 Received: (at 19102) by debbugs.gnu.org; 19 Nov 2014 20:32:14 +0000 Received: from localhost ([127.0.0.1]:38709 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XrBvC-00044a-Ee for submit@debbugs.gnu.org; Wed, 19 Nov 2014 15:32:14 -0500 Received: from mtaout24.012.net.il ([80.179.55.180]:41985) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XrBv9-00044P-4b for 19102@debbugs.gnu.org; Wed, 19 Nov 2014 15:32:12 -0500 Received: from conversion-daemon.mtaout24.012.net.il by mtaout24.012.net.il (HyperSendmail v2007.08) id <0NFA00500YVUJV00@mtaout24.012.net.il> for 19102@debbugs.gnu.org; Wed, 19 Nov 2014 22:24:32 +0200 (IST) Received: from HOME-C4E4A596F7 ([87.69.4.28]) by mtaout24.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0NFA00PGFZCW7H60@mtaout24.012.net.il>; Wed, 19 Nov 2014 22:24:32 +0200 (IST) Date: Wed, 19 Nov 2014 22:32:06 +0200 From: Eli Zaretskii In-reply-to: <87a93nrlql.fsf@rosalinde.fritz.box> X-012-Sender: halo1@inter.net.il Message-id: <83lhn76iex.fsf@gnu.org> References: <87lhn7s522.fsf@rosalinde.fritz.box> <83lhn789tq.fsf@gnu.org> <87h9xvruan.fsf@rosalinde.fritz.box> <83tx1v6mur.fsf@gnu.org> <87a93nrlql.fsf@rosalinde.fritz.box> X-Spam-Score: 1.0 (+) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 1.0 (+) > 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. > 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. From unknown Mon Aug 18 11:25:14 2025 X-Loop: help-debbugs@gnu.org Subject: bug#19102: 24.4; outline-move-subtree-up/down error at last and second-last subtree Resent-From: Stephen Berman Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 19 Nov 2014 22:08: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: To: Eli Zaretskii Cc: paul@tilk.co, 19102@debbugs.gnu.org Received: via spool by 19102-submit@debbugs.gnu.org id=B19102.141643483429536 (code B ref 19102); Wed, 19 Nov 2014 22:08:01 +0000 Received: (at 19102) by debbugs.gnu.org; 19 Nov 2014 22:07:14 +0000 Received: from localhost ([127.0.0.1]:38789 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XrDP7-0007gJ-Sp for submit@debbugs.gnu.org; Wed, 19 Nov 2014 17:07:14 -0500 Received: from mout.gmx.net ([212.227.15.15]:65123) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XrDP5-0007g9-0y for 19102@debbugs.gnu.org; Wed, 19 Nov 2014 17:07:12 -0500 Received: from rosalinde.fritz.box ([89.245.64.17]) by mail.gmx.com (mrgmx002) with ESMTPSA (Nemesis) id 0M23zf-1Y76h239Rr-00u5sL; Wed, 19 Nov 2014 23:07:03 +0100 From: Stephen Berman 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> Date: Wed, 19 Nov 2014 23:07:03 +0100 In-Reply-To: <83lhn76iex.fsf@gnu.org> (Eli Zaretskii's message of "Wed, 19 Nov 2014 22:32:06 +0200") Message-ID: <8761easv3s.fsf@rosalinde.fritz.box> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Provags-ID: V03:K0:dc5JR3m7Dgq3jRDTSW4hqsEp6ukzAm/V3BHvJHjucP9oV/n8Tkh jFPehyGbls2ESZ+HQnrVxP8u82SRm84mlBnh50BAh1CDgb9/9cYEBiUcPbokZFM6r8ic9D4 20I2Ku6MNWeaDzPj1jQet31Ekp3sxqk3FoJ1L53+1RFNqAX87bglGVNkd9dWs7n9HxYiROG IixvVg+a6EG3GpmlFJElA== X-UI-Out-Filterresults: notjunk:1; X-Spam-Score: -0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.0 (/) --=-=-= Content-Type: text/plain 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 --=-=-= Content-Type: text/x-patch Content-Disposition: inline Content-Description: bug#19102 patch diff --git a/lisp/outline.el b/lisp/outline.el index c7cad31..a34ff12 100644 --- a/lisp/outline.el +++ b/lisp/outline.el @@ -649,32 +649,46 @@ the match data is set appropriately." 'outline-get-last-sibling)) (ins-point (make-marker)) (cnt (abs arg)) + ;; Make sure we can move forward to find the end of the + ;; subtree and the insertion point. + (maybe-forward-char (lambda () + (and (eobp) (not (bolp)) (newline)) + (and (eolp) (not (bolp)) (forward-char 1)))) + (empty-last-line (save-excursion + (goto-char (point-max)) + (and (bolp) (eolp)))) beg end folded) - ;; Select the tree + ;; Select the tree. (outline-back-to-heading) (setq beg (point)) (save-match-data (save-excursion (outline-end-of-heading) (setq folded (outline-invisible-p))) (outline-end-of-subtree)) - (if (= (char-after) ?\n) (forward-char 1)) + (funcall maybe-forward-char) (setq end (point)) - ;; Find insertion point, with error handling + ;; Find insertion point, with error handling. (goto-char beg) (while (> cnt 0) (or (funcall movfunc) (progn (goto-char beg) - (error "Cannot move past superior level"))) + (with-demoted-errors "%s" + (message "Cannot move past superior level")))) (setq cnt (1- cnt))) (if (> arg 0) - ;; Moving forward - still need to move over subtree + ;; Moving forward - still need to move over subtree. (progn (outline-end-of-subtree) - (if (= (char-after) ?\n) (forward-char 1)))) + (funcall maybe-forward-char))) (move-marker ins-point (point)) (insert (delete-and-extract-region beg end)) (goto-char ins-point) (if folded (hide-subtree)) - (move-marker ins-point nil))) + (move-marker ins-point nil) + ;; If we added a newline to move forward, delete it. + (save-excursion + (goto-char (point-max)) + (when (and (bolp) (eolp) (not empty-last-line)) + (delete-char -1))))) (defun outline-end-of-heading () (if (re-search-forward outline-heading-end-regexp nil 'move) --=-=-=-- From unknown Mon Aug 18 11:25:14 2025 X-Loop: help-debbugs@gnu.org Subject: bug#19102: 24.4; outline-move-subtree-up/down error at last and second-last subtree 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: To: Stephen Berman Cc: Eli Zaretskii , 19102@debbugs.gnu.org Received: via spool by 19102-submit@debbugs.gnu.org id=B19102.141646602614232 (code B ref 19102); Thu, 20 Nov 2014 06:48:01 +0000 Received: (at 19102) by debbugs.gnu.org; 20 Nov 2014 06:47:06 +0000 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 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 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) 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 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) 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> From: Paul Rankin In-reply-to: <8761easv3s.fsf@rosalinde.fritz.box> Date: Thu, 20 Nov 2014 16:46:22 +1000 Message-ID: MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.7 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) 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 From unknown Mon Aug 18 11:25:14 2025 X-Loop: help-debbugs@gnu.org Subject: bug#19102: 24.4; outline-move-subtree-up/down error at last and second-last subtree Resent-From: Paul Rankin Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 20 Nov 2014 07:23: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: To: Stephen Berman Cc: Eli Zaretskii , 19102@debbugs.gnu.org Received: via spool by 19102-submit@debbugs.gnu.org id=B19102.141646818117667 (code B ref 19102); Thu, 20 Nov 2014 07:23:02 +0000 Received: (at 19102) by debbugs.gnu.org; 20 Nov 2014 07:23:01 +0000 Received: from localhost ([127.0.0.1]:38952 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XrM4z-0004ai-1s for submit@debbugs.gnu.org; Thu, 20 Nov 2014 02:23:01 -0500 Received: from out4-smtp.messagingengine.com ([66.111.4.28]:56215) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XrM4w-0004aZ-3Q for 19102@debbugs.gnu.org; Thu, 20 Nov 2014 02:22:58 -0500 Received: from compute2.internal (compute2.nyi.internal [10.202.2.42]) by mailout.nyi.internal (Postfix) with ESMTP id DFBBA20377; Thu, 20 Nov 2014 02:22:57 -0500 (EST) Received: from frontend2 ([10.202.2.161]) by compute2.internal (MEProxy); Thu, 20 Nov 2014 02:22:57 -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=yJofvpjyFdfX bbJxM/VdM6lEzNA=; b=mKneZmYJEMYgNKdgnPQMgssaZBSOeylgB3AGUPRYmsxJ spimoYfiB9BzXccBM5J00pRDTLt9wHRbctDdxoln6lJAvNOqwzfrs9cUAjf7Jk/d JfIBj3qPh6Imz0NTjYinG2O/l+UsPIH6I2FiKi0oBwRl14rWL+V5ExJgKRr8Gvw= 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=yJofvpjyFdfXbbJxM/VdM6lEzNA=; b=N59B5vHygRL6HkcqgSBS clUoAdAK95jBrHuuq9yPU3e3wJ4CbavW1dbCvkCekQtai9aiSs+kyQYCxKaY6EWX KNNZUQkc/v5lIbWemd/LboNMVILflnFn5N7jq4AecSOf/IN6GYMjKOnReCOXiAZW LkPYovjdZI9lKOLr6pFBn1Q= X-Sasl-enc: 9A2a5VTNTb39xT2Osjj4CeuDq8DBXBRiKru9osIL/XGW 1416468176 Received: from Paul-Rankins-MacBook-Pro.local (unknown [202.0.190.43]) by mail.messagingengine.com (Postfix) with ESMTPA id E0C4668017B; Thu, 20 Nov 2014 02:22:55 -0500 (EST) 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> From: Paul Rankin In-reply-to: <8761easv3s.fsf@rosalinde.fritz.box> Date: Thu, 20 Nov 2014 17:22:50 +1000 Message-ID: MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.7 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) 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 I needed to rewrite this for functionality with my own package, so I rewrote it very arrogantly and this is what I came up with... (defun fountain-outline-shift-down (&optional arg) (interactive "p") (outline-back-to-heading) (let* ((move-func (if (< 0 arg) 'outline-get-next-sibling 'outline-get-last-sibling)) (end-point-func '(lambda () (outline-end-of-subtree) (if (and (eolp) (not (bolp)) (eobp)) (open-line 1)) (unless (eobp) (forward-char 1)) (point))) (beg (point)) (end (save-excursion (funcall end-point-func))) (folded (save-excursion (outline-end-of-heading) (outline-invisible-p))) (insert-point (make-marker)) (i (abs arg))) (goto-char beg) (while (< 0 i) (or (funcall move-func) (progn (goto-char beg) (message "Cannot move past superior level"))) (setq i (1- i))) (if (< 0 arg) ; what does this bit do?? (funcall end-point-func)) (move-marker insert-point (point)) (insert (delete-and-extract-region beg end)) (goto-char insert-point) (if folded (hide-subtree)) (set-marker insert-point nil))) The only thing I'm not sure about is the line marked above. This is not intended for Emacs, just wanna see if I'm on the right track :) -- Paul W. Rankin http://www.paulwrankin.com From unknown Mon Aug 18 11:25:14 2025 X-Loop: help-debbugs@gnu.org Subject: bug#19102: 24.4; outline-move-subtree-up/down error at last and second-last subtree 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: To: Paul Rankin Cc: Eli Zaretskii , 19102@debbugs.gnu.org Received: via spool by 19102-submit@debbugs.gnu.org id=B19102.14164781031022 (code B ref 19102); Thu, 20 Nov 2014 10:09:02 +0000 Received: (at 19102) by debbugs.gnu.org; 20 Nov 2014 10:08:23 +0000 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 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 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 From: Stephen Berman 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> Date: Thu, 20 Nov 2014 11:08:13 +0100 In-Reply-To: (Paul Rankin's message of "Thu, 20 Nov 2014 16:46:22 +1000") Message-ID: <87r3wytcaa.fsf@rosalinde.fritz.box> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Provags-ID: V03:K0:zL0yS0yfDZjSTaSaI9OoyRu4RmAMVebseMi+vYpbv+DEmofyzDa a1B0ove5lqwTIscOoADg+s1UcfiFVAePzYlvqou3T83zHPkw5IqlecLDjTTu+T67M0htv9o b4NZIVpS+0MsjkFCC5hJnFPynb9Z4uG4Rc41I+BmwcHagAjC8rLmw/605uq2hrz4ZYG2w+S P2Vtt3tTDyvFqTuj0I4yw== X-UI-Out-Filterresults: notjunk:1; X-Spam-Score: -0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.0 (/) 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 From unknown Mon Aug 18 11:25:14 2025 X-Loop: help-debbugs@gnu.org Subject: bug#19102: 24.4; outline-move-subtree-up/down error at last and second-last subtree Resent-From: Stephen Berman Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 20 Nov 2014 10:10: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: To: Paul Rankin Cc: Eli Zaretskii , 19102@debbugs.gnu.org Received: via spool by 19102-submit@debbugs.gnu.org id=B19102.14164781911163 (code B ref 19102); Thu, 20 Nov 2014 10:10:01 +0000 Received: (at 19102) by debbugs.gnu.org; 20 Nov 2014 10:09:51 +0000 Received: from localhost ([127.0.0.1]:39077 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XrOgQ-0000Ig-LO for submit@debbugs.gnu.org; Thu, 20 Nov 2014 05:09:50 -0500 Received: from mout.gmx.net ([212.227.15.19]:54091) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XrOgO-0000IY-3V for 19102@debbugs.gnu.org; Thu, 20 Nov 2014 05:09:48 -0500 Received: from rosalinde.fritz.box ([89.245.126.188]) by mail.gmx.com (mrgmx002) with ESMTPSA (Nemesis) id 0Lh7sF-1YLB3M3sf9-00oSe8; Thu, 20 Nov 2014 11:09:40 +0100 From: Stephen Berman 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> Date: Thu, 20 Nov 2014 11:09:38 +0100 In-Reply-To: (Paul Rankin's message of "Thu, 20 Nov 2014 17:22:50 +1000") Message-ID: <87ppcitc7x.fsf@rosalinde.fritz.box> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Provags-ID: V03:K0:SOTsA+mlNzqSmNoH6vGhHNRnzHS/frPowfofvFU9+S+Bz/kOwrD 6UMGQoYQJNdx/5SWFsyhau/MYViK1IeMuYWeTvYyYzAZzbhe7DZ54OkSlmAj26m1D74uBNE spSNY3BQZfCcUzX8LzUX/l85Pdpd38usn7BR0P86B35khXd/03LBhFHwsYrZkszZTg3XAuZ L6OZbmc0P2N9MDA+m60hQ== X-UI-Out-Filterresults: notjunk:1; X-Spam-Score: -0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.0 (/) On Thu, 20 Nov 2014 17:22:50 +1000 Paul Rankin wrote: > I needed to rewrite this for functionality with my own package, so I > rewrote it very arrogantly and this is what I came up with... > > (defun fountain-outline-shift-down (&optional arg) > (interactive "p") > (outline-back-to-heading) > (let* ((move-func > (if (< 0 arg) > 'outline-get-next-sibling > 'outline-get-last-sibling)) > (end-point-func > '(lambda () > (outline-end-of-subtree) > (if (and (eolp) > (not (bolp)) > (eobp)) > (open-line 1)) > (unless (eobp) > (forward-char 1)) > (point))) > (beg (point)) > (end > (save-excursion > (funcall end-point-func))) > (folded > (save-excursion > (outline-end-of-heading) > (outline-invisible-p))) > (insert-point (make-marker)) > (i (abs arg))) > (goto-char beg) > (while (< 0 i) > (or (funcall move-func) > (progn (goto-char beg) > (message "Cannot move past superior level"))) > (setq i (1- i))) > (if (< 0 arg) ; what does this bit do?? > (funcall end-point-func)) > (move-marker insert-point (point)) > (insert (delete-and-extract-region beg end)) > (goto-char insert-point) > (if folded > (hide-subtree)) > (set-marker insert-point nil))) This basically does the same thing as the patch I proposed -- adding a newline if necessary to ensure forward movement -- except that if there was no empty line after the last subtree, your code leaves the added newline dangling. If you add that bit then there is effectively no difference between your version and mine. However, yours is slightly shorter and slightly cleaner, since it avoids a couple of setq's of let-bound variables, so maybe it's the better fix (after adding the line deletion bit; also, it's not necessary and AFAIK stylistically discouraged to quote a lambda form; and finally, I'm not sure if open-line is more or less appropriate here than newline -- maybe both are too heavyweight and (insert "\n") or even (terpri) would suffice? > The only thing I'm not sure about is the line marked above. This is not > intended for Emacs, just wanna see if I'm on the right track :) The line you marked tests whether we're moving the subtree down (positive arg) and if so ensures we find the insertion point after it. Or are you asking about something else? Steve Berman From unknown Mon Aug 18 11:25:14 2025 X-Loop: help-debbugs@gnu.org Subject: bug#19102: 24.4; outline-move-subtree-up/down error at last and second-last subtree Resent-From: Paul Rankin Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 20 Nov 2014 13:27: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: To: Stephen Berman Cc: Eli Zaretskii , 19102@debbugs.gnu.org Received: via spool by 19102-submit@debbugs.gnu.org id=B19102.141649000325131 (code B ref 19102); Thu, 20 Nov 2014 13:27:01 +0000 Received: (at 19102) by debbugs.gnu.org; 20 Nov 2014 13:26:43 +0000 Received: from localhost ([127.0.0.1]:39117 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XrRkw-0006XG-LG for submit@debbugs.gnu.org; Thu, 20 Nov 2014 08:26:42 -0500 Received: from out4-smtp.messagingengine.com ([66.111.4.28]:35988) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XrRks-0006X5-J3 for 19102@debbugs.gnu.org; Thu, 20 Nov 2014 08:26:39 -0500 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id C06C120E2C; Thu, 20 Nov 2014 08:26:37 -0500 (EST) Received: from frontend1 ([10.202.2.160]) by compute4.internal (MEProxy); Thu, 20 Nov 2014 08:26:37 -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=s0FAtzD/yFib NUz1x6FZqwGIi78=; b=JI+393iATJg5RsQ6vN/JivS1+gaOwg9OcuTLf+BLx0y6 sIyCVrY/XfpOeuXlCxxfSOh4uiEf7bvuDIOM9j5P5W0YyLeebW9xV6J1Vgl6flyA LcokwNZM2l58YCVZXVGdt0+cM7b0SJNYJjR/mJae/jHjS8md33VJVqXRPy//31E= 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=s0FAtzD/yFibNUz1x6FZqwGIi78=; b=lI4GN5NPTIWGu0pAKHYM XtN50rq0EfjW1MBA+PWVO1krOUubfrIUIzV73HpSduaYpBeAo754XrkSwU27J2GY y9iwr0c3PsYFnd8a5EqrV2faAVCZiH99pgBrVL8Xxl3T+dyG5CUUOyo1Dj0jIIf9 TWM5xC8OA+f1EOQ8l/W+2v0= X-Sasl-enc: 34OTpwbDzORgDJRM+Tq1sjuynZIx5/mx0Ij2SAbj0J5z 1416489996 Received: from Paul-Rankins-MacBook-Pro.local (unknown [202.0.190.43]) by mail.messagingengine.com (Postfix) with ESMTPA id 9E5FDC0000E; Thu, 20 Nov 2014 08:26:35 -0500 (EST) 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> <87r3wytcaa.fsf@rosalinde.fritz.box> From: Paul Rankin In-reply-to: <87r3wytcaa.fsf@rosalinde.fritz.box> Date: Thu, 20 Nov 2014 23:26:09 +1000 Message-ID: MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.7 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) Stephen Berman writes: >> 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 Sorry, I spoke far too soon there. -- Paul W. Rankin http://www.paulwrankin.com From unknown Mon Aug 18 11:25:14 2025 X-Loop: help-debbugs@gnu.org Subject: bug#19102: 24.4; outline-move-subtree-up/down error at last and second-last subtree Resent-From: Paul Rankin Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 20 Nov 2014 13:44: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: To: Stephen Berman Cc: Eli Zaretskii , 19102@debbugs.gnu.org Received: via spool by 19102-submit@debbugs.gnu.org id=B19102.141649100226891 (code B ref 19102); Thu, 20 Nov 2014 13:44:01 +0000 Received: (at 19102) by debbugs.gnu.org; 20 Nov 2014 13:43:22 +0000 Received: from localhost ([127.0.0.1]:39121 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XrS13-0006zf-Eg for submit@debbugs.gnu.org; Thu, 20 Nov 2014 08:43:21 -0500 Received: from out4-smtp.messagingengine.com ([66.111.4.28]:45451) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XrS0z-0006zT-JB for 19102@debbugs.gnu.org; Thu, 20 Nov 2014 08:43:18 -0500 Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.nyi.internal (Postfix) with ESMTP id 60A6F20C0F; Thu, 20 Nov 2014 08:43:17 -0500 (EST) Received: from frontend1 ([10.202.2.160]) by compute5.internal (MEProxy); Thu, 20 Nov 2014 08:43:17 -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=VCBL3J01v0dh fmery+G7boGVZDY=; b=NTA20nM7grMtYj/2gyLnVLfZW81Gf2tmuTVk3L3rv5QP ufYPDuqbpU9XYTdj04IQO8ZqS8uKUq5e61E0M2qLRSjKFPJCNalxyBqZ6RaqzOmZ 9ZSA7B5VBhDM9rjzC/ulmFsnX1yssMgczrOfeBaX5gfvKwwXem6SCtJEtIqL8hY= 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=VCBL3J01v0dhfmery+G7boGVZDY=; b=pbKUT8e9m7TpSh/ICDet 3bEOdHZcbWo7NOi7v+ZlygLGlnOEjM6XqwWwRg2H26Xcyd8yT6PboGYPUoUzkwrC dvD5/f9ZF4xLMqKpY6MgJCSACipLjqYlLKWXvN1Hrm56doagM6trJiPa8p/fq0h2 PoTVVxh/3j9dkBUbUDzSTss= X-Sasl-enc: MSehGm7q7bUPO7YEYPYhLVKzwjimOrKy0wWr2qAqzkpv 1416490996 Received: from Paul-Rankins-MacBook-Pro.local (unknown [202.0.190.43]) by mail.messagingengine.com (Postfix) with ESMTPA id A5BFAC0000E; Thu, 20 Nov 2014 08:43:15 -0500 (EST) 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> <87ppcitc7x.fsf@rosalinde.fritz.box> From: Paul Rankin In-reply-to: <87ppcitc7x.fsf@rosalinde.fritz.box> Date: Thu, 20 Nov 2014 23:43:10 +1000 Message-ID: MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.7 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) Stephen Berman writes: > This basically does the same thing as the patch I proposed -- adding a > newline if necessary to ensure forward movement -- except that if there > was no empty line after the last subtree, your code leaves the added > newline dangling. If you add that bit then there is effectively no > difference between your version and mine. For my package's purposes I think it might be better to have that dangling newline created it's not already there, but yeah, not for outline-mode. (This may be a faux pas on my part.) However, how about this for the dangling line code? --8<---------------cut here---------------start------------->8--- (unless empty-last-line (save-excursion (goto-char (point-max)) (if (and (bolp) (eolp)) (delete-char -1))))) --8<---------------cut here---------------end--------------->8--- That way it doesn't execute if it doesn't need to. Or am I over-thinking it? > However, yours is slightly shorter and slightly cleaner, since it > avoids a couple of setq's of let-bound variables, so maybe it's the > better fix (after adding the line deletion bit; also, it's not > necessary and AFAIK stylistically discouraged to quote a lambda form; > and finally, I'm not sure if open-line is more or less appropriate > here than newline -- maybe both are too heavyweight and (insert "\n") > or even (terpri) would suffice? Awesome, thanks. I'm not proposing any of my code go into Emacs, so go with whatever you think is best. >> The only thing I'm not sure about is the line marked above. This is not >> intended for Emacs, just wanna see if I'm on the right track :) > > The line you marked tests whether we're moving the subtree down > (positive arg) and if so ensures we find the insertion point after it. > Or are you asking about something else? Thanks. Yes that was all, please do not be under any impression that I have any idea what I'm doing. I did find some problems with saving match data though, so just for the heck of it, I've pasted the function I ended up going with for my package (it probably looks like I rewrote things from your patch just to be contrary, but it's just to fit with the internal style of the package): --8<---------------cut here---------------start------------->8--- (defun fountain-outline-shift-down (&optional n) (interactive "p") (outline-back-to-heading) (let* ((move-func (if (< 0 n) 'outline-get-next-sibling 'outline-get-last-sibling)) (end-point-func (lambda () (outline-end-of-subtree) (if (and (eobp) (eolp) (not (bolp))) (insert-char ?\n)) (unless (eobp) (forward-char 1)) (point))) (beg (point)) (folded (save-match-data (outline-end-of-heading) (outline-invisible-p))) (end (save-match-data (funcall end-point-func))) (insert-point (make-marker)) (i (abs n))) (goto-char beg) (while (< 0 i) (or (funcall move-func) (progn (goto-char beg) (message "Cannot shift past higher level"))) (setq i (1- i))) (if (< 0 n) (funcall end-point-func)) (move-marker insert-point (point)) (insert (delete-and-extract-region beg end)) (goto-char insert-point) (if folded (hide-subtree)) (set-marker insert-point nil))) --8<---------------cut here---------------end--------------->8--- -- Paul W. Rankin http://www.paulwrankin.com From unknown Mon Aug 18 11:25:14 2025 X-Loop: help-debbugs@gnu.org Subject: bug#19102: 24.4; outline-move-subtree-up/down error at last and second-last subtree Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 20 Nov 2014 16:22: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: To: Stephen Berman Cc: paul@tilk.co, 19102@debbugs.gnu.org Reply-To: Eli Zaretskii Received: via spool by 19102-submit@debbugs.gnu.org id=B19102.14165004679591 (code B ref 19102); Thu, 20 Nov 2014 16:22:01 +0000 Received: (at 19102) by debbugs.gnu.org; 20 Nov 2014 16:21:07 +0000 Received: from localhost ([127.0.0.1]:39702 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XrUTi-0002Uc-Jx for submit@debbugs.gnu.org; Thu, 20 Nov 2014 11:21:06 -0500 Received: from mtaout27.012.net.il ([80.179.55.183]:44291) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XrUTg-0002UV-UD for 19102@debbugs.gnu.org; Thu, 20 Nov 2014 11:21:05 -0500 Received: from conversion-daemon.mtaout27.012.net.il by mtaout27.012.net.il (HyperSendmail v2007.08) id <0NFC00H00I8PBF00@mtaout27.012.net.il> for 19102@debbugs.gnu.org; Thu, 20 Nov 2014 18:16:27 +0200 (IST) Received: from HOME-C4E4A596F7 ([87.69.4.28]) by mtaout27.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0NFC00AWXIJFIG70@mtaout27.012.net.il>; Thu, 20 Nov 2014 18:16:27 +0200 (IST) Date: Thu, 20 Nov 2014 18:21:03 +0200 From: Eli Zaretskii In-reply-to: <87r3wytcaa.fsf@rosalinde.fritz.box> X-012-Sender: halo1@inter.net.il Message-id: <83vbm96dxs.fsf@gnu.org> 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> <87r3wytcaa.fsf@rosalinde.fritz.box> X-Spam-Score: 1.0 (+) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 1.0 (+) > From: Stephen Berman > Cc: Eli Zaretskii , 19102@debbugs.gnu.org > Date: Thu, 20 Nov 2014 11:08:13 +0100 > > 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. Does it make sense to fix outline-move-subtree-up/down so that they also work when there's no empty line after the last subtree? That's one thing that looks inelegant in your patch, and might also cause some (minor) trouble: what if the user types C-g before this function finishes? From unknown Mon Aug 18 11:25:14 2025 X-Loop: help-debbugs@gnu.org Subject: bug#19102: 24.4; outline-move-subtree-up/down error at last and second-last subtree In-Reply-To: Resent-From: Stephen Berman Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 21 Nov 2014 10:33: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: To: Eli Zaretskii Cc: paul@tilk.co, 19102@debbugs.gnu.org Received: via spool by 19102-submit@debbugs.gnu.org id=B19102.141656595317767 (code B ref 19102); Fri, 21 Nov 2014 10:33:02 +0000 Received: (at 19102) by debbugs.gnu.org; 21 Nov 2014 10:32:33 +0000 Received: from localhost ([127.0.0.1]:40296 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XrlVx-0004cV-0L for submit@debbugs.gnu.org; Fri, 21 Nov 2014 05:32:33 -0500 Received: from mout.gmx.net ([212.227.17.21]:62784) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XrlVt-0004cH-AR for 19102@debbugs.gnu.org; Fri, 21 Nov 2014 05:32:30 -0500 Received: from rosalinde.fritz.box ([89.245.122.145]) by mail.gmx.com (mrgmx103) with ESMTPSA (Nemesis) id 0MIuft-1XpIfk2s13-002YhK; Fri, 21 Nov 2014 11:32:21 +0100 From: Stephen Berman 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> <87r3wytcaa.fsf@rosalinde.fritz.box> <83vbm96dxs.fsf@gnu.org> Date: Fri, 21 Nov 2014 11:32:20 +0100 Message-ID: <87oas0n8sr.fsf@rosalinde.fritz.box> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Provags-ID: V03:K0:h9A6zX8Qfrj38gHIcZknjR86404dOEOVxgATAATjwdS2NOPjHlV rqN0zP1ghf50OyjHjZAtDyLoXQQR0FzsFhtnQpFOZ+2zKtoCK9Aw9jNL515YftKGQbfxBQi BwuQf8vmkmfsYQAf07QF6beX1mVoAMwTn0EMWJCoNrV1wr/q22rmfhLEAPvb5zWOQNeKzCY a9UNipSMR/v5wfP8VVfcQ== X-UI-Out-Filterresults: notjunk:1; X-Spam-Score: -0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.0 (/) On Thu, 20 Nov 2014 18:21:03 +0200 Eli Zaretskii wrote: >> From: Stephen Berman >> Cc: Eli Zaretskii , 19102@debbugs.gnu.org >> Date: Thu, 20 Nov 2014 11:08:13 +0100 >> >> 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. > > Does it make sense to fix outline-move-subtree-up/down so that they > also work when there's no empty line after the last subtree? That's It didn't occur to me before, but your question prompted me to check and I see outline-mode derives from text-mode, which sets require-final-newline to mode-require-final-newline, so I guess the assumption is indeed that files in outline-mode should end in a newline. > one thing that looks inelegant in your patch, and might also cause > some (minor) trouble: what if the user types C-g before this function > finishes? We could avoid the trouble by wrapping the newline call in unwind-protect, couldn't we? But can C-g really take effect here? There is no place in the function where execution halts to wait for user feedback. Maybe with an outline containing an enormous number of subtrees the calculations could take long enough to make C-g interrupt it, though I tried and failed to do it moving over 500 subtrees. But I guess those are idle speculations, it does seem that just keeping a final newline added by the function is the simplest (and perhaps best) fix, so I guess we should commit some version of that fix and see if anyone complains. Steve Berman From unknown Mon Aug 18 11:25:14 2025 X-Loop: help-debbugs@gnu.org Subject: bug#19102: 24.4; outline-move-subtree-up/down error at last and second-last subtree In-Reply-To: Resent-From: Stephen Berman Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 21 Nov 2014 10:34: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: To: Paul Rankin Cc: Eli Zaretskii , 19102@debbugs.gnu.org Received: via spool by 19102-submit@debbugs.gnu.org id=B19102.141656602217920 (code B ref 19102); Fri, 21 Nov 2014 10:34:01 +0000 Received: (at 19102) by debbugs.gnu.org; 21 Nov 2014 10:33:42 +0000 Received: from localhost ([127.0.0.1]:40300 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XrlX3-0004ex-Hl for submit@debbugs.gnu.org; Fri, 21 Nov 2014 05:33:42 -0500 Received: from mout.gmx.net ([212.227.17.21]:52839) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XrlX1-0004ep-Np for 19102@debbugs.gnu.org; Fri, 21 Nov 2014 05:33:40 -0500 Received: from rosalinde.fritz.box ([89.245.122.145]) by mail.gmx.com (mrgmx102) with ESMTPSA (Nemesis) id 0MELdk-1XlByE2QvI-00FPDO; Fri, 21 Nov 2014 11:33:38 +0100 From: Stephen Berman 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> <87ppcitc7x.fsf@rosalinde.fritz.box> Date: Fri, 21 Nov 2014 11:33:37 +0100 Message-ID: <87mw7kn8qm.fsf@rosalinde.fritz.box> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Provags-ID: V03:K0:fJ+cZYys1zl8eYsGY19OrgN2Qp3C9Evja7dx0x3jEe9s6Z6vTFX BiuhHIBaB32I3VKNQOrMTWAF+C0NSpGij87xjO6mrcqKLwgPqblzZccJVckM5pBsw4ppvPA z4xo4kmGFW4ZB04uCOPvLzuY48vBpaIiYdfFfCHpQ+yvGyMSX6JSU0lqCrxq2j4kie51/2j MiL+aOQduJzKGX6+J6nQA== X-UI-Out-Filterresults: notjunk:1; X-Spam-Score: -0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.0 (/) On Thu, 20 Nov 2014 23:43:10 +1000 Paul Rankin wrote: > Stephen Berman writes: > >> This basically does the same thing as the patch I proposed -- adding a >> newline if necessary to ensure forward movement -- except that if there >> was no empty line after the last subtree, your code leaves the added >> newline dangling. If you add that bit then there is effectively no >> difference between your version and mine. > > For my package's purposes I think it might be better to have that > dangling newline created it's not already there, but yeah, not for > outline-mode. (This may be a faux pas on my part.) Actually, the faux pas seems to have been mine, see my latest reply to Eli Zaretskii. > However, how about this for the dangling line code? > > (unless empty-last-line > (save-excursion > (goto-char (point-max)) > (if (and (bolp) (eolp)) > (delete-char -1))))) > > > That way it doesn't execute if it doesn't need to. Or am I over-thinking > it? I guess that could save a few CPU cycles, but I guess the issue is moot now. >> However, yours is slightly shorter and slightly cleaner, since it >> avoids a couple of setq's of let-bound variables, so maybe it's the >> better fix (after adding the line deletion bit; also, it's not >> necessary and AFAIK stylistically discouraged to quote a lambda form; >> and finally, I'm not sure if open-line is more or less appropriate >> here than newline -- maybe both are too heavyweight and (insert "\n") >> or even (terpri) would suffice? > > Awesome, thanks. I'm not proposing any of my code go into Emacs, so go > with whatever you think is best. > >>> The only thing I'm not sure about is the line marked above. This is not >>> intended for Emacs, just wanna see if I'm on the right track :) >> >> The line you marked tests whether we're moving the subtree down >> (positive arg) and if so ensures we find the insertion point after it. >> Or are you asking about something else? > > Thanks. Yes that was all, please do not be under any impression that I > have any idea what I'm doing. Well, you seem to have at least as much an idea about this as I do (you probably shouldn't take that as a compliment ;-). > I did find some problems with saving match data though, so just for the Yes, the match data should be saved. > heck of it, I've pasted the function I ended up going with for my > package (it probably looks like I rewrote things from your patch just to > be contrary, but it's just to fit with the internal style of the > package): > (defun fountain-outline-shift-down (&optional n) > (interactive "p") > (outline-back-to-heading) > (let* ((move-func > (if (< 0 n) > 'outline-get-next-sibling > 'outline-get-last-sibling)) > (end-point-func > (lambda () > (outline-end-of-subtree) > (if (and (eobp) > (eolp) > (not (bolp))) > (insert-char ?\n)) > (unless (eobp) > (forward-char 1)) > (point))) > (beg (point)) > (folded > (save-match-data > (outline-end-of-heading) > (outline-invisible-p))) > (end > (save-match-data > (funcall end-point-func))) > (insert-point (make-marker)) > (i (abs n))) > (goto-char beg) > (while (< 0 i) > (or (funcall move-func) > (progn (goto-char beg) > (message "Cannot shift past higher level"))) > (setq i (1- i))) > (if (< 0 n) > (funcall end-point-func)) > (move-marker insert-point (point)) > (insert (delete-and-extract-region beg end)) > (goto-char insert-point) > (if folded > (hide-subtree)) > (set-marker insert-point nil))) As far as I'm concerned it's fine to commit your fix (though probably without the unrelated more or less stylistic differences); but since I'm not the maintainer of outline.el nor a core Emacs maintainer, it's up to (at least one of) them. Steve Berman From unknown Mon Aug 18 11:25:14 2025 X-Loop: help-debbugs@gnu.org Subject: bug#19102: 24.4; outline-move-subtree-up/down error at last and second-last subtree Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 21 Nov 2014 10:44: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: To: Stephen Berman Cc: paul@tilk.co, 19102@debbugs.gnu.org Reply-To: Eli Zaretskii Received: via spool by 19102-submit@debbugs.gnu.org id=B19102.141656658318773 (code B ref 19102); Fri, 21 Nov 2014 10:44:02 +0000 Received: (at 19102) by debbugs.gnu.org; 21 Nov 2014 10:43:03 +0000 Received: from localhost ([127.0.0.1]:40308 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Xrlg7-0004sj-Cb for submit@debbugs.gnu.org; Fri, 21 Nov 2014 05:43:03 -0500 Received: from mtaout29.012.net.il ([80.179.55.185]:43637) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Xrlg4-0004sJ-Nf for 19102@debbugs.gnu.org; Fri, 21 Nov 2014 05:43:02 -0500 Received: from conversion-daemon.mtaout29.012.net.il by mtaout29.012.net.il (HyperSendmail v2007.08) id <0NFD00J00XESQP00@mtaout29.012.net.il> for 19102@debbugs.gnu.org; Fri, 21 Nov 2014 12:41:05 +0200 (IST) Received: from HOME-C4E4A596F7 ([87.69.4.28]) by mtaout29.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0NFD00DWTXOHRU60@mtaout29.012.net.il>; Fri, 21 Nov 2014 12:41:05 +0200 (IST) Date: Fri, 21 Nov 2014 12:42:56 +0200 From: Eli Zaretskii In-reply-to: <87oas0n8sr.fsf@rosalinde.fritz.box> X-012-Sender: halo1@inter.net.il Message-id: <8361e84yxb.fsf@gnu.org> 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> <87r3wytcaa.fsf@rosalinde.fritz.box> <83vbm96dxs.fsf@gnu.org> <87oas0n8sr.fsf@rosalinde.fritz.box> X-Spam-Score: 1.0 (+) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 1.0 (+) > From: Stephen Berman > Cc: paul@tilk.co, 19102@debbugs.gnu.org > Date: Fri, 21 Nov 2014 11:32:20 +0100 > > > Does it make sense to fix outline-move-subtree-up/down so that they > > also work when there's no empty line after the last subtree? That's > > It didn't occur to me before, but your question prompted me to check and > I see outline-mode derives from text-mode, which sets > require-final-newline to mode-require-final-newline, so I guess the > assumption is indeed that files in outline-mode should end in a newline. Does doing that solve the problem without the need to delete the added line? > > one thing that looks inelegant in your patch, and might also cause > > some (minor) trouble: what if the user types C-g before this function > > finishes? > > We could avoid the trouble by wrapping the newline call in > unwind-protect, couldn't we? Yes, but it's better to avoid that in the first place. > 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 guess those are idle speculations, it does seem that just keeping a > final newline added by the function is the simplest (and perhaps best) > fix, so I guess we should commit some version of that fix and see if > anyone complains. Go for it, and thanks. From unknown Mon Aug 18 11:25:14 2025 X-Loop: help-debbugs@gnu.org Subject: bug#19102: 24.4; outline-move-subtree-up/down error at last and second-last subtree Resent-From: Stephen Berman Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 21 Nov 2014 17:32: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: To: Eli Zaretskii Cc: paul@tilk.co, 19102@debbugs.gnu.org Received: via spool by 19102-submit@debbugs.gnu.org id=B19102.14165910987469 (code B ref 19102); Fri, 21 Nov 2014 17:32:01 +0000 Received: (at 19102) by debbugs.gnu.org; 21 Nov 2014 17:31:38 +0000 Received: from localhost ([127.0.0.1]:41131 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Xrs3V-0001wO-DL for submit@debbugs.gnu.org; Fri, 21 Nov 2014 12:31:37 -0500 Received: from mout.gmx.net ([212.227.15.18]:60802) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Xrs3T-0001wE-21 for 19102@debbugs.gnu.org; Fri, 21 Nov 2014 12:31:36 -0500 Received: from rosalinde.fritz.box ([89.245.122.145]) by mail.gmx.com (mrgmx003) with ESMTPSA (Nemesis) id 0Llmcq-1YRCno0SXI-00ZNyR; Fri, 21 Nov 2014 18:31:20 +0100 From: Stephen Berman 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> <87r3wytcaa.fsf@rosalinde.fritz.box> <83vbm96dxs.fsf@gnu.org> <87oas0n8sr.fsf@rosalinde.fritz.box> <8361e84yxb.fsf@gnu.org> Date: Fri, 21 Nov 2014 18:31:19 +0100 In-Reply-To: <8361e84yxb.fsf@gnu.org> (Eli Zaretskii's message of "Fri, 21 Nov 2014 12:42:56 +0200") Message-ID: <87fvdcmpeg.fsf@rosalinde.fritz.box> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Provags-ID: V03:K0:93/KMCKveCfMLw32/37W1uyOkggI+S0xYMJ8f3moh/97ULU1bFU b/cWmRouW0TM0mjPrMKr6LbEyQSTyh5oanngXnLtqFRY8KShHPMCwBJwC/rtwOVjGfplX3g OtLlPFLFDfIST0O2pfQjzCLw4zosYRHiPeAHU0E3flfokWlZ4OhbITT5eVTgp+Bz15uGonV 9FT2aF07YK1dp1tbPGBlg== X-UI-Out-Filterresults: notjunk:1; X-Spam-Score: -0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.0 (/) --=-=-= Content-Type: text/plain On Fri, 21 Nov 2014 12:42:56 +0200 Eli Zaretskii wrote: >> From: Stephen Berman >> Cc: paul@tilk.co, 19102@debbugs.gnu.org >> Date: Fri, 21 Nov 2014 11:32:20 +0100 >> >> > Does it make sense to fix outline-move-subtree-up/down so that they >> > also work when there's no empty line after the last subtree? That's >> >> It didn't occur to me before, but your question prompted me to check and >> I see outline-mode derives from text-mode, which sets >> require-final-newline to mode-require-final-newline, so I guess the >> assumption is indeed that files in outline-mode should end in a newline. > > Does doing that solve the problem without the need to delete the added > line? Yes. As long as there is a final newline, the only change the current code needs is to replace `=' with `eq'. So given that require-final-newline is true for files in outline-mode, the only case that requires adding a final newline is a non-file outline-mode buffer that lacks a final newline. >> > one thing that looks inelegant in your patch, and might also cause >> > some (minor) trouble: what if the user types C-g before this function >> > finishes? >> >> We could avoid the trouble by wrapping the newline call in >> unwind-protect, couldn't we? > > Yes, but it's better to avoid that in the first place. > >> 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? >> I guess those are idle speculations, it does seem that just keeping a >> final newline added by the function is the simplest (and perhaps best) >> fix, so I guess we should commit some version of that fix and see if >> anyone complains. > > Go for it, and thanks. 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)? Steve Berman --=-=-= Content-Type: text/x-patch Content-Disposition: inline Content-Description: bug#19102 patch diff --git a/lisp/outline.el b/lisp/outline.el index c7cad31..3243e15 100644 --- a/lisp/outline.el +++ b/lisp/outline.el @@ -645,31 +645,38 @@ the match data is set appropriately." (defun outline-move-subtree-down (&optional arg) "Move the current subtree down past ARG headlines of the same level." (interactive "p") - (let ((movfunc (if (> arg 0) 'outline-get-next-sibling - 'outline-get-last-sibling)) - (ins-point (make-marker)) - (cnt (abs arg)) - beg end folded) - ;; Select the tree - (outline-back-to-heading) - (setq beg (point)) - (save-match-data - (save-excursion (outline-end-of-heading) - (setq folded (outline-invisible-p))) - (outline-end-of-subtree)) - (if (= (char-after) ?\n) (forward-char 1)) - (setq end (point)) - ;; Find insertion point, with error handling + (outline-back-to-heading) + (let* ((movfunc (if (> arg 0) 'outline-get-next-sibling + 'outline-get-last-sibling)) + ;; Find the end of the subtree to be moved as well as the point to + ;; move it to, adding a newline if necessary, to ensure these points + ;; are at bol on the line below the subtree. + (end-point-func (lambda () + (outline-end-of-subtree) + (if (and (eobp) (eolp) (not (bolp))) + (insert-char ?\n)) + (unless (eobp) + (forward-char 1)) + (point))) + (beg (point)) + (folded (save-match-data + (outline-end-of-heading) + (outline-invisible-p))) + (end (save-match-data + (funcall end-point-func))) + (ins-point (make-marker)) + (cnt (abs arg))) + ;; Find insertion point, with error handling. (goto-char beg) (while (> cnt 0) (or (funcall movfunc) - (progn (goto-char beg) - (error "Cannot move past superior level"))) + (unless (or (bobp) (eobp)) + (goto-char beg) + (user-error "Cannot shift past higher level"))) (setq cnt (1- cnt))) (if (> arg 0) - ;; Moving forward - still need to move over subtree - (progn (outline-end-of-subtree) - (if (= (char-after) ?\n) (forward-char 1)))) + ;; Moving forward - still need to move over subtree. + (funcall end-point-func)) (move-marker ins-point (point)) (insert (delete-and-extract-region beg end)) (goto-char ins-point) --=-=-=-- From unknown Mon Aug 18 11:25:14 2025 X-Loop: help-debbugs@gnu.org Subject: bug#19102: 24.4; outline-move-subtree-up/down error at last and second-last subtree Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 21 Nov 2014 19:57: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: To: Stephen Berman , Stefan Monnier Cc: paul@tilk.co, 19102@debbugs.gnu.org Reply-To: Eli Zaretskii Received: via spool by 19102-submit@debbugs.gnu.org id=B19102.141659977121881 (code B ref 19102); Fri, 21 Nov 2014 19:57:02 +0000 Received: (at 19102) by debbugs.gnu.org; 21 Nov 2014 19:56:11 +0000 Received: from localhost ([127.0.0.1]:41250 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XruJP-0005gq-3P for submit@debbugs.gnu.org; Fri, 21 Nov 2014 14:56:11 -0500 Received: from mtaout27.012.net.il ([80.179.55.183]:55769) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XruJK-0005gf-Su for 19102@debbugs.gnu.org; Fri, 21 Nov 2014 14:56:08 -0500 Received: from conversion-daemon.mtaout27.012.net.il by mtaout27.012.net.il (HyperSendmail v2007.08) id <0NFE00M00M62XI00@mtaout27.012.net.il> for 19102@debbugs.gnu.org; Fri, 21 Nov 2014 21:51:30 +0200 (IST) Received: from HOME-C4E4A596F7 ([87.69.4.28]) by mtaout27.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0NFE00I8GN5UMK60@mtaout27.012.net.il>; Fri, 21 Nov 2014 21:51:30 +0200 (IST) Date: Fri, 21 Nov 2014 21:56:07 +0200 From: Eli Zaretskii In-reply-to: <87fvdcmpeg.fsf@rosalinde.fritz.box> X-012-Sender: halo1@inter.net.il Message-id: <83bno0tjjc.fsf@gnu.org> 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> <87r3wytcaa.fsf@rosalinde.fritz.box> <83vbm96dxs.fsf@gnu.org> <87oas0n8sr.fsf@rosalinde.fritz.box> <8361e84yxb.fsf@gnu.org> <87fvdcmpeg.fsf@rosalinde.fritz.box> X-Spam-Score: 1.0 (+) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 1.0 (+) > From: Stephen Berman > Cc: paul@tilk.co, 19102@debbugs.gnu.org > 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. From unknown Mon Aug 18 11:25:14 2025 X-Loop: help-debbugs@gnu.org Subject: bug#19102: 24.4; outline-move-subtree-up/down error at last and second-last subtree Resent-From: Stephen Berman Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 21 Nov 2014 20:05: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: To: Eli Zaretskii Cc: paul@tilk.co, 19102@debbugs.gnu.org, Stefan Monnier Received: via spool by 19102-submit@debbugs.gnu.org id=B19102.141660028422687 (code B ref 19102); Fri, 21 Nov 2014 20:05:02 +0000 Received: (at 19102) by debbugs.gnu.org; 21 Nov 2014 20:04:44 +0000 Received: from localhost ([127.0.0.1]:41254 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XruRg-0005tq-5j for submit@debbugs.gnu.org; Fri, 21 Nov 2014 15:04:44 -0500 Received: from mout.gmx.net ([212.227.15.18]:51301) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XruRe-0005te-Eg for 19102@debbugs.gnu.org; Fri, 21 Nov 2014 15:04:43 -0500 Received: from rosalinde.fritz.box ([89.245.122.145]) by mail.gmx.com (mrgmx003) with ESMTPSA (Nemesis) id 0Mg42v-1XdOMd02kf-00NVHi; Fri, 21 Nov 2014 21:04:22 +0100 From: Stephen Berman 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> <87r3wytcaa.fsf@rosalinde.fritz.box> <83vbm96dxs.fsf@gnu.org> <87oas0n8sr.fsf@rosalinde.fritz.box> <8361e84yxb.fsf@gnu.org> <87fvdcmpeg.fsf@rosalinde.fritz.box> <83bno0tjjc.fsf@gnu.org> Date: Fri, 21 Nov 2014 21:04:19 +0100 In-Reply-To: <83bno0tjjc.fsf@gnu.org> (Eli Zaretskii's message of "Fri, 21 Nov 2014 21:56:07 +0200") Message-ID: <87bno0mibg.fsf@rosalinde.fritz.box> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Provags-ID: V03:K0:HKUTzwQQUTLJOtE3Y3WVMHt6M9O4udChTM/PkTOhqAQlOl9Xt+U vZGoDDrbUX5QgBLQQnJ7r426badk18khXcttKf4v6uNAKPV6VXPsbwItwl2DJIkzsvSpCTX GsVG9KgEyK490eYZ9FLIjnG7ZLOCzOzgNT9krBBwjYclni47NFH1EHPVxXpwN5XxQgfhbI/ RLFdCOHqImujRxyL9uc/g== X-UI-Out-Filterresults: notjunk:1; X-Spam-Score: -0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.0 (/) On Fri, 21 Nov 2014 21:56:07 +0200 Eli Zaretskii wrote: >> From: Stephen Berman >> Cc: paul@tilk.co, 19102@debbugs.gnu.org >> 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. Thanks for the explanation. >> 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. Ok. Steve Berman From unknown Mon Aug 18 11:25:14 2025 X-Loop: help-debbugs@gnu.org Subject: bug#19102: 24.4; outline-move-subtree-up/down error at last and second-last subtree Resent-From: Paul Rankin Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 22 Nov 2014 03:50:04 +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: To: Eli Zaretskii Cc: 19102@debbugs.gnu.org, Stephen Berman , Stefan Monnier Received: via spool by 19102-submit@debbugs.gnu.org id=B19102.141662816815100 (code B ref 19102); Sat, 22 Nov 2014 03:50:04 +0000 Received: (at 19102) by debbugs.gnu.org; 22 Nov 2014 03:49:28 +0000 Received: from localhost ([127.0.0.1]:41372 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Xs1hP-0003vT-Kd for submit@debbugs.gnu.org; Fri, 21 Nov 2014 22:49:28 -0500 Received: from out4-smtp.messagingengine.com ([66.111.4.28]:39798) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Xs1hJ-0003vG-Bi for 19102@debbugs.gnu.org; Fri, 21 Nov 2014 22:49:25 -0500 Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.nyi.internal (Postfix) with ESMTP id 912972064C for <19102@debbugs.gnu.org>; Fri, 21 Nov 2014 22:49:20 -0500 (EST) Received: from frontend2 ([10.202.2.161]) by compute5.internal (MEProxy); Fri, 21 Nov 2014 22:49:20 -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=PsTkXO0CA5Tk XHXBHL7OIxOX8iI=; b=pa8duE0da099WJZ4/zndmrqY/lnYpgjsuW99MRLOgCKG ocjLC9tpah3+aypv/2dO42m9TWnVdurfC7cUJNSEmS66s3dF5xKS8YSqz8kXTU3e NpKOgZuBO4KWp8XkwaoPZFzGD1CvP92xhHAmoq8byQ+/m5ANiBj4YRWWvb2Nvjo= 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=PsTkXO0CA5TkXHXBHL7OIxOX8iI=; b=QpZAK3PSPFEmEvDi0AOz HunnDKPff3BHESPATQ5cLkObIBv3Ofg+NqLi01uAEAkbADuoEnHTku75tRKaeV3r K3dMw8fQ+0dCgWv3O24dZwW4Sp/YzYJEd3AdQudrMSWvB/ZYCfiD5AfsZGfxwu+u 7LRHChJoHIfcDX76gECiZu0= X-Sasl-enc: 54HapnOdhEpIHuIB9wtiNoC6HbEQiZ1Lh3TA5N8ujso3 1416628159 Received: from Paul-Rankins-MacBook-Pro.local (unknown [202.0.190.43]) by mail.messagingengine.com (Postfix) with ESMTPA id 7E1606800EC; Fri, 21 Nov 2014 22:49:18 -0500 (EST) 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> <87r3wytcaa.fsf@rosalinde.fritz.box> <83vbm96dxs.fsf@gnu.org> <87oas0n8sr.fsf@rosalinde.fritz.box> <8361e84yxb.fsf@gnu.org> <87fvdcmpeg.fsf@rosalinde.fritz.box> <83bno0tjjc.fsf@gnu.org> From: Paul Rankin In-reply-to: <83bno0tjjc.fsf@gnu.org> Date: Sat, 22 Nov 2014 13:49:10 +1000 Message-ID: MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.7 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) Eli Zaretskii writes: >> 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. If it doesn't qualify as tiny, I'm happy to say Stephen took some unofficial inspiration from some errant suggestion from me and wrote the code all by himself, ergo copyright is all his :) -- Paul W. Rankin http://www.paulwrankin.com From unknown Mon Aug 18 11:25:14 2025 X-Loop: help-debbugs@gnu.org Subject: bug#19102: 24.4; outline-move-subtree-up/down error at last and second-last subtree Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 22 Nov 2014 16:33: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: To: Stephen Berman Cc: paul@tilk.co, Eli Zaretskii , 19102@debbugs.gnu.org Received: via spool by 19102-submit@debbugs.gnu.org id=B19102.141667394429079 (code B ref 19102); Sat, 22 Nov 2014 16:33:02 +0000 Received: (at 19102) by debbugs.gnu.org; 22 Nov 2014 16:32:24 +0000 Received: from localhost ([127.0.0.1]:41921 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XsDbk-0007Yx-DO for submit@debbugs.gnu.org; Sat, 22 Nov 2014 11:32:24 -0500 Received: from chene.dit.umontreal.ca ([132.204.246.20]:51933) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XsDbi-0007Yp-VL for 19102@debbugs.gnu.org; Sat, 22 Nov 2014 11:32:23 -0500 Received: from pastel.home (lechon.iro.umontreal.ca [132.204.27.242]) by chene.dit.umontreal.ca (8.14.1/8.14.1) with ESMTP id sAMGWLfp001662; Sat, 22 Nov 2014 11:32:22 -0500 Received: by pastel.home (Postfix, from userid 20848) id 8768B43AC; Sat, 22 Nov 2014 11:32:21 -0500 (EST) From: Stefan Monnier 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> <87r3wytcaa.fsf@rosalinde.fritz.box> <83vbm96dxs.fsf@gnu.org> <87oas0n8sr.fsf@rosalinde.fritz.box> <8361e84yxb.fsf@gnu.org> <87fvdcmpeg.fsf@rosalinde.fritz.box> Date: Sat, 22 Nov 2014 11:32:21 -0500 In-Reply-To: <87fvdcmpeg.fsf@rosalinde.fritz.box> (Stephen Berman's message of "Fri, 21 Nov 2014 18:31:19 +0100") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-NAI-Spam-Flag: NO X-NAI-Spam-Threshold: 5 X-NAI-Spam-Score: 0 X-NAI-Spam-Rules: 1 Rules triggered RV5133=0 X-NAI-Spam-Version: 2.3.0.9393 : core <5133> : inlines <1554> : streams <1346836> : uri <1835708> X-Spam-Score: -1.3 (-) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.3 (-) > Yes. As long as there is a final newline, the only change the current > code needs is to replace `=' with `eq'. So given that > require-final-newline is true for files in outline-mode, the only case > that requires adding a final newline is a non-file outline-mode buffer > that lacks a final newline. I don't understand why there'd be a difference between file and non-file buffers. Outline-mode doesn't care about files at all. The buffer can end without a newline both in the file and in the non-file case, regardless of the require-final-newline setting. OTOH, we can add a final newline pretty much any time we feel like it (better not do it gratuitously, but in the present case I can't think of any reason why we'd go out of our way just to avoid adding a final newline). Having failed to follow the thread until now, I don't know what should be done, but I hope this comment of mine can help someone else decide. Stefan From unknown Mon Aug 18 11:25:14 2025 X-Loop: help-debbugs@gnu.org Subject: bug#19102: 24.4; outline-move-subtree-up/down error at last and second-last subtree Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 22 Nov 2014 16:46: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: To: Stefan Monnier Cc: paul@tilk.co, 19102@debbugs.gnu.org, stephen.berman@gmx.net Reply-To: Eli Zaretskii Received: via spool by 19102-submit@debbugs.gnu.org id=B19102.141667475930265 (code B ref 19102); Sat, 22 Nov 2014 16:46:02 +0000 Received: (at 19102) by debbugs.gnu.org; 22 Nov 2014 16:45:59 +0000 Received: from localhost ([127.0.0.1]:41925 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XsDos-0007s5-O8 for submit@debbugs.gnu.org; Sat, 22 Nov 2014 11:45:58 -0500 Received: from mtaout21.012.net.il ([80.179.55.169]:38689) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XsDoq-0007rw-N1 for 19102@debbugs.gnu.org; Sat, 22 Nov 2014 11:45:57 -0500 Received: from conversion-daemon.a-mtaout21.012.net.il by a-mtaout21.012.net.il (HyperSendmail v2007.08) id <0NFG00I008WW0W00@a-mtaout21.012.net.il> for 19102@debbugs.gnu.org; Sat, 22 Nov 2014 18:45:54 +0200 (IST) Received: from HOME-C4E4A596F7 ([87.69.4.28]) by a-mtaout21.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0NFG00HLH98IWW50@a-mtaout21.012.net.il>; Sat, 22 Nov 2014 18:45:54 +0200 (IST) Date: Sat, 22 Nov 2014 18:45:59 +0200 From: Eli Zaretskii In-reply-to: X-012-Sender: halo1@inter.net.il Message-id: <83lhn3rxo8.fsf@gnu.org> 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> <87r3wytcaa.fsf@rosalinde.fritz.box> <83vbm96dxs.fsf@gnu.org> <87oas0n8sr.fsf@rosalinde.fritz.box> <8361e84yxb.fsf@gnu.org> <87fvdcmpeg.fsf@rosalinde.fritz.box> X-Spam-Score: 1.0 (+) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 1.0 (+) > From: Stefan Monnier > Cc: Eli Zaretskii , paul@tilk.co, 19102@debbugs.gnu.org > Date: Sat, 22 Nov 2014 11:32:21 -0500 > > Having failed to follow the thread until now, I don't know what > should be done Please turn your attention to this at least: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=19102#62 From unknown Mon Aug 18 11:25:14 2025 X-Loop: help-debbugs@gnu.org Subject: bug#19102: 24.4; outline-move-subtree-up/down error at last and second-last subtree Resent-From: Stephen Berman Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 22 Nov 2014 22:21: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: To: Stefan Monnier Cc: paul@tilk.co, Eli Zaretskii , 19102@debbugs.gnu.org Received: via spool by 19102-submit@debbugs.gnu.org id=B19102.141669481928165 (code B ref 19102); Sat, 22 Nov 2014 22:21:01 +0000 Received: (at 19102) by debbugs.gnu.org; 22 Nov 2014 22:20:19 +0000 Received: from localhost ([127.0.0.1]:42036 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XsJ2Q-0007KD-Ed for submit@debbugs.gnu.org; Sat, 22 Nov 2014 17:20:18 -0500 Received: from mout.gmx.net ([212.227.15.18]:49543) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XsJ2M-0007K0-PQ for 19102@debbugs.gnu.org; Sat, 22 Nov 2014 17:20:16 -0500 Received: from rosalinde.fritz.box ([89.245.78.19]) by mail.gmx.com (mrgmx003) with ESMTPSA (Nemesis) id 0M2cYX-1YAvwn3Kpp-00sR99; Sat, 22 Nov 2014 23:20:05 +0100 From: Stephen Berman 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> <87r3wytcaa.fsf@rosalinde.fritz.box> <83vbm96dxs.fsf@gnu.org> <87oas0n8sr.fsf@rosalinde.fritz.box> <8361e84yxb.fsf@gnu.org> <87fvdcmpeg.fsf@rosalinde.fritz.box> Date: Sat, 22 Nov 2014 23:20:03 +0100 In-Reply-To: (Stefan Monnier's message of "Sat, 22 Nov 2014 11:32:21 -0500") Message-ID: <87oaryop2k.fsf@rosalinde.fritz.box> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Provags-ID: V03:K0:GK17LvhA596zeu845DMEBdmWo7SQgCd4X0wApoIzlDPWPx8FcGy zM7tnzEoFJA6SSgRZ346fbbOuynvH8G2WUUdCQpHBtpYsNnB/ft4j8SvTj3vAPr638/01sM Hxi30nI3sWceZxa8qqhbgBSuvQq+oAnxv7zL7VZ0tzEKouAUY6bsypbHm34MxIrL4g6r76v 99oN6/5N+1ol56qzK6/hw== X-UI-Out-Filterresults: notjunk:1; X-Spam-Score: -0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.0 (/) On Sat, 22 Nov 2014 11:32:21 -0500 Stefan Monnier wrote: >> Yes. As long as there is a final newline, the only change the current >> code needs is to replace `=' with `eq'. So given that >> require-final-newline is true for files in outline-mode, the only case >> that requires adding a final newline is a non-file outline-mode buffer >> that lacks a final newline. > > I don't understand why there'd be a difference between file and > non-file buffers. Outline-mode doesn't care about files at all. > > The buffer can end without a newline both in the file and in the > non-file case, regardless of the require-final-newline setting. But by default, when a file in outline-mode is saved, if it doesn't end in a new line one is added, so on revisiting the file the user would have to delete the final newline for there to be none. Otherwise, the only problematic case is a buffer in outline-mode that hasn't been written to a file yet, since here the user has to add a final newline to avoid errors. Here's a minimal recipe to show the problem: 0. emacs -Q 1. C-x b test RET 2. evaluate this sexp: (progn (switch-to-buffer (generate-new-buffer "test")) (insert "* one\n* two\n") (outline-mode)) 3. Typing `C-c C-v' (outline-move-subtree-down) with point on either line, or typing `C-c C-^' (outline-move-subtree-up) with point on the second line, raises the error "Wrong type argument: number-or-marker-p, nil". (This is the error of the OP of this bug.) 4. You can avoid this error by replacing both occurrences of `=' with `eq' in outline-move-subtree-down, and now `C-c C-v' and `C-c C-^' work as expected. 5. Now delete the final newline, so that eob is after the "o" in line 2. => Now typing either `C-c C-v' with point on line one or `C-c C-^' with point line two result in the buffer containing the single line "* two* one". So once the error in step 3 is fixed, you still have to make sure there's a final newline. > OTOH, we can add a final newline pretty much any time we feel like it > (better not do it gratuitously, but in the present case I can't think > of any reason why we'd go out of our way just to avoid adding a final > newline). Does "we" refer to the outline.el code? If so, the proposed patch does just the opposite: it makes sure there's a final newline. Does this make things clearer? Steve Berman From unknown Mon Aug 18 11:25:14 2025 X-Loop: help-debbugs@gnu.org Subject: bug#19102: 24.4; outline-move-subtree-up/down error at last and second-last subtree Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 24 Nov 2014 04:08: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: To: Stephen Berman Cc: paul@tilk.co, Eli Zaretskii , 19102@debbugs.gnu.org Received: via spool by 19102-submit@debbugs.gnu.org id=B19102.14168020754277 (code B ref 19102); Mon, 24 Nov 2014 04:08:02 +0000 Received: (at 19102) by debbugs.gnu.org; 24 Nov 2014 04:07:55 +0000 Received: from localhost ([127.0.0.1]:43100 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XskwN-00016v-45 for submit@debbugs.gnu.org; Sun, 23 Nov 2014 23:07:55 -0500 Received: from chene.dit.umontreal.ca ([132.204.246.20]:41853) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XskwK-00016m-DZ for 19102@debbugs.gnu.org; Sun, 23 Nov 2014 23:07:53 -0500 Received: from fmsmemgm.homelinux.net (lechon.iro.umontreal.ca [132.204.27.242]) by chene.dit.umontreal.ca (8.14.1/8.14.1) with ESMTP id sAO47oJ2005474; Sun, 23 Nov 2014 23:07:50 -0500 Received: by fmsmemgm.homelinux.net (Postfix, from userid 20848) id DF3EAAE0A5; Sun, 23 Nov 2014 23:07:49 -0500 (EST) From: Stefan Monnier 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> <87r3wytcaa.fsf@rosalinde.fritz.box> <83vbm96dxs.fsf@gnu.org> <87oas0n8sr.fsf@rosalinde.fritz.box> <8361e84yxb.fsf@gnu.org> <87fvdcmpeg.fsf@rosalinde.fritz.box> <87oaryop2k.fsf@rosalinde.fritz.box> Date: Sun, 23 Nov 2014 23:07:49 -0500 In-Reply-To: <87oaryop2k.fsf@rosalinde.fritz.box> (Stephen Berman's message of "Sat, 22 Nov 2014 23:20:03 +0100") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-NAI-Spam-Flag: NO X-NAI-Spam-Threshold: 5 X-NAI-Spam-Score: 0 X-NAI-Spam-Rules: 1 Rules triggered RV5134=0 X-NAI-Spam-Version: 2.3.0.9393 : core <5134> : inlines <1555> : streams <1347317> : uri <1835821> X-Spam-Score: -1.3 (-) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.3 (-) > But by default, when a file in outline-mode is saved, if it doesn't end Who cares. A file-buffer may never be saved. And the require-final-newline option may be set differently, so even if saved we can't assume that there's always a final newline. > Does "we" refer to the outline.el code? If so, the proposed patch does > just the opposite: it makes sure there's a final newline. Sounds like we're in violent agreement, then. Stefan From unknown Mon Aug 18 11:25:14 2025 X-Loop: help-debbugs@gnu.org Subject: bug#19102: 24.4; outline-move-subtree-up/down error at last and second-last subtree Resent-From: Stephen Berman Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 25 Nov 2014 22:00: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: To: Stefan Monnier Cc: paul@tilk.co, Eli Zaretskii , 19102@debbugs.gnu.org Received: via spool by 19102-submit@debbugs.gnu.org id=B19102.14169527447815 (code B ref 19102); Tue, 25 Nov 2014 22:00:02 +0000 Received: (at 19102) by debbugs.gnu.org; 25 Nov 2014 21:59:04 +0000 Received: from localhost ([127.0.0.1]:45306 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XtO8W-00021z-2q for submit@debbugs.gnu.org; Tue, 25 Nov 2014 16:59:04 -0500 Received: from mout.gmx.net ([212.227.15.19]:55518) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XtO8T-00021c-VF for 19102@debbugs.gnu.org; Tue, 25 Nov 2014 16:59:03 -0500 Received: from rosalinde.fritz.box ([89.245.100.6]) by mail.gmx.com (mrgmx001) with ESMTPSA (Nemesis) id 0Lu7a2-1Y1Oo72TIc-011P59; Tue, 25 Nov 2014 22:58:53 +0100 From: Stephen Berman 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> <87r3wytcaa.fsf@rosalinde.fritz.box> <83vbm96dxs.fsf@gnu.org> <87oas0n8sr.fsf@rosalinde.fritz.box> <8361e84yxb.fsf@gnu.org> <87fvdcmpeg.fsf@rosalinde.fritz.box> <87oaryop2k.fsf@rosalinde.fritz.box> Date: Tue, 25 Nov 2014 22:58:52 +0100 In-Reply-To: (Stefan Monnier's message of "Sun, 23 Nov 2014 23:07:49 -0500") Message-ID: <87mw7ft00z.fsf@rosalinde.fritz.box> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Provags-ID: V03:K0:J0t/EsPcUSYoC7hxhmLZXtn8Y0ED3QnR46d2b7tDTLsspfnoVgO 3lVkDvqe/XUyXanIO8Sok81EMBwD9pOeyfrHjcFWEpS/hPvOxVSQsXygoINK7wiKmVqbEJd dJ0kC0KEOxeVQetLTQ6p6MfVfUD0keX+PcUB4B9lsf9UU5ztTFPDWgzmyaiK662lpl9Ldhg 1T1GaWWGR+3zwvC+OUbmA== X-UI-Out-Filterresults: notjunk:1; X-Spam-Score: -0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.0 (/) On Sun, 23 Nov 2014 23:07:49 -0500 Stefan Monnier wrote: >> Does "we" refer to the outline.el code? If so, the proposed patch does >> just the opposite: it makes sure there's a final newline. > > Sounds like we're in violent agreement, then. Ok, so I take it you accept the patch, so again the question, does it qualify as a tiny change? If not, and if Paul Rankin is unable or doesn't want to sign a copyright assignment, what's the appropriate way to give him credit? Steve Berman From unknown Mon Aug 18 11:25:14 2025 X-Loop: help-debbugs@gnu.org Subject: bug#19102: 24.4; outline-move-subtree-up/down error at last and second-last subtree Resent-From: Paul Rankin Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 26 Nov 2014 02:36: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: To: Stephen Berman Cc: Eli Zaretskii , 19102@debbugs.gnu.org, Stefan Monnier Received: via spool by 19102-submit@debbugs.gnu.org id=B19102.14169693163600 (code B ref 19102); Wed, 26 Nov 2014 02:36:02 +0000 Received: (at 19102) by debbugs.gnu.org; 26 Nov 2014 02:35:16 +0000 Received: from localhost ([127.0.0.1]:45449 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XtSRn-0000w0-OD for submit@debbugs.gnu.org; Tue, 25 Nov 2014 21:35:16 -0500 Received: from out4-smtp.messagingengine.com ([66.111.4.28]:51932) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XtSRZ-0000vF-CH for 19102@debbugs.gnu.org; Tue, 25 Nov 2014 21:35:14 -0500 Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id 9BE70209B9; Tue, 25 Nov 2014 21:35:00 -0500 (EST) Received: from frontend2 ([10.202.2.161]) by compute1.internal (MEProxy); Tue, 25 Nov 2014 21:35:00 -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=6bUib08oJrBk gfD4Qjw3wjdb/L4=; b=Onv2MgZSOvuU5s3xXbyPC7SkkJNnV9Rmr9kJuCHZpM0d hmVNH255Wei8SSRO+8jnUIXyZjJ4F22DJjQ/ikDbZCFyd/K4uJkT6yLCnJAcd2FI /nhigDbCmBgKdRxOVv+ZMv+fmf2FUj9O+uGqSgwXDb4l0NbtkT3itBtC97YlGpI= 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=6bUib08oJrBkgfD4Qjw3wjdb/L4=; b=lpQdALp3IF9kphDwbsyU W2fKfOip8Yk4ITtZ54fo3yoAcaMQBqAcxzSr8/ceqcLpSPeHTDE3aHm4QYp4XTFB mQtuKokaa8kFRdhQmwU9fAWrygNIqAr19ZDvLEgAXjlz+cOyZkEkAte6HxD0mkHv 3QtOlP6tbe+/OVfF93qB5Lw= X-Sasl-enc: t/7+P2X5WI06miCqDHC/EQYPreQqtqbzZSejgQYBhPgV 1416969299 Received: from Paul-Rankins-MacBook-Pro.local (unknown [202.0.190.43]) by mail.messagingengine.com (Postfix) with ESMTPA id 85A1068013E; Tue, 25 Nov 2014 21:34:58 -0500 (EST) 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> <87r3wytcaa.fsf@rosalinde.fritz.box> <83vbm96dxs.fsf@gnu.org> <87oas0n8sr.fsf@rosalinde.fritz.box> <8361e84yxb.fsf@gnu.org> <87fvdcmpeg.fsf@rosalinde.fritz.box> <87oaryop2k.fsf@rosalinde.fritz.box> <87mw7ft00z.fsf@rosalinde.fritz.box> From: Paul Rankin In-reply-to: <87mw7ft00z.fsf@rosalinde.fritz.box> Date: Wed, 26 Nov 2014 12:34:52 +1000 Message-ID: MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) Stephen Berman writes: > On Sun, 23 Nov 2014 23:07:49 -0500 Stefan Monnier wrote: > >>> Does "we" refer to the outline.el code? If so, the proposed patch does >>> just the opposite: it makes sure there's a final newline. >> >> Sounds like we're in violent agreement, then. > > Ok, so I take it you accept the patch, so again the question, does it > qualify as a tiny change? If not, and if Paul Rankin is unable or > doesn't want to sign a copyright assignment, what's the appropriate way > to give him credit? I'm happy to do the copyright assignment biz if needed, I just think Stephen you did 99% of the work. Whatever is the right netiquette here, I go with that. -- Paul W. Rankin http://www.paulwrankin.com Before printing this email please take a moment to think about the environment. Just stop and think about it. Think about the last time you were walking alone in a forest, how you felt at peace, how a wave of clarity seemed to overcome you and you had to stop and reevaluate your life, what you're doing with the limited time you have here. "Damn," you thought, "life is so precious. I should really be doing ______." Are you doing that now? Why not? Go on, pick up your computer and throw it out the window! It'll be great, like that scene from Network where everyone starts yelling "I'M MAD AS HELL AND I'M NOT GOING TO TAKE THIS ANY MORE." That'll be you, but it will be real. Now's your moment. From unknown Mon Aug 18 11:25:14 2025 X-Loop: help-debbugs@gnu.org Subject: bug#19102: 24.4; outline-move-subtree-up/down error at last and second-last subtree Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 26 Nov 2014 02:44: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: To: Stephen Berman Cc: paul@tilk.co, Eli Zaretskii , 19102@debbugs.gnu.org Received: via spool by 19102-submit@debbugs.gnu.org id=B19102.14169697874367 (code B ref 19102); Wed, 26 Nov 2014 02:44:02 +0000 Received: (at 19102) by debbugs.gnu.org; 26 Nov 2014 02:43:07 +0000 Received: from localhost ([127.0.0.1]:45457 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XtSZO-00018N-Pp for submit@debbugs.gnu.org; Tue, 25 Nov 2014 21:43:07 -0500 Received: from pruche.dit.umontreal.ca ([132.204.246.22]:43860) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XtSZM-00018E-8h for 19102@debbugs.gnu.org; Tue, 25 Nov 2014 21:43:04 -0500 Received: from pastel.home (lechon.iro.umontreal.ca [132.204.27.242]) by pruche.dit.umontreal.ca (8.14.1/8.14.1) with ESMTP id sAQ2h2DR025301; Tue, 25 Nov 2014 21:43:03 -0500 Received: by pastel.home (Postfix, from userid 20848) id AE5CD653E; Tue, 25 Nov 2014 21:43:02 -0500 (EST) From: Stefan Monnier 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> Date: Tue, 25 Nov 2014 21:43:02 -0500 In-Reply-To: <8761easv3s.fsf@rosalinde.fritz.box> (Stephen Berman's message of "Wed, 19 Nov 2014 23:07:03 +0100") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-NAI-Spam-Flag: NO X-NAI-Spam-Threshold: 5 X-NAI-Spam-Score: 0 X-NAI-Spam-Rules: 1 Rules triggered RV5136=0 X-NAI-Spam-Version: 2.3.0.9393 : core <5136> : inlines <1561> : streams <1348711> : uri <1836156> X-Spam-Score: -1.3 (-) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.3 (-) > + (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: (if (and (eobp) (not (bolp))) (newline) (and (eolp) (not (bolp)) (forward-char 1))))) Also, I don't understand the (not (bolp)) test in the second line: the code it replaces only tested (= (char-after) ?\n). So I think it'd be better to use: (if (and (eobp) (not (bolp))) (newline) (if (eq (char-after) ?\n) (forward-char 1))))) And to be closer to the original code, I'd swap the two tests. And I'd use `insert' rather than `newline' since I don't want to run abbrev expansions and things like that. (if (eq (char-after) ?\n) (forward-char 1) (if (and (eobp) (not (bolp))) (insert "\n"))))) > + (empty-last-line (save-excursion > + (goto-char (point-max)) > + (and (bolp) (eolp)))) At point-max, we know that (eolp) is non-nil, so you can just write (empty-last-line (save-excursion (goto-char (point-max)) (bolp)))) > - (error "Cannot move past superior level"))) > + (with-demoted-errors "%s" > + (message "Cannot move past superior level")))) This is wrong. Did you mean maybe to replace `error' with `user-error' instead, maybe? > + ;; If we added a newline to move forward, delete it. > + (save-excursion > + (goto-char (point-max)) > + (when (and (bolp) (eolp) (not empty-last-line)) > + (delete-char -1))))) Let's not bother. There's no harm in adding a missing final newline when we modify such a line-oriented file. Stefan From unknown Mon Aug 18 11:25:14 2025 X-Loop: help-debbugs@gnu.org Subject: bug#19102: 24.4; outline-move-subtree-up/down error at last and second-last subtree Resent-From: Stephen Berman Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 26 Nov 2014 13:39: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: To: Stefan Monnier Cc: paul@tilk.co, Eli Zaretskii , 19102@debbugs.gnu.org Received: via spool by 19102-submit@debbugs.gnu.org id=B19102.141700908919001 (code B ref 19102); Wed, 26 Nov 2014 13:39:02 +0000 Received: (at 19102) by debbugs.gnu.org; 26 Nov 2014 13:38:09 +0000 Received: from localhost ([127.0.0.1]:45692 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XtcnI-0004wL-2l for submit@debbugs.gnu.org; Wed, 26 Nov 2014 08:38:08 -0500 Received: from mout.gmx.net ([212.227.17.22]:63950) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XtcnE-0004wC-Km for 19102@debbugs.gnu.org; Wed, 26 Nov 2014 08:38:05 -0500 Received: from rosalinde.fritz.box ([89.245.127.251]) by mail.gmx.com (mrgmx102) with ESMTPSA (Nemesis) id 0Lyj4F-1Xx0DF1eQJ-0167EJ; Wed, 26 Nov 2014 14:38:02 +0100 From: Stephen Berman 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> Date: Wed, 26 Nov 2014 14:38:01 +0100 In-Reply-To: (Stefan Monnier's message of "Tue, 25 Nov 2014 21:43:02 -0500") Message-ID: <8761e26q12.fsf@rosalinde.fritz.box> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Provags-ID: V03:K0:hb780ZyYmUpJfydCOZfkMjmTPuf8Kr5Xi1/DmaoftY9hOVgKIRp PBdZxSHRySch3e7g7PWw8RlHZ2C5r2gxbdgSi1XwCiXtn4QJ1+JcbWOOFp9MKBwLclZAX00 4Dced2wE0fS6yjhfZrm5eBdCItVy9/LZieQpGk7ixbeepX7f5SnXwQga0jBPiyFvkyIPeen ZfzNHx+a5pHXREkxnmjmg== X-UI-Out-Filterresults: notjunk:1; X-Spam-Score: -0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.0 (/) --=-=-= Content-Type: text/plain 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: --=-=-= Content-Type: text/x-emacs-lisp Content-Disposition: inline Content-Description: outline-move-subtree-down (1) (defun outline-move-subtree-down (&optional arg) "Move the current subtree down past ARG headlines of the same level." (interactive "p") (let ((movfunc (if (> arg 0) 'outline-get-next-sibling 'outline-get-last-sibling)) (ins-point (make-marker)) (cnt (abs arg)) ;; Make sure we can move forward to find the end of the ;; subtree and the insertion point. (maybe-forward-char (lambda () (if (eq (char-after) ?\n) (forward-char 1) (if (and (eobp) (not (bolp))) (insert "\n"))))) beg end folded) ;; Select the tree. (outline-back-to-heading) (setq beg (point)) (save-match-data (save-excursion (outline-end-of-heading) (setq folded (outline-invisible-p))) (outline-end-of-subtree)) (funcall maybe-forward-char) (setq end (point)) ;; Find insertion point, with error handling. (goto-char beg) (while (> cnt 0) (or (funcall movfunc) (unless (or (bobp) (eobp)) (goto-char beg) (user-error "Cannot move past superior level"))) (setq cnt (1- cnt))) (if (> arg 0) ;; Moving forward - still need to move over subtree. (progn (outline-end-of-subtree) (funcall maybe-forward-char))) (move-marker ins-point (point)) (insert (delete-and-extract-region beg end)) (goto-char ins-point) (if folded (hide-subtree)) (move-marker ins-point nil))) --=-=-= Content-Type: text/plain And here's Paul's version (tweaked to make it closer to the outline.el style): --=-=-= Content-Type: text/x-emacs-lisp Content-Disposition: inline Content-Description: outline-move-subtree-down (2) (defun outline-move-subtree-down (&optional arg) "Move the current subtree down past ARG headlines of the same level." (interactive "p") (outline-back-to-heading) (let* ((movfunc (if (> arg 0) 'outline-get-next-sibling 'outline-get-last-sibling)) ;; Find the end of the subtree to be moved as well as the point to ;; move it to, adding a newline if necessary, to ensure these points ;; are at bol on the line below the subtree. (end-point-func (lambda () (outline-end-of-subtree) (if (and (eobp) (eolp) (not (bolp))) (insert-char ?\n)) (unless (eobp) (forward-char 1)) (point))) (beg (point)) (folded (save-match-data (outline-end-of-heading) (outline-invisible-p))) (end (save-match-data (funcall end-point-func))) (ins-point (make-marker)) (cnt (abs arg))) ;; Find insertion point, with error handling. (goto-char beg) (while (> cnt 0) (or (funcall movfunc) (unless (or (bobp) (eobp)) (goto-char beg) (user-error "Cannot move past superior level"))) (setq cnt (1- cnt))) (if (> arg 0) ;; Moving forward - still need to move over subtree. (funcall end-point-func)) (move-marker ins-point (point)) (insert (delete-and-extract-region beg end)) (goto-char ins-point) (if folded (hide-subtree)) (move-marker ins-point nil))) --=-=-= Content-Type: text/plain Which should we use? Steve Berman --=-=-=-- From unknown Mon Aug 18 11:25:14 2025 X-Loop: help-debbugs@gnu.org Subject: bug#19102: 24.4; outline-move-subtree-up/down error at last and second-last subtree Resent-From: Stephen Berman Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 26 Nov 2014 13:39: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: To: Paul Rankin Cc: Eli Zaretskii , 19102@debbugs.gnu.org, Stefan Monnier Received: via spool by 19102-submit@debbugs.gnu.org id=B19102.141700912819055 (code B ref 19102); Wed, 26 Nov 2014 13:39:03 +0000 Received: (at 19102) by debbugs.gnu.org; 26 Nov 2014 13:38:48 +0000 Received: from localhost ([127.0.0.1]:45695 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Xtcnw-0004xG-9s for submit@debbugs.gnu.org; Wed, 26 Nov 2014 08:38:48 -0500 Received: from mout.gmx.net ([212.227.17.21]:61144) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Xtcnu-0004x6-2p for 19102@debbugs.gnu.org; Wed, 26 Nov 2014 08:38:46 -0500 Received: from rosalinde.fritz.box ([89.245.127.251]) by mail.gmx.com (mrgmx102) with ESMTPSA (Nemesis) id 0MGFz9-1XfbuS1ptX-00FFb4; Wed, 26 Nov 2014 14:38:39 +0100 From: Stephen Berman 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> <87r3wytcaa.fsf@rosalinde.fritz.box> <83vbm96dxs.fsf@gnu.org> <87oas0n8sr.fsf@rosalinde.fritz.box> <8361e84yxb.fsf@gnu.org> <87fvdcmpeg.fsf@rosalinde.fritz.box> <87oaryop2k.fsf@rosalinde.fritz.box> <87mw7ft00z.fsf@rosalinde.fritz.box> Date: Wed, 26 Nov 2014 14:38:38 +0100 In-Reply-To: (Paul Rankin's message of "Wed, 26 Nov 2014 12:34:52 +1000") Message-ID: <874mtm6q01.fsf@rosalinde.fritz.box> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Provags-ID: V03:K0:q70cOfT5VryxHEL4clGfp629B7kBejVQnirDh2RWugZomDXqUQV dh8LYW22x2qXq/oEl0yEwva6MqFxNWASZyPvlAwJq6q8s/Geh2Phgz8QiqERSt9qqLjg2KG vYxq94ssNgJwF//4AlN4KLrPgMB4WmwAfXrp8GgrQ3IZ/CLDS5bDKGV6k5GqOgfdxFR+5Nk 5eWJBaAdhlJ3FYj1VinhQ== X-UI-Out-Filterresults: notjunk:1; X-Spam-Score: -0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.0 (/) On Wed, 26 Nov 2014 12:34:52 +1000 Paul Rankin wrote: > Stephen Berman writes: > >> On Sun, 23 Nov 2014 23:07:49 -0500 Stefan Monnier wrote: >> >>>> Does "we" refer to the outline.el code? If so, the proposed patch does >>>> just the opposite: it makes sure there's a final newline. >>> >>> Sounds like we're in violent agreement, then. >> >> Ok, so I take it you accept the patch, so again the question, does it >> qualify as a tiny change? If not, and if Paul Rankin is unable or >> doesn't want to sign a copyright assignment, what's the appropriate way >> to give him credit? > > I'm happy to do the copyright assignment biz if needed, I just think You could ask Stefan for the form to fill out to initiate the copyright assignment process just in case, or for any future contribution to Emacs you might want to make. > Stephen you did 99% of the work. Whatever is the right netiquette here, > I go with that. Let's see what Stefan says. Anyway, the important thing is to get the bug fixed! Steve Berman From unknown Mon Aug 18 11:25:14 2025 X-Loop: help-debbugs@gnu.org Subject: bug#19102: 24.4; outline-move-subtree-up/down error at last and second-last subtree Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 26 Nov 2014 15:55: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: To: Stephen Berman Cc: paul@tilk.co, Eli Zaretskii , 19102@debbugs.gnu.org Received: via spool by 19102-submit@debbugs.gnu.org id=B19102.14170172635003 (code B ref 19102); Wed, 26 Nov 2014 15:55:02 +0000 Received: (at 19102) by debbugs.gnu.org; 26 Nov 2014 15:54:23 +0000 Received: from localhost ([127.0.0.1]:46357 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Xtev8-0001Id-Qu for submit@debbugs.gnu.org; Wed, 26 Nov 2014 10:54:23 -0500 Received: from chene.dit.umontreal.ca ([132.204.246.20]:48653) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Xtev7-0001IW-ET for 19102@debbugs.gnu.org; Wed, 26 Nov 2014 10:54:21 -0500 Received: from pastel.home (lechon.iro.umontreal.ca [132.204.27.242]) by chene.dit.umontreal.ca (8.14.1/8.14.1) with ESMTP id sAQFsJ66000937; Wed, 26 Nov 2014 10:54:19 -0500 Received: by pastel.home (Postfix, from userid 20848) id 20C6A4820; Wed, 26 Nov 2014 10:54:19 -0500 (EST) From: Stefan Monnier 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> <8761e26q12.fsf@rosalinde.fritz.box> Date: Wed, 26 Nov 2014 10:54:19 -0500 In-Reply-To: <8761e26q12.fsf@rosalinde.fritz.box> (Stephen Berman's message of "Wed, 26 Nov 2014 14:38:01 +0100") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-NAI-Spam-Flag: NO X-NAI-Spam-Threshold: 5 X-NAI-Spam-Score: 0 X-NAI-Spam-Rules: 1 Rules triggered RV5137=0 X-NAI-Spam-Version: 2.3.0.9393 : core <5137> : inlines <1562> : streams <1349015> : uri <1836228> X-Spam-Score: -1.3 (-) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.3 (-) > 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. Please just send the diff that (you think) should be applied. Or two diffs to apply in sequence if you want to distinguish your changes from Paul's. > 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). I don't see why we should avoid the error in those cases: AFAICT, we can't do what the user asked, so we should signal an error. Stefan From unknown Mon Aug 18 11:25:14 2025 X-Loop: help-debbugs@gnu.org Subject: bug#19102: 24.4; outline-move-subtree-up/down error at last and second-last subtree Resent-From: Stephen Berman Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 26 Nov 2014 19:05: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: To: Stefan Monnier Cc: paul@tilk.co, Eli Zaretskii , 19102@debbugs.gnu.org Received: via spool by 19102-submit@debbugs.gnu.org id=B19102.141702867324165 (code B ref 19102); Wed, 26 Nov 2014 19:05:02 +0000 Received: (at 19102) by debbugs.gnu.org; 26 Nov 2014 19:04:33 +0000 Received: from localhost ([127.0.0.1]:46560 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XthtA-0006Hh-EQ for submit@debbugs.gnu.org; Wed, 26 Nov 2014 14:04:32 -0500 Received: from mout.gmx.net ([212.227.15.19]:52981) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Xtht7-0006HX-AZ for 19102@debbugs.gnu.org; Wed, 26 Nov 2014 14:04:30 -0500 Received: from rosalinde.fritz.box ([89.245.127.251]) by mail.gmx.com (mrgmx002) with ESMTPSA (Nemesis) id 0MNq4h-1XrGEt07Kd-007TL7; Wed, 26 Nov 2014 20:04:24 +0100 From: Stephen Berman 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> <8761e26q12.fsf@rosalinde.fritz.box> Date: Wed, 26 Nov 2014 20:04:23 +0100 In-Reply-To: (Stefan Monnier's message of "Wed, 26 Nov 2014 10:54:19 -0500") Message-ID: <87y4qx6ax4.fsf@rosalinde.fritz.box> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Provags-ID: V03:K0:3rJb+/CXQw0ldOsgVlxOXDHBOz70sJyKFl/SfO/Sl/NzRlon7pE HLyOW7FZYCyYTuYQYVc6teu9FEdWQV/vyXhWiINEDICnkyFxEKQQu7OYsYFPqRAa3aKodBT uxiI2RoztJZBkX8ZOwi5T5asd9mZLyn2+VKV+lC/BQoGAy1hrZss7FF4fyZ7Lf/ktNjqkir SW38KNuFwJUyhHgDC9D3A== X-UI-Out-Filterresults: notjunk:1; X-Spam-Score: -0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.0 (/) --=-=-= Content-Type: text/plain On Wed, 26 Nov 2014 10:54:19 -0500 Stefan Monnier wrote: >> 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. > > Please just send the diff that (you think) should be applied. > Or two diffs to apply in sequence if you want to distinguish your > changes from Paul's. Ok, I've done the latter, appended below. The first change just fixes the bug, incorporating your simplification of my patch for when to move forward and when to add a newline. The second change is Paul's refactoring of the code to avoid setq's of let-bound variables, which I think make the code cleaner and more elegant (the version he posted also fixed the bug, but I prefer your simplification). >> 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). > > I don't see why we should avoid the error in those cases: AFAICT, we > can't do what the user asked, so we should signal an error. Ok, I removed that part. Steve Berman --=-=-= Content-Type: text/x-patch Content-Disposition: inline Content-Description: Fix for bug#19102 diff --git a/lisp/outline.el b/lisp/outline.el index c7cad31..61ee7ff 100644 --- a/lisp/outline.el +++ b/lisp/outline.el @@ -649,27 +649,32 @@ the match data is set appropriately." 'outline-get-last-sibling)) (ins-point (make-marker)) (cnt (abs arg)) + ;; Make sure we can move forward to find the end of the + ;; subtree and the insertion point. + (maybe-forward-char (lambda () + (if (eq (char-after) ?\n) (forward-char 1) + (if (and (eobp) (not (bolp))) (insert "\n"))))) beg end folded) - ;; Select the tree + ;; Select the tree. (outline-back-to-heading) (setq beg (point)) (save-match-data (save-excursion (outline-end-of-heading) (setq folded (outline-invisible-p))) (outline-end-of-subtree)) - (if (= (char-after) ?\n) (forward-char 1)) + (funcall maybe-forward-char) (setq end (point)) - ;; Find insertion point, with error handling + ;; Find insertion point, with error handling. (goto-char beg) (while (> cnt 0) (or (funcall movfunc) (progn (goto-char beg) - (error "Cannot move past superior level"))) + (user-error "Cannot move past superior level"))) (setq cnt (1- cnt))) (if (> arg 0) - ;; Moving forward - still need to move over subtree + ;; Moving forward - still need to move over subtree. (progn (outline-end-of-subtree) - (if (= (char-after) ?\n) (forward-char 1)))) + (funcall maybe-forward-char))) (move-marker ins-point (point)) (insert (delete-and-extract-region beg end)) (goto-char ins-point) --=-=-= Content-Type: text/x-patch Content-Disposition: inline Content-Description: Refactoring patch diff --git a/lisp/outline.el b/lisp/outline.el index 61ee7ff..bb56341 100644 --- a/lisp/outline.el +++ b/lisp/outline.el @@ -645,25 +645,25 @@ the match data is set appropriately." (defun outline-move-subtree-down (&optional arg) "Move the current subtree down past ARG headlines of the same level." (interactive "p") - (let ((movfunc (if (> arg 0) 'outline-get-next-sibling - 'outline-get-last-sibling)) - (ins-point (make-marker)) - (cnt (abs arg)) - ;; Make sure we can move forward to find the end of the - ;; subtree and the insertion point. - (maybe-forward-char (lambda () - (if (eq (char-after) ?\n) (forward-char 1) - (if (and (eobp) (not (bolp))) (insert "\n"))))) - beg end folded) - ;; Select the tree. - (outline-back-to-heading) - (setq beg (point)) - (save-match-data - (save-excursion (outline-end-of-heading) - (setq folded (outline-invisible-p))) - (outline-end-of-subtree)) - (funcall maybe-forward-char) - (setq end (point)) + (outline-back-to-heading) + (let* ((movfunc (if (> arg 0) 'outline-get-next-sibling + 'outline-get-last-sibling)) + ;; Find the end of the subtree to be moved as well as the point to + ;; move it to, adding a newline if necessary, to ensure these points + ;; are at bol on the line below the subtree. + (end-point-func (lambda () + (outline-end-of-subtree) + (if (eq (char-after) ?\n) (forward-char 1) + (if (and (eobp) (not (bolp))) (insert "\n"))) + (point))) + (beg (point)) + (folded (save-match-data + (outline-end-of-heading) + (outline-invisible-p))) + (end (save-match-data + (funcall end-point-func))) + (ins-point (make-marker)) + (cnt (abs arg))) ;; Find insertion point, with error handling. (goto-char beg) (while (> cnt 0) @@ -673,8 +673,7 @@ the match data is set appropriately." (setq cnt (1- cnt))) (if (> arg 0) ;; Moving forward - still need to move over subtree. - (progn (outline-end-of-subtree) - (funcall maybe-forward-char))) + (funcall end-point-func)) (move-marker ins-point (point)) (insert (delete-and-extract-region beg end)) (goto-char ins-point) --=-=-=-- From unknown Mon Aug 18 11:25:14 2025 X-Loop: help-debbugs@gnu.org Subject: bug#19102: 24.4; outline-move-subtree-up/down error at last and second-last subtree Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 26 Nov 2014 22:12: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: To: Stephen Berman Cc: paul@tilk.co, Eli Zaretskii , 19102@debbugs.gnu.org Received: via spool by 19102-submit@debbugs.gnu.org id=B19102.141703991325849 (code B ref 19102); Wed, 26 Nov 2014 22:12:01 +0000 Received: (at 19102) by debbugs.gnu.org; 26 Nov 2014 22:11:53 +0000 Received: from localhost ([127.0.0.1]:46677 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XtkoT-0006ir-2R for submit@debbugs.gnu.org; Wed, 26 Nov 2014 17:11:53 -0500 Received: from chene.dit.umontreal.ca ([132.204.246.20]:49436) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XtkoQ-0006ij-Qw for 19102@debbugs.gnu.org; Wed, 26 Nov 2014 17:11:51 -0500 Received: from pastel.home (lechon.iro.umontreal.ca [132.204.27.242]) by chene.dit.umontreal.ca (8.14.1/8.14.1) with ESMTP id sAQMBnC1027007; Wed, 26 Nov 2014 17:11:49 -0500 Received: by pastel.home (Postfix, from userid 20848) id 158D04820; Wed, 26 Nov 2014 17:11:49 -0500 (EST) From: Stefan Monnier 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> <8761e26q12.fsf@rosalinde.fritz.box> <87y4qx6ax4.fsf@rosalinde.fritz.box> Date: Wed, 26 Nov 2014 17:11:49 -0500 In-Reply-To: <87y4qx6ax4.fsf@rosalinde.fritz.box> (Stephen Berman's message of "Wed, 26 Nov 2014 20:04:23 +0100") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-NAI-Spam-Flag: NO X-NAI-Spam-Level: X-NAI-Spam-Threshold: 5 X-NAI-Spam-Score: 0.2 X-NAI-Spam-Rules: 2 Rules triggered GEN_SPAM_FEATRE=0.2, RV5137=0 X-NAI-Spam-Version: 2.3.0.9393 : core <5137> : inlines <1565> : streams <1349160> : uri <1836262> X-Spam-Score: -1.3 (-) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.3 (-) > Ok, I've done the latter, appended below. Both look fine, and the second is small enough to count as "tiny change" (but we won't be able to accept much more from him before he signs the copyright paperwork). Please install, thank you, Stefan From unknown Mon Aug 18 11:25:14 2025 X-Loop: help-debbugs@gnu.org Subject: bug#19102: 24.4; outline-move-subtree-up/down error at last and second-last subtree Resent-From: Stephen Berman Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 26 Nov 2014 22:26: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: To: Stefan Monnier Cc: paul@tilk.co, Eli Zaretskii , 19102@debbugs.gnu.org Received: via spool by 19102-submit@debbugs.gnu.org id=B19102.141704073527252 (code B ref 19102); Wed, 26 Nov 2014 22:26:01 +0000 Received: (at 19102) by debbugs.gnu.org; 26 Nov 2014 22:25:35 +0000 Received: from localhost ([127.0.0.1]:46692 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Xtl1i-00075U-Ua for submit@debbugs.gnu.org; Wed, 26 Nov 2014 17:25:35 -0500 Received: from mout.gmx.net ([212.227.15.19]:58413) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Xtl1g-00075L-4x for 19102@debbugs.gnu.org; Wed, 26 Nov 2014 17:25:33 -0500 Received: from rosalinde.fritz.box ([89.245.127.251]) by mail.gmx.com (mrgmx001) with ESMTPSA (Nemesis) id 0Lrviw-1Y3Dm31sXW-013bov; Wed, 26 Nov 2014 23:25:21 +0100 From: Stephen Berman 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> <8761e26q12.fsf@rosalinde.fritz.box> <87y4qx6ax4.fsf@rosalinde.fritz.box> Date: Wed, 26 Nov 2014 23:25:20 +0100 In-Reply-To: (Stefan Monnier's message of "Wed, 26 Nov 2014 17:11:49 -0500") Message-ID: <87lhmx61m7.fsf@rosalinde.fritz.box> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Provags-ID: V03:K0:P5twpAtiGXWymBBDf3qCUDUz7IFbh4QDLrTe7z3ijef30ofG3nq IiH7JpKbvx8sFZVdVDYWN9ggwvfacwNRcWsn5gbZkjzIjPiVDxLHVtAPyBcC7LhdosfR40x j8VbSnWUPbmWz514CFwQGmAq1yruOrfLGBaFnTy0Rn3TUlA0fUL/afxs0zkm9GOhTdxtqie kI/nCPjxID0ku198WYrSQ== X-UI-Out-Filterresults: notjunk:1; X-Spam-Score: -0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.0 (/) On Wed, 26 Nov 2014 17:11:49 -0500 Stefan Monnier wrote: >> Ok, I've done the latter, appended below. > > Both look fine, and the second is small enough to count as "tiny change" > (but we won't be able to accept much more from him before he signs the > copyright paperwork). Please install, thank you, Ok, but first, just two more questions: I assume the bugfix part should go into emacs-24, but should the refactoring part go only into master? Or should I combine them again into one commit (in emacs-24)? Steve Berman From unknown Mon Aug 18 11:25:14 2025 X-Loop: help-debbugs@gnu.org Subject: bug#19102: 24.4; outline-move-subtree-up/down error at last and second-last subtree Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 27 Nov 2014 02:19: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: To: Stephen Berman Cc: paul@tilk.co, Eli Zaretskii , 19102@debbugs.gnu.org Received: via spool by 19102-submit@debbugs.gnu.org id=B19102.141705470218144 (code B ref 19102); Thu, 27 Nov 2014 02:19:02 +0000 Received: (at 19102) by debbugs.gnu.org; 27 Nov 2014 02:18:22 +0000 Received: from localhost ([127.0.0.1]:46759 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Xtof0-0004iZ-Im for submit@debbugs.gnu.org; Wed, 26 Nov 2014 21:18:22 -0500 Received: from pruche.dit.umontreal.ca ([132.204.246.22]:43665) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Xtoex-0004iR-Tt for 19102@debbugs.gnu.org; Wed, 26 Nov 2014 21:18:20 -0500 Received: from pastel.home (lechon.iro.umontreal.ca [132.204.27.242]) by pruche.dit.umontreal.ca (8.14.1/8.14.1) with ESMTP id sAR2IHQx005758; Wed, 26 Nov 2014 21:18:17 -0500 Received: by pastel.home (Postfix, from userid 20848) id 4AD954820; Wed, 26 Nov 2014 21:18:17 -0500 (EST) From: Stefan Monnier 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> <8761e26q12.fsf@rosalinde.fritz.box> <87y4qx6ax4.fsf@rosalinde.fritz.box> <87lhmx61m7.fsf@rosalinde.fritz.box> Date: Wed, 26 Nov 2014 21:18:17 -0500 In-Reply-To: <87lhmx61m7.fsf@rosalinde.fritz.box> (Stephen Berman's message of "Wed, 26 Nov 2014 23:25:20 +0100") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-NAI-Spam-Flag: NO X-NAI-Spam-Threshold: 5 X-NAI-Spam-Score: 0 X-NAI-Spam-Rules: 1 Rules triggered RV5137=0 X-NAI-Spam-Version: 2.3.0.9393 : core <5137> : inlines <1565> : streams <1349254> : uri <1836284> X-Spam-Score: -1.3 (-) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.3 (-) > Ok, but first, just two more questions: I assume the bugfix part should > go into emacs-24, Yes. > but should the refactoring part go only into master? > Or should I combine them again into one commit (in emacs-24)? Either way is OK. Stefan From unknown Mon Aug 18 11:25:14 2025 MIME-Version: 1.0 X-Mailer: MIME-tools 5.503 (Entity 5.503) X-Loop: help-debbugs@gnu.org From: help-debbugs@gnu.org (GNU bug Tracking System) To: Paul Rankin Subject: bug#19102: closed (Re: bug#19102: 24.4; outline-move-subtree-up/down error at last and second-last subtree) Message-ID: References: <87zjbdlzon.fsf@rosalinde.fritz.box> X-Gnu-PR-Message: they-closed 19102 X-Gnu-PR-Package: emacs Reply-To: 19102@debbugs.gnu.org Date: Thu, 27 Nov 2014 10:13:03 +0000 Content-Type: multipart/mixed; boundary="----------=_1417083183-537-1" This is a multi-part message in MIME format... ------------=_1417083183-537-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Your bug report #19102: 24.4; outline-move-subtree-up/down error at last and second-last su= btree which was filed against the emacs package, has been closed. The explanation is attached below, along with your original report. If you require more details, please reply to 19102@debbugs.gnu.org. --=20 19102: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D19102 GNU Bug Tracking System Contact help-debbugs@gnu.org with problems ------------=_1417083183-537-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at 19102-done) by debbugs.gnu.org; 27 Nov 2014 10:12:48 +0000 Received: from localhost ([127.0.0.1]:46999 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Xtw48-000084-BL for submit@debbugs.gnu.org; Thu, 27 Nov 2014 05:12:48 -0500 Received: from mout.gmx.net ([212.227.15.18]:55859) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Xtw46-00007q-Iw for 19102-done@debbugs.gnu.org; Thu, 27 Nov 2014 05:12:47 -0500 Received: from rosalinde.fritz.box ([89.245.88.159]) by mail.gmx.com (mrgmx001) with ESMTPSA (Nemesis) id 0MLeoF-1Xtf581igl-000wji; Thu, 27 Nov 2014 11:12:41 +0100 From: Stephen Berman To: Stefan Monnier Subject: Re: bug#19102: 24.4; outline-move-subtree-up/down error at last and second-last subtree 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> <8761e26q12.fsf@rosalinde.fritz.box> <87y4qx6ax4.fsf@rosalinde.fritz.box> <87lhmx61m7.fsf@rosalinde.fritz.box> Date: Thu, 27 Nov 2014 11:12:40 +0100 In-Reply-To: (Stefan Monnier's message of "Wed, 26 Nov 2014 21:18:17 -0500") Message-ID: <87zjbdlzon.fsf@rosalinde.fritz.box> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Provags-ID: V03:K0:MPBC+1AHq74iLBmpPSmLJNoz+xjKoTd7PlbFzBqwRzJBJlxjg86 cDirtuWMptOG4MGYogdEDq+EiahAZUIOQhf3SZayXV1cbdbj4E0S2IuWEa9tZGfu4Y2Zoro 1luN7/rXG7hGVAdP6RE3z9eHP3RCwrfX8/F36jWhRrlRCS0q18x0OVMx7txN6lJXHIWSRe7 3+VNd+O2/Hv98noHk5OOA== X-UI-Out-Filterresults: notjunk:1; X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 19102-done Cc: paul@tilk.co, Eli Zaretskii , 19102-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.0 (/) On Wed, 26 Nov 2014 21:18:17 -0500 Stefan Monnier wrote: >> Ok, but first, just two more questions: I assume the bugfix part should >> go into emacs-24, > > Yes. > >> but should the refactoring part go only into master? >> Or should I combine them again into one commit (in emacs-24)? > > Either way is OK. I pushed the fix to emacs-24 and am closing this bug. I think it's cleaner for the refactoring part to go only into master; I'll do that when the fix is merged. Steve Berman ------------=_1417083183-537-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at submit) by debbugs.gnu.org; 19 Nov 2014 08:33:03 +0000 Received: from localhost ([127.0.0.1]:37805 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Xr0hC-0003DF-SY for submit@debbugs.gnu.org; Wed, 19 Nov 2014 03:33:03 -0500 Received: from eggs.gnu.org ([208.118.235.92]:57124) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Xr0eA-00036f-Eq for submit@debbugs.gnu.org; Wed, 19 Nov 2014 03:29:55 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Xr0e4-0002A0-4I for submit@debbugs.gnu.org; Wed, 19 Nov 2014 03:29:54 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,T_DKIM_INVALID autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:54704) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xr0e4-00029w-16 for submit@debbugs.gnu.org; Wed, 19 Nov 2014 03:29:48 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58832) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xr0dy-0005sL-DY for bug-gnu-emacs@gnu.org; Wed, 19 Nov 2014 03:29:47 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Xr0ds-00028h-TV for bug-gnu-emacs@gnu.org; Wed, 19 Nov 2014 03:29:42 -0500 Received: from out4-smtp.messagingengine.com ([66.111.4.28]:54029) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xr0ds-00028T-LV for bug-gnu-emacs@gnu.org; Wed, 19 Nov 2014 03:29:36 -0500 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id A551B20C59; Wed, 19 Nov 2014 03:29:34 -0500 (EST) Received: from frontend2 ([10.202.2.161]) by compute4.internal (MEProxy); Wed, 19 Nov 2014 03:29:34 -0500 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=tilk.co; h= x-sasl-enc:from:to:subject:date:message-id:mime-version :content-type; s=mesmtp; bh=wb8kuqRKZm1IuEr0UCMUbBHEWDQ=; b=A2d4 buO5nH4Qw0p9VP47CQ7iN+ZVssNOnIDWMbC8P+VEyzEV4pPszshE+b5CGaYIsqf0 bjQ3E9mv2OvJff5bCBN2VzRaUJrC28rjaHLeqNSClf1It6Weqwuxckm0rFMnS468 U2QmuhQ/VQCRobHLvkHfiM6e8jcvQO5iU+qwc5E= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=x-sasl-enc:from:to:subject:date :message-id:mime-version:content-type; s=smtpout; bh=wb8kuqRKZm1 IuEr0UCMUbBHEWDQ=; b=HNNWIbijcjo3lZqpUFEg5cqYKhdD9d7L+2brBQwQPSH OfScB7uA4PVyiu6goxn7aYZGSyeBhX5OBjQqABNb9nEYl067TYF271QUH9uxu+u+ OEL/9+3RS6287s7XI8hbCn7ranHs3uAeKjxmVocY+J9mgNOLKFeRxOrGbYTXtvoY = X-Sasl-enc: xkqIfOABcMM78mhPMvjmRANTM6lBfWji15Qszp91qkJO 1416385773 Received: from Paul-Rankins-MacBook-Pro.local (unknown [202.0.190.43]) by mail.messagingengine.com (Postfix) with ESMTPA id 38AC16800F8 for ; Wed, 19 Nov 2014 03:29:32 -0500 (EST) From: Paul Rankin To: bug-gnu-emacs@gnu.org Subject: 24.4; outline-move-subtree-up/down error at last and second-last subtree Date: Wed, 19 Nov 2014 18:29:01 +1000 Message-ID: MIME-Version: 1.0 Content-Type: text/plain X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: submit X-Mailman-Approved-At: Wed, 19 Nov 2014 03:33:01 -0500 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) 1. emacs -Q 2. M-x switch-to-buffer RET test 3. M-x outline-mode 4. insert: * one * two * three 5. position point at "* three" 6. M-x outline-move-subtree-up => Wrong type argument: number-or-marker-p, nil 7. position point at "* two" 8. M-x outline-move-subtree-down => Wrong type argument: number-or-marker-p, nil Expected behaviour: - at 6. subtree "* three" should move above "* two" - or at 8. subtree "* two" should move below "* three" In GNU Emacs 24.4.1 (x86_64-apple-darwin14.0.0, NS apple-appkit-1343.14) of 2014-10-21 on Paul-Rankins-MacBook-Pro.local Windowing system distributor `Apple', version 10.3.1343 Configured using: `configure --prefix=/usr/local/Cellar/emacs/24.4 --enable-locallisppath=/usr/local/share/emacs/site-lisp --infodir=/usr/local/Cellar/emacs/24.4/share/info/emacs --without-dbus --with-gnutls --with-ns --disable-ns-self-contained' Important settings: value of $LANG: en_AU.UTF-8 locale-coding-system: utf-8-unix Major mode: Outline Minor modes in effect: tooltip-mode: t electric-indent-mode: t mouse-wheel-mode: t tool-bar-mode: t menu-bar-mode: t file-name-shadow-mode: t global-font-lock-mode: t font-lock-mode: t blink-cursor-mode: t auto-composition-mode: t auto-encryption-mode: t auto-compression-mode: t line-number-mode: t transient-mark-mode: t Recent input: M-x s w i t b u t e s t M-x o u t l i n e SPC m o d s-v M-x o u t l i n e SPC m o v e u p M-x o u t l i n e SPC m o v e d o M-x r e p o r t Recent messages: For information about GNU Emacs and the GNU system, type C-h C-a. You can run the command `switch-to-buffer' with C-x b Mark set outline-move-subtree-up: Wrong type argument: number-or-marker-p, nil call-interactively: Wrong type argument: number-or-marker-p, nil Load-path shadows: None found. Features: (shadow sort gnus-util mail-extr emacsbug message format-spec rfc822 mml easymenu mml-sec mm-decode mm-bodies mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader sendmail rfc2047 rfc2045 ietf-drums mm-util help-fns mail-prsvr mail-utils noutline outline easy-mmode time-date tooltip electric uniquify ediff-hook vc-hooks lisp-float-type mwheel ns-win tool-bar dnd fontset image regexp-opt fringe tabulated-list newcomment lisp-mode prog-mode register page menu-bar rfn-eshadow timer select scroll-bar mouse jit-lock font-lock syntax facemenu font-core frame cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean japanese hebrew greek romanian slovak czech european ethiopic indian cyrillic chinese case-table epa-hook jka-cmpr-hook help simple abbrev minibuffer nadvice loaddefs button faces cus-face macroexp files text-properties overlay sha1 md5 base64 format env code-pages mule custom widget hashtable-print-readable backquote make-network-process cocoa ns multi-tty emacs) Memory information: ((conses 16 73311 8272) (symbols 48 17397 0) (miscs 40 41 170) (strings 32 10116 4888) (string-bytes 1 269187) (vectors 16 9102) (vector-slots 8 374266 16740) (floats 8 54 226) (intervals 56 204 0) (buffers 960 13)) -- Paul W. Rankin http://www.paulwrankin.com Before printing this email please take a moment to think about the environment. Just stop and think about it. Think about the last time you were walking alone in a forest, how you felt at peace, how a wave of clarity seemed to overcome you and you had to stop and reevaluate your life, what you're doing with the limited time you have here. "Damn," you thought, "life is so precious. I should really be doing ______." Are you doing that now? Why not? Go on, pick up your computer and throw it out the window! It'll be great, like that scene from Network where everyone starts yelling "I'M MAD AS HELL AND I'M NOT GOING TO TAKE THIS ANY MORE." That'll be you, but it will be real. Now's your moment. -- Paul W. Rankin http://www.paulwrankin.com ------------=_1417083183-537-1-- From unknown Mon Aug 18 11:25:14 2025 X-Loop: help-debbugs@gnu.org Subject: bug#19102: 24.4; outline-move-subtree-up/down error at last and second-last subtree Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 27 Nov 2014 17:17: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: To: Stephen Berman Cc: paul@tilk.co, Eli Zaretskii , 19102-done@debbugs.gnu.org Received: via spool by 19102-done@debbugs.gnu.org id=D19102.141710856429737 (code D ref 19102); Thu, 27 Nov 2014 17:17:02 +0000 Received: (at 19102-done) by debbugs.gnu.org; 27 Nov 2014 17:16:04 +0000 Received: from localhost ([127.0.0.1]:47812 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Xu2fk-0007jH-7o for submit@debbugs.gnu.org; Thu, 27 Nov 2014 12:16:04 -0500 Received: from mercure.iro.umontreal.ca ([132.204.24.67]:39690) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Xu2fi-0007hK-O5 for 19102-done@debbugs.gnu.org; Thu, 27 Nov 2014 12:16:03 -0500 Received: from hidalgo.iro.umontreal.ca (hidalgo.iro.umontreal.ca [132.204.27.50]) by mercure.iro.umontreal.ca (Postfix) with ESMTP id 5C23585059; Thu, 27 Nov 2014 12:16:02 -0500 (EST) Received: from lechon.iro.umontreal.ca (lechon.iro.umontreal.ca [132.204.27.242]) by hidalgo.iro.umontreal.ca (Postfix) with ESMTP id D21A21E5B8A; Thu, 27 Nov 2014 12:15:38 -0500 (EST) Received: by lechon.iro.umontreal.ca (Postfix, from userid 20848) id 85918B4085; Thu, 27 Nov 2014 12:15:38 -0500 (EST) From: Stefan Monnier 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> <8761e26q12.fsf@rosalinde.fritz.box> <87y4qx6ax4.fsf@rosalinde.fritz.box> <87lhmx61m7.fsf@rosalinde.fritz.box> <87zjbdlzon.fsf@rosalinde.fritz.box> Date: Thu, 27 Nov 2014 12:15:38 -0500 In-Reply-To: <87zjbdlzon.fsf@rosalinde.fritz.box> (Stephen Berman's message of "Thu, 27 Nov 2014 11:12:40 +0100") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-DIRO-MailScanner-Information: Please contact the ISP for more information X-DIRO-MailScanner: Found to be clean X-DIRO-MailScanner-SpamCheck: n'est pas un polluriel, SpamAssassin (score=-2.82, requis 5, autolearn=not spam, ALL_TRUSTED -2.82, MC_TSTLAST 0.00) X-DIRO-MailScanner-From: monnier@iro.umontreal.ca X-Spam-Status: No X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.3 (--) > I pushed the fix to emacs-24 and am closing this bug. I think it's > cleaner for the refactoring part to go only into master; I'll do that > when the fix is merged. Sounds good, thank you, Stefan