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


Message #61 received at 13687 <at> debbugs.gnu.org (full text, mbox):

From: Jambunathan K <kjambunathan <at> gmail.com>
To: "Drew Adams" <drew.adams <at> oracle.com>
Cc: 'Juri Linkov' <juri <at> jurta.org>, 13687 <at> debbugs.gnu.org
Subject: Re: bug#13687: /srv/bzr/emacs/trunk r111878: *
	lisp/replace.el(read-regexp): Let-bind `default' to the first
Date: Sat, 09 Mar 2013 00:00:11 +0530
"Drew Adams" <drew.adams <at> oracle.com> writes:

> E.g., in the code I cited, if a user does not want the same defaulting
> behavior for commands `occur', `how-many', etc., she can set option
> `search/replace-default-fn' to a function that distinguishes them
> (e.g., using `this-command', as Jambunathan suggested).

Interesting suggestion there.

This makes me think that there is no need for multiple
`hi-lock-read-regexp-defaults-function' and a separate
`occur-read-regexp-defaults-function' etc.  But a single
`read-regexp-defaults-function' that cases on `this-command'.

The function can return a symbol token like `t' for `this-command's
which it doesn't want to meddle with but return nil or a regexp or list
of regexps for commands it wants to insinuate.

Is there any problem with this `read-regexp-defaults-function' approach?




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.