[slime-devel] New keybindings for Who-xref commands
Bill_Clementson at peoplesoft.com
Bill_Clementson at peoplesoft.com
Tue Jun 29 19:49:30 UTC 2004
Attached is a patch that provides dual key bindings for the Who-xref
commands (e.g. - it now allows either "C-c C-w c" or "C-c C-w C-c" for the
"Who calls ..." command). This is in keeping with the Documentation key
binding change.
- Bill
Index: slime.el
===================================================================
RCS file: /project/slime/cvsroot/slime/slime.el,v
retrieving revision 1.345
diff -u -r1.345 slime.el
--- slime.el 29 Jun 2004 17:39:01 -0000 1.345
+++ slime.el 29 Jun 2004 19:41:51 -0000
@@ -483,11 +483,6 @@
("~" slime-sync-package-and-default-directory :prefixed t :inferior t)
("\M-p" slime-repl-set-package :prefixed t :inferior t)
;; Cross reference
- ("\C-wc" slime-who-calls :prefixed t :inferior t :sldb t)
- ("\C-wr" slime-who-references :prefixed t :inferior t :sldb t)
- ("\C-wb" slime-who-binds :prefixed t :inferior t :sldb t)
- ("\C-ws" slime-who-sets :prefixed t :inferior t :sldb t)
- ("\C-wm" slime-who-macroexpands :prefixed t :inferior t :sldb t)
("<" slime-list-callers :prefixed t :inferior t :sldb t)
(">" slime-list-callees :prefixed t :inferior t :sldb t)
;; "Other"
@@ -516,6 +511,16 @@
(?h slime-hyperspec-lookup)
(?~ common-lisp-hyperspec-format)))
+(defvar slime-who-map (make-sparse-keymap)
+ "Keymap for who-xref commands. Bound to a prefix key.")
+
+(defvar slime-who-bindings
+ '((?c slime-who-calls)
+ (?r slime-who-references)
+ (?b slime-who-binds)
+ (?s slime-who-sets)
+ (?m slime-who-macroexpands)))
+
;; Maybe a good idea, maybe not..
(defvar slime-prefix-key "\C-c"
"The prefix key to use in SLIME keybinding sequences.")
@@ -551,7 +556,17 @@
(let ((modified (slime-control-modified-char key)))
(define-key slime-doc-map (string modified) command)))))
;; C-c C-d is the prefix for the doc map.
- (slime-define-key "\C-d" slime-doc-map :prefixed t :inferior t))
+ (slime-define-key "\C-d" slime-doc-map :prefixed t :inferior 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 (string key) command)
+ (let ((modified (slime-control-modified-char key)))
+ (define-key slime-who-map (string modified) command))))
+ ;; C-c C-w is the prefix for the who-xref map.
+ (slime-define-key "\C-w" slime-who-map :prefixed t :inferior t))
(defun slime-control-modified-char (char)
"Return the control-modified version of CHAR."
More information about the slime-devel
mailing list