From mboxrd@z Thu Jan 1 00:00:00 1970 From: =?ISO-8859-1?Q?Jan_B=F6cker?= Subject: [PATCH] org-narrow-to-subtree: prevent prepending text to the next headline while narrowed Date: Mon, 18 Jan 2010 12:13:28 +0100 Message-ID: <4B544258.4040305@jboecker.de> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------080002000007030406010501" Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NWpYl-0007DH-2T for emacs-orgmode@gnu.org; Mon, 18 Jan 2010 06:14:15 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NWpYe-0007AQ-KB for emacs-orgmode@gnu.org; Mon, 18 Jan 2010 06:14:12 -0500 Received: from [199.232.76.173] (port=33429 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NWpYe-0007A7-1K for emacs-orgmode@gnu.org; Mon, 18 Jan 2010 06:14:08 -0500 Received: from mail7.worldserver.net ([217.13.200.27]:48696) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1NWpYd-0003U3-HI for emacs-orgmode@gnu.org; Mon, 18 Jan 2010 06:14:07 -0500 List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Org Mode This is a multi-part message in MIME format. --------------080002000007030406010501 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Consider the following situation: * A Some text. * B - Place the cursor on A, press C-x n w (org-narrow-to-subtree). - Go to the very end of the buffer and insert "xyz". - C-x n w (widen). You end up with: * A Some Text xyz* B The attached one-line patch fixes this by passing `nil' for the `to-heading' parameter of `org-end-of-subtree'. --------------080002000007030406010501 Content-Type: text/plain; name="0001-org-narrow-to-subtree-prevent-prepending-text-to-the.patch" Content-Transfer-Encoding: 8bit Content-Disposition: attachment; filename*0="0001-org-narrow-to-subtree-prevent-prepending-text-to-the.pa"; filename*1="tch" >From 688a42315caf5840c9db5ab957670c33d1921e92 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20B=C3=B6cker?= Date: Mon, 18 Jan 2010 11:54:00 +0100 Subject: [PATCH] org-narrow-to-subtree: prevent prepending text to the next headline while narrowed --- lisp/ChangeLog | 6 ++++++ lisp/org.el | 2 +- 2 files changed, 7 insertions(+), 1 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index b85a716..cb6ebe9 100755 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,9 @@ +2010-01-18 Jan Böcker + + * org.el (org-narrow-to-subtree): Position the end of the narrowed + region before the line with the next heading, to prevent the user + from prepending text to the next headline. + 2010-01-18 Carsten Dominik * org-ctags.el (org-ctags-enable): Change order of functions. diff --git a/lisp/org.el b/lisp/org.el index 626720f..a4755a2 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -6829,7 +6829,7 @@ If yes, remember the marker and the distance to BEG." (save-match-data (narrow-to-region (progn (org-back-to-heading t) (point)) - (progn (org-end-of-subtree t t) (point)))))) + (progn (org-end-of-subtree t nil) (point)))))) (defun org-clone-subtree-with-time-shift (n &optional shift) "Clone the task (subtree) at point N times. -- 1.6.6 --------------080002000007030406010501 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Emacs-orgmode mailing list Please use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode --------------080002000007030406010501--