瀏覽代碼

Update the texinfo for link parameters documentation

John Kitchin 8 年之前
父節點
當前提交
4e42012090
共有 1 個文件被更改,包括 19 次插入12 次删除
  1. 19 12
      doc/org.texi

+ 19 - 12
doc/org.texi

@@ -3688,6 +3688,7 @@ entry referenced by the current line.
 @cindex completion, of links
 @cindex completion, of links
 @cindex inserting links
 @cindex inserting links
 @vindex org-keep-stored-link-after-insertion
 @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@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
 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
 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
 valid link prefixes like @samp{http:} or @samp{ftp:}, including the prefixes
 defined through link abbreviations (@pxref{Link abbreviations}).  If you
 defined through link abbreviations (@pxref{Link abbreviations}).  If you
 press @key{RET} after inserting only the @var{prefix}, Org will offer
 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
 @orgkey C-u C-c C-l
 @cindex file name completion
 @cindex file name completion
 @cindex completion, of file names
 @cindex completion, of file names
@@ -3887,10 +3889,15 @@ can define them in the file with
 
 
 @noindent
 @noindent
 In-buffer completion (@pxref{Completion}) can be used after @samp{[} to
 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
 @node Search options
 @section Search options in file links
 @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}.
 buffer with @kbd{C-c C-l}.
 
 
 When it makes sense for your new link type, you may also define a function
 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
 @node Adding export back-ends
 @section Adding export back-ends
 @section Adding export back-ends