all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Barry Margolin <barmar@alum.mit.edu>
To: help-gnu-emacs@gnu.org
Subject: Re: Why I get different results running the same exp?
Date: Sat, 09 Jun 2007 00:08:51 -0400	[thread overview]
Message-ID: <barmar-82ADB3.00085109062007@comcast.dca.giganews.com> (raw)
In-Reply-To: mailman.1761.1181271448.32220.help-gnu-emacs@gnu.org

In article <mailman.1761.1181271448.32220.help-gnu-emacs@gnu.org>,
 "Yu,Gang" <wuhanyugang@gmail.com> 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 <ttn@gnuvola.org> wrote:
> >
> > () "Yu,Gang" <wuhanyugang@gmail.com>
> > () 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 ***

  parent reply	other threads:[~2007-06-09  4:08 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <mailman.1721.1181215534.32220.help-gnu-emacs@gnu.org>
2007-06-07 14:05 ` Why I get different results running the same exp? Thien-Thi Nguyen
2007-06-08  2:57   ` Yu,Gang
     [not found]   ` <mailman.1761.1181271448.32220.help-gnu-emacs@gnu.org>
2007-06-09  4:08     ` Barry Margolin [this message]
2007-06-07 11:25 Yu,Gang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=barmar-82ADB3.00085109062007@comcast.dca.giganews.com \
    --to=barmar@alum.mit.edu \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.