# HG changeset patch # User Glenn Morris # Date 1194407173 0 # Node ID 88dacb884a1cbe661b902a2fa5229d5ceaddfe18 # Parent ba090ec72685535c87eca814ebb0dffe1a3e1cf5 (tpu-map-key): Use unless rather than cond. Remove superfluous concats. Move final set-buffer to non-emacs-specific code. diff -r ba090ec72685 -r 88dacb884a1c lisp/emulation/tpu-mapper.el --- 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 "