"Fossies" - the Fresh Open Source Software Archive

Member "auctex-12.3/style/tex-live.el" (18 Oct 2020, 4974 Bytes) of package /linux/misc/auctex-12.3.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) Lisp source code syntax highlighting (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file.

    1 ;;; tex-live.el --- AUCTeX style for `tex-live.sty'
    2 
    3 ;; Copyright (C) 2020 Free Software Foundation, Inc.
    4 
    5 ;; Author: Arash Esbati <arash@gnu.org>
    6 ;; Maintainer: auctex-devel@gnu.org
    7 ;; Created: 2020-03-29
    8 ;; Keywords: tex
    9 
   10 ;; This file is part of AUCTeX.
   11 
   12 ;; AUCTeX is free software; you can redistribute it and/or modify it
   13 ;; under the terms of the GNU General Public License as published by
   14 ;; the Free Software Foundation; either version 3, or (at your option)
   15 ;; any later version.
   16 
   17 ;; AUCTeX is distributed in the hope that it will be useful, but
   18 ;; WITHOUT ANY WARRANTY; without even the implied warranty of
   19 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   20 ;; General Public License for more details.
   21 
   22 ;; You should have received a copy of the GNU General Public License
   23 ;; along with AUCTeX; see the file COPYING.  If not, write to the Free
   24 ;; Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
   25 ;; 02110-1301, USA.
   26 
   27 ;;; Commentary:
   28 
   29 ;; This file adds support for `tex-live.sty' from 2019/08/14.
   30 ;; `tex-live.sty' is part of TeXLive.
   31 
   32 ;; Chances are high that this style is not feature complete, and
   33 ;; fontification is not ideal.  But this might be a starting point for
   34 ;; TeXLive documentation editors who use AUCTeX.
   35 
   36 ;; Silence the compiler:
   37 (declare-function LaTeX-add-fancyvrb-environments
   38           "fancyvrb"
   39           (&rest fancyvrb-environments))
   40 
   41 (declare-function font-latex-add-keywords
   42           "font-latex"
   43           (keywords class))
   44 
   45 (TeX-add-style-hook
   46  "tex-live"
   47  (lambda ()
   48 
   49    ;; Run hooks for required packages:
   50    (TeX-run-style-hooks "geometry"
   51             "alltt"
   52             "array"
   53             "colortbl"
   54             "comment"
   55             "float"
   56             "graphicx"
   57             "longtable"
   58             "ulem"
   59             "url"
   60             "xspace"
   61             "relsize"
   62             "fancyvrb")
   63 
   64    ;; Add | to a local version of `LaTeX-shortvrb-chars' before
   65    ;; running the style hook `shortvrb.el':
   66    (add-to-list (make-local-variable 'LaTeX-shortvrb-chars) ?|)
   67    (TeX-run-style-hooks "shortvrb")
   68 
   69    ;; Add support for custom environments defined with `fancyvrb.sty':
   70    (LaTeX-add-fancyvrb-environments
   71     '("verbatim" "Verbatim")
   72     '("sverbatim" "Verbatim")
   73     '("fverbatim" "Verbatim")
   74     '("boxedverbatim" "Verbatim"))
   75 
   76    (TeX-add-symbols
   77     '("verbatiminput" LaTeX-fancyvrb-arg-file-relative)
   78     '("boxedverbatiminput" LaTeX-fancyvrb-arg-file-relative)
   79     '("listinginput"
   80       (TeX-arg-eval completing-read
   81             (TeX-argument-prompt optional nil "Value of firstnumber key")
   82             (cadr (assoc "firstnumber" LaTeX-fancyvrb-key-val-options-local)))
   83       LaTeX-fancyvrb-arg-file-relative)
   84 
   85     ;; Various sorts of names:
   86     '("pkgname" "Package")
   87     '("optname" "Option")
   88     '("cmdname" "Command")
   89     '("colname" "Collection")
   90     '("dirname" "Directory")
   91     '("filename" "Directory")
   92     '("envname"
   93       (TeX-arg-eval completing-read
   94             (TeX-argument-prompt optional nil "Environment")
   95             '("TEXMFCACHE"
   96               "TEXMFCNF"
   97               "TEXMFCONFIG"
   98               "TEXMFDIST"
   99               "TEXMFHOME"
  100               "TEXMFLOCAL"
  101               "TEXMFMAIN"
  102               "TEXMFOUTPUT"
  103               "TEXMFSYSCONFIG"
  104               "TEXMFSYSVAR"
  105               "TEXMFVAR"
  106               "TEXINPUTS"
  107               "TEXFONTMAPS"
  108               "ENCFONTS"
  109               "PATH" "MANPATH" "INFOPATH" "DISPLAY")))
  110     '("code" "Code")
  111     '("file" "File")
  112     '("prog" "Program")
  113     '("samp" "Sample")
  114     '("var" "Variable")
  115     '("ttbar" "Variable (typewriter)")
  116 
  117     '("Ucom" "Command (bold)")
  118 
  119     ;; Special names:
  120     '("dpi" 0)
  121     '("bs" 0)
  122     '("cs" TeX-arg-macro))
  123 
  124    (add-to-list 'LaTeX-verbatim-macros-with-braces-local "dirname")
  125    (add-to-list 'LaTeX-verbatim-macros-with-braces-local "filename")
  126 
  127    (LaTeX-add-environments
  128     '("ttdescription" LaTeX-env-item)
  129     '("cmddescription" LaTeX-env-item)
  130     '("itemize*" LaTeX-env-item)
  131     '("enumerate*" LaTeX-env-item)
  132     '("warningbox")
  133     '("lrBox"))
  134 
  135    ;; `tex-live.sty' adds one new column specification letter P:
  136    (set (make-local-variable 'LaTeX-array-column-letters)
  137     (concat LaTeX-array-column-letters "P"))
  138 
  139    ;; Custom env's where \item takes an opt. argument:
  140    (let ((envs '("ttdescription" "cmddescription")))
  141      (dolist (env envs)
  142        (add-to-list 'LaTeX-item-list `(,env . LaTeX-item-argument) t)))
  143 
  144    ;; Fontification
  145    (when (and (featurep 'font-latex)
  146           (eq TeX-install-font-lock 'font-latex-setup))
  147      (font-latex-add-keywords '(("verbatiminput"      "{")
  148                 ("boxedverbatiminput" "{")
  149                 ("listinginput"       "{{")
  150                 ("pkgname"       "{")
  151                 ("optname"       "{")
  152                 ("cmdname"       "{")
  153                 ("colname"       "{")
  154                 ("dirname"       "")
  155                 ("filename"      "")
  156                 ("envname"       "{")
  157                 ("cs"            "{"))
  158                   'reference)
  159      (font-latex-add-keywords '(("code" "{")
  160                 ("file" "{")
  161                 ("prog" "{")
  162                 ("samp" "{")
  163                 ("ttvar" "{"))
  164                   'type-command)
  165      (font-latex-add-keywords '(("var" "{") )
  166                   'italic-command)
  167      (font-latex-add-keywords '(("Ucom" "{"))
  168                   'bold-command)))
  169  LaTeX-dialect)
  170 
  171 ;;; tex-live.el ends here