GNU bug report logs - #13687
24.3.50; `read-regexp' should provide regex for symbol at point as defaults

Previous Next

Package: emacs;

Reported by: Jambunathan K <kjambunathan <at> gmail.com>

Date: Mon, 11 Feb 2013 06:30:02 UTC

Severity: wishlist

Found in version 24.3.50

Done: Stefan Monnier <monnier <at> iro.umontreal.ca>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Juri Linkov <juri <at> jurta.org>
To: "Drew Adams" <drew.adams <at> oracle.com>
Cc: 'Jambunathan K' <kjambunathan <at> gmail.com>, 13687 <at> debbugs.gnu.org
Subject: bug#13687: /srv/bzr/emacs/trunk r111878: * lisp/replace.el(read-regexp): Let-bind `default' to the first
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?




This bug report was last modified 12 years and 68 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.