Hi again.
Please comment if I am getting things wrong:
On 14 Dec 2001, Stephen J. Turnbull wrote:
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.
It affects (hyper-)?apropos with an indication that it is a
user-variable, no other way right?
Related is the affect to `set-variable' which completion includes it if
and only if the doc string contains an asterisk.
defcustom:
A user option which has special support from the Custom libraries
for easy maintenance.
Since these are intended for users to modify, I believe that _every_
defcustom should have an asterisk at the begining of a doc string.
In that case why do we at all have asterisks in defcustom doc strings,
couldn't they just behave like if the doc-string _always_ contained an
asterisk? (i.e. let the defcustom expansion insert one if there is none)
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.
Since these are for other package writers. I can see no reason for having
an asterisk in the doc string for them, AFAIK the "*" only affects the
`set-variable' function and (hyper-)?apropos as described above.
Could anybody come up with (real-life) examples of when it's a good idea
to include "*" and when it is not a good idea to include "*" in a
defvar declaration
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.
I agree.
defconst:
An internal variable which _should_ be reinitialized every time
the declaration is executed. Often used for constants, but there
are other uses.
As I get it "*" in the doc string should never appear; they are not mean
to be modified, certainly not by users.
So why don't we make defconst ignore (or remove) any initial asterisks in
doc strings for defconst declarations.
I assume that "*" in doc string for functions does not have any effect
since (interactive ... ) is used instead to make them commands, right?
I am sorry to ask such seemingly not very important questions, but if it
finds it ways to the documentation (as I have plans for it to do) I hope
it will help the community and comming elisp hackers to write nice and
consistent code.
Jarl