From: <tomas@tuxteam.de>
To: emacs-devel@gnu.org
Subject: Re: prettify-symbols-mode to handle "\alpha-\beta" ...
Date: Thu, 4 Feb 2021 09:44:26 +0100 [thread overview]
Message-ID: <20210204084426.GA6944@tuxteam.de> (raw)
In-Reply-To: <trinity-95c33fa4-44aa-49af-86bc-7ece15b257b0-1612401882938@3c-app-mailcom-bs06>
[-- Attachment #1: Type: text/plain, Size: 2244 bytes --]
On Thu, Feb 04, 2021 at 02:24:42AM +0100, pietru@caramail.com wrote:
>
> I am using prettify-symbols-mode for displaying greek command using
> the corresponding greek glyph when using mathematical expressions
> in texinfo.
>
> Here is an example
>
> (push '("\\alpha" . ?α) prettify-symbols-alist)
> (push '("\\beta" . ?β) prettify-symbols-alist)
>
> This works well when using "\alpha\beta", "\alpha - \beta"
> 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.
>
> Would you be so kind to update "prettify-symbols-mode"
> so the substitutions can become possible to handle.
>
> 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 ‘lambda’ with the Greek lambda character
‘λ’. In a TeX buffer, it will replace ‘\alpha’
... ‘\omega’ 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
‘prettify-symbols-alist’. More elaborate customization is
available via customizing ‘prettify-symbols-compose-predicate’
if its default value ‘prettify-symbols-default-compose-p’
is not appropriate. There is also a global version,
‘global-prettify-symbols-mode’, 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 ‘prettify-symbols-unprettify-at-point’:
if non-‘nil’, 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
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 198 bytes --]
prev parent reply other threads:[~2021-02-04 8:44 UTC|newest]
Thread overview: 36+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-02-04 1:24 prettify-symbols-mode to handle "\alpha-\beta" pietru
2021-02-04 2:08 ` Óscar Fuentes
2021-02-04 3:03 ` pietru
2021-02-04 3:39 ` Óscar Fuentes
2021-02-04 3:46 ` Christopher Dimech
2021-02-04 3:51 ` pietru
2021-02-04 4:04 ` Stefan Monnier
2021-02-04 4:21 ` Christopher Dimech
2021-02-04 16:12 ` Stefan Monnier
2021-02-04 18:09 ` Christopher Dimech
2021-02-04 18:21 ` Stefan Monnier
2021-02-04 20:14 ` Christopher Dimech
2021-02-04 18:15 ` Christopher Dimech
2021-02-04 18:23 ` Stefan Monnier
2021-02-04 20:22 ` Christopher Dimech
2021-02-04 20:38 ` Stefan Monnier
2021-02-04 20:54 ` Christopher Dimech
2021-02-05 20:32 ` pietru
2021-02-05 21:01 ` Stefan Monnier
2021-02-05 21:05 ` Christopher Dimech
2021-02-05 21:54 ` Christopher Dimech
2021-02-05 21:57 ` Stefan Monnier
2021-02-05 22:09 ` Gregory Heytings
2021-02-05 22:22 ` pietru
2021-02-05 22:45 ` Gregory Heytings
2021-02-05 22:56 ` pietru
2021-02-05 23:04 ` Gregory Heytings
2021-02-05 23:15 ` pietru
2021-02-05 23:22 ` Gregory Heytings
2021-02-05 23:43 ` Christopher Dimech
2021-02-05 23:44 ` pietru
2021-02-06 0:05 ` pietru
2021-02-04 20:34 ` Christopher Dimech
2021-02-04 3:46 ` Ihor Radchenko
2021-02-04 3:59 ` Christopher Dimech
2021-02-04 8:44 ` tomas [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20210204084426.GA6944@tuxteam.de \
--to=tomas@tuxteam.de \
--cc=emacs-devel@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).