Nick Dokos <nicholas.do...@hp.com> writes:

> The problem is that org-entry-get does not just look forward: it looks
> *around* and finds the property when point is both at the beginning
> and at the end of the headline "Four", so you get "four" twice.

Ah, so that's the culprit.  Thanks!

> Maybe this?
>
> #+BEGIN_SRC emacs-lisp
>   (defun get-export-filenames ()
>     (interactive)
>     (setq export-files '())
>     (progn
>       (org-map-entries
>        (lambda ()
>          (setq org-map-continue-from (outline-next-heading))
>          (if org-map-continue-from
>              (let ((org-trust-scanner-tags t))
>                (push (org-entry-get (point) "EXPORT_FILE_NAME") 
> export-files))))
>          nil 'tree)
>        (message export-files))) ; errors, but lets me see the list of 
> collected values
>   
> #+END_SRC

Indeed, that does seem to work: outline-next-heading returns nil if it
doesn't find a next heading, and a buffer location otherwise (at least
that's the way it looks based on some tests; the documentation doesn't
say, and I didn't crack open the code).  So wrapping the rest of the
lambda body in (if org-map-continue-from ...) prevents it from executing
that one last time.

Thanks for your help, Nick!

Best,
Richard


_______________________________________________
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode

Reply via email to