all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Patch: maintain window configuration when org-agenda-follow-indirect is set
@ 2011-10-23 19:17 Dave Abrahams
  2011-12-12 16:40 ` [Accepted] " Bastien Guerry
  2011-12-12 16:46 ` Bastien
  0 siblings, 2 replies; 3+ messages in thread
From: Dave Abrahams @ 2011-10-23 19:17 UTC (permalink / raw)
  To: emacs-orgmode

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: 0001-Maintain-stable-window-configuration-when-org-agenda.patch --]
[-- Type: text/x-patch, Size: 1804 bytes --]

From 5adafd491f520908c8ee180c1b0d63d877fa8547 Mon Sep 17 00:00:00 2001
From: Dave Abrahams <dave@boostpro.com>
Date: Sun, 23 Oct 2011 14:41:44 -0400
Subject: [PATCH] Maintain stable window configuration when
 org-agenda-follow-indirect is set

Without this change, org-agenda-follow-indirect tends to cause the
window configration to bounce around chaotically as you move from item
to item.
---
 lisp/org-agenda.el |   17 +++++++++++++++++
 1 files changed, 17 insertions(+), 0 deletions(-)

diff --git a/lisp/org-agenda.el b/lisp/org-agenda.el
index e4b1ba5..639ee23 100644
--- a/lisp/org-agenda.el
+++ b/lisp/org-agenda.el
@@ -7168,6 +7168,23 @@ With numerical prefix arg ARG, go up to this level and then take that tree.
 With a \\[universal-argument] prefix, make a separate frame for this tree (i.e. don't
 use the dedicated frame)."
   (interactive)
+  (if (and current-prefix-arg (listp current-prefix-arg))
+      (org-agenda-do-tree-to-indirect-buffer)
+    (let ((agenda-window (selected-window))
+          (indirect-window (get-buffer-window org-last-indirect-buffer)))
+      (save-window-excursion (org-agenda-do-tree-to-indirect-buffer))
+      (unwind-protect
+          (progn
+            (unless indirect-window
+              (setq indirect-window (split-window agenda-window)))
+            (select-window indirect-window)
+            (switch-to-buffer org-last-indirect-buffer :norecord)
+            (fit-window-to-buffer indirect-window))
+        (select-window agenda-window)))))
+
+(defun org-agenda-do-tree-to-indirect-buffer ()
+  "Implements org-agenda-tree-to-indirect-buffer, but
+doesn't attempt to manage stability of the window configuration."
   (org-agenda-check-no-diary)
   (let* ((marker (or (org-get-at-bol 'org-marker)
 		     (org-agenda-error)))
-- 
1.7.6.1


[-- Attachment #2: Type: text/plain, Size: 63 bytes --]


-- 
Dave Abrahams
BoostPro Computing
http://www.boostpro.com


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [Accepted] Patch: maintain window configuration when org-agenda-follow-indirect is set
  2011-10-23 19:17 Patch: maintain window configuration when org-agenda-follow-indirect is set Dave Abrahams
@ 2011-12-12 16:40 ` Bastien Guerry
  2011-12-12 16:46 ` Bastien
  1 sibling, 0 replies; 3+ messages in thread
From: Bastien Guerry @ 2011-12-12 16:40 UTC (permalink / raw)
  To: emacs-orgmode

Patch 1004 (http://patchwork.newartisans.com/patch/1004/) is now "Accepted".

Maintainer comment: none

This relates to the following submission:

http://mid.gmane.org/%3Cm2bot77c1a.fsf%40pluto.luannocracy.com%3E

Here is the original message containing the patch:

> Content-Type: text/plain; charset="utf-8"
> MIME-Version: 1.0
> Content-Transfer-Encoding: 7bit
> Subject: [O] Patch: maintain window configuration when
> 	org-agenda-follow-indirect is set
> Date: Mon, 24 Oct 2011 00:17:37 -0000
> From: Dave Abrahams <dave@boostpro.com>
> X-Patchwork-Id: 1004
> Message-Id: <m2bot77c1a.fsf@pluto.luannocracy.com>
> To: emacs-orgmode@gnu.org
> 
> 
> 
> 
> >From 5adafd491f520908c8ee180c1b0d63d877fa8547 Mon Sep 17 00:00:00 2001
> From: Dave Abrahams <dave@boostpro.com>
> Date: Sun, 23 Oct 2011 14:41:44 -0400
> Subject: [PATCH] Maintain stable window configuration when
>  org-agenda-follow-indirect is set
> 
> Without this change, org-agenda-follow-indirect tends to cause the
> window configration to bounce around chaotically as you move from item
> to item.
> ---
>  lisp/org-agenda.el |   17 +++++++++++++++++
>  1 files changed, 17 insertions(+), 0 deletions(-)
> 
> diff --git a/lisp/org-agenda.el b/lisp/org-agenda.el
> index e4b1ba5..639ee23 100644
> --- a/lisp/org-agenda.el
> +++ b/lisp/org-agenda.el
> @@ -7168,6 +7168,23 @@ With numerical prefix arg ARG, go up to this level and then take that tree.
>  With a \\[universal-argument] prefix, make a separate frame for this tree (i.e. don't
>  use the dedicated frame)."
>    (interactive)
> +  (if (and current-prefix-arg (listp current-prefix-arg))
> +      (org-agenda-do-tree-to-indirect-buffer)
> +    (let ((agenda-window (selected-window))
> +          (indirect-window (get-buffer-window org-last-indirect-buffer)))
> +      (save-window-excursion (org-agenda-do-tree-to-indirect-buffer))
> +      (unwind-protect
> +          (progn
> +            (unless indirect-window
> +              (setq indirect-window (split-window agenda-window)))
> +            (select-window indirect-window)
> +            (switch-to-buffer org-last-indirect-buffer :norecord)
> +            (fit-window-to-buffer indirect-window))
> +        (select-window agenda-window)))))
> +
> +(defun org-agenda-do-tree-to-indirect-buffer ()
> +  "Implements org-agenda-tree-to-indirect-buffer, but
> +doesn't attempt to manage stability of the window configuration."
>    (org-agenda-check-no-diary)
>    (let* ((marker (or (org-get-at-bol 'org-marker)
>  		     (org-agenda-error)))
> -- 
> 1.7.6.1
> 
> 

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Patch: maintain window configuration when org-agenda-follow-indirect is set
  2011-10-23 19:17 Patch: maintain window configuration when org-agenda-follow-indirect is set Dave Abrahams
  2011-12-12 16:40 ` [Accepted] " Bastien Guerry
@ 2011-12-12 16:46 ` Bastien
  1 sibling, 0 replies; 3+ messages in thread
From: Bastien @ 2011-12-12 16:46 UTC (permalink / raw)
  To: Dave Abrahams; +Cc: emacs-orgmode

Dave Abrahams <dave@boostpro.com> writes:

> Without this change, org-agenda-follow-indirect tends to cause the
> window configration to bounce around chaotically as you move from item
> to item.

Applied, thanks.  I had to update the commit message: it should contain
an Emacs-ready ChangeLog message.

-- 
 Bastien

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2011-12-12 16:45 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-10-23 19:17 Patch: maintain window configuration when org-agenda-follow-indirect is set Dave Abrahams
2011-12-12 16:40 ` [Accepted] " Bastien Guerry
2011-12-12 16:46 ` Bastien

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.