help-gnu-emacs
[Top][All Lists]
Advanced

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

Re: Function Defintion


From: Barry Margolin
Subject: Re: Function Defintion
Date: Fri, 28 Feb 2003 20:38:53 GMT

In article <de3ad953.0302281147.38ae9ded@posting.google.com>,
Artist <googleartist@yahoo.com> wrote:
>Hi, How I can get the function definition via lisp code?
> Lambda expression may be ok.
>
>I know how to see it via find-function and I don't want to use macro.
>
>Something like
>(get-definition 'mark-whole-buffer)

(symbol-function 'mark-whole-buffer)

>should return
>
>(defun mark-whole-buffer ()
>  "Put point at beginning and mark at end of buffer.
>You probably should not use this function in Lisp programs;
>it is usually a mistake for a Lisp function to use any subroutine
>that uses or sets the mark."
>  (interactive)
>  (push-mark (point))
>  (push-mark (point-max) nil t)
>  (goto-char (point-min)))

You'll only get the lambda expression if the function is interpreted.
Since mark-whole-buffer is byte-compiled, you get a vector containing the
compiled version:

#[nil "À`!ˆÀdÁÂ#ˆeb‡" [push-mark nil t] 4 1035873 nil]

If you want to see the source code, use M-. to find the source file.

-- 
Barry Margolin, barry.margolin@level3.com
Genuity Managed Services, Woburn, MA
*** DON'T SEND TECHNICAL QUESTIONS DIRECTLY TO ME, post them to newsgroups.
Please DON'T copy followups to me -- I'll assume it wasn't posted to the group.


reply via email to

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