changeset 95268:bcc553c768f9

* 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.
author Stefan Monnier <monnier@iro.umontreal.ca>
date Fri, 23 May 2008 20:31:12 +0000
parents 4ec6f3d46f27
children 1e9eb6106f5a
files lisp/ChangeLog lisp/progmodes/ada-mode.el lisp/progmodes/mixal-mode.el lisp/textmodes/reftex-vars.el lisp/textmodes/reftex.el
diffstat 5 files changed, 63 insertions(+), 24 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/ChangeLog	Fri May 23 17:19:22 2008 +0000
+++ b/lisp/ChangeLog	Fri May 23 20:31:12 2008 +0000
@@ -1,3 +1,16 @@
+2008-05-23  Paul R  <paul.r.ml@gmail.com>
+
+	* 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  <monnier@iro.umontreal.ca>
 
 	* emacs-lisp/regexp-opt.el (regexp-opt): Always return
--- a/lisp/progmodes/ada-mode.el	Fri May 23 17:19:22 2008 +0000
+++ b/lisp/progmodes/ada-mode.el	Fri May 23 20:31:12 2008 +0000
@@ -448,6 +448,13 @@
 (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 @@
 (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 @@
     '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-map "\C-cu"  'ada-prj-edit)
+  (define-key ada-mode-extra-map "f"     'ada-find-file)
+
+  (define-key ada-mode-extra-map "u"  'ada-prj-edit)
 
   ;;  The templates, defined in ada-stmt.el
 
@@ -4634,7 +4644,7 @@
     (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))
   )
 
 
--- a/lisp/progmodes/mixal-mode.el	Fri May 23 17:19:22 2008 +0000
+++ b/lisp/progmodes/mixal-mode.el	Fri May 23 20:31:12 2008 +0000
@@ -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)
--- a/lisp/textmodes/reftex-vars.el	Fri May 23 17:19:22 2008 +0000
+++ b/lisp/textmodes/reftex-vars.el	Fri May 23 20:31:12 2008 +0000
@@ -1847,7 +1847,16 @@
 
 (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)
 
--- a/lisp/textmodes/reftex.el	Fri May 23 17:19:22 2008 +0000
+++ b/lisp/textmodes/reftex.el	Fri May 23 20:31:12 2008 +0000
@@ -2406,16 +2406,23 @@
 ;; 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))
+    
 
 ;;; =========================================================================
 ;;;