emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* [PATCH 1/3] Fix bug when narrowing to subtree with point at an inline task
@ 2011-03-02 16:56 Nicolas Goaziou
  2011-03-02 16:56 ` [PATCH 2/3] When demoting a subtree, don't change level of inline tasks within Nicolas Goaziou
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Nicolas Goaziou @ 2011-03-02 16:56 UTC (permalink / raw)
  To: Org mode list; +Cc: Nicolas Goaziou

* lisp/org.el (org-narrow-to-subtree): ensure `org-back-to-heading'
  will move point to a real heading and not an inline task by wraping
  function into a org-with-limited-levels macro.
---
 lisp/org.el |   11 ++++++-----
 1 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/lisp/org.el b/lisp/org.el
index a26a3ca..6e1be76 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -7566,11 +7566,12 @@ If yes, remember the marker and the distance to BEG."
   (interactive)
   (save-excursion
     (save-match-data
-      (narrow-to-region
-       (progn (org-back-to-heading t) (point))
-       (progn (org-end-of-subtree t t)
-	      (if (and (org-on-heading-p) (not (eobp))) (backward-char 1))
-	      (point))))))
+      (org-with-limited-levels
+       (narrow-to-region
+	(progn (org-back-to-heading t) (point))
+	(progn (org-end-of-subtree t t)
+	       (if (and (org-on-heading-p) (not (eobp))) (backward-char 1))
+	       (point)))))))
 
 (defun org-narrow-to-block ()
   "Narrow buffer to the current block."
-- 
1.7.4.1

^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2011-03-06  8:31 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-03-02 16:56 [PATCH 1/3] Fix bug when narrowing to subtree with point at an inline task Nicolas Goaziou
2011-03-02 16:56 ` [PATCH 2/3] When demoting a subtree, don't change level of inline tasks within Nicolas Goaziou
2011-03-06  8:30   ` [Accepted] [O, " Bastien Guerry
2011-03-02 16:56 ` [PATCH 3/3] Promote and demote inline tasks Nicolas Goaziou
2011-03-06  8:30   ` [Accepted] [O,3/3] " Bastien Guerry
2011-03-06  8:29 ` [Accepted] [O, 1/3] Fix bug when narrowing to subtree with point at an inline task Bastien Guerry

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).