From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: =?UTF-8?B?Sm/Do28gVMOhdm9yYQ==?= Newsgroups: gmane.emacs.devel Subject: Re: Help sought understanding shorthands wrt modules/packages Date: Sun, 6 Nov 2022 11:19:55 +0000 Message-ID: References: <25a8a3a6-81c8-3fbc-434d-fb1b24ae1d62@gmail.com> <83cza48lxe.fsf@gnu.org> <87cza0ihb7.fsf@gmx.de> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="000000000000b531c405eccb7849" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="9221"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Eli Zaretskii , akrl@sdf.org, emacs-devel@gnu.org To: Michael Albinus , Richard Stallman Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sun Nov 06 12:19:31 2022 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 1ordgX-0002FP-S7 for ged-emacs-devel@m.gmane-mx.org; Sun, 06 Nov 2022 12:19:29 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ordg3-00054g-VO; Sun, 06 Nov 2022 06:19:00 -0500 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 1ordg1-00054W-TT for emacs-devel@gnu.org; Sun, 06 Nov 2022 06:18:58 -0500 Original-Received: from mail-ot1-x332.google.com ([2607:f8b0:4864:20::332]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ordfy-0004hS-IP; Sun, 06 Nov 2022 06:18:56 -0500 Original-Received: by mail-ot1-x332.google.com with SMTP id cn2-20020a056830658200b0066c74617e3dso5080687otb.2; Sun, 06 Nov 2022 03:18:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=Mfb0+X3oH182Z8WgQYb7x8jMYP5RPG+82MH1LofxV6U=; b=ot13OeGAPNToJ6/md5Hm1BahKq69/iXCXe8E6jD6C5cvbGHDIPgUzoAoqdT/netlQt dZeWoyhR3WUvEsUt3/QXxreOWkMMZ/LckuHT8G7SKRLFZPH+uit7e7lhshHDYQoqU7qU ib4VQgU8Sxzqyy7lfu+0hfyAcEOMRkv1oFhuGhiDjWep1BfNxVKTkf1vCyBx1nr9/71u HqSp6sTYbeKGvB9TJ4WpM42dX7qBfW2crVhfmFI2QQpqCg6BfSRet0zqECbfcThO+Tpk wB2JqX73yRIpCwpXHrUymnCXCPbbMcmUZPOgylVTCu6Uxid1q4IBWcHzCwlypAQzVjiB MzPg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=Mfb0+X3oH182Z8WgQYb7x8jMYP5RPG+82MH1LofxV6U=; b=knmkrT9gZjrETLkrAU/NRZt9XVz18M54x7LW/DP53qkGZuT2kv6LekCQWSZ8PQqk2N IMWTbJYRVP3GMTKo9w5d+feykE2g4xMa88LX6ICFQtxwJDrin9qshvN+fUHNYZJm/FOk Zz0/PkGnbS5TRMM7P8XjK5+nOfgXpko1dUgKbdR8aGDlZrprc2VLIRS0x46ksNHswc7F ZvmcetUf9stgBS6+I+pRMFjLbA3XfHOLvIvP+bJMyyKPLCZAckOB25eYupGHgtWHrjEK ZaIdf6TPkHfQU9J2QGVXgKy2atFZtgbJ8lW2T9Vc3GfHHByhTkm3pkPEcmEVVeCceKB3 0YbA== X-Gm-Message-State: ACrzQf32qM01NJBNg88j6YzjilafrxwCHnKmYDHJZeGG7A26/gZjDv8Z 4HIqtSKCaPA+I0QdcJ8YG/Gd8gVZ4CSK6kkyJe4= X-Google-Smtp-Source: AMsMyM5p5tqSNcGs0BWyIc0cpr9PlmHa4RSaBQRnnHGMbtj38z6kSLuGRGtm/vtYKT3iLp81GOkcXKYdhKhXEGqGRw8= X-Received: by 2002:a9d:117:0:b0:666:e09d:577e with SMTP id 23-20020a9d0117000000b00666e09d577emr22596455otu.93.1667733531209; Sun, 06 Nov 2022 03:18:51 -0800 (PST) In-Reply-To: <87cza0ihb7.fsf@gmx.de> Received-SPF: pass client-ip=2607:f8b0:4864:20::332; envelope-from=joaotavora@gmail.com; helo=mail-ot1-x332.google.com 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, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, 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: , Original-Sender: "Emacs-devel" Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:299247 Archived-At: --000000000000b531c405eccb7849 Content-Type: text/plain; charset="UTF-8" On Sun, Nov 6, 2022 at 9:06 AM Michael Albinus wrote: > > I wrote text for etc/NEWS: > > > > ** Shorthands for loading a file can be specified from "outside". > > > > The new function `load-with-shorthands' loads a file > > and specifies additional shorthands for reading it. I think it's fair to say, as the person who originally implemented shorthands, that I don't agree with this change. Providing two different ways to load an .el file so that each interns different symbols into obarray would lead to unfortunate consequences where it would be hard or impossible for humans or programs to understand the provenance of a given symbol. I cannot understand Richard's assertion that "shorthands are incomplete". Shorthands were primarily designed to solve the "the s.el problem", and the current implementation available since Emacs 28 solves that problem already, IMO. I've described how to do so multiple times in the past, but here goes again: Anyway, here are the instructions again summarized: 1. Grab s.el from its upstream repository 2. Don't touch any of its code. Just add this local variable definition to the end of the file. ;; Local Variables: ;; read-symbol-shorthands: (("s-" . "magnars-string-")) ;; End: 3. Rename the file from s.el to magnars-string.el. Change its line (provide 's) to (provide 'magnars-string) 4. Include magnars-string.el in Emacs core or GNU/NonGNU Elpa 5. Tell the current users of s.el, say im-a-s-user.el, in the world to type (require 'magnars-string) instead of (require 's) 6. In the local variables footer of im-a-s-user.el, also add ;; Local Variables: ;; read-symbol-shorthands: (("s-" . "magnars-string-")) ;; End: That's it. Minimal code was changed, and im-a-s-user.el continues to work as previously, except that the "namespace pollution" of many symbols with a very short prefix is not present anymore. --000000000000b531c405eccb7849 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
On Sun, Nov 6, 2022 at 9:06 AM Michael Albinus <michael.albinus@g= mx.de> wrote:

> > I wrote text for etc/NEWS:
> &g= t;
> > =C2=A0 =C2=A0 ** Shorthands for loading a file can be speci= fied from "outside".
> >
> > =C2=A0 =C2=A0 The = new function `load-with-shorthands' loads a file
> > =C2= =A0 =C2=A0 and specifies additional shorthands for reading it.
I think it's fair to say, as the person who originally imp= lemented shorthands,
that I don't agree with this change.

Providing two different ways to load an .el file so t= hat each interns different
symbols into obarray would lead to unf= ortunate consequences where it would
be hard or impossible for hu= mans or programs to understand the provenance of
a given symbol.<= /div>

I cannot understand Richard's assertion that &= quot;shorthands are incomplete".=C2=A0
Shorthands were = primarily designed to solve the "the s.el problem", and the curre= nt
implementation available since Emacs 28 solves that probl= em already, IMO.

I've described how to do = so multiple times in the past, but here goes again:

Anyway, here are the instructions again summarized:

1. Grab s.el from its upstream repository
2. Don't touch any of its code.=C2=A0 Just add this local variable
=C2=A0 =C2=A0definition to the end of the file.

=C2=A0 =C2=A0;; Local Variables:
=C2=A0 =C2=A0;; read-symbol-shorthands: (("s-" . "magnars-st= ring-"))
=C2=A0 =C2=A0;; End:

3. Rename the file from s.el to magnars-string.el.=C2=A0 Change its line

=C2=A0 =C2=A0=C2=A0 (provide 's)

=C2=A0=C2=A0 to

=C2=A0 =C2=A0=C2=A0 (provide 'magnars-string)

4. Include magnars-string.el in Emacs core or GNU/NonGNU Elpa
5. Tell the current users of s.el, say im-a-s-user.el, in the world to type=

=C2=A0 =C2=A0 =C2=A0(require 'magnars-string)

=C2=A0 =C2=A0instead of

=C2=A0 =C2=A0 =C2=A0(require 's)

6. In the local va= riables footer of im-a-s-user.el, also add

=C2=A0= =C2=A0 ;; Local Variables:
=C2=A0 =C2=A0;; read-symbol-shorthands: (("s-" . "magnars-st= ring-"))
=C2=A0 =C2=A0;; End:

That's it.=C2=A0 Minimal = code was changed, and im-a-s-user.el continues to work as
previou= sly, except that the "namespace pollution" of many symbols with a= very
short prefix is not present anymore.
--000000000000b531c405eccb7849--