]> code.delx.au - gnu-emacs-elpa/blob - packages/auctex-11.86/style/CJK.el
(debbugs-emacs): New function and modes for listing the Emacs bugs, reading them...
[gnu-emacs-elpa] / packages / auctex-11.86 / style / CJK.el
1 ;;; CJK.el --- AUCTeX style for the CJK package.
2
3 ;; Copyright (C) 2009 Free Software Foundation, Inc.
4
5 ;; Author: Ralf Angeli <angeli@caeruleus.net>
6 ;; Maintainer: auctex-devel@gnu.org
7 ;; Created: 2009-01-04
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 the CJK package, version 4.8.0
30 ;; (22-May-2008).
31
32 ;;; Code:
33
34 (defvar LaTeX-CJK-package-options
35 '("lowercase" "global" "local" "active" "encapsulated")
36 "Package options for the CJK package.")
37
38 (defvar LaTeX-CJK-enc-list
39 '("Bg5" "Bg5+" "HK" "GB" "GBt" "GBK" "JIS" "JIS2" "SJIS" "KS" "UTF8" "CNS1"
40 "CNS2" "CNS3" "CNS4" "CNS5" "CNS6" "CNS7" "CEFX" "CEFY")
41 "List of encodings supported by the CJK package.")
42
43 (defun LaTeX-env-CJK (env)
44 "Prompt for the arguments of ENV and insert it.
45 The function can be used for CJK and CJK* environments."
46 (LaTeX-insert-environment
47 env
48 (concat
49 (let ((font-enc (read-string "(Optional) Font encoding: ")))
50 (unless (zerop (length font-enc)) (format "[%s]" font-enc)))
51 (format "{%s}" (completing-read "Encoding: "
52 (mapcar 'list LaTeX-CJK-enc-list)))
53 (format "{%s}" (read-string "Font family: ")))))
54
55 (TeX-add-style-hook
56 "CJK"
57 (lambda ()
58 ;; New symbols
59 (TeX-add-symbols
60 '("CJKencfamily" ["Font encoding"] "Encoding" "Font family")
61 '("CJKchar" ["Encoding"] "First byte" "Second byte")
62 '("CJKcaption" 1)
63 '("CJKfamily" 1)
64 '("CJKfontenc" "Encoding" "Font encoding")
65 '("CJKenc" 1)
66 '("Unicode" "First byte" "Second byte")
67 '("CJKsymbols" 2)
68 '("CJKsymbol" 1)
69 "CJKbold"
70 "CJKnormal"
71 "CJKboldshift"
72 "CJKCJKchar"
73 "CJKhangulchar"
74 "CJKlatinchar"
75 "CJKhwkatakana"
76 "CJKnohwkatakana"
77 "CJKglue"
78 "CJKtolerance"
79 "CJKtilde"
80 "nbs"
81 "standardtilde"
82 "CJKspace"
83 "CJKnospace"
84 "CJKindent"
85 '("CJKaddEncHook" 2)
86 "CJKkern"
87 "CJKverbatim")
88 ;; New environments
89 (LaTeX-add-environments
90 '("CJK" LaTeX-env-CJK)
91 '("CJK*" LaTeX-env-CJK))))
92
93 ;;; CJK.el ends here