emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

master 0ef5bbd: Fix eshell glob modifiers


From: Mattias Engdegård
Subject: master 0ef5bbd: Fix eshell glob modifiers
Date: Sat, 31 Oct 2020 13:09:47 -0400 (EDT)

branch: master
commit 0ef5bbd5d4d633135224d69a9f1b8a8713be0a43
Author: Mattias Engdegård <mattiase@acm.org>
Commit: Mattias Engdegård <mattiase@acm.org>

    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.
---
 lisp/eshell/em-pred.el | 26 +++++++++++++-------------
 1 file changed, 13 insertions(+), 13 deletions(-)

diff --git a/lisp/eshell/em-pred.el b/lisp/eshell/em-pred.el
index c26f654..59139da 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."



reply via email to

[Prev in Thread] Current Thread [Next in Thread]