From: Dmitry Gutov Date: Sat, 25 May 2019 21:14:10 +0000 (+0300) Subject: Expand some xref documentation X-Git-Tag: emacs-27.0.90~2795 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=d0df779224f56eef777f6e75063e49bfb434f9e0;p=emacs.git Expand some xref documentation * lisp/progmodes/xref.el (xref-show-xrefs-function) (xref-show-definitions-function, xref--create-fetcher): Add or extend the docstring. --- diff --git a/lisp/progmodes/xref.el b/lisp/progmodes/xref.el index b7390aa7ba3..090618fa02f 100644 --- a/lisp/progmodes/xref.el +++ b/lisp/progmodes/xref.el @@ -834,10 +834,27 @@ Return an alist of the form ((FILENAME . (XREF ...)) ...)." (defvar xref-show-xrefs-function 'xref--show-xref-buffer - "Function to display a list of search results.") + "Function to display a list of search results. + +It should accept two arguments: FETCHER and ALIST. + +FETCHER is a function of no arguments that returns a list of xref +values. It must not depend on the current buffer or selected +window. + +ALIST will include the following keys: + +WINDOW for the window that was selected before the current +command was called. + +DISPLAY-ACTION indicates where the target location should be +displayed. The possible values are nil, `window' meaning the +other window, or `frame' meaning the other frame.") (defvar xref-show-definitions-function 'xref--show-defs-buffer - "Function to display a list of definitions.") + "Function to display a list of definitions. + +Accepts the same arguments as `xref-show-xrefs-function'.") (defvar xref--read-identifier-history nil) @@ -902,6 +919,10 @@ Return an alist of the form ((FILENAME . (XREF ...)) ...)." display-action)) (defun xref--create-fetcher (input kind arg) + "Return an xref list fetcher function. + +It revisits the saved position and delegates the finding logic to +the xref backend method indicated by KIND and passes ARG to it." (let* ((orig-buffer (current-buffer)) (orig-position (point)) (backend (xref-find-backend))