diff options
author | Bastien Guerry <bzg@altern.org> | 2011-02-18 15:15:54 +0100 |
---|---|---|
committer | Bastien Guerry <bzg@altern.org> | 2011-02-18 15:15:54 +0100 |
commit | c6dbde1babaa0b2efa278d75a6ec82f91ef59d5e (patch) | |
tree | 84d3aa404a9c195b47b6668cc3ab0581ed5c2528 | |
parent | 10d76f720a1f32e7fa73cb3359c1beae2b72da84 (diff) | |
download | org-mode-c6dbde1babaa0b2efa278d75a6ec82f91ef59d5e.tar.gz |
Fix bug when redoing a block agenda command.
* org-agenda.el (org-agenda): Set the 'last-args property to
nil when calling `org-agenda'. Don't kill the local variable
`org-agenda-current-span'.
(org-run-agenda-series): Use the new property 'last-args.
(org-agenda-change-time-span): Use the dynamically set
`org-agenda-overriding-arguments' variable when non-nil.
Thanks to Matt Lundin and Michael Brand for reporting this.
-rw-r--r-- | lisp/org-agenda.el | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/lisp/org-agenda.el b/lisp/org-agenda.el index 54de775..67b53f1 100644 --- a/lisp/org-agenda.el +++ b/lisp/org-agenda.el @@ -2159,9 +2159,10 @@ Pressing `<' twice means to restrict to the current subtree or region (move-marker org-agenda-restrict-end nil)) ;; Delete old local properties (put 'org-agenda-redo-command 'org-lprops nil) + ;; Delete previously set last-arguments + (put 'org-agenda-redo-command 'last-args nil) ;; Remember where this call originated (setq org-agenda-last-dispatch-buffer (current-buffer)) - (kill-local-variable 'org-agenda-current-span) (unless keys (setq ans (org-agenda-get-restriction-and-command prefix-descriptions) keys (car ans) @@ -2462,6 +2463,10 @@ s Search for keywords C Configure custom agenda commands (org-let (nth 1 series) '(org-prepare-agenda name)) (let* ((org-agenda-multi t) (redo (list 'org-run-agenda-series name (list 'quote series))) + (org-agenda-overriding-arguments + (or org-agenda-overriding-arguments + (unless (null (delq nil (get 'org-agenda-redo-command 'last-args))) + (get 'org-agenda-redo-command 'last-args)))) (cmds (car series)) (gprops (nth 1 series)) match ;; The byte compiler incorrectly complains about this. Keep it! @@ -2496,6 +2501,7 @@ s Search for keywords C Configure custom agenda commands (t (error "Invalid type in command series")))) (widen) (setq org-agenda-redo-command redo) + (put 'org-agenda-redo-command 'last-args org-agenda-last-arguments) (goto-char (point-min))) (org-fit-agenda-window) (org-let (nth 1 series) '(org-finalize-agenda))) @@ -6292,7 +6298,8 @@ SPAN may be `day', `week', `month', `year'." org-starting-day)) (sd (org-agenda-compute-starting-span sd span n)) (org-agenda-overriding-arguments - (list (car org-agenda-last-arguments) sd span t))) + (or org-agenda-overriding-arguments + (list (car org-agenda-last-arguments) sd span t)))) (org-agenda-redo) (org-agenda-find-same-or-today-or-agenda)) (org-agenda-set-mode-name) |