diff lisp/keymap.el @ 284:558f606b08ae r21-0b40

Import from CVS: tag r21-0b40
author cvs
date Mon, 13 Aug 2007 10:34:13 +0200
parents 6330739388db
children c6de09ad3017
line wrap: on
line diff
--- a/lisp/keymap.el	Mon Aug 13 10:33:19 2007 +0200
+++ b/lisp/keymap.el	Mon Aug 13 10:34:13 2007 +0200
@@ -43,6 +43,15 @@
   (interactive)
   (ding))
 
+(defmacro kbd (keys)
+  "Convert KEYS to the internal Emacs key representation.
+KEYS should be a string in the format used for saving keyboard macros
+\(see `insert-kbd-macro')."
+  (if (or (stringp keys)
+	  (vectorp keys))
+      (read-kbd-macro keys)
+    `(read-kbd-macro ,keys)))
+
 (defun suppress-keymap (map &optional nodigits)
   "Make MAP override all normally self-inserting keys to be undefined.
 Normally, as an exception, digits and minus-sign are set to make prefix args,
@@ -271,7 +280,7 @@
 ;;; This is used both by call-interactively (for the command history)
 ;;; and by macros.el (for saving keyboard macros to a file).
 
-;; ### why does (events-to-keys [backspace]) return "\C-h"?
+;; #### why does (events-to-keys [backspace]) return "\C-h"?
 ;; BTW, this function is a mess, and macros.el does *not* use it, in
 ;; spite of the above comment.  `format-kbd-macro' is used to save
 ;; keyboard macros to a file.