aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Monnier2008-05-23 20:31:12 +0000
committerStefan Monnier2008-05-23 20:31:12 +0000
commita3507bd3c2cd362c0ffd7de5462e4cacf0cf9dc7 (patch)
treed442467b6d5500630c671ae45a732e469f7f5e92
parent9cc236e006e474dc83a90d0bb5bc5f6b99c9351e (diff)
downloademacs-a3507bd3c2cd362c0ffd7de5462e4cacf0cf9dc7.tar.gz
emacs-a3507bd3c2cd362c0ffd7de5462e4cacf0cf9dc7.zip
* 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 9f20d191528..9bf42b35f2a 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,16 @@
12008-05-23 Paul R <paul.r.ml@gmail.com>
2
3 * textmodes/reftex-vars.el (reftex-extra-bindings-prefix): New var.
4 * textmodes/reftex.el (reftex-extra-bindings-map): New var.
5 (reftex-extra-bindings): Use it.
6
7 * progmodes/mixal-mode.el (mixal-mode-map): Move key-bindings
8 away from the user-reserved keys.
9
10 * progmodes/ada-mode.el (ada-mode-extra-map, ada-mode-extra-prefix):
11 New vars.
12 (ada-create-keymap): Use them.
13
12008-05-23 Stefan Monnier <monnier@iro.umontreal.ca> 142008-05-23 Stefan Monnier <monnier@iro.umontreal.ca>
2 15
3 * emacs-lisp/regexp-opt.el (regexp-opt): Always return 16 * emacs-lisp/regexp-opt.el (regexp-opt): Always return
diff --git a/lisp/progmodes/ada-mode.el b/lisp/progmodes/ada-mode.el
index b4621d4af2c..663f13965d1 100644
--- a/lisp/progmodes/ada-mode.el
+++ b/lisp/progmodes/ada-mode.el
@@ -448,6 +448,13 @@ The extensions should include a `.' if needed.")
448(defvar ada-mode-map (make-sparse-keymap) 448(defvar ada-mode-map (make-sparse-keymap)
449 "Local keymap used for Ada mode.") 449 "Local keymap used for Ada mode.")
450 450
451(defvar ada-mode-extra-map (make-sparse-keymap)
452 "Keymap used for non-standard keybindings.")
453
454;; default is C-c C-q because it's free in ada-mode-map
455(defvar ada-mode-extra-prefix "\C-c\C-q"
456 "Prefix key to access `ada-mode-extra-map' functions.")
457
451(defvar ada-mode-abbrev-table nil 458(defvar ada-mode-abbrev-table nil
452 "Local abbrev table for Ada mode.") 459 "Local abbrev table for Ada mode.")
453 460
@@ -4537,6 +4544,9 @@ Moves to 'begin' if in a declarative part."
4537(defun ada-create-keymap () 4544(defun ada-create-keymap ()
4538 "Create the keymap associated with the Ada mode." 4545 "Create the keymap associated with the Ada mode."
4539 4546
4547 ;; All non-standard keys go into ada-mode-extra-map
4548 (define-key ada-mode-map ada-mode-extra-prefix ada-mode-extra-map)
4549
4540 ;; Indentation and Formatting 4550 ;; Indentation and Formatting
4541 (define-key ada-mode-map "\C-j" 'ada-indent-newline-indent-conditional) 4551 (define-key ada-mode-map "\C-j" 'ada-indent-newline-indent-conditional)
4542 (define-key ada-mode-map "\C-m" 'ada-indent-newline-indent-conditional) 4552 (define-key ada-mode-map "\C-m" 'ada-indent-newline-indent-conditional)
@@ -4585,23 +4595,23 @@ Moves to 'begin' if in a declarative part."
4585 'ada-point-and-xref) 4595 'ada-point-and-xref)
4586 (define-key ada-mode-map [(control tab)] 'ada-complete-identifier) 4596 (define-key ada-mode-map [(control tab)] 'ada-complete-identifier)
4587 4597
4588 (define-key ada-mode-map "\C-co" 'ff-find-other-file) 4598 (define-key ada-mode-extra-map "o" 'ff-find-other-file)
4589 (define-key ada-mode-map "\C-c5\C-d" 'ada-goto-declaration-other-frame) 4599 (define-key ada-mode-map "\C-c5\C-d" 'ada-goto-declaration-other-frame)
4590 (define-key ada-mode-map "\C-c\C-d" 'ada-goto-declaration) 4600 (define-key ada-mode-map "\C-c\C-d" 'ada-goto-declaration)
4591 (define-key ada-mode-map "\C-c\C-s" 'ada-xref-goto-previous-reference) 4601 (define-key ada-mode-map "\C-c\C-s" 'ada-xref-goto-previous-reference)
4592 (define-key ada-mode-map "\C-c\C-c" 'ada-compile-application) 4602 (define-key ada-mode-map "\C-c\C-c" 'ada-compile-application)
4593 (define-key ada-mode-map "\C-cc" 'ada-change-prj) 4603 (define-key ada-mode-extra-map "c" 'ada-change-prj)
4594 (define-key ada-mode-map "\C-cd" 'ada-set-default-project-file) 4604 (define-key ada-mode-extra-map "d" 'ada-set-default-project-file)
4595 (define-key ada-mode-map "\C-cg" 'ada-gdb-application) 4605 (define-key ada-mode-extra-map "g" 'ada-gdb-application)
4596 (define-key ada-mode-map "\C-c\C-m" 'ada-set-main-compile-application) 4606 (define-key ada-mode-map "\C-c\C-m" 'ada-set-main-compile-application)
4597 (define-key ada-mode-map "\C-cr" 'ada-run-application) 4607 (define-key ada-mode-extra-map "r" 'ada-run-application)
4598 (define-key ada-mode-map "\C-c\C-o" 'ada-goto-parent) 4608 (define-key ada-mode-map "\C-c\C-o" 'ada-goto-parent)
4599 (define-key ada-mode-map "\C-c\C-r" 'ada-find-references) 4609 (define-key ada-mode-map "\C-c\C-r" 'ada-find-references)
4600 (define-key ada-mode-map "\C-cl" 'ada-find-local-references) 4610 (define-key ada-mode-extra-map "l" 'ada-find-local-references)
4601 (define-key ada-mode-map "\C-c\C-v" 'ada-check-current) 4611 (define-key ada-mode-map "\C-c\C-v" 'ada-check-current)
4602 (define-key ada-mode-map "\C-cf" 'ada-find-file) 4612 (define-key ada-mode-extra-map "f" 'ada-find-file)
4603 4613
4604 (define-key ada-mode-map "\C-cu" 'ada-prj-edit) 4614 (define-key ada-mode-extra-map "u" 'ada-prj-edit)
4605 4615
4606 ;; The templates, defined in ada-stmt.el 4616 ;; The templates, defined in ada-stmt.el
4607 4617
@@ -4634,7 +4644,7 @@ Moves to 'begin' if in a declarative part."
4634 (define-key map "w" 'ada-while-loop) 4644 (define-key map "w" 'ada-while-loop)
4635 (define-key map "\C-x" 'ada-exception) 4645 (define-key map "\C-x" 'ada-exception)
4636 (define-key map "x" 'ada-exit) 4646 (define-key map "x" 'ada-exit)
4637 (define-key ada-mode-map "\C-ct" map)) 4647 (define-key ada-mode-extra-map "t" map))
4638 ) 4648 )
4639 4649
4640 4650
diff --git a/lisp/progmodes/mixal-mode.el b/lisp/progmodes/mixal-mode.el
index 0c5bbba9651..eda74167b27 100644
--- a/lisp/progmodes/mixal-mode.el
+++ b/lisp/progmodes/mixal-mode.el
@@ -77,10 +77,10 @@
77;;; Key map 77;;; Key map
78(defvar mixal-mode-map 78(defvar mixal-mode-map
79 (let ((map (make-sparse-keymap))) 79 (let ((map (make-sparse-keymap)))
80 (define-key map "\C-cc" 'compile) 80 (define-key map "\C-c\C-c" 'compile)
81 (define-key map "\C-cr" 'mixal-run) 81 (define-key map "\C-c\C-r" 'mixal-run)
82 (define-key map "\C-cd" 'mixal-debug) 82 (define-key map "\C-c\C-d" 'mixal-debug)
83 (define-key map "\C-ho" 'mixal-describe-operation-code) 83 (define-key map "\C-h\C-o" 'mixal-describe-operation-code)
84 map) 84 map)
85 "Keymap for `mixal-mode'.") 85 "Keymap for `mixal-mode'.")
86;; (makunbound 'mixal-mode-map) 86;; (makunbound 'mixal-mode-map)
diff --git a/lisp/textmodes/reftex-vars.el b/lisp/textmodes/reftex-vars.el
index ca9706a476b..5d575eb6e80 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."
1847 1847
1848(defcustom reftex-extra-bindings nil 1848(defcustom reftex-extra-bindings nil
1849 "Non-nil means, make additional key bindings on startup. 1849 "Non-nil means, make additional key bindings on startup.
1850These extra bindings are located in the users `C-c letter' map." 1850These extra bindings are located in the
1851`reftex-extra-bindings-map' map, bound to
1852`reftex-extra-bindings-prefix'."
1853 :group 'reftex-miscellaneous-configurations
1854 :type 'boolean)
1855
1856;; below, default is C-c C-y because it is free in LaTeX mode.
1857(defcustom reftex-extra-bindings-prefix "\C-c\C-y"
1858 "When `reftex-extra-bindings' is set to non-nil, use extra
1859bindings with this prefix bound to `reftex-extra-bindings-map'."
1851 :group 'reftex-miscellaneous-configurations 1860 :group 'reftex-miscellaneous-configurations
1852 :type 'boolean) 1861 :type 'boolean)
1853 1862
diff --git a/lisp/textmodes/reftex.el b/lisp/textmodes/reftex.el
index 47c25a15663..c391b55d109 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."
2406;; Setting `reftex-extra-bindings' really is only there to spare users 2406;; Setting `reftex-extra-bindings' really is only there to spare users
2407;; the hassle of defining bindings in the user space themselves. This 2407;; the hassle of defining bindings in the user space themselves. This
2408;; is why they violate the key binding recommendations. 2408;; is why they violate the key binding recommendations.
2409(defvar reftex-extra-bindings-map
2410 (let ((map (make-sparse-keymap)))
2411 (define-key map "t" 'reftex-toc)
2412 (define-key map "l" 'reftex-label)
2413 (define-key map "r" 'reftex-reference)
2414 (define-key map "c" 'reftex-citation)
2415 (define-key map "v" 'reftex-view-crossref)
2416 (define-key map "g" 'reftex-grep-document)
2417 (define-key map "s" 'reftex-search-document)
2418 map)
2419 "Reftex extra bindings map")
2420
2409(when reftex-extra-bindings 2421(when reftex-extra-bindings
2410 (loop for x in 2422 (define-key reftex-mode-map
2411 '(("\C-ct" . reftex-toc) 2423 reftex-extra-bindings-prefix
2412 ("\C-cl" . reftex-label) 2424 reftex-extra-bindings-map))
2413 ("\C-cr" . reftex-reference) 2425
2414 ("\C-cc" . reftex-citation)
2415 ("\C-cv" . reftex-view-crossref)
2416 ("\C-cg" . reftex-grep-document)
2417 ("\C-cs" . reftex-search-document))
2418 do (define-key reftex-mode-map (car x) (cdr x))))
2419 2426
2420;;; ========================================================================= 2427;;; =========================================================================
2421;;; 2428;;;