[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Completion mechanism for headlines when creating a link between 2 Or
From: |
Ihor Radchenko |
Subject: |
Re: Completion mechanism for headlines when creating a link between 2 Org files? |
Date: |
Mon, 04 Sep 2023 08:14:44 +0000 |
Alain.Cochard@unistra.fr writes:
> C-c C-l (org-insert-link)
>
> [...]
>
> Completion support
>
> Completion with TAB helps you to insert valid link prefixes
> like ‘http’ or ‘ftp’, including the prefixes defined
> through link abbreviations (see Link Abbreviations). If you
> press RET after inserting only the prefix, Org offers
> specific completion support for some link types.
>
> but, after I complete for a given file, I cannot find a way to further
> complete for a specific (sub)headline. Is there a way that I missed,
> even after searching the Internet a bit?
You would need to extend the default file: link completion function -
`org-link-complete-file'.
You can override it with any custom function:
(org-link-set-parameters "file" :complete #'your-custom-completion-function)
> If not, I am making it a feature request. Indeed it would be great,
> especially if one does not really remember where, in a (known) file,
> the headline is, nor --even more importantly-- what its name exactly
> is.
>
> (In my naive view, as the completion mechanism already exists for
> internal files, it should be easy to extend it for external files...)
It is, although even more common request is simply inserting a link to a
heading in _a_ file (not known).
--
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>