all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: "Drew Adams" <drew.adams@oracle.com>
To: <gebser@mousecar.com>
Cc: 'GNU Emacs List' <help-gnu-emacs@gnu.org>
Subject: RE: need obsolete arg in (read-from-minibuffer ...)
Date: Fri, 18 Mar 2011 16:03:51 -0700	[thread overview]
Message-ID: <D79FEA8BC7E14736808AD0927A040FF4@us.oracle.com> (raw)
In-Reply-To: <4D83D8B9.7070608@mousecar.com>

> > What do you mean by "work"?  And what do you mean "without" 
> > the obsolete arg?
> 
> If I change the 2nd arg from "def-val" to "nil", then def-val
> isn't displayed in the minibuffer for editing by the user.
> However, the docs say that this arg is obsolete.
> I take this to mean that it should be left as "nil".

Correct.  By "obsolete" the docs mean that that the Emacs developers think you
should leave it as nil (i.e., not use the INITIAL-CONTENTS argument), and use
only the DEFAULT-VALUE argument.

They think that the only useful use cases make no use of INITIAL-CONTENTS.  But
see the doc string wrt the HIST arg, where they allow for an exception.

However, if you understand the difference between DEFAULT-VALUE and
INITIAL-CONTENTS, and _you prefer_ the behavior of INITIAL-CONTENTS for some
reason in some particular context, then use it.  Personally, I do not consider
INITIAL-CONTENTS obsolete, FWIW.

Remember that you can pull the DEFAULT-VALUE into the minibuffer using `M-n'.
So the difference typically comes down to which you find more convenient: having
a value in the minibuffer initially (and having to get rid of it if you really
want something else instead) or pulling a value into the minibuffer when you
need it, using `M-n'.

If the default/initial value is used most of the time, then you might find it
more convenient to have the minibuffer prefilled with it.  If it is not used
most of the time then you might find it more convenient not to have to clear it
out of the minibuffer and type another value.  And this relative convenience
might change, depending on the command and the context.

Personally, I bind `M-k' to a command that clears out the minibuffer, and I
prefill the minibuffer.  I prefill it with the value of DEFAULT-VALUE if
INITIAL-CONTENTS is empty (nil), which is typically the case.  IOW, I have in
effect an automatic `M-n'.  I hit `M-k' when I don't want the value.  Other
people prefer to hit `M-n' when they do want the value.

A lot can depend on how appropriate/useful the default values are for the
commands you use.  If the programmer provided only lousy default values, then
you probably don't want the minibuffer prefilled with them.

In Icicles, whether to prefill or not is a user choice (option).
http://www.emacswiki.org/emacs/Icicles_-_Customization_and_General_Tips#toc11




  reply	other threads:[~2011-03-18 23:03 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-18 20:23 need obsolete arg in (read-from-minibuffer ...) ken
2011-03-18 20:37 ` Drew Adams
2011-03-18 22:12   ` ken
2011-03-18 23:03     ` Drew Adams [this message]
2011-03-19  2:22       ` ken
2011-03-19  2:34         ` Drew Adams
     [not found]       ` <mailman.0.1300501334.15172.help-gnu-emacs@gnu.org>
2011-03-22  1:02         ` Stefan Monnier
     [not found]   ` <mailman.23.1300486344.31996.help-gnu-emacs@gnu.org>
2011-03-19  1:59     ` Stefan Monnier
2011-03-19  5:23       ` ken
2011-03-19  5:51       ` need obsolete arg in (read-from-minibuffer ...) in Version 2.0 ken

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=D79FEA8BC7E14736808AD0927A040FF4@us.oracle.com \
    --to=drew.adams@oracle.com \
    --cc=gebser@mousecar.com \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.