From: Christopher Dimech <dimech@gmx.com>
To: Arash Esbati <arash@gnu.org>
Cc: Alessandro Bertulli <alessandro.bertulli96@gmail.com>,
Stefan Monnier <monnier@iro.umontreal.ca>,
wilnerthomas@tutanota.com, help-gnu-emacs@gnu.org
Subject: Re: Rainbow-delimiters highlighting { and } for tex and latex
Date: Fri, 9 Sep 2022 22:13:33 +0200 [thread overview]
Message-ID: <trinity-e057e44e-9a89-4246-9dee-fe71861c361a-1662754413546@3c-app-mailcom-bs02> (raw)
In-Reply-To: <86y1us5oij.fsf@gnu.org>
> Sent: Saturday, September 10, 2022 at 7:36 AM
> From: "Arash Esbati" <arash@gnu.org>
> To: "Christopher Dimech" <dimech@gmx.com>
> Cc: "Alessandro Bertulli" <alessandro.bertulli96@gmail.com>, "Stefan Monnier" <monnier@iro.umontreal.ca>, wilnerthomas@tutanota.com, help-gnu-emacs@gnu.org
> Subject: Re: Rainbow-delimiters highlighting { and } for tex and latex
>
> Christopher Dimech <dimech@gmx.com> writes:
>
> > For instance, tex-mode and latex-mode do provide a preview tool that uses
> > "prettify-symbols".
>
> I don't understand how the sentence above fits to the next one. The
> feature "prettify-symbols" is there and working, so what do you want to
> change?
Mentioning `prettify-symbols` was not necessarily about changing it,
but an argument in favour of valuable functionality, because there
is also the school of thought stating that built-in tex-mode and
latex-mode should only implement the most basic functionality (e.g.
language highlighting) rather than including convenient tools such as
typography previewing and keyword shortcuts (e.g. cdlatex).
I am more pragmatic, seeing typography previewing and keyword shortcuts
as valuable even for a basic core tex and latex mode.
But not extreme, in the sense that Auctex can continue as a package
for additional functionality.
> > Being able to introduce keywords rapidly (more efficiently than can be
> > achieved with text completion) is also valuable for users, currently
> > provided by cdlatex. The problem with cdlatex is that it also depends
> > upon texmathp which currently forces users to either pick the file and
> > add it to their emacs configuration or install auctex. Which
> > immediately makes the various CamelCase version of modes and hooks
> > come up.
>
> This is admittedly a nuisance: If you want to use the stock tex-mode
> with cdlatex and you install AUCTeX via ELPA, AUCTeX will take over.
> Maybe the solution is to provide texmathp.el as an ELPA-package without
> AUCTeX.
It is the plan to provide keyword shortcuts to tex-mode and latex-mode without
a built-in mechanism (taking code from texmathp.el or otherwise).
I do not approve that auctex should automatically take over. On the
contrary, auctex is a separate project, and in accordance with that,
a user should specify whether he wants to hook with the emacs built-in
or with the auctex ones (e.g. auctex-tex-mode, auctex-latex-mode,
auctex-tex-mode-hook, auctex-latex-mode-hook). Consequently one can
simultaneously allow some files to use latex-mode, whilst others can use
auctex-latex-mode.
> > The cdlatex functionality can be introduced into tex-mode and
> > latex-mode. Getting the community to improve it would be highly
> > beneficial if the possibilities are included as emacs built-in.
>
> You want to duplicate the code and/or functionality?
Duplicate the functionality, although we can duplicate the code
because its author Carsten Dominik allows us. We can then return
him a cleaned-up version that he can progress further if he wants
as a separate project.
> > Auctex and Cdlatex could continue seperately, for more exotic features
> > like as today.
>
> I can't tell for cdlatex since I've never used it, but I don't consider
> many features provided by AUCTeX as exotic.
>
> > For auctex, the recommendation is to reject TeX-mode and LaTeX-mode
> > (and related hooks), using instead auctex-tex-mode and
> > auctex-latex-mode (and corresponding hooks).
>
> Personally, I think that ship has sailed; one could define some aliases,
> but I'm not sure if that is going towards a replacement.
I do not see it would be a big challenge with users to simply change to
auctex-tex-mode and auctex-latex-mode. We can keep them for a while, but
they stop taking over all tex and latex files when one wants to use latex-mode.
> > In summary, the focus is on these things
> >
> > 1. Improve design of tex-mode and latex-mode such that common structures
> > are separated into a "core-file" applicable to both, with some minor
> > tweaks in tex-mode and latex-mode if requires.
>
> This is what AUCTeX does with tex.el and plain-tex.el, latex.el,
> context.el etc.
Right, we should do the same with the built-in tex-mode which mixes
the tools fol tex and latex in the same file.
> > 2. Reevaluate the preview tool that uses prettify-symbols, to see whether
> > there exists possibility of improvement by looking how auctex does
> > things.
>
> AUCTeX is really dumb in this regard. From tex.el:
If auctex is not doing anything smarter that what we have with
tex-mode and latex-mode, then we are good.
> ;; Prettify Symbols mode
> (require 'tex-mode)
> (setq-local prettify-symbols-alist tex--prettify-symbols-alist)
> (add-function :override (local 'prettify-symbols-compose-predicate)
> #'TeX--prettify-symbols-compose-p)
>
> and
>
> (defun TeX--prettify-symbols-compose-p (start end match)
> (and (tex--prettify-symbols-compose-p start end match)
> (not (let ((face (get-text-property end 'face)))
> (if (consp face)
> (memq 'font-latex-verbatim-face face)
> (eq face 'font-latex-verbatim-face))))))
>
> Best, Arash
>
next prev parent reply other threads:[~2022-09-09 20:13 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-09-07 11:07 Rainbow-delimiters highlighting { and } for tex and latex wilnerthomas--- via Users list for the GNU Emacs text editor
2022-09-07 13:01 ` Stefan Monnier via Users list for the GNU Emacs text editor
2022-09-07 13:10 ` wilnerthomas--- via Users list for the GNU Emacs text editor
2022-09-07 13:14 ` Stefan Monnier via Users list for the GNU Emacs text editor
2022-09-07 13:23 ` wilnerthomas--- via Users list for the GNU Emacs text editor
2022-09-07 13:34 ` Stefan Monnier
2022-09-07 19:29 ` Christopher Dimech
2022-09-08 4:13 ` tomas
2022-09-08 10:13 ` Christopher Dimech
2022-09-08 12:08 ` Alessandro Bertulli
2022-09-08 13:25 ` Christopher Dimech
2022-09-08 13:58 ` Alessandro Bertulli
2022-09-08 15:02 ` Christopher Dimech
2022-09-08 15:04 ` Alessandro Bertulli
2022-09-09 8:41 ` Arash Esbati
2022-09-09 12:33 ` Christopher Dimech
2022-09-09 19:36 ` Arash Esbati
2022-09-09 20:13 ` Christopher Dimech [this message]
2022-09-09 20:45 ` Christopher Dimech
[not found] ` <jwvleqvmhqj.fsf-monnier+emacs@gnu.org-NBNA5jg----2>
2022-09-07 15:03 ` wilnerthomas--- via Users list for the GNU Emacs text editor
2022-09-07 15:16 ` tomas
2022-09-07 15:29 ` wilnerthomas--- via Users list for the GNU Emacs text editor
2022-09-07 15:59 ` tomas
2022-09-07 16:43 ` Stefan Monnier
[not found] ` <jwvczc7b0jf.fsf-monnier+emacs@gnu.org-NBNqAf0----2>
2022-09-08 10:35 ` wilnerthomas--- via Users list for the GNU Emacs text editor
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=trinity-e057e44e-9a89-4246-9dee-fe71861c361a-1662754413546@3c-app-mailcom-bs02 \
--to=dimech@gmx.com \
--cc=alessandro.bertulli96@gmail.com \
--cc=arash@gnu.org \
--cc=help-gnu-emacs@gnu.org \
--cc=monnier@iro.umontreal.ca \
--cc=wilnerthomas@tutanota.com \
/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.
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).