From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Jambunathan K Newsgroups: gmane.emacs.bugs Subject: bug#13687: /srv/bzr/emacs/trunk r111878: * lisp/replace.el(read-regexp): Let-bind `default' to the first Date: Sat, 09 Mar 2013 21:51:11 +0530 Message-ID: <87sj44o87c.fsf@gmail.com> References: <877glsyecw.fsf@gmail.com> <87621cfhff.fsf@mail.jurta.org> <87zjykygjk.fsf@mail.jurta.org> <87vc92gi37.fsf@gmail.com> <1751CEB23B214A3AADCCFD9F007425DE@us.oracle.com> <87li9xer9u.fsf@mail.jurta.org> <8738w5n3rg.fsf@gmail.com> <87d2v9rmcl.fsf@gmail.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1362846150 17409 80.91.229.3 (9 Mar 2013 16:22:30 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 9 Mar 2013 16:22:30 +0000 (UTC) Cc: 13687@debbugs.gnu.org To: "Drew Adams" Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Mar 09 17:22:54 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 1UEMXu-0007pg-EG for geb-bug-gnu-emacs@m.gmane.org; Sat, 09 Mar 2013 17:22:54 +0100 Original-Received: from localhost ([::1]:42518 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UEMXY-0006MP-D3 for geb-bug-gnu-emacs@m.gmane.org; Sat, 09 Mar 2013 11:22:32 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:35411) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UEMXR-0006MF-1f for bug-gnu-emacs@gnu.org; Sat, 09 Mar 2013 11:22:29 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UEMXK-000051-AO for bug-gnu-emacs@gnu.org; Sat, 09 Mar 2013 11:22:25 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:37884) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UEMXK-00004x-7N for bug-gnu-emacs@gnu.org; Sat, 09 Mar 2013 11:22:18 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.72) (envelope-from ) id 1UEMY1-0006Fa-Me for bug-gnu-emacs@gnu.org; Sat, 09 Mar 2013 11:23:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Jambunathan K Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 09 Mar 2013 16:23: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.136284612423952 (code B ref 13687); Sat, 09 Mar 2013 16:23:01 +0000 Original-Received: (at 13687) by debbugs.gnu.org; 9 Mar 2013 16:22:04 +0000 Original-Received: from localhost ([127.0.0.1]:41991 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UEMX5-0006EG-Vn for submit@debbugs.gnu.org; Sat, 09 Mar 2013 11:22:04 -0500 Original-Received: from mail-pb0-f44.google.com ([209.85.160.44]:58893) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UEMX3-0006Dm-68 for 13687@debbugs.gnu.org; Sat, 09 Mar 2013 11:22:02 -0500 Original-Received: by mail-pb0-f44.google.com with SMTP id wz12so2274473pbc.3 for <13687@debbugs.gnu.org>; Sat, 09 Mar 2013 08:21:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version:content-type; bh=pHM0bavr8IkbvAOqpz04aKwKm5GpaB1euwS9ScyreYQ=; b=e8vdSK3eRrlfs3hQR+CBO17dAwLIFaJcJa8VBSJy2YnvTeu4C/KeZKLOZJO+cqbISv TvHrhjTADQI/NPtFwg2zHynN0JJej2ZrRGTNtwqPy9yEmrMXWK8Ls3NBLw+t7vU+Pgo+ IATqRViqF23Sj0TxVinAZT7o6f0nUAYkH5WzLmt1uMoFtqJqn7Sguvtl4B0hpKyrLxIg DKwRn5SmX+TeTlnVt7LS/fkoDcyWNAU5espsRxmwRFFopIX6uHCNMGy9ZnUl4rZMct4t mMBG/tGkB363Q4MdLbpM70rZhR+KVw4yS/zoX8h8+iCdmc0sjrMPhLUB+BzipABoqGEy YOXQ== X-Received: by 10.68.252.134 with SMTP id zs6mr5670051pbc.66.1362846071494; Sat, 09 Mar 2013 08:21:11 -0800 (PST) Original-Received: from debian-6.05 ([101.63.128.26]) by mx.google.com with ESMTPS id gf6sm10914112pbc.24.2013.03.09.08.21.08 (version=TLSv1.1 cipher=RC4-SHA bits=128/128); Sat, 09 Mar 2013 08:21:10 -0800 (PST) In-Reply-To: (Drew Adams's message of "Sat, 9 Mar 2013 07:08:54 -0800") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) 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:72280 Archived-At: Drew You are beating a dead horse and the first line clearly says it is a DEAD HORSE. The mail only stated why I KILLED the horse. It is my way of saying my earlier patch to hi-lock and the previous patch to occur stands and is useful. I will definitely look in to comments that you may have to offer with the patch that introduces `occur-read-regexp-defaults-function'. Grouping - I don't know why you are beating on it - will now be user's responsibility not that of Emacs. Jambunathan K. "Drew Adams" writes: >> EXPERIMENTAL and ABANDONED PATCH > >> Use of `this-command' is very fragile and flaky. > > No, but it is somewhat fragile. > >> Consider `multi-occur-in-matching-buffers' which does multiple >> `read-regexp' - one for the buffers and one for the actual >> regexp. It is not possible to return a two different regexps >> for the same `this-command'. > > You don't need to. If a user needs to test for > `multi-occur-in-matching-buffers' via `this-command' then s?he can do that and > act accordingly. No need for general code that tries to second-guess things. > >> Interestingly, I am attaching a long from *Messages* buffer >> and it looks like `this-command' is not reliable (Do you see >> `exit-minibuffer' in the logs.) > > See below. > >> So `this-command' could work for simple commands like highlighting >> commands but will be flaky to be applied in general. >> >> Anyways good to experiment and see where an idea takes us... > > As I said, we should not encourage this. And yes, any use of `last-command' or > `this-command' is somewhat fragile, because some functions intentionally change > their values. > > And yes, comparing functions is also problematic in general. No eta reduction, > for one thing: (equal (lambda (x) (car x)) 'car). > > See what I wrote earlier. Let users choose any string-returning function they > want to use for defaulting. If a user wants to use a function that conditions > its return value on `this-command', s?he can always do so. > > But there is no reason to encourage that. Any set of commands that we design to > use the same defaulting choice (via the same user option) should be a cohesive > group: the same choice should make sense across that set. > > If you have one or more commands that do not fit that, then give them their own > defaulting options (grouping again, where appropriate). > > There is nothing new here - just common sense. The solution is simple, IMO. > >> Interestingly, I am attaching a long from *Messages* buffer >> and it looks like `this-command' is not reliable (Do you see >> `exit-minibuffer' in the logs.) >> >> cmd: exit-minibuffer defaults: nil > > Your code checks only (eq user-defaults t). When `user-defaults' is nil, this > returns nil.