all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#30888: Allow searching compressed C sources for `find-function'
@ 2018-03-20 21:40 Felipe Ochoa
  2019-06-24 18:50 ` Lars Ingebrigtsen
  0 siblings, 1 reply; 3+ messages in thread
From: Felipe Ochoa @ 2018-03-20 21:40 UTC (permalink / raw)
  To: 30888

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








^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2019-09-16 23:17 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-03-20 21:40 bug#30888: Allow searching compressed C sources for `find-function' Felipe Ochoa
2019-06-24 18:50 ` Lars Ingebrigtsen
2019-09-16 23:17   ` Lars Ingebrigtsen

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.