emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [O] Searching for a headline


From: Nicolas Goaziou
Subject: Re: [O] Searching for a headline
Date: Sun, 26 Feb 2017 16:27:47 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1 (gnu/linux)

Hello,

Mark Meyer <address@hidden> writes:

> I'm using org-publish-external-link to look up a the link target for a
> headline. The following code works, although I'd expect it to fail:
>
> (org-publish-resolve-external-link
>   (concat "* " (org-element-property :raw-value headline))
>   source-file)
>
> ``headline'' is a headline as returned by org-element, while
> ``source-file'' is a ``.org'' file.
>
> I'd expect that this needs to be
>
> (org-publish-resolve-external-link
>   (concat (make-string (org-element-property :level headline) ?*)
>    " " (org-element-property :raw-value headline))
>   source-file)
>
> I.e. for a level 3 headline it should be ``*** foobar'' and not ``*
> foobar''. ``org-publish-resolve-external-link'' uses
> ``org-export-string-to-search-cell'' internally.
>
> Can someone point me to some docuentation on how the searching works?

The first argument for `org-publish-external-link' is a so-called
"fuzzy" search string. In such a string "*whatever" is meant to match
a headline named "whatever", whatever its level is. IOW, the "*"
character denotes a headline, not a level.

Regards,

-- 
Nicolas Goaziou



reply via email to

[Prev in Thread] Current Thread [Next in Thread]