From 3fe2fb5794715b075fc1dd6d5d84bf10eae24c73 Mon Sep 17 00:00:00 2001 From: Dmitry Gutov Date: Thu, 18 Feb 2021 01:41:03 +0200 Subject: [PATCH] Present C source files as absolute file names too when possible * lisp/progmodes/elisp-mode.el (xref-location-group): Present C source files as absolute file names too when possible (bug#46514). --- lisp/progmodes/elisp-mode.el | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/lisp/progmodes/elisp-mode.el b/lisp/progmodes/elisp-mode.el index 312153052d6..c14b18425f6 100644 --- a/lisp/progmodes/elisp-mode.el +++ b/lisp/progmodes/elisp-mode.el @@ -904,7 +904,13 @@ non-nil result supersedes the xrefs produced by (point-marker))))))) (cl-defmethod xref-location-group ((l xref-elisp-location)) - (xref-elisp-location-file l)) + (let ((file (xref-elisp-location-file l))) + (defvar find-function-C-source-directory) + (if (and find-function-C-source-directory + (string-match-p "\\`src/" file)) + (concat find-function-C-source-directory + (substring file 3)) + file))) (defun elisp-load-path-roots () (if (boundp 'package-user-dir) -- 2.39.2