diff options
Diffstat (limited to 'ekdosis.el')
-rw-r--r-- | ekdosis.el | 115 |
1 files changed, 52 insertions, 63 deletions
@@ -22,36 +22,39 @@ | |||
22 | ;; <http://www.gnu.org/licenses/>. | 22 | ;; <http://www.gnu.org/licenses/>. |
23 | 23 | ||
24 | (defvar LaTeX-ekdosis-preamble-options | 24 | (defvar LaTeX-ekdosis-preamble-options |
25 | '(;; | 25 | '(("parnotes" ("true" "false" "roman")) |
26 | ("parnotes" ("true" "false" "roman")) | ||
27 | ("teiexport" ("true" "false" "tidy")) | 26 | ("teiexport" ("true" "false" "tidy")) |
28 | ("layout" ("float" "footins")) | 27 | ("layout" ("float" "footins"))) |
29 | ) | ||
30 | "Package options for the ekdosis package.") | 28 | "Package options for the ekdosis package.") |
31 | 29 | ||
32 | (defun LaTeX-ekdosis-package-options () | 30 | (defun LaTeX-ekdosis-package-options () |
33 | "Prompt for package options for ekdosis package." | 31 | "Prompt for package options for ekdosis package." |
34 | (TeX-read-key-val t | 32 | (TeX-read-key-val t LaTeX-ekdosis-preamble-options)) |
35 | (append LaTeX-ekdosis-preamble-options))) | 33 | |
34 | (defun LaTeX-ekdosis-long-key-val (optional arg) | ||
35 | (let ((crm-local-completion-map | ||
36 | (remove (assoc 32 crm-local-completion-map) | ||
37 | crm-local-completion-map)) | ||
38 | (minibuffer-local-completion-map | ||
39 | (remove (assoc 32 minibuffer-local-completion-map) | ||
40 | minibuffer-local-completion-map))) | ||
41 | (TeX-argument-insert | ||
42 | (TeX-read-key-val optional arg) | ||
43 | optional))) | ||
36 | 44 | ||
37 | (defvar LaTeX-ekdosis-declarewitness-options | 45 | (defvar LaTeX-ekdosis-declarewitness-options |
38 | '(;; | 46 | '(("settlement") |
39 | ("settlement") | ||
40 | ("repository") | 47 | ("repository") |
41 | ("msName") | 48 | ("msName") |
42 | ("origDate") | 49 | ("origDate")) |
43 | ) | 50 | "List of local options for DeclareWitness macro.") |
44 | "Local options.") | ||
45 | 51 | ||
46 | (defvar LaTeX-ekdosis-app-options | 52 | (defvar LaTeX-ekdosis-app-options |
47 | '(;; | 53 | '(("type")) |
48 | ("type") | 54 | "Local option for app|note macro.") |
49 | ) | ||
50 | "Local options.") | ||
51 | 55 | ||
52 | (defvar LaTeX-ekdosis-lem-options | 56 | (defvar LaTeX-ekdosis-lem-options |
53 | '(;; | 57 | '(("wit") |
54 | ("wit") | ||
55 | ("alt") | 58 | ("alt") |
56 | ("pre") | 59 | ("pre") |
57 | ("post") | 60 | ("post") |
@@ -59,51 +62,42 @@ | |||
59 | ("postwit") | 62 | ("postwit") |
60 | ("sep") | 63 | ("sep") |
61 | ("nolem" ("true" "false")) | 64 | ("nolem" ("true" "false")) |
62 | ("nosep" ("true" "false")) | 65 | ("nosep" ("true" "false"))) |
63 | ) | 66 | "Local options for lem macro") |
64 | "Local options.") | ||
65 | 67 | ||
66 | (defvar LaTeX-ekdosis-rdg-options | 68 | (defvar LaTeX-ekdosis-rdg-options |
67 | '(;; | 69 | '(("wit") |
68 | ("wit") | ||
69 | ("alt") | 70 | ("alt") |
70 | ("pre") | 71 | ("pre") |
71 | ("post") | 72 | ("post") |
72 | ("prewit") | 73 | ("prewit") |
73 | ("postwit") | 74 | ("postwit") |
74 | ("nordg" ("true" "false")) | 75 | ("nordg" ("true" "false"))) |
75 | ) | 76 | "Local options for rdg macro.") |
76 | "Local options.") | ||
77 | 77 | ||
78 | (defvar LaTeX-ekdosis-note-options | 78 | (defvar LaTeX-ekdosis-note-options |
79 | '(;; | 79 | '(("type") |
80 | ("type") | ||
81 | ("lem") | 80 | ("lem") |
82 | ("labelb") | 81 | ("labelb") |
83 | ("labele") | 82 | ("labele") |
84 | ("sep") | 83 | ("sep") |
85 | ("pre") | 84 | ("pre") |
86 | ("post") | 85 | ("post")) |
87 | ) | 86 | "Local options for note macro.") |
88 | "Local options.") | ||
89 | 87 | ||
90 | (defvar LaTeX-ekdosis-note-star-options | 88 | (defvar LaTeX-ekdosis-note-star-options |
91 | '(;; | 89 | '(("pre") |
92 | ("pre") | 90 | ("post")) |
93 | ("post") | 91 | "Local options for note* macro.") |
94 | ) | ||
95 | "Local options.") | ||
96 | 92 | ||
97 | (defvar LaTeX-ekdosis-alignment-key-val-options | 93 | (defvar LaTeX-ekdosis-alignment-key-val-options |
98 | '(;; | 94 | '(("tcols") |
99 | ("tcols") | ||
100 | ("lcols") | 95 | ("lcols") |
101 | ("texts") | 96 | ("texts") |
102 | ("apparatus") | 97 | ("apparatus") |
103 | ("paired" ("true" "false")) | 98 | ("paired" ("true" "false")) |
104 | ("pagelineation" ("true" "false")) | 99 | ("pagelineation" ("true" "false"))) |
105 | ) | 100 | "Local options for alignment env.") |
106 | "Local options.") | ||
107 | 101 | ||
108 | (TeX-add-style-hook | 102 | (TeX-add-style-hook |
109 | "ekdosis" | 103 | "ekdosis" |
@@ -111,45 +105,40 @@ | |||
111 | ;; Folding features: | 105 | ;; Folding features: |
112 | (add-to-list (make-local-variable 'LaTeX-fold-macro-spec-list) | 106 | (add-to-list (make-local-variable 'LaTeX-fold-macro-spec-list) |
113 | '("{1}" ("app")) | 107 | '("{1}" ("app")) |
114 | ) | 108 | t) |
115 | (add-to-list (make-local-variable 'LaTeX-fold-macro-spec-list) | 109 | (add-to-list (make-local-variable 'LaTeX-fold-macro-spec-list) |
116 | '("{7}||{6}||{5}||{4}||{3}||{2}||{1}" ("lem")) | 110 | '("{7}||{6}||{5}||{4}||{3}||{2}||{1}" ("lem")) |
117 | ) | 111 | t) |
118 | (add-to-list (make-local-variable 'LaTeX-fold-macro-spec-list) | 112 | (add-to-list (make-local-variable 'LaTeX-fold-macro-spec-list) |
119 | '("[r]" ("rdg")) | 113 | '("[r]" ("rdg")) |
120 | ) | 114 | t) |
121 | (add-to-list (make-local-variable 'LaTeX-fold-macro-spec-list) | 115 | (add-to-list (make-local-variable 'LaTeX-fold-macro-spec-list) |
122 | '("[n]" ("note")) | 116 | '("[n]" ("note")) |
123 | ) | 117 | t) |
124 | ;; This package relies on lualatex, so check for it: | 118 | ;; This package relies on lualatex, so check for it: |
125 | (TeX-check-engine-add-engines 'luatex) | 119 | (TeX-check-engine-add-engines 'luatex) |
126 | (TeX-add-symbols | 120 | (TeX-add-symbols |
127 | '("DeclareWitness" "xml:id" "rendition" "description" | 121 | '("DeclareWitness" "xml:id" "rendition" "description" |
128 | [ (TeX-arg-key-val LaTeX-ekdosis-declarewitness-options) ] | 122 | [ LaTeX-ekdosis-long-key-val LaTeX-ekdosis-declarewitness-options ] |
129 | 0) | 123 | 0) |
130 | '("app" [ (TeX-arg-key-val | 124 | '("app" [ TeX-arg-key-val LaTeX-ekdosis-app-options ] |
131 | LaTeX-ekdosis-app-options) ] | ||
132 | t) | 125 | t) |
133 | '("lem" [ (TeX-arg-key-val | 126 | '("lem" [ LaTeX-ekdosis-long-key-val LaTeX-ekdosis-lem-options ] |
134 | LaTeX-ekdosis-lem-options) ] | ||
135 | t) | 127 | t) |
136 | '("rdg" [ (TeX-arg-key-val | 128 | '("rdg" [ LaTeX-ekdosis-long-key-val LaTeX-ekdosis-rdg-options ] |
137 | LaTeX-ekdosis-rdg-options) ] | ||
138 | t) | 129 | t) |
139 | '("note" [ (TeX-arg-key-val | 130 | '("note" [ LaTeX-ekdosis-long-key-val LaTeX-ekdosis-note-options ] |
140 | LaTeX-ekdosis-note-options) ] | ||
141 | t) | 131 | t) |
142 | '("note*" [ (TeX-arg-key-val | 132 | '("note*" [ LaTeX-ekdosis-long-key-val LaTeX-ekdosis-note-star-options ] |
143 | LaTeX-ekdosis-note-star-options) ] | ||
144 | t) | 133 | t) |
145 | '("SetEkdosisAlignment" (TeX-arg-key-val | 134 | '("SetEkdosisAlignment" |
146 | LaTeX-ekdosis-alignment-key-val-options)) | 135 | TeX-arg-key-val LaTeX-ekdosis-alignment-key-val-options)) |
147 | ) | 136 | (LaTeX-add-environments |
148 | (LaTeX-add-environments | 137 | "ekdosis" |
149 | "ekdosis" | 138 | '("alignment" LaTeX-env-args |
150 | '("alignment" LaTeX-env-args | 139 | [ TeX-arg-key-val LaTeX-ekdosis-alignment-key-val-options ] |
151 | [ TeX-arg-key-val LaTeX-ekdosis-alignment-key-val-options ] 0)) | 140 | )) |
152 | ) | 141 | ) |
153 | LaTeX-dialect) | 142 | LaTeX-dialect) |
154 | 143 | ||
155 | ;;; ekdosis.el ends here | 144 | ;;; ekdosis.el ends here |