summaryrefslogtreecommitdiff
path: root/lisp/find-cmd.el
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2015-09-17 16:08:20 -0700
committerPaul Eggert <eggert@cs.ucla.edu>2015-09-17 16:09:39 -0700
commit284c470ef752967fcd8bae6a450dc138462b1e49 (patch)
tree83e8bcfe4c756e741ee9d4ecdf80f6b8d0e73c91 /lisp/find-cmd.el
parentd149ff5233805c0a09b6067e0cf27549291cc83a (diff)
downloademacs-284c470ef752967fcd8bae6a450dc138462b1e49.tar.gz
Backslash cleanup in Elisp source files
This patch should not change behavior. It typically omits backslashes where they are redundant (e.g., in the string literal "^\$"). In a few places, insert backslashes where they make regular expressions clearer: e.g., replace "^\*" (equivalent to "^*") with "^\\*", which has the same effect as a regular expression. Also, use ‘\ %’ instead of ‘\%’ when avoiding confusion with SCCS IDs, and similarly use ‘\ $’ instead of ‘\$’ when avoiding confusion with RCS IDs, as that makes it clearer that the backslash is intended.
Diffstat (limited to 'lisp/find-cmd.el')
-rw-r--r--lisp/find-cmd.el28
1 files changed, 14 insertions, 14 deletions
diff --git a/lisp/find-cmd.el b/lisp/find-cmd.el
index d78a0b35fab..71c7a9b9c77 100644
--- a/lisp/find-cmd.el
+++ b/lisp/find-cmd.el
@@ -140,10 +140,10 @@ the string will be quoted).")
"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\"\)\)\)\)
+\(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."
@@ -159,9 +159,9 @@ result is a string that should be ready for the command line."
(defun find-and (form)
"And FORMs together, so:
- \(and \(mtime \"+1\"\) \(name \"something\"\)\)
+ (and (mtime \"+1\") (name \"something\"))
will produce:
- find . \\\( -mtime +1 -and -name something \\\)"
+ find . \\( -mtime +1 -and -name something \\)"
(if (< (length form) 2)
(find-to-string (car form))
(concat "\\( "
@@ -170,9 +170,9 @@ will produce:
(defun find-or (form)
"Or FORMs together, so:
- \(or \(mtime \"+1\"\) \(name \"something\"\)\)
+ (or (mtime \"+1\") (name \"something\"))
will produce:
- find . \\\( -mtime +1 -or -name something \\\)"
+ find . \\( -mtime +1 -or -name something \\)"
(if (< (length form) 2)
(find-to-string (car form))
(concat "\\( "
@@ -181,21 +181,21 @@ will produce:
(defun find-not (form)
"Or FORMs together and prefix with a -not, so:
- \(not \(mtime \"+1\"\) \(name \"something\"\)\)
+ (not (mtime \"+1\") (name \"something\"))
will produce:
- -not \\\( -mtime +1 -or -name something \\\)
+ -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\"\)\)\)"
+ (not (and (mtime \"+1\") (name \"something\")))"
(concat "-not " (find-or (mapcar #'find-to-string form))))
(defun find-prune (form)
"-or together FORMs postfix `-prune' and then -or that with a
-true, so:
- \(\(prune \(name \".svn\" \".git\"\)\) \(name \"*.pm\"\)\)
+ ((prune (name \".svn\" \".git\")) (name \"*.pm\"))
will produce (unwrapped):
- \\\( \\\( \\\( -name .svn -or -name .git \\\) /
- -prune -or -true \\\) -and -name *.pm \\\)"
+ \\( \\( \\( -name .svn -or -name .git \\) /
+ -prune -or -true \\) -and -name *.pm \\)"
(find-or
(list
(concat (find-or (mapcar #'find-to-string form)) (find-generic "prune"))