aboutsummaryrefslogtreecommitdiffstats
path: root/lisp/textmodes
diff options
context:
space:
mode:
authorStefan Monnier2010-05-02 22:29:46 -0400
committerStefan Monnier2010-05-02 22:29:46 -0400
commit56eb09046e00ac7ee6d3d3d752cb1ee664b7e062 (patch)
tree6ff481ffba16576053b3cb2a8ad24a4f66bdec4a /lisp/textmodes
parent063371f2b0dc2519db3abcbe54955167bde8ca9e (diff)
downloademacs-56eb09046e00ac7ee6d3d3d752cb1ee664b7e062.tar.gz
emacs-56eb09046e00ac7ee6d3d3d752cb1ee664b7e062.zip
Use define-minor-mode where applicable.
* mh-show.el (mh-showing-mode): Move function to mh-e.el. * mh-e.el (mh-showing-mode): * url-dired.el (url-dired-minor-mode): * org-table.el (orgtbl-mode): * view.el (view-mode): * type-break.el (type-break-query-mode) (type-break-mode-line-message-mode): * textmodes/reftex.el (reftex-mode): * term/vt100.el (vt100-wide-mode): * tar-mode.el (tar-subfile-mode): * savehist.el (savehist-mode): * ibuf-ext.el (ibuffer-auto-mode): * composite.el (auto-composition-mode): * progmodes/vhdl-mode.el (vhdl-electric-mode, vhdl-stutter-mode): Use define-minor-mode. (vhdl-mode): Use static mode-line format. (vhdl-mode-line-update): Delete. (vhdl-create-mode-menu, vhdl-activate-customizations) (vhdl-hs-minor-mode): Don't bother calling it.
Diffstat (limited to 'lisp/textmodes')
-rw-r--r--lisp/textmodes/reftex.el40
1 files changed, 10 insertions, 30 deletions
diff --git a/lisp/textmodes/reftex.el b/lisp/textmodes/reftex.el
index 66dec462b83..b4b0a281ca6 100644
--- a/lisp/textmodes/reftex.el
+++ b/lisp/textmodes/reftex.el
@@ -305,10 +305,6 @@
305(defconst reftex-version "RefTeX version 4.31" 305(defconst reftex-version "RefTeX version 4.31"
306 "Version string for RefTeX.") 306 "Version string for RefTeX.")
307 307
308(defvar reftex-mode nil
309 "Determines if RefTeX mode is active.")
310(make-variable-buffer-local 'reftex-mode)
311
312(defvar reftex-mode-map (make-sparse-keymap) 308(defvar reftex-mode-map (make-sparse-keymap)
313 "Keymap for RefTeX mode.") 309 "Keymap for RefTeX mode.")
314 310
@@ -504,8 +500,10 @@
504 "Turn on RefTeX mode." 500 "Turn on RefTeX mode."
505 (reftex-mode t)) 501 (reftex-mode t))
506 502
503(put 'reftex-mode :included '(memq major-mode '(latex-mode tex-mode)))
504(put 'reftex-mode :menu-tag "RefTeX Mode")
507;;;###autoload 505;;;###autoload
508(defun reftex-mode (&optional arg) 506(define-minor-mode reftex-mode
509 "Minor mode with distinct support for \\label, \\ref and \\cite in LaTeX. 507 "Minor mode with distinct support for \\label, \\ref and \\cite in LaTeX.
510 508
511\\<reftex-mode-map>A Table of Contents of the entire (multifile) document with browsing 509\\<reftex-mode-map>A Table of Contents of the entire (multifile) document with browsing
@@ -535,11 +533,7 @@ Under X, these and other functions will also be available as `Ref' menu
535on the menu bar. 533on the menu bar.
536 534
537------------------------------------------------------------------------------" 535------------------------------------------------------------------------------"
538 536 :lighter " Ref" :keymap reftex-mode-map
539 (interactive "P")
540 (setq reftex-mode (not (or (and (null arg) reftex-mode)
541 (<= (prefix-numeric-value arg) 0))))
542
543 (if reftex-mode 537 (if reftex-mode
544 (progn 538 (progn
545 ;; Mode was turned on 539 ;; Mode was turned on
@@ -565,24 +559,10 @@ on the menu bar.
565 (modify-syntax-entry ?\' "." reftex-syntax-table-for-bib) 559 (modify-syntax-entry ?\' "." reftex-syntax-table-for-bib)
566 (modify-syntax-entry ?\" "." reftex-syntax-table-for-bib) 560 (modify-syntax-entry ?\" "." reftex-syntax-table-for-bib)
567 (modify-syntax-entry ?\[ "." reftex-syntax-table-for-bib) 561 (modify-syntax-entry ?\[ "." reftex-syntax-table-for-bib)
568 (modify-syntax-entry ?\] "." reftex-syntax-table-for-bib) 562 (modify-syntax-entry ?\] "." reftex-syntax-table-for-bib))
569
570 (run-hooks 'reftex-mode-hook))
571 ;; Mode was turned off 563 ;; Mode was turned off
572 (easy-menu-remove reftex-mode-menu))) 564 (easy-menu-remove reftex-mode-menu)))
573 565
574(if (fboundp 'add-minor-mode)
575 ;; Use it so that we get the extras
576 (progn
577 (put 'reftex-mode :included '(memq major-mode '(latex-mode tex-mode)))
578 (put 'reftex-mode :menu-tag "RefTeX Mode")
579 (add-minor-mode 'reftex-mode " Ref" reftex-mode-map))
580 ;; The standard way
581 (unless (assoc 'reftex-mode minor-mode-alist)
582 (push '(reftex-mode " Ref") minor-mode-alist))
583 (unless (assoc 'reftex-mode minor-mode-map-alist)
584 (push (cons 'reftex-mode reftex-mode-map) minor-mode-map-alist)))
585
586(defvar reftex-docstruct-symbol) 566(defvar reftex-docstruct-symbol)
587(defun reftex-kill-buffer-hook () 567(defun reftex-kill-buffer-hook ()
588 "Save RefTeX's parse file for this buffer if the information has changed." 568 "Save RefTeX's parse file for this buffer if the information has changed."
@@ -625,11 +605,11 @@ on the menu bar.
625;;; 605;;;
626;;; Multibuffer Variables 606;;; Multibuffer Variables
627;;; 607;;;
628;;; Technical notes: These work as follows: We keep just one list 608;; Technical notes: These work as follows: We keep just one list
629;;; of labels for each master file - this can save a lot of memory. 609;; of labels for each master file - this can save a lot of memory.
630;;; `reftex-master-index-list' is an alist which connects the true file name 610;; `reftex-master-index-list' is an alist which connects the true file name
631;;; of each master file with the symbols holding the information on that 611;; of each master file with the symbols holding the information on that
632;;; document. Each buffer has local variables which point to these symbols. 612;; document. Each buffer has local variables which point to these symbols.
633 613
634;; List of variables which handle the multifile stuff. 614;; List of variables which handle the multifile stuff.
635;; This list is used to tie, untie, and reset these symbols. 615;; This list is used to tie, untie, and reset these symbols.