all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* how to print an elisp function
@ 2014-05-16  6:06 Joe Riel
  2014-05-16 10:18 ` Nicolas Richard
  0 siblings, 1 reply; 4+ messages in thread
From: Joe Riel @ 2014-05-16  6:06 UTC (permalink / raw)
  To: Help GNU Emacs

How can I print an elisp function?

(print some-func) returns an error, void-variable some-func.
How do I tell it to print the function assigned to some-func?


-- 
Joe Riel




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

* Re: how to print an elisp function
       [not found] <mailman.1441.1400220416.1147.help-gnu-emacs@gnu.org>
@ 2014-05-16  9:34 ` Pascal J. Bourguignon
  0 siblings, 0 replies; 4+ messages in thread
From: Pascal J. Bourguignon @ 2014-05-16  9:34 UTC (permalink / raw)
  To: help-gnu-emacs

Joe Riel <joer@san.rr.com> writes:

> How can I print an elisp function?
>
> (print some-func) returns an error, void-variable some-func.
> How do I tell it to print the function assigned to some-func?

Then why don't you define that variable?

    (let ((some-func (function sin)))
      (print some-func))


Or define a function:

    (defun some-func (x) (1+ x))
    (print (function some-func))


-- 
__Pascal Bourguignon__
http://www.informatimago.com/
"Le mercure monte ?  C'est le moment d'acheter !"


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

* Re: how to print an elisp function
  2014-05-16  6:06 how to print an elisp function Joe Riel
@ 2014-05-16 10:18 ` Nicolas Richard
  2014-05-16 13:42   ` Joe Riel
  0 siblings, 1 reply; 4+ messages in thread
From: Nicolas Richard @ 2014-05-16 10:18 UTC (permalink / raw)
  To: Joe Riel; +Cc: Help GNU Emacs

Joe Riel <joer@san.rr.com> writes:

> How can I print an elisp function?
>
> (print some-func) returns an error, void-variable some-func.
> How do I tell it to print the function assigned to some-func?

Perhaps you want (print (symbol-function 'some-func))

-- 
Nico.



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

* Re: how to print an elisp function
  2014-05-16 10:18 ` Nicolas Richard
@ 2014-05-16 13:42   ` Joe Riel
  0 siblings, 0 replies; 4+ messages in thread
From: Joe Riel @ 2014-05-16 13:42 UTC (permalink / raw)
  To: Nicolas Richard; +Cc: Help GNU Emacs

On Fri, 16 May 2014 12:18:46 +0200
Nicolas Richard <theonewiththeevillook@yahoo.fr> wrote:

> Joe Riel <joer@san.rr.com> writes:
> 
> > How can I print an elisp function?
> >
> > (print some-func) returns an error, void-variable some-func.
> > How do I tell it to print the function assigned to some-func?
> 
> Perhaps you want (print (symbol-function 'some-func))
> 

Yes, thanks.

-- 
Joe Riel




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

end of thread, other threads:[~2014-05-16 13:42 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-05-16  6:06 how to print an elisp function Joe Riel
2014-05-16 10:18 ` Nicolas Richard
2014-05-16 13:42   ` Joe Riel
     [not found] <mailman.1441.1400220416.1147.help-gnu-emacs@gnu.org>
2014-05-16  9:34 ` Pascal J. Bourguignon

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.