emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Nicolas Goaziou <mail@nicolasgoaziou.fr>
To: "Nicolas Bercher (Aʟᴏɴɢ-Tʀᴀᴄᴋ)" <nbercher@along-track.com>
Cc: emacs-orgmode@gnu.org
Subject: Re: [IT] Broken support for links to text files (both internal & external)
Date: Tue, 09 Jan 2018 20:36:14 +0100	[thread overview]
Message-ID: <87lgh63jv5.fsf@nicolasgoaziou.fr> (raw)
In-Reply-To: <1cad6675-4cd6-d8fd-6b1c-0c94a9aa2890@along-track.com> (Nicolas Bercher's message of "Mon, 8 Jan 2018 18:56:47 +0100")

Hello,

"Nicolas Bercher (Aʟᴏɴɢ-Tʀᴀᴄᴋ)" <nbercher@along-track.com> writes:

> HOWEVER, in the case of links pointing to headlines, the matching to has
> to be EXACT (but it was not necessary in earlier version since 2011 at
> least) otherwise I get the message below:
>
>   "No match for fuzzy expression: <random text>"
>
> Do you know if I can revert some option to make the sample below to work
> again?

You cannot. This option somehow disappeared years ago.

Note that you can complete "[[*" with M-<TAB>, which can help a bit. If
the feature is considered useful anyway,
`org-link-search-must-match-exact-headline' is not the right way to
solve this. With this variable, that the same document can mean two
different things, which cripples portability.

For example, the following document

    * XX
    Contents 1
    * X
    Contents 2
    * Headline
    See [[*X]].

means two different things if you set
`org-link-search-must-match-exact-headline' to nil and I don't. 

Granted, you can use file local variables to fix a given value in the
document, but that doesn't sound right. Org format ought to be more
self-contained.

So, here's an idea. We could drop
`org-link-search-must-match-exact-headline' (the `query-to-create' value
could be handled in a dedicated variable) and introduce a new syntax for
regexp searches:

  [[?random words]] and [[*?random words]]

This way, where the link should point to is explicit.

The question about export is still open. [[*?random words]] targets
a headline it can be handled the usual way. However [[?random words]]
may target anything, including parts of the document that cannot be
referenced easily (e.g., comments, the contents of an example block...).

Another option is to keep only [[*?random words]] since we cannot handle
the other properly. Note that, even without this feature, you can still
use targets for specific locations in the buffer:

  Some <<here>>long text

  [[here]]

I have the feeling that a feature like [[?random words]] (and
`org-link-search-must-match-exact-headline') is going to bite us
someday.

WDYT?

Regards,

-- 
Nicolas Goaziou

  reply	other threads:[~2018-01-09 19:36 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-04 16:20 [IT] Broken support for links to text files (both internal & external) Nicolas Bercher (Aʟᴏɴɢ-Tʀᴀᴄᴋ)
2018-01-05  6:42 ` Eric S Fraga
2018-01-05  7:32 ` Nicolas Goaziou
2018-01-05 12:10   ` Nicolas Bercher (Aʟᴏɴɢ-Tʀᴀᴄᴋ)
2018-01-05 12:27     ` Eric S Fraga
2018-01-05 16:15       ` Nicolas Bercher (Aʟᴏɴɢ-Tʀᴀᴄᴋ)
2018-01-05 17:47         ` Eric S Fraga
2018-01-05 20:16         ` Tim Cross
2018-01-08 17:56         ` Nicolas Bercher (Aʟᴏɴɢ-Tʀᴀᴄᴋ)
2018-01-09 19:36           ` Nicolas Goaziou [this message]
2018-01-10  3:44             ` Samuel Wales
2018-01-10  3:46               ` Samuel Wales

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=87lgh63jv5.fsf@nicolasgoaziou.fr \
    --to=mail@nicolasgoaziou.fr \
    --cc=emacs-orgmode@gnu.org \
    --cc=nbercher@along-track.com \
    /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).