Commit 822b17d3 authored by Michaël Cadilhac's avatar Michaël Cadilhac
Browse files

(dired-do-chmod): Change to use the built-in `set-file-modes' and the

symbolic mode parsing functions.
parent f664fee9
......@@ -8,6 +8,9 @@
(read-file-modes): New. Read either an octal value of a file mode or a
symbolic value, and return its numeric value.
* dired-aux.el (dired-do-chmod): Change to use the built-in
`set-file-modes' and the previous symbolic mode parsing functions.
2007-09-10 Stefan Monnier <>
* textmodes/texinfo.el: Remove spurious * in docstrings.
......@@ -253,9 +253,20 @@ List has a form of (file-name full-file-name (attribute-list))"
(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)
(if num-modes num-modes
(file-modes-symbolic-to-number modes (file-modes file)))))
(dired-do-redisplay arg)))
(defun dired-do-chgrp (&optional arg)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment