> I stepped through jde-find, and it seems that it is calling 
> executable-find
> to find "grep"; however the actual name is "grep.exe" on 
> Windows.   I tried
> copying grep.exe to grep, but that didn't work.  Any ideas?

Yes, itīs a bug in JDE. The GNUEmacs version of executable-find
works also for program-names without extension whereas the XEmacs-
version needs the complete name incl. extension.
I can remember that there was already a discussion about executable-find
in this mailing list, concerning finding the "wget" program.

IMHO there are two options for JDE:
1. Setting some defconsts:
(defconst grep-prog (if (memq system-type '(ms-dos windows-nt))
                        "grep.exe" "grep"))
Then replacing all hard-coded "grep" with grep-prog
Same for all other programs JDE needs.

Then it doesnīt matter which executable-find version is used.

2. defining the executable-find itself, maybe as jde-executable-find:
Here is the code:
(defvar jde-executable-binary-suffixes
  (if (memq system-type '(ms-dos windows-nt))
      '(".exe" ".com" ".bat" ".cmd" ".btm" "")
    '("")))
(defun jde-executable-find (command)
  "Search for COMMAND in exec-path and return the absolute file name.
Return nil if COMMAND is not found anywhere in `exec-path'."
  (let ((list exec-path)
        file)
    (while list
      (setq list
            (if (and (setq file (expand-file-name command (car list)))
                     (let ((suffixes jde-executable-binary-suffixes)
                           candidate)
                       (while suffixes
                         (setq candidate (concat file (car suffixes)))
                         (if (and (file-executable-p candidate)
                                  (not (file-directory-p candidate)))
                             (setq suffixes nil)
                           (setq suffixes (cdr suffixes))
                           (setq candidate nil)))
                       (setq file candidate)))
                nil
              (setq file nil)
              (cdr list))))
    file))

I vote for the latter one (2.) because it makes the code clean and it removes
the ugly dependency to the executable.el from the sh-script-package of XEmacs!

Other opinions?

Klaus

Reply via email to