aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDmitry Antipov2012-04-16 21:49:40 -0400
committerGlenn Morris2012-04-16 21:49:40 -0400
commit30009afd5b72606149d13eba52cf1a3ab96e3cc5 (patch)
tree9f7e8453d7e078e6b5801346d0964f18d9a31021
parente5a36063440039e18fe6db354693baf13ee7709c (diff)
downloademacs-30009afd5b72606149d13eba52cf1a3ab96e3cc5.tar.gz
emacs-30009afd5b72606149d13eba52cf1a3ab96e3cc5.zip
Add user, group name completion to dired
Note from committer: I modified the original patch, by adding the new collection argument at the end of the argument list rather than in the middle. * dired-aux.el (dired-mark-read-string): Offer optional completion. (dired-do-chxxx): Complete chown, chgrp over users, groups. Fixes: debbugs:7900
-rw-r--r--lisp/ChangeLog5
-rw-r--r--lisp/dired-aux.el12
2 files changed, 13 insertions, 4 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 599a69bb9c2..31caf9b6a34 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,8 @@
12012-04-17 Dmitry Antipov <dmantipov@yandex.ru>
2
3 * dired-aux.el (dired-mark-read-string): Offer optional completion.
4 (dired-do-chxxx): Complete chown, chgrp over users, groups. (Bug#7900)
5
12012-04-17 Glenn Morris <rgm@gnu.org> 62012-04-17 Glenn Morris <rgm@gnu.org>
2 7
3 * mouse.el (mouse-drag-track): 8 * mouse.el (mouse-drag-track):
diff --git a/lisp/dired-aux.el b/lisp/dired-aux.el
index 0795b0175a2..97ff0cbd07e 100644
--- a/lisp/dired-aux.el
+++ b/lisp/dired-aux.el
@@ -245,7 +245,11 @@ List has a form of (file-name full-file-name (attribute-list))."
245 " (default now): " 245 " (default now): "
246 ": "))) 246 ": ")))
247 (new-attribute (dired-mark-read-string prompt nil op-symbol 247 (new-attribute (dired-mark-read-string prompt nil op-symbol
248 arg files default)) 248 arg files default
249 (cond ((eq op-symbol 'chown)
250 (system-users))
251 ((eq op-symbol 'chgrp)
252 (system-groups)))))
249 (operation (concat program " " new-attribute)) 253 (operation (concat program " " new-attribute))
250 failures) 254 failures)
251 (setq failures 255 (setq failures
@@ -385,7 +389,7 @@ Uses the shell command coming from variables `lpr-command' and
385 (dired-run-shell-command (dired-shell-stuff-it command file-list nil)))) 389 (dired-run-shell-command (dired-shell-stuff-it command file-list nil))))
386 390
387(defun dired-mark-read-string (prompt initial op-symbol arg files 391(defun dired-mark-read-string (prompt initial op-symbol arg files
388 &optional default-value) 392 &optional default-value collection)
389 "Read args for a Dired marked-files command, prompting with PROMPT. 393 "Read args for a Dired marked-files command, prompting with PROMPT.
390Return the user input (a string). 394Return the user input (a string).
391 395
@@ -399,9 +403,9 @@ of such values, available via history commands. Note that if the
399user enters empty input, this function returns the empty string, 403user enters empty input, this function returns the empty string,
400not DEFAULT-VALUE." 404not DEFAULT-VALUE."
401 (dired-mark-pop-up nil op-symbol files 405 (dired-mark-pop-up nil op-symbol files
402 'read-from-minibuffer 406 'completing-read
403 (format prompt (dired-mark-prompt arg files)) 407 (format prompt (dired-mark-prompt arg files))
404 initial nil nil nil default-value)) 408 collection nil nil initial nil default-value nil))
405 409
406;;; Cleaning a directory: flagging some backups for deletion. 410;;; Cleaning a directory: flagging some backups for deletion.
407 411