* symbol-file
@ 2008-08-14 13:20 martin rudalics
2008-08-14 13:32 ` symbol-file Lennart Borgman (gmail)
0 siblings, 1 reply; 3+ messages in thread
From: martin rudalics @ 2008-08-14 13:20 UTC (permalink / raw)
To: emacs-devel
(symbol-file 'ediff-directories 'defun)
currently returns "ediff" which contradicts the doc-string saying
The value is an absolute file name.
It can also be nil, if the definition is not associated with any file.
I suggest we'd either fix the doc-string appropriately or return
(locate-file (nth 1 (symbol-function symbol)) load-path '(".el" ".elc"))
in the autoload case.
martin
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: symbol-file
2008-08-14 13:20 symbol-file martin rudalics
@ 2008-08-14 13:32 ` Lennart Borgman (gmail)
2008-08-14 14:24 ` symbol-file martin rudalics
0 siblings, 1 reply; 3+ messages in thread
From: Lennart Borgman (gmail) @ 2008-08-14 13:32 UTC (permalink / raw)
To: martin rudalics; +Cc: emacs-devel
martin rudalics wrote:
> (symbol-file 'ediff-directories 'defun)
>
> currently returns "ediff" which contradicts the doc-string saying
>
> The value is an absolute file name.
> It can also be nil, if the definition is not associated with any file.
>
> I suggest we'd either fix the doc-string appropriately or return
>
> (locate-file (nth 1 (symbol-function symbol)) load-path '(".el" ".elc"))
>
> in the autoload case.
I think it would be best to return the absolute file name and then have
a separate function file-name-in-load-path that just gives for example
"ediff.el". The second function can then be used by the help functions
to display the file name.
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: symbol-file
2008-08-14 13:32 ` symbol-file Lennart Borgman (gmail)
@ 2008-08-14 14:24 ` martin rudalics
0 siblings, 0 replies; 3+ messages in thread
From: martin rudalics @ 2008-08-14 14:24 UTC (permalink / raw)
To: Lennart Borgman (gmail); +Cc: emacs-devel
> I think it would be best to return the absolute file name and then have
> a separate function file-name-in-load-path that just gives for example
> "ediff.el". The second function can then be used by the help functions
> to display the file name.
We could use the
(find-function-search-for-symbol function nil "loaddefs.el")
approach and search for "^;;; Generated autoloads from \\(.*\\)" just as
`describe-function-1' does. I'm not sure whether this would break other
applications using `symbol-file' though. WOW, I don't know whether it's
intended to, for example, pass the result of `symbol-file' to `load' and
expect the later to DTRT with it.
BTW, you can see the current approach in action by doing
(describe-function 'ediff-directories)
which gives
ediff-directories is an interactive autoloaded Lisp function in `ediff'.
where `ediff' is just the "file name string" `load' would use but
certainly not a file name.
martin
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2008-08-14 14:24 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-08-14 13:20 symbol-file martin rudalics
2008-08-14 13:32 ` symbol-file Lennart Borgman (gmail)
2008-08-14 14:24 ` symbol-file martin rudalics
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.