unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* No such program, egrep error in Customize
@ 2007-12-26 18:32 Drew Adams
  2007-12-26 18:54 ` Drew Adams
  2007-12-26 19:41 ` Eli Zaretskii
  0 siblings, 2 replies; 11+ messages in thread
From: Drew Adams @ 2007-12-26 18:32 UTC (permalink / raw)
  To: Bug-Gnu-Emacs

emacs -Q

Define a defcustom with a color value.
M-x customize-variable for the option.
Edit the color value field a bit and use `M-TAB' to try to complete.

I get these messages (error):

 Starting "egrep" process...
 apply: Searching for program: no such file or directory, egrep


In GNU Emacs 22.1.1 (i386-mingw-nt5.1.2600)
 of 2007-06-02 on RELEASE
Windowing system distributor `Microsoft Corp.', version 5.1.2600
configured using `configure --with-gcc (3.4) --cflags -Ic:/gnuwin32/include'






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

* RE: No such program, egrep error in Customize
  2007-12-26 18:32 No such program, egrep error in Customize Drew Adams
@ 2007-12-26 18:54 ` Drew Adams
  2007-12-26 19:18   ` Andreas Schwab
  2007-12-26 19:18   ` Drew Adams
  2007-12-26 19:41 ` Eli Zaretskii
  1 sibling, 2 replies; 11+ messages in thread
From: Drew Adams @ 2007-12-26 18:54 UTC (permalink / raw)
  To: Bug-Gnu-Emacs

> emacs -Q
>
> Define a defcustom with a color value.
> M-x customize-variable for the option.
> Edit the color value field a bit and use `M-TAB' to try to complete.
>
> I get these messages (error):
>
>  Starting "egrep" process...
>  apply: Searching for program: no such file or directory, egrep
>
>
> In GNU Emacs 22.1.1 (i386-mingw-nt5.1.2600)
>  of 2007-06-02 on RELEASE
> Windowing system distributor `Microsoft Corp.', version 5.1.2600
> configured using `configure --with-gcc (3.4) --cflags
> -Ic:/gnuwin32/include'

The backtrace is below. `widget-complete' (`M-TAB') is calling
`ispell-complete-word' instead of `widget-color-complete', which is the
:complete value of the `color' widget.

When I do debug-on-entry widget-complete, I see that it does this:

Debugger entered--returning value: ispell-complete-word
  widget-get((string :format " %v" :value "lightgoldenrod2" :parent
(custom-variable :documentation-shown t :custom-state modified :tag "Icicle
Region Background" :value icicle-region-background :custom-form edit
:custom-magic (custom-magic :args ... :parent #1 :indent 0 :children ...
:from #<marker (moves after insertion) at 565 in *Customize Option: Icicle
Region Background*> :to #<marker at 642 in *Customize Option: Icicle Region
Background*> :buttons nil :value nil) :buttons (... ... ... ... ...)
:comment-widget (custom-comment :parent #1 :value "" :indent 0 :from
#<marker at 1084 in *Customize Option: Icicle Region Background*> :to
#<marker at 1084 in *Customize Option: Icicle Region Background*>) :children
(#0 ...) :from #<marker (moves after insertion) at 524 in *Customize Option:
Icicle Region Background*> :to #<marker at 1126 in *Customize Option: Icicle
Region Background*>) :indent 0 :field-overlay #<overlay from 561 to 564 in
*Customize Option: Icicle Region Background*> :from #<marker (moves after
insertion) at 560 in *Customize Option: Icicle Region Background*> :to
#<marker at 565 in *Customize Option: Icicle Region Background*>)
:complete-function)
* (or (widget-get widget :complete-function) widget-complete-field)
* (call-interactively (or (widget-get widget :complete-function)
widget-complete-field))
* widget-default-complete((string :format " %v" :value "lightgoldenrod2"
:parent (custom-variable :documentation-shown t :custom-state modified :tag
"Icicle Region Background" :value icicle-region-background :custom-form edit
:custom-magic (custom-magic :args ... :parent #1 :indent 0 :children ...
:from #<marker (moves after insertion) at 565 in *Customize Option: Icicle
Region Background*> :to #<marker at 642 in *Customize Option: Icicle Region
Background*> :buttons nil :value nil) :buttons (... ... ... ... ...)
:comment-widget (custom-comment :parent #1 :value "" :indent 0 :from
#<marker at 1084 in *Customize Option: Icicle Region Background*> :to
#<marker at 1084 in *Customize Option: Icicle Region Background*>) :children
(#0 ...) :from #<marker (moves after insertion) at 524 in *Customize Option:
Icicle Region Background*> :to #<marker at 1126 in *Customize Option: Icicle
Region Background*>) :indent 0 :field-overlay #<overlay from 561 to 564 in
*Customize Option: Icicle Region Background*> :from #<marker (moves after
insertion) at 560 in *Customize Option: Icicle Region Background*> :to
#<marker at 565 in *Customize Option: Icicle Region Background*>))
* widget-apply((string :format " %v" :value "lightgoldenrod2" :parent
(custom-variable :documentation-shown t :custom-state modified :tag "Icicle
Region Background" :value icicle-region-background :custom-form edit
:custom-magic (custom-magic :args ... :parent #1 :indent 0 :children ...
:from #<marker (moves after insertion) at 565 in *Customize Option: Icicle
Region Background*> :to #<marker at 642 in *Customize Option: Icicle Region
Background*> :buttons nil :value nil) :buttons (... ... ... ... ...)
:comment-widget (custom-comment :parent #1 :value "" :indent 0 :from
#<marker at 1084 in *Customize Option: Icicle Region Background*> :to
#<marker at 1084 in *Customize Option: Icicle Region Background*>) :children
(#0 ...) :from #<marker (moves after insertion) at 524 in *Customize Option:
Icicle Region Background*> :to #<marker at 1126 in *Customize Option: Icicle
Region Background*>) :indent 0 :field-overlay #<overlay from 561 to 564 in
*Customize Option: Icicle Region Background*> :from #<marker (moves after
insertion) at 560 in *Customize Option: Icicle Region Background*> :to
#<marker at 565 in *Customize Option: Icicle Region Background*>) :complete)
* (save-restriction (widget-narrow-to-field) (widget-apply field :complete))
* (if field (save-restriction (widget-narrow-to-field) (widget-apply field
:complete)) (error "Not in an editable field"))
* (let ((field ...)) (if field (save-restriction ... ...) (error "Not in an
editable field")))
* widget-complete()
  call-interactively(widget-complete)

IOW, the :complete value of the `color' widget, `widget-color-complete',
never gets used. Both parts of the `or' in `widget-default-complete' are
inappropriate here:

 (or (widget-get widget :complete-function) widget-complete-field)

The first part returns `ispell-complete-word'. The second part returns
`complete-symbol'. My guess would be that (widget-apply... :complete) is not
picking up the :complete value from widget `color'.


---8<---- error backtrace ----

  call-process("egrep" nil t nil "-i" "^blu.*$" "/usr/dict/words")
  apply(call-process ("egrep" nil t nil "-i" "^blu.*$" "/usr/dict/words"))
  ispell-call-process("egrep" nil t nil "-i" "^blu.*$" "/usr/dict/words")
  apply(ispell-call-process "egrep" nil t nil ("-i" "^blu.*$"
"/usr/dict/words"))
  byte-code(...)
  lookup-words("blu*" "/usr/dict/words")
  ispell-complete-word(nil)
  call-interactively(ispell-complete-word)
  widget-default-complete((string :format " %v" :value "lightgoldenrod2"
:parent (custom-variable :documentation-shown t :custom-state modified :tag
"Icicle Region Background" :value icicle-region-background :custom-form edit
:custom-magic (custom-magic :args ... :parent #1 :indent 0 :children ...
:from #<marker (moves after insertion) at 565 in *Customize Option: Icicle
Region Background*> :to #<marker at 642 in *Customize Option: Icicle Region
Background*> :buttons nil :value nil) :buttons (... ... ... ... ...)
:comment-widget (custom-comment :parent #1 :value "" :indent 0 :from
#<marker at 1084 in *Customize Option: Icicle Region Background*> :to
#<marker at 1084 in *Customize Option: Icicle Region Background*>) :children
(#0 ...) :from #<marker (moves after insertion) at 524 in *Customize Option:
Icicle Region Background*> :to #<marker at 1126 in *Customize Option: Icicle
Region Background*>) :indent 0 :field-overlay #<overlay from 561 to 564 in
*Customize Option: Icicle Region Background*> :from #<marker (moves after
insertion) at 560 in *Customize Option: Icicle Region Background*> :to
#<marker at 565 in *Customize Option: Icicle Region Background*>))
  widget-apply((string :format " %v" :value "lightgoldenrod2" :parent
(custom-variable :documentation-shown t :custom-state modified :tag "Icicle
Region Background" :value icicle-region-background :custom-form edit
:custom-magic (custom-magic :args ... :parent #1 :indent 0 :children ...
:from #<marker (moves after insertion) at 565 in *Customize Option: Icicle
Region Background*> :to #<marker at 642 in *Customize Option: Icicle Region
Background*> :buttons nil :value nil) :buttons (... ... ... ... ...)
:comment-widget (custom-comment :parent #1 :value "" :indent 0 :from
#<marker at 1084 in *Customize Option: Icicle Region Background*> :to
#<marker at 1084 in *Customize Option: Icicle Region Background*>) :children
(#0 ...) :from #<marker (moves after insertion) at 524 in *Customize Option:
Icicle Region Background*> :to #<marker at 1126 in *Customize Option: Icicle
Region Background*>) :indent 0 :field-overlay #<overlay from 561 to 564 in
*Customize Option: Icicle Region Background*> :from #<marker (moves after
insertion) at 560 in *Customize Option: Icicle Region Background*> :to
#<marker at 565 in *Customize Option: Icicle Region Background*>) :complete)
  widget-complete()
  call-interactively(widget-complete)





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

* Re: No such program, egrep error in Customize
  2007-12-26 18:54 ` Drew Adams
@ 2007-12-26 19:18   ` Andreas Schwab
  2007-12-26 19:45     ` Drew Adams
  2007-12-26 19:50     ` Eli Zaretskii
  2007-12-26 19:18   ` Drew Adams
  1 sibling, 2 replies; 11+ messages in thread
From: Andreas Schwab @ 2007-12-26 19:18 UTC (permalink / raw)
  To: Drew Adams; +Cc: Bug-Gnu-Emacs

"Drew Adams" <drew.adams@oracle.com> writes:

>   ispell-call-process("egrep" nil t nil "-i" "^blu.*$" "/usr/dict/words")

Set ispell-grep-command to the name of the egrep program.

Andreas.

-- 
Andreas Schwab, SuSE Labs, schwab@suse.de
SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany
PGP key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."




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

* RE: No such program, egrep error in Customize
  2007-12-26 18:54 ` Drew Adams
  2007-12-26 19:18   ` Andreas Schwab
@ 2007-12-26 19:18   ` Drew Adams
  2007-12-26 19:47     ` Eli Zaretskii
  1 sibling, 1 reply; 11+ messages in thread
From: Drew Adams @ 2007-12-26 19:18 UTC (permalink / raw)
  To: Bug-Gnu-Emacs

My bad. I had mistakenly defined the :type as `string', not `color'.

Still, the error message is perhaps a bit strange. ispell is apparently used
for completion of strings, but if ispell is not installed, then that's not
TRT.

Anyway, sorry for the noise wrt `color'.





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

* Re: No such program, egrep error in Customize
  2007-12-26 18:32 No such program, egrep error in Customize Drew Adams
  2007-12-26 18:54 ` Drew Adams
@ 2007-12-26 19:41 ` Eli Zaretskii
  2007-12-26 19:53   ` Drew Adams
  2007-12-29 12:42   ` Eli Zaretskii
  1 sibling, 2 replies; 11+ messages in thread
From: Eli Zaretskii @ 2007-12-26 19:41 UTC (permalink / raw)
  To: Drew Adams; +Cc: bug-gnu-emacs

> From: "Drew Adams" <drew.adams@oracle.com>
> Date: Wed, 26 Dec 2007 10:32:24 -0800
> 
> emacs -Q
> 
> Define a defcustom with a color value.
> M-x customize-variable for the option.
> Edit the color value field a bit and use `M-TAB' to try to complete.
> 
> I get these messages (error):
> 
>  Starting "egrep" process...
>  apply: Searching for program: no such file or directory, egrep

It's quite obvious: you don't have an executable `egrep' (egrep.exe,
egrep.bat, egrep.cmd, etc.) anywhere on your PATH.

> In GNU Emacs 22.1.1 (i386-mingw-nt5.1.2600)
>  of 2007-06-02 on RELEASE

If you don't have GNU Grep installed, that's the problem.  If you do
have it installed, I'm guessing that `egrep' there is a Unix shell
script, and Windows doesn't know how to run it.  I suggest to write a
batch file egrep.cmd, with these two lines:

@echo off
grep -E %*

put it somewhere on your PATH, and then M-TAB should work for you.
Did it?




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

* RE: No such program, egrep error in Customize
  2007-12-26 19:18   ` Andreas Schwab
@ 2007-12-26 19:45     ` Drew Adams
  2007-12-26 19:50     ` Eli Zaretskii
  1 sibling, 0 replies; 11+ messages in thread
From: Drew Adams @ 2007-12-26 19:45 UTC (permalink / raw)
  To: Andreas Schwab; +Cc: Bug-Gnu-Emacs

> >   ispell-call-process("egrep" nil t nil "-i" "^blu.*$"
> "/usr/dict/words")
>
> Set ispell-grep-command to the name of the egrep program.

Right. It is - but not in emacs -Q.

I think the error message for Customize should say something more
user-friendly, in any case. If the user tries to complete some text (a
word), it should say why it can't do so at a higher level than a "searching
for program" error.

And why not have a fallback word/text-completion function that doesn't
depend on having ispell installed? Dabbrev, for instance - it might not be
that useful, but it could be better than nothing.

Or at least put the ispell part in a condition-case so the second `or'
branch can get tried, to pick up `lisp-complete-symbol'.

Anyway, I found the problem I had - see my other mail. Thx for your prompt
reply.





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

* Re: No such program, egrep error in Customize
  2007-12-26 19:18   ` Drew Adams
@ 2007-12-26 19:47     ` Eli Zaretskii
  2007-12-26 20:02       ` Drew Adams
  0 siblings, 1 reply; 11+ messages in thread
From: Eli Zaretskii @ 2007-12-26 19:47 UTC (permalink / raw)
  To: Drew Adams; +Cc: bug-gnu-emacs

> From: "Drew Adams" <drew.adams@oracle.com>
> Date: Wed, 26 Dec 2007 11:18:34 -0800
> 
> Still, the error message is perhaps a bit strange. ispell is apparently used
> for completion of strings, but if ispell is not installed, then that's not
> TRT.

No, ispell (the program) is not used for completion.  Instead, you
will see that ispell.el invokes the program that is the value of
ispell-grep-command directly, as this backtrace you posted clearly
shows:

  ispell-call-process("egrep" nil t nil "-i" "^blu.*$" "/usr/dict/words")

(`ispell-call-process' is a simple wrapper for call-process-region, it
does NOT invoke ispell the program.)




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

* Re: No such program, egrep error in Customize
  2007-12-26 19:18   ` Andreas Schwab
  2007-12-26 19:45     ` Drew Adams
@ 2007-12-26 19:50     ` Eli Zaretskii
  1 sibling, 0 replies; 11+ messages in thread
From: Eli Zaretskii @ 2007-12-26 19:50 UTC (permalink / raw)
  To: Andreas Schwab; +Cc: bug-gnu-emacs

> From: Andreas Schwab <schwab@suse.de>
> Date: Wed, 26 Dec 2007 20:18:07 +0100
> Cc: Bug-Gnu-Emacs <bug-gnu-emacs@gnu.org>
> 
> "Drew Adams" <drew.adams@oracle.com> writes:
> 
> >   ispell-call-process("egrep" nil t nil "-i" "^blu.*$" "/usr/dict/words")
> 
> Set ispell-grep-command to the name of the egrep program.

There isn't one: for some weird reason, GNU Grep maintainers decided
to produce only one executable program, named `grep' (`grep.exe' on
DOS and Windows), and have `egrep' and `fgrep' as Unix shell scripts.
Let the fleas of a thousand camels infest the armpits of those who
change old-standing Unix traditions of having 3 programs in the Grep
package!




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

* RE: No such program, egrep error in Customize
  2007-12-26 19:41 ` Eli Zaretskii
@ 2007-12-26 19:53   ` Drew Adams
  2007-12-29 12:42   ` Eli Zaretskii
  1 sibling, 0 replies; 11+ messages in thread
From: Drew Adams @ 2007-12-26 19:53 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: bug-gnu-emacs

> It's quite obvious: you don't have an executable `egrep' (egrep.exe,
> egrep.bat, egrep.cmd, etc.) anywhere on your PATH.

Yes, that was obvious from the beginning.

My question was why it was looking for egrep (in order to look for ispell).
There was a completion function defined for widget `color', and it wasn't
being called.

But I found my mistake - the defcustom was not defining the :type as
`color'. See my email to emacs-devel about that.

> > In GNU Emacs 22.1.1 (i386-mingw-nt5.1.2600)
> >  of 2007-06-02 on RELEASE
>
> If you don't have GNU Grep installed, that's the problem.  If you do
> have it installed, I'm guessing that `egrep' there is a Unix shell
> script, and Windows doesn't know how to run it.  I suggest to write a
> batch file egrep.cmd, with these two lines:
>
> @echo off
> grep -E %*
>
> put it somewhere on your PATH, and then M-TAB should work for you.
> Did it?

ispell-grep-command is "egrep", which is fine for me.

However, in emacs -Q, my usual PATH was not used (naturally), so it wasn't
found. Same thing occurs for `grep' or any other program. IOW, no problem
when my .emacs is used, because I set PATH there to include the cygwin
binaries, but emacs -Q has no idea about that (naturally).






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

* RE: No such program, egrep error in Customize
  2007-12-26 19:47     ` Eli Zaretskii
@ 2007-12-26 20:02       ` Drew Adams
  0 siblings, 0 replies; 11+ messages in thread
From: Drew Adams @ 2007-12-26 20:02 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: bug-gnu-emacs

> > Still, the error message is perhaps a bit strange. ispell is
> > apparently used for completion of strings, but if ispell is
> > not installed, then that's not TRT.
>
> No, ispell (the program) is not used for completion.  Instead, you
> will see that ispell.el invokes the program that is the value of
> ispell-grep-command directly, as this backtrace you posted clearly
> shows:
>
>   ispell-call-process("egrep" nil t nil "-i" "^blu.*$" "/usr/dict/words")
>
> (`ispell-call-process' is a simple wrapper for call-process-region, it
> does NOT invoke ispell the program.)

Thanks for the clarification. Let me rephrase it then. The code that calls
ispell-call-process with "egrep", or some higher-level code, should perhaps
provide a better error message for a Customize user.

And see my other mail. It is better for such a failure to find egrep not to
raise an error and instead call some default text-completion function.

There are perhaps other, and better ways to handle this, but I don't think
the current approach is very user-friendly, in any case. Especially for a
Customize user. At the limit, it is better to punt and say completion is not
available than to send the user googling to figure out what egrep and
ispell-call-process might be all about.





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

* Re: No such program, egrep error in Customize
  2007-12-26 19:41 ` Eli Zaretskii
  2007-12-26 19:53   ` Drew Adams
@ 2007-12-29 12:42   ` Eli Zaretskii
  1 sibling, 0 replies; 11+ messages in thread
From: Eli Zaretskii @ 2007-12-29 12:42 UTC (permalink / raw)
  To: drew.adams, bug-gnu-emacs

> Date: Wed, 26 Dec 2007 21:41:04 +0200
> From: Eli Zaretskii <eliz@gnu.org>
> Cc: bug-gnu-emacs@gnu.org
> 
> If you do have it installed, I'm guessing that `egrep' there is a
> Unix shell script, and Windows doesn't know how to run it.

I installed a change that should fix this.




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

end of thread, other threads:[~2007-12-29 12:42 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-12-26 18:32 No such program, egrep error in Customize Drew Adams
2007-12-26 18:54 ` Drew Adams
2007-12-26 19:18   ` Andreas Schwab
2007-12-26 19:45     ` Drew Adams
2007-12-26 19:50     ` Eli Zaretskii
2007-12-26 19:18   ` Drew Adams
2007-12-26 19:47     ` Eli Zaretskii
2007-12-26 20:02       ` Drew Adams
2007-12-26 19:41 ` Eli Zaretskii
2007-12-26 19:53   ` Drew Adams
2007-12-29 12:42   ` Eli Zaretskii

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).