emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: prettify-symbols-mode to handle "\alpha-\beta" ...


From: Christopher Dimech
Subject: Re: prettify-symbols-mode to handle "\alpha-\beta" ...
Date: Thu, 4 Feb 2021 04:46:09 +0100

There could be a minor mode that one can use with texinfo-mode.

---------------------
Christopher Dimech
General Administrator - Naiad Informatics - GNU Project (Geocomputation)
- Geophysical Simulation
- Geological Subsurface Mapping
- Disaster Preparedness and Mitigation
- Natural Resource Exploration and Production
- Free Software Advocacy


> Sent: Thursday, February 04, 2021 at 3:39 PM
> From: "Óscar Fuentes" <ofv@wanadoo.es>
> To: emacs-devel@gnu.org
> Subject: Re: prettify-symbols-mode to handle "\alpha-\beta" ...
>
> pietru@caramail.com writes:
> 
> >> The docstring of prettify-symbols-alist says:
> >> 
> >>   Each element looks like (SYMBOL . CHARACTER), where the symbol
> >>   matching SYMBOL (a string, not a regexp) will be shown as CHARACTER
> >>   instead.
> >> 
> >> so no, SYMBOL *must* *not* be a regexp.
> >> 
> >> I can't reproduce the problem you are describing. After starting Emacs:
> >> 
> >> emacs -Q
> >> 
> >> if I evaluate this in *scratch*:
> >> 
> >>   (push '("\\alpha" . ?α) prettify-symbols-alist)
> >> 
> >> then open a .tex file, write \alpha_i, M-x prettify-symbols-alist, the
> >> string is transformed to α_i.
> >> 
> >> Please note that the definition of SYMBOL depends on the major mode of
> >> the buffer, so make sure that your current major mode is tex-mode.
> >> 
> >
> > No, the major mode is texinfo-mode.  Texinfo allows mathematics to be
> > displayed using the usual tex expressions.  Could this functionality
> > be put for use in texinfo-mode?
> 
> I missed the texinfo bit on your original message, sorry.
> 
> Supporting what you want would require either changing what texinfo
> considers a symbol or changing prettify-symbols-mode to work on
> something else instead of symbols.
> 
> Probably the easiest route for you is to derive a mode from texinfo-mode
> that modifies the syntax table defined in texinfo.el to suit your needs
> (see "Syntax Tables" in the Elisp manual).
> 
> If you insist on changing texinfo-mode itself, put those modifications
> on the mode's syntax table and submit the change to the Emacs
> maintainers, but my guess is that you will need to give pretty solid
> reasons for the change to be accepted, and then wait a long time until
> Emacs 28 is released and becomes widespread enough among your target
> users.
> 
> 
>



reply via email to

[Prev in Thread] Current Thread [Next in Thread]