]> git.eshelyaron.com Git - emacs.git/commitdiff
Present C source files as absolute file names too when possible
authorDmitry Gutov <dgutov@yandex.ru>
Wed, 17 Feb 2021 23:41:03 +0000 (01:41 +0200)
committerDmitry Gutov <dgutov@yandex.ru>
Wed, 17 Feb 2021 23:41:03 +0000 (01:41 +0200)
* 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

index 312153052d693631b13e21b6be937cdd3ca90bfc..c14b18425f6b319102acfe28bb3bc3103f43608e 100644 (file)
@@ -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)