From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: fatiparty--- via Users list for the GNU Emacs text editor Newsgroups: gmane.emacs.help Subject: Re: Colourising tex keywords Date: Tue, 11 Jan 2022 22:30:20 +0100 (CET) Message-ID: References: <878rvms8zg.fsf@zoho.eu> <87sftup6mf.fsf@web.de> <87mtk2p3id.fsf@web.de> <87o84i2fwf.fsf@web.de> Reply-To: fatiparty@tutanota.com Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_Part_459879_2008232021.1641936620720" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="12194"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Help Gnu Emacs To: Michael Heerdegen Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Tue Jan 11 22:31:41 2022 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1n7Ok1-00030N-22 for geh-help-gnu-emacs@m.gmane-mx.org; Tue, 11 Jan 2022 22:31:41 +0100 Original-Received: from localhost ([::1]:56892 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n7Ojz-0004oF-Nz for geh-help-gnu-emacs@m.gmane-mx.org; Tue, 11 Jan 2022 16:31:39 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:37186) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n7Oin-0004nC-No for help-gnu-emacs@gnu.org; Tue, 11 Jan 2022 16:30:28 -0500 Original-Received: from w1.tutanota.de ([81.3.6.162]:48958) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n7Oik-0005fp-2H for help-gnu-emacs@gnu.org; Tue, 11 Jan 2022 16:30:25 -0500 Original-Received: from w3.tutanota.de (unknown [192.168.1.164]) by w1.tutanota.de (Postfix) with ESMTP id B4840FBF5A8; Tue, 11 Jan 2022 21:30:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1641936620; s=s1; d=tutanota.com; h=From:From:To:To:Subject:Subject:Content-Description:Content-ID:Content-Type:Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:In-Reply-To:In-Reply-To:MIME-Version:MIME-Version:Message-ID:Message-ID:Reply-To:References:References:Sender; bh=gRUGRqVQXAEMtmfLdKL8KA3nPBbh4VF6CE/iag0x6Pk=; b=NWMNQ27KibWzmD19zbdto06x+MtFMsuQ9s7D9lZ0xJnGK+6O7leqTsBXvp661L1I T3YxGxRnFpnHq4e9hndo5D/12kio2HN6dSAQh03gYtwu1Q/qXrOhYFacBRQ5FZgdfjr 1GKNznJVtSPV2pRnZwEhuDE+8jd01+lDCFItLRoN3xQHGqfa0NBohgIl/BQwz+Rwgi7 OkPflypAQ+y8Ih5W2N1EiAd9xumjqJqkE4jHhS1pp9EwHip0x7HTruJlptVRkICHAY2 SMIpBTgQl+vwpF+FbHgG1B4Ill9++2yjRr4JNVGVjc//1QHEXEpXY22wj/UmMmfkiFH bdHEJ4KHgQ== In-Reply-To: <87o84i2fwf.fsf@web.de> Received-SPF: pass client-ip=81.3.6.162; envelope-from=fatiparty@tutanota.com; helo=w1.tutanota.de X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, HTML_MESSAGE=0.001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.io gmane.emacs.help:135224 Archived-At: ------=_Part_459879_2008232021.1641936620720 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Jan 12, 2022, 08:09 by michael_heerdegen@web.de: > fatiparty--- via Users list for the GNU Emacs text editor > writes: > >> I see no specific hints with debug-on-error. >> > > You won't get a debugger for font-lock errors. > >> The definition does not work for me, because I want to specify my own >> keywords to highlight. >> > > Hard to guess the cause without a recipe to reproduce your problem. > Seems everything works for me - unless I have understood something > wrong. > > Michael. > Perhaps I can send the actual file.=C2=A0 I do not think it is a very sever= e problem to fix. ------=_Part_459879_2008232021.1641936620720 Content-Type: text/x-emacs-lisp; charset=UTF-8; name=daphne-stenogr.el Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename=daphne-stenogr.el ;;; daphne-stenogr.el ;; Version 1.0 ;; Mode: rec ;; File: daphne-stenogr.el ;; Brief: TODO. ;; Version: 1.0 ;; License: Gnu Affero General Public License (Gnu AGPL) ;; + Version 3 or Any Later Version. ;; Keywords: Elisp ;; # end of rec ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ___ ___ _ ;; / __|_ __ _ _ / __|___ _ _ __| |_ __ ;; | (__| '_ \ || | | (__/ _ \ ' \/ _` \ \ / ;; \___| .__/\_, | \___\___/_||_\__,_/_\_\ ;; |_| |__/ ;; This file is free software; you can redistribute it and/or modify ;; it under the terms of the Gnu Affero General Public License as ;; published by the Free Software Foundation, either version 3 of the ;; License, or (at your option) any later version. ;; You should have received a copy of the GNU General Public License ;; along with this file. A copy of the license is included in the file ;; entitled "gnu--agpl.texi". If not, see ;; . ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; Commentary: ;;; Code: ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; (require 'rx) ; Is this needed ;; (eval-when-compile ;; (setq byte-compile-function-environment ;;=09(delq (assq 'daphne-mode byte-compile-function-environment) ;;=09 byte-compile-function-environment))) ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; _ _ =20 ;; __| |__ _ _ __| |_ _ _ ___=20 ;; / _` / _` | '_ \ ' \| ' \/ -_) ;; \__,_\__,_| .__/_||_|_||_\___| ;; |_| =20 (defgroup daphne () "Groups tools for assisting with superior & inferior typeface." :prefix "daphne" :group 'daphne) (defgroup keyword-typeface () "Groups tools for typesetting mathematical symbols." :prefix "daphne-keyword" :group 'daphne) ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; _ _ =20 ;; | |_ _____ ____ ___ _ __ __ ___| |___ _ _ _ _=20 ;; | _/ -_) \ / _/ _ \ ' \ / _/ _ \ / _ \ || | '_| ;; \__\___/_\_\__\___/_|_|_| \__\___/_\___/\_,_|_| =20 (defface texmark-colour '( (default :inherit bold) ( ((class color) (background light)) :foreground "#00FF00" ) ( ((class color) (background dark)) :foreground "#00FF00" ) (t :inherit font-lock-builtin-face) ) "User defined colour typeface for tex command keywords.") ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; For a user defined typeface, inherit "texmark-markup". (defface texmark-typeface '((t :inherit font-lock-keyword-face))=20 "Colour typeface for tex command keywords.") ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Mode: rec ;; Defconst: texcom-cluster ;; Brief: Sets tex keywords=20 ;; Subject: The `rx' regular expression parser ;; Brief: texcom-cluster sets tex keywords using rx, a regular ;; + expression parser that is easier to read. ;; Example: `rx' command ;; + (rx "\\" word-start (group (or "alpha" "beta" "zeta")) word-end) ;; Example: Equivalent concatenated expression ;; + (concat "\\\\\\<\\(alpha\\|beta\\|zeta\\)\\>") ;; # end of rec (defconst texmark-cluster `( ;; ------------------------------------------------- ;; Greek (,(rx "\\" word-start (group (or "alpha" "beta" "chi" "delta" "Delta" "epsilon" "varepsilon" "eta" "gamma" "Gamma" "iota" "kappa" "lambda" "Lambda" "mu" "nu" "omega" "Omega" "phi" "varphi" "Phi" "pi" "varpi" "Pi" "psi" "Psi" "rho" "varrho" "sigma" "varsigma" "Sigma" "tau" "theta" "vartheta" "Theta" "upsilon" "Upsilon" "xi" "Xi" "zeta")) =09 word-end) (1 'texmark-typeface)) ;; ------------------------------------------------- ;; Mathematical symbols (,(rx "\\" word-start (group (or "infty" "Re" "Im" "angle" "triangle" "backslash" "vert" "Vert" "emptyset" "bot" "top" "exists" "forall" "hbar" "ell" "aleph" "imath" "jmath" "nabla" "neg" "lnot" "prime" "partial" "surd" "wp" "flat" "sharp" "natural" "clubsuit" "diamondsuit" "heartsuit" "spadesuit")) =09 word-end) (1 'texmark-typeface)) ;; ------------------------------------------------- ;; Binary operations (,(rx "\\" word-start (group (or "vee" "wedge" "amalg" "cap" "cup" "uplus" "sqcap" "sqcup" "dagger" "ddagger" "land" "lor" "cdot" "diamond" "bullet" "circ" "bigcirc" "odot" "ominus" "oplus" "oslash" "otimes" "pm" "mp" "triangleleft" "triangleright" "bigtriangledown" "bigtriangleup" "ast" "star" "times" "div" "setminus" "wr")) =09 word-end) (1 'texmark-typeface)) ;; ------------------------------------------------- ;; Mathematical relations (,(rx "\\" word-start (group (or "asymp" "cong" "dashv" "vdash" "perp" "mid" "parallel" "doteq" "equiv" "ge" "geq" "le" "leq" "gg" "ll" "models" "ne" "neq" "notin" "in" "ni" "owns" "prec" "preceq" "succ" "succeq" "bowtie" "propto" "approx" "sim" "simeq" "frown" "smile" "subset" "subseteq" "supset" "supseteq" "sqsubseteq" "sqsupseteq" "cos" "sin" "tan" "cot" "csc" "sec" "arccos" "arcsin" "arctan" "cosh" "coth" "sinh" "tanh" "det" "dim" "exp" "ln" "log" "lg" "arg" "deg" "gcd" "hom" "ker" "inf" "sup" "lim" "liminf" "limsup" "max" "min" "Pr")) =09 word-end) (1 'texmark-typeface)) ;; ------------------------------------------------- ;; Delimeters (,(rx "\\" word-start (group (or "lbrace" "rbrace" "lbrack" "rbrack" "langle" "rangle" "lceil" "rceil" "lfloor" "rfloor")) =09 word-end) (1 'texmark-typeface)) ;; ------------------------------------------------- ;; Arrows (,(rx "\\" word-start (group (or "leftarrow" "gets" "Leftarrow" "rightarrow" "to" "Rightarrow" "leftrightarrow" "Leftrightarrow" "longleftarrow" "Longleftarrow" "longrightarrow" "Longrightarrow" "longleftrightarrow" "Longleftrightarrow" "iff" "hookleftarrow" "hookrightarrow" "leftharpoondown" "rightharpoondown" "leftharpoonup" "rightharpoonup" "rightleftharpoons" "mapsto" "longmapsto" "downarrow" "Downarrow" "uparrow" "Uparrow" "updownarrow" "Updownarrow" "nearrow" "searrow" "nwarrow" "swarrow")) word-end) (1 'texmark-typeface)) ;; ------------------------------------------------- ;; Large mathematical operations (,(rx "\\" word-start (group (or "bigcap" "bigcup" "bigodot" "bigoplus" "bigotimes" "bigsqcup" "biguplus" "bigvee" "bigwedge" "coprod" "smallint" "int" "oint" "prod" "sum" "limits" "nolimits" "displaylimits")) =09 word-end) (1 'texmark-typeface)) ;; ------------------------------------------------- ;; Fractions and stacking (,(rx "\\" word-start (group (or "over" "atop" "above" "choose" "brace" "cases" "underbrace" "overbrace" "underline" "overline" "overleftarrow" "overrightarrow" "buildrel" "ldots" "cdots" "vdots" "ddots" "lgroup" "rgroup" "left" "right" "delimiter" "delimiterfactor" "delimitershortfall" "matrix" "pmatrix" "bordermatrix" "sqrt" "root" "of")) word-end) (1 'texmark-typeface)) ;; ------------------------------------------------- ;; Punctuation and style (,(rx "\\" word-start (group (or "cdotp" "ldotp" "colon" "sb" "sp" "textstyle" "scriptstyle" "scriptscriptstyle" "displaystyle")) =09 word-end) (1 'texmark-typeface)) ;; ------------------------------------------------- ;; Mathematical accents (,(rx "\\" word-start (group (or "acute" "b" "bar" "breve" "check" "ddot" "dot" "grave" "hat" "widehat" "tilde" "widetilde" "vec")) =09 word-end) (1 'texmark-typeface)) ;; ------------------------------------------------- ;; Mathematical class (,(rx "\\" word-start (group (or "mathord" "mathop" "mathbin" "mathrel " "mathopen" "mathclose" "mathpunct")) =09 word-end) (1 'texmark-typeface)) ;; ------------------------------------------------- ;; Equations and multiline display (,(rx "\\" word-start (group (or "eqno" "leqno" "displaylines" "eqalign" "eqalignno" "leqalignno")) =09 word-end) (1 'texmark-typeface)) ;; ------------------------------------------------- ;; Big sizes. Using concat rather than rx. (,(rx "\\" word-start (group (or "big" "bigl" "bigm" "bigr" "Big" "Bigl" "Bigm" "Bigr" "bigg" "biggl" "biggm" "biggr" "Bigg" "Biggl" "Biggm" "Biggr" "downbracefill" "upbracefill" "arrowvert" "Arrowvert" "lmoustache" "rmoustache" "bracevert")) =09 word-end) (1 'texmark-typeface)) ) "Typeface fontification for tex keywords.") ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (defun texmark-typeface-enable () "Sets the highlight colour for tex commands." (font-lock-add-keywords nil texmark-cluster t) (font-lock-flush)) ;; +++++++++++++++++++++++++++++++++++++++++++++++++++++ (defun texmark-typeface-disable () "Clears the highlight colour for tex commands." (font-lock-remove-keywords nil texmark-cluster) (font-lock-flush)) ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; * Displays texmath glyphs for the corresponding tex commands. ;; _ _ =20 ;; (_)__| |___ ___ __ _ _ _ __ _ _ __ ___ ;; | / _` / -_) _ \/ _` | '_/ _` | ' \(_-< ;; |_\__,_\___\___/\__, |_| \__,_|_|_|_/__/ ;; |___/ =20 ;;(require 'prog-mode) ;; ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ (defvar texsym-cluster '( ;; Greek Letters ;; ************* ("\\alpha" . ?=CE=B1) ("\\beta" . ?=CE=B2) ("\\chi" . ?=CF=87= ) ("\\delta" . ?=CE=B4) ("\\Delta" . ?=CE=94) ("\\epsilon" . ?= =CF=B5) ("\\varepsilon" . ?=CE=B5) ("\\eta" . ?=CE=B7) ("\\gamma" . ?=CE= =B3) ("\\Gamma" . ?=CE=93) ("\\iota" . ?=CE=B9) ("\\kappa" . ?=CE= =BA) ("\\lambda" . ?=CE=BB) ("\\Lambda" . ?=CE=9B) ("\\mu" . ?=CE=BC) ("\\nu" . ?=CE=BD) ("\\omega" . ?=CF=89) ("\\Omega" . ?=CE= =A9) ("\\phi" . ?=CF=95) ("\\varphi" . ?=CF=86) ("\\pi" . ?=CF=80) ("\\Pi" . ?=CE=A0) ("\\psi" . ?=CF=88) ("\\Psi" . ?=CE=A8= ) ("\\rho" . ?=CF=81) ("\\varrho" . ?=CF=B1) ("\\sigma" . ?=CF= =83) ("\\varsigma" . ?=CF=82) ("\\Sigma" . ?=CE=A3) ("\\tau" . ?=CF=84= ) ("\\theta" . ?=CE=B8) ("\\vartheta" . ?=CF=91) ("\\Theta" . ?=CE= =98) ("\\upsilon" . ?=CF=85) ("\\Upsilon" . ?=CE=A5) ("\\xi" . ?=CE=BE) ("\\Xi" . ?=CE=9E) ("\\zeta" . ?=CE=B6) ;; Mathematical Symbols ;; ******************** ("\\forall" . ?=E2=88=80) ("\\exists" . ?=E2=88=83) ("\\infty" .= ?=E2=88=9E) ("\\emptyset" . ?=E2=88=85) ("\\sqrt" . ?=E2=88=9A) ("\\surd" . = ?=E2=88=9A) ("\\Re" . ?=E2=84=9C) ("\\Im" . ?=E2=84=91) ("\\ell" . ?= =E2=84=93) ("\\hbar" . ?=E2=84=8F) ("\\wp" . ?=E2=84=98) ("\\aleph" .= ?=E2=84=B5) ("\\imath" . ?=C4=B1) ("\\jmath" . ?=C8=B7) ("\\angle" . ?=E2= =88=A0) ("\\partial" . ?=E2=88=82) ("\\nabla" . ?=E2=88=87) ("\\triangle= " . ?=E2=96=B3) ("\\vert" . ?|) ("\\Vert" . ?=E2=88=A5) ("\\backslash" . ?= =E2=88=96) ("\\bot" . ?=E2=8A=A5) ("\\top" . ?=E2=8A=A4) ("\\prime" .= ?=E2=80=B2) ("\\neg" . ?=C2=AC) ("\\lnot" . ?=C2=AC) ("\\natural" . ?= =E2=99=AE)=20 ("\\flat" . ?=E2=99=AD) ("\\sharp" . ?=E2=99=AF) ("\\clubsuit= " . ?=E2=99=A3) ("\\heartsuit" . ?=E2=99=A1) ("\\spadesuit" . ?=E2=99=A0) ("\\diamonds= uit" . ?=E2=8B=84)=20 ;; Binary Operations ;; ***************** ("\\over" . ?/) ("\\vee" . ?=E2=88=A8) ("\\wedge" . ?=E2=88=A7) ("\\cap" . ?=E2= =88=A9) ("\\cup" . ?=E2=88=AA) ("\\uplus" . ?=E2=8A=8E) ("\\sqcap" . ?= =E2=8A=93) ("\\dagger" . ?=E2=80=A0) ("\\ddagger" . ?=E2=80=A1) ("\\land" . ?=E2= =88=A7) ("\\lor" . ?=E2=88=A8) ("\\cdot" . ?=E2=8B=85) ("\\diamond" . ?= =E2=8B=84) ("\\bullet" . ?=E2=88=99) ("\\circ" . ?=E2=88=98) ("\\bigcirc" . ?= =E2=97=AF) ("\\odot" . ?=E2=8A=99) ("\\ominus" . ?=E2=8A=96) ("\\oplus" . ?= =E2=8A=95) ("\\oslash" . ?=E2=8A=98) ("\\otimes" . ?=E2=8A=97) ("\\pm" . ?=C2= =B1) ("\\mp" . ?=E2=88=93) ("\\ast" . ?=E2=88=97) ("\\star" . ?=E2= =8B=86) ("\\times" . ?=C3=97) ("\\div" . ?=C3=B7) ("\\amalg" . ?=E2=A8= =BF) ("\\triangleleft" . ?=E2=97=83) ("\\triangleright" . ?=E2=96=B9) ("\\bigtriangledown" . ?=E2=96=BD) ("\\bigtriangleup" . ?=E2=96=B3) ;;("\\setminus" . ?=E2=88=96) ("\\wr" . ?=E2=89=80) ;; Large Mathematical Operations ;; ***************************** ("\\sum" . ?=E2=88=91) ("\\prod" . ?=E2=88=8F) ("\\coprod"= . ?=E2=88=90) ("\\smallint" . ?=E2=88=AB) ("\\int" . ?=E2=88=AB) ("\\oint" .= ?=E2=88=AE) ("\\bigoplus" . ?=E2=A8=81) ("\\bigotimes" . ?=E2=A8=82) ("\\bigodot"= . ?=E2=A8=80) ("\\bigcap" . ?=E2=8B=82) ("\\bigcup" . ?=E2=8B=83) ("\\bigvee"= . ?=E2=8B=81) ("\\bigwedge" . ?=E2=8B=80) ("\\bigsqcup" . ?=E2=A8=86) ("\\biguplus= " . ?=E2=A8=84) ;; Mathematical Relations ;; ********************** ("\\asymp" . ?=E2=89=8D) ("\\cong" . ?=E2=89=85) ("\\dashv" = . ?=E2=8A=A3) ("\\vdash" . ?=E2=8A=A2) ("\\perp" . ?=E2=8A=A5) ("\\mid" . = ?=E2=88=A3) ("\\parallel" . ?=E2=88=A5) ("\\doteq" . ?=E2=89=90) ("\\equiv" = . ?=E2=89=A1) ("\\ge" . ?=E2=89=A5) ("\\geq" . ?=E2=89=A5) ("\\le" . ?= =E2=89=A4) ("\\leq" . ?=E2=89=A4) ("\\gg" . ?=E2=89=AB) ("\\ll" . ?= =E2=89=AA) ("\\models" . ?=E2=8A=A8) ("\\ne" . ?=E2=89=A0) ("\\notin" = . ?=E2=88=89) ("\\in" . ?=E2=88=88) ("\\ni" . ?=E2=88=8B) ("\\owns" .= ?=E2=88=8B) ("\\prec" . ?=E2=89=BA) ("\\preceq" . ?=E2=AA=AF) ("\\succ" .= ?=E2=89=BB) ("\\succeq" . ?=E2=AA=B0) ("\\bowtie" . ?=E2=8B=88) ("\\propto"= . ?=E2=88=9D) ("\\approx" . ?=E2=89=88) ("\\sim" . ?=E2=88=BC) ("\\simeq"= . ?=E2=89=83) ("\\frown" . ?=E2=8C=A2) ("\\smile" . ?=E2=8C=A3) ("\\subset" = . ?=E2=8A=82) ("\\subseteq" . ?=E2=8A=86) ("\\supset" . ?=E2=8A=83) ("\\supset= eq" . ?=E2=8A=87) ("\\sqsubseteq" . ?=E2=8A=91) ("\\sqsupseteq" . ?=E2=8A=92) ;; Delimeters ;; ********** ("\\lbrace" . ?{) ("\\rbrace" . ?}) ("\\lbrack" . ?\[) ("\\rbrack" . ?\]) ("\\langle" . ?\=E2=9F=A8) ("\\rangle" . ?\=E2= =9F=A9) ("\\lceil" . ?=E2=8C=88) ("\\rceil" . ?=E2=8C=89) ("\\lfloor" = . ?=E2=8C=8A) ("\\rfloor" . ?=E2=8C=8B) ("\\widehat" . ?^) ("\\overline" . ?=CC= =85 ) =20 ("\\tilde" . ?~) ("\\left\\{" . ?{) ("\\right\\}" . ?}) ("\\left\\[" . ?\[) ("\\right\\]" . ?\])=20 ("\\left\\(" . ?\() ("\\right\\)" . ?\)) ("\\bigl\(" . ?\() ("\\bigr\)" . ?\)) ("\\Biggl\(" . ?\() ("\\Biggr\)" . ?\)) ;; Arrows ;; ****** =20 ("\\iff" . ?=E2=9F=BA) ("\\gets" . ?=E2=86=90) ("\\to" . ?=E2=86=92) ("\\longmapsto" . ?=E2=9F=BC)=20 ("\\leftarrow" . ?=E2=86=90) ("\\rightarrow" . ?=E2=86=92) ("\\Leftarrow" . ?=E2=87=90) ("\\Rightarrow" . ?=E2=87=92) ("\\uparrow" . ?=E2=86=91) ("\\Uparrow" . ?=E2=87=91) ("\\nearrow" . ?=E2=86=97) ("\\searrow" . ?=E2=86=98) ("\\nwarrow" . ?=E2=86=96) ("\\swarrow" . ?=E2=86=99) ("\\updownarrow" . ?=E2=86=95) ("\\Updownarrow" . ?=E2=87=95) ("\\downarrow" . ?=E2=86=93) ("\\Downarrow" . ?=E2=87=93) ("\\leftrightarrow" . ?=E2=86=94) ("\\Leftrightarrow" . ?=E2=87=94) ("\\longleftarrow" . ?=E2=9F=B5) ("\\Longleftarrow" . ?=E2=9F=B8) ("\\longrightarrow" . ?=E2=9F=B6) ("\\Longrightarrow" . ?=E2=9F=B9) ("\\longleftrightarrow" . ?=E2=9F=B7) ("\\Longleftrightarrow" . ?=E2= =9F=BA) ("\\hookleftarrow" . ?=E2=86=A9) ("\\hookrightarrow" . ?=E2=86=AA= ) ("\\leftharpoondown" . ?=E2=86=BD) ("\\rightharpoondown" . ?=E2=87= =81) ("\\leftharpoonup" . ?=E2=86=BC) ("\\rightharpoonup" . ?=E2=87=80= ) ("\\rightleftharpoons" . ?=E2=87=8C) ("\\mapsto" . ?=E2=86=A6) ;; Fractions and Stacking ;; ********************** ("\\dots" . ?=E2=80=A6) ("\\ldots" . ?=E2=80=A6) ("\\cdots" . ?=E2= =8B=AF) ("\\vdots" . ?=E2=8B=AE) ("\\ddots" . ?=E2=8B=B1) ;; Punctuation and Style ;; ********************* =20 ("\\cdotp" . ?=E2=8B=85) ("\\ldotp" . ?.) ("\\colon" . ?:) ;; Tex Primitives ;; ************** ;; ?\N{NAME} specifies character by the Unicode Name=20 ("\\cr" . ?\N{ZERO WIDTH SPACE}) =20 ;; Other Glyphs (e.g. Latex) ;; ************************* ("\\Subset" . ?=E2=8B=90) ("\\Supset" . ?=E2=8B=91) ("\\Vdash" = . ?=E2=8A=A9) ("\\Vvdash" . ?=E2=8A=AA) ("\\because" . ?=E2=88=B5) ("\\boxminus= " . ?=E2=8A=9F) ("\\boxplus" . ?=E2=8A=9E) ("\\boxtimes" . ?=E2=8A=A0) ("\\circeq"= . ?=E2=89=97) ("\\eqcirc" . ?=E2=89=96) ("\\eqcolon" . ?=E2=89=95) ("\\circled= R" . ?=C2=AE) ("\\circledS" . ?=E2=93=88) ("\\ggg" . ?=E2=8B=99) ("\\gnapprox"= . ?=E2=8B=A7) ("\\lambdabar" . ?=C6=9B) ("\\veebar" . ?=E2=8A=BB) ("\\celsius" .= ?=E2=84=83) ("\\textdied" . ?=E2=9C=9D) ("\\urcorner" . ?=E2=8C=9D) ("\\u{i}" .= ?=C4=AD) ("\\vDash" . ?=E2=8A=A8) ("\\textwon" . ?=E2=82=A9) ("\\textpes= o" . ?=E2=82=B1) ("\\textlira" . ?=E2=82=A4) ("\\textnaira" . ?=E2=82=A6) ("\\textbah= t" . ?=E0=B8=BF) ("\\gneq" . ?=E2=89=A9) ("\\gneqq" . ?=E2=89=A9) ("\\gnsim" .= ?=E2=8B=A7) ("\\gtrapprox" . ?=E2=89=B3) ("\\gtrdot" . ?=E2=8B=97) ("\\gtreqles= s" . ?=E2=8B=9B) ("\\gtreqqless" . ?=E2=8B=9B) ("\\gtrless" . ?=E2=89=B7) ("\\gtrsim" = . ?=E2=89=B3) ("\\gvertneqq" . ?=E2=89=A9) ("\\qquad" . ?=E2=A7=A2) ("\\quad" . = ?=E2=90=A3) ("\\curlyeqprec" . ?=E2=8B=9E) ("\\curlyeqsucc" . ?=E2=8B=9F) ("\\curlypreceq" . ?=E2=89=BC) ("\\curlyvee" . ?=E2=8B=8E) ("\\curlywedge" . ?=E2=8B=8F) ("\\curvearrowleft" . ?=E2=86=B6= ) ("\\curvearrowright" . ?=E2=86=B7) ("\\divideontimes" . ?=E2=8B=87)= =20 ("\\eqslantgtr" . ?=E2=8B=9D) ("\\eqslantless" . ?=E2=8B=9C) ("\\ordfeminine" . ?=C2=AA) ("\\ordmasculine" . ?=C2=BA) ("\\circlearrowleft" . ?=E2=86=BA) ("\\circlearrowright" . ?=E2=86= =BB) =20 ("\\rightrightarrows" . ?=E2=87=89) ("\\rightthreetimes" . ?=E2=8B= =8C) ("\\sphericalangle" . ?=E2=88=A2) ("\\twoheadleftarrow" . ?=E2=86= =9E) ("\\twoheadrightarrow" . ?=E2=86=A0) ("\\textcolonmonetary" . ?=E2=82= =A1) ("\\textpertenthousand" . ?=E2=80=B1) ("\\textreferencemark" . ?=E2=80= =BB) ("\\textrecipe" . ?=E2=84=9E) ("\\textinterrobang" . ?=E2=80=BD= ) =20 ("\\textnumero" . ?=E2=84=96) ("\\textdiscount" . ?=E2=81=92) ("\\textestimated" . ?=E2=84=AE) ("\\textopenbullet" . ?=E2=97=A6= ) ("\\textlquill" . ?\=E2=81=85) ("\\textrquill" . ?\=E2=81=86) ("\\textcircledP" . ?=E2=84=97) ) "A glyph list usable for tex modes.") ;; +++++++++++++++++++++++++++++++++++++++++++++++++++++ (defun texsym-predicate (start end _match) "Prettify mathematical expressions defined by tex syntax. Matches START with a backslash and END with a word constituent [a-zA-Z0-9]. Uses the prettify functionality of `prog-mode'." (not (or (memq (char-before start) '(?\\)) (memq (char-syntax (or (char-after end) ?\s)) '(?w)) =09 (nth 8 (syntax-ppss)))) ) ;; ----------------------------------------------------- (defun prettify-symbols-cluster () "Set keywords and corresponding glyph." (setq-local prettify-symbols-alist texsym-cluster) (setq prettify-symbols-compose-predicate 'texsym-predicate)) ;; +++++++++++++++++++++++++++++++++++++++++++++++++++++ (defun ideogram-view-enable () "Enables typeface for tex glyphs." (prettify-symbols-cluster) (prettify-symbols-mode)) (defun ideogram-view-disable () "Enables typeface for tex glyphs." (prettify-symbols-mode 0)) ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; _ _=20 ;; _ _(_)__ __(_) ;; | '_| / _/ _| | ;; |_| |_\__\__|_| (defcustom ricci-signal t "Displays mathematical expressions in Ricci Notation.=20 Ricci Notation is enabled when `ricci-signal' is `t', otherwise disabled." :type 'boolean :group 'ricci) (put 'ricci-signal 'safe-local-variable 'booleanp) ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (defcustom ricci-deviat '(0.18 -0.18) "Sets the superior and inferior vertical deviation of typeface. Deviation is measured relative to the text font size." :group 'ricci :type '(list (float :tag "supr-deviat") (float :tag "infr-deviat")) ) ;; +++++++++++++++++++++++++++++++++++++++++++++++++++++ (defcustom ricci-scale 0.8 "Sets the superior and inferior typeface scaling with preceding text. For nested expressions, scale is applied repeatedly, with limit set by `ricci-hmin'." :type 'float :group 'ricci) ;; +++++++++++++++++++++++++++++++++++++++++++++++++++++ (defcustom ricci-hmin 0.8 "Sets the minimum ricci glyph height. For integer values, the hmin is scaled in units of 1/10 point size. For floating point values, relative height is used." :type '(choice (integer :tag "Font height in 1/10 point units") =09=09 (float :tag "Fraction of font height")) :group 'ricci) ;; +++++++++++++++++++++++++++++++++++++++++++++++++++++ (defun ricci-height (height) "Return integer HEIGHT of superior and inferior glyph. HEIGHT typeface height. Integer scaled in 1/10 of point size. Not smaller than value set by `daphne-hmin'." (ceiling (max (if (integerp ricci-hmin) =09 ricci-hmin =09 (condition-case nil ; For bootstrapping. =09 (* ricci-hmin =09=09 (face-attribute 'default :height)) =09 (error 0))) =09(* height ricci-scale)))) ; assumes height is integer. ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (defface ricci-supr '((t :height ricci-height)) "Typography for superior glyphs in Ricci Script." :group 'ricci) ;; +++++++++++++++++++++++++++++++++++++++++++++++++++++ (defface ricci-infr '((t :height ricci-height)) "Typography for inferior glyphs in Ricci Script." :group 'ricci) ;; +++++++++++++++++++++++++++++++++++++++++++++++++++++ (defun ricci-raise (pos) "Raise and lower typeface at position POS. POS Position in buffer" (unless (or (memq (get-text-property pos 'face) =09=09'(font-lock-constant-face font-lock-builtin-face)) =09 (let ( (odd nil) (pos pos) ) =09 (while (eq (char-before pos) ?\\) ; Check backslash quoting =09 (setq pos (1- pos) odd (not odd))) =09 odd)) (if (eq (char-after pos) ?^) =09`(face ricci-supr display ; detected superscript `^'. =09 (raise ,(car ricci-deviat))) `(face ricci-infr display ; detected subscript `_' =09 (raise ,(cadr ricci-deviat)))) )) ;; +++++++++++++++++++++++++++++++++++++++++++++++++++++ (defun ricci-match (limit) "Matches superior and inferior glyph patterns up to LIMIT. LIMIT Narrows the accessible portion of the buffer." =20 (when (and ricci-signal =09 (re-search-forward "[_^] *\\([^\n\\{}]\\|\ \\\\\\([a-zA-Z@]+\\|[^ \t\n]\\)\\|\\({\\)\\)" limit t)) (when (match-end 3) (let (($beg (match-beginning 3)) =09 ($end (save-restriction =09=09 (narrow-to-region (point-min) limit) =09=09 (condition-case nil =09=09 (scan-lists (point) 1 1) (error nil))))) =09;; body of let =09(store-match-data (if $end =09 (list (match-beginning 0) $end $beg $end) =09 (list $beg $beg $beg $beg))))) t)) ;; +++++++++++++++++++++++++++++++++++++++++++++++++++++ ;; Mode: rec ;; Defun: (ricci-script sel) ;; Param: SEL Selection enabled or disabled ;; # end of rec =20 ;; Mode: rec ;; Subject: [TODO] setq-local change in Emacs 27.2 ;; + Change setq-local commands for Gnu Emacs ? onwards ;; + (setq-local ricci-deviat '(0.34 -0.34) ;; + ricci-scale 0.2)) ;; Detail: Changes in Emacs 27.2 ;; + `setq-local' can now set an arbitrary number of variables, ;; + which makes the syntax more like `setq'. ;; ;; Subject: Declaration of font-lock-add-keywords ;; + (font-lock-add-keywords MODE KEYWORDS &optional HOW) ;; Detail: For details call `C-h f font-lock-add-keywords'. ;; # end of rec (defun ricci-script (sel) "Set the superior and inferior deviaton and scale. SEL Selection enabled or disabled" (pcase sel ("+" ; enables feature (setq-local ricci-deviat '(0.34 -0.34)) (setq-local ricci-scale 0.2)) ("-" ; disables feature (setq-local ricci-deviat '(0.0 0.0)) (setq-local ricci-scale 1.0)) ) (font-lock-add-keywords nil '( (ricci-match (1 (ricci-raise (match-beginning 0)))) ) t) (font-lock-flush) ) ;; +++++++++++++++++++++++++++++++++++++++++++++++++++++ (defun ricci-script-enable () "Displays mathematics with Ricci Notation." (interactive) (ricci-script "+") ) ;; +++++++++++++++++++++++++++++++++++++++++++++++++++++ (defun ricci-script-disable () "Disables the display of Ricci Script." (interactive) (ricci-script "-") ) ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (defvar-local stenogr-sweep-kondor 1 "Keeps track of the cycle state in `daphne-stenogr-sweep'.") (defun stenogr-sweep () "Cycles supinf and ideograms functionality." (interactive) ;; uses (+) for feature enabled, (-) for feature disabled (pcase stenogr-sweep-kondor (1 (ideogram-view-enable) (message "daphne | + Ideogram Vision") (setq-local stenogr-sweep-kondor (1+ stenogr-sweep-kondor))) (2 (ricci-script-enable) (message "daphne | + Ideogram Vision | + Ricci Script") (setq-local stenogr-sweep-kondor (1+ stenogr-sweep-kondor))) =20 (_ (ricci-script-disable) (ideogram-view-disable) (message "daphne | - Ideogram Vision | - Ricci Script") (setq-local stenogr-sweep-kondor 1)) )) ;; ----------------------------------------------------- (defun daphne-stenogr-sweep-keytrigger () "Key trigger capability for rapid execution of commands." (global-set-key (kbd "H-s") #'stenogr-sweep) ) ;; ----------------------------------------------------- (defun daphne-stenogr-launch () "Launch Ideogram tools for mathematical notation.=20 Provides three capabilities - Tex command highlighting; Ricci Notation; Ideogram display." (message "+ daphne-stenogr") (texmark-typeface-enable) (daphne-stenogr-sweep-keytrigger)) ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Subject: define-minor-mode ;; Brief: Defines a new minor mode ;; Subject: Documentation for `define-minor-mode'. ;; + C-h f define-minor-mode ;; Declaration: define-minor-mode ;; + (define-minor-mode MODE DOC ;; + &optional INIT-VALUE LIGHTER KEYMAP &rest BODY) ;; Brief: Defines a toggle command MODE and by default a control ;; + variable named MODE. ;;;###autoload (define-minor-mode daphne-minor-mode "Minor mode for assisting with superior & inferior typeface." :init-value nil :lighter " Daphne" ; used in modeline when mode is enabled ;; Disable commands first to avoids multiple copies of lists when ;; calling `(daphne-minor-mode 1)' several times. (texmark-typeface-disable) (ricci-script-disable) (when daphne-minor-mode ! variable self-made by define-minor-mode (texmark-typeface-enable) (ricci-script-enable)) ) ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (provide 'daphne) ;; code ends here ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; Marginalia ;; Mode: rec ;; Subject: Idempotency of variables ;; Detail: Idempotency describes an action which, when performed ;; + multiple times, has no further effect on its subject after the ;; + first time it is performed. In algebra, a idempotent quantity is ;; + a quantity which when multiplied into itself gives itself. ;; End of rec ;; daphne-stenogr.el ends here ------=_Part_459879_2008232021.1641936620720--