From: "Jan Böcker" <jan.boecker@jboecker.de>
To: Org Mode <emacs-orgmode@gnu.org>
Subject: [PATCH] org-narrow-to-subtree: prevent prepending text to the next headline while narrowed
Date: Mon, 18 Jan 2010 12:13:28 +0100 [thread overview]
Message-ID: <4B544258.4040305@jboecker.de> (raw)
[-- Attachment #1: Type: text/plain, Size: 349 bytes --]
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'.
[-- Attachment #2: 0001-org-narrow-to-subtree-prevent-prepending-text-to-the.patch --]
[-- Type: text/plain, Size: 1384 bytes --]
From 688a42315caf5840c9db5ab957670c33d1921e92 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jan=20B=C3=B6cker?= <jan.boecker@jboecker.de>
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 <jan.boecker@jboecker.de>
+
+ * 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 <carsten.dominik@gmail.com>
* 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
[-- Attachment #3: Type: text/plain, Size: 201 bytes --]
_______________________________________________
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
next reply other threads:[~2010-01-18 11:14 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-01-18 11:13 Jan Böcker [this message]
2010-01-22 10:30 ` [PATCH] org-narrow-to-subtree: prevent prepending text to the next headline while narrowed Carsten Dominik
2010-01-22 16:50 ` Samuel Wales
2010-02-01 8:11 ` Carsten Dominik
2010-02-01 17:26 ` Samuel Wales
2010-02-02 6:17 ` Carsten Dominik
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.orgmode.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4B544258.4040305@jboecker.de \
--to=jan.boecker@jboecker.de \
--cc=emacs-orgmode@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).