summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBastien Guerry <bzg@altern.org>2011-02-03 20:03:51 +0100
committerBastien Guerry <bzg@altern.org>2011-02-03 20:03:51 +0100
commit809b505ef07829e5b14ff4fdf7f459c126348642 (patch)
treebd5307f3e79d74e73de58055218249a50eb7dadc
parent814871c42bdc611d92c07301af52992e7bf1a8f7 (diff)
downloadorg-mode-809b505ef07829e5b14ff4fdf7f459c126348642.tar.gz
Add a new command: org-agenda-bulk-mark-regexp
* org-agenda.el (org-agenda-bulk-mark-regexp): New command. (org-agenda-menu): Add the new command to the menu. (org-agenda-mode-map): Add % as the keybinding for the new command.
-rw-r--r--lisp/org-agenda.el12
1 files changed, 11 insertions, 1 deletions
diff --git a/lisp/org-agenda.el b/lisp/org-agenda.el
index bbe9d8a..d5850e8 100644
--- a/lisp/org-agenda.el
+++ b/lisp/org-agenda.el
@@ -1757,6 +1757,7 @@ The following commands are available:
(org-defkey org-agenda-mode-map "\C-k" 'org-agenda-kill)
(org-defkey org-agenda-mode-map "\C-c\C-w" 'org-agenda-refile)
(org-defkey org-agenda-mode-map "m" 'org-agenda-bulk-mark)
+(org-defkey org-agenda-mode-map "%" 'org-agenda-bulk-mark-regexp)
(org-defkey org-agenda-mode-map "u" 'org-agenda-bulk-unmark)
(org-defkey org-agenda-mode-map "U" 'org-agenda-bulk-remove-all-marks)
(org-defkey org-agenda-mode-map "B" 'org-agenda-bulk-action)
@@ -1961,9 +1962,10 @@ The following commands are available:
["Delete subtree" org-agenda-kill t])
("Bulk action"
["Mark entry" org-agenda-bulk-mark t]
+ ["Mark matching regexp" org-agenda-bulk-mark-regexp t]
["Unmark entry" org-agenda-bulk-unmark t]
- ["Act on all marked" org-agenda-bulk-action t]
["Unmark all entries" org-agenda-bulk-remove-all-marks :active t :keys "C-u s"])
+ ["Act on all marked" org-agenda-bulk-action t]
"--"
("Tags and Properties"
["Show all Tags" org-agenda-show-tags t]
@@ -7869,6 +7871,14 @@ This is a command that has to be installed in `calendar-mode-map'."
(message "%d entries marked for bulk action"
(length org-agenda-bulk-marked-entries))))))
+(defun org-agenda-bulk-mark-regexp (regexp)
+ "Mark entries match REGEXP."
+ (interactive "sRegexp: ")
+ (save-excursion
+ (goto-char (point-min))
+ (while (re-search-forward regexp nil t)
+ (call-interactively 'org-agenda-bulk-mark))))
+
(defun org-agenda-bulk-unmark ()
"Unmark the entry at point for future bulk action."
(interactive)