From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Nix Newsgroups: gmane.emacs.help Subject: Re: Emacs internals + lisp guru question Date: 29 Sep 2002 16:33:19 +0100 Organization: the Core Sender: help-gnu-emacs-admin@gnu.org Message-ID: <87y99k24lc.fsf@amaterasu.srvr.nix> References: Reply-To: Nix <$}xinix{$@esperi.demon.co.uk> NNTP-Posting-Host: localhost.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: main.gmane.org 1033316794 26736 127.0.0.1 (29 Sep 2002 16:26:34 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Sun, 29 Sep 2002 16:26:34 +0000 (UTC) Return-path: Original-Received: from monty-python.gnu.org ([199.232.76.173]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 17vgts-0006wx-00 for ; Sun, 29 Sep 2002 18:26:32 +0200 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.10) id 17vgu3-0006Om-00; Sun, 29 Sep 2002 12:26:43 -0400 Original-Path: shelby.stanford.edu!nntp.stanford.edu!newsfeed.stanford.edu!logbridge.uoregon.edu!kibo.news.demon.net!news.demon.co.uk!demon!news.srvr.nix!not-for-mail Original-Newsgroups: gnu.emacs.help,comp.lang.lisp,gnu.utils.help,comp.unix.shell,comp.unix.programmer Original-Followup-To: gnu.emacs.help Original-Lines: 75 Original-NNTP-Posting-Host: bacchus.srvr.nix Original-X-Trace: news.demon.co.uk 1033315844 13293 194.222.138.8 (29 Sep 2002 16:10:44 GMT) Original-X-Complaints-To: abuse@demon.net User-Agent: Gnus/5.0808 (Gnus v5.8.8) XEmacs/21.4 (Informed Management) X-Emacs: more boundary conditions than the Middle East. Original-Xref: nntp.stanford.edu gnu.emacs.help:105493 comp.lang.lisp:94937 gnu.utils.help:4055 comp.unix.shell:133553 comp.unix.programmer:143503 Original-To: help-gnu-emacs@gnu.org Errors-To: help-gnu-emacs-admin@gnu.org X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.0.11 Precedence: bulk List-Help: List-Post: List-Subscribe: , List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: Xref: main.gmane.org gmane.emacs.help:2038 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:2038 [followups drastically trimmed] On 28 Sep 2002, gnuist stipulated: > There are some functions that take a list as argument. > Text can be read from the buffer as a string. > There are some functions that take a "symbol" as an argument. > A string can be converted to a symbol. Yes, with `intern' or `make-symbol' (which do *very* different things). > However, when symbol is provided to the function by converting a string > it is not working. > > For example: > > (describe-function quoted-SYMBOL) works > (make-symbol "describe-function") works The symbols these functions yield are *different*: e.g. (eq 'describe-function (make-symbol "describe-function")) ==> nil Think of a symbol as a key in a lookup table mapping symbols to triples of (function, value, property). (Lisp calls these tables `obarrays'). The Lisp reader (the thing that takes 'describe-function and transforms it to a symbol) looks up its symbols in the obarray named, with great originality, `obarray'. This is the one where all the Lisp symbols are defined. There are other obarrays: abbrev puts its abbrevs in an obarray, and the BBDB uses another one to store its address book. Obviously you don't want these entries to collide with Lisp symbols; so they use different obarrays (which are normally *themselves* stored as Lisp variables). `make-symbol' makes a symbol that is in *no obarray at all*; so regardless of its name no symbol given to the Lisp reader will be equal to it, have the same value as it, &c, &c. If you want to look up a symbol with a name given as a string in the Lisp obarray, you need to use `intern'; this'll create the symbol if it doesn't exist. If you want to avoid creating the symbol, you can use `intern-soft', which returns nil if the symbol is nonexistent. See . > How can we get the code of describe-function? (symbol-function 'describe-function), but it's not very useful; the function is probably byte-compiled, so you'll get code in the bytecode interpreter's language, not in Lisp. Alternatively, look in `help.el' (I think it's there in GNU Emacs too; I'm looking at XEmacs here). > What is the meaning of the gibberish from > (insert (format "%s" (symbol-function 'describe-function) )) I see no gibberish there. Which bit do you find gibberishy? > What is out there to learn more about emacs/emacs_lisp and become more > sophisticated? The Emacs Lisp Intro is very good: . Once you've read that, read the Lisp Reference for your flavour of (X)Emacs and read lots of the lisp sources that come with the editor and you should be enlightened. -- `Let's have a round of applause for those daring young men and their flying spellcheckers.' --- Meg Worley