[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [O] How to identify all headings that won't be exported?
From: |
Thomas S. Dye |
Subject: |
Re: [O] How to identify all headings that won't be exported? |
Date: |
Thu, 26 Jun 2014 14:40:01 -1000 |
Aloha all,
Answering myself ...
address@hidden (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