unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* announcing defaults when reading from minibuffer
@ 2005-08-28 12:23 Emilio Lopes
  2005-08-29  8:39 ` Richard M. Stallman
  2005-08-29 18:47 ` Bill Wohler
  0 siblings, 2 replies; 5+ messages in thread
From: Emilio Lopes @ 2005-08-28 12:23 UTC (permalink / raw)


I've just asked myself if there's any convention for announcing
defaults when reading from minibuffer.  Skimming the Elisp manual
didn't reveal anything in this regard.  Seaching the archives of this
list I found this message from RMS:

   The standard for Emacs is (default foo).  There may be some
   nonstandard functions that use [foo], due to imperfect quality
   control, but we should stick to the standard (unless we decide to
   change it).

[http://lists.gnu.org/archive/html/emacs-devel/2004-06/msg00085.html]

So I documented this convention in "(elisp) Text from Minibuffer".

Here's the patch:


2005-08-28  Emilio C. Lopes  <eclig@gmx.net>

	* minibuf.texi (Text from Minibuffer): mention convention for
	announcing default values when reading from the minibuffer.

diff -rN -c old-emacs-darcs.eclig/lispref/minibuf.texi new-emacs-darcs.eclig/lispref/minibuf.texi
*** old-emacs-darcs.eclig/lispref/minibuf.texi	Sun Aug 28 14:20:31 2005
--- new-emacs-darcs.eclig/lispref/minibuf.texi	Sun Aug 28 14:05:41 2005
***************
*** 154,159 ****
--- 154,167 ----
  empty string, @code{""}.  In this respect, it is different from all
  the other minibuffer input functions in this chapter.
  
+ Note that the standard way in Emacs to announce a default value when
+ reading from the minibuffer is to put it between parenthesis following
+ the word ``default'' as in
+ 
+ @smallexample
+ Enter value (default 42): 
+ @end smallexample
+ 
  If @var{keymap} is non-@code{nil}, that keymap is the local keymap to
  use in the minibuffer.  If @var{keymap} is omitted or @code{nil}, the
  value of @code{minibuffer-local-map} is used as the keymap.  Specifying

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: announcing defaults when reading from minibuffer
  2005-08-28 12:23 announcing defaults when reading from minibuffer Emilio Lopes
@ 2005-08-29  8:39 ` Richard M. Stallman
  2005-08-29 17:23   ` Emilio Lopes
  2005-08-29 18:47 ` Bill Wohler
  1 sibling, 1 reply; 5+ messages in thread
From: Richard M. Stallman @ 2005-08-29  8:39 UTC (permalink / raw)
  Cc: emacs-devel

Thanks for thinking of this.  It seems to me that a better
place to put this is in the Tips appendix--do you agree?


*** tips.texi	11 Aug 2005 15:11:39 -0400	1.69
--- tips.texi	28 Aug 2005 21:07:16 -0400	
***************
*** 374,379 ****
--- 374,388 ----
  with a period.
  
  @item
+ When you mention a default value in a minibuffer prompt,
+ put it and the word @samp{default} inside parentheses.
+ It should look like this:
+ 
+ @example
+ Enter the answer (default 42): 
+ @end example
+ 
+ @item
  In @code{interactive}, if you use a Lisp expression to produce a list
  of arguments, don't try to provide the ``correct'' default values for
  region or position arguments.  Instead, provide @code{nil} for those

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: announcing defaults when reading from minibuffer
  2005-08-29  8:39 ` Richard M. Stallman
@ 2005-08-29 17:23   ` Emilio Lopes
  0 siblings, 0 replies; 5+ messages in thread
From: Emilio Lopes @ 2005-08-29 17:23 UTC (permalink / raw)


Richard M Stallman writes:

> It seems to me that a better place to put this is in the Tips
> appendix--do you agree?

I was also in doubt.  I thought it's best to have this information
together with the rest of the documentation of the function in
question, whenever possible.  That way people will learn good Elisp
style when they first learn the mechanics of the function.

Such separation makes sense when documenting languages which can be
used in different projects, each having its own coding conventions.
Elisp can be used only within Emacs.

OTOH there are already precedence cases (`error', e.g.).  So maybe
it's better not to open this can of worms now and instead install the
change as you posted.  I guess people will find the information either
way.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: announcing defaults when reading from minibuffer
  2005-08-28 12:23 announcing defaults when reading from minibuffer Emilio Lopes
  2005-08-29  8:39 ` Richard M. Stallman
@ 2005-08-29 18:47 ` Bill Wohler
  2005-08-30 10:30   ` Richard M. Stallman
  1 sibling, 1 reply; 5+ messages in thread
From: Bill Wohler @ 2005-08-29 18:47 UTC (permalink / raw)


Emilio Lopes <eclig@gmx.net> writes:

> I've just asked myself if there's any convention for announcing
> defaults when reading from minibuffer.  Skimming the Elisp manual
> didn't reveal anything in this regard.  Seaching the archives of this
> list I found this message from RMS:
>
>    The standard for Emacs is (default foo).  There may be some
>    nonstandard functions that use [foo], due to imperfect quality
>    control, but we should stick to the standard (unless we decide to
>    change it).

Thanks for bringing this to my attention. I've submitted a bug report
to ensure that this is changed in MH-E.

Can you please clarify the location of the colon? Your update to the
manual says this:

> + Enter value (default 42): 

However, "C-x b (switch-to-buffer)" for example shows this:

  "Switch to buffer: (default foo) "

-- 
Bill Wohler <wohler@newt.com>  http://www.newt.com/wohler/  GnuPG ID:610BD9AD
Maintainer of comp.mail.mh FAQ and MH-E. Vote Libertarian!
If you're passed on the right, you're in the wrong lane.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: announcing defaults when reading from minibuffer
  2005-08-29 18:47 ` Bill Wohler
@ 2005-08-30 10:30   ` Richard M. Stallman
  0 siblings, 0 replies; 5+ messages in thread
From: Richard M. Stallman @ 2005-08-30 10:30 UTC (permalink / raw)
  Cc: emacs-devel

    Can you please clarify the location of the colon? Your update to the
    manual says this:

    > + Enter value (default 42): 

    However, "C-x b (switch-to-buffer)" for example shows this:

      "Switch to buffer: (default foo) "

You are right.  Thanks.

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2005-08-30 10:30 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-08-28 12:23 announcing defaults when reading from minibuffer Emilio Lopes
2005-08-29  8:39 ` Richard M. Stallman
2005-08-29 17:23   ` Emilio Lopes
2005-08-29 18:47 ` Bill Wohler
2005-08-30 10:30   ` Richard M. Stallman

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).