Aloha all,

Answering myself ...

t...@tsdye.com (Thomas S. Dye) writes:

> Is there a practical way to identify descendants for my use
> case? 
>
>   (defun tsd-get-names-labels-and-headings ()
>     (interactive)
>     (save-excursion
>       (goto-char (point-min))
>       (let ((matches))
>         (while
>             (re-search-forward "\\#\\+\\(name\\|label\\):\\s-\\(.*\\)" 
> (point-max) t)
>           (add-to-list 'matches (match-string-no-properties 2) t))
>         (dolist (heading (org-map-entries 'org-heading-components))
>           (when (and (nth 4 heading) (not (search "noexport"(nth 5 heading))))
>             (add-to-list 'matches (nth 4 heading))))
>         (dolist (properties (org-map-entries 'org-entry-properties))
>           (when (cdr (assoc "CUSTOM_ID" properties))
>             (add-to-list 'matches
>                          (format "#%s" (cdr (assoc "CUSTOM_ID" 
> properties))))))
>         (sort matches 'string<))))

Yes, use the MATCH argument to org-map-entries.

Many thanks to Jonathan Leech-Pepin for pointing this out to me off
list.

All the best,
Tom

-- 
Thomas S. Dye
http://www.tsdye.com

Reply via email to