summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBastien Guerry <bzg@altern.org>2011-12-31 12:08:54 +0100
committerBastien Guerry <bzg@altern.org>2011-12-31 12:08:54 +0100
commit72915f1c521be111fee80fc698822a6d1ac961b7 (patch)
treebe9b39ff3c877eab1a2cf1a274c7a96313104e15
parent79bf3ed861e7effce772a995bf27921f12f86149 (diff)
downloadorg-mode-72915f1c521be111fee80fc698822a6d1ac961b7.tar.gz
org.el: Honor 'start-level for `org-loop-over-headlines-in-active-region'.
* org.el (org-loop-over-headlines-in-active-region): Fix docstring. (org-todo, org-deadline, org-schedule): Honor the 'start-level value of `org-loop-over-headlines-in-active-region'.
-rw-r--r--lisp/org.el30
1 files changed, 20 insertions, 10 deletions
diff --git a/lisp/org.el b/lisp/org.el
index 2528fa8..24b0aa1 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -418,9 +418,10 @@ When set to a string, those commands will be performed on the
matching headlines within the active region. Such string must be
a tags/property/todo match as it is used in the agenda tags view.
-The list of commands is:
-- `org-schedule'
-- `org-deadline'"
+The list of commands is: `org-schedule', `org-deadline',
+`org-todo', `org-archive-subtree', `org-archive-set-tag' and
+`org-archive-to-archive-sibling'. The archiving commands skip
+already archived entries."
:type '(choice (const :tag "Don't loop" nil)
(const :tag "All headlines in active region" t)
(const :tag "In active region, headlines at the same level than the first one" 'start-level)
@@ -11192,12 +11193,13 @@ For calling through lisp, arg is also interpreted in the following way:
really is a member of `org-todo-keywords'."
(interactive "P")
(if (and (org-region-active-p) org-loop-over-headlines-in-active-region)
- (let (org-loop-over-headlines-in-active-region)
+ (let ((cl (if (eq org-loop-over-headlines-in-active-region 'start-level)
+ 'region-start-level 'region))
+ org-loop-over-headlines-in-active-region)
(org-map-entries
`(org-todo ,arg)
org-loop-over-headlines-in-active-region
- 'region
- (if (outline-invisible-p) (org-end-of-subtree nil t))))
+ cl (if (outline-invisible-p) (org-end-of-subtree nil t))))
(if (equal arg '(16)) (setq arg 'nextset))
(let ((org-blocker-hook org-blocker-hook)
(case-fold-search nil))
@@ -11950,9 +11952,13 @@ With argument TIME, set the deadline at the corresponding date. TIME
can either be an Org date like \"2011-07-24\" or a delta like \"+2d\"."
(interactive "P")
(if (and (org-region-active-p) org-loop-over-headlines-in-active-region)
- (let (org-loop-over-headlines-in-active-region)
+ (let ((cl (if (eq org-loop-over-headlines-in-active-region 'start-level)
+ 'region-start-level 'region))
+ org-loop-over-headlines-in-active-region)
(org-map-entries
- `(org-deadline ',remove ,time) org-loop-over-headlines-in-active-region 'region (if (outline-invisible-p) (org-end-of-subtree nil t))))
+ `(org-deadline ',remove ,time)
+ org-loop-over-headlines-in-active-region
+ cl (if (outline-invisible-p) (org-end-of-subtree nil t))))
(let* ((old-date (org-entry-get nil "DEADLINE"))
(repeater (and old-date
(string-match
@@ -11994,9 +12000,13 @@ With argument TIME, scheduled at the corresponding date. TIME can
either be an Org date like \"2011-07-24\" or a delta like \"+2d\"."
(interactive "P")
(if (and (org-region-active-p) org-loop-over-headlines-in-active-region)
- (let (org-loop-over-headlines-in-active-region)
+ (let ((cl (if (eq org-loop-over-headlines-in-active-region 'start-level)
+ 'region-start-level 'region))
+ org-loop-over-headlines-in-active-region)
(org-map-entries
- `(org-schedule ',remove ,time) org-loop-over-headlines-in-active-region 'region (if (outline-invisible-p) (org-end-of-subtree nil t))))
+ `(org-schedule ',remove ,time)
+ org-loop-over-headlines-in-active-region
+ cl (if (outline-invisible-p) (org-end-of-subtree nil t))))
(let* ((old-date (org-entry-get nil "SCHEDULED"))
(repeater (and old-date
(string-match