From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Christopher Dimech Newsgroups: gmane.emacs.help Subject: Re: Separating colour and positioning functioning Date: Tue, 9 Feb 2021 01:27:52 +0100 Message-ID: References: <878s7yp7fh.fsf@zoho.eu> 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="14989"; mail-complaints-to="usenet@ciao.gmane.io" Cc: help-gnu-emacs@gnu.org To: moasenwood@zoho.eu Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Tue Feb 09 01:35:23 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 1l9Gzy-0003ib-OQ for geh-help-gnu-emacs@m.gmane-mx.org; Tue, 09 Feb 2021 01:35:22 +0100 Original-Received: from localhost ([::1]:58866 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l9Gzx-0008Cf-PX for geh-help-gnu-emacs@m.gmane-mx.org; Mon, 08 Feb 2021 19:35:21 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:60868) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l9Gss-0000Ea-VA for help-gnu-emacs@gnu.org; Mon, 08 Feb 2021 19:28:03 -0500 Original-Received: from mout.gmx.net ([212.227.17.21]:52181) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l9Gsl-0007S3-LT for help-gnu-emacs@gnu.org; Mon, 08 Feb 2021 19:28:02 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1612830473; bh=/I0w+96SnuKJL7NWeRoNIDVV6nd85xsLDkqrV4meo0o=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date:In-Reply-To:References; b=Asom1Wdh5sXCuMgLtOExrJFr/jXGvZasXD7DzHlyTbITYh2NgS4ZOP9etEwsblUa6 KqxgUtCWN43mZMFATi+HJFNdqMyyD8jthAxWZPYFht3wtLQ4eLeurJMnhHHtlDnWQu hm+qTup42xSMBcmjRaB8CRRkSm3QaYhjuHzXub3E= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Original-Received: from [213.165.168.94] ([213.165.168.94]) by web-mail.gmx.net (3c-app-mailcom-bs12.server.lan [172.19.170.180]) (via HTTP); Tue, 9 Feb 2021 01:27:52 +0100 Importance: normal Sensitivity: Normal In-Reply-To: <878s7yp7fh.fsf@zoho.eu> X-UI-Message-Type: mail X-Priority: 3 X-Provags-ID: V03:K1:BBKuOu7Kg4SJwRzOkkyrX4tsZm0pEGgUdZL+t1SHz2WyHaXfleaFHjHnyKfADEj1OFotL /1LE8bpEVN1ZqaAR2TDwxg4o0AaSKJeINPXqDv9M81L5f0bPaZOgQncxOeXh32IMVfoRve8YOSPQ XuPo1P/b6su54rnH8akjNhBH4VOgzWrFhc/lfgRy+oL2qtO7FPnxF6ixKKkyDzcQVzvZgv8OWlSt kez1+T2DlWex30iPXSc8mUPXavH+71boLZXmrUJEh7ntNMH/QTV0vOraB/QnRtdOs7/IuLMYHsOs v4= X-UI-Out-Filterresults: notjunk:1;V03:K0:puRfiStQT90=:bnD6OlSFSSSl+8Mr4vTKvY XfyvGMDZ/96fh0mI40bMVCLQs5JHReBn/PmfiedvHnEZAIi9nKwxl2T4dXD2YdGLqzZMK+r/I jV/Ca1QDBGi3BC+rjMevTkSKAau8j5GEtSXmGL0IWN2khGkFexLqvPvIMbQhnR0ipWQtsT3LW I4C7Y9FTRpCp4M13JGjPgfG/VC3TUkcG5o4phH72YIZikxnzBjbReKbqplp20LmTah8GwKOoS Q/L7L4vEPp0ufYSp/iawzhTaLo5J73HvbWmdlBr9dUigmmYJKVk8O3Ub59Y3oMNkW+BSnZMYX HLvY4L5pH0f6qqe4llnqwxxWc0PN2CiVBaZMTAgonIa5TnmQS8Fpk5KVC+zw/TWH3DqO5arwv dgn/6VnY1sVYRFe7m67rrUIaBZhct7h4yV5PyroPQrdvxTg36WFhuaIccvd9JKveoaoHucCJN r+jndG+qNC9LJR8eo4HzOfXpFQEf/PBmyq2hKGDroCdCPoMps8tX39od0oXPgl9IfPU6X6t6+ EukXJzPyiNnFF5kiqGr28Kt9boSLCk2hmo2LbWF5G2YTQmNPvLjX1+3gJiykO1bmKA5s6Kdsr Z0dTTRo3irJuQ= Received-SPF: pass client-ip=212.227.17.21; envelope-from=dimech@gmx.com; helo=mout.gmx.net X-Spam_score_int: -25 X-Spam_score: -2.6 X-Spam_bar: -- X-Spam_report: (-2.6 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-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:127670 Archived-At: I am working on crucible-supinf-enable, which currently does both font-lock-add-keywords and font-lock-unfontify-region-function And would like the functionality to enable or disable only supinf rather than disabling tex-keywords-cruc=2E tex-keywords-cruc turns tex keywords to a red colour=2E I want to have two functions, one to enable supinf, another to disable it= =2E > Sent: Tuesday, February 09, 2021 at 9:37 AM > From: "Emanuel Berg via Users list for the GNU Emacs text editor" > To: help-gnu-emacs@gnu=2Eorg > Subject: Re: Separating colour and positioning functioning > > Christopher Dimech wrote: >=20 > > Have written a minor mode with part of the the code below > > and want to modify tex-typeface-crucible so that the colour > > scheme is enabled when the minor-mode is on=2E >=20 > I got the following warnings from the byte compiler: >=20 > Warning: defface for =E2=80=98colour-tex-cruc=E2=80=99 fails to specif= y containing group > Warning: reference to free variable =E2=80=98crucible-supinf-enable=E2= =80=99 > Warning: reference to free variable =E2=80=98crucible-supinf-vshift=E2= =80=99 > Warning: reference to free variable =E2=80=98supinf-font-lock-cruc=E2= =80=99 >=20 > Style PO-lice: >=20 > > (defface colour-tex-cruc >=20 > US English is preferable, then it becomes consistent=2E The user > shouldn't have think, "is the programmer a 'bloke' or > a 'dude'?" =2E=2E=2E >=20 > > '( (default :inherit bold) > > ( ((class color) (min-colors 88) (background light)) > > :foreground "#FF0000" ) > > ( ((class color) (min-colors 88) (background dark)) > > :foreground "#FF0000") > > (t :inherit font-lock-builtin-face) ) > > "Typeface for tex keywords=2E") >=20 > Avoid hard-coding the same data (88 and "#FF0000") repeatedly=2E > Normally, the method is to use `let'=2E >=20 > > (defun supinf-disable-cruc (beg end) > > "Set typeface for text between BEG and END=2E" > > (font-lock-default-unfontify-region beg end) > > (while (< beg end) > > (let ((next (next-single-property-change beg 'display nil end)) > > (prop (get-text-property beg 'display))) > > (if (and (eq (car-safe prop) 'raise) >=20 > `if' -> `while' >=20 > > (member (car-safe (cdr prop)) crucible-supinf-vshift) > > (null (cddr prop))) > > (put-text-property beg next 'display nil)) > > (setq beg next)))) >=20 > This looks unorthodox but OK, I don't have a snappy answer > what to do instead=2E=2E=2E >=20 > > (defun tex-typeface-crucible () > > "Font-lock setup for mathematical symbols=2E" > > (font-lock-flush (point-min) (point-max)) >=20 > Is that the same as just (font-lock-flush) ? >=20 > > (if crucible-supinf-enable > > (progn > > (font-lock-add-keywords nil crucible-tex-keywords t) > > (font-lock-add-keywords nil supinf-font-lock-cruc t)) > > (font-lock-remove-keywords nil crucible-tex-keywords) > > (supinf-disable-cruc (point-min) (point-max))) > > (font-lock-flush (point-min) (point-max))) >=20 > Is that the same as =2E=2E=2E same=2E >=20 > --=20 > underground experts united > http://user=2Eit=2Euu=2Ese/~embe8573 > https://dataswamp=2Eorg/~incal >=20 >=20 >