emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Nicolas Goaziou <mail@nicolasgoaziou.fr>
To: Mark Meyer <mark@ofosos.org>
Cc: emacs-orgmode <emacs-orgmode@gnu.org>
Subject: Re: Searching for a headline
Date: Sun, 26 Feb 2017 16:27:47 +0100	[thread overview]
Message-ID: <87efylt1jg.fsf@nicolasgoaziou.fr> (raw)
In-Reply-To: <fb9a22fd-3cd4-5648-2337-866d9934038b@ofosos.org> (Mark Meyer's message of "Sun, 26 Feb 2017 14:41:35 +0100")

Hello,

Mark Meyer <mark@ofosos.org> 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	other threads:[~2017-02-26 15:27 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-26 13:41 Searching for a headline Mark Meyer
2017-02-26 15:27 ` Nicolas Goaziou [this message]
2017-02-26 16:11   ` Mark Meyer
2017-02-26 16:39     ` Nicolas Goaziou
2017-02-26 16:58       ` Mark Meyer
2017-02-26 17:28         ` Nicolas Goaziou
2017-02-26 17:54           ` Mark Meyer
2017-02-26 18:12             ` Nicolas Goaziou
2017-02-26 18:21               ` Mark Meyer
2017-02-26 18:28                 ` Nicolas Goaziou
2017-02-26 18:30                   ` Mark Meyer
2017-02-26 21:46                   ` Mark Meyer
2017-02-26 19:32             ` Eric Abrahamsen
2017-02-26 20:40               ` Mark Meyer
2017-02-26 21:34                 ` Eric Abrahamsen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87efylt1jg.fsf@nicolasgoaziou.fr \
    --to=mail@nicolasgoaziou.fr \
    --cc=emacs-orgmode@gnu.org \
    --cc=mark@ofosos.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).