[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: `C-h f' doesn't show file where function comes from
From: |
Katsumi Yamaoka |
Subject: |
Re: `C-h f' doesn't show file where function comes from |
Date: |
Mon, 08 Sep 2008 09:13:30 +0900 |
User-agent: |
Gnus/5.110011 (No Gnus v0.11) Emacs/23.0.60 (gnu/linux) |
>>>>> martin rudalics wrote:
> It _may_ relate to where you install Emacs.
I found out the cause of the problem. It relates to whether
Emacs is installed or not. That `Emacs is *not* installed' means
that a user built Emacs in the source tree and uses it there.
In that case all the .el files are not gzipped.
> The behavior you observe might be related to my recent changes. Could
> you please try to edebug the function `find-lisp-object-file-name' in
> help-fns.el and find out why it fails to return an absolute filename for
> your settings.
With Emacs that is started with `emacs -Q -l wid-edit', the form
(find-lisp-object-file-name 'widget-button-press
(symbol-function 'widget-button-press))
returns nil, even though the result of the form
(symbol-function 'widget-button-press) contains the real .elc file
name:
#[(pos &optional event)
("/usr/local/share/emacs/23.0.60/lisp/wid-edit.elc" . 29635)
nil 4
("/usr/local/share/emacs/23.0.60/lisp/wid-edit.elc" . 29551) "@d"]
In my case the source file is:
/usr/local/share/emacs/23.0.60/lisp/wid-edit.el.gz
Gzipping .el files is done by default when installing Emacs.
However, `find-lisp-object-file-name' looks for only wid-edit.el.
Here is a patch:
--8<---------------cut here---------------start------------->8---
--- help-fns.el~ 2008-09-01 21:41:33 +0000
+++ help-fns.el 2008-09-08 00:01:27 +0000
@@ -295,7 +295,9 @@
;; When the Elisp source file can be found in the install
;; directory return the name of that file - `file-name' should
;; have become an absolute file name ny now.
- (and (file-readable-p lib-name) lib-name)))
+ (or (and (file-readable-p lib-name) lib-name)
+ (and (file-readable-p (concat lib-name ".gz"))
+ (concat lib-name ".gz")))))
((let* ((lib-name (file-name-nondirectory file-name))
;; The next form is from `describe-simplify-lib-file-name'.
(file-name
--8<---------------cut here---------------end--------------->8---
With this patch `C-h f widget-button-press RET' shows the file
name properly as follows:
--8<---------------cut here---------------start------------->8---
widget-button-press is an interactive compiled Lisp function in
`/local/share/emacs/23.0.60/lisp/wid-edit.el.gz'.
(widget-button-press pos &optional event)
Invoke button at pos.
[back]
--8<---------------cut here---------------end--------------->8---
The newlines under the file name seem to be too many, though.
Regards,
- `C-h f' doesn't show file where function comes from, Katsumi Yamaoka, 2008/09/04
- Re: `C-h f' doesn't show file where function comes from, Francis Litterio, 2008/09/04
- Re: `C-h f' doesn't show file where function comes from, martin rudalics, 2008/09/05
- Re: `C-h f' doesn't show file where function comes from, Katsumi Yamaoka, 2008/09/05
- Re: `C-h f' doesn't show file where function comes from, martin rudalics, 2008/09/05
- Re: `C-h f' doesn't show file where function comes from, Katsumi Yamaoka, 2008/09/05
- Re: `C-h f' doesn't show file where function comes from, martin rudalics, 2008/09/06
- Re: `C-h f' doesn't show file where function comes from,
Katsumi Yamaoka <=
- Re: `C-h f' doesn't show file where function comes from, Katsumi Yamaoka, 2008/09/07
- Re: `C-h f' doesn't show file where function comes from, martin rudalics, 2008/09/08
- Re: `C-h f' doesn't show file where function comes from, martin rudalics, 2008/09/08
- Re: `C-h f' doesn't show file where function comes from, Katsumi Yamaoka, 2008/09/08