From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nicolas Goaziou Subject: [PATCH 1/3] Fix bug when narrowing to subtree with point at an inline task Date: Wed, 2 Mar 2011 17:56:02 +0100 Message-ID: <1299084964-26440-1-git-send-email-n.goaziou@gmail.com> Return-path: Received: from [140.186.70.92] (port=39989 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PupLZ-0007bY-J6 for emacs-orgmode@gnu.org; Wed, 02 Mar 2011 11:56:22 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PupLY-0002Uf-73 for emacs-orgmode@gnu.org; Wed, 02 Mar 2011 11:56:21 -0500 Received: from mail-fx0-f41.google.com ([209.85.161.41]:33149) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PupLY-0002Ub-0a for emacs-orgmode@gnu.org; Wed, 02 Mar 2011 11:56:20 -0500 Received: by fxm5 with SMTP id 5so213793fxm.0 for ; Wed, 02 Mar 2011 08:56:19 -0800 (PST) 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 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