From 822b17d34c7a87a6d77edab18a9b7a3793c7a6d6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C3=ABl=20Cadilhac?= Date: Mon, 10 Sep 2007 09:58:29 +0000 Subject: (dired-do-chmod): Change to use the built-in `set-file-modes' and the symbolic mode parsing functions. --- lisp/dired-aux.el | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) (limited to 'lisp/dired-aux.el') diff --git a/lisp/dired-aux.el b/lisp/dired-aux.el index 124c53b44c5..f904238c8fa 100644 --- a/lisp/dired-aux.el +++ b/lisp/dired-aux.el @@ -253,9 +253,20 @@ List has a form of (file-name full-file-name (attribute-list))" ;;;###autoload (defun dired-do-chmod (&optional arg) "Change the mode of the marked (or next ARG) files. -This calls chmod, thus symbolic modes like `g+w' are allowed." +Symbolic modes like `g+w' are allowed." (interactive "P") - (dired-do-chxxx "Mode" dired-chmod-program 'chmod arg)) + (let* ((files (dired-get-marked-files t arg)) + (modes (dired-mark-read-string + "Change mode of %s to: " nil + 'chmod arg files)) + (num-modes (if (string-match "^[0-7]+" modes) + (string-to-number modes 8)))) + (dolist (file files) + (set-file-modes + file + (if num-modes num-modes + (file-modes-symbolic-to-number modes (file-modes file))))) + (dired-do-redisplay arg))) ;;;###autoload (defun dired-do-chgrp (&optional arg) -- cgit v1.2.1