mirror of
https://git.savannah.gnu.org/git/emacs.git
synced 2024-12-26 10:49:33 +00:00
(dired-do-chmod): Change to use the built-in `set-file-modes' and the
symbolic mode parsing functions.
This commit is contained in:
parent
f664fee97d
commit
822b17d34c
@ -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 <monnier@iro.umontreal.ca>
|
||||
|
||||
* textmodes/texinfo.el: Remove spurious * in docstrings.
|
||||
|
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user