[slime-cvs] CVS slime
heller
heller at common-lisp.net
Wed Sep 24 09:13:57 UTC 2008
Update of /project/slime/cvsroot/slime
In directory clnet:/tmp/cvs-serv14301
Modified Files:
ChangeLog slime.el
Log Message:
* slime.el (slime-define-both-key-bindings): New function. Factor of
slime-init-keymaps.
(slime-init-keymaps): Use it.
(slime-control-modified-char): Deleted.
--- /project/slime/cvsroot/slime/ChangeLog 2008/09/24 09:10:34 1.1541
+++ /project/slime/cvsroot/slime/ChangeLog 2008/09/24 09:13:30 1.1542
@@ -3,6 +3,10 @@
* slime.el (slime-prefix-map): New keymap.
(slime-define-key): Use it. Also drop unused :inferior arg.
(slime-inspector-mode-map): Bind C-c to slime-prefix-map.
+ (slime-define-both-key-bindings): New function. Factor of
+ slime-init-keymaps.
+ (slime-init-keymaps): Use it.
+ (slime-control-modified-char): Deleted.
2008-09-23 Douglas Crosher <dcrosher at common-lisp.net>
--- /project/slime/cvsroot/slime/slime.el 2008/09/24 09:12:59 1.1041
+++ /project/slime/cvsroot/slime/slime.el 2008/09/24 09:13:38 1.1042
@@ -630,30 +630,21 @@
do (apply #'slime-define-key key command :allow-other-keys t keys))
;; Documentation
(setq slime-doc-map (make-sparse-keymap))
- (loop for (key command) in slime-doc-bindings
- do (progn
- ;; We bind both unmodified and with control.
- (define-key slime-doc-map (vector key) command)
- (unless (equal key ?h) ; But don't bind C-h
- (let ((modified (slime-control-modified-char key)))
- (define-key slime-doc-map (vector modified) command)))))
+ (slime-define-both-key-bindings slime-doc-map slime-doc-bindings)
;; C-c C-d is the prefix for the doc map.
(slime-define-key "\C-d" slime-doc-map :prefixed t)
;; Who-xref
(setq slime-who-map (make-sparse-keymap))
- (loop for (key command) in slime-who-bindings
- do (progn
- ;; We bind both unmodified and with control.
- (define-key slime-who-map (vector key) command)
- (let ((modified (slime-control-modified-char key)))
- (define-key slime-who-map (vector modified) command))))
+ (slime-define-both-key-bindings slime-who-map slime-who-bindings)
;; C-c C-w is the prefix for the who-xref map.
(slime-define-key "\C-w" slime-who-map :prefixed t))
-(defun slime-control-modified-char (char)
- "Return the control-modified version of CHAR."
- ;; Maybe better to just bitmask it?
- (read (format "?\\C-%c" char)))
+(defun slime-define-both-key-bindings (keymap bindings)
+ (loop for (char command) in bindings do
+ ;; We bind both unmodified and with control.
+ (define-key keymap `[,char] command)
+ (unless (equal char ?h) ; But don't bind C-h
+ (define-key keymap `[(control ,char)] command))))
(slime-init-keymaps)
More information about the slime-cvs
mailing list