]> git.eshelyaron.com Git - emacs.git/commitdiff
Don't bind org-agenda key to an anonymous function
authorMark Oteiza <mvoteiza@udel.edu>
Sat, 17 Jun 2017 01:51:05 +0000 (21:51 -0400)
committerMark Oteiza <mvoteiza@udel.edu>
Sat, 17 Jun 2017 01:51:05 +0000 (21:51 -0400)
* lisp/org/org-agenda.el: Bind "g" to named command.
(org-agenda-redo-all): New command.  Extend the previous functionality
through a prefix argument.

lisp/org/org-agenda.el

index 153e3772b0cfc129873d0a77f9f1f53785451c35..409c93abedcadcff4bdd58205d0eeb15e94d8b99 100644 (file)
@@ -2252,7 +2252,7 @@ The following commands are available:
 (org-defkey org-agenda-mode-map "!" 'org-agenda-toggle-deadlines)
 (org-defkey org-agenda-mode-map "G" 'org-agenda-toggle-time-grid)
 (org-defkey org-agenda-mode-map "r" 'org-agenda-redo)
-(org-defkey org-agenda-mode-map "g" (lambda () (interactive) (org-agenda-redo t)))
+(org-defkey org-agenda-mode-map "g" 'org-agenda-redo-all)
 (org-defkey org-agenda-mode-map "e" 'org-agenda-set-effort)
 (org-defkey org-agenda-mode-map "\C-c\C-xe" 'org-agenda-set-effort)
 (org-defkey org-agenda-mode-map "\C-c\C-x\C-e"
@@ -7310,6 +7310,17 @@ in the agenda."
     (org-goto-line line)
     (recenter window-line)))
 
+(defun org-agenda-redo-all (&optional exhaustive)
+  "Rebuild all agenda views in the current buffer.
+With a prefix argument, do so in all agenda buffers."
+  (interactive "P")
+  (if exhaustive
+      (dolist (buffer (buffer-list))
+        (with-current-buffer buffer
+          (when (derived-mode-p 'org-agenda-mode)
+            (org-agenda-redo t))))
+    (org-agenda-redo t)))
+
 (defvar org-global-tags-completion-table nil)
 (defvar org-agenda-filter-form nil)
 (defvar org-agenda-filtered-by-category nil)