unofficial mirror of bug-gnu-emacs@gnu.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

* bug#30888: Allow searching compressed C sources for `find-function'
  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
  0 siblings, 1 reply; 3+ messages in thread
From: Lars Ingebrigtsen @ 2019-06-24 18:50 UTC (permalink / raw)
  To: Felipe Ochoa; +Cc: 30888

Felipe Ochoa <felipe.nospam.ochoa@gmail.com> writes:

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

I guess that makes sense, and the implementation looks OK to me, but
what's the use case?  The reason `find-function' does look into .el.gz
files is that on some (many?) distributions, the .el files in Emacs are
distributed with Emacs (sometimes in a separate package), but in .gz
form.

I've never seen gzipped .c files in the wild -- is that something that's
done?

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no





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

* bug#30888: Allow searching compressed C sources for `find-function'
  2019-06-24 18:50 ` Lars Ingebrigtsen
@ 2019-09-16 23:17   ` Lars Ingebrigtsen
  0 siblings, 0 replies; 3+ messages in thread
From: Lars Ingebrigtsen @ 2019-09-16 23:17 UTC (permalink / raw)
  To: Felipe Ochoa; +Cc: 30888

Lars Ingebrigtsen <larsi@gnus.org> writes:

> Felipe Ochoa <felipe.nospam.ochoa@gmail.com> writes:
>
>> This patch makes the handling of compressed sources consistent between C
>> functions and lisp functions (for which `find-function' already supports
>> compression).
>
> I guess that makes sense, and the implementation looks OK to me, but
> what's the use case?  The reason `find-function' does look into .el.gz
> files is that on some (many?) distributions, the .el files in Emacs are
> distributed with Emacs (sometimes in a separate package), but in .gz
> form.
>
> I've never seen gzipped .c files in the wild -- is that something that's
> done?

There was no response (on the use case) in 12 weeks, so I'm closing this
bug report.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no





^ permalink raw reply	[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 public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).