* Rainbow-delimiters highlighting { and } for tex and latex @ 2022-09-07 11:07 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 0 siblings, 1 reply; 25+ messages in thread From: wilnerthomas--- via Users list for the GNU Emacs text editor @ 2022-09-07 11:07 UTC (permalink / raw) To: Help Gnu Emacs With elisp I have seen the package rainbow-delimiters, and would like to have the same thing for "tex" and "latex", but this time highlighting beginning "{" and ending "}". ^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: Rainbow-delimiters highlighting { and } for tex and latex 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 0 siblings, 1 reply; 25+ messages in thread From: Stefan Monnier via Users list for the GNU Emacs text editor @ 2022-09-07 13:01 UTC (permalink / raw) To: help-gnu-emacs wilnerthomas--- via Users list for the GNU Emacs text editor [2022-09-07 13:07:15] wrote: > With elisp I have seen the package rainbow-delimiters, and would like to > have the same thing for "tex" and "latex", but this time highlighting > beginning "{" and ending "}". I hear there's a package called `rainbow-delimiters` for that :-) Stefan ^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: Rainbow-delimiters highlighting { and } for tex and latex 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 0 siblings, 1 reply; 25+ messages in thread From: wilnerthomas--- via Users list for the GNU Emacs text editor @ 2022-09-07 13:10 UTC (permalink / raw) To: Stefan Monnier; +Cc: help-gnu-emacs Sep 7, 2022, 13:01 by help-gnu-emacs@gnu.org: > wilnerthomas--- via Users list for the GNU Emacs text editor [2022-09-07 13:07:15] wrote: > >> With elisp I have seen the package rainbow-delimiters, and would like to >> have the same thing for "tex" and "latex", but this time highlighting >> beginning "{" and ending "}". >> > > I hear there's a package called `rainbow-delimiters` for that :-) > Stefan, you are right. But it handles only lisp commands, colouring initial "(" and final ")". But not for highlighting "{" and "}" for "tex" and "latex". ^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: Rainbow-delimiters highlighting { and } for tex and latex 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 0 siblings, 1 reply; 25+ messages in thread From: Stefan Monnier via Users list for the GNU Emacs text editor @ 2022-09-07 13:14 UTC (permalink / raw) To: help-gnu-emacs > Stefan, you are right. But it handles only lisp commands, colouring > initial "(" and final ")". But > not for highlighting "{" and "}" for "tex" and "latex". That is not my experience (from a few seconds before sending my previous message). Stefan ^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: Rainbow-delimiters highlighting { and } for tex and latex 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 [not found] ` <jwvleqvmhqj.fsf-monnier+emacs@gnu.org-NBNA5jg----2> 0 siblings, 2 replies; 25+ messages in thread From: wilnerthomas--- via Users list for the GNU Emacs text editor @ 2022-09-07 13:23 UTC (permalink / raw) To: Stefan Monnier; +Cc: help-gnu-emacs Sep 7, 2022, 13:14 by help-gnu-emacs@gnu.org: >> Stefan, you are right. But it handles only lisp commands, colouring >> initial "(" and final ")". But >> not for highlighting "{" and "}" for "tex" and "latex". >> > > That is not my experience (from a few seconds before sending my > previous message). > What do I have to do exactly? ^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: Rainbow-delimiters highlighting { and } for tex and latex 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 [not found] ` <jwvleqvmhqj.fsf-monnier+emacs@gnu.org-NBNA5jg----2> 1 sibling, 1 reply; 25+ messages in thread From: Stefan Monnier @ 2022-09-07 13:34 UTC (permalink / raw) To: wilnerthomas; +Cc: help-gnu-emacs wilnerthomas@tutanota.com [2022-09-07 15:23:57] wrote: > Sep 7, 2022, 13:14 by help-gnu-emacs@gnu.org: >>> Stefan, you are right. But it handles only lisp commands, colouring >>> initial "(" and final ")". But >>> not for highlighting "{" and "}" for "tex" and "latex". >>> >> >> That is not my experience (from a few seconds before sending my >> previous message). >> > What do I have to do exactly? I don't know. For me it just works (I don't use rainbow-delimiters, I simply turned it on to double-check my intuition before replying to you, and it worked for (..), {..} and [..] in a `latex-mode` buffer). Stefan ^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: Rainbow-delimiters highlighting { and } for tex and latex 2022-09-07 13:34 ` Stefan Monnier @ 2022-09-07 19:29 ` Christopher Dimech 2022-09-08 4:13 ` tomas 2022-09-08 12:08 ` Alessandro Bertulli 0 siblings, 2 replies; 25+ messages in thread From: Christopher Dimech @ 2022-09-07 19:29 UTC (permalink / raw) To: Stefan Monnier; +Cc: wilnerthomas, help-gnu-emacs > Sent: Thursday, September 08, 2022 at 1:34 AM > From: "Stefan Monnier" <monnier@iro.umontreal.ca> > To: wilnerthomas@tutanota.com > Cc: help-gnu-emacs@gnu.org > Subject: Re: Rainbow-delimiters highlighting { and } for tex and latex > > wilnerthomas@tutanota.com [2022-09-07 15:23:57] wrote: > > Sep 7, 2022, 13:14 by help-gnu-emacs@gnu.org: > >>> Stefan, you are right. But it handles only lisp commands, colouring > >>> initial "(" and final ")". But > >>> not for highlighting "{" and "}" for "tex" and "latex". > >>> > >> > >> That is not my experience (from a few seconds before sending my > >> previous message). > >> > > What do I have to do exactly? > > I don't know. For me it just works (I don't use rainbow-delimiters, > I simply turned it on to double-check my intuition before replying to > you, and it worked for (..), {..} and [..] in a `latex-mode` buffer). > > > Stefan Have scrutinised this. The problem is the atrocious design around the implementation of tex and latex major modes. This will work (add-to-list 'auto-mode-alist '("\\.sty\\'" . LaTeX-mode)) (add-hook 'LaTeX-mode-hook #'rainbow-delimiters-mode) But this will not (add-to-list 'auto-mode-alist '("\\.sty\\'" . latex-mode)) (add-hook 'latex-mode-hook #'rainbow-delimiters-mode) Work needs to be done so that there is just "tex-mode" and "latex-mode", and getting rid with all this TeX-mode", "LaTeX-mode", TeX-mode-hook, LaTeX-mode-hook, nonsense. Tools are supposed to work well together but this is not the case with "tex-related" modes. ^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: Rainbow-delimiters highlighting { and } for tex and latex 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 1 sibling, 1 reply; 25+ messages in thread From: tomas @ 2022-09-08 4:13 UTC (permalink / raw) To: help-gnu-emacs [-- Attachment #1: Type: text/plain, Size: 231 bytes --] On Wed, Sep 07, 2022 at 09:29:13PM +0200, Christopher Dimech wrote: [...] > [...] The problem is the atrocious design around the implementation > of tex and latex major modes. Always so friendly and cheerful. -- t [-- Attachment #2: signature.asc --] [-- Type: application/pgp-signature, Size: 195 bytes --] ^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: Rainbow-delimiters highlighting { and } for tex and latex 2022-09-08 4:13 ` tomas @ 2022-09-08 10:13 ` Christopher Dimech 0 siblings, 0 replies; 25+ messages in thread From: Christopher Dimech @ 2022-09-08 10:13 UTC (permalink / raw) To: tomas; +Cc: help-gnu-emacs > Sent: Thursday, September 08, 2022 at 4:13 PM > From: tomas@tuxteam.de > To: help-gnu-emacs@gnu.org > Subject: Re: Rainbow-delimiters highlighting { and } for tex and latex > > On Wed, Sep 07, 2022 at 09:29:13PM +0200, Christopher Dimech wrote: > > [...] > > > [...] The problem is the atrocious design around the implementation > > of tex and latex major modes. > > Always so friendly and cheerful. Let's say nobody knew how to swim in the world. Suddenly one man jumped into the river and swam across. Would it look magical and devine? One hundred percent. Working with a little bit of sense, not absolute sense, just a little sense is looking magical to you. You can imagine what sort of atmosphere many would be living in. People here are not perfect but are striving to be better. My effort is just to provide people methods with which we can make what we do a sophisticated technology for people to be able to work magically. I could invite you over sometime with the chance of fulfilling some expectations. And if they don't happen, who the hell cares anyway. Would that be more reasonable? Felicitations Christopher, Kristof, or whatever you want ^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: Rainbow-delimiters highlighting { and } for tex and latex 2022-09-07 19:29 ` Christopher Dimech 2022-09-08 4:13 ` tomas @ 2022-09-08 12:08 ` Alessandro Bertulli 2022-09-08 13:25 ` Christopher Dimech 1 sibling, 1 reply; 25+ messages in thread From: Alessandro Bertulli @ 2022-09-08 12:08 UTC (permalink / raw) To: Christopher Dimech; +Cc: Stefan Monnier, wilnerthomas, help-gnu-emacs > Have scrutinised this. The problem is the atrocious design around the implementation > of tex and latex major modes. > > This will work > > (add-to-list 'auto-mode-alist '("\\.sty\\'" . LaTeX-mode)) > (add-hook 'LaTeX-mode-hook #'rainbow-delimiters-mode) > > But this will not > > (add-to-list 'auto-mode-alist '("\\.sty\\'" . latex-mode)) > (add-hook 'latex-mode-hook #'rainbow-delimiters-mode) I don't want to add more fuel, but just to clear a bit: latex-mode and tex-mode are the modes set up by vanilla Emacs. AUCTeX, which is an awesome package to provide a quick yet powerful LaTeX IDE in Emacs, provides LaTeX-mode and TeX-mode (note the capitalization). Is it confusing? Unfortunately, yes it is. > Work needs to be done so that there is just "tex-mode" and "latex-mode", > and getting rid with all this TeX-mode", "LaTeX-mode", TeX-mode-hook, > LaTeX-mode-hook, nonsense. I agree, but I guess the point is to not break compatibility with old codebases. I wonder if defining some aliases would work tho. > Tools are supposed to work well together but this is not the case with > "tex-related" modes. Actually they do, once corrected this thing. Probably you have auto-mode-alist set up so that .tex/.sty files are opened in LaTeX-mode, so latex-mode-hook is never actually run. Is this your problem, maybe? Anyway, I'm glad you got it work. -- Alessandro Bertulli ^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: Rainbow-delimiters highlighting { and } for tex and latex 2022-09-08 12:08 ` Alessandro Bertulli @ 2022-09-08 13:25 ` Christopher Dimech 2022-09-08 13:58 ` Alessandro Bertulli 0 siblings, 1 reply; 25+ messages in thread From: Christopher Dimech @ 2022-09-08 13:25 UTC (permalink / raw) To: Alessandro Bertulli; +Cc: Stefan Monnier, wilnerthomas, help-gnu-emacs > Sent: Friday, September 09, 2022 at 12:08 AM > From: "Alessandro Bertulli" <alessandro.bertulli96@gmail.com> > To: "Christopher Dimech" <dimech@gmx.com> > Cc: "Stefan Monnier" <monnier@iro.umontreal.ca>, wilnerthomas@tutanota.com, help-gnu-emacs@gnu.org > Subject: Re: Rainbow-delimiters highlighting { and } for tex and latex > > > > Have scrutinised this. The problem is the atrocious design around the implementation > > of tex and latex major modes. > > > > This will work > > > > (add-to-list 'auto-mode-alist '("\\.sty\\'" . LaTeX-mode)) > > (add-hook 'LaTeX-mode-hook #'rainbow-delimiters-mode) > > > > But this will not > > > > (add-to-list 'auto-mode-alist '("\\.sty\\'" . latex-mode)) > > (add-hook 'latex-mode-hook #'rainbow-delimiters-mode) > > I don't want to add more fuel, but just to clear a bit: latex-mode and > tex-mode are the modes set up by vanilla Emacs. AUCTeX, which is an > awesome package to provide a quick yet powerful LaTeX IDE in Emacs, > provides LaTeX-mode and TeX-mode (note the capitalization). Is it > confusing? Unfortunately, yes it is. The plan would be to integrate the functionality of AUCTeX into tex-mode and latex-mode, even though there can be a core AUCTeX file. The problems associated with the separate functionality has been discussed with Carsten Dominik about his "cdlatex" rapid tools. There is agreement on the need for thinking a new scheme through. > > Work needs to be done so that there is just "tex-mode" and "latex-mode", > > and getting rid with all this TeX-mode", "LaTeX-mode", TeX-mode-hook, > > LaTeX-mode-hook, nonsense. > > I agree, but I guess the point is to not break compatibility with old > codebases. I wonder if defining some aliases would work tho. I would say that users expect emacs to honour the contents of auto-mode-alist. > > Tools are supposed to work well together but this is not the case with > > "tex-related" modes. > > Actually they do, once corrected this thing. Probably you have > auto-mode-alist set up so that .tex/.sty files are opened in LaTeX-mode, > so latex-mode-hook is never actually run. Is this your problem, maybe? > Anyway, I'm glad you got it work. > > -- > Alessandro Bertulli There is a solution but is very time consuming to realise what is happening. Especially for users who rely on many tools and packages. ^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: Rainbow-delimiters highlighting { and } for tex and latex 2022-09-08 13:25 ` Christopher Dimech @ 2022-09-08 13:58 ` Alessandro Bertulli 2022-09-08 15:02 ` Christopher Dimech 0 siblings, 1 reply; 25+ messages in thread From: Alessandro Bertulli @ 2022-09-08 13:58 UTC (permalink / raw) To: Christopher Dimech; +Cc: Stefan Monnier, wilnerthomas, help-gnu-emacs Christopher Dimech <dimech@gmx.com> writes: > The plan would be to integrate the functionality of AUCTeX into tex-mode > and latex-mode, even though there can be a core AUCTeX file. The problems > associated with the separate functionality has been discussed with Carsten > Dominik about his "cdlatex" rapid tools. There is agreement on the need > for thinking a new scheme through. Do you mind providing a quick recap? Is cdlatex going to become part of AUCTeX? Or vanilla Emacs? >> I agree, but I guess the point is to not break compatibility with old >> codebases. I wonder if defining some aliases would work tho. > > I would say that users expect emacs to honour the contents of auto-mode-alist. Wait, what do you mean? Maybe I haven't made myself clear: I was thinking of defining an alias, say, `auctex-mode`, so that configuration for it can be easily tell apart from latex-mode. Actually, I don't know, is it possible to do so in Emacs-lisp? > There is a solution but is very time consuming to realise what is happening. > Especially for users who rely on many tools and packages. You meank, a solution to this specific problem, or a solution to the naming confusion? -- Alessandro Bertulli ^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: Rainbow-delimiters highlighting { and } for tex and latex 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 0 siblings, 2 replies; 25+ messages in thread From: Christopher Dimech @ 2022-09-08 15:02 UTC (permalink / raw) To: Alessandro Bertulli; +Cc: Stefan Monnier, wilnerthomas, help-gnu-emacs > Sent: Friday, September 09, 2022 at 1:58 AM > From: "Alessandro Bertulli" <alessandro.bertulli96@gmail.com> > To: "Christopher Dimech" <dimech@gmx.com> > Cc: "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: > > > The plan would be to integrate the functionality of AUCTeX into tex-mode > > and latex-mode, even though there can be a core AUCTeX file. The problems > > associated with the separate functionality has been discussed with Carsten > > Dominik about his "cdlatex" rapid tools. There is agreement on the need > > for thinking a new scheme through. > > Do you mind providing a quick recap? Is cdlatex going to become part of > AUCTeX? Or vanilla Emacs? In summary, to take out the emacs setup away from cdlatex and auctex, and make a self consistent package that removes the current dependencies. Then either incorporate in tex-mode and latex-mode, or have a switch that enables extended tools found in auctex and cdlatex. > >> I agree, but I guess the point is to not break compatibility with old > >> codebases. I wonder if defining some aliases would work tho. > > > > I would say that users expect emacs to honour the contents of auto-mode-alist. > > Wait, what do you mean? Maybe I haven't made myself clear: I was > thinking of defining an alias, say, `auctex-mode`, so that configuration > for it can be easily tell apart from latex-mode. Actually, I don't know, > is it possible to do so in Emacs-lisp? As all these tools are part of Gnu, it would be more suitable to integrate all the tex and latex functionality in simple way within emacs. Other major modes do not work in confusing ways like tex and latex. There is good functionality in the auctex and cdlatex modes for emacs that a least the core should be put in just a single mode. > > There is a solution but is very time consuming to realise what is happening. > > Especially for users who rely on many tools and packages. > > You meank, a solution to this specific problem, or a solution to the > naming confusion? A solution to the naming confusion as it is not quite clear what emacs does behind the scenes if you are a user. ^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: Rainbow-delimiters highlighting { and } for tex and latex 2022-09-08 15:02 ` Christopher Dimech @ 2022-09-08 15:04 ` Alessandro Bertulli 2022-09-09 8:41 ` Arash Esbati 1 sibling, 0 replies; 25+ messages in thread From: Alessandro Bertulli @ 2022-09-08 15:04 UTC (permalink / raw) To: Christopher Dimech; +Cc: Stefan Monnier, wilnerthomas, help-gnu-emacs Got it, thanks 👍 -- Alessandro Bertulli ^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: Rainbow-delimiters highlighting { and } for tex and latex 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 1 sibling, 1 reply; 25+ messages in thread From: Arash Esbati @ 2022-09-09 8:41 UTC (permalink / raw) To: Christopher Dimech Cc: Alessandro Bertulli, Stefan Monnier, wilnerthomas, help-gnu-emacs Christopher Dimech <dimech@gmx.com> writes: > As all these tools are part of Gnu, it would be more suitable to > integrate all the tex and latex functionality in simple way within > emacs. [...] There is good functionality in the auctex and cdlatex > modes for emacs that a least the core should be put in just a single > mode. Does it mean you want to create a One-Stop-Shop for (La)TeX writing within Emacs, i.e., merging AUCTeX, cdlatex etc. into a core library? Or just put part of AUCTeX/cdlatex in core? If the latter, how do you pull the rest? > Other major modes do not work in confusing ways like tex and latex. Does python also fit the bill above? There is the builtin python.el and external packages like python-mode.el which have their pros and cons. Best, Arash ^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: Rainbow-delimiters highlighting { and } for tex and latex 2022-09-09 8:41 ` Arash Esbati @ 2022-09-09 12:33 ` Christopher Dimech 2022-09-09 19:36 ` Arash Esbati 0 siblings, 1 reply; 25+ messages in thread From: Christopher Dimech @ 2022-09-09 12:33 UTC (permalink / raw) To: Arash Esbati Cc: Alessandro Bertulli, Stefan Monnier, wilnerthomas, help-gnu-emacs > Sent: Friday, September 09, 2022 at 8:41 PM > 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: > > > As all these tools are part of Gnu, it would be more suitable to > > integrate all the tex and latex functionality in simple way within > > emacs. [...] There is good functionality in the auctex and cdlatex > > modes for emacs that a least the core should be put in just a single > > mode. > > Does it mean you want to create a One-Stop-Shop for (La)TeX writing > within Emacs, i.e., merging AUCTeX, cdlatex etc. into a core library? > Or just put part of AUCTeX/cdlatex in core? If the latter, how do you > pull the rest? A One-Stop-Shop. Not at all. Just to have some of the essential functionality as a built-in core at emacs release. Currently, tex-mode and latex-mode already includes some functionality that has been considered valuable for some time by users. For instance, tex-mode and latex-mode do provide a preview tool that uses "prettify-symbols". 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. cdlatex functionality is great but the design has been found to be fragile. For instance, even though the following commands share the same structure, hitting "fr<TAB>", the fr does not expand to \frac{}{}, even though `a expands to \alpha and equ<TAB> expands to an equation environment as expected. 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. Auctex and Cdlatex could continue seperately, for more exotic features like as today. 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). 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. 2. Reevaluate the preview tool that uses prettify-symbols, to see whether there exists possibility of improvement by looking how auctex does things. 3. Introduce rapid insertion of tex and latex keywords and environments by studying the cdlatex functionality. > > Other major modes do not work in confusing ways like tex and latex. > > Does python also fit the bill above? There is the builtin python.el and > external packages like python-mode.el which have their pros and cons. Am not the best person to decide on python, but if users face the same nomenclature problem, it would be valuable to rethink the design. But, one needs the people using the many aspects of python to tell us what is not working for them. I can scrutinise only things within my experience, and have others lead on the implementation details of things like python. ^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: Rainbow-delimiters highlighting { and } for tex and latex 2022-09-09 12:33 ` Christopher Dimech @ 2022-09-09 19:36 ` Arash Esbati 2022-09-09 20:13 ` Christopher Dimech 2022-09-09 20:45 ` Christopher Dimech 0 siblings, 2 replies; 25+ messages in thread From: Arash Esbati @ 2022-09-09 19:36 UTC (permalink / raw) To: Christopher Dimech Cc: Alessandro Bertulli, Stefan Monnier, wilnerthomas, help-gnu-emacs 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? > 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. > 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? > 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. > 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. > 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: ;; 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 ^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: Rainbow-delimiters highlighting { and } for tex and latex 2022-09-09 19:36 ` Arash Esbati @ 2022-09-09 20:13 ` Christopher Dimech 2022-09-09 20:45 ` Christopher Dimech 1 sibling, 0 replies; 25+ messages in thread From: Christopher Dimech @ 2022-09-09 20:13 UTC (permalink / raw) To: Arash Esbati Cc: Alessandro Bertulli, Stefan Monnier, wilnerthomas, help-gnu-emacs > 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 > ^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: Rainbow-delimiters highlighting { and } for tex and latex 2022-09-09 19:36 ` Arash Esbati 2022-09-09 20:13 ` Christopher Dimech @ 2022-09-09 20:45 ` Christopher Dimech 1 sibling, 0 replies; 25+ messages in thread From: Christopher Dimech @ 2022-09-09 20:45 UTC (permalink / raw) To: Arash Esbati Cc: Alessandro Bertulli, Stefan Monnier, wilnerthomas, help-gnu-emacs > 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: > > > 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. Perhaps not. The argument is that it would be difficult for all auctex functionality to be incorporated and maintained as part of emacs. Consequently, I see the value of continuing with auctex as separate package. But we have to fix the problematic parts of auctex so that users can comfortably use auctex tools whilst being able to easily switch to the tex and latex built-in modes in emacs when they want to. ^ permalink raw reply [flat|nested] 25+ messages in thread
[parent not found: <jwvleqvmhqj.fsf-monnier+emacs@gnu.org-NBNA5jg----2>]
* Re: Rainbow-delimiters highlighting { and } for tex and latex [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 ` (2 more replies) 0 siblings, 3 replies; 25+ messages in thread From: wilnerthomas--- via Users list for the GNU Emacs text editor @ 2022-09-07 15:03 UTC (permalink / raw) To: Stefan Monnier; +Cc: help-gnu-emacs Sep 7, 2022, 13:34 by monnier@iro.umontreal.ca: > wilnerthomas@tutanota.com [2022-09-07 15:23:57] wrote: > >> Sep 7, 2022, 13:14 by help-gnu-emacs@gnu.org: >> >>>> Stefan, you are right. But it handles only lisp commands, colouring >>>> initial "(" and final ")". But >>>> not for highlighting "{" and "}" for "tex" and "latex". >>>> >>> >>> That is not my experience (from a few seconds before sending my >>> previous message). >>> >> What do I have to do exactly? >> > > I don't know. For me it just works (I don't use rainbow-delimiters, > I simply turned it on to double-check my intuition before replying to > you, and it worked for (..), {..} and [..] in a `latex-mode` buffer). > What version are you using? Do you know where in the code the checking for "{ }" is performed? I see rainbow-delimiters--propertize which only has (while (> end (progn (skip-syntax-forward "^()" end) I can see that "( )" and "[ ]" get highlighted, but not "{ }". ^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: Rainbow-delimiters highlighting { and } for tex and latex 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 16:43 ` Stefan Monnier [not found] ` <jwvczc7b0jf.fsf-monnier+emacs@gnu.org-NBNqAf0----2> 2 siblings, 1 reply; 25+ messages in thread From: tomas @ 2022-09-07 15:16 UTC (permalink / raw) To: help-gnu-emacs [-- Attachment #1: Type: text/plain, Size: 1343 bytes --] On Wed, Sep 07, 2022 at 05:03:50PM +0200, wilnerthomas--- via Users list for the GNU Emacs text editor wrote: > > Sep 7, 2022, 13:34 by monnier@iro.umontreal.ca: > > > wilnerthomas@tutanota.com [2022-09-07 15:23:57] wrote: > > > >> Sep 7, 2022, 13:14 by help-gnu-emacs@gnu.org: > >> > >>>> Stefan, you are right. But it handles only lisp commands, colouring > >>>> initial "(" and final ")". But > >>>> not for highlighting "{" and "}" for "tex" and "latex". > >>>> > >>> > >>> That is not my experience (from a few seconds before sending my > >>> previous message). > >>> > >> What do I have to do exactly? > >> > > > > I don't know. For me it just works (I don't use rainbow-delimiters, > > I simply turned it on to double-check my intuition before replying to > > you, and it worked for (..), {..} and [..] in a `latex-mode` buffer). > > > > What version are you using? Do you know where in the code the checking for "{ }" is performed? > > I see > > rainbow-delimiters--propertize > > which only has > > (while (> end (progn (skip-syntax-forward "^()" end) This is the syntax category. You can look that up in the docs. If your buffer has the correct mode, things will work. In your case, the mode should be latex-mode. Please, read the docs. Cheers -- t [-- Attachment #2: signature.asc --] [-- Type: application/pgp-signature, Size: 195 bytes --] ^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: Rainbow-delimiters highlighting { and } for tex and latex 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 0 siblings, 1 reply; 25+ messages in thread From: wilnerthomas--- via Users list for the GNU Emacs text editor @ 2022-09-07 15:29 UTC (permalink / raw) To: tomas; +Cc: help-gnu-emacs Sep 7, 2022, 15:16 by tomas@tuxteam.de: > On Wed, Sep 07, 2022 at 05:03:50PM +0200, wilnerthomas--- via Users list for the GNU Emacs text editor wrote: > >> >> Sep 7, 2022, 13:34 by monnier@iro.umontreal.ca: >> >> > wilnerthomas@tutanota.com [2022-09-07 15:23:57] wrote: >> > >> >> Sep 7, 2022, 13:14 by help-gnu-emacs@gnu.org: >> >> >> >>>> Stefan, you are right. But it handles only lisp commands, colouring >> >>>> initial "(" and final ")". But >> >>>> not for highlighting "{" and "}" for "tex" and "latex". >> >>>> >> >>> >> >>> That is not my experience (from a few seconds before sending my >> >>> previous message). >> >>> >> >> What do I have to do exactly? >> >> >> > >> > I don't know. For me it just works (I don't use rainbow-delimiters, >> > I simply turned it on to double-check my intuition before replying to >> > you, and it worked for (..), {..} and [..] in a `latex-mode` buffer). >> > >> >> What version are you using? Do you know where in the code the checking for "{ }" is performed? >> >> I see >> >> rainbow-delimiters--propertize >> >> which only has >> >> (while (> end (progn (skip-syntax-forward "^()" end) >> > > This is the syntax category. You can look that up in the > docs. If your buffer has the correct mode, things will > work. In your case, the mode should be latex-mode. > > Please, read the docs. > I am using the following function (defun lex-rainbow-delimiters () "Configuration." (add-to-list 'load-path "~/bin/contrib/rainbow-delimiters") (require 'rainbow-delimiters) (add-hook 'tex-mode-hook #'rainbow-delimiters-mode) (add-hook 'latex-mode-hook #'rainbow-delimiters-mode) (message "+ rainbow-delimiters")) This does not work. I first have to load the latex file, then call "M-x rainbow-delimiters-mode" to take effect. ^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: Rainbow-delimiters highlighting { and } for tex and latex 2022-09-07 15:29 ` wilnerthomas--- via Users list for the GNU Emacs text editor @ 2022-09-07 15:59 ` tomas 0 siblings, 0 replies; 25+ messages in thread From: tomas @ 2022-09-07 15:59 UTC (permalink / raw) To: wilnerthomas; +Cc: help-gnu-emacs [-- Attachment #1: Type: text/plain, Size: 239 bytes --] On Wed, Sep 07, 2022 at 05:29:27PM +0200, wilnerthomas@tutanota.com wrote: [...] > This does not work. I first have to load the latex file, then call > "M-x rainbow-delimiters-mode" to take effect. I give up, sorry. -- t [-- Attachment #2: signature.asc --] [-- Type: application/pgp-signature, Size: 195 bytes --] ^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: Rainbow-delimiters highlighting { and } for tex and latex 2022-09-07 15:03 ` wilnerthomas--- via Users list for the GNU Emacs text editor 2022-09-07 15:16 ` tomas @ 2022-09-07 16:43 ` Stefan Monnier [not found] ` <jwvczc7b0jf.fsf-monnier+emacs@gnu.org-NBNqAf0----2> 2 siblings, 0 replies; 25+ messages in thread From: Stefan Monnier @ 2022-09-07 16:43 UTC (permalink / raw) To: wilnerthomas; +Cc: help-gnu-emacs >> I don't know. For me it just works (I don't use rainbow-delimiters, >> I simply turned it on to double-check my intuition before replying to >> you, and it worked for (..), {..} and [..] in a `latex-mode` buffer). > What version are you using? Emacs-29.0.50, but I don't think this has changed for a long time. > (while (> end (progn (skip-syntax-forward "^()" end) Yes, that's the code. > I can see that "( )" and "[ ]" get highlighted, but not "{ }". The above code looks for chars with the "parenthesis syntax" according to the major mode's syntax-table. I.e. the same info used by `show-paren`. I'm using Emacs's built-in `latex-mode`. Maybe you're using a different major mode which doesn't give paren syntax to the braces? Check the "syntax:" info give by `C-u C-x =` when your cursor in on a brace. Stefan ^ permalink raw reply [flat|nested] 25+ messages in thread
[parent not found: <jwvczc7b0jf.fsf-monnier+emacs@gnu.org-NBNqAf0----2>]
* Re: Rainbow-delimiters highlighting { and } for tex and latex [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 0 siblings, 0 replies; 25+ messages in thread From: wilnerthomas--- via Users list for the GNU Emacs text editor @ 2022-09-08 10:35 UTC (permalink / raw) To: Stefan Monnier; +Cc: help-gnu-emacs Sep 7, 2022, 16:43 by monnier@iro.umontreal.ca: >>> I don't know. For me it just works (I don't use rainbow-delimiters, >>> I simply turned it on to double-check my intuition before replying to >>> you, and it worked for (..), {..} and [..] in a `latex-mode` buffer). >>> >> What version are you using? >> > > Emacs-29.0.50, but I don't think this has changed for a long time. > >> (while (> end (progn (skip-syntax-forward "^()" end) >> > > Yes, that's the code. > >> I can see that "( )" and "[ ]" get highlighted, but not "{ }". >> > > The above code looks for chars with the "parenthesis syntax" according > to the major mode's syntax-table. I.e. the same info used by > `show-paren`. > > I'm using Emacs's built-in `latex-mode`. Maybe you're using a different > major mode which doesn't give paren syntax to the braces? > > Check the "syntax:" info give by `C-u C-x =` when your cursor in on a brace. > I will investigate deeper with my setup. Have you tried with latex-mode-hook? (add-to-list 'auto-mode-alist '("\\.sty\\'" . latex-mode)) (add-hook 'latex-mode-hook #'rainbow-delimiters-mode) Could be that the mode hook is not working ^ permalink raw reply [flat|nested] 25+ messages in thread
end of thread, other threads:[~2022-09-09 20:45 UTC | newest] Thread overview: 25+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 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 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
Code repositories for project(s) associated with this external index https://git.savannah.gnu.org/cgit/emacs.git https://git.savannah.gnu.org/cgit/emacs/org-mode.git This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.