From mboxrd@z Thu Jan 1 00:00:00 1970 From: Bernt Hansen Subject: [PATCH 1/2] Remove striction when finding task by id Date: Sat, 14 Jun 2014 10:46:50 -0400 Message-ID: <1402757211-30510-2-git-send-email-bernt@norang.ca> References: <1402757211-30510-1-git-send-email-bernt@norang.ca> Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:38546) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WvpEm-0007hQ-69 for emacs-orgmode@gnu.org; Sat, 14 Jun 2014 10:47:27 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WvpEd-00048f-H1 for emacs-orgmode@gnu.org; Sat, 14 Jun 2014 10:47:20 -0400 Received: from mho-03-ewr.mailhop.org ([204.13.248.66]:47912 helo=mho-01-ewr.mailhop.org) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WvpEd-00046Q-Et for emacs-orgmode@gnu.org; Sat, 14 Jun 2014 10:47:11 -0400 Received: from cpe000102d0fe75-cm68b6fcf41760.cpe.net.cable.rogers.com ([99.239.136.54] helo=mail.norang.ca) by mho-01-ewr.mailhop.org with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.72) (envelope-from ) id 1WvpEW-000CMU-Uj for emacs-orgmode@gnu.org; Sat, 14 Jun 2014 14:47:05 +0000 In-Reply-To: <1402757211-30510-1-git-send-email-bernt@norang.ca> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org Cc: Bernt Hansen Allows find task by id to locate a task outside a current restriction. I restrict to subtrees regularly and when I want to jump to another task outside the current restriction but in the same file this patch is required to locate the appropriate heading. Without this patch point ends up at the top of my restricted area which is on the wrong task. --- lisp/org-macs.el | 8 +++++--- 1 files changed, 5 insertions(+), 3 deletions(-) diff --git a/lisp/org-macs.el b/lisp/org-macs.el index ddd6e2e..e6af5da 100644 --- a/lisp/org-macs.el +++ b/lisp/org-macs.el @@ -154,9 +154,11 @@ We use a macro so that the test can happen at compilation time." `(let ((,mpom ,pom)) (save-excursion (if (markerp ,mpom) (set-buffer (marker-buffer ,mpom))) - (save-excursion - (goto-char (or ,mpom (point))) - ,@body))))) + (save-restriction + (widen) + (save-excursion + (goto-char (or ,mpom (point))) + ,@body)))))) (def-edebug-spec org-with-point-at (form body)) (put 'org-with-point-at 'lisp-indent-function 1) -- 1.7.9.48.g85da4d