From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Davin Pearson Newsgroups: gmane.emacs.devel Subject: Re: Special Event: Davin reveals his own personal additions to Emacs. Date: Thu, 14 Jul 2022 16:42:44 +1200 Message-ID: References: Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="00000000000007eb9105e3bc892a" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="5695"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Thu Jul 14 06:45:20 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 1oBqj0-0001Km-Oe for ged-emacs-devel@m.gmane-mx.org; Thu, 14 Jul 2022 06:45:18 +0200 Original-Received: from localhost ([::1]:41606 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oBqiz-0005Hd-IU for ged-emacs-devel@m.gmane-mx.org; Thu, 14 Jul 2022 00:45:17 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:37328) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oBqgk-0004Vu-UF for emacs-devel@gnu.org; Thu, 14 Jul 2022 00:42:59 -0400 Original-Received: from mail-yw1-x1132.google.com ([2607:f8b0:4864:20::1132]:37685) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oBqgj-0003IK-3R for emacs-devel@gnu.org; Thu, 14 Jul 2022 00:42:58 -0400 Original-Received: by mail-yw1-x1132.google.com with SMTP id 00721157ae682-31cf1adbf92so5844707b3.4 for ; Wed, 13 Jul 2022 21:42:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=940mBxbHz638s4Kb5SJOar0ebW72rTiRkDYBBJq2uao=; b=a7IoDgH24y/cfkv7WeRPEhSeY2BW1C/5SSQacf3SC3eVqep+eykfQTZGOgLDYsw3ij gc8Bl9W7zzRJRjPJrY+vKVwFaAl/k9t/uEUVRXMMbmN3qAVYGsbIWWG8gLhYelWuwBzO FbWF1Saluf9cF3AKtit9+tBv3ZvSfO9zNuAfPnDDmj0mOeNue6Mv5esIqaIKzWCr/x9j zwF6bvNKcUgJZkBaTd69Nzu4oydWqrOB76Iw+NF2mLBLBN5Js4bokCI5+oAkvzAx+P9p CxH4Yc/0wVFt5CV6xowZyeNEDmgnf4oyece8le4ZNoL3uWaVSbl05WcWF55f9uvipP1l +qzw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=940mBxbHz638s4Kb5SJOar0ebW72rTiRkDYBBJq2uao=; b=cOlaOptvjVQb2v+H925vIshpsANu6S73TRLIVVQZlT6jx7VYNE0W/LVnf/VhdGL6Ol 3SCjAEOFWEPJBQCwECwGMPPfztouh4gMwFg+XyTo3pY7/4ZZcRJPrW4tlQCg6xt/6MY9 f8J/8IPOY8rhhr+9MQeli1gmrkCixOJIJD/026iOYitBMxfz3C/4zjjJFh4TkjlKAJKX x/dnz7MTGQEhMFU/Z7Q3mCAgp29YQBaWR4JJ3HUKKtWFdjbYWv642ElA38TY6FSPExwD MsDbKwRkEiY4ybjyIF0wBDPrlae2Ng/xWOoe0a/ZRLLw0ryWwnF1YNixPH/Juh7trUa6 ZUwQ== X-Gm-Message-State: AJIora8pgwndtM7GG3HRuVbRMQBeHq7mLDjnyLD0SWczYiZgt7YTc461 FO+cEgYbmRH2sEi/WD1p2C8HNJnz0OvxS+JDS54= X-Google-Smtp-Source: AGRyM1vIV3BQ5vinYfeQypdB6t3sfGRmu4XQu5e8xPiJXItVgX5g0OUHveC2iGWz0ETP7cZV4XpluVN4NTs2J1oVfJs= X-Received: by 2002:a81:5404:0:b0:31c:c24d:94b0 with SMTP id i4-20020a815404000000b0031cc24d94b0mr7850947ywb.502.1657773775906; Wed, 13 Jul 2022 21:42:55 -0700 (PDT) In-Reply-To: Received-SPF: pass client-ip=2607:f8b0:4864:20::1132; envelope-from=davin.pearson@gmail.com; helo=mail-yw1-x1132.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, T_SCC_BODY_TEXT_LINE=-0.01 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" Xref: news.gmane.io gmane.emacs.devel:292126 Archived-At: --00000000000007eb9105e3bc892a Content-Type: text/plain; charset="UTF-8" Here are some changes to my earlier email: It is rather unlikely that there is another dmp who uses Elisp out there in the world today. Short of a rewrite of the Elisp code base I recommend that Lisp namespaces be allocated on a first in first served basis, which is how internet domain names are allocated. A more ideal solution would be to borrow Java's package system into Elisp. My package name will be nz.davinpearson. This is a bit unwieldy as it is much easier to use dmp as the name of my package. Perhaps someone out there can come up with a system that combines the tersity of dmp with the guarantee that you will not be treading on someone else's code, like how Java does it.... On Thu, 14 Jul 2022 at 14:30, Davin Pearson wrote: > Is dmp a reasonable prefix for global variables? > > I once used my-* for my global variables but abandoned it > when other people started to use my code. > > It is rather unlikely that there is a dmp out there in the world today. > > Lisp namespaces should be allocated on a first in first served basis, > which is how internet domain names are allocated. > > > > On Thu, 14 Jul 2022 at 13:48, Stefan Monnier > wrote: > >> > I use debugging checkpoints every second line >> > so the following code cannot be written: >> > >> > (defun foo () >> > (progn >> > (progn >> > (zip) >> > (message "&apple:1") >> > (zap) >> > (message "&apple:2") >> > (boo) >> > (message "&apple:3") >> > (bum) >> > (message "&apple:4")))) >> >> I do use separate lines for closing parens every once in a while, don't >> get me wrong. It's just an exception rather than a rule. >> [ Note also that inserting/removing such `message` needs to be different >> for the last element in any case because it determines the return >> value. ] >> >> >> importantly: >> >> - should use `with-current-buffer`. >> > >> > is that instead of (set-buffer buf)? >> >> If you compile the code, the byte-compiler will give you a warning >> suggesting to replace with-current-buffer for save-excursion + set-buffer. >> >> >> - should not `setq` on a global variable that doesn't have an >> appropriate >> >> namespace prefix. >> >> >> > Do you mean the following is not allowed: >> > >> > (setq apple 'banana) >> > >> > but the following code is allowed: >> > >> > (setq dmp-apple 'banana) >> >> Neither are recommended without first declaring that global variable >> (since that's what it is: a global variable). >> And global declarations need to use a proper namespace prefix. >> Otherwise you're at risk of stepping on someone else's toes/variables. >> >> >> Stefan >> >> --00000000000007eb9105e3bc892a Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Here are some changes to my earlier = email:

It is rather unlikely that = there is another dmp who uses Elisp
out there in the world today.=

Short of a rewrite of the Elisp code base I recom= mend that
Lisp namespaces be allocated on a first= in first served basis,
which is how internet domain names are al= located.

A more ideal solution would be to borrow = Java's package
system into Elisp.=C2=A0 My package name will = be nz.davinpearson.
This is a bit unwieldy as it is much easier t= o use dmp as
the name of my package.=C2=A0 Perhaps someone out th= ere can
come up with a system that combines the tersity of dmp wi= th
the guarantee that you will not be treading on someone
else's code, like how Java does it....

On Thu, 14 Jul 2022 at 14:30, Davin Pearson <davin.pearson@gmail.com> wrote:
Is dmp a re= asonable prefix for global variables?

I once used = my-* for my global variables but abandoned it
when other peo= ple started to use my code.

It is rather unlikely = that there is a dmp out there in the world today.

= Lisp namespaces should be allocated on a first in first served basis,
=
which is how internet domain names are allocated.

=


On Thu, 14 Jul 2022 at 13:48, Stefan Monnier <monnier@iro.umontreal.c= a> wrote:
> I use debugging checkpoints every second line
> so the following code cannot be written:
>
> (defun foo ()
>=C2=A0 =C2=A0 (progn
>=C2=A0 =C2=A0 =C2=A0 =C2=A0(progn
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (zip)
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (message "&apple:1") >=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (zap)
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (message "&apple:2") >=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (boo)
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (message "&apple:3") >=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (bum)
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (message "&apple:4")))= )

I do use separate lines for closing parens every once in a while, don't=
get me wrong.=C2=A0 It's just an exception rather than a rule.
[ Note also that inserting/removing such `message` needs to be different =C2=A0 for the last element in any case because it determines the return =C2=A0 value.=C2=A0 ]

>> importantly:
>> - should use `with-current-buffer`.
>
> is that instead of (set-buffer buf)?

If you compile the code, the byte-compiler will give you a warning
suggesting to replace with-current-buffer for save-excursion + set-buffer.<= br>
>> - should not `setq` on a global variable that doesn't have an = appropriate
>>=C2=A0 =C2=A0namespace prefix.
>>
> Do you mean the following is not allowed:
>
> (setq apple 'banana)
>
> but the following code is allowed:
>
> (setq dmp-apple 'banana)

Neither are recommended without first declaring that global variable
(since that's what it is: a global variable).
And global declarations need to use a proper namespace prefix.
Otherwise you're at risk of stepping on someone else's toes/variabl= es.


=C2=A0 =C2=A0 =C2=A0 =C2=A0 Stefan

--00000000000007eb9105e3bc892a--