]> git.eshelyaron.com Git - emacs.git/commitdiff
(dired-query-alist): Remove spurious backslash.
authorStefan Monnier <monnier@iro.umontreal.ca>
Fri, 18 Sep 2009 15:35:23 +0000 (15:35 +0000)
committerStefan Monnier <monnier@iro.umontreal.ca>
Fri, 18 Sep 2009 15:35:23 +0000 (15:35 +0000)
(dired-query): Use read-key.

lisp/ChangeLog
lisp/dired-aux.el

index 1f1444340c5585a2016ca29d8ce0dacc88d01f8c..76144677c870101e0c5662f81a7735f8a2e5e59e 100644 (file)
@@ -1,3 +1,8 @@
+2009-09-18  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+       * dired-aux.el (dired-query-alist): Remove spurious backslash.
+       (dired-query): Use read-key.
+
 2009-09-18  Adrian Robert  <Adrian.B.Robert@gmail.com>
 
        * cus-start.el (ns-use-qd-smoothing): Remove.
index 4a7e5956751647b3bef0be0f75ba86732521f79f..0fcefe971b8780c4ec32c5ca6ab5345c95a71f78 100644 (file)
@@ -867,7 +867,7 @@ Otherwise, the rule is a compression rule, and compression is done with gzip.")
           failures)))))
 
 (defvar dired-query-alist
-  '((?\y . y) (?\040 . y)              ; `y' or SPC means accept once
+  '((?y . y) (?\040 . y)               ; `y' or SPC means accept once
     (?n . n) (?\177 . n)               ; `n' or DEL skips once
     (?! . yes)                         ; `!' accepts rest
     (?q . no) (?\e . no)               ; `q' or ESC skips rest
@@ -876,10 +876,10 @@ Otherwise, the rule is a compression rule, and compression is done with gzip.")
 
 ;;;###autoload
 (defun dired-query (qs-var qs-prompt &rest qs-args)
-  ;; Query user and return nil or t.
-  ;; Store answer in symbol VAR (which must initially be bound to nil).
-  ;; Format PROMPT with ARGS.
-  ;; Binding variable help-form will help the user who types the help key.
+  "Query user and return nil or t.
+Store answer in symbol VAR (which must initially be bound to nil).
+Format PROMPT with ARGS.
+Binding variable `help-form' will help the user who types the help key."
   (let* ((char (symbol-value qs-var))
         (action (cdr (assoc char dired-query-alist))))
     (cond ((eq 'yes action)
@@ -897,13 +897,12 @@ Otherwise, the rule is a compression rule, and compression is done with gzip.")
             ;; Actually it looks nicer without cursor-in-echo-area - you can
             ;; look at the dired buffer instead of at the prompt to decide.
             (apply 'message qprompt qs-args)
-            (setq char (set qs-var (read-char)))
-            (while (not (setq elt (assoc char dired-query-alist)))
-              (message "Invalid char - type %c for help." help-char)
+            (while (progn (setq char (set qs-var (read-key)))
+                           (not (setq elt (assoc char dired-query-alist))))
+              (message "Invalid key - type %c for help." help-char)
               (ding)
               (sit-for 1)
-              (apply 'message qprompt qs-args)
-              (setq char (set qs-var (read-char))))
+              (apply 'message qprompt qs-args))
             ;; Display the question with the answer.
             (message "%s" (concat (apply 'format qprompt qs-args)
                              (char-to-string char)))