]> code.delx.au - gnu-emacs/blobdiff - lisp/eshell/em-pred.el
(c-emacs-features): Fix typo in docstring.
[gnu-emacs] / lisp / eshell / em-pred.el
index c3e3de5adbd57a3f360f6b41d2e8e5664fafea1d..71e34346d778d26b1e76bc0bdbad74b33541fc4c 100644 (file)
@@ -1,6 +1,9 @@
-;;; em-pred --- argument predicates and modifiers (ala zsh)
+;;; em-pred.el --- argument predicates and modifiers (ala zsh)
 
-;; Copyright (C) 1999, 2000 Free Software Foundation
+;; Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004,
+;;   2005, 2006, 2007 Free Software Foundation, Inc.
+
+;; Author: John Wiegley <johnw@gnu.org>
 
 ;; This file is part of GNU Emacs.
 
@@ -16,8 +19,8 @@
 
 ;; You should have received a copy of the GNU General Public License
 ;; along with GNU Emacs; see the file COPYING.  If not, write to the
-;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-;; Boston, MA 02111-1307, USA.
+;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+;; Boston, MA 02110-1301, USA.
 
 (provide 'em-pred)
 
@@ -56,6 +59,8 @@ ordinary strings."
 ;; See the zsh docs for more on the syntax ([(zsh.info)Filename
 ;; Generation]).
 
+;;; Code:
+
 ;;; User Variables:
 
 (defcustom eshell-pred-load-hook '(eshell-pred-initialize)
@@ -109,7 +114,7 @@ The format of each entry is
 (put 'eshell-predicate-alist 'risky-local-variable t)
 
 (defcustom eshell-modifier-alist
-  '((?e . '(lambda (lst)
+  '((?E . '(lambda (lst)
             (mapcar
              (function
               (lambda (str)
@@ -182,12 +187,13 @@ OWNERSHIP:
 
 FILE ATTRIBUTES:
   l[+-]N                 +/-/= N links
-  a[Mwhm][+-](N|'FILE')  access time +/-/= N mnths/weeks/days/mins
-                        if FILE specified, use as comparison basis;
-                        so a+'file.c' shows files accessed before
-                        file.c was last accessed
-  m[Mwhm][+-](N|'FILE')  modification time...
-  c[Mwhm][+-](N|'FILE')  change time...
+  a[Mwhms][+-](N|'FILE') access time +/-/= N mnths/weeks/hours/mins/secs
+                        (days if unspecified) if FILE specified,
+                        use as comparison basis; so a+'file.c'
+                        shows files accessed before file.c was
+                        last accessed
+  m[Mwhms][+-](N|'FILE') modification time...
+  c[Mwhms][+-](N|'FILE') change time...
   L[kmp][+-]N            file size +/-/= N Kb/Mb/blocks
 
 EXAMPLES:
@@ -203,7 +209,7 @@ EXAMPLES:
   "Eshell modifier quick reference:
 
 FOR SINGLE ARGUMENTS, or each argument of a list of strings:
-  e  evaluate again
+  E  evaluate again
   L  lowercase
   U  uppercase
   C  capitalize
@@ -214,7 +220,7 @@ FOR SINGLE ARGUMENTS, or each argument of a list of strings:
   q  escape special characters
 
   S       split string at any whitespace character
-  S/PAT/  split string at each occurance of PAT
+  S/PAT/  split string at each occurrence of PAT
 
 FOR LISTS OF ARGUMENTS:
   o  sort alphabetically
@@ -228,7 +234,7 @@ FOR LISTS OF ARGUMENTS:
   x/PAT/  exclude all members matching PAT
 
   s/pat/match/  substitute PAT with MATCH
-  g/pat/match/  substitute PAT with MATCH for all occurances
+  g/pat/match/  substitute PAT with MATCH for all occurrences
 
 EXAMPLES:
   *.c(:o)  sorted list of .c files")
@@ -251,7 +257,6 @@ EXAMPLES:
 
 (defun eshell-pred-initialize ()
   "Initialize the predicate/modifier code."
-  (make-local-hook 'eshell-parse-argument-hook)
   (add-hook 'eshell-parse-argument-hook
            'eshell-parse-arg-modifier t t)
   (define-key eshell-command-map [(meta ?q)] 'eshell-display-predicate-help)
@@ -406,7 +411,7 @@ returning the resultant string."
   "Return a predicate to test whether a file matches a certain time."
   (let* ((quantum 86400)
         qual amount when open close end)
-    (when (memq (char-after) '(?M ?w ?h ?m))
+    (when (memq (char-after) '(?M ?w ?h ?m ?s))
       (setq quantum (char-after))
       (cond
        ((eq quantum ?M)
@@ -464,7 +469,7 @@ that 'ls -l' will show in the first column of its display. "
        (forward-char)
       (setq type ?%)))
   `(lambda (file)
-     (let ((attrs (file-attributes (directory-file-name file))))
+     (let ((attrs (eshell-file-attributes (directory-file-name file))))
        (if attrs
           (memq (aref (nth 8 attrs) 0)
                 ,(if (eq type ?%)
@@ -489,7 +494,7 @@ that 'ls -l' will show in the first column of its display. "
     (setq amount (string-to-number (match-string 0)))
     (goto-char (match-end 0))
     `(lambda (file)
-       (let ((attrs (file-attributes file)))
+       (let ((attrs (eshell-file-attributes file)))
         (if attrs
             (,(if (eq qual ?-)
                   '<
@@ -518,7 +523,7 @@ that 'ls -l' will show in the first column of its display. "
     (setq amount (* (string-to-number (match-string 0)) quantum))
     (goto-char (match-end 0))
     `(lambda (file)
-       (let ((attrs (file-attributes file)))
+       (let ((attrs (eshell-file-attributes file)))
         (if attrs
             (,(if (eq qual ?-)
                   '<
@@ -597,6 +602,5 @@ that 'ls -l' will show in the first column of its display. "
         (lambda (str)
           (split-string str ,sep))) lst))))
 
-;;; Code:
-
+;;; arch-tag: 8b5ce022-17f3-4c40-93c7-5faafaa63f31
 ;;; em-pred.el ends here