all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* [patch] 21.3 compile.el -- grep-find fix
@ 2004-01-27 13:24 Jari Aalto+mail.linux
  0 siblings, 0 replies; only message in thread
From: Jari Aalto+mail.linux @ 2004-01-27 13:24 UTC (permalink / raw)



This patch assumes that executable.el has been patched.

2004-01-27 Tue  Jari Aalto  <jari.aalto <AT> poboxes.com>

        * progmodes/compile.el
        (top level): Added atuload for `executable-command-find-unix-p'
        (grep-compute-defaults):
        Check if `grep-find-command' is Unix type find(1), if
        not, print message and set grep-find-command to nil.
        (grep-find): Check `grep-find-command'.


Index: compile.el
===================================================================
RCS file: /cygdrive/h/data/version-control/cvsroot/emacs/gnu-emacs/lisp213/progmodes/compile.el,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -IId: -b -w -u -r1.2 -r1.3
--- compile.el	14 Aug 2003 20:37:05 -0000	1.2
+++ compile.el	27 Jan 2004 13:21:55 -0000	1.3
@@ -31,6 +31,8 @@
 
 ;;; Code:
 
+(autoload 'executable-command-find-unix-p "executable")
+
 (defgroup compilation nil
   "Run compiler as inferior of Emacs, parse error messages."
   :group 'tools
@@ -88,7 +90,13 @@
               'gnu)))
   (unless grep-find-command
     (setq grep-find-command
-          (cond ((eq grep-find-use-xargs 'gnu)
+          (cond
+           ((not (executable-command-find-unix-p "find"))
+            (message
+             (concat "compile.el: Unix type find(1) not found. "
+                     "Please set `grep-find-command'."))
+            nil)
+           ((eq grep-find-use-xargs 'gnu)
                  (format "%s . -type f -print0 | xargs -0 -e %s"
                          find-program grep-command))
                 (grep-find-use-xargs
@@ -698,11 +706,17 @@
    (progn
      (unless grep-find-command
        (grep-compute-defaults))
+     (if grep-find-command
      (list (read-from-minibuffer "Run find (like this): "
                                  grep-find-command nil nil
-                                 'grep-find-history))))
+                                     'grep-find-history))
+       ;; No default was set
+       (read-string
+        "compile.el: No `grep-find-command' command available. Press RET.")
+       (list nil))))
+  (when (and grep-find-command command-args)
   (let ((null-device nil))              ; see grep
-    (grep command-args)))
+      (grep command-args))))
 
 (defcustom compilation-scroll-output nil
   "*Non-nil to scroll the *compilation* buffer window as output appears.



-- 
http://tiny-tools.sourceforge.net/
Swatch @time   http://www.mir.com.my/iTime/itime.htm
               http://www.ryanthiessen.com/swatch/resources.htm
Use Licenses!  http://www.linuxjournal.com/article.php?sid=6225
Which Licence? http://www.linuxjournal.com/article.php?sid=4825
OSI Licences   http://www.opensource.org/licenses/

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2004-01-27 13:24 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-01-27 13:24 [patch] 21.3 compile.el -- grep-find fix Jari Aalto+mail.linux

Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.