aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Monnier <[email protected]>2008-05-23 20:31:12 +0000
committerStefan Monnier <[email protected]>2008-05-23 20:31:12 +0000
commita3507bd3c2cd362c0ffd7de5462e4cacf0cf9dc7 (patch)
treed442467b6d5500630c671ae45a732e469f7f5e92
parent9cc236e006e474dc83a90d0bb5bc5f6b99c9351e (diff)
* textmodes/reftex-vars.el (reftex-extra-bindings-prefix): New var.
* textmodes/reftex.el (reftex-extra-bindings-map): New var. (reftex-extra-bindings): Use it. * progmodes/mixal-mode.el (mixal-mode-map): Move key-bindings away from the user-reserved keys. * progmodes/ada-mode.el (ada-mode-extra-map, ada-mode-extra-prefix): New vars. (ada-create-keymap): Use them.
-rw-r--r--lisp/ChangeLog13
-rw-r--r--lisp/progmodes/ada-mode.el28
-rw-r--r--lisp/progmodes/mixal-mode.el8
-rw-r--r--lisp/textmodes/reftex-vars.el11
-rw-r--r--lisp/textmodes/reftex.el25
5 files changed, 62 insertions, 23 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 9f20d19152..9bf42b35f2 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,16 @@
+2008-05-23 Paul R <[email protected]>
+
+ * textmodes/reftex-vars.el (reftex-extra-bindings-prefix): New var.
+ * textmodes/reftex.el (reftex-extra-bindings-map): New var.
+ (reftex-extra-bindings): Use it.
+
+ * progmodes/mixal-mode.el (mixal-mode-map): Move key-bindings
+ away from the user-reserved keys.
+
+ * progmodes/ada-mode.el (ada-mode-extra-map, ada-mode-extra-prefix):
+ New vars.
+ (ada-create-keymap): Use them.
+
2008-05-23 Stefan Monnier <[email protected]>
* emacs-lisp/regexp-opt.el (regexp-opt): Always return
diff --git a/lisp/progmodes/ada-mode.el b/lisp/progmodes/ada-mode.el
index b4621d4af2..663f13965d 100644
--- a/lisp/progmodes/ada-mode.el
+++ b/lisp/progmodes/ada-mode.el
@@ -448,6 +448,13 @@ The extensions should include a `.' if needed.")
(defvar ada-mode-map (make-sparse-keymap)
"Local keymap used for Ada mode.")
+(defvar ada-mode-extra-map (make-sparse-keymap)
+ "Keymap used for non-standard keybindings.")
+
+;; default is C-c C-q because it's free in ada-mode-map
+(defvar ada-mode-extra-prefix "\C-c\C-q"
+ "Prefix key to access `ada-mode-extra-map' functions.")
+
(defvar ada-mode-abbrev-table nil
"Local abbrev table for Ada mode.")
@@ -4537,6 +4544,9 @@ Moves to 'begin' if in a declarative part."
(defun ada-create-keymap ()
"Create the keymap associated with the Ada mode."
+ ;; All non-standard keys go into ada-mode-extra-map
+ (define-key ada-mode-map ada-mode-extra-prefix ada-mode-extra-map)
+
;; Indentation and Formatting
(define-key ada-mode-map "\C-j" 'ada-indent-newline-indent-conditional)
(define-key ada-mode-map "\C-m" 'ada-indent-newline-indent-conditional)
@@ -4585,23 +4595,23 @@ Moves to 'begin' if in a declarative part."
'ada-point-and-xref)
(define-key ada-mode-map [(control tab)] 'ada-complete-identifier)
- (define-key ada-mode-map "\C-co" 'ff-find-other-file)
+ (define-key ada-mode-extra-map "o" 'ff-find-other-file)
(define-key ada-mode-map "\C-c5\C-d" 'ada-goto-declaration-other-frame)
(define-key ada-mode-map "\C-c\C-d" 'ada-goto-declaration)
(define-key ada-mode-map "\C-c\C-s" 'ada-xref-goto-previous-reference)
(define-key ada-mode-map "\C-c\C-c" 'ada-compile-application)
- (define-key ada-mode-map "\C-cc" 'ada-change-prj)
- (define-key ada-mode-map "\C-cd" 'ada-set-default-project-file)
- (define-key ada-mode-map "\C-cg" 'ada-gdb-application)
+ (define-key ada-mode-extra-map "c" 'ada-change-prj)
+ (define-key ada-mode-extra-map "d" 'ada-set-default-project-file)
+ (define-key ada-mode-extra-map "g" 'ada-gdb-application)
(define-key ada-mode-map "\C-c\C-m" 'ada-set-main-compile-application)
- (define-key ada-mode-map "\C-cr" 'ada-run-application)
+ (define-key ada-mode-extra-map "r" 'ada-run-application)
(define-key ada-mode-map "\C-c\C-o" 'ada-goto-parent)
(define-key ada-mode-map "\C-c\C-r" 'ada-find-references)
- (define-key ada-mode-map "\C-cl" 'ada-find-local-references)
+ (define-key ada-mode-extra-map "l" 'ada-find-local-references)
(define-key ada-mode-map "\C-c\C-v" 'ada-check-current)
- (define-key ada-mode-map "\C-cf" 'ada-find-file)
+ (define-key ada-mode-extra-map "f" 'ada-find-file)
- (define-key ada-mode-map "\C-cu" 'ada-prj-edit)
+ (define-key ada-mode-extra-map "u" 'ada-prj-edit)
;; The templates, defined in ada-stmt.el
@@ -4634,7 +4644,7 @@ Moves to 'begin' if in a declarative part."
(define-key map "w" 'ada-while-loop)
(define-key map "\C-x" 'ada-exception)
(define-key map "x" 'ada-exit)
- (define-key ada-mode-map "\C-ct" map))
+ (define-key ada-mode-extra-map "t" map))
)
diff --git a/lisp/progmodes/mixal-mode.el b/lisp/progmodes/mixal-mode.el
index 0c5bbba965..eda74167b2 100644
--- a/lisp/progmodes/mixal-mode.el
+++ b/lisp/progmodes/mixal-mode.el
@@ -77,10 +77,10 @@
;;; Key map
(defvar mixal-mode-map
(let ((map (make-sparse-keymap)))
- (define-key map "\C-cc" 'compile)
- (define-key map "\C-cr" 'mixal-run)
- (define-key map "\C-cd" 'mixal-debug)
- (define-key map "\C-ho" 'mixal-describe-operation-code)
+ (define-key map "\C-c\C-c" 'compile)
+ (define-key map "\C-c\C-r" 'mixal-run)
+ (define-key map "\C-c\C-d" 'mixal-debug)
+ (define-key map "\C-h\C-o" 'mixal-describe-operation-code)
map)
"Keymap for `mixal-mode'.")
;; (makunbound 'mixal-mode-map)
diff --git a/lisp/textmodes/reftex-vars.el b/lisp/textmodes/reftex-vars.el
index ca9706a476..5d575eb6e8 100644
--- a/lisp/textmodes/reftex-vars.el
+++ b/lisp/textmodes/reftex-vars.el
@@ -1847,7 +1847,16 @@ symbol indicating in what context the hook is called."
(defcustom reftex-extra-bindings nil
"Non-nil means, make additional key bindings on startup.
-These extra bindings are located in the users `C-c letter' map."
+These extra bindings are located in the
+`reftex-extra-bindings-map' map, bound to
+`reftex-extra-bindings-prefix'."
+ :group 'reftex-miscellaneous-configurations
+ :type 'boolean)
+
+;; below, default is C-c C-y because it is free in LaTeX mode.
+(defcustom reftex-extra-bindings-prefix "\C-c\C-y"
+ "When `reftex-extra-bindings' is set to non-nil, use extra
+bindings with this prefix bound to `reftex-extra-bindings-map'."
:group 'reftex-miscellaneous-configurations
:type 'boolean)
diff --git a/lisp/textmodes/reftex.el b/lisp/textmodes/reftex.el
index 47c25a1566..c391b55d10 100644
--- a/lisp/textmodes/reftex.el
+++ b/lisp/textmodes/reftex.el
@@ -2406,16 +2406,23 @@ IGNORE-WORDS List of words which should be removed from the string."
;; Setting `reftex-extra-bindings' really is only there to spare users
;; the hassle of defining bindings in the user space themselves. This
;; is why they violate the key binding recommendations.
+(defvar reftex-extra-bindings-map
+ (let ((map (make-sparse-keymap)))
+ (define-key map "t" 'reftex-toc)
+ (define-key map "l" 'reftex-label)
+ (define-key map "r" 'reftex-reference)
+ (define-key map "c" 'reftex-citation)
+ (define-key map "v" 'reftex-view-crossref)
+ (define-key map "g" 'reftex-grep-document)
+ (define-key map "s" 'reftex-search-document)
+ map)
+ "Reftex extra bindings map")
+
(when reftex-extra-bindings
- (loop for x in
- '(("\C-ct" . reftex-toc)
- ("\C-cl" . reftex-label)
- ("\C-cr" . reftex-reference)
- ("\C-cc" . reftex-citation)
- ("\C-cv" . reftex-view-crossref)
- ("\C-cg" . reftex-grep-document)
- ("\C-cs" . reftex-search-document))
- do (define-key reftex-mode-map (car x) (cdr x))))
+ (define-key reftex-mode-map
+ reftex-extra-bindings-prefix
+ reftex-extra-bindings-map))
+
;;; =========================================================================
;;;