aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMark Oteiza2016-11-18 20:19:17 -0500
committerMark Oteiza2016-11-18 20:19:17 -0500
commit6cdd1c333034b308e74e70c4fd10399fbb5329b9 (patch)
tree5c889279c7c0d948e0f8d7ffd62a695afeabf996
parent66f80708a74d193c65a324caa80b115701da0859 (diff)
downloademacs-6cdd1c333034b308e74e70c4fd10399fbb5329b9.tar.gz
emacs-6cdd1c333034b308e74e70c4fd10399fbb5329b9.zip
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.
-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 @@
100(defconst reftex-version emacs-version 100(defconst reftex-version emacs-version
101 "Version string for RefTeX.") 101 "Version string for RefTeX.")
102 102
103(defvar reftex-mode-map (make-sparse-keymap) 103(defvar reftex-mode-map
104 (let ((map (make-sparse-keymap)))
105 ;; The default bindings in the mode map.
106 (define-key map "\C-c=" 'reftex-toc)
107 (define-key map "\C-c-" 'reftex-toc-recenter)
108 (define-key map "\C-c(" 'reftex-label)
109 (define-key map "\C-c)" 'reftex-reference)
110 (define-key map "\C-c[" 'reftex-citation)
111 (define-key map "\C-c<" 'reftex-index)
112 (define-key map "\C-c>" 'reftex-display-index)
113 (define-key map "\C-c/" 'reftex-index-selection-or-word)
114 (define-key map "\C-c\\" 'reftex-index-phrase-selection-or-word)
115 (define-key map "\C-c|" 'reftex-index-visit-phrases-buffer)
116 (define-key map "\C-c&" 'reftex-view-crossref)
117
118 ;; Bind `reftex-mouse-view-crossref' only when the key is still free
119 (if (featurep 'xemacs)
120 (unless (key-binding [(shift button2)])
121 (define-key map [(shift button2)] 'reftex-mouse-view-crossref))
122 (unless (key-binding [(shift mouse-2)])
123 (define-key map [(shift mouse-2)] 'reftex-mouse-view-crossref)))
124
125 ;; For most of these commands there are already bindings in place.
126 ;; Setting `reftex-extra-bindings' really is only there to spare users
127 ;; the hassle of defining bindings in the user space themselves. This
128 ;; is why they violate the key binding recommendations.
129 (when reftex-extra-bindings
130 (define-key map "\C-ct" 'reftex-toc)
131 (define-key map "\C-cl" 'reftex-label)
132 (define-key map "\C-cr" 'reftex-reference)
133 (define-key map "\C-cc" 'reftex-citation)
134 (define-key map "\C-cv" 'reftex-view-crossref)
135 (define-key map "\C-cg" 'reftex-grep-document)
136 (define-key map "\C-cs" 'reftex-search-document))
137
138 map)
104 "Keymap for RefTeX mode.") 139 "Keymap for RefTeX mode.")
105 140
106(defvar reftex-mode-menu nil) 141(defvar reftex-mode-menu nil)
@@ -659,9 +694,9 @@ on next use."
659 (interactive) 694 (interactive)
660 695
661 ;; Reset the file search path variables 696 ;; Reset the file search path variables
662 (loop for prop in '(status master-dir recursive-path rec-type) do 697 (dolist (prop '(status master-dir recursive-path rec-type))
663 (put 'reftex-tex-path prop nil) 698 (put 'reftex-tex-path prop nil)
664 (put 'reftex-bib-path prop nil)) 699 (put 'reftex-bib-path prop nil))
665 700
666 ;; Kill temporary buffers associated with RefTeX - just in case they 701 ;; Kill temporary buffers associated with RefTeX - just in case they
667 ;; were not cleaned up properly 702 ;; were not cleaned up properly
@@ -2134,30 +2169,6 @@ IGNORE-WORDS List of words which should be removed from the string."
2134;;; 2169;;;
2135;;; Keybindings 2170;;; Keybindings
2136 2171
2137;; The default bindings in the mode map.
2138(loop for x in
2139 '(("\C-c=" . reftex-toc)
2140 ("\C-c-" . reftex-toc-recenter)
2141 ("\C-c(" . reftex-label)
2142 ("\C-c)" . reftex-reference)
2143 ("\C-c[" . reftex-citation)
2144 ("\C-c<" . reftex-index)
2145 ("\C-c>" . reftex-display-index)
2146 ("\C-c/" . reftex-index-selection-or-word)
2147 ("\C-c\\" . reftex-index-phrase-selection-or-word)
2148 ("\C-c|" . reftex-index-visit-phrases-buffer)
2149 ("\C-c&" . reftex-view-crossref))
2150 do (define-key reftex-mode-map (car x) (cdr x)))
2151
2152;; Bind `reftex-mouse-view-crossref' only when the key is still free
2153(if (featurep 'xemacs)
2154 (unless (key-binding [(shift button2)])
2155 (define-key reftex-mode-map [(shift button2)]
2156 'reftex-mouse-view-crossref))
2157 (unless (key-binding [(shift mouse-2)])
2158 (define-key reftex-mode-map [(shift mouse-2)]
2159 'reftex-mouse-view-crossref)))
2160
2161(defvar bibtex-mode-map) 2172(defvar bibtex-mode-map)
2162 2173
2163;; Bind `reftex-view-crossref-from-bibtex' in BibTeX mode map 2174;; 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."
2165 "bibtex" 2176 "bibtex"
2166 '(define-key bibtex-mode-map "\C-c&" 'reftex-view-crossref-from-bibtex)) 2177 '(define-key bibtex-mode-map "\C-c&" 'reftex-view-crossref-from-bibtex))
2167 2178
2168;; For most of these commands there are already bindings in place.
2169;; Setting `reftex-extra-bindings' really is only there to spare users
2170;; the hassle of defining bindings in the user space themselves. This
2171;; is why they violate the key binding recommendations.
2172(when reftex-extra-bindings
2173 (loop for x in
2174 '(("\C-ct" . reftex-toc)
2175 ("\C-cl" . reftex-label)
2176 ("\C-cr" . reftex-reference)
2177 ("\C-cc" . reftex-citation)
2178 ("\C-cv" . reftex-view-crossref)
2179 ("\C-cg" . reftex-grep-document)
2180 ("\C-cs" . reftex-search-document))
2181 do (define-key reftex-mode-map (car x) (cdr x))))
2182
2183;;; ========================================================================= 2179;;; =========================================================================
2184;;; 2180;;;
2185;;; Menu 2181;;; Menu