From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: Irritation in C-u M-x grep, caused by overprotectiveness Date: Sun, 29 Jul 2007 09:49:33 -0400 Message-ID: References: <20070729110910.GA1955@muc.de> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1185716996 27129 80.91.229.12 (29 Jul 2007 13:49:56 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sun, 29 Jul 2007 13:49:56 +0000 (UTC) Cc: emacs-devel@gnu.org To: Alan Mackenzie Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Jul 29 15:49:50 2007 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1IF99R-00011M-Dy for ged-emacs-devel@m.gmane.org; Sun, 29 Jul 2007 15:49:41 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1IF99R-0005qi-2o for ged-emacs-devel@m.gmane.org; Sun, 29 Jul 2007 09:49:41 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1IF99O-0005qd-HR for emacs-devel@gnu.org; Sun, 29 Jul 2007 09:49:38 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1IF99M-0005qR-2T for emacs-devel@gnu.org; Sun, 29 Jul 2007 09:49:37 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1IF99L-0005qO-Tk for emacs-devel@gnu.org; Sun, 29 Jul 2007 09:49:35 -0400 Original-Received: from tomts10.bellnexxia.net ([209.226.175.54] helo=tomts10-srv.bellnexxia.net) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1IF99L-0005PX-El for emacs-devel@gnu.org; Sun, 29 Jul 2007 09:49:35 -0400 Original-Received: from pastel.home ([70.53.195.62]) by tomts10-srv.bellnexxia.net (InterMail vM.5.01.06.13 201-253-122-130-113-20050324) with ESMTP id <20070729134934.DHSU9197.tomts10-srv.bellnexxia.net@pastel.home> for ; Sun, 29 Jul 2007 09:49:34 -0400 Original-Received: by pastel.home (Postfix, from userid 20848) id 9ED2280C5; Sun, 29 Jul 2007 09:49:33 -0400 (EDT) In-Reply-To: <20070729110910.GA1955@muc.de> (Alan Mackenzie's message of "Sun\, 29 Jul 2007 11\:09\:10 +0000") User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.1.50 (gnu/linux) X-detected-kernel: Solaris 8 (1) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:75780 Archived-At: > If I give an environment variable as "filename", the chances are I'll > want to use it in subsequent greps. I don't see why that'd generally be the case, but I guess it's just as good a default as the current one. Maybe a better and more general approach to the problem goes as follows: Currently the code checks whether the previous "list of files" (typically a global pattern) matches the current buffer's file name. If it does then the previous list of files is reused, otherwise the previous list of files is ignored and replaced by a new glob pattern. Now in your case, the list of files which *you* wrote did not "match" the current buffer's file name, so clearly, the above heuristic shouldn't be applied anyway. I.e. we should only check "does it match the current file?" if it did match the current file in its previous use. Stefan