From: Mattias EngdegÄrd Date: Sat, 31 Oct 2020 16:19:44 +0000 (+0100) Subject: Fix eshell glob modifiers X-Git-Tag: emacs-28.0.90~5311 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=0ef5bbd5d4d633135224d69a9f1b8a8713be0a43;p=emacs.git Fix eshell glob modifiers Modified globbing such as *.txt(W) for all world-writable files ending in .txt apparently never worked correctly. * lisp/eshell/em-pred.el (eshell-predicate-alist): Use correct elisp syntax for octal constants. (eshell-pred-file-mode): Return a boolean, not a number. --- diff --git a/lisp/eshell/em-pred.el b/lisp/eshell/em-pred.el index c26f654e278..59139da10db 100644 --- a/lisp/eshell/em-pred.el +++ b/lisp/eshell/em-pred.el @@ -73,18 +73,18 @@ ordinary strings." (?p . (eshell-pred-file-type ?p)) ; named pipes (?@ . (eshell-pred-file-type ?l)) ; symbolic links (?% . (eshell-pred-file-type ?%)) ; allow user to specify (c def.) - (?r . (eshell-pred-file-mode 0400)) ; owner-readable - (?w . (eshell-pred-file-mode 0200)) ; owner-writable - (?x . (eshell-pred-file-mode 0100)) ; owner-executable - (?A . (eshell-pred-file-mode 0040)) ; group-readable - (?I . (eshell-pred-file-mode 0020)) ; group-writable - (?E . (eshell-pred-file-mode 0010)) ; group-executable - (?R . (eshell-pred-file-mode 0004)) ; world-readable - (?W . (eshell-pred-file-mode 0002)) ; world-writable - (?X . (eshell-pred-file-mode 0001)) ; world-executable - (?s . (eshell-pred-file-mode 4000)) ; setuid - (?S . (eshell-pred-file-mode 2000)) ; setgid - (?t . (eshell-pred-file-mode 1000)) ; sticky bit + (?r . (eshell-pred-file-mode #o0400)) ; owner-readable + (?w . (eshell-pred-file-mode #o0200)) ; owner-writable + (?x . (eshell-pred-file-mode #o0100)) ; owner-executable + (?A . (eshell-pred-file-mode #o0040)) ; group-readable + (?I . (eshell-pred-file-mode #o0020)) ; group-writable + (?E . (eshell-pred-file-mode #o0010)) ; group-executable + (?R . (eshell-pred-file-mode #o0004)) ; world-readable + (?W . (eshell-pred-file-mode #o0002)) ; world-writable + (?X . (eshell-pred-file-mode #o0001)) ; world-executable + (?s . (eshell-pred-file-mode #o4000)) ; setuid + (?S . (eshell-pred-file-mode #o2000)) ; setgid + (?t . (eshell-pred-file-mode #o1000)) ; sticky bit (?U . #'(lambda (file) ; owned by effective uid (if (file-exists-p file) (= (file-attribute-user-id (file-attributes file)) @@ -478,7 +478,7 @@ that `ls -l' will show in the first column of its display." `(lambda (file) (let ((modes (file-modes file 'nofollow))) (if modes - (logand ,mode modes))))) + (not (zerop (logand ,mode modes))))))) (defun eshell-pred-file-links () "Return a predicate to test whether a file has a given number of links."