* 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.
This commit is contained in:
Stefan Monnier 2008-05-23 20:31:12 +00:00
parent 9cc236e006
commit a3507bd3c2
5 changed files with 62 additions and 23 deletions

View file

@ -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

View file

@ -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))
)

View file

@ -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)

View file

@ -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)

View file

@ -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))
;;; =========================================================================
;;;