emacs-pretest-bug
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: ediff failure if diff doesn't exist


From: Kevin Rodgers
Subject: Re: ediff failure if diff doesn't exist
Date: Thu, 11 May 2006 09:07:52 -0600
User-agent: Thunderbird 1.5.0.2 (Windows/20060308)

Jesper Harder wrote:
On ms-windows when you (require 'ediff) on a computer where the diff
executable doesn't exist you get the backtrace below.

Of course, ediff probably isn't that useful if you don't have diff,
but still it would be nice to fail in a more gracefull way.

To reproduce, set ediff-diff-program to something that doesn't exist
and require ediff.

Debugger entered--Lisp error: (file-error "Searching for program" "no
such file or directory" "diff")
 call-process("diff" nil nil nil "--binary" "NUL" "NUL")
 apply(call-process ("diff" nil nil nil "--binary" "NUL" "NUL"))
 ediff-diff-mandatory-option("diff")
 ediff-reset-diff-options(ediff-diff-options "")
 custom-initialize-reset(ediff-diff-options "")
 custom-declare-variable(ediff-diff-options ""
("r:/Dev/Common/Util/Emacs/lisp/ediff-diff.elc" . -3371) :set
ediff-reset-diff-options :type string :group ediff-diff)
 require(ediff-diff)

I came across a similar problem in one of my own packages that uses
call-process to determine what options an external program supports.

It's easy to fix by checking first that executable-find returns non-nil,
or by wrapping call-process in condition-case.

But that wasn't necessary before, so I suspect that call-process has
changed to now signal an error.  If that's intentional, its doc string
should be updated, because currently it says only this:

| If BUFFER is 0, `call-process' returns immediately with value nil.
| Otherwise it waits for PROGRAM to terminate
| and returns a numeric exit status or a signal description string.
| If you quit, the process is killed with SIGINT, or SIGKILL if you quit again.

--
Kevin





reply via email to

[Prev in Thread] Current Thread [Next in Thread]