[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
- [O] [PATCH 1/2] Fix narrowing for 1-line subtrees, Leo Vivier, 2019/02/17
- [O] [PATCH 2/2] Prevent deletion of newline added by narrowing, Leo Vivier, 2019/02/17
- Re: [O] [PATCH 1/2] Fix narrowing for 1-line subtrees, Nicolas Goaziou, 2019/02/19
- Re: [O] [PATCH 1/2] Fix narrowing for 1-line subtrees, Leo Vivier, 2019/02/19
- [O] [PATCH] Fix narrowing for 1-line subtrees (squashed), Leo Vivier, 2019/02/19
- Re: [O] [PATCH 1/2] Fix narrowing for 1-line subtrees, Nicolas Goaziou, 2019/02/19
- Re: [O] [PATCH 1/2] Fix narrowing for 1-line subtrees, Leo Vivier, 2019/02/19
- Re: [O] [PATCH 1/2] Fix narrowing for 1-line subtrees, Leo Vivier, 2019/02/19
- Re: [O] [PATCH 1/2] Fix narrowing for 1-line subtrees, Leo Vivier, 2019/02/19
- Re: [O] [PATCH 1/2] Fix narrowing for 1-line subtrees, Nicolas Goaziou, 2019/02/20
- Re: [O] [PATCH 1/2] Fix narrowing for 1-line subtrees, Leo Vivier, 2019/02/20