From mboxrd@z Thu Jan 1 00:00:00 1970 From: Leo Vivier Subject: [PATCH] Fix other commands for exiting narrowing (2) Date: Mon, 18 Feb 2019 02:21:20 +0100 Message-ID: <871s45uc1b.fsf@hidden> References: <20190218002547.30325-1-leo.vivier@gmail.com> <20190218002547.30325-2-leo.vivier@gmail.com> <87imxh3o46.fsf@hidden> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([209.51.188.92]:35192) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gvXcb-0000y1-J7 for emacs-orgmode@gnu.org; Sun, 17 Feb 2019 20:21:26 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gvXcb-0005to-03 for emacs-orgmode@gnu.org; Sun, 17 Feb 2019 20:21:25 -0500 Received: from mail-wr1-x430.google.com ([2a00:1450:4864:20::430]:40717) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gvXca-0005sA-NR for emacs-orgmode@gnu.org; Sun, 17 Feb 2019 20:21:24 -0500 Received: by mail-wr1-x430.google.com with SMTP id q1so16529315wrp.7 for ; Sun, 17 Feb 2019 17:21:24 -0800 (PST) Received: from thinkpad.localdomain (lcs07-lyo-176-188-242-162.sfr.lns.abo.bbox.fr. [176.188.242.162]) by smtp.gmail.com with ESMTPSA id 132sm9998700wmd.27.2019.02.17.17.21.22 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sun, 17 Feb 2019 17:21:22 -0800 (PST) In-Reply-To: <87imxh3o46.fsf@hidden> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: "Emacs-orgmode" To: emacs-orgmode@gnu.org * lisp/org.el (org-toggle-narrow-to-subtree): Different interactive calls and use wrapper for widen --- Same deal as the last email. Sorry for only noticing those commands now; I don't use them in my workflow. The change in `interactive' is to ensure that only the interactive calls to `org-narrow-to-subtree' produce the last newline. lisp/org.el | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lisp/org.el b/lisp/org.el index 292807138..ef86423e8 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -8421,12 +8421,12 @@ end of the narrowed tree." (when newline (insert "\n"))) (point))))))) -(defun org-toggle-narrow-to-subtree () +(defun org-toggle-narrow-to-subtree (&optional newline) "Narrow to the subtree at point or widen a narrowed buffer." - (interactive) + (interactive "p") (if (buffer-narrowed-p) - (widen) - (org-narrow-to-subtree))) + (org-widen) + (org-narrow-to-subtree newline))) (defun org-narrow-to-block () "Narrow buffer to the current block." -- 2.20.1