• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /macosx-10.10/emacs-93/emacs/lisp/textmodes/

Lines Matching +defs:auto +defs:mode +defs:list

1 ;;; reftex.el --- minor mode for doing \label, \ref, \cite, \index in LaTeX
31 ;; RefTeX is a minor mode with distinct support for \ref, \label, \cite,
50 ;; To turn RefTeX Mode on and off in a buffer, use `M-x reftex-mode'.
55 ;; (add-hook 'LaTeX-mode-hook 'turn-on-reftex) ; AUCTeX LaTeX mode
56 ;; (add-hook 'latex-mode-hook 'turn-on-reftex) ; Emacs latex mode
94 ;; search path, i.e. a list of directories to check. Normally this list
104 ;; reftex-mode'. To turn on RefTeX Mode for all LaTeX files, add the
107 ;; (add-hook 'LaTeX-mode-hook 'turn-on-reftex) ; with AUCTeX LaTeX mode
108 ;; (add-hook 'latex-mode-hook 'turn-on-reftex) ; with Emacs latex mode
149 ;; specified in the `\bibliography' command) and pull out a list of
150 ;; matches for you to choose from. The list is _formatted_ and
201 ;; list internally when `reftex-label' and `reftex-index' are used.
208 ;; If your major LaTeX mode is AUCTeX, RefTeX can cooperate with it
303 ;;; Define the formal stuff for a minor mode named RefTeX.
309 (defvar reftex-mode nil
310 "Determines if RefTeX mode is active.")
311 (make-variable-buffer-local 'reftex-mode)
313 (defvar reftex-mode-map (make-sparse-keymap)
314 "Keymap for RefTeX mode.")
316 (defvar reftex-mode-menu nil)
334 ;; to make the compilation of reftex-mode not complain.
335 (defvar reftex-auto-view-crossref-timer nil
336 "The timer used for auto-view-crossref.")
337 (defvar reftex-toc-auto-recenter-timer nil
342 "Turn on RefTeX mode."
343 (reftex-mode t))
346 (defun reftex-mode (&optional arg)
347 "Minor mode with distinct support for \\label, \\ref and \\cite in LaTeX.
349 \\<reftex-mode-map>A Table of Contents of the entire (multifile) document with browsing
358 to pull out a *formatted* list of articles from your BibTeX
371 \\{reftex-mode-map}
378 (setq reftex-mode (not (or (and (null arg) reftex-mode)
381 (if reftex-mode
384 (easy-menu-add reftex-mode-menu)
387 (unless (get 'reftex-auto-view-crossref 'initialized)
388 (and reftex-auto-view-crossref
389 (reftex-toggle-auto-view-crossref))
390 (put 'reftex-auto-view-crossref 'initialized t))
391 (unless (get 'reftex-auto-recenter-toc 'initialized)
392 (and (eq reftex-auto-recenter-toc t)
393 (reftex-toggle-auto-toc-recenter))
394 (put 'reftex-auto-recenter-toc 'initialized t))
408 (run-hooks 'reftex-mode-hook))
410 (easy-menu-remove reftex-mode-menu)))
412 (if (fboundp 'add-minor-mode)
415 (put 'reftex-mode :included '(memq major-mode '(latex-mode tex-mode)))
416 (put 'reftex-mode :menu-tag "RefTeX Mode")
417 (add-minor-mode 'reftex-mode " Ref" reftex-mode-map))
419 (unless (assoc 'reftex-mode minor-mode-alist)
420 (push '(reftex-mode " Ref") minor-mode-alist))
421 (unless (assoc 'reftex-mode minor-mode-map-alist)
422 (push (cons 'reftex-mode reftex-mode-map) minor-mode-map-alist)))
430 (when (and (boundp 'reftex-mode) reftex-mode
447 (buffer-list))))
457 (defvar outline-minor-mode)
458 (defvar font-lock-mode)
467 ;;; Technical notes: These work as follows: We keep just one list
469 ;;; `reftex-master-index-list' is an alist which connects the true file name
474 ;; This list is used to tie, untie, and reset these symbols.
479 (defvar reftex-master-index-list nil)
484 ;; Variable holding the symbol with the label list of the document.
497 (index (assoc master reftex-master-index-list))
507 (push (cons master index) reftex-master-index-list))
545 ((fboundp 'tex-main-file) (tex-main-file)) ; Emacs LaTeX mode
612 (defun reftex-add-index-macros (entry-list)
625 (let ((list (get reftex-docstruct-symbol 'reftex-index-macros-style))
627 (while entry-list
628 (setq entry (pop entry-list))
631 (not (memq entry list))
632 (setq list (reftex-remove-symbols-from-list list)))
633 ;; Add to list unless already member
634 (unless (member entry list)
637 (push entry list)))
639 (put reftex-docstruct-symbol 'reftex-index-macros-style list)))))
643 ;;; Functions to compile the tables, reset the mode etc.
666 (defvar reftex-label-mac-list nil)
669 (defvar reftex-label-env-list nil)
672 (defvar reftex-typekey-list nil)
679 ;; The last list-of-labels entry used in a reference.
680 (defvar reftex-last-used-reference (list nil nil nil nil))
689 ;; The message when follow-mode is suspended
691 "No follow-mode into unvisited file. Press SPC to visit it.")
741 ;; A list of all variables in the cache.
753 reftex-label-mac-list
754 reftex-label-env-list
755 reftex-typekey-list
811 (defun reftex-reset-mode ()
826 (let ((buffer-list '("*RefTeX Help*" "*RefTeX Select*"
829 (while (setq buf (pop buffer-list))
866 reftex-typekey-list)
885 (list reftex-label-alist
894 (reftex-splice-symbols-into-list
902 (reftex-splice-symbols-into-list
909 fmt reffmt labelfmt wordlist qh-list macros-with-labels
916 reftex-typekey-list nil
920 reftex-label-env-list nil
921 reftex-label-mac-list nil)
951 (setq fmt (list "\\label{%s}" fmt)))
956 (add-to-list 'reftex-typekey-list typekey))
959 (add-to-list 'reftex-prefix-to-typekey-alist
963 (add-to-list 'reftex-typekey-to-prefix-alist
973 (add-to-list 'reftex-special-env-parsers env-or-mac)
982 (if nlabel (add-to-list 'macros-with-labels env-or-mac)))
983 (if typekey (add-to-list 'reftex-label-mac-list env-or-mac)))
991 (add-to-list 'reftex-label-env-list env-or-mac)
1010 (push (list env-or-mac typekey context labelfmt
1023 ((setq cell (assoc typekey qh-list))
1026 (push (list typekey env-or-mac) qh-list)))))
1032 (setq qh-list
1033 (sort qh-list
1039 qh-list "")
1057 qh-list "\n")))
1107 (push (list macro tag prefix verify nargs nindex opt-args repeat)
1110 (push (list key macro) reftex-key-to-index-macro-alist))
1131 ;; Make the full list of section levels
1206 ;; Return a list of macro name, nargs, arg-nr which is label and a list of
1212 opt-list nlabel (cnt 0))
1216 (push cnt opt-list))
1221 (list must-match cnt nlabel opt-list)))
1236 (if (and reftex-mode
1277 (defun reftex-silence-toc-markers (list n)
1278 ;; Set all toc markers in the first N entries in list to nil
1279 (while (and list (> (decf n) -1))
1280 (and (eq (car (car list)) 'toc)
1281 (markerp (nth 4 (car list)))
1282 (set-marker (nth 4 (car list)) nil))
1283 (pop list)))
1288 (let* ((list (symbol-value reftex-docstruct-symbol))
1350 (print (list 'toc "toc" (nth 2 x) (nth 3 x)
1360 list))
1445 (list file))
1446 (list (concat file def-ext) file))))
1556 ;; Find FILE along the directory list PATH.
1584 ;; Expand parts of path ending in `//' recursively into directory list.
1595 (setq path1 (append (reftex-recursive-directory-list dir) path1))
1600 (defun reftex-recursive-directory-list (dir)
1601 ;; Return a list of all directories below DIR, including DIR itself
1602 (let ((path (list dir)) path1 file files)
1670 (autoload 'reftex-toggle-auto-toc-recenter "reftex-toc"
1680 (autoload 'reftex-get-bibfile-list "reftex-cite")
1694 (autoload 'reftex-select-label-mode "reftex-sel")
1695 (autoload 'reftex-select-bib-mode "reftex-sel")
1716 (autoload 'reftex-index-phrases-mode "reftex-index"
1717 "Major mode for managing the Index phrases of a LaTeX document." t)
1732 (autoload 'reftex-toggle-auto-view-crossref "reftex-dcr")
1750 "Produce a list of all duplicate labels in the document." t)
1811 "Is transient-mark-mode on and the region active?
1815 (and transient-mark-mode mark-active)))
1848 (defun reftex-all-assq (key list)
1849 ;; Return a list of all associations of KEY in LIST. Comparison with eq.
1851 (while (setq list (memq (assq key list) list))
1852 (push (car list) rtn)
1853 (pop list))
1856 (defun reftex-all-assoc-string (key list)
1857 ;; Return a list of all associations of KEY in LIST. Comparison with string=.
1859 (while list
1860 (if (string= (car (car list)) key)
1861 (push (car list) rtn))
1862 (pop list))
1865 (defun reftex-last-assoc-before-elt (key elt list &optional exclusive)
1871 (let* ((elt (car (member elt list))) (ex (not exclusive)) ass last-ass)
1872 (while (and (setq ass (assoc key list))
1873 (setq list (memq ass list))
1874 (or ex (not (eq elt (car list))))
1875 (memq elt list))
1877 list (cdr list)))
1880 (defun reftex-sublist-nth (list nth predicate &optional completion)
1881 ;; Make a list of the NTH elements of all members of LIST which
1884 ;; list also a list, so that the result can be used for completion.
1886 (while list
1887 (if (funcall predicate (car list))
1889 (list (nth nth (car list)))
1890 (nth nth (car list)))
1892 (setq list (cdr list)))
1942 (defun reftex-auto-mode-alist ()
1943 ;; Return an `auto-mode-alist' with only the .gz (etc) thingies.
1945 (let ((alist auto-mode-alist)
2041 (defun reftex-visited-files (list)
2042 ;; Takes a list of filenames and returns the buffers of those already visited
2044 list)))
2073 (auto-mode-alist (reftex-auto-mode-alist))
2074 (default-major-mode 'fundamental-mode)
2087 (add-to-list 'reftex-buffers-to-kill buf))
2096 ;; Kill all buffers in the list reftex-kill-temporary-buffers.
2115 (defun reftex-splice-symbols-into-list (list alist)
2116 ;; Splice the association in ALIST of any symbols in LIST into the list.
2117 ;; Return new list.
2119 (while list
2120 (while (and (not (null (car list))) ;; keep list elements nil
2121 (symbolp (car list)))
2122 (setq tmp (car list))
2125 (setq list (append (nth 2 (assoc tmp alist)) (cdr list))))
2129 (push (pop list) rtn))
2132 (defun reftex-remove-symbols-from-list (list)
2133 ;; Remove all symbols from list
2135 (while list
2136 (unless (symbolp (car list))
2137 (push (car list) rtn))
2138 (setq list (cdr list)))
2141 (defun reftex-uniquify (list)
2142 ;; Return a list of all elements in LIST, but each only once, keeping order
2144 (while list
2145 (setq elm (pop list))
2150 (defun reftex-uniquify-by-car (alist &optional keep-list)
2151 ;; Return a list of all elements in ALIST, but each car only once.
2156 (if (or (member (car elm) keep-list)
2195 ;; Remove words from the ignore list or with funny characters
2277 (and (featurep 'x-symbol-tex) (not (boundp 'x-symbol-mode)))))))
2296 (let ((major-mode 'latex-mode))
2297 (font-lock-mode 1)))
2302 (let ((major-mode 'latex-mode)
2383 ;; The default bindings in the mode map.
2396 do (define-key reftex-mode-map (car x) (cdr x)))
2401 (define-key reftex-mode-map [(shift button2)]
2404 (define-key reftex-mode-map [(shift mouse-2)]
2407 ;; Bind `reftex-view-crossref-from-bibtex' in BibTeX mode map
2410 '(define-key bibtex-mode-map "\C-c&" 'reftex-view-crossref-from-bibtex))
2422 do (define-key reftex-mode-map (car x) (cdr x))))
2430 (defvar reftex-isearch-minor-mode nil)
2431 (make-variable-buffer-local 'reftex-isearch-minor-mode)
2435 (easy-menu-define reftex-mode-menu reftex-mode-map
2436 "Menu used in RefTeX mode"
2489 ["Automatic Recenter" reftex-toggle-auto-toc-recenter
2490 :style toggle :selected reftex-toc-auto-recenter-timer]
2493 ["Automatic Info" reftex-toggle-auto-view-crossref
2494 :style toggle :selected reftex-auto-view-crossref-timer]
2495 ["...in Echo Area" (setq reftex-auto-view-crossref t)
2496 :style radio :selected (eq reftex-auto-view-crossref t)]
2497 ["...in Other Window" (setq reftex-auto-view-crossref 'window)
2498 :style radio :selected (eq reftex-auto-view-crossref 'window)]
2503 ["isearch whole document" reftex-isearch-minor-mode
2504 :style toggle :selected reftex-isearch-minor-mode])
2521 (list 'reftex-set-cite-format (list 'quote (car x)))
2523 (list 'eq (list 'reftex-get-cite-format) (list 'quote (car x)))))
2540 (list 'reftex-add-index-macros (list 'list (list 'quote (car x))))
2542 (list 'memq (list 'quote (car x))
2543 (list 'get 'reftex-docstruct-symbol
2544 (list 'quote 'reftex-index-macros-style)))))
2547 ["Reset RefTeX Mode" reftex-reset-mode t]