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


Reply via email to