emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[O] [PATCH] Fix other commands for exiting narrowing (2)


From: Leo Vivier
Subject: [O] [PATCH] Fix other commands for exiting narrowing (2)
Date: Mon, 18 Feb 2019 02:21:20 +0100

* 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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]