unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Function to get defalias?
@ 2009-11-23 17:07 Lennart Borgman
  2009-11-23 21:00 ` Juri Linkov
  2009-11-23 21:19 ` Stefan Monnier
  0 siblings, 2 replies; 4+ messages in thread
From: Lennart Borgman @ 2009-11-23 17:07 UTC (permalink / raw)
  To: Emacs-Devel devel

Do we have a function that does what indirect-variable does for
variables for defalias:ed funtions?




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

* Re: Function to get defalias?
  2009-11-23 17:07 Function to get defalias? Lennart Borgman
@ 2009-11-23 21:00 ` Juri Linkov
  2009-11-23 21:19 ` Stefan Monnier
  1 sibling, 0 replies; 4+ messages in thread
From: Juri Linkov @ 2009-11-23 21:00 UTC (permalink / raw)
  To: Lennart Borgman; +Cc: Emacs-Devel devel

> Do we have a function that does what indirect-variable does for
> variables for defalias:ed funtions?

Something like this in a loop:

(or (and (symbolp this-command) (fboundp this-command)
         (symbolp (symbol-function this-command))
         (symbol-function this-command)) this-command)

-- 
Juri Linkov
http://www.jurta.org/emacs/




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

* Re: Function to get defalias?
  2009-11-23 17:07 Function to get defalias? Lennart Borgman
  2009-11-23 21:00 ` Juri Linkov
@ 2009-11-23 21:19 ` Stefan Monnier
  2009-11-23 21:29   ` Lennart Borgman
  1 sibling, 1 reply; 4+ messages in thread
From: Stefan Monnier @ 2009-11-23 21:19 UTC (permalink / raw)
  To: Lennart Borgman; +Cc: Emacs-Devel devel

> Do we have a function that does what indirect-variable does for
> variables for defalias:ed funtions?

indirect-function?


        Stefan




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

* Re: Function to get defalias?
  2009-11-23 21:19 ` Stefan Monnier
@ 2009-11-23 21:29   ` Lennart Borgman
  0 siblings, 0 replies; 4+ messages in thread
From: Lennart Borgman @ 2009-11-23 21:29 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: Emacs-Devel devel

On Mon, Nov 23, 2009 at 10:19 PM, Stefan Monnier
<monnier@iro.umontreal.ca> wrote:
>> Do we have a function that does what indirect-variable does for
>> variables for defalias:ed funtions?
>
> indirect-function?


Thanks, I was probably asking for the wrong thing. I meant something
like the code describe-function that shows the function symbol.

I ended up stealing that code:


;;;###autoload
(defun ourcomments-indirect-fun (fun)
  "Get the alias for function FUN if any."
  ;; This code is from `describe-function-1'.
  (when (and (symbolp fun)
             (functionp fun))
    (let ((def (symbol-function fun)))
      (when (symbolp def)
        (while (and (fboundp def)
                    (symbolp (symbol-function def)))
          (setq def (symbol-function def)))
        def))))




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

end of thread, other threads:[~2009-11-23 21:29 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-11-23 17:07 Function to get defalias? Lennart Borgman
2009-11-23 21:00 ` Juri Linkov
2009-11-23 21:19 ` Stefan Monnier
2009-11-23 21:29   ` Lennart Borgman

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