|
@@ -9964,6 +9964,10 @@ ACTION can be `set', `up', `down', or a character."
|
|
|
;;;; Tags
|
|
|
|
|
|
(defvar org-agenda-archives-mode)
|
|
|
+(defvar org-map-continue-from nil
|
|
|
+ "Position from where mapping should continue.
|
|
|
+Can be set byt the action argument to `org-scan-tag's and `org-map-entries'.")
|
|
|
+
|
|
|
(defvar org-scanner-tags nil
|
|
|
"The current tag list while the tags scanner is running.")
|
|
|
(defvar org-trust-scanner-tags nil
|
|
@@ -10006,6 +10010,7 @@ only lines with a TODO keyword are included in the output."
|
|
|
(or (buffer-file-name (buffer-base-buffer))
|
|
|
(buffer-name (buffer-base-buffer)))))))
|
|
|
(case-fold-search nil)
|
|
|
+ (org-map-continue-from nil)
|
|
|
lspos tags tags-list
|
|
|
(tags-alist (list (cons 0 org-file-tags)))
|
|
|
(llast 0) rtn rtn1 level category i txt
|
|
@@ -10093,15 +10098,20 @@ only lines with a TODO keyword are included in the output."
|
|
|
'priority priority 'type "tagsmatch")
|
|
|
(push txt rtn))
|
|
|
((functionp action)
|
|
|
+ (setq org-map-continue-from nil)
|
|
|
(save-excursion
|
|
|
(setq rtn1 (funcall action))
|
|
|
- (push rtn1 rtn))
|
|
|
- (goto-char (point-at-eol)))
|
|
|
+ (push rtn1 rtn)))
|
|
|
(t (error "Invalid action")))
|
|
|
|
|
|
;; if we are to skip sublevels, jump to end of subtree
|
|
|
- (or org-tags-match-list-sublevels (org-end-of-subtree t))))
|
|
|
- (and (= (point) lspos) (forward-char 1))))
|
|
|
+ (unless org-tags-match-list-sublevels
|
|
|
+ (org-end-of-subtree t)
|
|
|
+ (backward-char 1))))
|
|
|
+ ;; Get the correct position from where to continue
|
|
|
+ (if org-map-continue-from
|
|
|
+ (goto-char org-map-continue-from)
|
|
|
+ (and (= (point) lspos) (end-of-line 1)))))
|
|
|
(when (and (eq action 'sparse-tree)
|
|
|
(not org-sparse-tree-open-archived-trees))
|
|
|
(org-hide-archived-subtrees (point-min) (point-max)))
|
|
@@ -10869,7 +10879,18 @@ Returns the new tags string, or nil to not change the current settings."
|
|
|
FUNC is a function or a lisp form. The function will be called without
|
|
|
arguments, with the cursor positioned at the beginning of the headline.
|
|
|
The return values of all calls to the function will be collected and
|
|
|
-returned as a list.
|
|
|
+returned as a list.
|
|
|
+
|
|
|
+The call to FUNC will be wrapped into a save-excursion form, so FUNC
|
|
|
+does not need to preserve point. After evaluaton, the cursor will be
|
|
|
+moved to the end of the line (presumably of the headline of the
|
|
|
+processed entry) and search continues from there. Under some
|
|
|
+circumstances, this may not produce the wanted results. For example,
|
|
|
+if you have removed (e.g. archived) the current (sub)tree it could
|
|
|
+mean that the next entry will be skipped entirely. In such cases, you
|
|
|
+can specify the position from where search should continue by making
|
|
|
+FUNC set the variable `org-map-continue-from' to the desired buffer
|
|
|
+position.
|
|
|
|
|
|
MATCH is a tags/property/todo match as it is used in the agenda tags view.
|
|
|
Only headlines that are matched by this query will be considered during
|