From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Newsgroups: gmane.emacs.devel Subject: Re: prettify-symbols-mode to handle "\alpha-\beta" ... Date: Thu, 4 Feb 2021 09:44:26 +0100 Message-ID: <20210204084426.GA6944@tuxteam.de> References: Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="YZ5djTAD1cGYuMQK" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="761"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mutt/1.5.21 (2010-09-15) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Thu Feb 04 09:48:25 2021 Return-path: Envelope-to: ged-emacs-devel@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 1l7aJM-00006W-Sp for ged-emacs-devel@m.gmane-mx.org; Thu, 04 Feb 2021 09:48:24 +0100 Original-Received: from localhost ([::1]:48680 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l7aJL-0008Fn-UI for ged-emacs-devel@m.gmane-mx.org; Thu, 04 Feb 2021 03:48:23 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:34082) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l7aFj-0006V8-Ph for emacs-devel@gnu.org; Thu, 04 Feb 2021 03:44:39 -0500 Original-Received: from mail.tuxteam.de ([5.199.139.25]:37891) by eggs.gnu.org with esmtps (TLS1.2:DHE_RSA_AES_128_CBC_SHA1:128) (Exim 4.90_1) (envelope-from ) id 1l7aFh-00006V-A2 for emacs-devel@gnu.org; Thu, 04 Feb 2021 03:44:39 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=tuxteam.de; s=mail; h=From:In-Reply-To:Content-Type:MIME-Version:References:Message-ID:Subject:To:Date; bh=L5c/HiFZaLf8BuytYMyH91BxdpLzEHGzJVC6YIIKlrA=; b=TwKguwbBHn1cuFzrnE6HfKQgfjCj8Un9/l+2ySap5AhNvIuR6MBkCC3CpRc+O99Chm/ygZiEQMd4D3a8QURjJ9FW1LZRLtfhUJaz+1TYkXTj/QEIdPQEk6TQXlpV+HOsECPinBFxflNz8id35Qg07EcM6wMtgdvFuHd1jhefwHlfVkqjnFpN0RWeB2FPD/Uk0nDSBzk63FHQ2eFZS+NJQk0whmyBIEwcSeLznzNkT0Ou1jsfOWuPNwBi59eJxzkhHaKxD+BSkK7DJfRK+0cxOASKSqgopnzK5gnOAInaHgd2XTu5dNiATYbLMNFkAKR3EqjDtXxl9e1Dthnd4L2jig==; Original-Received: from tomas by mail.tuxteam.de with local (Exim 4.80) (envelope-from ) id 1l7aFW-000200-LH for emacs-devel@gnu.org; Thu, 04 Feb 2021 09:44:26 +0100 Content-Disposition: inline In-Reply-To: Received-SPF: pass client-ip=5.199.139.25; envelope-from=tomas@tuxteam.de; helo=mail.tuxteam.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, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:263858 Archived-At: --YZ5djTAD1cGYuMQK Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Feb 04, 2021 at 02:24:42AM +0100, pietru@caramail.com wrote: >=20 > I am using prettify-symbols-mode for displaying greek command using > the corresponding greek glyph when using mathematical expressions > in texinfo. >=20 > Here is an example >=20 > (push '("\\alpha" . ?=CE=B1) prettify-symbols-alist) > (push '("\\beta" . ?=CE=B2) prettify-symbols-alist) >=20 > This works well when using "\alpha\beta", "\alpha - \beta"=20 > But the expression fails when using "\alpha-\beta" or > "\alpha_i", "\alpha_{ij}", "\beta^i", "\beta+\alpha". > The expressions are all valid mathematical expressions > when using tex. =20 >=20 > Would you be so kind to update "prettify-symbols-mode" > so the substitutions can become possible to handle. >=20 > Does this require that SYMBOL in (SYMBOL . CHARACTER) be > a regexp? Quoth the doc, "26.11 Other Features Useful for Editing Programs": "Prettify Symbols mode is a buffer-local minor mode that replaces certain strings with more attractive versions for display purposes. For example, in Emacs Lisp mode, it replaces the string =E2=80=98lambda=E2=80=99 with the Greek lambda character =E2=80=98=CE=BB=E2=80=99. In a TeX buffer, it will replace =E2=80=98\al= pha=E2=80=99 ... =E2=80=98\omega=E2=80=99 and other math macros with their Unicode characters. You may wish to use this in non-programming modes as well. You can customize the mode by adding more entries to =E2=80=98prettify-symbols-alist=E2=80=99. More elaborate customization = is available via customizing =E2=80=98prettify-symbols-compose-predicate=E2= =80=99 if its default value =E2=80=98prettify-symbols-default-compose-p=E2=80=99 is not appropriate. There is also a global version, =E2=80=98global-prettify-symbols-mode=E2=80=99, which enables the mode in all buffers that support it. The symbol at point can be shown in its original form. This is controlled by the variable =E2=80=98prettify-symbols-unprettify-at-point= =E2=80=99: if non-=E2=80=98nil=E2=80=99, the original form of symbol at point will = be restored for as long as point is at it." So I'd look around the variable's docstrings (C-h v) of - prettify-symbols-alist (this you already know) - prettify-symbols-compose-predicate This might answer (at least part of) your questions. Cheers - t --YZ5djTAD1cGYuMQK Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.12 (GNU/Linux) iEYEARECAAYFAmAbs+oACgkQBcgs9XrR2kaCCwCfWOKX0fudf9FU0whGW6lIDOHB 15QAoIHRdCD8mly1H7mnZKJ8e6Fidr/3 =2FDC -----END PGP SIGNATURE----- --YZ5djTAD1cGYuMQK--