[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: elisp from CL transition guide
From: |
Tim Cross |
Subject: |
Re: elisp from CL transition guide |
Date: |
Sat, 18 Aug 2007 16:39:57 +1000 |
User-agent: |
Gnus/5.11 (Gnus v5.11) Emacs/22.1.50 (gnu/linux) |
Tamas Papp <tkpapp@gmail.com> writes:
> daniel@bigwalter.net (Daniel Jensen) writes:
>
>> Tamas Papp <tkpapp@gmail.com> writes:
>>
>>> I have some Common Lisp programming experience, and would like to use
>>> Emacs Lisp for simple tasks. I found introductions to Elisp, but what
>>> I am looking for is some guide that would tell me the differences from
>>> CL, to get started quicker.
>>
>> I don't think that many of the differences between Emacs Lisp and Common
>> Lisp will come up while you're getting started. My advice is to take on
>> those simple tasks right now and learn by doing. The Emacs Lisp
>> Introduction is an excellent tutorial. It will teach you how to think
>> about writing Emacs commands. I think that's what you should focus on.
>> There is also plenty of source code to read and learn from.
>
> One thing I don't understand yet is namespaces in Elisp: if I set fill-column
> in
> a buffer (setq fill-column 80), that doesn't seem to affect fill-column in
> other
> buffers. But if I set some other variable eg (setq foo 12), foo will evaluate
> to 12 in other buffers. What would be a correct mental model for this?
>
Probably Schizophrenia !
Actually, emacs has the concept of 'buffer local variables', where the
variable binding is local to a buffer. usually, if a buffer local variable
is not set directly in a buffer, it will default to the same value as the
global variable. However, once it is set, it becomes local to that
buffer. When you set it, it doesn't set the global value.
Emacs doesn't have package namespaces like CL, which is why most variables
are prefixed with the name of the package they belong to.
have a look at the documentation for make-local-variable
Tim
--
Tim Cross
tcross@rapttech.com.au
There are two types of people in IT - those who do not manage what they
understand and those who do not understand what they manage.
- elisp from CL transition guide, Tamas Papp, 2007/08/16
- Re: elisp from CL transition guide, Petter Gustad, 2007/08/16
- Re: elisp from CL transition guide, Tassilo Horn, 2007/08/16
- Re: elisp from CL transition guide, Daniel Jensen, 2007/08/16
- Re: elisp from CL transition guide, Pascal Bourguignon, 2007/08/16
- Re: elisp from CL transition guide, Tim Cross, 2007/08/18