emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Bernt Hansen <bernt@norang.ca>
To: emacs-orgmode@gnu.org
Cc: Bernt Hansen <bernt@norang.ca>
Subject: [PATCH 1/2] Remove striction when finding task by id
Date: Sat, 14 Jun 2014 10:46:50 -0400	[thread overview]
Message-ID: <1402757211-30510-2-git-send-email-bernt@norang.ca> (raw)
In-Reply-To: <1402757211-30510-1-git-send-email-bernt@norang.ca>

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	other threads:[~2014-06-14 14:47 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-14 14:46 Two patches I have been using for 6-12 months Bernt Hansen
2014-06-14 14:46 ` Bernt Hansen [this message]
2014-06-14 15:12   ` [PATCH 1/2] Remove striction when finding task by id Nicolas Goaziou
2014-06-14 15:25     ` Bernt Hansen
2014-06-15  2:50       ` [PATCH] Remove restriction when locating markers Bernt Hansen
2014-06-15  7:31         ` Nicolas Goaziou
2014-06-14 14:46 ` [PATCH 2/2] Keep window position in agenda when changing todo states Bernt Hansen
2014-06-14 15:51   ` Bastien
2014-06-14 17:01     ` Bernt Hansen
2014-06-14 17:45       ` Bernt Hansen
2014-06-15  7:34         ` Bastien

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=1402757211-30510-2-git-send-email-bernt@norang.ca \
    --to=bernt@norang.ca \
    --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).