GNU bug report logs -
#669
23.0.60; defalias is not taken into account by C-h k
Previous Next
To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 669 in the body.
You can then email your comments to 669 AT debbugs.gnu.org in the normal way.
Toggle the display of automated, internal messages from the tracker.
Report forwarded to
bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>
:
bug#669
; Package
emacs
.
Full text and
rfc822 format available.
Acknowledgement sent to
"Drew Adams" <drew.adams <at> oracle.com>
:
New bug report received and forwarded. Copy sent to
Emacs Bugs <bug-gnu-emacs <at> gnu.org>
.
Full text and
rfc822 format available.
Message #5 received at submit <at> emacsbugs.donarmstrong.com (full text, mbox):
emacs -Q
(defun foo (&optional predicate)
"" (interactive) (message "FOO"))
(defalias 'lisp-complete-symbol (symbol-function 'foo))
C-h k then shows this, which is 100% wrong:
M-TAB (translated from <escape> <tab>) runs the command
lisp-complete-symbol, which is an interactive Lisp function in
`lisp.el'.
It is bound to M-TAB.
(lisp-complete-symbol &optional predicate)
In GNU Emacs 23.0.60.1 (i386-mingw-nt5.1.2600)
of 2008-08-01 on LENNART-69DE564
Windowing system distributor `Microsoft Corp.', version 5.1.2600
configured using `configure --with-gcc (3.4) --no-opt --cflags -Ic:/g/include
-fno-crossjumping'
Important settings:
value of $LC_ALL: nil
value of $LC_COLLATE: nil
value of $LC_CTYPE: nil
value of $LC_MESSAGES: nil
value of $LC_MONETARY: nil
value of $LC_NUMERIC: nil
value of $LC_TIME: nil
value of $LANG: ENU
value of $XMODIFIERS: nil
locale-coding-system: cp1252
default-enable-multibyte-characters: t
Major mode: Emacs-Lisp
Minor modes in effect:
tooltip-mode: t
tool-bar-mode: t
mouse-wheel-mode: t
menu-bar-mode: t
file-name-shadow-mode: t
global-font-lock-mode: t
font-lock-mode: t
blink-cursor-mode: t
global-auto-composition-mode: t
auto-composition-mode: t
auto-encryption-mode: t
auto-compression-mode: t
line-number-mode: t
transient-mark-mode: t
Recent input:
<help-echo> C-x C-f t h r o w - r r r r . e l <return>
<down-mouse-1> <mouse-1> ( d e f u n SPC f o o SPC
( <backspace> <backspace> <backspace> <backspace> <backspace>
<backspace> <backspace> <backspace> <backspace> <backspace>
<backspace> <backspace> <help-echo> C-h f l i s p -
<backspace> <backspace> <backspace> <backspace> <backspace>
<help-echo> <help-echo> l i s p - c o m p l e t e -
s y m b o l <return> <help-echo> <help-echo> <help-echo>
Information forwarded to
bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>
:
bug#669
; Package
emacs
.
Full text and
rfc822 format available.
Acknowledgement sent to
"Drew Adams" <drew.adams <at> ORACLE.COM>
:
Extra info received and forwarded to list. Copy sent to
Emacs Bugs <bug-gnu-emacs <at> gnu.org>
.
Full text and
rfc822 format available.
Message #10 received at submit <at> emacsbugs.donarmstrong.com (full text, mbox):
If you use (defalias 'lisp-complete-symbol 'foo) instead, then this is output:
M-TAB (translated from <escape> <tab>) runs the command
lisp-complete-symbol, which is an alias for `foo' in `lisp.el'.
It is bound to M-TAB.
(lisp-complete-symbol &optional predicate)
This is still wrong, because `foo' is not in `lisp.el' (and the defalias is not
in `lisp.el').
This bug appears as far back as Emacs 20.7.
> From: Drew Adams Sent: Thursday, August 07, 2008 11:23 AM
> emacs -Q
>
> (defun foo (&optional predicate)
> "" (interactive) (message "FOO"))
>
> (defalias 'lisp-complete-symbol (symbol-function 'foo))
>
> C-h k then shows this, which is 100% wrong:
>
> M-TAB (translated from <escape> <tab>) runs the command
> lisp-complete-symbol, which is an interactive Lisp function in
> `lisp.el'.
>
> It is bound to M-TAB.
>
> (lisp-complete-symbol &optional predicate)
>
>
>
> In GNU Emacs 23.0.60.1 (i386-mingw-nt5.1.2600)
> of 2008-08-01 on LENNART-69DE564
> Windowing system distributor `Microsoft Corp.', version 5.1.2600
> configured using `configure --with-gcc (3.4) --no-opt
> --cflags -Ic:/g/include
> -fno-crossjumping'
>
> Important settings:
> value of $LC_ALL: nil
> value of $LC_COLLATE: nil
> value of $LC_CTYPE: nil
> value of $LC_MESSAGES: nil
> value of $LC_MONETARY: nil
> value of $LC_NUMERIC: nil
> value of $LC_TIME: nil
> value of $LANG: ENU
> value of $XMODIFIERS: nil
> locale-coding-system: cp1252
> default-enable-multibyte-characters: t
>
> Major mode: Emacs-Lisp
>
> Minor modes in effect:
> tooltip-mode: t
> tool-bar-mode: t
> mouse-wheel-mode: t
> menu-bar-mode: t
> file-name-shadow-mode: t
> global-font-lock-mode: t
> font-lock-mode: t
> blink-cursor-mode: t
> global-auto-composition-mode: t
> auto-composition-mode: t
> auto-encryption-mode: t
> auto-compression-mode: t
> line-number-mode: t
> transient-mark-mode: t
>
> Recent input:
> <help-echo> C-x C-f t h r o w - r r r r . e l <return>
> <down-mouse-1> <mouse-1> ( d e f u n SPC f o o SPC
> ( <backspace> <backspace> <backspace> <backspace> <backspace>
> <backspace> <backspace> <backspace> <backspace> <backspace>
> <backspace> <backspace> <help-echo> C-h f l i s p -
> <backspace> <backspace> <backspace> <backspace> <backspace>
> <help-echo> <help-echo> l i s p - c o m p l e t e -
> s y m b o l <return> <help-echo> <help-echo> <help-echo>
>
>
>
>
>
>
>
Information forwarded to
bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>
:
bug#669
; Package
emacs
.
Full text and
rfc822 format available.
Acknowledgement sent to
"Drew Adams" <drew.adams <at> ORACLE.COM>
:
Extra info received and forwarded to list. Copy sent to
Emacs Bugs <bug-gnu-emacs <at> gnu.org>
.
Full text and
rfc822 format available.
Information forwarded to
bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>
:
bug#669
; Package
emacs
.
Full text and
rfc822 format available.
Acknowledgement sent to
martin rudalics <rudalics <at> gmx.at>
:
Extra info received and forwarded to list. Copy sent to
Emacs Bugs <bug-gnu-emacs <at> gnu.org>
.
Full text and
rfc822 format available.
Message #20 received at 669 <at> emacsbugs.donarmstrong.com (full text, mbox):
> If you use (defalias 'lisp-complete-symbol 'foo) instead, then this is output:
>
> M-TAB (translated from <escape> <tab>) runs the command
> lisp-complete-symbol, which is an alias for `foo' in `lisp.el'.
>
> It is bound to M-TAB.
>
> (lisp-complete-symbol &optional predicate)
>
> This is still wrong, because `foo' is not in `lisp.el' (and the defalias is not
> in `lisp.el').
>
> This bug appears as far back as Emacs 20.7.
>
>
>> From: Drew Adams Sent: Thursday, August 07, 2008 11:23 AM
>> emacs -Q
>>
>> (defun foo (&optional predicate)
>> "" (interactive) (message "FOO"))
>>
>> (defalias 'lisp-complete-symbol (symbol-function 'foo))
>>
>> C-h k then shows this, which is 100% wrong:
>>
>> M-TAB (translated from <escape> <tab>) runs the command
>> lisp-complete-symbol, which is an interactive Lisp function in
>> `lisp.el'.
>>
>> It is bound to M-TAB.
>>
>> (lisp-complete-symbol &optional predicate)
I'm currently rewriting help-fns.el and can produce
M-TAB (translated from <escape> <tab>) runs the command
lisp-complete-symbol, which is an interactive Lisp function.
It is bound to M-TAB, <menu-bar> <lisp-interaction>
<lisp-complete-symbol>, H-SPC.
(lisp-complete-symbol &optional predicate)
and
M-TAB (translated from <escape> <tab>) runs the command
lisp-complete-symbol, which is an alias for `foo'.
It is bound to M-TAB, <menu-bar> <lisp-interaction>
<lisp-complete-symbol>, H-SPC.
(lisp-complete-symbol &optional predicate)
Are these acceptable?
martin
Information forwarded to
bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>
:
bug#669
; Package
emacs
.
Full text and
rfc822 format available.
Acknowledgement sent to
"Drew Adams" <drew.adams <at> oracle.com>
:
Extra info received and forwarded to list. Copy sent to
Emacs Bugs <bug-gnu-emacs <at> gnu.org>
.
Full text and
rfc822 format available.
Message #25 received at 669 <at> emacsbugs.donarmstrong.com (full text, mbox):
> > If you use (defalias 'lisp-complete-symbol 'foo) instead,
> > then this is output:
> >
> > M-TAB (translated from <escape> <tab>) runs the command
> > lisp-complete-symbol, which is an alias for `foo' in `lisp.el'.
> >
> > It is bound to M-TAB.
> >
> > (lisp-complete-symbol &optional predicate)
> >
> > This is still wrong, because `foo' is not in `lisp.el'
> > (and the defalias is not in `lisp.el').
> >
> > This bug appears as far back as Emacs 20.7.
> >
> >
> >> From: Drew Adams Sent: Thursday, August 07, 2008 11:23 AM
> >> emacs -Q
> >>
> >> (defun foo (&optional predicate)
> >> "" (interactive) (message "FOO"))
> >>
> >> (defalias 'lisp-complete-symbol (symbol-function 'foo))
> >>
> >> C-h k then shows this, which is 100% wrong:
> >>
> >> M-TAB (translated from <escape> <tab>) runs the command
> >> lisp-complete-symbol, which is an interactive Lisp function in
> >> `lisp.el'.
> >>
> >> It is bound to M-TAB.
> >>
> >> (lisp-complete-symbol &optional predicate)
>
> I'm currently rewriting help-fns.el and can produce
>
> M-TAB (translated from <escape> <tab>) runs the command
> lisp-complete-symbol, which is an interactive Lisp function.
>
> It is bound to M-TAB, <menu-bar> <lisp-interaction>
> <lisp-complete-symbol>, H-SPC.
>
> (lisp-complete-symbol &optional predicate)
>
> and
>
> M-TAB (translated from <escape> <tab>) runs the command
> lisp-complete-symbol, which is an alias for `foo'.
>
> It is bound to M-TAB, <menu-bar> <lisp-interaction>
> <lisp-complete-symbol>, H-SPC.
>
> (lisp-complete-symbol &optional predicate)
>
> Are these acceptable?
Hi Martin,
Thanks for working on this.
Not completely fixed yet, because it doesn't say anything about where `foo' is
defined (assuming it is defined in a file somewhere). If you could add that,
that would be great. The point is that we do want to send the user to the source
code, but not to the original `lisp-complete-symbol' source code.
We also need to be sure that the `foo' doc string is used. In my test example I
omitted that.
And both of these cases need to be treated:
(defalias 'lisp-complete-symbol 'foo)
(defalias 'lisp-complete-symbol (symbol-function 'foo))
Thx - Drew
Information forwarded to
bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>
:
bug#669
; Package
emacs
.
Full text and
rfc822 format available.
Acknowledgement sent to
martin rudalics <rudalics <at> gmx.at>
:
Extra info received and forwarded to list. Copy sent to
Emacs Bugs <bug-gnu-emacs <at> gnu.org>
.
Full text and
rfc822 format available.
Message #30 received at 669 <at> emacsbugs.donarmstrong.com (full text, mbox):
> Not completely fixed yet, because it doesn't say anything about where `foo' is
> defined (assuming it is defined in a file somewhere).
If it is "defined in a file somewhere" you can jump to `foo' and see
where it is defined. IIUC your assumption was that it's been defined
and evaluated in a buffer only.
> If you could add that,
> that would be great. The point is that we do want to send the user to the source
> code, but not to the original `lisp-complete-symbol' source code.
If it's defined in a file we can send the user to the source code in the
(defalias 'lisp-complete-symbol 'foo)
case via the `foo' indirection but certainly _not_ in the
(defalias 'lisp-complete-symbol (symbol-function 'foo))
because, well, look at the return value of (symbol-function 'foo).
> We also need to be sure that the `foo' doc string is used. In my test example I
> omitted that.
In the indirection case follow the link to `foo' and get its doc-string
from there. In the `symbol-function' case you simply have to provide
your own doc-string via the third arg of `defalias'.
> And both of these cases need to be treated:
>
> (defalias 'lisp-complete-symbol 'foo)
> (defalias 'lisp-complete-symbol (symbol-function 'foo))
I suppose I posted the *Help* output for both cases.
martin
Information forwarded to
bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>
:
bug#669
; Package
emacs
.
Full text and
rfc822 format available.
Acknowledgement sent to
"Drew Adams" <drew.adams <at> oracle.com>
:
Extra info received and forwarded to list. Copy sent to
Emacs Bugs <bug-gnu-emacs <at> gnu.org>
.
Full text and
rfc822 format available.
Message #35 received at 669 <at> emacsbugs.donarmstrong.com (full text, mbox):
> > Not completely fixed yet, because it doesn't say anything
> > about where `foo' is
> > defined (assuming it is defined in a file somewhere).
>
> If it is "defined in a file somewhere" you can jump to `foo' and see
> where it is defined. IIUC your assumption was that it's been defined
> and evaluated in a buffer only.
I didn't mean to make any such assumption. The example I sent was ambiguous in
this regard, but it did probably suggest a definition outside of a file.
If the new definition is in a file that is loaded, then it would be good to
treat it the same way we treat such a definition when it has nothing aliased to
it: give the function name and the file it is defined in.
That is, for (defun foo () "..." 5) we don't just print `foo' and let you click
that link to find out where it is defined. We also print "is an interactive
compiled Lisp function in `titi.el'". That same format would be preferable for
the defalias case also: "`toto' is an alias for `foo' which is an interactive
compiled Lisp function in `titi.el'".
IOW, the only thing to be added is the fact that `toto' is an alias for `foo'.
We still need to know what `foo' is and where it was defined.
> > If you could add that, that would be great. The point is that
> > we do want to send the user to the source
> > code, but not to the original `lisp-complete-symbol' source code.
>
> If it's defined in a file we can send the user to the source
> code in the
>
> (defalias 'lisp-complete-symbol 'foo)
>
> case via the `foo' indirection
It's the `lisp-complete-symbol' that is the indirection: it is a pointer to
`foo'.
> but certainly _not_ in the
>
> (defalias 'lisp-complete-symbol (symbol-function 'foo))
>
> because, well, look at the return value of (symbol-function 'foo).
I guess this is because `defalias' is a function, not a macro, so we don't have
access to the sexp (symbol-function 'foo) and hence to `foo'. OK.
> > We also need to be sure that the `foo' doc string is used.
> > In my test example I omitted that.
>
> In the indirection case follow the link to `foo' and get its
> doc-string from there. In the `symbol-function' case you
> simply have to provide your own doc-string via the third arg of `defalias'.
This is presumably the same problem as above. OK.
So it sounds like we can build the source file link "in `titi.el'" in the case
of 'foo but not in the case of (symbol-function 'foo). That's still pretty good
- much more helpful than what we have now (which is wrong and misleading).
> > And both of these cases need to be treated:
> >
> > (defalias 'lisp-complete-symbol 'foo)
> > (defalias 'lisp-complete-symbol (symbol-function 'foo))
>
> I suppose I posted the *Help* output for both cases.
Thx - Drew
Information forwarded to
bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>
:
bug#669
; Package
emacs
.
Full text and
rfc822 format available.
Acknowledgement sent to
martin rudalics <rudalics <at> gmx.at>
:
Extra info received and forwarded to list. Copy sent to
Emacs Bugs <bug-gnu-emacs <at> gnu.org>
.
Full text and
rfc822 format available.
Message #40 received at 669 <at> emacsbugs.donarmstrong.com (full text, mbox):
> That is, for (defun foo () "..." 5) we don't just print `foo' and let you click
> that link to find out where it is defined. We also print "is an interactive
> compiled Lisp function in `titi.el'". That same format would be preferable for
> the defalias case also: "`toto' is an alias for `foo' which is an interactive
> compiled Lisp function in `titi.el'".
Doing C-h f RET rplaca RET gets me a Help buffer with the line
rplaca is an alias for `setcar' in `.../subr.el'.
Clicking on
- the "setcar" link gets me to the Help buffer for `setcar',
- the ".../subr.el" link gets me to the location of the defalias.
I suppose we shouldn't change that behavior.
martin
Information forwarded to
bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>
:
bug#669
; Package
emacs
.
Full text and
rfc822 format available.
Acknowledgement sent to
"Drew Adams" <drew.adams <at> oracle.com>
:
Extra info received and forwarded to list. Copy sent to
Emacs Bugs <bug-gnu-emacs <at> gnu.org>
.
Full text and
rfc822 format available.
Message #45 received at 669 <at> emacsbugs.donarmstrong.com (full text, mbox):
> > That is, for (defun foo () "..." 5) we don't just print
> `foo' and let you click
> > that link to find out where it is defined. We also print
> "is an interactive
> > compiled Lisp function in `titi.el'". That same format
> would be preferable for
> > the defalias case also: "`toto' is an alias for `foo'
> which is an interactive
> > compiled Lisp function in `titi.el'".
>
> Doing C-h f RET rplaca RET gets me a Help buffer with the line
>
> rplaca is an alias for `setcar' in `.../subr.el'.
>
> Clicking on
>
> - the "setcar" link gets me to the Help buffer for `setcar',
>
> - the ".../subr.el" link gets me to the location of the defalias.
>
> I suppose we shouldn't change that behavior.
I'll leave it up to you - whatever you think is appropriate. Thanks for working
on this.
The general idea, from my point of view, is to immediately give the user the
most info s?he might need, provided that doesn't obscure the most important info
s?he is after (the doc string, in this case).
The main thing I wanted to point out was that `C-h f' was describing the wrong
things and attributing those faulty descriptions to the right things. It should
say that the alias is an alias and then describe the function for which it is an
alias. If it can also let you know where the alias is defined and where the
function it points to is defined, so much the better.
Information forwarded to
bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>
:
bug#669
; Package
emacs
.
Full text and
rfc822 format available.
Acknowledgement sent to
Stefan Monnier <monnier <at> iro.umontreal.ca>
:
Extra info received and forwarded to list. Copy sent to
Emacs Bugs <bug-gnu-emacs <at> gnu.org>
.
Full text and
rfc822 format available.
Message #50 received at 669 <at> emacsbugs.donarmstrong.com (full text, mbox):
> case via the `foo' indirection but certainly _not_ in the
> (defalias 'lisp-complete-symbol (symbol-function 'foo))
> because, well, look at the return value of (symbol-function 'foo).
We certainly could, if we labelled every lambda we build with the
location where it was found (rather than labelling the symbol to which
the lambda is bound). In some cases we already do that (if the code is
byte-compiled and the lambda has a docstring, we include a pointer to
the docstring which includes the file name).
Stefan
Information forwarded to
bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>
:
bug#669
; Package
emacs
.
Full text and
rfc822 format available.
Acknowledgement sent to
Stefan Monnier <monnier <at> iro.umontreal.ca>
:
Extra info received and forwarded to list. Copy sent to
Emacs Bugs <bug-gnu-emacs <at> gnu.org>
.
Full text and
rfc822 format available.
Message #55 received at 669 <at> emacsbugs.donarmstrong.com (full text, mbox):
> Clicking on
> - the "setcar" link gets me to the Help buffer for `setcar',
> - the ".../subr.el" link gets me to the location of the defalias.
> I suppose we shouldn't change that behavior.
Indeed we don't want to change that: having access to the defalias
itself is more important than saving a click in the case the user wants
to access the actual function body.
Stefan
Information forwarded to
bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>
:
bug#669
; Package
emacs
.
Full text and
rfc822 format available.
Acknowledgement sent to
Chong Yidong <cyd <at> stupidchicken.com>
:
Extra info received and forwarded to list. Copy sent to
Emacs Bugs <bug-gnu-emacs <at> gnu.org>
.
Full text and
rfc822 format available.
Message #60 received at 669 <at> emacsbugs.donarmstrong.com (full text, mbox):
Martin Rudalics has checked in his fix (2008-09-01 checkin to trunk).
Now closing the bug.
bug closed, send any further explanations to "Drew Adams" <drew.adams <at> oracle.com>
Request was from
Chong Yidong <cyd <at> stupidchicken.com>
to
control <at> emacsbugs.donarmstrong.com
.
(Mon, 01 Sep 2008 17:35:05 GMT)
Full text and
rfc822 format available.
bug archived.
Request was from
Debbugs Internal Request <don <at> donarmstrong.com>
to
internal_control <at> emacsbugs.donarmstrong.com
.
(Tue, 30 Sep 2008 14:24:04 GMT)
Full text and
rfc822 format available.
This bug report was last modified 16 years and 326 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.