[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] master d0df779 1/2: Expand some xref documentation
From: |
Dmitry Gutov |
Subject: |
[Emacs-diffs] master d0df779 1/2: Expand some xref documentation |
Date: |
Sat, 25 May 2019 17:19:41 -0400 (EDT) |
branch: master
commit d0df779224f56eef777f6e75063e49bfb434f9e0
Author: Dmitry Gutov <address@hidden>
Commit: Dmitry Gutov <address@hidden>
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 b7390aa..090618f 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))