forked from mirrors/org-mode
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'.
This commit is contained in:
parent
79bf3ed861
commit
72915f1c52
30
lisp/org.el
30
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
|
matching headlines within the active region. Such string must be
|
||||||
a tags/property/todo match as it is used in the agenda tags view.
|
a tags/property/todo match as it is used in the agenda tags view.
|
||||||
|
|
||||||
The list of commands is:
|
The list of commands is: `org-schedule', `org-deadline',
|
||||||
- `org-schedule'
|
`org-todo', `org-archive-subtree', `org-archive-set-tag' and
|
||||||
- `org-deadline'"
|
`org-archive-to-archive-sibling'. The archiving commands skip
|
||||||
|
already archived entries."
|
||||||
:type '(choice (const :tag "Don't loop" nil)
|
:type '(choice (const :tag "Don't loop" nil)
|
||||||
(const :tag "All headlines in active region" t)
|
(const :tag "All headlines in active region" t)
|
||||||
(const :tag "In active region, headlines at the same level than the first one" 'start-level)
|
(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'."
|
really is a member of `org-todo-keywords'."
|
||||||
(interactive "P")
|
(interactive "P")
|
||||||
(if (and (org-region-active-p) org-loop-over-headlines-in-active-region)
|
(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-map-entries
|
||||||
`(org-todo ,arg)
|
`(org-todo ,arg)
|
||||||
org-loop-over-headlines-in-active-region
|
org-loop-over-headlines-in-active-region
|
||||||
'region
|
cl (if (outline-invisible-p) (org-end-of-subtree nil t))))
|
||||||
(if (outline-invisible-p) (org-end-of-subtree nil t))))
|
|
||||||
(if (equal arg '(16)) (setq arg 'nextset))
|
(if (equal arg '(16)) (setq arg 'nextset))
|
||||||
(let ((org-blocker-hook org-blocker-hook)
|
(let ((org-blocker-hook org-blocker-hook)
|
||||||
(case-fold-search nil))
|
(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\"."
|
can either be an Org date like \"2011-07-24\" or a delta like \"+2d\"."
|
||||||
(interactive "P")
|
(interactive "P")
|
||||||
(if (and (org-region-active-p) org-loop-over-headlines-in-active-region)
|
(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-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"))
|
(let* ((old-date (org-entry-get nil "DEADLINE"))
|
||||||
(repeater (and old-date
|
(repeater (and old-date
|
||||||
(string-match
|
(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\"."
|
either be an Org date like \"2011-07-24\" or a delta like \"+2d\"."
|
||||||
(interactive "P")
|
(interactive "P")
|
||||||
(if (and (org-region-active-p) org-loop-over-headlines-in-active-region)
|
(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-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"))
|
(let* ((old-date (org-entry-get nil "SCHEDULED"))
|
||||||
(repeater (and old-date
|
(repeater (and old-date
|
||||||
(string-match
|
(string-match
|
||||||
|
|
Loading…
Reference in New Issue