]> git.eshelyaron.com Git - emacs.git/commitdiff
(universal-coding-system-argument):
authorGerd Moellmann <gerd@gnu.org>
Wed, 24 Jan 2001 13:14:45 +0000 (13:14 +0000)
committerGerd Moellmann <gerd@gnu.org>
Wed, 24 Jan 2001 13:14:45 +0000 (13:14 +0000)
Handle commands with prefix args.

lisp/ChangeLog
lisp/international/mule-cmds.el

index bac8e169de236828ffabba2f6e14e0376f42b91a..3fa3c14a06cfa7ebd31789c4fe73c1fe0e574877 100644 (file)
@@ -1,3 +1,8 @@
+2001-01-24  Gerd Moellmann  <gerd@gnu.org>
+
+       * international/mule-cmds.el (universal-coding-system-argument): 
+       Handle commands with prefix args.
+
 2001-01-24  Edward M. Reingold  <reingold@emr.cs.uiuc.edu>
 
        * calendar/diary-lib.el (diary-float): Fix case of MONTH
index 6ff2e46b53a9c3445ffaf0d8058f1ac71b815fe4..0d81e8412fb4c8766286ac01efb6914098db7a80 100644 (file)
@@ -264,9 +264,37 @@ wrong, use this command again to toggle back to the right mode."
                         default))
         (keyseq (read-key-sequence
                  (format "Command to execute with %s:" coding-system)))
-        (cmd (key-binding keyseq)))
+        (cmd (key-binding keyseq))
+        prefix)
+
+    (when (eq cmd 'universal-argument)
+      (call-interactively cmd)
+      
+      ;; Process keys bound in `universal-argument-map'.
+      (while (progn
+              (setq keyseq (read-key-sequence nil t)
+                    cmd (key-binding keyseq t))
+              (not (eq cmd 'universal-argument-other-key)))
+       (let ((current-prefix-arg prefix-arg)
+             ;; Have to bind `last-command-char' here so that 
+             ;; `digit-argument', for isntance, can compute the
+             ;; prefix arg.
+             (last-command-char (aref keyseq 0)))
+         (call-interactively cmd)))
+
+      ;; This is the final call to `univeral-argument-other-key', which
+      ;; set's the final `prefix-arg.
+      (let ((current-prefix-arg prefix-arg))
+       (call-interactively cmd))
+       
+      ;; Read the command to execute with the given prefix arg.
+      (setq prefix prefix-arg
+           keyseq (read-key-sequence nil t)
+           cmd (key-binding keyseq)))
+
     (let ((coding-system-for-read coding-system)
-         (coding-system-for-write coding-system))
+         (coding-system-for-write coding-system)
+         (current-prefix-arg prefix))
       (message "")
       (call-interactively cmd))))