From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: "Dr. Arne Babenhauserheide" Newsgroups: gmane.emacs.devel Subject: Re: 10 problems with Elisp, part 10 Date: Tue, 06 Aug 2024 09:14:57 +0200 Message-ID: <87mslqceby.fsf@web.de> References: <87sevj9b50.fsf@jeremybryant.net> <871q33rj7v.fsf@dataswamp.org> <86ed73qhly.fsf@gnu.org> <87frrjoryg.fsf_-_@dataswamp.org> <86wmkuq60j.fsf@gnu.org> <87a5hqq4v3.fsf@dataswamp.org> <87mslqes7m.fsf@web.de> <874j7ypvr4.fsf@dataswamp.org> 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="10577"; mail-complaints-to="usenet@ciao.gmane.io" To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Tue Aug 06 09:16:06 2024 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 1sbEQQ-0002bG-FI for ged-emacs-devel@m.gmane-mx.org; Tue, 06 Aug 2024 09:16:06 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sbEPX-0006CL-D9; Tue, 06 Aug 2024 03:15:11 -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 1sbEPV-0006Bl-FU for emacs-devel@gnu.org; Tue, 06 Aug 2024 03:15:09 -0400 Original-Received: from mout.web.de ([212.227.15.4]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sbEPS-0001cV-2d for emacs-devel@gnu.org; Tue, 06 Aug 2024 03:15:08 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=web.de; s=s29768273; t=1722928500; x=1723533300; i=arne_bab@web.de; bh=knugvncEDNwzjUQcQI5Q1xGrbn7iGLopg3lBdsoLzsI=; h=X-UI-Sender-Class:From:To:Subject:In-Reply-To:References:Date: Message-ID:MIME-Version:Content-Type:cc:content-transfer-encoding: content-type:date:from:message-id:mime-version:reply-to:subject: to; b=Mvq+1f9BRewGmLNkktcSjlrhOSeAxSkrUexnEBj7aMfTajWtACIIGZdpFKzzU494 aywUGuZcJd3FhsPmTzbEJnLfV7pFFrcf5cGQw4abUhFeDTaRY53gtHMLy5GoL7wfx 9aLHhM+m1gMe2qHHX4kMVFsspv5SOqc1PpXuzCNAaFD3PDEeUeaZGWb7X+J5rPje+ ju8vP3ZXjRbhezHRRb8oGKYZWWyMr9yiiapxeNOnaZuxpt28m2Wsh8UY4rkAs8Wu/ FFRHx1YdHmVajbDEq+u6tyaE1pDgUJf7VFnKiIKOC+DpDBEMo9aqXFrSdYsJFMgKN /A9M1XDyxS3pA2Laqw== X-UI-Sender-Class: 814a7b36-bfc1-4dae-8640-3722d8ec6cd6 Original-Received: from fluss ([80.136.23.189]) by smtp.web.de (mrweb005 [213.165.67.108]) with ESMTPSA (Nemesis) id 1MkVsg-1rwyEf3ibW-00nvZ1; Tue, 06 Aug 2024 09:14:59 +0200 In-Reply-To: <874j7ypvr4.fsf@dataswamp.org> (Emanuel Berg's message of "Mon, 05 Aug 2024 22:20:15 +0200") X-Provags-ID: V03:K1:VXN+9vEqNFnF4/VTotMP1HuxofrOIgQzLwYxI5uxi2mo7KVBj3l WjamdCjHhargVc2c8p9GRR9XIjt6c+VXxZDyOwHxizTiD0oI0uGg/6l6TgzNx+cctGKx+1K 0pIHtJ5jgfCpHSe6Q/LNqgvbcT1QNUkEcbi97CwmHA+n71C6nye/w+GB4Bno8x1QciHHYBD UkAEX6cT5ROf2Iy50BKIg== UI-OutboundReport: notjunk:1;M01:P0:rKD3y253iGQ=;hnKZ71t24EPoGNuoW2WwOsTlb7L bLvvGQXagEq64DXaCiGm3D70Q0XU79+C0JDfjUBe+gKgws3X1aLvyhBsoW7W0e7sMwpYqWb1c izgE7sHM+4xQ/r0jMoUnoRHorHCrlvg6PZwJSfWrLfwNP3qSALO1YQbdDJwhZhQgOu1/nP6Qr qUD5cboiuVTa5AA3akl30usxFCDpwl75b/b2+/vfF/iSFI+uWd8w+mWUgJgdHFtN/gcPABRe+ UJ8k3xnjei5uHADQeiYM+bi2XVhM8TylfjgRkrpznlsqYZ/ybvJBMmbGLvDKSDkCZ3a7LFZ4k AVOAiHSoxGaoOCLjtfRwTtcoqeu335Oy3/Y5VY+By7y3BJzeyHIQlclazsIaydnHjzA6FL+ge mNwvs1bP46hr3/Hu+KIwTVq3mzNcqIlWEo+QqktA7nr5a2UsKT33bydLRieWPT0mmlmRB8Dyw 3jpIPBdUUBtESvplySZ4ku6UqIPJtSquuSGE9iRluuWT2R33W0JFZ2TCzYK3Zs0nZN5RrmajO U4nV1xpnCPfCcFTeLHDUAuZ5qrMLLAC28HxiBrkxA8qr41Oa5rTTK6ldaMmrC56ZdOfgnmFqU 1TPeHDyuAdrzvtFnjHQ60zv06kOOjF862Qn8+I/RI6LgmUNNasup920qCggFvuOumLZFGyGp3 Rt02hcaIoF5FCdPQXNODt8arcrFsXrae47UKw3P/o9PAflLQVvwoLY+U0pxMa/3hpMfc7qusm fdC+ro3Zju8bJ1PSYC5MxX6WfcdQOWaGH7bW0cgt/7qpsppQwrNIqu6YgISu8Fs/ncrv11Fh Received-SPF: pass client-ip=212.227.15.4; envelope-from=arne_bab@web.de; helo=mout.web.de X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 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, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=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:322426 Archived-At: --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Emanuel Berg writes: > Dr Arne Babenhauserheide wrote: > >> After having seen how I could write interactive indentation >> highlighting in wisp-mode in a few hours of hacking and >> a few dozen lines of code [...] > > Excellent, now have a look at ispell.el - 4 323 lines - or > flyspell.el that is 2 393 lines - you can reduce it a lot, > I take it. That=E2=80=99s not my point. My point is that the buffer as abstraction is already pretty good. If you forgo that, you add a lot of complexity with finding the right entry points, defining how elisp should interact with text =E2=80=94 all wh= ile increasing the separation from regular editing, so creating a package requires a higher up-front investment to find the right APIs. As a counter-point: An example of a higher level of abstraction is the org-mode API. But thinking back how long it took me to get that to actually do what I needed, I doubt that that=E2=80=99s the model I want for= most packages. But I agree that without this, what I wrote would have been more brittle. Another example for specialized APIs that are used by others, too, are completion APIs =E2=80=94 auto-complete or company. Currently Emacs is the environment I know that has the lowest barrier of entry for writing a package. To check my memory on that, I now looked at an IntelliJ plugin that just does replace-regex, and that clocks in at about 200 LOC, using specialized entry points. To get another sample, I checked a VS-code extension that just flashes the region on copy. To implement the equivalent of (if mark-active (list (point) (mark)) '()) it needs 20 lines of code. That said: going by the example of the orgmode API and completion APIs, building specialized APIs for certain tasks and releasing them as packages could be a way to move forward to experiment with abstractions. If similar APIs prove useful for very different tasks, and other people start using them, that would build a case that generalizing them and integrating them in Emacs and elisp as a default API could be a good way forward. Best wishes, Arne =2D-=20 Unpolitisch sein hei=C3=9Ft politisch sein, ohne es zu merken. draketo.de --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQJEBAEBCAAuFiEE801qEjXQSQPNItXAE++NRSQDw+sFAmaxzXIQHGFybmVfYmFi QHdlYi5kZQAKCRAT741FJAPD62bbD/9ldzY4OxxV0We4wgFYzYJIDXUmLAA008eH BBa3ATWeE7OKzlSjyzqd63aw9+A/OgYCtne3dr+GbwolFwAtDz2oxh5fZMDTyxHs 1JHCgTnVFiJe+bKZb3Bmyu3g0UXn99KMUywHFYcJsQdQ21C71vXLErwLpb0kY5oH bdU1GQJJZY0YooohlC1i8fSbYKDtmCfjp9faZfS+8g3f1MhbBMlpUkAjL6MYpywU qZQnhZhIYQoqfTIZAF0PnpRbV1vYCdMaQjWOalAs1CqVrGlZG7ArCESZ0EPM2DEW xWtHqaKCn9o45tVCWzv9XyaXSvk8g9bV95b1Jn0BAWEjLH90NFQ1rejeLe/rBTgt RPi+6WU/RJjIGWPgMxP4cLp5XIKXIPJaot92Hla6f7C0ETaTXjKopRBVRM4kvStk HHNL/Dez4PgU+ZK9LSx9bXEHQn/A6P3aS8XRSru7HugpdoyDviSRKOTDoq8Ufn9w x4yxXr3XdPBFgUYkAD+ekpx+mLZghKRnVxXabg/Hi3kQrWcL7b+IW75U0VD3ZGxj jXpiuWc0kO0dpbKMCfd/ICn793DnnNyx+KMooiemJcX/2FT2Oi97bYPNCddJihiJ s7dUSiR/9pZ2cSl3mnjOHXWFtBOoP69qKdxXXJIma9Rbx9hwXUjYwq2HIQN99Z7z MAtDgvAZn4jEBAEBCAAuFiEE3Si95tmHXKvOSosd3M8NswvBBUgFAmaxzXIQHGFy bmVfYmFiQHdlYi5kZQAKCRDczw2zC8EFSP1zA/4gq6L88EnUfA0wS+OGh/RmjpDH iHbWInZNMU6EnXIFK0l2QggLq7+E4yX7tCH4IALsvr6jWtdpjoZKWjzgxfZEYMi3 z/a1mcrjBQiUzV0/SJCf8I2GuJhUMaA9XVMHqoWXdzAbWCRqrn5OVYoaEK218MID Vrm6UeEQxsu1drT6kg== =DW5o -----END PGP SIGNATURE----- --=-=-=--