unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* grep.el bug?
@ 2005-01-16  3:43 David Abrahams
  2005-01-16  4:09 ` David Abrahams
  0 siblings, 1 reply; 3+ messages in thread
From: David Abrahams @ 2005-01-16  3:43 UTC (permalink / raw)


I just rebuilt emacs from CVS.  On line 541 of grep.el, a change was
made about a year ago that seems to be breaking grep-find for me.

    (let ((null-device nil))		; see grep
      (grep command-args))))

This always leads to the following backtrace for me:

Debugger entered--Lisp error: (wrong-type-argument stringp nil)
  call-process("find" nil nil nil nil "-print0")
  grep-compute-defaults()
  grep-process-setup()
  compilation-start("find . -type f -not -path \"*/CVS/*\" ...)
  grep("find . -type f -not -path \"*/CVS/*\" -not -name \ ...)
  grep-find("find . -type f -not -path \"*/CVS/*\" -not    ...)
  call-interactively(grep-find)
  execute-extended-command(nil)
  call-interactively(execute-extended-command)

As far as I can tell, null-device gets passed as the 5th argument to
call-process, which expects only strings after its 4th argument.  But
this can't have remained broken for everyone for a whole year, can it?
So I must be missing something.  The comment that directs me to "see
grep" leaves me completely in the dark.

Clues, anyone?

Thanks in advance,
-- 
Dave Abrahams
Boost Consulting
http://www.boost-consulting.com

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: grep.el bug?
  2005-01-16  3:43 grep.el bug? David Abrahams
@ 2005-01-16  4:09 ` David Abrahams
  2005-01-17 23:42   ` Richard Stallman
  0 siblings, 1 reply; 3+ messages in thread
From: David Abrahams @ 2005-01-16  4:09 UTC (permalink / raw)


David Abrahams wrote:
> I just rebuilt emacs from CVS.  On line 541 of grep.el, a change was
> made about a year ago that seems to be breaking grep-find for me.
> 
>     (let ((null-device nil))		; see grep
>       (grep command-args))))
> 
> This always leads to the following backtrace for me:
> 
> Debugger entered--Lisp error: (wrong-type-argument stringp nil)
>   call-process("find" nil nil nil nil "-print0")
>   grep-compute-defaults()
>   grep-process-setup()
>   compilation-start("find . -type f -not -path \"*/CVS/*\" ...)
>   grep("find . -type f -not -path \"*/CVS/*\" -not -name \ ...)
>   grep-find("find . -type f -not -path \"*/CVS/*\" -not    ...)
>   call-interactively(grep-find)
>   execute-extended-command(nil)
>   call-interactively(execute-extended-command)
> 
> As far as I can tell, null-device gets passed as the 5th argument to
> call-process, which expects only strings after its 4th argument.  But
> this can't have remained broken for everyone for a whole year, can it?
> So I must be missing something.  The comment that directs me to "see
> grep" leaves me completely in the dark.
> 
> Clues, anyone?

Here's one clue: I have customized grep-find-command.  I believe that if
I hadn't,

     (unless grep-find-command
       (grep-compute-defaults))

would cause grep-compute-defaults to be called early enough to make the
nil-ness of null-device irrellevant.  Hah, yes, that is in fact the case.

The grep function has a slightly more sophisticated check:


     (unless (and grep-command
		  (or (not grep-use-null-device) (eq grep-use-null-device t)))

I don't know exactly what the right fix is, but it seems to me these
tests ought to be encapsulated, or just incorporated into
grep-compute-defaults.  Hmm, something like that seems to be there
already. Since I don't know what the original authors of this code were
thinking, I'm having trouble thinking of a change that preserves what's
currently working but doesn't just make more of a mess.

-- 
Dave Abrahams
Boost Consulting
http://www.boost-consulting.com

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: grep.el bug?
  2005-01-16  4:09 ` David Abrahams
@ 2005-01-17 23:42   ` Richard Stallman
  0 siblings, 0 replies; 3+ messages in thread
From: Richard Stallman @ 2005-01-17 23:42 UTC (permalink / raw)
  Cc: emacs-devel

    The grep function has a slightly more sophisticated check:


	 (unless (and grep-command
		      (or (not grep-use-null-device) (eq grep-use-null-device t)))

Putting that into grep-find seems like a simple solution.
I will do that.  Thanks:

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2005-01-17 23:42 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-01-16  3:43 grep.el bug? David Abrahams
2005-01-16  4:09 ` David Abrahams
2005-01-17 23:42   ` Richard Stallman

Code repositories for project(s) associated with this public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).