1 ;;; x-symbol-sgml.el --- token language "SGML entity" for package x-symbol
3 ;; Copyright (C) 1996-1999, 2002, 2003 Free Software Foundation, Inc.
5 ;; Author: Christoph Wedler <wedler@users.sourceforge.net>
6 ;; Maintainer: (Please use `M-x x-symbol-package-bug' to contact the maintainer)
8 ;; Keywords: WYSIWYG, HTML, wp, math, internationalization
9 ;; X-URL: http://x-symbol.sourceforge.net/
11 ;; This program is free software; you can redistribute it and/or modify
12 ;; it under the terms of the GNU General Public License as published by
13 ;; the Free Software Foundation; either version 2, or (at your option)
16 ;; This program is distributed in the hope that it will be useful,
17 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
18 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 ;; GNU General Public License for more details.
21 ;; You should have received a copy of the GNU General Public License
22 ;; along with this program; if not, write to the Free Software
23 ;; Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
27 ;; If you want to use package x-symbol, please visit the URL (use
28 ;; \\[x-symbol-package-web]) and read the info (use \\[x-symbol-package-info]).
30 ;; Token language sgml is registered in x-symbol-hooks.
34 (provide 'x-symbol-sgml)
37 ;;;===========================================================================
39 ;;;===========================================================================
41 (defcustom x-symbol-sgml-auto-style
42 '((not (memq major-mode '(sgml-mode xml-mode)))
43 (x-symbol-auto-coding-alist x-symbol-sgml-auto-coding-alist)
44 x-symbol-coding (not x-symbol-mode)
45 x-symbol-mode x-symbol-mode)
46 "Values for X-Symbol's buffer-local variables with language `sgml'.
47 See language access `x-symbol-LANG-auto-style'."
50 :type 'x-symbol-auto-style)
52 (defcustom x-symbol-sgml-auto-coding-alist
53 '(("<meta\\s-+http-equiv\\s-*=\\s-*\"content-type\"\\s-*content\\s-*=\\s-*\"text/html\\s-*;\\s-*charset\\s-*=\\s-*\\([A-Za-z0-9---]+\\)\"\\s-*>" 1
54 ("iso-8859-1" . iso-8859-1)
55 ("iso-8859-2" . iso-8859-2)
56 ("iso-8859-3" . iso-8859-3)
57 ("iso-8859-9" . iso-8859-9)
58 ("iso-8859-15" . iso-8859-15)))
59 "*Alist used to determine the file coding with language `sgml'.
60 Used in the default value of `x-symbol-sgml-auto-style'. See variable
61 `x-symbol-auto-coding-alist' for details."
64 :type 'x-symbol-auto-coding)
67 ;;;===========================================================================
68 ;;; Miscellaneous variables
69 ;;;===========================================================================
71 (defface x-symbol-sgml-symbol-face
72 '((((class color) (background light))
73 (:foreground "orange4")))
74 "*Face used for entities with name representing non-Latin-1 characters.
75 Used in `x-symbol-sgml-class-face-alist'."
77 :group 'x-symbol-info-general)
79 (defface x-symbol-sgml-noname-face
80 '((((class color) (background light))
81 (:foreground "red4")))
82 "*Face used for Latin-N character entities without name.
83 Used in `x-symbol-sgml-class-face-alist'."
85 :group 'x-symbol-info-general)
87 (defcustom x-symbol-sgml-modeline-name "sgml"
88 "Modeline name of token language `sgml'.
89 See language access `x-symbol-LANG-modeline-name'."
93 (defcustom x-symbol-sgml-header-groups-alist
94 '(("Operator" bigop operator)
96 ("Arrow, Punctuation" arrow triangle shape
97 white line dots punctuation quote parenthesis)
98 ("Symbol" symbol currency mathletter setsymbol)
99 ("Greek Letter" greek greek1)
100 ("Misc. Letter" letter slash)
101 ("Cedilla, Ogonek" cedilla ogonek)
102 ("Dotaccent, Ring" dotaccent ring)
103 ("Tilde, Breve" tilde breve)
104 ("Circumflex, Caron" circumflex caron)
105 ("Diaeresis, Umlaut" diaeresis hungarumlaut)
106 ("Acute, Grave" acute grave))
107 "Header/submenu specification of the specific menu for language `sgml'.
108 See language access `x-symbol-LANG-header-groups-alist'."
109 :group 'x-symbol-sgml
110 :group 'x-symbol-input-init
111 :type 'x-symbol-headers)
113 (defcustom x-symbol-sgml-class-alist
115 (noname "SGML char-ref" (x-symbol-emph-info-face))
116 (VALID "SGML entity" (x-symbol-info-face))
117 (INVALID "no SGML entity" (x-symbol-emph-info-face)))
118 "Token classes displayed by info in echo area, for language `sgml'.
119 See language access `x-symbol-LANG-class-alist'."
120 :group 'x-symbol-sgml
121 :group 'x-symbol-info-strings
122 :type 'x-symbol-class-info)
124 (defcustom x-symbol-sgml-class-face-alist
125 '((symbol x-symbol-sgml-symbol-face (x-symbol-sgml-symbol-face))
126 (noname x-symbol-sgml-noname-face (x-symbol-sgml-noname-face)))
127 "Color scheme in language specific grid and info, for language `sgml'.
128 See language access `x-symbol-LANG-class-face-alist'."
129 :group 'x-symbol-sgml
130 :group 'x-symbol-input-init
131 :group 'x-symbol-info-general
132 :type 'x-symbol-class-faces)
134 (defcustom x-symbol-sgml-electric-ignore nil
135 "Specification restricting input method ELECTRIC with language `sgml'.
136 See language access `x-symbol-LANG-electric-ignore'."
137 :group 'x-symbol-sgml
138 :group 'x-symbol-input-control
139 :type 'x-symbol-function-or-regexp)
141 (defvar x-symbol-sgml-token-list 'x-symbol-sgml-token-list-name
142 "Symbol specifying the token definition for language `sgml'.
144 - `x-symbol-sgml-token-list-name': the canonical token for a character
145 is a entity references,
146 - `x-symbol-sgml-token-list-code': the canonical token for a character
147 is a character references,
148 - `x-symbol-sgml-token-list-netscape': the canonical token for a
149 Latin-1 character is a entity references, for others, it is a
150 character references. Bug workaround for Netscape, v4.6 or lower.
152 The value is used by function `x-symbol-sgml-default-token-list' which
153 is used for the definition of the conversion tables. See
154 `x-symbol-sgml-token-grammar'.")
156 (defvar x-symbol-sgml-token-grammar
157 '(x-symbol-make-grammar
158 :decode-regexp "&[#0-9A-Za-z]+;"
159 :token-list x-symbol-sgml-default-token-list)
160 "Grammar of token language `sgml'.
161 See language access `x-symbol-LANG-token-grammar'.")
163 (defvar x-symbol-sgml-user-table nil
164 "User table defining SGML entities, used in `x-symbol-sgml-table'.")
166 (defvar x-symbol-sgml-generated-data nil
167 "Generated data for token language `sgml'.
168 See language access `x-symbol-LANG-generated-data'.")
171 ;;;===========================================================================
173 ;;;===========================================================================
175 (defcustom x-symbol-sgml-master-directory 'ignore
176 "Function returning the directory of the master file or nil.
177 See `x-symbol-image-parse-buffer'."
178 :group 'x-symbol-sgml
179 :group 'x-symbol-image-language
182 (defcustom x-symbol-sgml-image-searchpath '("./")
183 "Search path for implicitly relative image file names.
184 See language access `x-symbol-LANG-image-searchpath'."
185 :group 'x-symbol-sgml
186 :group 'x-symbol-image-language
187 :type '(repeat directory))
189 (defcustom x-symbol-sgml-image-cached-dirs '("images/" "pictures/")
190 "Directory parts of images stored in the memory cache.
191 See language access `x-symbol-LANG-image-cached-dirs'."
192 :group 'x-symbol-sgml
193 :group 'x-symbol-image-language
194 :type '(repeat string))
196 (defcustom x-symbol-sgml-image-file-truename-alist
199 "Alist used to determine the file name of an image URL.
200 Each element looks like
202 (REGEXP . NEWTEXT) or
203 (REGEXP FUNCTION ARG...)
204 If the the image file name is matched by REGEXP, the corresponding
205 element is processed, if no REGEXP matches, the image file name is used
206 as it is. With the first form, the image command will not be
207 highlighted. With the second form, replace text matched by REGEXP with
208 NEWTEXT, see `replace-match' for details. With the third form,
209 FUNCTION, call FUNCTION with the image file name and the remaining
210 arguments ARGs to get the true file name.
212 E.g., I add the following element to this variable:
213 (\"\\\\`http://www\\\\.fmi\\\\.uni-passau\\\\.de/~wedler/\" \. \"~/public_html/\")"
214 :group 'x-symbol-sgml
215 :group 'x-symbol-image-language
216 :type '(repeat (cons :format "%v"
217 :value ("" . "") ; doesn't work (custom bug?)
220 (const :tag "Not highlighted" nil)
221 (string :tag "Replace match with")
224 (repeat :tag "With arguments" sexp))))))
226 (defcustom x-symbol-sgml-image-keywords
227 '("\\.\\(gif\\|png\\|jpe?g\\)\\'"
228 ("<img[ \t][^\n>]*src=\"\\([^\n\"]+\\)\"[^\n>]*>"
229 x-symbol-sgml-image-file-truename 1))
230 "Keywords for image insertion commands of language `sgml'.
231 See language access `x-symbol-LANG-image-keywords'."
232 :group 'x-symbol-sgml
233 :group 'x-symbol-image-language
234 :type 'x-symbol-image-keywords)
236 (defun x-symbol-sgml-image-file-truename (num)
237 "Return true image file name for last match.
238 Return text matched by the NUMth regexp group of the corresponding
239 keyword regexp, after being processed according to
240 `x-symbol-sgml-image-file-truename-alist'."
241 (x-symbol-match-in-alist (setq num (match-string num))
242 x-symbol-sgml-image-file-truename-alist
246 ;;;===========================================================================
247 ;;; Super- and Subscripts
248 ;;;===========================================================================
250 (defcustom x-symbol-sgml-subscript-matcher 'x-symbol-sgml-subscript-matcher
251 "Function matching super-/subscripts for language `sgml'.
252 See language access `x-symbol-LANG-subscript-matcher'."
253 :group 'x-symbol-sgml
256 (defcustom x-symbol-sgml-font-lock-regexp "<su[bp]>"
257 "Regexp matching the start tag of SGML's super- and subscripts.
258 See also `x-symbol-sgml-font-lock-alist'."
259 :group 'x-symbol-sgml
262 (defcustom x-symbol-sgml-font-lock-limit-regexp "\n\\|</?su[bp]>"
263 "Regexp matching the end tag of SGML's super- and subscripts.
264 This regexp should match the end of line and the closing tags in
265 `x-symbol-sgml-font-lock-alist'."
266 :group 'x-symbol-sgml
269 (defcustom x-symbol-sgml-font-lock-contents-regexp "[^ \t\n\240]"
270 "*Regexp matching the super- and subscript contents.
271 This regexp should match the text between the opening and closing super-
273 :group 'x-symbol-sgml
276 (defcustom x-symbol-sgml-font-lock-alist
277 '(("<sub>" . "</sub>") ("<sup>" . "</sup>"))
278 "Alist for correct tag pairs for HTML's super- and subscripts.
279 Each element looks like (OPEN . CLOSE). All keys OPEN in this alist
280 should be matched by `x-symbol-sgml-font-lock-regexp', all CLOSEs should
281 be matched by `x-symbol-sgml-font-lock-limit-regexp'."
282 :group 'x-symbol-sgml
283 :type '(repeat (cons :format "%v"
284 (string :tag "Open tag")
285 (string :tag "Close tag"))))
288 ;;;===========================================================================
290 ;;;===========================================================================
292 (defun x-symbol-sgml-default-token-list (tokens)
295 (memq x-symbol-sgml-token-list
296 '(x-symbol-sgml-token-list-name
297 x-symbol-sgml-token-list-code
298 x-symbol-sgml-token-list-netscape))
299 (if (or (eq x-symbol-sgml-token-list
300 'x-symbol-sgml-token-list-name)
301 (and (eq x-symbol-sgml-token-list
302 'x-symbol-sgml-token-list-netscape)
303 (< (car tokens) 256)))
304 (append (cdr tokens) (list (format "&#%d;" (car tokens))))
305 (cons (format "&#%d;" (car tokens)) (cdr tokens))))))
307 ;; http://www.w3.org/TR/REC-html40/sgml/entities.html
308 ;; (query-replace-regexp "<!ENTITY[ \t]*\\([A-Za-z][A-Za-z0-9]*\\)[ \t]*CDATA[ \t]*\"&#\\([0-9]+\\);\"[ \t]*--\\(.+\\) -->[ \t]*.*$" " (\\1 () \\2 \"&\\1;\") ; \\3")
310 (defvar x-symbol-sgml-latin1-table
311 '((nobreakspace () 160 " ")
312 (exclamdown () 161 "¡")
313 (cent () 162 "¢")
314 (sterling () 163 "£")
315 (currency () 164 "¤")
317 (brokenbar () 166 "¦" "&brkbar;")
318 (section () 167 "§")
319 (diaeresis () 168 "¨" "¨")
320 (copyright () 169 "©")
321 (ordfeminine () 170 "ª")
322 (guillemotleft () 171 "«")
323 (notsign () 172 "¬")
324 (hyphen () 173 "­")
325 (registered () 174 "®")
326 (macron () 175 "¯" "&hibar;")
327 (degree () 176 "°")
328 (plusminus () 177 "±")
329 (twosuperior () 178 "²")
330 (threesuperior () 179 "³")
331 (acute () 180 "´")
332 (mu1 () 181 "µ")
333 (paragraph () 182 "¶")
334 (periodcentered () 183 "·")
335 (cedilla () 184 "¸")
336 (onesuperior () 185 "¹")
337 (masculine () 186 "º")
338 (guillemotright () 187 "»")
339 (onequarter () 188 "¼")
340 (onehalf () 189 "½")
341 (threequarters () 190 "¾")
342 (questiondown () 191 "¿")
343 (Agrave () 192 "À")
344 (Aacute () 193 "Á")
345 (Acircumflex () 194 "Â")
346 (Atilde () 195 "Ã")
347 (Adiaeresis () 196 "Ä")
348 (Aring () 197 "Å")
349 (AE () 198 "Æ")
350 (Ccedilla () 199 "Ç")
351 (Egrave () 200 "È")
352 (Eacute () 201 "É")
353 (Ecircumflex () 202 "Ê")
354 (Ediaeresis () 203 "Ë")
355 (Igrave () 204 "Ì")
356 (Iacute () 205 "Í")
357 (Icircumflex () 206 "Î")
358 (Idiaeresis () 207 "Ï")
359 (ETH () 208 "Ð") ; "Đ" for Dbar (U0110) = latin2#208?
360 (Ntilde () 209 "Ñ")
361 (Ograve () 210 "Ò")
362 (Oacute () 211 "Ó")
363 (Ocircumflex () 212 "Ô")
364 (Otilde () 213 "Õ")
365 (Odiaeresis () 214 "Ö")
366 (multiply () 215 "×")
367 (Ooblique () 216 "Ø")
368 (Ugrave () 217 "Ù")
369 (Uacute () 218 "Ú")
370 (Ucircumflex () 219 "Û")
371 (Udiaeresis () 220 "Ü")
372 (Yacute () 221 "Ý")
373 (THORN () 222 "Þ")
374 (ssharp () 223 "ß")
375 (agrave () 224 "à")
376 (aacute () 225 "á")
377 (acircumflex () 226 "â")
378 (atilde () 227 "ã")
379 (adiaeresis () 228 "ä")
380 (aring () 229 "å")
381 (ae () 230 "æ")
382 (ccedilla () 231 "ç")
383 (egrave () 232 "è")
384 (eacute () 233 "é")
385 (ecircumflex () 234 "ê")
386 (ediaeresis () 235 "ë")
387 (igrave () 236 "ì")
388 (iacute () 237 "í")
389 (icircumflex () 238 "î")
390 (idiaeresis () 239 "ï")
392 (ntilde () 241 "ñ")
393 (ograve () 242 "ò")
394 (oacute () 243 "ó")
395 (ocircumflex () 244 "ô")
396 (otilde () 245 "õ")
397 (odiaeresis () 246 "ö")
398 (division () 247 "÷")
399 (oslash () 248 "ø")
400 (ugrave () 249 "ù")
401 (uacute () 250 "ú")
402 (ucircumflex () 251 "û")
403 (udiaeresis () 252 "ü")
404 (yacute () 253 "ý")
405 (thorn () 254 "þ")
406 (ydiaeresis () 255 "ÿ"))
407 "Table defining SGML entities, see `x-symbol-sgml-table'.")
409 (defvar x-symbol-sgml-latinN-table
410 '((Aogonek (noname) 260)
412 (Lslash (noname) 321)
413 (Lcaron (noname) 317)
414 (Sacute (noname) 346)
415 (Scaron (symbol) 352 "Š")
416 (Scedilla (noname) 350)
417 (Tcaron (noname) 356)
418 (Zacute (noname) 377)
419 (Zcaron (noname) 381)
420 (Zdotaccent (noname) 379)
421 (aogonek (noname) 261)
422 (ogonek (noname) 731)
423 (lslash (noname) 322)
424 (lcaron (noname) 318)
425 (sacute (noname) 347)
427 (scaron (symbol) 353 "š")
428 (scedilla (noname) 351)
429 (tcaron (noname) 357)
430 (zacute (noname) 378)
431 (hungarumlaut (noname) 733)
432 (zcaron (noname) 382)
433 (zdotaccent (noname) 380)
434 (Racute (noname) 340)
435 (Abreve (noname) 258)
436 (Lacute (noname) 313)
437 (Cacute (noname) 262)
438 (Ccaron (noname) 268)
439 (Eogonek (noname) 280)
440 (Ecaron (noname) 282)
441 (Dcaron (noname) 270)
443 (Nacute (noname) 323)
444 (Ncaron (noname) 327)
445 (Ohungarumlaut (noname) 336)
446 (Rcaron (noname) 344)
448 (Uhungarumlaut (noname) 368)
449 (Tcedilla (noname) 354)
450 (racute (noname) 341)
451 (abreve (noname) 259)
452 (lacute (noname) 314)
453 (cacute (noname) 263)
454 (ccaron (noname) 269)
455 (eogonek (noname) 281)
456 (ecaron (noname) 283)
457 (dcaron (noname) 271)
459 (nacute (noname) 324)
460 (ncaron (noname) 328)
461 (ohungarumlaut (noname) 337)
462 (rcaron (noname) 345)
464 (uhungarumlaut (noname) 369)
465 (tcedilla (noname) 355)
466 (dotaccent (noname) 729)
468 (Hcircumflex (noname) 292)
469 (Idotaccent (noname) 304)
470 (Gbreve (noname) 286)
471 (Jcircumflex (noname) 308)
473 (hcircumflex (noname) 293)
474 (dotlessi (noname) 305)
475 (gbreve (noname) 287)
476 (jcircumflex (noname) 309)
477 (Cdotaccent (noname) 266)
478 (Ccircumflex (noname) 264)
479 (Gdotaccent (noname) 288)
480 (Gcircumflex (noname) 284)
481 (Ubreve (noname) 364)
482 (Scircumflex (noname) 348)
483 (cdotaccent (noname) 267)
484 (ccircumflex (noname) 265)
485 (gdotaccent (noname) 289)
486 (gcircumflex (noname) 285)
487 (ubreve (noname) 365)
488 (scircumflex (noname) 349)
489 (euro (symbol) 8364 "€")
490 (OE (symbol) 338 "Œ")
491 (oe (symbol) 339 "œ")
492 (Ydiaeresis (symbol) 376 "Ÿ"))
493 "Table defining SGML entities, see `x-symbol-sgml-table'.")
495 (defvar x-symbol-sgml-xsymb0-table
496 '((Delta (symbol) 916 "Δ")
497 (Phi (symbol) 934 "Φ")
498 (Gamma (symbol) 915 "Γ")
499 (theta1 (symbol) 977 "ϑ")
500 (Lambda (symbol) 923 "Λ")
501 (Pi (symbol) 928 "Π")
502 (Theta (symbol) 920 "Θ")
503 (Sigma (symbol) 931 "Σ")
504 (sigma1 (symbol) 962 "ς")
505 (Omega (symbol) 937 "Ω")
506 (Xi (symbol) 926 "Ξ")
507 (Psi (symbol) 936 "Ψ")
508 (alpha (symbol) 945 "α")
509 (beta (symbol) 946 "β")
510 (chi (symbol) 967 "χ")
511 (delta (symbol) 948 "δ")
512 (epsilon (symbol) 949 "ε")
513 (phi (symbol) 966 "φ")
514 (gamma (symbol) 947 "γ")
515 (eta (symbol) 951 "η")
516 (iota (symbol) 953 "ι")
517 (kappa (symbol) 954 "κ")
518 (lambda (symbol) 955 "λ")
519 (mu (symbol) 956 "μ")
520 (nu (symbol) 957 "ν")
521 (pi (symbol) 960 "π")
522 (theta (symbol) 952 "θ")
523 (rho (symbol) 961 "ρ")
524 (sigma (symbol) 963 "σ")
525 (tau (symbol) 964 "τ")
526 (upsilon (symbol) 965 "υ")
527 (omega1 (symbol) 982 "ϖ")
528 (omega (symbol) 969 "ω")
529 (xi (symbol) 958 "ξ")
530 (psi (symbol) 968 "ψ")
531 (zeta (symbol) 950 "ζ")
532 (Upsilon1 (symbol) 978 "ϒ")
534 (florin (symbol) 402 "ƒ")
535 (bullet (symbol) 8226 "•")
536 (ellipsis (symbol) 8230 "…")
537 (minute (symbol) 8242 "′")
538 (second (symbol) 8243 "″")
539 (radicalex (symbol) 8254 "‾")
540 (fraction (symbol) 8260 "⁄")
541 (weierstrass (symbol) 8472 "℘")
542 (Ifraktur (symbol) 8465 "ℑ")
543 (Rfraktur (symbol) 8476 "ℜ")
544 (trademark (symbol) 8482 "™")
545 (aleph (symbol) 8501 "ℵ")
546 (arrowleft (symbol) 8592 "←")
547 (arrowup (symbol) 8593 "↑")
548 (arrowright (symbol) 8594 "→")
549 (arrowdown (symbol) 8595 "↓")
550 (arrowboth (symbol) 8596 "↔")
551 (carriagereturn (symbol) 8629 "↵")
552 (arrowdblleft (symbol) 8656 "⇐")
553 (arrowdblup (symbol) 8657 "⇑")
554 (arrowdblright (symbol) 8658 "⇒")
555 (arrowdbldown (symbol) 8659 "⇓")
556 (arrowdblboth (symbol) 8660 "⇔")
558 (partialdiff (symbol) 8706 "∂")
559 (emptyset (symbol) 8709 "∅")
560 (gradient (symbol) 8711 "∇")
561 (element (symbol) 8712 "∈")
562 (notelement (symbol) 8713 "∉")
563 (suchthat (symbol) 8715 "∋")
564 (product (symbol) 8719 "∏")
565 (summation (symbol) 8721 "∑")
566 (minus1 (symbol) 8722 "−")
567 (asterisk1 (symbol) 8727 "∗")
568 (radical (symbol) 8730 "√")
569 (proportional (symbol) 8733 "∝")
570 (infinity (symbol) 8734 "∞")
571 (angle (symbol) 8736 "∠")
572 (logicaland (symbol) 8743 "∧")
573 (logicalor (symbol) 8744 "∨")
574 (intersection (symbol) 8745 "∩")
575 (union (symbol) 8746 "∪")
576 (integral (symbol) 8747 "∫")
577 (similar (symbol) 8764 "∼")
578 (congruent (symbol) 8773 "≅")
579 (notequal (symbol) 8800 "≠")
580 (equivalence (symbol) 8801 "≡")
581 (lessequal (symbol) 8804 "≤")
582 (greaterequal (symbol) 8805 "≥")
583 (propersubset (symbol) 8834 "⊂")
584 (propersuperset (symbol) 8835 "⊃")
585 (notsubset (symbol) 8836 "⊄")
586 (reflexsubset (symbol) 8838 "⊆")
587 (reflexsuperset (symbol) 8839 "⊇")
588 (circleplus (symbol) 8853 "⊕")
589 (circlemultiply (symbol) 8855 "⊗")
590 (perpendicular (symbol) 8869 "⊥")
591 (periodcentered1 (symbol) 8901 "⋅")
592 (angleleft (symbol) 9001 "⟨")
593 (angleright (symbol) 9002 "⟩")
594 (lozenge (symbol) 9674 "◊")
595 (spade (symbol) 9824 "♠")
596 (club (symbol) 9827 "♣")
597 (heart (symbol) 9829 "♥")
598 (diamond (symbol) 9830 "♦"))
599 "Table defining SGML entities, see `x-symbol-sgml-table'.")
601 (defvar x-symbol-sgml-xsymb1-table
602 '((ampersand2 () 38 "&")
603 (quotedbl1 () 34 """)
605 (greater2 () 62 ">")
606 (universal1 (symbol) 8704 "∀")
607 (existential1 (symbol) 8707 "∃")
608 (circumflex (symbol) 710 "ˆ")
609 (tilde (symbol) 732 "˜")
610 ;;(ensp (symbol) 8194 " ") ; en space, U+2002 ISOpub
611 ;;(emsp (symbol) 8195 " ") ; em space, U+2003 ISOpub
612 ;;(thinsp (symbol) 8201 " ") ; thin space, U+2009 ISOpub
613 ;;(zwnj (symbol) 8204 "‌") ; zero width non-joiner, U+200C NEW RFC 2070
614 ;;(zwj (symbol) 8205 "‍") ; zero width joiner, U+200D NEW RFC 2070
615 ;;(lrm (symbol) 8206 "‎") ; left-to-right mark, U+200E NEW RFC 2070
616 ;;(rlm (symbol) 8207 "‏") ; right-to-left mark, U+200F NEW RFC 2070
617 (endash (symbol) 8211 "–")
618 (emdash (symbol) 8212 "—")
619 ;;(lsquo (symbol) 8216 "‘") ; left single quotation mark, U+2018 ISOnum
620 ;;(rsquo (symbol) 8217 "’") ; right single quotation mark, U+2019 ISOnum
621 ;;(sbquo (symbol) 8218 "‚") ; single low-9 quotation mark, U+201A NEW
622 ;;(ldquo (symbol) 8220 "“") ; left double quotation mark, U+201C ISOnum
623 ;;(rdquo (symbol) 8221 "”") ; right double quotation mark, U+201D ISOnum
624 ;;(bdquo (symbol) 8222 "„") ; double low-9 quotation mark, U+201E NEW
625 (dagger (symbol) 8224 "†")
626 (daggerdbl (symbol) 8225 "‡")
627 (perthousand (symbol) 8240 "‰")
628 (guilsinglleft (symbol) 8249 "‹")
629 (guilsinglright (symbol) 8250 "›")
630 (therefore1 (symbol) 8756 "∴")
631 (ceilingleft (symbol) 8968 "⌈")
632 (ceilingright (symbol) 8969 "⌉")
633 (floorleft (symbol) 8970 "⌊")
634 (floorright (symbol) 8971 "⌋")
635 (asym (symbol) 8776 "≈")
637 "Table defining SGML entities, see `x-symbol-sgml-table'.")
639 ;; Should I add symbols from http://www.bbsinc.com/iso8859.html ?
640 (defvar x-symbol-sgml-table
641 (append x-symbol-sgml-user-table
643 x-symbol-sgml-latin1-table
644 x-symbol-sgml-latinN-table
645 x-symbol-sgml-xsymb0-table
646 x-symbol-sgml-xsymb1-table)
647 "Table defining `sgml' tokens for the characters.
648 See language access `x-symbol-LANG-table' and variable
649 `x-symbol-sgml-token-list'. Use `x-symbol-sgml-user-table' to define
650 private SGML entities or shadow existing ones.")
653 ;;;===========================================================================
654 ;;; Subscript functions
655 ;;;===========================================================================
657 (defun x-symbol-sgml-subscript-matcher (limit)
658 ;; checkdoc-params: (limit)
659 "Match and skip over super- and subscripts.
660 Return nil if `x-symbol-mode' or `x-symbol-subscripts' is nil. Uses
661 `x-symbol-sgml-font-lock-regexp'."
663 (let (open-beg open-end close-end close-beg)
664 (while (re-search-forward x-symbol-sgml-font-lock-regexp limit t)
665 (setq open-beg (match-beginning 0)
666 open-end (match-end 0))
667 (when (re-search-forward x-symbol-sgml-font-lock-limit-regexp
669 (setq close-beg (match-beginning 0)
670 close-end (match-end 0))
671 (if (equal (cdr (assoc (downcase
672 (buffer-substring open-beg open-end))
673 x-symbol-sgml-font-lock-alist))
674 (downcase (buffer-substring close-beg close-end)))
678 (re-search-forward x-symbol-sgml-font-lock-contents-regexp
680 (store-match-data (list open-beg close-end
683 close-beg close-end))
684 (return (if (eq (char-after (+ 3 open-beg)) ?b)
686 'x-symbol-sup-face)))
687 (goto-char close-beg)))))))
689 ;;; Local IspellPersDict: .ispell_xsymb
690 ;;; x-symbol-sgml.el ends here