From d0df779224f56eef777f6e75063e49bfb434f9e0 Mon Sep 17 00:00:00 2001 From: Dmitry Gutov Date: Sun, 26 May 2019 00:14:10 +0300 Subject: [PATCH] Expand some xref documentation * lisp/progmodes/xref.el (xref-show-xrefs-function) (xref-show-definitions-function, xref--create-fetcher): Add or extend the docstring. --- lisp/progmodes/xref.el | 25 +++++++++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) 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)) -- 2.39.2