emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Function to get defalias?


From: Lennart Borgman
Subject: Re: Function to get defalias?
Date: Mon, 23 Nov 2009 22:29:55 +0100

On Mon, Nov 23, 2009 at 10:19 PM, Stefan Monnier
<address@hidden> 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))))




reply via email to

[Prev in Thread] Current Thread [Next in Thread]