;;; em-pred.el --- argument predicates and modifiers (ala zsh) -*- lexical-binding:t -*-
-;; Copyright (C) 1999-2015 Free Software Foundation, Inc.
+;; Copyright (C) 1999-2016 Free Software Foundation, Inc.
;; Author: John Wiegley <johnw@gnu.org>
OWNERSHIP:
U owned by effective uid
- u(UID|'user') owned by UID/user
- g(GID|'group') owned by GID/group
+ u(UID|\\='user\\=') owned by UID/user
+ g(GID|\\='group\\=') owned by GID/group
FILE ATTRIBUTES:
l[+-]N +/-/= N links
- a[Mwhms][+-](N|'FILE') access time +/-/= N months/weeks/hours/mins/secs
+ a[Mwhms][+-](N|\\='FILE\\=') access time +/-/= N months/weeks/hours/mins/secs
(days if unspecified) if FILE specified,
- use as comparison basis; so a+'file.c'
+ 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...
+ m[Mwhms][+-](N|\\='FILE\\=') modification time...
+ c[Mwhms][+-](N|\\='FILE\\=') change time...
L[kmp][+-]N file size +/-/= N Kb/Mb/blocks
EXAMPLES:
***/*~f*(-/) recursively (though not traversing symlinks),
find all directories (or symlinks referring to
directories) whose names do not begin with f.
- e*(*Lk+50) executables 50k or larger beginning with 'e'")
+ e*(*Lk+50) executables 50k or larger beginning with `e'")
(defvar eshell-modifier-help-string
"Eshell modifier quick reference:
(if (and func (functionp func))
(setq preds (eshell-add-pred-func func preds
negate follow))
- (error "Invalid function predicate '%s'"
+ (error "Invalid function predicate `%s'"
(eshell-stringify func))))
(error "Invalid function predicate")))
((eq char ?^)
(cons `(lambda (lst)
(mapcar (function ,func) lst))
mods))
- (error "Invalid function modifier '%s'"
+ (error "Invalid function modifier `%s'"
(eshell-stringify func))))
(error "Invalid function modifier")))
((eq char ?:)
(forward-char)
(let ((mod (assq (char-after) eshell-modifier-alist)))
(if (not mod)
- (error "Unknown modifier character '%c'" (char-after))
+ (error "Unknown modifier character `%c'" (char-after))
(forward-char)
(setq mods (cons (eval (cdr mod)) mods)))))
(t
(let ((pred (assq char eshell-predicate-alist)))
(if (not pred)
- (error "Unknown predicate character '%c'" char)
+ (error "Unknown predicate character `%c'" char)
(forward-char)
(setq preds
(eshell-add-pred-func (eval (cdr pred)) preds
(defun eshell-pred-file-type (type)
"Return a test which tests that the file is of a certain TYPE.
TYPE must be a character, and should be one of the possible options
-that 'ls -l' will show in the first column of its display. "
+that `ls -l' will show in the first column of its display. "
(when (eq type ?%)
(setq type (char-after))
(if (memq type '(?b ?c))