summaryrefslogtreecommitdiff
path: root/lisp
diff options
context:
space:
mode:
authorMark Oteiza <mvoteiza@udel.edu>2016-11-18 20:19:17 -0500
committerMark Oteiza <mvoteiza@udel.edu>2016-11-18 20:19:17 -0500
commit6cdd1c333034b308e74e70c4fd10399fbb5329b9 (patch)
tree5c889279c7c0d948e0f8d7ffd62a695afeabf996 /lisp
parent66f80708a74d193c65a324caa80b115701da0859 (diff)
downloademacs-6cdd1c333034b308e74e70c4fd10399fbb5329b9.tar.gz
Move key mappings into reftex-mode-map defvar
* lisp/textmodes/reftex.el (reftex-mode-map): Assimilate top-level key mappings. (reftex-reset-mode): Just use dolist.
Diffstat (limited to 'lisp')
-rw-r--r--lisp/textmodes/reftex.el82
1 files changed, 39 insertions, 43 deletions
diff --git a/lisp/textmodes/reftex.el b/lisp/textmodes/reftex.el
index a488ab14b10..24fa0d145e8 100644
--- a/lisp/textmodes/reftex.el
+++ b/lisp/textmodes/reftex.el
@@ -100,7 +100,42 @@
(defconst reftex-version emacs-version
"Version string for RefTeX.")
-(defvar reftex-mode-map (make-sparse-keymap)
+(defvar reftex-mode-map
+ (let ((map (make-sparse-keymap)))
+ ;; The default bindings in the mode map.
+ (define-key map "\C-c=" 'reftex-toc)
+ (define-key map "\C-c-" 'reftex-toc-recenter)
+ (define-key map "\C-c(" 'reftex-label)
+ (define-key map "\C-c)" 'reftex-reference)
+ (define-key map "\C-c[" 'reftex-citation)
+ (define-key map "\C-c<" 'reftex-index)
+ (define-key map "\C-c>" 'reftex-display-index)
+ (define-key map "\C-c/" 'reftex-index-selection-or-word)
+ (define-key map "\C-c\\" 'reftex-index-phrase-selection-or-word)
+ (define-key map "\C-c|" 'reftex-index-visit-phrases-buffer)
+ (define-key map "\C-c&" 'reftex-view-crossref)
+
+ ;; Bind `reftex-mouse-view-crossref' only when the key is still free
+ (if (featurep 'xemacs)
+ (unless (key-binding [(shift button2)])
+ (define-key map [(shift button2)] 'reftex-mouse-view-crossref))
+ (unless (key-binding [(shift mouse-2)])
+ (define-key map [(shift mouse-2)] 'reftex-mouse-view-crossref)))
+
+ ;; For most of these commands there are already bindings in place.
+ ;; 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.
+ (when reftex-extra-bindings
+ (define-key map "\C-ct" 'reftex-toc)
+ (define-key map "\C-cl" 'reftex-label)
+ (define-key map "\C-cr" 'reftex-reference)
+ (define-key map "\C-cc" 'reftex-citation)
+ (define-key map "\C-cv" 'reftex-view-crossref)
+ (define-key map "\C-cg" 'reftex-grep-document)
+ (define-key map "\C-cs" 'reftex-search-document))
+
+ map)
"Keymap for RefTeX mode.")
(defvar reftex-mode-menu nil)
@@ -659,9 +694,9 @@ on next use."
(interactive)
;; Reset the file search path variables
- (loop for prop in '(status master-dir recursive-path rec-type) do
- (put 'reftex-tex-path prop nil)
- (put 'reftex-bib-path prop nil))
+ (dolist (prop '(status master-dir recursive-path rec-type))
+ (put 'reftex-tex-path prop nil)
+ (put 'reftex-bib-path prop nil))
;; Kill temporary buffers associated with RefTeX - just in case they
;; were not cleaned up properly
@@ -2134,30 +2169,6 @@ IGNORE-WORDS List of words which should be removed from the string."
;;;
;;; Keybindings
-;; The default bindings in the mode map.
-(loop for x in
- '(("\C-c=" . reftex-toc)
- ("\C-c-" . reftex-toc-recenter)
- ("\C-c(" . reftex-label)
- ("\C-c)" . reftex-reference)
- ("\C-c[" . reftex-citation)
- ("\C-c<" . reftex-index)
- ("\C-c>" . reftex-display-index)
- ("\C-c/" . reftex-index-selection-or-word)
- ("\C-c\\" . reftex-index-phrase-selection-or-word)
- ("\C-c|" . reftex-index-visit-phrases-buffer)
- ("\C-c&" . reftex-view-crossref))
- do (define-key reftex-mode-map (car x) (cdr x)))
-
-;; Bind `reftex-mouse-view-crossref' only when the key is still free
-(if (featurep 'xemacs)
- (unless (key-binding [(shift button2)])
- (define-key reftex-mode-map [(shift button2)]
- 'reftex-mouse-view-crossref))
- (unless (key-binding [(shift mouse-2)])
- (define-key reftex-mode-map [(shift mouse-2)]
- 'reftex-mouse-view-crossref)))
-
(defvar bibtex-mode-map)
;; Bind `reftex-view-crossref-from-bibtex' in BibTeX mode map
@@ -2165,21 +2176,6 @@ IGNORE-WORDS List of words which should be removed from the string."
"bibtex"
'(define-key bibtex-mode-map "\C-c&" 'reftex-view-crossref-from-bibtex))
-;; For most of these commands there are already bindings in place.
-;; 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.
-(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))))
-
;;; =========================================================================
;;;
;;; Menu