From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: michael-franzese@gmx.com Newsgroups: gmane.emacs.help Subject: Re: Minor mode for colouring plain tex lowercase greek letters Date: Mon, 11 Jan 2021 20:36:41 +0100 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="16056"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Help Gnu Emacs To: michael-franzese@gmx.com Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Mon Jan 11 20:57:52 2021 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 1kz3K3-00044u-Tq for geh-help-gnu-emacs@m.gmane-mx.org; Mon, 11 Jan 2021 20:57:51 +0100 Original-Received: from localhost ([::1]:48072 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kz3K2-0004yS-UO for geh-help-gnu-emacs@m.gmane-mx.org; Mon, 11 Jan 2021 14:57:50 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:54532) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kz2zg-0003vR-FW for help-gnu-emacs@gnu.org; Mon, 11 Jan 2021 14:36:48 -0500 Original-Received: from mout-xforward.gmx.net ([82.165.159.14]:35829) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kz2zd-0002ry-FE for help-gnu-emacs@gnu.org; Mon, 11 Jan 2021 14:36:48 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1610393801; bh=T1//bFT5iDkd8Wejtin4krAen0j3AdRejU4F52PS72Q=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date:In-Reply-To:References; b=AP+OoNJcv+LTELguVrVVrq2HYu63D/mG4Z04bki1HXcSamn+c629YtPf3eAXFOllH pwZfdsOBNDETRLnzDtkrkvyeRb41SIAlnE5EIRmFzJer5/HM40i33H1q6U11/ZBkoL ZGybB7k7XtYx6E/qKUPzdEol5caWK5LB7UwjU6w4= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Original-Received: from [185.244.212.219] ([185.244.212.219]) by web-mail.gmx.net (3c-app-mailcom-bs13.server.lan [172.19.170.181]) (via HTTP); Mon, 11 Jan 2021 20:36:41 +0100 Importance: normal Sensitivity: Normal In-Reply-To: X-UI-Message-Type: mail X-Priority: 3 X-Provags-ID: V03:K1:rTMGPJZDMH5aqfvpwMwL2XAgyJ6wp2KK+k9jsWaBgggFOzK7mcBiZ3chEv0sIeaUXRDPf c39jm5hxXt/7/lroIxdjLTSvYm14RkBykz2rs0yT28PqkhMZEx1Hw1kr3mMlHkB+MrcTkPln+8Xm t6sA66+1OVgqDF5Stk/zUoKVI4szp5KVUFQHQvY2bFTEqzU+Liz1fx+WVHMZ5dL+cqujlub1xQHh DS1IqHoQ+1m4R1gjXKMNxpHjJpBEeZuFql2ZZj6LiCfQ6GtwxAcdP/yk5HfShnRtX5x9vJRVaiKg V4= X-UI-Out-Filterresults: junk:10;V03:K0:ZEGncDt2q1Q=:AX3mmXj7Ffh9x5smMAP5ivLc NsJJt8NNtXznJ45/ovC/LjOWwbS5njzF3yJxZrkj81WNmC3uEe3ReKmn33apEy4SL6qyCX5jm N1lhCEDtw8s7c/zqv2FoJc8KhUYACvps0O8/NuWSPXwme+Mzxf2Q+z/lyqaYvBqcIlPazYjq0 bnWJeRflQ8n7vKVTZhzjMkSB79nPU9O7pUhxj2mMV9y42obsf/0Krqbq8GR6FvNpHiGCG5gqR 1GisxrHVYfOKiv5hMzWHIYZQYuSnWhoeQlEEypqqGrlanKPeX2jdNHQ13nPkARvS5e3v7nxGQ fRwktygeXj9OFb6+ZoixBahWKoXxfOJaI4ZWqj1w/97GbfMSFMpvTzIBPat6g2NelcxV0CV4/ sqBqAECVZZT8wlzOxoW65NCvj/R1lNRy+piftVtqaQSJL0T37J83TjPuBH7+b0cETzet7q+OU Kkw7IYBxixHpRVMjw6FeS2rrbLFL3pvAXnne9pzYCIUOM+y9jJ3Jn0zRRV6eQW0TbLrDKTbYP bEFdzcy3XnsHOFpW31WIYOco7SV1cT65o2sW9z9vgDUtJ78Qm6N3ksOwnT2X7+Morrp0jUA1k MI7QNCMwPwio8DHtMfwWeUM+5ELIdm4mKyuneJIZht2U4vzP+YGskg== Received-SPF: pass client-ip=82.165.159.14; envelope-from=michael-franzese@gmx.com; helo=mout-xforward.gmx.net X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, FREEMAIL_FROM=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.23 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:127194 Archived-At: Have put the following code te highlight greek letters using a minor mode for texinfo-mode and the plani tex colouring commands \alpha \beta \gamma are not being coloured. (defun insert-ptex () (interactive) (insert "ptex")) (defvar ptex-mode-map (let ((map (make-keymap))) (define-key map (kbd "C-c t") 'insert-ptex) map) "Key map for use when variable `ptex-mode' is non-nil.") (defvar ptex-mode-hook nil "Hook called when variable `ptex-mode' is non-nil.") (define-minor-mode ptex-mode "Minor mode for colouring plain tex keywords." :init-value nil :global nil :lighter " ptex" :keymap ptex-mode-map (run-hooks 'ptex-mode-hook)) (add-hook 'texinfo-mode-hook 'ptex-mode) (defface colour-greek-category '((default :inherit bold) (((class color) (min-colors 88) (background light)) :foreground "#00FFFF") (((class color) (min-colors 88) (background dark)) :foreground "#00FFFF") (t :inherit font-lock-builtin-face)) "Face for header category entry.") (defconst ptex-greek-keywords '(("\\\\\\<\\(alpha\\|beta\\|gamma\\)\\>" (1 'colour-greek-category))) "Rules to apply font-lock highlighting.") (defun ptex-assign-font-greek-keywords () "Font-lock setup for `ptex-greek-keywords'." (font-lock-flush (point-min) (point-max)) (if ptex-mode (font-lock-add-keywords nil ptex-greek-keywords t) (font-lock-remove-keywords nil ptex-greek-keywords)) (font-lock-flush (point-min) (point-max))) (add-hook 'texinfo-mode-hook #'ptex-assign-font-greek-keywords) (provide 'ptex-mode) > Sent: Monday, January 11, 2021 at 9:10 PM > From: michael-franzese@gmx.com > To: "Help Gnu Emacs" > Subject: Minor mode for colouring plain tex lowercase greek letters > > Am trying to write a minor made to highlight tex keywords. I am startin= g > with the lowercase greek letters: \alpha, \beta, \gamma, \delta, \epsilo= n, > \zeta, \eta, \theta, \iota, \kappa, \lambda, \mu, \nu, \xi. > > Do not know how I can set the lowercase greek letters to some colour. > > I would have to assign a face to each regexp group rather than defining = my own faces. > Reuse the font-lock faces that one can find on M-x find-library RET face= s RET. > > >