AUCTeX Sync -- New Style Files
[packages] / xemacs-packages / auctex / style / gloss-italian.el
1 ;;; gloss-italian.el --- Italian support for polyglossia package.
2
3 ;; Copyright (C) 2015 Free Software Foundation, Inc.
4
5 ;; Maintainer: auctex-devel@gnu.org
6 ;; Author: Mosè Giordano <mose@gnu.org>
7 ;; Keywords: tex
8
9 ;; This file is part of AUCTeX.
10
11 ;; AUCTeX is free software; you can redistribute it and/or modify it
12 ;; under the terms of the GNU General Public License as published by
13 ;; the Free Software Foundation; either version 3, or (at your option)
14 ;; any later version.
15
16 ;; AUCTeX is distributed in the hope that it will be useful, but
17 ;; WITHOUT ANY WARRANTY; without even the implied warranty of
18 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
19 ;; General Public License for more details.
20
21 ;; You should have received a copy of the GNU General Public License
22 ;; along with AUCTeX; see the file COPYING.  If not, write to the Free
23 ;; Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
24 ;; 02110-1301, USA.
25
26 ;;; Commentary:
27
28 ;; This is based on italian.el style file, adapted to polyglossia package.
29
30 ;;; Code:
31
32 (defvar TeX-language-it-hook nil
33   "Hook run for Italian texts.")
34
35 (TeX-add-style-hook
36  "gloss-italian"
37  (lambda ()
38    (TeX-add-symbols
39     '("textitalian" [TeX-arg-key-val LaTeX-polyglossia-italian-options-list] t))
40    (LaTeX-add-environments
41     '("italian"
42       LaTeX-env-args [TeX-arg-key-val LaTeX-polyglossia-italian-options-list]))
43
44    (when (or (LaTeX-polyglossia-lang-option-member "italian" "babelshorthands=true")
45              (LaTeX-polyglossia-lang-option-member "italian" "babelshorthands"))
46      (unless (eq (car TeX-quote-language) 'override)
47        (let ((open-quote (if (and (boundp 'LaTeX-italian-open-quote)
48                                   LaTeX-italian-open-quote)
49                              LaTeX-italian-open-quote
50                            "\"<"))
51              (close-quote (if (and (boundp 'LaTeX-italian-close-quote)
52                                    LaTeX-italian-close-quote)
53                               LaTeX-italian-close-quote
54                             "\">")))
55          (setq TeX-quote-language
56                `("italian" ,open-quote ,close-quote ,TeX-quote-after-quote))))
57
58      ;; Fontification of quotation marks.
59      (when (fboundp 'font-latex-add-quotes)
60        (font-latex-add-quotes '("\"<" "\">" french))))
61    (run-hooks 'TeX-language-it-hook))
62  LaTeX-dialect)
63
64 (defvar LaTeX-polyglossia-italian-options-list
65   '(("babelshorthands" ("true" "false")))
66   "Italian language options for the polyglossia package.")
67
68 ;;; gloss-italian.el ends here