From: Bernt Hansen <bernt@norang.ca>
To: emacs-orgmode@gnu.org
Cc: Bernt Hansen <bernt@norang.ca>
Subject: [PATCH 3/3] Honour existing restrictions when visiting tasks from the agenda
Date: Fri, 30 Dec 2011 05:49:09 -0500 [thread overview]
Message-ID: <1325242149-22487-4-git-send-email-bernt@norang.ca> (raw)
In-Reply-To: <1325242149-22487-1-git-send-email-bernt@norang.ca>
* lisp/org-agenda.el (org-agenda-switch-to): Widen org buffer only if point is
outside the current restriction
Widen org buffer when visiting from agenda only if point is outside
current restriction.
Visiting a task with RET or TAB in the agenda should not affect the
org-mode buffer restriction unless the target task is not currently
visible due to the restriction.
---
lisp/org-agenda.el | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/lisp/org-agenda.el b/lisp/org-agenda.el
index f240f5e..b009faf 100644
--- a/lisp/org-agenda.el
+++ b/lisp/org-agenda.el
@@ -7033,7 +7033,9 @@ at the text of the entry itself."
(pos (marker-position marker)))
(org-pop-to-buffer-same-window buffer)
(and delete-other-windows (delete-other-windows))
- (widen)
+ (when (or (< pos (point-min))
+ (> pos (point-max)))
+ (widen))
(goto-char pos)
(when (eq major-mode 'org-mode)
(org-show-context 'agenda)
--
1.7.8.247.g10f4e
next prev parent reply other threads:[~2011-12-30 10:49 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-12-30 10:49 Honour existing restrictions if possible when visiting tasks from the agenda Bernt Hansen
2011-12-30 10:49 ` [PATCH 1/3] Honour existing restrictions when regenerating " Bernt Hansen
2011-12-30 10:49 ` [PATCH 2/3] Honour existing restrictions when clocking in from " Bernt Hansen
2012-01-19 13:43 ` Matt Lundin
2012-01-19 14:51 ` Bernt Hansen
2012-01-19 15:22 ` Bastien
2012-01-19 15:44 ` Bernt Hansen
2012-01-19 15:47 ` Sebastien Vauban
2012-01-19 16:11 ` Bastien
2012-01-19 18:05 ` Bernt Hansen
2011-12-30 10:49 ` Bernt Hansen [this message]
2011-12-31 8:11 ` Honour existing restrictions if possible when visiting tasks " Carsten Dominik
2011-12-31 14:12 ` Bernt Hansen
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1325242149-22487-4-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 external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.