bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#30888: Allow searching compressed C sources for `find-function'


From: Felipe Ochoa
Subject: bug#30888: Allow searching compressed C sources for `find-function'
Date: Tue, 20 Mar 2018 16:40:50 -0500

This patch makes the handling of compressed sources consistent between C
functions and lisp functions (for which `find-function' already supports
compression).

>From 3fd28dd1682f9e7a723cc7cbaeaad10da63989cd Mon Sep 17 00:00:00 2001
From: Felipe Ochoa <felipe.nospam.ochoa@gmail.com>
Date: Tue, 20 Mar 2018 16:26:25 -0500
Subject: [PATCH] Allow searching compressed C sources for `find-function'

From: felipe <felipe@fov.space>

* emacs-lisp/find-func.el (find-function-C-source)
---
 lisp/emacs-lisp/find-func.el | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/lisp/emacs-lisp/find-func.el b/lisp/emacs-lisp/find-func.el
index 300bfab..cc1af01 100644
--- a/lisp/emacs-lisp/find-func.el
+++ b/lisp/emacs-lisp/find-func.el
@@ -243,14 +243,14 @@ find-function-advised-original
 (defun find-function-C-source (fun-or-var file type)
   "Find the source location where FUN-OR-VAR is defined in FILE.
 TYPE should be nil to find a function, or `defvar' to find a variable."
-  (let ((dir (or find-function-C-source-directory
-                 (read-directory-name "Emacs C source dir: " nil nil t))))
-    (setq file (expand-file-name file dir))
-    (if (file-readable-p file)
+  (let* ((dir (or find-function-C-source-directory
+                  (read-directory-name "Emacs C source dir: " nil nil t)))
+         (full-name (locate-file file (list dir) load-file-rep-suffixes)))
+    (if full-name
         (if (null find-function-C-source-directory)
             (setq find-function-C-source-directory dir))
-      (error "The C source file %s is not available"
-             (file-name-nondirectory file))))
+      (error "The C source file %s is not available" file))
+    (setq file full-name))
   (unless type
     ;; Either or both an alias and its target might be advised.
     (setq fun-or-var (find-function-advised-original
-- 
2.7.4








reply via email to

[Prev in Thread] Current Thread [Next in Thread]