From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: uzibalqa Newsgroups: gmane.emacs.help Subject: Re: cdlatex-mode in emacs Date: Thu, 25 Aug 2022 15:03:48 +0000 Message-ID: References: <83edx45070.fsf@gnu.org> <838rnc4ytn.fsf@gnu.org> <936d788e-120e-86a3-0f39-9e57ae242731@gmail.com> <57a9ab6f-47c3-cfca-2aec-e4e8ac5dd6ca@gmail.com> Reply-To: uzibalqa 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="15260"; mail-complaints-to="usenet@ciao.gmane.io" Cc: wilnerthomas@tutanota.com, Eli Zaretskii , help-gnu-emacs@gnu.org To: Thibaut Verron Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Thu Aug 25 17:04:39 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 1oREPO-0003pr-Sv for geh-help-gnu-emacs@m.gmane-mx.org; Thu, 25 Aug 2022 17:04:39 +0200 Original-Received: from localhost ([::1]:39854 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oREPN-0002QT-Vp for geh-help-gnu-emacs@m.gmane-mx.org; Thu, 25 Aug 2022 11:04:38 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:37770) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oREOm-0002Q6-5m for help-gnu-emacs@gnu.org; Thu, 25 Aug 2022 11:04:00 -0400 Original-Received: from mail-4319.protonmail.ch ([185.70.43.19]:30115) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oREOh-0001hJ-Vd; Thu, 25 Aug 2022 11:03:59 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=proton.me; s=protonmail; t=1661439832; x=1661699032; bh=tXaiCAUGe9GWx0SIkQCMdW0G4I5wsn6/1j4SU5zrrGA=; h=Date:To:From:Cc:Reply-To:Subject:Message-ID:In-Reply-To: References:Feedback-ID:From:To:Cc:Date:Subject:Reply-To: Feedback-ID:Message-ID; b=KAsEO+Av/syJZBW6mOlESjt9ixzW7tHL2xdvLoM3tpIvuawlXmKju1h0+wlsOJoQj sf0JhT1IoF+VglinGMyQAYvB0i4jCazA07xQnMcaVSlKDzeYm7ez/Snry05Ido439Y vS3NWOGbsvROp3eNjoJ1w3G80R0CKbPPvV+9PnmwigEBnRej0AbUCMi3nYeN4a6xc3 wJwNyR5eVZV2VVZDZaDdWboOLz81/mw2L1nkxkxuLMia5NMJ40T2z15Q/1e3LnPiLy Y/qKVHJWEfRToJlZUzGt3d+sDvUkmlIvsBPLdESX6wp4Odzc0KhbZNdtYVtLePI9FC eLAbX8GWrScpg== In-Reply-To: <57a9ab6f-47c3-cfca-2aec-e4e8ac5dd6ca@gmail.com> Feedback-ID: 52887082:user:proton Received-SPF: pass client-ip=185.70.43.19; envelope-from=uzibalqa@proton.me; helo=mail-4319.protonmail.ch X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_PASS=-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:139089 Archived-At: ------- Original Message ------- On Thursday, August 25th, 2022 at 1:07 PM, Thibaut Verron wrote: > On 25/08/2022 14:03, uzibalqa wrote: >=20 > > ------- Original Message ------- > > On Thursday, August 25th, 2022 at 11:39 AM, Thibaut Verron thibaut.verr= on@gmail.com wrote: > >=20 > > > On 25/08/2022 12:41, uzibalqa wrote: > > >=20 > > > > ------- Original Message ------- > > > > On Thursday, August 25th, 2022 at 8:08 AM, Thibaut Verron thibaut.v= erron@gmail.com wrote: > > > >=20 > > > > > On 25/08/2022 08:53, wilnerthomas--- via Users list for the GNU E= macs > > > > > text editor wrote: > > > > >=20 > > > > > > Aug 25, 2022, 06:33 by eliz@gnu.org: > > > > > >=20 > > > > > > > > Date: Thu, 25 Aug 2022 06:20:09 +0000 > > > > > > > > From: uzibalqa uzibalqa@proton.me > > > > > > > > Cc: help-gnu-emacs@gnu.org > > > > > > > >=20 > > > > > > > > > > Date: Thu, 25 Aug 2022 03:20:04 +0000 > > > > > > > > > > From: uzibalqa uzibalqa@proton.me > > > > > > > > > >=20 > > > > > > > > > > Does anybody know when cdlatex-mode was introduced into= Emacs? I am using Emacs 27.2 > > > > > > > > > > There's no cdlatex-mode in Emacs, only org-cdlatex-mode= . > > > > > > > > > > Is there texmathp.el in emacs, which is a Gnu Package. > > > > > > > > > > No, not in Emacs. > > > > > > > > > > It is part of AUCTeX which is a Gnu Package. It comes w= ith Emacs Support for writing > > > > > > > > > > Latex Files. Could the functionality be included in Ema= cs. cdlatex-mode is useful for > > > > > > > > > > rapid writing latex templates and symbols rapidly. > > > > > > > > > > Could improve using tex-mode and latex-mode immensely i= n Emacs. > > > > > > > > > > AUCTeX is on GNU Elpa, and cdlatex is on NonGNU Elpa, s= o both can be > > > > > > > > > > directly installed with the package manager. In my opin= ion, it is the > > > > > > > > > > right place for such packages, rather than emacs core: = this way they can > > > > > > > > > > release new versions without having to wait for the ema= cs release cycle. > > > > > > > > > > (See: org-mode) > > > > >=20 > > > > > tex-mode and latex-mode are extremely basic modes in comparison, = I don't > > > > > know anybody using them. And it's unfortunate that they preempted= the > > > > > tex- and latex- namespaces, forcing AUCTeX to capitalize its mode= names > > > > > and variables -- but I digress. > > > > > I agree with your last evaluation Thibaut. tex-mode and latex-mod= e are > > > > > extremely basic modes. Because (as you state) almost nobody using= them, > > > > > they should be beefed up using ideas from texmathp.el and cdlatex= . With > > > > > the useful functionalities incorporated, emacs would not need to = always > > > > > pick up on every release of those packages. But users can get the= m seperately > > > > > for added functionality if they wish. > > >=20 > > > But what would be the advantage of doing that? Both packages are > > > available on the "official" repository for emacs packages, and can be > > > installed in a matter of seconds. > > > Emacs should have good built-in support for all language and hypertex= t modes it > > > supports. >=20 >=20 > Then Emacs will be huge and the release cycle much slower. >=20 > A lot of languages and hypertext modes supported by emacs have > relatively limited built-in support in comparison with what's available > in packages. >=20 > Note that I said "relatively" limited, because the built-in support for > latex is only limited when compared to amazing feats like AUCTeX. Reftex > (table of contents, multi-file support, cross-references, bibliography > management), and outline-mode (sectional navigation) are both included > with emacs, and offer support that even dedicated latex IDEs can have > trouble imitating. >=20 > > cdlatex was made because tex-mode and latex-mode are very frustrating > > to do serious work and be productive with them. cdlatex does have probl= ems, and > > Emacs Maintainers are capable of doing a better job than relying just o= n the work > > of one person. >=20 >=20 > There seems to be a confusion: cdlatex and latex-mode are completely > different and have different goals. latex-mode, like AUCTeX's > LaTeX-mode, is a major mode for editing latex files. That covers > everything from syntax highlighting to reference management to sectional > navigation to, yes, macro and environment insertion. >=20 > On the other hand, cdlatex is a minor mode which focuses on fast > insertion of a limited set of macros and environments. Most of its > features are extensions of AUCTeX features, such as LaTeX-math-mode, > TeX-electric-sub-or-superscript, etc. >=20 > AUCTeX already existed when cdlatex was invented, and I'm 99% sure that > its author uses cdlatex on top of AUCTeX, rather than with latex-mode. > One could argue that cdlatex could be included in AUCTeX. I personally > would not like this to happen, because cdlatex has a very different > philosophy and can be a lot more intrusive than AUCTeX. >=20 > By the way, the "one person" maintaining cdlatex is also the original > author of org-mode, as well as texmathp and RefTeX which are two major > components of AUCTeX. If anything, that alone convinces me that keeping > cdlatex and AUCTeX separate is a reasonable choice. >=20 > Most of the problems I see with cdlatex come from the fact that it's a > rather small package, designed to implement precisely the ergonomics > intended by its author. The result is an opinionated package which is > reliably doing exactly what it is supposed to do, but with whom users > can occasionally disagree. Making it more flexible would come at the > cost of reduced reliability. And allocating more humanpower to the > maintenance would not really change anything. >=20 > > > Right now the purpose of each package is clear: built-in basic suppor= t, > > > auctex for advanced IDE-like features, cdlatex for quick math inserti= on. > > > (Note that cdlatex is a minor mode, and can be used to insert maths i= n > > > any emacs buffer.) > > >=20 > > > > I encourage that tex-mode and latex-mode stop being intertwined tog= ether, but > > > > developed seperately. The syntax is so different that they produce = choas when > > > > all functionality is put in a single file. > > >=20 > > > The file tex-mode.el which implements basic support for both tex, lat= ex > > > and doctex is less than 4000 lines long. The syntax may be superficia= lly > > > different, but a lot of concepts are common between the different > > > languages of the family. Plus, one gets support for tex syntax in lat= ex > > > documents for free. > > >=20 > > > AUCTeX, too, builds support for latex on top of the support for tex. > > >=20 > > > Best wishes, > > > Thibaut > > > Concept that are exactly common should be moved out in a separate fil= es. > > > tex-mode, latex-mode, etc, can call them. Better to have a number of = smaller > > > files but with a well organised design. >=20 >=20 > The file seems well organized to me, the code is grouped according to > the provided features. That's a lot easier to use and manage than having > to modify n files at exactly the right place anytime one wants to add a > new feature. >=20 > Most of the contents is common concepts, with little bits of > instantiation here and there. And a lot of the language-specific content > (in terms of lines of code) is documentation rather than code. Again, > that's because tex- and latex- mode do not attempt to implement more > than basic support for latex files. >=20 > In any case it is a concern for developers, not users. Do you have > changes that you would like to include in tex-mode.el, but can't because > of the current file structure? One feature I did include in my implementation for tex-mode is to highlight tex commands such as "\sqrt", "\omega" and the rest. But the starting "\" is not highlighted in order to distinguish different components such as in= =20 "\alpha\beta" and "\sin\omega_k". =20 =20 > Best wishes, > Thibaut cdlatex would also be useful for use with texinfo-mode, particularly now th= at texinfo uses mathjax.