From c74e901d7f21678f300a1f47be091ff34760a3e2 Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Wed, 7 Nov 2007 03:46:22 +0000 Subject: [PATCH] (tpu-map-key): Use unless rather than cond. Remove superfluous concats. Move final set-buffer to non-emacs-specific code. --- lisp/ChangeLog | 6 ++++++ lisp/emulation/tpu-mapper.el | 34 +++++++++++++++++----------------- 2 files changed, 23 insertions(+), 17 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index e74b56f7b41..7622873361d 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,9 @@ +2007-11-07 Glenn Morris + + * emulation/tpu-mapper.el (tpu-map-key): Use unless rather than cond. + Remove superfluous concats. Move final set-buffer to + non-emacs-specific code. + 2007-11-07 Rob Riepel * emulation/tpu-mapper.el (tpu-map-key): Remove un-needed cond branch. diff --git a/lisp/emulation/tpu-mapper.el b/lisp/emulation/tpu-mapper.el index 8edf963c8dd..b3ad67ec4df 100644 --- a/lisp/emulation/tpu-mapper.el +++ b/lisp/emulation/tpu-mapper.el @@ -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 " -- 2.39.2