diff --git a/doc/org.texi b/doc/org.texi index e92788f47..81bff5ffa 100644 --- a/doc/org.texi +++ b/doc/org.texi @@ -3688,6 +3688,7 @@ entry referenced by the current line. @cindex completion, of links @cindex inserting links @vindex org-keep-stored-link-after-insertion +@vindex org-link-parameters Insert a link@footnote{Note that you don't have to use this command to insert a link. Links in Org are plain text, and you can type or paste them straight into the buffer. By using this command, the links are automatically @@ -3711,11 +3712,12 @@ them with @key{up} and @key{down} (or @kbd{M-p/n}). valid link prefixes like @samp{http:} or @samp{ftp:}, including the prefixes defined through link abbreviations (@pxref{Link abbreviations}). If you press @key{RET} after inserting only the @var{prefix}, Org will offer -specific completion support for some link types@footnote{This works by -calling a special function @code{org-PREFIX-complete-link}.} For -example, if you type @kbd{file @key{RET}}, file name completion (alternative -access: @kbd{C-u C-c C-l}, see below) will be offered, and after @kbd{bbdb -@key{RET}} you can complete contact names. +specific completion support for some link types@footnote{This works if +a completion function is defined in the @samp{:complete} property of a link +in @code{org-link-parameters}.} For example, if you type @kbd{file +@key{RET}}, file name completion (alternative access: @kbd{C-u C-c C-l}, see +below) will be offered, and after @kbd{bbdb @key{RET}} you can complete +contact names. @orgkey C-u C-c C-l @cindex file name completion @cindex completion, of file names @@ -3887,10 +3889,15 @@ can define them in the file with @noindent In-buffer completion (@pxref{Completion}) can be used after @samp{[} to -complete link abbreviations. You may also define a function -@code{org-PREFIX-complete-link} that implements special (e.g., completion) -support for inserting such a link with @kbd{C-c C-l}. Such a function should -not accept any arguments, and return the full link with prefix. +complete link abbreviations. You may also define a function that implements +special (e.g., completion) support for inserting such a link with @kbd{C-c +C-l}. Such a function should not accept any arguments, and return the full +link with prefix. You can add a completion function to a link like this: + +@lisp +(org-link-set-parameters ``type'' :complete #'some-function) +@end lisp + @node Search options @section Search options in file links @@ -18005,9 +18012,9 @@ the link description when the link is later inserted into an Org buffer with @kbd{C-c C-l}. When it makes sense for your new link type, you may also define a function -@code{org-PREFIX-complete-link} that implements special (e.g., completion) -support for inserting such a link with @kbd{C-c C-l}. Such a function should -not accept any arguments, and return the full link with prefix. +that implements special (e.g., completion) support for inserting such a link +with @kbd{C-c C-l}. Such a function should not accept any arguments, and +return the full link with prefix. @node Adding export back-ends @section Adding export back-ends