Debian Codegraph @

texmf-dist/doc/latex/fixme/fixme.el

raw
1 ;;; fixme.el --- AUCTeX style file for FiXme
2
3 ;; Copyright (C) 2000, 2002, 2004, 2006, 2009, 2017, 2019 Didier Verna
4
5 ;; Author: Didier Verna <[email protected]>
6 ;; Keywords: tex abbrev data
7
8 ;; This file is part of FiXme.
9
10 ;; FiXme may be distributed and/or modified under the conditions of the LaTeX
11 ;; Project Public License, either version 1.3 of this license or (at your
12 ;; option) any later version. The latest version of this license is in
13 ;; http://www.latex-project.org/lppl.txt and version 1.3 or later is part of
14 ;; all distributions of LaTeX version 2005/12/01 or later.
15
16 ;; FiXme consists of all files listed in the file `README.md'.
17
18
19 ;;; Commentary:
20
21
22 ;;; Code:
23
24
25 ;; ===========================================================================
26 ;; Utilities
27 ;; ===========================================================================
28
29 (defun LaTeX-fixme-xkeyval-boolean-values (items)
30 "Create a sorted list of XKeyVal boolean values for ITEMS.
31 Every item leads to two strings: \"item\" and \"noitem\"."
32 (sort (mapcan (lambda (item) `(,item ,(concat "no" item))) items)
33 #'string<))
34
35 (defun LaTeX-fixme-xkeyval-boolean-option (item)
36 "Create an XKeyVal boolean option for ITEM.
37 This creates a list of the form (\"ITEM\" (\"true\" \"false\"))."
38 `(,item ("true" "false")))
39
40 (defun LaTeX-fixme-option< (option1 option2)
41 "Return t if the car of OPTION1 is STRING< to the car of OPTION2.
42 This function is used as a predicate for sorting XKeyVal option
43 lists."
44 (string< (car option1) (car option2)))
45
46 (defun LaTeX-fixme-xkeyval-boolean-options (items)
47 "Create a sorted list of XKeyVal boolean options for ITEMS.
48 Every item leads to two lists: (\"item\" (\"true\" \"false\"))
49 and (\"noitem\" (\"true\" \"false\"))."
50 (sort (mapcar #'LaTeX-fixme-xkeyval-boolean-option
51 (LaTeX-fixme-xkeyval-boolean-values items))
52 #'LaTeX-fixme-option<))
53
54 ;; The two functions below steal AUCTeX's mechanism for reading key=value
55 ;; lists of options, only without the =value part. This is probably suboptimal
56 ;; because that part could still be entered manually (withtout, completion
57 ;; that is) although it's not supposed to, but it's simpler to do it this way.
58 (defun LaTeX-fixme-read-key (optional key-list &optional prompt)
59 "Prompt for keys in KEY-LIST and return them.
60 If OPTIONAL is non-nil, indicate in the prompt that we are
61 reading an optional argument. KEY-LIST is a list of strings.
62 Use PROMPT as the prompt string."
63 (multi-prompt-key-value
64 (TeX-argument-prompt optional prompt "Keys")
65 (if (symbolp key-list)
66 (eval key-list)
67 (mapcar #'list key-list))))
68
69 (defun LaTeX-fixme-arg-key (optional key-list &optional prompt)
70 "Prompt for keys in KEY-LIST and insert them as a TeX macro argument.
71 If OPTIONAL is non-nil, insert as an optional argument. KEY-LIST
72 is a list of strings. Use PROMPT as the prompt string."
73 (TeX-argument-insert (LaTeX-fixme-read-key optional key-list prompt)
74 optional))
75
76 (defun LaTeX-fixme-file-feature (kind)
77 "Return the KIND of feature name provided by the current file, or nil.
78 KIND may be one of \"layout\", \"envlout\", \"targetlayout\" or
79 \"theme\", in order to attempt matching the file name with
80 \"fxKIND<feature>.sty\"."
81 (let ((file-name (buffer-file-name)))
82 (when file-name
83 (setq file-name (file-name-nondirectory file-name))
84 (when (string-match (concat (regexp-quote (concat "fx" kind))
85 "\\(.+\\)\\.sty")
86 file-name)
87 (match-string 1 file-name)))))
88
89 (defun maybe-upcase-initials (string-or-nil)
90 "Upcase STRING-OR-NIL initials if it is a string, or return \"\"."
91 (if string-or-nil (upcase-initials string-or-nil) ""))
92
93
94
95 ;; ===========================================================================
96 ;; Options
97 ;; ===========================================================================
98
99 ;; Status processing
100 ;; -----------------
101 (defvar LaTeX-fixme-status-options
102 '(("draft")
103 ("final")
104 ("status" ("draft" "final")))
105 "FiXme document status options.")
106
107
108 ;; Layouts
109 ;; -------
110 (defvar LaTeX-fixme-builtin-layouts
111 '("footnote" "index" "inline" "margin" "marginclue")
112 "FiXme builtin layouts.")
113
114 (defvar LaTeX-fixme-builtin-layout-boolean-values
115 (LaTeX-fixme-xkeyval-boolean-values LaTeX-fixme-builtin-layouts)
116 "FiXme built-in layout boolean values.")
117
118 (defvar LaTeX-fixme-builtin-layout-boolean-options
119 (LaTeX-fixme-xkeyval-boolean-options LaTeX-fixme-builtin-layouts)
120 "FiXme built-in layout boolean options.")
121
122 (defvar LaTeX-fixme-external-layouts
123 '("marginnote"
124 "pdfcmargin" "pdfcnote" "pdfcsigmargin" "pdfcsignote"
125 "pdfmargin" "pdfnote" "pdfsigmargin" "pdfsignote")
126 "FiXme external layouts.")
127
128 (defvar LaTeX-fixme-external-layout-boolean-values
129 (LaTeX-fixme-xkeyval-boolean-values LaTeX-fixme-external-layouts)
130 "FiXme external layout boolean values.")
131
132 (defvar LaTeX-fixme-external-layout-boolean-options
133 (LaTeX-fixme-xkeyval-boolean-options LaTeX-fixme-external-layouts)
134 "FiXme external layout boolean options.")
135
136 (defvar LaTeX-fixme-layouts
137 (sort (copy-sequence `(,@LaTeX-fixme-builtin-layouts
138 ,@LaTeX-fixme-external-layouts))
139 #'string<)
140 "FiXme layouts.")
141
142 (defvar LaTeX-fixme-layout-boolean-values
143 (LaTeX-fixme-xkeyval-boolean-values LaTeX-fixme-layouts)
144 "FiXme layout boolean values.")
145
146 (defvar LaTeX-fixme-layout-boolean-options
147 (LaTeX-fixme-xkeyval-boolean-options LaTeX-fixme-layouts)
148 "FiXme layout boolean options.")
149
150 ;; #### FIXME: this is not totally correct. The layout, morelayout and
151 ;; innerlayout options accept either a single value, or a comma-separated list
152 ;; of such.
153 (defvar LaTeX-fixme-layout-options
154 (sort (copy-sequence
155 `(,@LaTeX-fixme-layout-boolean-options
156 ("layout" ,LaTeX-fixme-layout-boolean-values)
157 ("morelayout" ,LaTeX-fixme-layout-boolean-values)
158 ("innerlayout" (,@LaTeX-fixme-layout-boolean-values
159 ("layout" ,LaTeX-fixme-layout-boolean-values)
160 ("morelayout",LaTeX-fixme-layout-boolean-values)))))
161 #'LaTeX-fixme-option<)
162 "FiXme layout options.")
163
164
165 ;; Environment layouts
166 ;; -------------------
167 (defvar LaTeX-fixme-builtin-env-layouts
168 '("plain" "signature")
169 "FiXme builtin environment layouts.")
170
171 (defvar LaTeX-fixme-external-env-layouts
172 '("color" "colorsig")
173 "FiXme external environment layouts.")
174
175 (defvar LaTeX-fixme-env-layouts
176 (sort (copy-sequence `(,@LaTeX-fixme-builtin-env-layouts
177 ,@LaTeX-fixme-external-env-layouts))
178 #'string<)
179 "FiXme environment layouts.")
180
181 (defvar LaTeX-fixme-envlayout-option
182 `("envlayout" ,LaTeX-fixme-env-layouts)
183 "FiXme envlayout option.")
184
185
186 ;; Target layouts
187 ;; --------------
188 (defvar LaTeX-fixme-builtin-target-layouts
189 '("changebar" "plain")
190 "FiXme builtin target layouts.")
191
192 (defvar LaTeX-fixme-external-target-layouts
193 '("color" "colorcb")
194 "FiXme external target layouts.")
195
196 (defvar LaTeX-fixme-target-layouts
197 (sort (copy-sequence `(,@LaTeX-fixme-builtin-target-layouts
198 ,@LaTeX-fixme-external-target-layouts))
199 #'string<)
200 "FiXme target layouts.")
201
202 (defvar LaTeX-fixme-targetlayout-option
203 `("targetlayout" ,LaTeX-fixme-target-layouts)
204 "FiXme targetlayout option.")
205
206
207 ;; Target option
208 ;; -------------
209 (defvar LaTeX-fixme-target-option
210 '("target" ("thepage"))
211 "FiXme target option.")
212
213
214 ;; Faces
215 ;; -----
216 (defun LaTeX-fixme-face-option (face)
217 "Return the face option corresponding to FACE.
218 This is (\"FACEface\")."
219 `(,(concat face "face")))
220
221 (defvar LaTeX-fixme-common-faces '("inline" "margin" "signature")
222 "FiXme common faces.")
223
224 (defvar LaTeX-fixme-common-face-options
225 (sort (mapcar #'LaTeX-fixme-face-option LaTeX-fixme-common-faces)
226 #'LaTeX-fixme-option<)
227 "FiXme common face options.")
228
229 (defvar LaTeX-fixme-env-face "env"
230 "FiXme environment face.")
231
232 (defvar LaTeX-fixme-env-face-option
233 (LaTeX-fixme-face-option LaTeX-fixme-env-face)
234 "FiXme env face option.")
235
236 (defvar LaTeX-fixme-target-face "target"
237 "FiXme environment face.")
238
239 (defvar LaTeX-fixme-target-face-option
240 (LaTeX-fixme-face-option LaTeX-fixme-target-face)
241 "FiXme target face option.")
242
243 (defvar LaTeX-fixme-faces
244 (sort (copy-sequence `(,@LaTeX-fixme-common-faces
245 ,LaTeX-fixme-env-face ,LaTeX-fixme-target-face))
246 #'string<)
247 "FiXme faces.")
248
249 (defvar LaTeX-fixme-face-options
250 (sort (mapcar #'LaTeX-fixme-face-option LaTeX-fixme-faces)
251 #'LaTeX-fixme-option<)
252 "FiXme face options.")
253
254
255 ;; Logging
256 ;; -------
257 (defvar LaTeX-fixme-logging-options
258 (LaTeX-fixme-xkeyval-boolean-options '("silent"))
259 "FiXme logging options.")
260
261
262 ;; Languages
263 ;; ---------
264 (defvar LaTeX-fixme-languages
265 '("croatian" "danish" "english" "francais" "french" "german" "italian"
266 "ngerman" "spanish")
267 "FiXme Languages.")
268
269 ;; #### NOTE: langtrack not included
270 (defvar LaTeX-fixme-language-options
271 (sort `(,@(mapcar #'list LaTeX-fixme-languages)
272 ("lang" ,LaTeX-fixme-languages)
273 ("defaultlang" ,LaTeX-fixme-languages))
274 #'LaTeX-fixme-option<)
275 "FiXme options for language selection.")
276
277 (defvar LaTeX-fixme-langtrack-option
278 (LaTeX-fixme-xkeyval-boolean-option "langtrack")
279 "FiXme langtrack option.")
280
281
282 ;; Authoring
283 ;; ---------
284 (defvar LaTeX-fixme-author-option
285 '("author")
286 "FiXme author option.")
287
288
289 (defvar LaTeX-fixme-mode-options
290 (sort (copy-sequence `(,(LaTeX-fixme-xkeyval-boolean-option "singleuser")
291 ,(LaTeX-fixme-xkeyval-boolean-option "multiuser")
292 ("mode" ("multiuser""singleuser"))))
293 #'LaTeX-fixme-option<)
294 "FiXme mode options.")
295
296
297 ;; Themes
298 ;; ------
299 (defvar LaTeX-fixme-themes
300 '("color" "colorsig" "signature")
301 "FiXme themes.")
302
303 (defvar LaTeX-fixme-theme-option
304 `("theme" ,LaTeX-fixme-themes)
305 "FiXme theme option.")
306
307
308 ;; Macro-dependent
309 ;; ---------------
310 (defun LaTeX-fixme-annotation-options (&optional targeted)
311 "Return a specification for the optional argument to FiXme annotations.
312 Mostly all, except for envlayout, envface, langtrack and theme.
313 TARGETED is for the starred versions, where additional options
314 exist (targetlayout and targetface)."
315 `[ TeX-arg-key-val
316 ,(sort (copy-sequence `(,@LaTeX-fixme-status-options
317 ,@LaTeX-fixme-layout-options
318 ,@LaTeX-fixme-common-face-options
319 ,LaTeX-fixme-target-option
320 ,@(when targeted
321 `(,LaTeX-fixme-targetlayout-option
322 ,LaTeX-fixme-target-face-option))
323 ,@LaTeX-fixme-logging-options
324 ,@LaTeX-fixme-language-options
325 ,LaTeX-fixme-author-option
326 ,@LaTeX-fixme-mode-options))
327 #'LaTeX-fixme-option<) ])
328
329 ;; #### WARNING: gross hack. This function makes the targeted annotations look
330 ;; like they're taking a single mandatory argument, whereas they actually take
331 ;; 2.
332 (defun LaTeX-fixme-targeted-annotation-hack (optional)
333 "Hook for targeted FiXme annotations.
334 This function inserts a first couple of braces and a second one,
335 potentially with the active region's contents within it. The point is left
336 inside the first couple of braces."
337 (TeX-argument-insert "" nil)
338 (TeX-parse-argument optional nil))
339
340
341 ;; #### NOTE: an even DWIMer thing to do would be to make the MACRO argument
342 ;; depend on the NAME one, in case the user changed it from the initial input.
343 (defvar LaTeX-fixme-args-register-layout
344 `([ (LaTeX-fixme-arg-key ,LaTeX-fixme-layouts "Incompatible layout(s)") ]
345 (TeX-arg-eval TeX-read-string "Name: " (LaTeX-fixme-file-feature "layout"))
346 (TeX-arg-eval TeX-read-string "Macro: "
347 (concat TeX-esc "FXLayout"
348 (maybe-upcase-initials
349 (LaTeX-fixme-file-feature "layout")))))
350 "FiXme layout registration arguments.
351 An optional mutual exclusion list, a layout name and the
352 corresponding macro.")
353
354 ;; #### NOTE: OPTIONALP is ignored.
355 (defun LaTeX-fixme-boolean-option-definition (optionalp)
356 "Hook for boolean option definitions.
357 Prompt for, and insert a key between braces.
358 When TeX-insert-macro is called with a prefix argument, first insert an empty
359 pair of square brackets for a function definition, and leave point inside."
360 (cond (current-prefix-arg
361 (insert "[")
362 (let ((point (point)))
363 (insert "]")
364 (TeX-arg-string nil "Key")
365 (goto-char point)))
366 (t
367 (TeX-arg-string nil "Key"))))
368
369
370 ;; Environment-dependent
371 ;; ---------------------
372 ;; #### NOTE: this function compensates for the fact that AUCTeX doesn't
373 ;; understand t arguments in environments as it does in macros (the point is
374 ;; always left within the argument's body). The other solution (actually, the
375 ;; previous one) was to prompt for the annotation summary, but I find that
376 ;; less convenient to edit it in the minibuffer, rather than in the file
377 ;; directly.
378 (defun LaTeX-fixme-insert-environment (environment)
379 "Insert a FiXme annotation ENVIRONMENT.
380 Prompt for arguments, and leave point within the first couple of
381 braces, where the annotation summary needs to go. For targeted
382 environments, use the active region as the second mandatory
383 argument."
384 (let* ((targeted (string-match "\\*" environment))
385 (options-list (sort (copy-sequence
386 (append LaTeX-fixme-status-options
387 LaTeX-fixme-layout-options
388 LaTeX-fixme-common-face-options
389 LaTeX-fixme-logging-options
390 LaTeX-fixme-language-options
391 LaTeX-fixme-mode-options
392 (list LaTeX-fixme-envlayout-option
393 LaTeX-fixme-env-face-option
394 LaTeX-fixme-target-option
395 LaTeX-fixme-author-option)
396 (when targeted
397 (list LaTeX-fixme-targetlayout-option
398 LaTeX-fixme-target-face-option))))
399 #'LaTeX-fixme-option<))
400 (options (TeX-read-key-val t options-list))
401 (target (when (and targeted (TeX-active-mark))
402 (prog1 (buffer-substring (point) (mark))
403 (delete-region (point) (mark))))))
404 (LaTeX-insert-environment
405 environment
406 (concat (when (and options (not (string= options "")))
407 (format "[%s]" options))
408 (concat TeX-grop TeX-grcl)
409 (when targeted
410 (concat TeX-grop target TeX-grcl))))
411 (when target
412 (LaTeX-fill-environment nil)
413 (indent-according-to-mode)
414 ;; #### NOTE: for some reason, doing this after DELETE-REGION doesn't
415 ;; work (maybe something related to the insertion of the environment) so
416 ;; I'm deferring it to here.
417 (TeX-deactivate-mark))
418 (LaTeX-find-matching-begin)
419 (re-search-forward TeX-grcl)
420 (when (= (char-after) ?\[)
421 (forward-list))
422 (forward-char)))
423
424
425
426 ;; ===========================================================================
427 ;; Style Hooks
428 ;; ===========================================================================
429
430 (TeX-add-style-hook "fixme"
431 (lambda ()
432
433 (TeX-add-symbols
434 `("fxsetup" (TeX-arg-key-val ,(sort (copy-sequence
435 `(,@LaTeX-fixme-status-options
436 ,@LaTeX-fixme-layout-options
437 ,@LaTeX-fixme-common-face-options
438 ,LaTeX-fixme-envlayout-option
439 ,LaTeX-fixme-env-face-option
440 ,LaTeX-fixme-targetlayout-option
441 ,LaTeX-fixme-target-face-option
442 ,LaTeX-fixme-target-option
443 ,@LaTeX-fixme-logging-options
444 ,@LaTeX-fixme-language-options
445 ,LaTeX-fixme-langtrack-option
446 ,LaTeX-fixme-author-option
447 ,@LaTeX-fixme-mode-options
448 ,LaTeX-fixme-theme-option))
449 #'LaTeX-fixme-option<)))
450
451 `("fxnote" ,(LaTeX-fixme-annotation-options) t)
452 `("fxwarning" ,(LaTeX-fixme-annotation-options) t)
453 `("fxerror" ,(LaTeX-fixme-annotation-options) t)
454 `("fxfatal" ,(LaTeX-fixme-annotation-options) t)
455 ;; #### NOTE: \fixme is obsolete so I don't want to support it here.
456
457 `("fxnote*" ,(LaTeX-fixme-annotation-options t)
458 LaTeX-fixme-targeted-annotation-hack)
459 `("fxwarning*" ,(LaTeX-fixme-annotation-options t)
460 LaTeX-fixme-targeted-annotation-hack)
461 `("fxerror*" ,(LaTeX-fixme-annotation-options t)
462 LaTeX-fixme-targeted-annotation-hack)
463 `("fxfatal*" ,(LaTeX-fixme-annotation-options t)
464 LaTeX-fixme-targeted-annotation-hack)
465
466 '("listoffixmes" 0)
467
468 `("fxuselayouts" (TeX-arg-key-val ,LaTeX-fixme-layout-boolean-options
469 "Layout options"))
470 `("fxloadlayouts" (LaTeX-fixme-arg-key ,LaTeX-fixme-external-layouts
471 "External layouts"))
472
473 '("fxuseenvlayout" (TeX-arg-eval completing-read "Environment layout: "
474 LaTeX-fixme-env-layouts))
475 `("fxloadenvlayouts" (LaTeX-fixme-arg-key
476 ,LaTeX-fixme-external-env-layouts
477 "External environment layout(s)"))
478
479 '("fxusetargetlayout" (TeX-arg-eval completing-read "Target layout: "
480 LaTeX-fixme-target-layouts))
481 `("fxloadtargetlayouts" (LaTeX-fixme-arg-key
482 ,LaTeX-fixme-external-target-layouts
483 "External target layout(s)"))
484
485 '("fxsetface" (TeX-arg-eval completing-read "Face: " LaTeX-fixme-faces) t)
486
487 '("FXRegisterAuthor"
488 ;; #### WARNING: this really is a dirty, dirty trick. We construct a
489 ;; single argument out of 3, and let AUCTeX enclose the whole thing
490 ;; with the missing pair of braces...
491 (TeX-arg-eval
492 let* ((tag (read-from-minibuffer "Tag: "))
493 (cmd (read-from-minibuffer "Command prefix: " (downcase tag)))
494 (env (read-from-minibuffer "Environment prefix: "
495 (concat "a" (downcase cmd)))))
496 (concat cmd TeX-grcl
497 TeX-grop env TeX-grcl
498 TeX-grop tag)))
499
500 '("fxusetheme" (TeX-arg-eval completing-read "Theme: " LaTeX-fixme-themes))
501
502 `("FXRegisterLayout" ,@LaTeX-fixme-args-register-layout)
503 `("FXRegisterLayout*" ,@LaTeX-fixme-args-register-layout)
504 '("FXProvidesLayout"
505 (TeX-arg-eval TeX-read-string "Name: "
506 (LaTeX-fixme-file-feature "layout"))
507 [ TeX-arg-version ])
508 `("FXRequireLayouts" (LaTeX-fixme-arg-key ,LaTeX-fixme-external-layouts
509 "External layout(s)"))
510
511 '("FXRegisterEnvLayout"
512 (TeX-arg-eval TeX-read-string "Name: "
513 (LaTeX-fixme-file-feature "envlayout"))
514 (TeX-arg-eval TeX-read-string "Opening macro: "
515 (concat TeX-esc "FXEnvLayout"
516 (maybe-upcase-initials
517 (LaTeX-fixme-file-feature "envlayout"))
518 "Begin"))
519 (TeX-arg-eval TeX-read-string "Closing macro: "
520 (concat TeX-esc "FXEnvLayout"
521 (maybe-upcase-initials
522 (maybe-LaTeX-fixme-file-feature "envlayout"))
523 "End")))
524 '("FXProvidesEnvLayout"
525 (TeX-arg-eval TeX-read-string "Name: "
526 (LaTeX-fixme-file-feature "envlayout"))
527 [ TeX-arg-version ])
528 '("FXRequireEnvLayout" (TeX-arg-eval completing-read
529 "External environment layout: "
530 LaTeX-fixme-external-env-layouts))
531
532 '("FXRegisterTargetLayout"
533 (TeX-arg-eval TeX-read-string "Name: "
534 (LaTeX-fixme-file-feature "targetlayout"))
535 (TeX-arg-eval TeX-read-string "Macro: "
536 (concat TeX-esc "FXTargetLayout"
537 (maybe-upcase-initials
538 (LaTeX-fixme-file-feature "targetlayout")))))
539 '("FXProvidesTargetLayout"
540 (TeX-arg-eval TeX-read-string "Name: "
541 (LaTeX-fixme-file-feature "targetlayout"))
542 [ TeX-arg-version ])
543 '("Fxrequiretargetlayout"
544 (TeX-arg-eval completing-read "External target layout: "
545 LaTeX-fixme-external-target-layouts))
546
547 '("FXProvidesTheme"
548 (TeX-arg-eval TeX-read-string "Name: "
549 (LaTeX-fixme-file-feature "theme"))
550 [ TeX-arg-version ]))
551
552 (let ((families '("Layout" "EnvLayout" "TargetLayout")))
553 (apply #'TeX-add-symbols
554 (mapcar (lambda (macro)
555 (cons macro
556 '("Key" [ "Default" ] t)))
557 (mapcar (lambda (family) (concat "FXDefine" family "Key"))
558 families)))
559 (apply #'TeX-add-symbols
560 (mapcar (lambda (macro)
561 (cons macro
562 '([ "Macro prefix" ] "Key" [ "Default" ] t)))
563 (mapcar (lambda (family)
564 (concat "FXDefine" family "CmdKey"))
565 families)))
566 (apply #'TeX-add-symbols
567 (mapcar (lambda (macro)
568 (cons macro
569 '("Key" [ "Bin" ] "Alternatives" [ "Default" ] t)))
570 (mapcar (lambda (family)
571 (concat "FXDefine" family "ChoiceKey"))
572 families)))
573 (apply #'TeX-add-symbols
574 (mapcar (lambda (macro) (cons macro '("Key" t)))
575 (mapcar (lambda (family)
576 (concat "FXDefine" family "VoidKey"))
577 families)))
578 (apply #'TeX-add-symbols
579 (mapcar (lambda (macro)
580 (cons macro '(LaTeX-fixme-boolean-option-definition)))
581 (mapcar (lambda (family)
582 (concat "FXDefine" family "BoolKey"))
583 families))))
584
585 (apply #'TeX-add-symbols
586 (mapcan (lambda (macro)
587 (mapcar (lambda (language)
588 (list (concat "fx" language macro) 0))
589 ;; #### NOTE: francais is an alias to french.
590 (remove "francais" LaTeX-fixme-languages)))
591 (mapcar (lambda (macro) (concat macro "name"))
592 '("note" "notes"
593 "warning" "warnings"
594 "error" "errors"
595 "fatal" "fatals"))))
596
597 (apply #'TeX-add-symbols
598 (mapcar (lambda (language)
599 (list (concat language "listfixmename") 0))
600 ;; #### NOTE: francais is an alias to french.
601 (remove "francais" LaTeX-fixme-languages)))
602
603
604 (LaTeX-add-environments
605 `("anfxnote" LaTeX-fixme-insert-environment)
606 `("anfxwarning" LaTeX-fixme-insert-environment)
607 `("anfxerror" LaTeX-fixme-insert-environment)
608 `("anfxfatal" LaTeX-fixme-insert-environment)
609
610 `("anfxnote*" LaTeX-fixme-insert-environment)
611 `("anfxwarning*" LaTeX-fixme-insert-environment)
612 `("anfxerror*" LaTeX-fixme-insert-environment)
613 `("anfxfatal*" LaTeX-fixme-insert-environment))
614
615
616 (when (and (featurep 'font-latex)
617 (eq TeX-install-font-lock 'font-latex-setup))
618 (font-latex-add-keywords '(("fxsetup" "{")
619
620 "listoffixmes"
621
622 ("fxuselayouts" "{")
623 ("fxloadlayouts" "{")
624
625 ("fxuseenvlayout" "{")
626 ("fxloadenvlayouts" "{")
627
628 ("fxusetargetlayout" "{")
629 ("fxloadtargetlayouts" "{")
630
631 ("fxsetface" "{{")
632
633 ("FXRegisterAuthor" "{{{")
634
635 ("fxusetheme" "{")
636
637 ("FXRegisterLayout" "*[{{")
638 ("FXProvidesLayout" "{[")
639 ("FXRequireLayout" "{")
640
641 ("FXRegisterEnvLayout" "{{{")
642 ("FXProvidesEnvLayout" "{[")
643 ("FXRequireEnvLayout" "{")
644
645 ("FXRegisterTargetLayout" "{{")
646 ("FXProvidesTargetLayout" "{[")
647 ("FXRequireTargetLayout" "{")
648
649 ("FXDefineLayoutKey" "{[{")
650 ("FXDefineEnvLayoutKey" "{[{")
651 ("FXDefineTargetLayoutKey" "{[{")
652
653 ("FXDefineLayoutCmdKey" "[{[{")
654 ("FXDefineEnvLayoutCmdKey" "[{[{")
655 ("FXDefineTargetLayoutCmdKey" "[{[{")
656
657 ("FXDefineLayoutChoiceKey" "{[{[{")
658 ("FXDefineEnvLayoutChoiceKey" "{[{[{")
659 ("FXDefineTargetLayoutChoiceKey" "{[{[{")
660
661 ("FXDefineLayoutVoidKey" "{{")
662 ("FXDefineEnvLayoutVoidKey" "{{")
663 ("FXDefineTargetLayoutVoidKey" "{{")
664
665 ("FXDefineLayoutBoolKey" "[{")
666 ("FXDefineEnvLayoutBoolKey" "[{")
667 ("FXDefineTargetLayoutBoolKey" "[{")
668
669 ("FXProvidesTheme" "{["))
670 'function)
671 ;; The starred version of the 4 macros below takes a second mandatory
672 ;; argument. We skip this since it would confuse font-latex when used as
673 ;; the non-starred version
674 (font-latex-add-keywords '(("fxnote" "*[{")
675 ("fxwarning" "*[{")
676 ("fxerror" "*[{")
677 ("fxfatal" "*[{"))
678 'textual)))
679 LaTeX-dialect)
680
681
682
683 ;;; Local variables:
684 ;;; eval: (put 'TeX-add-style-hook 'lisp-indent-function 1)
685 ;;; End:
686
687 ;;; fixme.el ends here