From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Barry Margolin Newsgroups: gmane.emacs.help Subject: Re: Why I get different results running the same exp? Date: Sat, 09 Jun 2007 00:08:51 -0400 Organization: Symantec Message-ID: References: <87fy53uaft.fsf@ambire.localdomain> NNTP-Posting-Host: lo.gmane.org X-Trace: sea.gmane.org 1181364065 15601 80.91.229.12 (9 Jun 2007 04:41:05 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sat, 9 Jun 2007 04:41:05 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sat Jun 09 06:41:04 2007 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1Hwsl5-0001yp-LS for geh-help-gnu-emacs@m.gmane.org; Sat, 09 Jun 2007 06:41:03 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Hwsl4-0007zU-P3 for geh-help-gnu-emacs@m.gmane.org; Sat, 09 Jun 2007 00:41:02 -0400 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!postnews.google.com!news2.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!local01.nntp.dca.giganews.com!nntp.comcast.com!news.comcast.com.POSTED!not-for-mail Original-NNTP-Posting-Date: Fri, 08 Jun 2007 23:08:51 -0500 Original-Newsgroups: gnu.emacs.help Mail-Copies-To: nobody User-Agent: MT-NewsWatcher/3.5.2 (PPC Mac OS X) X-Copies-To: never Original-Lines: 79 Original-NNTP-Posting-Host: 24.34.108.171 Original-X-Trace: sv3-isbC9G9dHUKlc3I94Gs4vtcx3FIthEwHV97M5RMIZHnowF1g/yU+LIVhH8t0SbAlY1ffVbMdslKznqk!DCZ7W/1KJbASEr4TRl8pZQQk6ZYS5Au5VulBtUwMqGeiafdJZGFeQv8wZ9BKfbxlS8NZDBAINXar!LEp15z9VcfzAY241IdRttWd4ISuyAqrfRc8rtbCtTQ== Original-X-Complaints-To: abuse@comcast.net X-DMCA-Complaints-To: dmca@comcast.net X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.3.34 Original-Xref: shelby.stanford.edu gnu.emacs.help:149219 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:44804 Archived-At: In article , "Yu,Gang" wrote: > If I understand you corrently, I restart emacs with > > "emacs -q" > > I copy the code to *scratch*, evaluate them > > then, I repeatedly run "(ygrep "(start|stop)-process" "\\.el$" load-path)" > third times, > > first result is 128 matches , and second 141, third 146. Works fine for me, I get 172 matches every time. > > I ediff the buffers ,find that some items are ingored by the precedent > match. > > But I could not explain:-( > > I suspect the problem is > "(while (and > grep-process > (not (equal (process-status grep-process) 'exit))) > (sleep-for 0 100)))" > > but I am not sure, any suggestions? That's just waiting for the grep to finish, which is fine. I'm not sure why your function is so complicated. Instead of doing a separate grep for each directory and then combining them, why don't you do one big grep for everything? Append "/*.el" to each element of the directory, concatenate them, and pass them to grep. E.g. if load-path contains ("/path/to/dir1" "/path/to/dir2") you do (let* ((paths (mapconcat '(lambda (dir) (concat dir "/*.el")) load-path)) (command (sprintf "egrep -nH -e '%s' %s" regexp paths))) (grep command)) > > thanks > > On 6/7/07, Thien-Thi Nguyen wrote: > > > > () "Yu,Gang" > > () Thu, 7 Jun 2007 19:25:28 +0800 > > > > but, everytime I run: > > > > (ygrep "(start|stop)-process" "\\.el$" load-path) > > > > in the *scratch* buffer, I get a different result. > > > > What's wrong?? > > > > if you save the code and repeatedly load it into a freshly > > started emacs, do you get consistent results each time? > > > > if so, what does that mean? > > if not, what does that mean? > > > > thi > > _______________________________________________ > > help-gnu-emacs mailing list > > help-gnu-emacs@gnu.org > > http://lists.gnu.org/mailman/listinfo/help-gnu-emacs > > > > cheers -- Barry Margolin, barmar@alum.mit.edu Arlington, MA *** PLEASE post questions in newsgroups, not directly to me *** *** PLEASE don't copy me on replies, I'll read them in the group ***