From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nicolas Goaziou Subject: Re: Searching for a headline Date: Sun, 26 Feb 2017 16:27:47 +0100 Message-ID: <87efylt1jg.fsf@nicolasgoaziou.fr> References: Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:33627) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ci0jq-0007Cs-1x for emacs-orgmode@gnu.org; Sun, 26 Feb 2017 10:27:55 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ci0jm-0002Sd-Py for emacs-orgmode@gnu.org; Sun, 26 Feb 2017 10:27:54 -0500 Received: from relay3-d.mail.gandi.net ([217.70.183.195]:33647) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1ci0jm-0002SF-JD for emacs-orgmode@gnu.org; Sun, 26 Feb 2017 10:27:50 -0500 In-Reply-To: (Mark Meyer's message of "Sun, 26 Feb 2017 14:41:35 +0100") List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: "Emacs-orgmode" To: Mark Meyer Cc: emacs-orgmode Hello, Mark Meyer 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