%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /usr/local/share/emacs/27.2/lisp/
Upload File :
Create Path :
Current File : //usr/local/share/emacs/27.2/lisp/find-cmd.elc

;ELC
;;; Compiled
;;; in Emacs version 27.2
;;; with all optimizations.

;;; This file uses dynamic docstrings, first added in Emacs 19.29.

;;; This file does not contain utf-8 non-ASCII characters,
;;; and so can be loaded in Emacs versions earlier than 23.

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;


(require 'grep)
#@267 Holds details of each of the find options.
The car of each alist is the name.  The cdr is minimum args, the
function used to join many occurrences of the argument together,
and whether or not to leave quotes off the string (non-nil means
the string will be quoted).
(defconst find-constituents '((and . find-and) (not . find-not) (or . find-or) (a . find-and) (n . find-not) (o . find-or) (prune . find-prune) (L 0) (P 0) (H 0) (amin 1) (anewer 1) (atime 1) (cmin 1) (cnewer 1) (ctime 1) (empty 0) (executable 0) (false 0) (fstype 1) (gid 1) (group 1) (ilname 1) (iname 1) (inum 1) (ipath 1) (iregex 1) (iwholename 1) (links 1) (lname 1) (mmin 1) (mtime 1) (name 1) (newer 1) (nogroup 0) (nouser 0) (path 1) (perm 0) (readable 0) (regex 1) (samefile 1) (size 1) (true 0) (type 1) (uid 1) (used 1) (user 1) (wholename 1) (writable 0) (xtype nil) (daystart 0) (depth 0) (maxdepth 1) (mindepth 1) (mount 0) (noleaf 0) (ignore_readdir_race 0) (noignore_readdir_race 0) (regextype 1) (xdev 0) (delete 0) (print0 0) (printf 1) (fprintf 2) (print 0) (fprint0 1) (fprint 1) (ls 0) (fls 1) (prune 0) (quit 0) (exec 1 find-command t) (ok 1 find-command t) (execdir 1 find-command t) (okdir 1 find-command t)) (#$ . 425))
#@352 Initiate the building of a find command.
For example:

(find-cmd \='(prune (name ".svn" ".git" ".CVS"))
          \='(and (or (name "*.pl" "*.pm" "*.t")
                    (mtime "+1"))
                (fstype "nfs" "ufs"))))

`default-directory' is used as the initial search path.  The
result is a string that should be ready for the command line.
(defalias 'find-cmd #[(&rest subfinds) "\303\304\305	!!\303\nA\203\306\307\n\310#\202\307\n@!\260\207" [find-program default-directory subfinds " " shell-quote-argument expand-file-name mapconcat find-to-string ""] 8 (#$ . 1643)])
#@125 And FORMs together, so:
  (and (mtime "+1") (name "something"))
will produce:
  find . \( -mtime +1 -and -name something \)
(defalias 'find-and #[(form) "G\301W\203\f\302@!\207\303\304\302\305#\306Q\207" [form 2 find-to-string "\\( " mapconcat "-and " "\\) "] 5 (#$ . 2238)])
#@122 Or FORMs together, so:
  (or (mtime "+1") (name "something"))
will produce:
  find . \( -mtime +1 -or -name something \)
(defalias 'find-or #[(form) "G\301W\203\f\302@!\207\303\304\302\305#\306Q\207" [form 2 find-to-string "\\( " mapconcat "-or " "\\) "] 5 (#$ . 2525)])
#@265 Or FORMs together and prefix with a -not, so:
  (not (mtime "+1") (name "something"))
will produce:
  -not \( -mtime +1 -or -name something \)
If you wanted the FORMs -and(ed) together instead then this would
suffice:
  (not (and (mtime "+1") (name "something")))
(defalias 'find-not #[(form) "\301\302\303\304\"!P\207" [form "-not " find-or mapcar find-to-string] 5 (#$ . 2807)])
#@229 -or together FORMs postfix `-prune' and then -or that with a
-true, so:
  ((prune (name ".svn" ".git")) (name "*.pm"))
will produce (unwrapped):
  \( \( \( -name .svn -or -name .git \) /
  -prune -or -true \) -and -name *.pm \)
(defalias 'find-prune #[(form) "\301\211\302\303\"!\304\305!P\304\306!D!\207" [form find-or mapcar find-to-string find-generic "prune" "true"] 5 (#$ . 3196)])
#@328 Allow an arbitrary string to be used as a form.
OPTION is the name of the form, OPER is the function used to either
OR or AND multiple results together.  ARGCOUNT is the minimum of
args that OPTION can receive and ARGS are the arguments for OPTION.
If DONT-QUOTE is non-nil, arguments are quoted for passing them to
the shell.
(defalias 'find-generic #[(option &optional oper argcount args dont-quote) "\247\203	GW\203\304\305\n#\210\206\306	\203*	G\203*\307\310	\"!\202.\311\n\312Q)\207" [argcount args option oper error "`%s' needs at least %d arguments" find-or mapcar #[(x) "\303	\203
\304\n\304Q\202\304\305\n!\304QQ\207" [option dont-quote x "-" " " shell-quote-argument] 5] "-" " "] 4 (#$ . 3591)])
#@121 For each item in FORM add a terminating semi-colon and turn
them into valid switches.  The result is -and(ed) together.
(defalias 'find-command #[(form) "\301\302\303\"!\207" [form find-and mapcar #[(x) "\301!\302P\207" [x find-to-string "\\; "] 2]] 4 (#$ . 4323)])
#@54 Parse FORM to produce a set of valid find arguments.
(defalias 'find-to-string #[(form) ";\203\207:\205O\306@	\"A\2119\203%\307\n!\203%\nA!\202N\n:\203I\310@!\n@\nA@\nAA@\311\312\n\f
A%!,\202N\313\314@\")\207" [form find-constituents option dont-quote oper argcnt assoc fboundp symbol-name find-to-string find-generic error "Sorry I don't know how to handle `%s'"] 8 (#$ . 4597)])
(provide 'find-cmd)

Zerion Mini Shell 1.0