help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: read-from-minibuffer with default value string


From: Drew Adams
Subject: RE: read-from-minibuffer with default value string
Date: Mon, 6 Dec 2010 07:49:49 -0800

> Yes, I had been trying to puzzle over that page. You quote 
> the passages that suggest INITIAL-CONTENTS is still ok, but
> it also includes the line:
> 
>    Use of a cons cell as the value for INITIAL arguments is deprecated
>    in user code.
> 
> I'm not sure if this might be a documentation bug, but it sure left me
> with mixed messages.

No, it's not a typo.  That's something else again.  It pertains to this earlier
paragraph:

   INITIAL can also be a cons cell of the form `(STRING . POSITION)'.
   This means to insert STRING in the minibuffer but put point at POSITION
   within the string's text.

(So both HIST and INITIAL can be cons cells.)  Admittedly the statement you
quote can be confusing, especially because:

1. It is separated by a large paragraph from the statement that INITIAL can be a
cons.

2. It speaks about "user code".  That's easy to miss - and easy to wonder about.
What it is presumably saying is that Emacs Dev does not consider this deprecated
for its own (Emacs-developer) use in (officially distributed) Emacs code, but it
considers it deprecated for coding by users.  Silly?

You might want to file a doc bug to try to get this part clarified: `M-x
report-emacs-bug'.

> Sure, my only concerns in sorting this out are 1) to learn to use
> correct, idiomatic elisp and 2) to avoid constructs that are likely to
> change/disappear in future emacs versions. I think your 
> suggestions will allow me to avoid the issue entirely, which is good.

Yes, that's the right approach, IMO.  I do the same thing, for the same reason,
in spite of my view that this should _not_ be considered deprecated/obsolete.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]