From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Michael Eliachevitch Newsgroups: gmane.emacs.devel Subject: Re: Grammar checking Date: Fri, 31 Mar 2023 08:45:56 +0000 Message-ID: <87355lcloi.fsf@posteo.de> References: <87sfdnyuxc.fsf@posteo.de> <83sfdl2z26.fsf@gnu.org> <58158ae49808189da7b2@heytings.org> <83mt3t2xz1.fsf@gnu.org> <86jzyxxqir.fsf@gmail.com> Mime-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha256; protocol="application/pgp-signature" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="30385"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Eli Zaretskii , Gregory Heytings , rms@gnu.org, emacs-devel@gnu.org To: Nasser Alkmim Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Fri Mar 31 11:31:49 2023 Return-path: Envelope-to: ged-emacs-devel@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 1piB6q-0007kF-Kd for ged-emacs-devel@m.gmane-mx.org; Fri, 31 Mar 2023 11:31:48 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1piB5u-0007DV-MV; Fri, 31 Mar 2023 05:30:50 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1piB5q-0007Cx-OL for emacs-devel@gnu.org; Fri, 31 Mar 2023 05:30:47 -0400 Original-Received: from mout02.posteo.de ([185.67.36.66]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1piB5o-0003Jc-6T for emacs-devel@gnu.org; Fri, 31 Mar 2023 05:30:46 -0400 Original-Received: from submission (posteo.de [185.67.36.169]) by mout02.posteo.de (Postfix) with ESMTPS id F3948240350 for ; Fri, 31 Mar 2023 11:30:39 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.de; s=2017; t=1680255040; bh=zhB9EJ5SKHaZ89g8LJTyFxtqnG9ygTmkSSEhilpo21A=; h=From:To:Cc:Subject:Date:Autocrypt:OpenPGP:From; b=A+DGks/gnvUixa3Fnua0m0/t9I+Iqivjm8w3jl/oJRf4CUXbX0TP3L7z9/IZq9OzA AmYNO5tE3ha2hd9S/FUZYpsAQpAsQH9HeNFy42IzUC6eskfgHUBNCr3k97I5ORrNg4 dQgzASAoDXKQvyz5zuNJ79SAJmJxWLmCczAmYkfqcvjyI00AEGL+TQopshwyXtCYpy hrOyzROHkwC+IBahMVNC+ASxrqmJsZreuzXsm1wwTrWs50hmb62nWxnNqS4LhlKizv hnvU61penKITB84wChFbt+preQIvOt18VfQQpYQrdOO9Tbt8W4PqFDCFRZwyXCSuGN n9U9GY7JO1/kA== Original-Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4Pnw4v17K1z9rxV; Fri, 31 Mar 2023 11:30:39 +0200 (CEST) In-reply-to: <86jzyxxqir.fsf@gmail.com> Autocrypt: addr=m.eliachevitch@posteo.de; keydata=xsBNBFHFxZABCADAAv2siayhA7Etl85WcwcyMPBD2bt/6Wh3A8a12AURV5J4tprzgbdlxC0w1LofvklG7ls25NERAY931hvQW+f5GEI0pwoNNFXEkKDa8/J4SxhrqXx8CJA85owPq1g4cFeO1ooQJ32BewlRGsnhd+taYExZ76oaMnFtx6jYjf6mPbjDyiLhC+Og3MBpOqAnmX7mhStgJl0uru1ZGEB17tzzVuQ4ljDv/MvUagVFymQBhmlbzvze5eLeDn90Ot0DjWHy3HzCFMEnVqQy8rmEA8N9GOANwyMY79KVymsPakeNwacPRFzYXCZvolC5jtY6I/1ALvVtNc45JyZWty+rMPo3ABEBAAHNGG0uZWxpYWNoZXZpdGNoQHBvc3Rlby5kZcLAlAQTAQgAPhYhBFRpCMeCODrQ59iU7BuPlcgSXc4xBQJgUmWNAhsDBQkSToKgBQsJCAcCBhUKCQgLAgQWAgMBAh4BAheAAAoJEBuPlcgSXc4xqC8H/06lkI7BimgkSobuEzsD9LsIPEyz5uUaQAP77u1nfoO1vB0DEdPxn7f3H3Hs7nyUfPgvgsn+9rTSV+ubHH5f/bzgQZgES2WItbV7iM290j6nWSc/iCTLlTmM2KMNvbMB9xGzV0m+UjMyAa9zUhB/3N+rd5ya/oSiTKw2/UbgfM5fR1knIUgPDENlKjJvO7/71Sxwpc+gKvAR9lHRT8JzQMyFaFO+zbo53Z7FzDTuj7zVyQ4MPIhe+UMI4rtNZeyPDM0QTep0+N39JbDhvUVevOh 15XJTYXl2Zdhl/yunnOibtg3XKtToakc4FjWJGrw8njbges5YqaodeMq OpenPGP: url=https://posteo.de/keys/m.eliachevitch@posteo.de.asc Received-SPF: pass client-ip=185.67.36.66; envelope-from=m.eliachevitch@posteo.de; helo=mout02.posteo.de X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 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, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:304901 Archived-At: --=-=-= Content-Type: text/plain; format=flowed > I tried a couple of grammar checkers in Emacs, integrated via Flymake and Eglot. > The one that works best for me is this Grammarly language server [1]. > Best in terms of diagnostics. > Some users may find it too intrusive, so it may be a personal preference thing. > However, it is not usable for larger buffers because it is too slow. > Maybe some narrowing functionality can help. > Also, there may be other implications regarding using Grammarly. > The LanguageTool language server is available as well, but It is not as > effective as Grammarly to catch mistakes and offer suggestions. > > [0] https://github.com/emacs-languagetool/flymake-languagetool > [1] https://github.com/emacs-grammarly/eglot-grammarly Most recently I also reverted to grammar checking via LSP servers with Eglot. Grammarly is powerful an I like knowing that it's powered by Common Lisp, but due to its proprietary nature it's not something that fits well with the philosophy of Emacs and the FSF. I'm checking a LaTeX-file, where I found the "ltex" [3] language server to be useful [3]. It's basically a Languagetool language server, but aware of markdown and LaTeX syntax. But in practice it doesn't seem to do anything much smarter than just ignoring certain syntactic commands or macros. So plain Languagetool might be sufficient if one could configure it with text-faces like in `flyspell-prog-mode' or faces to ignore. One issue with Eglot is that afaik it currently only allows for one language server to be active at a time, so if I want to check the grammar I need to switch the active LSP server. I think it was mentioned as a possible feature in the future to allow different simultaneous language servers for different LSP capabilities, maybe one main one for completion and thinks like rename and two LSP's for linting, for instance. I don't know how far that is, but I'm aware that Eglot development is very active and there are many other issues. Writing text is one of the core functionalities of an editor and therefore I think that grammar checking could be integrated more tightly than just relying on Eglot. And as I just discussed it's something that might used in parallel to a language server. However, the strength of using LSP servers for linting is that it's easy to change grammar checking LSP servers without _any_ additional work required on Emacs side. So I'm not sure if coupling Emacs tightly to Languagetool and not allowing for alternatives is the way to go. [3]: https://valentjn.github.io/ltex. Actually there's even a special package for that https://github.com/emacs-languagetool/eglot-ltex, but in my opinion that's not really necessary, it just adds some custom eglot configuration. --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQFNBAEBCAA3FiEEVGkIx4I4OtDn2JTsG4+VyBJdzjEFAmQmqD0ZHG0uZWxpYWNo ZXZpdGNoQHBvc3Rlby5kZQAKCRAbj5XIEl3OMTOLCACXkTHx+cHLkqwTe50wuWlo JNNApuPwutmPD9qZxeXn0uFx2UmSRiolbojAg3CTIMMmLgsW6FG0VbKwzycS0B37 LXP32hm+lj7QAweiAMUmBfxa6W+XG0fg94Ii7CrJBMGTB5Xx2Cl33ZXYZXj37JKW A5L50oVQ9jgoiOO1XlR4Xn3Ys9eG3xf3FtiOqRqPvUBpzPNFfy8qSlfYAa8tu3WS OpNbgw+wEB1ejE5+hBW9wFCi1xnpYkrUVNoxXobsdLPtzg2HkJ2mxOQxyRdug17A pX7CGgMO/AeFKAHXwZ5i6cfY9hPbaC19Idl4NiQWCoUMtkfmTToCi4HaFq6ACogn =n3yr -----END PGP SIGNATURE----- --=-=-=--