comparison lisp/progmodes/grep.el @ 53750:4deb14fde58c

(grep-compute-defaults): Use executable-command-find-posix-p. (grep-find): Check `grep-find-command'.
author Richard M. Stallman <rms@gnu.org>
date Thu, 29 Jan 2004 17:54:36 +0000
parents 23376885b0f9
children 823980f7d612
comparison
equal deleted inserted replaced
53749:fef39a2085e4 53750:4deb14fde58c
316 "-0" "-e" "echo") 316 "-0" "-e" "echo")
317 0)) 317 0))
318 'gnu))) 318 'gnu)))
319 (unless grep-find-command 319 (unless grep-find-command
320 (setq grep-find-command 320 (setq grep-find-command
321 (cond ((eq grep-find-use-xargs 'gnu) 321 (cond ((not (executable-command-find-unix-p "find"))
322 (message
323 (concat "compile.el: Unix type find(1) not found. "
324 "Please set `grep-find-command'."))
325 nil)
326 ((eq grep-find-use-xargs 'gnu)
322 (format "%s . -type f -print0 | xargs -0 -e %s" 327 (format "%s . -type f -print0 | xargs -0 -e %s"
323 find-program grep-command)) 328 find-program grep-command))
324 (grep-find-use-xargs 329 (grep-find-use-xargs
325 (format "%s . -type f -print | xargs %s" 330 (format "%s . -type f -print | xargs %s"
326 find-program grep-command)) 331 find-program grep-command))
441 easily repeat a find command." 446 easily repeat a find command."
442 (interactive 447 (interactive
443 (progn 448 (progn
444 (unless grep-find-command 449 (unless grep-find-command
445 (grep-compute-defaults)) 450 (grep-compute-defaults))
446 (list (read-from-minibuffer "Run find (like this): " 451 (if grep-find-command
447 grep-find-command nil nil 452 (list (read-from-minibuffer "Run find (like this): "
448 'grep-find-history)))) 453 grep-find-command nil nil
449 (let ((null-device nil)) ; see grep 454 'grep-find-history))
450 (grep command-args))) 455 ;; No default was set
456 (read-string
457 "compile.el: No `grep-find-command' command available. Press RET.")
458 (list nil))))
459 (when (and grep-find-command command-args)
460 (let ((null-device nil)) ; see grep
461 (grep command-args))))
451 462
452 (defun grep-expand-command-macros (command &optional regexp files dir excl case-fold) 463 (defun grep-expand-command-macros (command &optional regexp files dir excl case-fold)
453 "Patch grep COMMAND replacing <D>, etc." 464 "Patch grep COMMAND replacing <D>, etc."
454 (setq command 465 (setq command
455 (replace-regexp-in-string "<D>" 466 (replace-regexp-in-string "<D>"