all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Barry Margolin <barry.margolin@level3.com>
Subject: Re: Function Defintion
Date: Fri, 28 Feb 2003 20:38:53 GMT	[thread overview]
Message-ID: <wNP7a.33$271.180@paloalto-snr1.gtei.net> (raw)
In-Reply-To: de3ad953.0302281147.38ae9ded@posting.google.com

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 1245 bytes --]

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	other threads:[~2003-02-28 20:38 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-02-28 19:47 Function Defintion Artist
2003-02-28 20:38 ` Barry Margolin [this message]
2003-02-28 20:38 ` Stefan Monnier
2003-03-01  4:15 ` D. Goel

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='wNP7a.33$271.180@paloalto-snr1.gtei.net' \
    --to=barry.margolin@level3.com \
    /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.