From 807a9d2d6b3604e33cde3202ffec56405d706b83 Mon Sep 17 00:00:00 2001 From: Makarius Wenzel Date: Wed, 2 Aug 2000 23:08:47 +0000 Subject: x-symbol-isabelle-prepare-table: avoids redundancy in code, improves on isar version (only 1 backslash); --- isa/x-symbol-isabelle.el | 293 +++++++++++++++++++++++++---------------------- 1 file changed, 153 insertions(+), 140 deletions(-) diff --git a/isa/x-symbol-isabelle.el b/isa/x-symbol-isabelle.el index 857c9e57..1822b673 100644 --- a/isa/x-symbol-isabelle.el +++ b/isa/x-symbol-isabelle.el @@ -2,7 +2,7 @@ ;; Author: David von Oheimb ;; Copyright 1998 Technische Universitaet Muenchen ;; token language "Isabelle Symbols" for package x-symbol -;; +;; ;; NB: Part of Proof General distribution. ;; @@ -23,7 +23,7 @@ ; ("Symbol" symbol currency mathletter setsymbol) ; ("Greek Letter" greek greek1) ; ("Acute, Grave" acute grave)) -; "*If non-nil, used in isasym specific grid/menu. +; "*If non-nil, used in isasym specific grid/menu." (defvar x-symbol-isabelle-class-alist '((VALID "Isabelle Symbol" (x-symbol-info-face)) @@ -42,8 +42,8 @@ ;(defvar x-symbol-isabelle-token-shape '(?\\ "\\\\\\<[A-Za-z][A-Za-z0-9_']*>\\a'" . "[A-Za-z]")) (defvar x-symbol-isabelle-token-shape nil) -(defvar x-symbol-isabelle-exec-specs '(nil ("\\`\\\\<[A-Za-z][A-Za-z0-9_']*>\\'" . - "\\\\<[A-Za-z][A-Za-z0-9_']*>"))) +(defvar x-symbol-isabelle-exec-specs '(nil ("\\`\\\\<[A-Za-z][A-Za-z0-9_']*>\\'" . + "\\\\<[A-Za-z][A-Za-z0-9_']*>"))) (defvar x-symbol-isabelle-input-token-ignore nil) (defun x-symbol-isabelle-default-token-list (tokens) tokens) @@ -51,144 +51,157 @@ (defvar x-symbol-isabelle-token-list 'x-symbol-isabelle-default-token-list) -(defvar x-symbol-isabelle-symbol-table '(;;symbols (isabelle14 font) - (visiblespace () "\\\\" "\\") - (Gamma () "\\\\" "\\") - (Delta () "\\\\" "\\") - (Theta () "\\\\" "\\") - (Lambda () "\\\\" "\\") - (Pi () "\\\\" "\\") - (Sigma () "\\\\" "\\") - (Phi () "\\\\" "\\") - (Psi () "\\\\" "\\") - (Omega () "\\\\" "\\") - (alpha () "\\\\" "\\") - (beta () "\\\\" "\\") - (gamma () "\\\\" "\\") - (delta () "\\\\" "\\") - (epsilon1 () "\\\\" "\\") - (zeta () "\\\\" "\\") - (eta () "\\\\" "\\") - (theta1 () "\\\\" "\\") - (kappa1 () "\\\\" "\\") - (lambda () "\\\\" "\\") - (mu () "\\\\" "\\") - (nu () "\\\\" "\\") - (xi () "\\\\" "\\") - (pi () "\\\\" "\\") - (rho () "\\\\" "\\") - (sigma () "\\\\" "\\") - (tau () "\\\\" "\\") - (phi1 () "\\\\" "\\") - (chi () "\\\\" "\\") - (psi () "\\\\" "\\") - (omega () "\\\\" "\\") - (notsign () "\\\\" "\\") - (logicaland () "\\\\" "\\") - (logicalor () "\\\\" "\\") - (universal1 () "\\\\" "\\") - (existential1 () "\\\\" "\\") - (biglogicaland () "\\\\" "\\") - (ceilingleft () "\\\\" "\\") - (ceilingright () "\\\\" "\\") - (floorleft () "\\\\" "\\") - (floorright () "\\\\" "\\") - (bardash () "\\\\" "\\") - (bardashdbl () "\\\\" "\\") - (semanticsleft () "\\\\" "\\") - (semanticsright () "\\\\" "\\") - (periodcentered () "\\\\" "\\") - (element () "\\\\" "\\") - (reflexsubset () "\\\\" "\\") - (intersection () "\\\\" "\\") - (union () "\\\\" "\\") - (bigintersection () "\\\\" "\\") - (bigunion () "\\\\" "\\") - (sqintersection () "\\\\" "\\") - (squnion () "\\\\" "\\") - (bigsqintersection () "\\\\" "\\") - (bigsqunion () "\\\\" "\\") - (perpendicular () "\\\\" "\\") - (dotequal () "\\\\" "\\") - (equivalence () "\\\\" "\\") - (notequal () "\\\\" "\\") - (propersqsubset () "\\\\" "\\") - (reflexsqsubset () "\\\\" "\\") - (properprec () "\\\\" "\\") - (reflexprec () "\\\\" "\\") - (propersucc () "\\\\" "\\") - (approxequal () "\\\\" "\\") - (similar () "\\\\" "\\") - (simequal () "\\\\" "\\") - (lessequal () "\\\\" "\\") - (coloncolon () "\\\\" "\\") - (arrowleft () "\\\\" "\\") - (endash () "\\\\" "\\") - (arrowright () "\\\\" "\\") - (arrowdblleft () "\\\\" "\\") -; (rightleftharpoons () "\\\\" "\\") ;missing symbol (but not necessary) - (arrowdblright () "\\\\" "\\") - (frown () "\\\\" "\\") - (mapsto () "\\\\" "\\") - (leadsto () "\\\\" "\\") - (arrowup () "\\\\" "\\") - (arrowdown () "\\\\" "\\") - (notelement () "\\\\" "\\") - (multiply () "\\\\" "\\") - (circleplus () "\\\\" "\\") - (circleminus () "\\\\" "\\") - (circlemultiply () "\\\\" "\\") - (circleslash () "\\\\" "\\") - (propersubset () "\\\\" "\\") - (infinity () "\\\\" "\\") - (box () "\\\\" "\\") - (lozenge1 () "\\\\" "\\") - (circ () "\\\\" "\\") - (bullet () "\\\\" "\\") - (bardbl () "\\\\" "\\") - (radical () "\\\\" "\\") - (copyright () "\\\\" "\\") - )) -(defvar x-symbol-isabelle-xsymbol-table '(;;xsymbols - (plusminus () "\\\\" "\\") - (division () "\\\\
" "\\
") - (longarrowright () "\\\\" "\\") - (longarrowleft () "\\\\" "\\") - (longarrowboth () "\\\\" "\\") - (longarrowdblright () "\\\\" "\\") - (longarrowdblleft () "\\\\" "\\") - (longarrowdblboth () "\\\\" "\\") - (brokenbar () "\\\\" "\\") - (hyphen () "\\\\" "\\") - (macron () "\\\\" "\\") - (exclamdown () "\\\\" "\\") - (questiondown () "\\\\" "\\") - (guillemotleft () "\\\\" "\\") - (guillemotright () "\\\\" "\\") - (degree () "\\\\" "\\") - (onesuperior () "\\\\" "\\") - (onequarter () "\\\\" "\\") - (twosuperior () "\\\\" "\\") - (onehalf () "\\\\" "\\") - (threesuperior () "\\\\" "\\") - (threequarters () "\\\\" "\\") - (paragraph () "\\\\" "\\") - (registered () "\\\\" "\\") - (ordfeminine () "\\\\" "\\") - (ordmasculine () "\\\\" "\\") - (section () "\\\\
" "\\
") - (pounds () "\\\\" "\\") - (yen () "\\\\" "\\") - (cent () "\\\\" "\\") - (currency () "\\\\" "\\") - (braceleft2 () "\\\\" "\\") - (braceright2 () "\\\\" "\\") - (top () "\\\\" "\\") - )) +(defvar x-symbol-isabelle-symbol-table ; symbols (isabelle font) + '((visiblespace "\\") + (Gamma "\\") + (Delta "\\") + (Theta "\\") + (Lambda "\\") + (Pi "\\") + (Sigma "\\") + (Phi "\\") + (Psi "\\") + (Omega "\\") + (alpha "\\") + (beta "\\") + (gamma "\\") + (delta "\\") + (epsilon1 "\\") + (zeta "\\") + (eta "\\") + (theta1 "\\") + (kappa1 "\\") + (lambda "\\") + (mu "\\") + (nu "\\") + (xi "\\") + (pi "\\") + (rho "\\") + (sigma "\\") + (tau "\\") + (phi1 "\\") + (chi "\\") + (psi "\\") + (omega "\\") + (notsign "\\") + (logicaland "\\") + (logicalor "\\") + (universal1 "\\") + (existential1 "\\") + (biglogicaland "\\") + (ceilingleft "\\") + (ceilingright "\\") + (floorleft "\\") + (floorright "\\") + (bardash "\\") + (bardashdbl "\\") + (semanticsleft "\\") + (semanticsright "\\") + (periodcentered "\\") + (element "\\") + (reflexsubset "\\") + (intersection "\\") + (union "\\") + (bigintersection "\\") + (bigunion "\\") + (sqintersection "\\") + (squnion "\\") + (bigsqintersection "\\") + (bigsqunion "\\") + (perpendicular "\\") + (dotequal "\\") + (equivalence "\\") + (notequal "\\") + (propersqsubset "\\") + (reflexsqsubset "\\") + (properprec "\\") + (reflexprec "\\") + (propersucc "\\") + (approxequal "\\") + (similar "\\") + (simequal "\\") + (lessequal "\\") + (coloncolon "\\") + (arrowleft "\\") + (endash "\\") + (arrowright "\\") + (arrowdblleft "\\") +; (rightleftharpoons "\\") ;missing symbol (but not necessary) + (arrowdblright "\\") + (frown "\\") + (mapsto "\\") + (leadsto "\\") + (arrowup "\\") + (arrowdown "\\") + (notelement "\\") + (multiply "\\") + (circleplus "\\") + (circleminus "\\") + (circlemultiply "\\") + (circleslash "\\") + (propersubset "\\") + (infinity "\\") + (box "\\") + (lozenge1 "\\") + (circ "\\") + (bullet "\\") + (bardbl "\\") + (radical "\\") + (copyright "\\"))) + +(defvar x-symbol-isabelle-xsymbol-table ; xsymbols + '((plusminus "\\") + (division "\\
") + (longarrowright "\\") + (longarrowleft "\\") + (longarrowboth "\\") + (longarrowdblright "\\") + (longarrowdblleft "\\") + (longarrowdblboth "\\") + (brokenbar "\\") + (hyphen "\\") + (macron "\\") + (exclamdown "\\") + (questiondown "\\") + (guillemotleft "\\") + (guillemotright "\\") + (degree "\\") + (onesuperior "\\") + (onequarter "\\") + (twosuperior "\\") + (onehalf "\\") + (threesuperior "\\") + (threequarters "\\") + (paragraph "\\") + (registered "\\") + (ordfeminine "\\") + (ordmasculine "\\") + (section "\\
") + (pounds "\\") + (yen "\\") + (cent "\\") + (currency "\\") + (braceleft2 "\\") + (braceright2 "\\") + (top "\\"))) + (defvar x-symbol-isabelle-user-table nil) + +(defun x-symbol-isabelle-prepare-table (table) + (let* + ((is-isar (eq proof-assistant-symbol 'isar)) + (prfx1 (if is-isar "" "\\")) + (prfx2 (if is-isar "\\" ""))) + (mapcar (lambda (entry) + (list (car entry) '() (concat prfx1 (cadr entry)) (concat prfx2 (cadr entry)))) + table))) + (defvar x-symbol-isabelle-table - (append x-symbol-isabelle-user-table - (append x-symbol-isabelle-symbol-table x-symbol-isabelle-xsymbol-table))) + (x-symbol-isabelle-prepare-table + (append + x-symbol-isabelle-user-table + x-symbol-isabelle-symbol-table + x-symbol-isabelle-xsymbol-table))) ;;;=========================================================================== ;;; Internal -- cgit v1.2.3