comparison lisp/find-dired.el @ 10168:64163654c255

(find-grep-options): Use -q on non-BSD systems. (find-ls-option): Don't ask for inode numbers.
author Richard M. Stallman <rms@gnu.org>
date Thu, 15 Dec 1994 12:16:29 +0000
parents d95a8d8ab0f4
children 8102a6447ea0
comparison
equal deleted inserted replaced
10167:358d48409854 10168:64163654c255
5 ;; Author: Roland McGrath <roland@gnu.ai.mit.edu>, 5 ;; Author: Roland McGrath <roland@gnu.ai.mit.edu>,
6 ;; Sebastian Kremer <sk@thp.uni-koeln.de> 6 ;; Sebastian Kremer <sk@thp.uni-koeln.de>
7 ;; Maintainer: Sebastian Kremer <sk@thp.uni-koeln.de> 7 ;; Maintainer: Sebastian Kremer <sk@thp.uni-koeln.de>
8 ;; Keywords: unix 8 ;; Keywords: unix
9 9
10 (defconst find-dired-version (substring "$Revision: 1.16 $" 11 -2) 10 (defconst find-dired-version (substring "$Revision: 1.17 $" 11 -2)
11 "$Id: find-dired.el,v 1.16 1994/05/03 23:39:55 kwzh Exp rms $") 11 "$Id: find-dired.el,v 1.17 1994/11/19 14:03:23 rms Exp rms $")
12 12
13 ;;; This program is free software; you can redistribute it and/or modify 13 ;;; This program is free software; you can redistribute it and/or modify
14 ;;; it under the terms of the GNU General Public License as published by 14 ;;; it under the terms of the GNU General Public License as published by
15 ;;; the Free Software Foundation; either version 1, or (at your option) 15 ;;; the Free Software Foundation; either version 1, or (at your option)
16 ;;; any later version. 16 ;;; any later version.
31 ;; LISPDIR ENTRY for the Elisp Archive =============================== 31 ;; LISPDIR ENTRY for the Elisp Archive ===============================
32 ;; LCD Archive Entry: 32 ;; LCD Archive Entry:
33 ;; find-dired|Roland McGrath, Sebastian Kremer 33 ;; find-dired|Roland McGrath, Sebastian Kremer
34 ;; |roland@gnu.ai.mit.edu, sk@thp.uni-koeln.de 34 ;; |roland@gnu.ai.mit.edu, sk@thp.uni-koeln.de
35 ;; |Run a `find' command and dired the output 35 ;; |Run a `find' command and dired the output
36 ;; |$Date: 1994/05/03 23:39:55 $|$Revision: 1.16 $| 36 ;; |$Date: 1994/11/19 14:03:23 $|$Revision: 1.17 $|
37 37
38 ;; INSTALLATION ====================================================== 38 ;; INSTALLATION ======================================================
39 39
40 ;; To use this file, byte-compile it, install it somewhere in your 40 ;; To use this file, byte-compile it, install it somewhere in your
41 ;; load-path, and put: 41 ;; load-path, and put:
58 58
59 (require 'dired) 59 (require 'dired)
60 60
61 ;;;###autoload 61 ;;;###autoload
62 (defvar find-ls-option (if (eq system-type 'berkeley-unix) "-ls" 62 (defvar find-ls-option (if (eq system-type 'berkeley-unix) "-ls"
63 "-exec ls -ldi {} \\;") 63 "-exec ls -ld {} \\;")
64 "*Option to `find' to produce an `ls -l'-type listing.") 64 "*Option to `find' to produce an `ls -l'-type listing.")
65 65
66 ;;;###autoload 66 ;;;###autoload
67 (defvar find-grep-options (if (eq system-type 'berkeley-unix) "-s" "-l") 67 (defvar find-grep-options (if (eq system-type 'berkeley-unix) "-s" "-q")
68 "*Option to grep to be as silent as possible. 68 "*Option to grep to be as silent as possible.
69 On Berkeley systems, this is `-s', for others it seems impossible to 69 On Berkeley systems, this is `-s'; on Posix, and with GNU grep, `-q' does it.
70 suppress all output, so `-l' is used to print nothing more than the 70 On other systems, the closest you can come is to use `-l'.")
71 file name.")
72 71
73 (defvar find-args nil 72 (defvar find-args nil
74 "Last arguments given to `find' by \\[find-dired].") 73 "Last arguments given to `find' by \\[find-dired].")
75 74
76 ;;;###autoload 75 ;;;###autoload
155 The command run (after changing into DIR) is 154 The command run (after changing into DIR) is
156 155
157 find . -exec grep -s ARG {} \\\; -ls 156 find . -exec grep -s ARG {} \\\; -ls
158 157
159 Thus ARG can also contain additional grep options." 158 Thus ARG can also contain additional grep options."
160 (interactive "DFind-grep (directory): \nsFind-grep (grep args): ") 159 (interactive "DFind-grep (directory): \nsFind-grep (grep regexp): ")
161 ;; find -exec doesn't allow shell i/o redirections in the command, 160 ;; find -exec doesn't allow shell i/o redirections in the command,
162 ;; or we could use `grep -l >/dev/null' 161 ;; or we could use `grep -l >/dev/null'
163 (find-dired dir 162 (find-dired dir
164 (concat "! -type d -exec grep " find-grep-options " " 163 (concat "! -type d -exec grep " find-grep-options " "
165 args " {} \\\; "))) 164 args " {} \\\; ")))