Commit 647ac0c3 authored by David Byers's avatar David Byers
Browse files

Define kbd more agressively to override buggy definitions in some Emacsen

parent f02db491
1999-06-11 David Byers <davby@ida.liu.se>
* compatibility.el (kbd): Redefine kbd if it seems to be
misbehaving.
1999-01-16 David Byers <davby@ida.liu.se>
* lyskom-rest.el (j-or-n-p): Don't compare character to int. It's
......
......@@ -65,7 +65,6 @@ LysKOM"))
(if (not (, predicate))
(progn (,@ forms))))))
(defmacro lyskom-compatibility-definition (predicate definition)
"If PREDICATE is nil, evaluate DEFINITION at compile and run time.
Definition should be a function definition of some kind, with syntax
......@@ -140,15 +139,27 @@ of the lyskom-provide-* functions instead."
;;; ======================================================================
;;; Defining keys
;;;
;;; Lots of Emacsen have buggy definitions of kbd (or no definition at all)
;;; Although it's crufty to redefine a function from subr.el, I will do so
;;; if it appears to be misbehaving. Don't like it? Tough!
;;;
(lyskom-compatibility-definition
(condition-case error
(or (equal (kbd (identity "<down-mouse-2>"))
[down-mouse-2])
(error "Bad definition of kbd"))
(error nil))
(lyskom-provide-macro kbd (keys)
"Convert KEYS to the internal Emacs key representation.
(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)))
(if (or (stringp keys)
(vectorp keys))
(read-kbd-macro keys)
`(read-kbd-macro ,keys))))
;;; ======================================================================
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment