changeset 85951:88dacb884a1c

(tpu-map-key): Use unless rather than cond. Remove superfluous concats. Move final set-buffer to non-emacs-specific code.
author Glenn Morris <rgm@gnu.org>
date Wed, 07 Nov 2007 03:46:13 +0000
parents ba090ec72685
children 9bb0a271c2eb
files lisp/emulation/tpu-mapper.el
diffstat 1 files changed, 17 insertions(+), 17 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/emulation/tpu-mapper.el	Wed Nov 07 03:39:19 2007 +0000
+++ b/lisp/emulation/tpu-mapper.el	Wed Nov 07 03:46:13 2007 +0000
@@ -176,24 +176,24 @@
   (interactive)
   (if (featurep 'xemacs)
       (progn
-	(setq tpu-key-seq (read-key-sequence (format "Press %s%s: " ident descrip)))
-	(setq tpu-key (concat "[" (format "%s" (event-key (aref tpu-key-seq 0))) "]"))
-	(cond ((not (equal tpu-key tpu-return))
-	       (set-buffer "Keys")
-	       (insert (format"(global-set-key %s %s)\n" tpu-key func))
-	       (set-buffer "Gold-Keys")
-	       (insert (format "(define-key GOLD-map %s %s)\n" tpu-key gold-func))
-	       (set-buffer "Directions"))))
+	(setq tpu-key-seq (read-key-sequence
+                           (format "Press %s%s: " ident descrip))
+              tpu-key (format "[%s]" (event-key (aref tpu-key-seq 0))))
+	(unless (equal tpu-key tpu-return)
+          (set-buffer "Keys")
+          (insert (format"(global-set-key %s %s)\n" tpu-key func))
+          (set-buffer "Gold-Keys")
+          (insert (format "(define-key GOLD-map %s %s)\n" tpu-key gold-func))))
     (message "Press %s%s: " ident descrip)
-    (setq tpu-key-seq (read-event))
-    (setq tpu-key (concat "[" (format "%s" tpu-key-seq) "]"))
-    (cond ((not (equal tpu-key tpu-return))
-	   (set-buffer "Keys")
-	   (insert (format"(define-key tpu-global-map %s %s)\n" tpu-key func))
-	   (set-buffer "Gold-Keys")
-	   (insert (format "(define-key tpu-gold-map %s %s)\n" tpu-key gold-func))
-	   (set-buffer "Directions"))))
-    tpu-key)
+    (setq tpu-key-seq (read-event)
+          tpu-key (format "[%s]" tpu-key-seq))
+    (unless (equal tpu-key tpu-return)
+      (set-buffer "Keys")
+      (insert (format"(define-key tpu-global-map %s %s)\n" tpu-key func))
+      (set-buffer "Gold-Keys")
+      (insert (format "(define-key tpu-gold-map %s %s)\n" tpu-key gold-func))))
+  (set-buffer "Directions")
+  tpu-key)
 
 (set-buffer "Keys")
 (insert "