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: Rainbow-delimiters highlighting { and } for tex and latex Date: Fri, 9 Sep 2022 22:13:33 +0200 Message-ID: References: <87wnae5aj4.fsf@gmail.com> <87k06e55im.fsf@gmail.com> <86sfl1vt1m.fsf@gnu.org> <86y1us5oij.fsf@gnu.org> 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="26240"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Alessandro Bertulli , Stefan Monnier , wilnerthomas@tutanota.com, help-gnu-emacs@gnu.org To: Arash Esbati Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Fri Sep 09 22:15:05 2022 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 1oWkP3-0006fA-Qj for geh-help-gnu-emacs@m.gmane-mx.org; Fri, 09 Sep 2022 22:15:05 +0200 Original-Received: from localhost ([::1]:33534 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oWkP2-0007Eg-DN for geh-help-gnu-emacs@m.gmane-mx.org; Fri, 09 Sep 2022 16:15:04 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:34414) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oWkNl-0006lj-Fo for help-gnu-emacs@gnu.org; Fri, 09 Sep 2022 16:13:45 -0400 Original-Received: from mout.gmx.net ([212.227.17.22]:36725) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oWkNf-0006EK-Ny; Fri, 09 Sep 2022 16:13:45 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1662754413; bh=URGssbGHgUeVO+JV5ayO358QWucVBPecEGbJrJ8jMPI=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date:In-Reply-To:References; b=BZmO1AttQvZ+Xez5xn1oQfEtVnGMFlQKNxeWM2Gv/WZ5oYnw81/2ll/Y2oGfIIRdm 0PdSVWaAI//MFV3YTvTHKl1mbMZ6l92jr2xFPZRdXj5rjfNrCQU/IcIKSwSpWqKFY1 m1PY4Abd1kz48kQiEtnO5XH3WyloSwbUiaS9yWYQ= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Original-Received: from [92.251.127.164] ([92.251.127.164]) by web-mail.gmx.net (3c-app-mailcom-bs02.server.lan [172.19.170.129]) (via HTTP); Fri, 9 Sep 2022 22:13:33 +0200 Importance: normal Sensitivity: Normal In-Reply-To: <86y1us5oij.fsf@gnu.org> X-UI-Message-Type: mail X-Priority: 3 X-Provags-ID: V03:K1:jRrwsefRt1/55nSBPvYjPpNvL5w/rMFQw29HDAJbc9CDWItIMxN7I2VoSyuwkNmP64TWp 6ijbq57u7XIy52G+lL33c33PBXSwS9fisxfxqKyztujsCAe07B9pFMQ0LD1fmBjWqVuIMaJnysoP MSjh1nFypWSEqreEEISqlfICt5iy49muasYzf/eFO2PV+kKCfp5yEwrim+UinnSSgax2+ml2DSxt oX2ARaTDgkOWQ/K2iBm9l1wSXeilXj7s6U+xU4uDveWU4JtZo22A57mPtjA75S2gKzjiEwMblx+r KA= X-UI-Out-Filterresults: notjunk:1;V03:K0:sZ2yQyC5kks=:1sfwy/6YInWyH1STfyp88S oJQWzkBl+CykacejWSR6Rf+Vy7zST2VUrjjAbWJeDICGBapbiF1SZupwIDjsPHkPJcWs+SY2B XOh0pI4uAuRpO2xpClMMSUrMYasU/dmm6SyE1ErPIAqKn8vTcEuilfYT9lbRYKO0dn/NWKXa4 G2VFqFvupqHBmmvgoF5oiFZr4maxnkWJAOdP4rqVvcYj7U/NNQPWFcoHsA32d9jt2mP3XK+4k NWiWw6+3LUbs5Ot57EWwifZ8mGKko/Nml5Xv/HDZ2Bgwx4UfSXpuLUacrAVCme6kV0vwJbJ2r 1hFmu6d0pmZQ+4w37KwQ/XwGDHrpGWAO7be8AEdkCt7jTgIXkvgEzBrqjL4iM0EIfqElgc9Ub KeavZWBzjlsySwnicNSfXqoPUVo1a8UpTEIhx1FPvofYq86xhmzQOdtL4+IO/MjheIU0PTTp3 LQl8glEKeH/3jHmJbN2necmBzCOhzorkj4ufmlBIBxGNfwilGgNnTGs5ILNkoNDSWZOSMOyyd 3E87cSKZOcbEbGo4aOGJVfTJy0vZpeb21VeaupW/1nwo2jJwTkL9Q2B0gVAzoC/lPF/hrAOB2 p5XL2dcAUIBX91SObU/xtHeMsAzVgYFd37lliOBwimE5BjjFxn4VF0VH3icCKtbkFZ7jrvkKA 7iV0CVzU+gCVBc3Y0k5RyfrZ6p8o01/7EZgIHOX8KS4ZmIsi8tuz/yCfpjtQ2EJfHUItfiR/B +pGfRV/BwtgF+EqsHv+bV6SsA2HoYwSOOsw8jJEzkNxrYlnj7qa1HEt+VmtUwhrVfwKulYno Received-SPF: pass client-ip=212.227.17.22; 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, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.29 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:139348 Archived-At: > Sent: Saturday, September 10, 2022 at 7:36 AM > From: "Arash Esbati" > To: "Christopher Dimech" > Cc: "Alessandro Bertulli" , "Stefan Mon= nier" , wilnerthomas@tutanota.com, help-gnu-emac= s@gnu.org > Subject: Re: Rainbow-delimiters highlighting { and } for tex and latex > > Christopher Dimech writes: > > > For instance, tex-mode and latex-mode do provide a preview tool that u= ses > > "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 wit= hout 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 structur= es > > are separated into a "core-file" applicable to both, with some mino= r > > 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 whet= her > > 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 >