>>>> "Jarl" == Jarl Friis <jarl(a)diku.dk>
writes:
Jarl> I am planning to make an XEmacs package one day (out of
Jarl> eSMS) and needs some information of how to do that. There
Jarl> will probably come a series of questions regarding this.
I think I committed a patch a few weeks ago describing my experiences
with TRAMP and Mule-UCS. Anyway, the next releases of 21.4 and 21.5
should have a node in Lispref going into more detail about packaging
libraries from the developer's point of view. There is definitely
some material already in (xemacs)Packages.
Jarl> In the lispref there's a section describing Defining Global
Jarl> Variables. A lot of stuff regarding defvar is mentioned and
Jarl> one should start the documentation string with an asteriks
Jarl> to indicate it's a user option, the
This is used by (hyper-)?apropos. You should still do it in defcustoms.
Jarl> As I see it user-options should not be declared with
Jarl> `defvar', but rather `defcustom'.
Yes.
Jarl> does that make `defvar' obsolete?
No. There are three possible declarations (that I know of).
defcustom:
A user option which has special support from the Custom libraries
for easy maintenance.
defvar:
An internal variable which should _not_ be reinitialized on
execution of the declaration if already bound. This can be used
for communication among a group of cooperating packages, and also
avoids a lot of inconvenience in the edit-compile-load-test cycle.
Note that if you really want to have the initialization done, you
just need to execute the defvar form interactively. This is an
excellent compromise AFAICT.
defconst:
An internal variable which _should_ be reinitialized every time
the declaration is executed. Often used for constants, but there
are other uses.
--
Institute of Policy and Planning Sciences
http://turnbull.sk.tsukuba.ac.jp
University of Tsukuba Tennodai 1-1-1 Tsukuba 305-8573 JAPAN
Don't ask how you can "do" free software business;
ask what your business can "do for" free software.