Mercurial > hg > dotemacs
comparison elpa/auctex-12.2.4/context-en.el @ 207:ded909e32640
auctex: new version from ELPA
author | Jordi Gutiérrez Hermoso <jordigh@octave.org> |
---|---|
date | Fri, 08 Jan 2021 19:42:09 -0500 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
206:c4742df2304d | 207:ded909e32640 |
---|---|
1 ;;; context-en.el --- Support for the ConTeXt english interface. | |
2 | |
3 ;; Copyright (C) 2003-2004, 2006, 2008, 2010, 2014 | |
4 ;; Free Software Foundation, Inc. | |
5 | |
6 ;; Maintainer: Berend de Boer <berend@pobox.com> | |
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 file is loaded by context.el when required. | |
29 | |
30 ;;; Code: | |
31 | |
32 ;; Build upon ConTeXt | |
33 (require 'context) | |
34 | |
35 ;;; ConText macro names | |
36 | |
37 ;;; Code: | |
38 (defvar ConTeXt-environment-list-en | |
39 '("alignment" "appendices" | |
40 "background" "backmatter" "bodymatter" "bodypart" "buffer" | |
41 "code" "color" "columns" "combination" | |
42 "encoding" "extroductions" | |
43 "fact" "formula" "framedcode" "framedtext" "frontmatter" | |
44 "helptext" "hiding" | |
45 "itemize" | |
46 "legend" "line" "linecorrection" "linenumbering" "lines" | |
47 "localenvironment" "localfootnotes" | |
48 "makeup" "mapping" "marginblock" "marginedge" "marginrule" "mode" | |
49 "narrower" "notmode" | |
50 "opposite" | |
51 "packed" "pagecomment" "pagefigure" "positioning" "postponing" | |
52 "quotation" | |
53 "raster" "register" | |
54 "standardmakeup" | |
55 "table" "tabulate" "TEXpage" "text" "textbackground" "typing" | |
56 "unpacked" | |
57 ;; project structure | |
58 "component" "environment" "product" "project" | |
59 ;; flowcharts, if you have loaded this module | |
60 "FLOWcell" "FLOWchart" | |
61 ;; typesetting computer languages | |
62 "EIFFEL" "JAVA" "JAVASCRIPT" "MP" "PASCAL" "PERL" "SQL" "TEX" "XML" | |
63 ;; some metapost environments | |
64 "MPpositiongraphic" "useMPgraphic" "MPcode" "reusableMPgraphic" | |
65 "uniqueMPgraphic") | |
66 "List of the ConTeXt en interface start/stop pairs.") | |
67 | |
68 (defvar ConTeXt-define-list-en | |
69 '("accent" | |
70 "background" "blank" "block" "blocks" "bodyfont" "bodyfontenvironment" | |
71 "buffer" | |
72 "casemap" "character" "color" "colorgroup" "combinedlist" "command" | |
73 "description" "enumeration" | |
74 "float" "font" "fontsynonym" "framedtext" "head" | |
75 "indenting" "label" | |
76 "logo" "overlay" | |
77 "palet" "program" "startstop" "type" "typing") | |
78 "List of the names of ConTeXt en interface macro's that define things.") | |
79 | |
80 (defvar ConTeXt-setup-list-en | |
81 '("align" "arranging" "background" "backgrounds" "blackrules" | |
82 "blank" "block" "bodyfont" "bodyfontenvironment" "bottom" | |
83 "bottomtexts" "buffer" "capitals" "caption" "captions" "color" | |
84 "colors" "columns" "combinations" "combinedlist" "descriptions" | |
85 "enumerations" "externalfigures" "fillinlines" "fillinrules" "float" | |
86 "floats" "footer" "footertexts" "footnodedefinition" "footnotes" | |
87 "framed" "framedtexts" "head" "header" "headertexts" "headnumber" | |
88 "heads" "headtext" "hyphenmark" "indentations" "indenting" "inmargin" | |
89 "interlinespace" "itemize" "items" "labeltext" "language" "layout" | |
90 "linenumbering" "lines" "list" "makeup" "marginblocks" | |
91 "marginrules" "marking" "narrower" "oppositeplacing" | |
92 "pagecomment" "pagenumber" "pagenumbering" "palet" "papersize" "paragraphs" | |
93 "quote" "referencing" "register" | |
94 "screens" "section" "sectionblock" "sorting" "spacing" | |
95 "subpagenumber" "synonyms" "text" "textrules" "texttexts" "thinrules" | |
96 "tolerance" "top" "toptexts" "type" "typing" "underbar" "whitespace") | |
97 "List of the names of ConTeXt en interface macro's that setup things.") | |
98 | |
99 ;; referencing in ConTeXt | |
100 (defvar ConTeXt-referencing-list-en | |
101 '("in" "at" "about" "pagereference" "textreference" "reference") | |
102 "List of ConTeXt en macro's that are used for referencing." | |
103 ) | |
104 | |
105 ;; lists some place macro's as well, should perhaps be under separate menu | |
106 (defvar ConTeXt-other-macro-list-en | |
107 '("abbreviation" "adaptlayout" "at" "combinepages" "copypages" | |
108 "externalfigure" "framed" "from" "input" "insertpages" "filterpages" | |
109 "getbuffer" "goto" | |
110 "hideblocks" "keepblocks" | |
111 "leftaligned" "midaligned" | |
112 "obeyspaces" | |
113 "page" | |
114 "placecontent" "placeexternalfigure" "placefigure" "placelogos" "placetable" | |
115 "processblocks" "protect" | |
116 "raggedcenter" "rightaligned" "rotate" | |
117 "scale" "selectblocks" "showexternalfigures" "slicepages" | |
118 "useexternalfigure" "unprotect" "url" "useblocks" "usemodule" "useURL" | |
119 "version") | |
120 "List of ConTeXt en interface macro's that are not an environment nor a setup.") | |
121 | |
122 (defun ConTeXt-define-command-en (what) | |
123 "The ConTeXt en interface way of creating a define command." | |
124 (concat "define" what)) | |
125 | |
126 (defun ConTeXt-setup-command-en (what) | |
127 "The ConTeXt en interface way of creating a setup command." | |
128 (concat "setup" what)) | |
129 | |
130 (defvar ConTeXt-project-structure-list-en | |
131 '("project" "environment" "product" "component") | |
132 "List of the names of ConTeXt project structure elements for its en interface. List should be in logical order.") | |
133 | |
134 (defvar ConTeXt-section-block-list-en | |
135 '("frontmatter" "bodymatter" "appendices" "backmatter") | |
136 "List of the names of ConTeXt section blocks for its en interface. List should be in logical order.") | |
137 | |
138 | |
139 ;; TODO: | |
140 ;; ConTeXt has alternative sections like title and subject. Currently | |
141 ;; the level is used to find the section name, so the alternative | |
142 ;; names are never found. Have to start using the section name instead | |
143 ;; of the number. | |
144 (defvar ConTeXt-numbered-section-list-en | |
145 '(("part" 0) | |
146 ("chapter" 1) | |
147 ("section" 2) | |
148 ("subsection" 3) | |
149 ("subsubsection" 4)) | |
150 "List of the names of ConTeXt numbered sections for its en interface.") | |
151 | |
152 (defvar ConTeXt-unnumbered-section-list-en | |
153 '(("title" 1) | |
154 ("subject" 2) | |
155 ("subsubject" 3) | |
156 ("subsubsubject" 4)) | |
157 "List of the names of ConTeXt unnumbered sections for its en interface.") | |
158 | |
159 (defvar ConTeXt-section-list-en | |
160 (append ConTeXt-numbered-section-list-en ConTeXt-unnumbered-section-list-en) | |
161 ) | |
162 | |
163 | |
164 (defvar ConTeXt-text-en "text" | |
165 "The ConTeXt en interface body text group.") | |
166 | |
167 (defvar ConTeXt-item-list-en | |
168 '("item" "its" "mar" "ran" "sub" "sym") | |
169 "The ConTeXt macro's that are variants of item.") | |
170 | |
171 (defcustom ConTeXt-default-environment-en "itemize" | |
172 "*The default environment when creating new ones with `ConTeXt-environment'." | |
173 :group 'ConTeXt-en-environment | |
174 :type 'string) | |
175 | |
176 (defvar ConTeXt-extra-paragraph-commands-en | |
177 '("crlf" "par" "place[A-Za-z]+") | |
178 "List of ConTeXt macros that should have their own line. | |
179 That is, besides the section(-block) commands.") | |
180 | |
181 ;; Emacs en menu names and labels should go here | |
182 ;; to be done | |
183 | |
184 | |
185 ;;; Mode | |
186 | |
187 (defun ConTeXt-en-mode-initialization () | |
188 "ConTeXt english interface specific initialization." | |
189 (mapc 'ConTeXt-add-environments (reverse ConTeXt-environment-list-en)) | |
190 | |
191 (TeX-add-symbols | |
192 '("but" ConTeXt-arg-define-ref (TeX-arg-literal " ")) | |
193 '("item" ConTeXt-arg-define-ref (TeX-arg-literal " ")) | |
194 '("items" [ConTeXt-arg-setup] (TeX-arg-string "Comma separated list")) | |
195 '("its" ConTeXt-arg-define-ref (TeX-arg-literal " ")) | |
196 '("nop" (TeX-arg-literal " ")) | |
197 '("ran" TeX-arg-string (TeX-arg-literal " ")) | |
198 '("sub" ConTeXt-arg-define-ref (TeX-arg-literal " ")) | |
199 '("sym" (TeX-arg-string "Symbol") (TeX-arg-literal " ")))) | |
200 | |
201 ;;;###autoload | |
202 (defun context-en-mode () | |
203 "Major mode for editing files for ConTeXt using its english interface. | |
204 | |
205 Special commands: | |
206 \\{ConTeXt-mode-map} | |
207 | |
208 Entering `context-mode' calls the value of `text-mode-hook', | |
209 then the value of TeX-mode-hook, and then the value | |
210 of context-mode-hook." | |
211 (interactive) | |
212 ;; set the ConTeXt interface | |
213 (setq ConTeXt-current-interface "en") | |
214 | |
215 ;; initialization | |
216 (ConTeXt-mode-common-initialization) | |
217 (ConTeXt-en-mode-initialization) | |
218 | |
219 ;; set mode line | |
220 (setq TeX-base-mode-name "ConTeXt-en") | |
221 (TeX-set-mode-name)) | |
222 | |
223 (provide 'context-en) | |
224 | |
225 ;;; context-en.el ends here |