# HG changeset patch # User Micha¸«³l Cadilhac # Date 1189418296 0 # Node ID 20b4ed0e2a05443a2b990ff22bd8233c331f9ae7 # Parent 4a28dfc9900f126e11565796061b954ade263309 (dired-do-chmod): Change to use the built-in `set-file-modes' and the symbolic mode parsing functions. diff -r 4a28dfc9900f -r 20b4ed0e2a05 lisp/dired-aux.el --- a/lisp/dired-aux.el Mon Sep 10 09:56:11 2007 +0000 +++ b/lisp/dired-aux.el Mon Sep 10 09:58:16 2007 +0000 @@ -253,9 +253,20 @@ ;;;###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)