Browse Source

Agenda: Improve window fitting while making a series of blocks

The agenda window was fitted after each partial command, which makes
no sense.  Now it is only fitted after the final block.
Carsten Dominik 16 years ago
parent
commit
bc74aecd8d
2 changed files with 8 additions and 4 deletions
  1. 3 0
      lisp/ChangeLog
  2. 5 4
      lisp/org-agenda.el

+ 3 - 0
lisp/ChangeLog

@@ -4,6 +4,9 @@
 	property, for sorting.
 	property, for sorting.
 	(org-cmp-todo-state): Get the applicable TODO keywords directly
 	(org-cmp-todo-state): Get the applicable TODO keywords directly
 	from the buffer.
 	from the buffer.
+	(org-run-agenda-series, org-agenda-list, org-search-view)
+	(org-todo-list, org-tags-view): Only fit agenda window when the
+	whole series is done.
 
 
 	* org.el (org-scan-tags): Add todo state as property, for sorting.
 	* org.el (org-scan-tags): Add todo state as property, for sorting.
 
 

+ 5 - 4
lisp/org-agenda.el

@@ -1776,6 +1776,7 @@ s   Search for keywords                 C   Configure custom agenda commands
     (widen)
     (widen)
     (setq org-agenda-redo-command redo)
     (setq org-agenda-redo-command redo)
     (goto-char (point-min)))
     (goto-char (point-min)))
+  (org-fit-agenda-window)
   (org-let (nth 1 series) '(org-finalize-agenda)))
   (org-let (nth 1 series) '(org-finalize-agenda)))
 
 
 ;;;###autoload
 ;;;###autoload
@@ -2601,7 +2602,7 @@ given in `org-agenda-start-on-weekday'."
 	(setq tbl (apply 'org-get-clocktable p))
 	(setq tbl (apply 'org-get-clocktable p))
 	(insert tbl)))
 	(insert tbl)))
     (goto-char (point-min))
     (goto-char (point-min))
-    (org-fit-agenda-window)
+    (or org-agenda-multi (org-fit-agenda-window))
     (unless (and (pos-visible-in-window-p (point-min))
     (unless (and (pos-visible-in-window-p (point-min))
 		 (pos-visible-in-window-p (point-max)))
 		 (pos-visible-in-window-p (point-max)))
       (goto-char (1- (point-max)))
       (goto-char (1- (point-max)))
@@ -2811,7 +2812,7 @@ in `org-agenda-text-search-extra-files'."
     (when rtnall
     (when rtnall
       (insert (org-finalize-agenda-entries rtnall) "\n"))
       (insert (org-finalize-agenda-entries rtnall) "\n"))
     (goto-char (point-min))
     (goto-char (point-min))
-    (org-fit-agenda-window)
+    (or org-agenda-multi (org-fit-agenda-window))
     (add-text-properties (point-min) (point-max) '(org-agenda-type search))
     (add-text-properties (point-min) (point-max) '(org-agenda-type search))
     (org-finalize-agenda)
     (org-finalize-agenda)
     (setq buffer-read-only t)))
     (setq buffer-read-only t)))
@@ -2881,7 +2882,7 @@ for a keyword.  A numeric prefix directly selects the Nth keyword in
     (when rtnall
     (when rtnall
       (insert (org-finalize-agenda-entries rtnall) "\n"))
       (insert (org-finalize-agenda-entries rtnall) "\n"))
     (goto-char (point-min))
     (goto-char (point-min))
-    (org-fit-agenda-window)
+    (or org-agenda-multi (org-fit-agenda-window))
     (add-text-properties (point-min) (point-max) '(org-agenda-type todo))
     (add-text-properties (point-min) (point-max) '(org-agenda-type todo))
     (org-finalize-agenda)
     (org-finalize-agenda)
     (setq buffer-read-only t)))
     (setq buffer-read-only t)))
@@ -2947,7 +2948,7 @@ The prefix arg TODO-ONLY limits the search to TODO entries."
     (when rtnall
     (when rtnall
       (insert (org-finalize-agenda-entries rtnall) "\n"))
       (insert (org-finalize-agenda-entries rtnall) "\n"))
     (goto-char (point-min))
     (goto-char (point-min))
-    (org-fit-agenda-window)
+    (or org-agenda-multi (org-fit-agenda-window))
     (add-text-properties (point-min) (point-max) '(org-agenda-type tags))
     (add-text-properties (point-min) (point-max) '(org-agenda-type tags))
     (org-finalize-agenda)
     (org-finalize-agenda)
     (setq buffer-read-only t)))
     (setq buffer-read-only t)))