Subject: Re: bug#13687: /srv/bzr/emacs/trunk r111878: * lisp/replace.el(read-regexp): Let-bind `default' to the first

From: Juri Linkov <[email-masked]>
Date: Fri, 08 Mar 2013 19:28:09 +0200

> Let the command decide its own defaulting.  Individual commands that read the
> minibuffer should control such defaulting, at the point of call.

Since when the command commands the user, and not other way round?

> They can rely on user options if they want to.  But a single user option for
> this kind of thing, and especially if it somehow takes control of defaulting
> away from the caller (command), is a bad idea.

Perhaps you missed the whole thread, but see what the users are forced to use

http://stackoverflow.com/questions/15161592/make-emacs-rgrep-default-to-last-search-term-rather-than-word-at-point

in the absence of customizable options.

> FWIW, in my code I do something that I'm guessing might be similar to the
> _effect_ you want, but I stay completely away from command lookup/dispatching.

There is no command lookup/dispatching since Jambunathan implements
the third variant, and not the second cited above.

> I have a user option, `search/replace-default-fn', whose value (a function)
> provides the default value(s) for functions `query-replace', `occur',
> `how-many', `flush-lines',...

Your `search/replace-default-fn' is exactly the same thing as
`occur-read-regexp-defaults-function', so why do you object?