help-emacs-windows
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: [h-e-w] Font Lock in Emacs 21 (with AucTeX)


From: Underwood, Jonathan
Subject: RE: [h-e-w] Font Lock in Emacs 21 (with AucTeX)
Date: Tue, 5 Feb 2002 16:42:56 -0500


I don;t seem to have any problem with font-lock in 21.1 with auctex. I do actually use font-latex which comes with auctex for font locking, as it's better than normal font lock. Below is my site-tex.el file which does all my tex set up and is called from my .emacs using (require site-tex). You'll need to tweak the relevant variables to suit your own environment if you want to use this, otherwise it might just be useful for pointers. Note that using this file means you don;t have to do any editing of tex-site.el within the auctex package.

HTH
jonathan

;Time-stamp: <Wed 12 Dec, 2001. 21:49>
;; Rather than copy and edit the tex-site.el as suggested in the auctex
;; distribution, here i do all the site customization. The reason being there
;; was errors in the tex-mik.el file, so it was easier to first load the auctex
;; files and then fix things up.

(provide 'site-tex)

;;; These are the only variables which should need changing (these are my
;;; own defines)
(defvar auctex-file-dir "c:/usr/emacs/site-lisp/auctex-10.0g/"
  "*Directory where the auctex package resides. Used first to load the
tex-site.el from auctex package, and then to set TeX-lisp-directory.")

(defvar tex-macro-dir '("c:/usr/texmf/tex/" "c:/usr/localtexmf/tex/")
  "*List of directories where the tex macro and style files reside. Used to set
TeX-macro-global.")

(defvar auctex-info-dir (list "c:/usr/emacs/site-lisp/auctex-10.0g/doc/")
  "*Directory in which the AucTeX info files reside.")
;___________________________________________________________________________________

;;; Add auctex directory to load path and load tex-site from the auctex package.
(setq Info-default-directory-list (append auctex-info-dir Info-default-directory-list))
(setq load-path (append (list auctex-file-dir) load-path))
(require 'tex-site)

;___________________________________________________________________________________

;;; Fix things not set in tex-site.el (taken from tex-site.el)
(setq TeX-lisp-directory auctex-file-dir)
(setq TeX-macro-global tex-macro-dir)

;___________________________________________________________________________________

;;; Windows specific stuff, assuming using the miktex distribution.
(cond ((string-match "nt" system-configuration)
      ;; Stuff taken from tex-mik.el
      ;; The MikTeX commands.
      (setq TeX-command-list
            (list (list "TeX" "tex \\nonstopmode\\input %t" 'TeX-run-TeX nil t)
                  (list "LaTeX" "%l \\nonstopmode\\input{%t}" 'TeX-run-LaTeX nil t)
                  (list "LaTeX PDF" "pdflatex \\nonstopmode\\input{%t}"
                        'TeX-run-LaTeX nil t)
                  (list "View" "%v" 'TeX-run-discard nil nil)
                  ;;    (list "gsview" "gsview32 %f" 'TeX-run-command t nil)
                  (list "dvips" "dvips %d -o %f " 'TeX-run-command t nil)
                  (list "dvips (Letter)" "dvips %d -t letter -o %f "
                        'TeX-run-command t nil)
                  (list "BibTeX" "bibtex %s" 'TeX-run-BibTeX nil nil)
                  (list "Index" "makeindex %s" 'TeX-run-command nil t)
                  (list "Check" "lacheck %s" 'TeX-run-compile nil t)
                  (list "Other" "" 'TeX-run-command t t)))
     
      ;; DVI to source correspondence (stolen from the German magazine c't).
      (setq LaTeX-command-style '(("." "latex --src-specials --c-style-errors")))
      (setq TeX-view-style '(("^a5$" "yap %d -paper a5")
                             ("^landscape$" "yap %d -paper a4r -s 4")
                             ("^epsf$" "gsview32 %f")
                             ("." "yap -1 -s%n%b %d")))
     
      ;; These two auctex variables cope for the situation where cmd.exe is not the
      ;; usual shell. This seems futile since bash set up still screws up latexing.g
      (require 'tex-buf)
      (setq TeX-shell "cmd")
      (setq TeX-shell-command-option "/c")
      ))
;___________________________________________________________________________________

;;; The Following stuff has been migrated from .emacs file
;; Auctex options.
(setq TeX-default-mode 'LaTeX-mode) ; as opposed to emacs latex mode.
(setq TeX-auto-save t)
(setq TeX-parse-self t)
(setq-default TeX-master nil); Query for Master file

;; Font latex - enhanced font lock for latex files.
(require 'font-latex)

;; reftex
(autoload 'reftex-mode "reftex" "RefTeX Minor Mode" t)
(autoload 'turn-on-reftex  "reftex" "RefTeX Minor Mode" nil)
(autoload 'reftex-citation "reftex-cite" "Make citation" nil)
(add-hook 'LaTeX-mode-hook 'turn-on-reftex)   ; with AUCTeX LaTeX mode
(setq reftex-plug-into-AUCTeX t)
(setq reftex-enable-partial-scans t)
(setq reftex-save-parse-info t)
(setq reftex-use-multiple-selection-buffers t)
(setq bib-cite-use-reftex-view-crossref t)
(setq reftex-cite-format 'natbib)

;; flyspell (minor mode)
(add-hook 'LaTeX-mode-hook 'flyspell-mode)
(setq ispell-parser 'tex)

;; Local mode customization-add functions and bind keys.
(add-hook 'LaTeX-mode-hook
          '(lambda()
             (local-set-key [f5] 'do-LaTeX)
             (local-set-key [f6] 'do-BibTeX)
             (local-set-key [f7] 'do-dviview)
             (local-set-key [f8] 'do-dvips)
             (defun do-LaTeX ()
               "LaTeX the current file."
               (interactive)
               (TeX-command "LaTeX" 'TeX-master-file))
             (defun do-BibTeX ()
               "BibTeX the current file."
               (interactive)
               (TeX-command "BibTeX" 'TeX-master-file))
             (defun do-dviview ()
               "YAPview the current file."
               (interactive)
               (TeX-command "View" 'TeX-master-file))
             (defun do-dvips ()
               "DVIPS the current file."
               (interactive)
               (TeX-command "dvips" 'TeX-master-file))
             ))

;; settings for bib-cite.el (for bibtex files)
(require 'imenu)
(autoload 'turn-on-bib-cite "bib-cite")
(add-hook 'LaTeX-mode-hook 'turn-on-bib-cite)


> -----Original Message-----
> From: Joe Riel [mailto:address@hidden]
> Sent: February 5, 2002 12:24 PM
> To: address@hidden
> Subject: [h-e-w] Font Lock in Emacs 21 (with AucTeX)
>
>
> I've just upgraded to Emacs 21. Font lock works in other
> buffers, but not in Auctex mode.
> I notice that the font-lock minor mode, in any buffer, is no
> longer described by describe-mode (C-h m).
>
> Any pointers to turning on font lock in Auctex would be appreciated.
>
>
> Joe Riel
>
>
>


reply via email to

[Prev in Thread] Current Thread [Next in Thread]