branch: elpa/helm
commit d1a510f012a7d8b42ad4cc55112911fb22279402
Author: Thierry Volpiatto <[email protected]>
Commit: Thierry Volpiatto <[email protected]>

    Fix compat for helm-ff-octal-permissions as
    
    file-modes-symbolic-to-number is much older (2007) than
    file-modes-number-to-symbolic (2021).
---
 helm-utils.el | 22 ----------------------
 1 file changed, 22 deletions(-)

diff --git a/helm-utils.el b/helm-utils.el
index 3269011888..0f82c5b170 100644
--- a/helm-utils.el
+++ b/helm-utils.el
@@ -800,31 +800,9 @@ If STRING is non--nil return instead a space separated 
string."
 (defun helm-ff-octal-permissions (perms)
   "Return the numeric representation of PERMS.
 PERMS is the list of permissions for owner, group and others."
-  (if (fboundp 'file-modes-symbolic-to-number)
-      (helm-ff-octal-permissions-1 perms)
-    (helm-ff-octal-permissions-2 perms)))
-
-(defun helm-ff-octal-permissions-1 (perms)
   (let ((modes (apply 'format "u=%s,g=%s,o=%s" perms)))
     (format "%o" (file-modes-symbolic-to-number modes))))
 
-(defun helm-ff-octal-permissions-2 (perms)
-  "Return the numeric representation of PERMS.
-PERMS is the list of permissions for owner, group and others."
-  (cl-flet ((string-to-octal (str)
-              (cl-loop for c across str
-                       sum (pcase c
-                             (?r 4)
-                             (?w 2)
-                             (?x 1)
-                             (_ 0)))))
-    (cl-loop with sb = ""
-             for str in perms
-             when (string-match "t" str)
-             do (setq sb "1")
-             concat (number-to-string (string-to-octal str)) into modes
-             finally return (concat sb modes))))
-
 (defun helm-format-columns-of-files (files)
   "Same as `dired-format-columns-of-files'.
 Inlined here for compatibility."

Reply via email to