From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Drew Adams" Newsgroups: gmane.emacs.bugs Subject: bug#13687: /srv/bzr/emacs/trunk r111878: * lisp/replace.el(read-regexp): Let-bind `default' to the first Date: Fri, 8 Mar 2013 07:29:52 -0800 Message-ID: <1751CEB23B214A3AADCCFD9F007425DE@us.oracle.com> References: <877glsyecw.fsf@gmail.com> <87621cfhff.fsf@mail.jurta.org><87zjykygjk.fsf@mail.jurta.org> <87vc92gi37.fsf@gmail.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1362756643 29830 80.91.229.3 (8 Mar 2013 15:30:43 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 8 Mar 2013 15:30:43 +0000 (UTC) Cc: 13687@debbugs.gnu.org To: "'Jambunathan K'" , "'Juri Linkov'" Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Mar 08 16:31:03 2013 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1UDzG8-0002yB-0K for geb-bug-gnu-emacs@m.gmane.org; Fri, 08 Mar 2013 16:31:00 +0100 Original-Received: from localhost ([::1]:60660 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UDzFm-00030y-5L for geb-bug-gnu-emacs@m.gmane.org; Fri, 08 Mar 2013 10:30:38 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:57207) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UDzFd-00030m-PA for bug-gnu-emacs@gnu.org; Fri, 08 Mar 2013 10:30:35 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UDzFY-0003rU-HK for bug-gnu-emacs@gnu.org; Fri, 08 Mar 2013 10:30:29 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:35483) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UDzFY-0003rM-Eg for bug-gnu-emacs@gnu.org; Fri, 08 Mar 2013 10:30:24 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.72) (envelope-from ) id 1UDzG9-0001uU-QJ for bug-gnu-emacs@gnu.org; Fri, 08 Mar 2013 10:31:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: "Drew Adams" Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 08 Mar 2013 15:31:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 13687 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 13687-submit@debbugs.gnu.org id=B13687.13627566577332 (code B ref 13687); Fri, 08 Mar 2013 15:31:01 +0000 Original-Received: (at 13687) by debbugs.gnu.org; 8 Mar 2013 15:30:57 +0000 Original-Received: from localhost ([127.0.0.1]:39592 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UDzG0-0001u9-UR for submit@debbugs.gnu.org; Fri, 08 Mar 2013 10:30:56 -0500 Original-Received: from aserp1040.oracle.com ([141.146.126.69]:28466) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UDzFu-0001tr-35 for 13687@debbugs.gnu.org; Fri, 08 Mar 2013 10:30:50 -0500 Original-Received: from acsinet22.oracle.com (acsinet22.oracle.com [141.146.126.238]) by aserp1040.oracle.com (Sentrion-MTA-4.3.1/Sentrion-MTA-4.3.1) with ESMTP id r28FU1KW026206 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Fri, 8 Mar 2013 15:30:02 GMT Original-Received: from acsmt356.oracle.com (acsmt356.oracle.com [141.146.40.156]) by acsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id r28FU0fG018577 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 8 Mar 2013 15:30:01 GMT Original-Received: from abhmt101.oracle.com (abhmt101.oracle.com [141.146.116.53]) by acsmt356.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id r28FU0Os016061; Fri, 8 Mar 2013 09:30:00 -0600 Original-Received: from dradamslap1 (/10.159.244.176) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Fri, 08 Mar 2013 07:30:00 -0800 X-Mailer: Microsoft Office Outlook 11 In-Reply-To: <87vc92gi37.fsf@gmail.com> X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.6157 Thread-Index: Ac4b/Vzs5LaraRS8R8ihIBS4Es59mwAETIqg X-Source-IP: acsinet22.oracle.com [141.146.126.238] X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:72226 Archived-At: > > 2. Add a new defcustom like: > > (defcustom minibuffer-defaults > > '((highlight-regexp-default . tag-at-point) > > (rgrep . history) > > (occur . tag-at-point) > > (how-many . history) > > ...)) > > Cons: Too large list of commands for one option. > > I am attaching a patch that handles `occur'. > I will commit this patch tomorrow. Sorry, I have not been following this thread at all - please excuse any jumping to wrong conclusions. If that defcustom is what it looks like to me, I'd say that such an approach is quite misguided. I.e., if you are defining a user option that globally controls defaulting for commands reading input from the minibuffer, that's a bad idea, IMHO. Let the command decide its own defaulting. Individual commands that read the minibuffer should control such defaulting, at the point of call. 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. And doubly so if it does command lookup to determine the default value to use. That's the real mistake, IMHO. 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. 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',... This means that, a priori, the same option value is used for all such functions. But a command can override this. And the function that is the option value can itself do the kind of dispatching that you are doing, if that is something the user really wants. code: http://www.emacswiki.org/emacs/download/replace%2b.el doc: http://www.emacswiki.org/cgi-bin/wiki/ReplacePlus I also wonder whether you are perhaps changing the user experience here without a proper proposal and discussion in emacs-devel first. "I will commit...tomorrow." does not inspire confidence. How about proposing a change and seeing what others in the development list think? Again, if I have misunderstood, mille excuses.