all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: "Drew Adams" <drew.adams@oracle.com>
To: "'martin rudalics'" <rudalics@gmx.at>
Cc: 669@emacsbugs.donarmstrong.com
Subject: bug#669: 23.0.60; defalias is not taken into account by C-h k
Date: Wed, 13 Aug 2008 14:41:07 -0700	[thread overview]
Message-ID: <004f01c8fd8d$4f880730$c2b22382@us.oracle.com> (raw)
In-Reply-To: <48A34F54.9090302@gmx.at>

>  > 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







  reply	other threads:[~2008-08-13 21:41 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-08-07 18:23 bug#669: 23.0.60; defalias is not taken into account by C-h k Drew Adams
2008-08-07 20:54 ` Drew Adams
2008-08-13 17:05   ` martin rudalics
2008-08-13 17:27     ` Drew Adams
2008-08-13 21:17       ` martin rudalics
2008-08-13 21:41         ` Drew Adams [this message]
2008-08-14  6:18           ` martin rudalics
2008-08-14 15:33             ` Drew Adams
2008-08-14 20:03             ` Stefan Monnier
2008-08-14 20:00         ` Stefan Monnier

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='004f01c8fd8d$4f880730$c2b22382@us.oracle.com' \
    --to=drew.adams@oracle.com \
    --cc=669@emacsbugs.donarmstrong.com \
    --cc=rudalics@gmx.at \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.