emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] /srv/bzr/emacs/emacs-24 r107948: Add user, group name comp


From: Glenn Morris
Subject: [Emacs-diffs] /srv/bzr/emacs/emacs-24 r107948: Add user, group name completion to dired
Date: Fri, 02 Nov 2012 02:16:43 -0000
User-agent: Bazaar (2.5.0)

------------------------------------------------------------
revno: 107948
fixes bug: http://debbugs.gnu.org/7900
author: Dmitry Antipov <address@hidden>
committer: Glenn Morris <address@hidden>
branch nick: trunk
timestamp: Mon 2012-04-16 21:49:40 -0400
message:
  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.
modified:
  lisp/ChangeLog
  lisp/dired-aux.el
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog    2012-04-17 00:04:53 +0000
+++ b/lisp/ChangeLog    2012-04-17 01:49:40 +0000
@@ -1,3 +1,8 @@
+2012-04-17  Dmitry Antipov  <address@hidden>
+
+       * dired-aux.el (dired-mark-read-string): Offer optional completion.
+       (dired-do-chxxx): Complete chown, chgrp over users, groups.  (Bug#7900)
+
 2012-04-17  Glenn Morris  <address@hidden>
 
        * mouse.el (mouse-drag-track):

=== modified file 'lisp/dired-aux.el'
--- a/lisp/dired-aux.el 2012-04-01 02:44:24 +0000
+++ b/lisp/dired-aux.el 2012-04-17 01:49:40 +0000
@@ -245,7 +245,11 @@
                             " (default now): "
                           ": ")))
         (new-attribute (dired-mark-read-string prompt nil op-symbol
-                                               arg files default))
+                                               arg files default
+                                               (cond ((eq op-symbol 'chown)
+                                                      (system-users))
+                                                     ((eq op-symbol 'chgrp)
+                                                      (system-groups)))))
         (operation (concat program " " new-attribute))
         failures)
     (setq failures
@@ -385,7 +389,7 @@
     (dired-run-shell-command (dired-shell-stuff-it command file-list nil))))
 
 (defun dired-mark-read-string (prompt initial op-symbol arg files
-                              &optional default-value)
+                              &optional default-value collection)
   "Read args for a Dired marked-files command, prompting with PROMPT.
 Return the user input (a string).
 
@@ -399,9 +403,9 @@
 user enters empty input, this function returns the empty string,
 not DEFAULT-VALUE."
   (dired-mark-pop-up nil op-symbol files
-                    'read-from-minibuffer
+                    'completing-read
                     (format prompt (dired-mark-prompt arg files))
-                    initial nil nil nil default-value))
+                    collection nil nil initial nil default-value nil))
 
 ;;; Cleaning a directory: flagging some backups for deletion.
 


reply via email to

[Prev in Thread] Current Thread [Next in Thread]