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 10:57:10 +1200 Message-ID: References: Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="000000000000391eb105e3b7b52d" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="40042"; 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 00:59:51 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 1oBlKh-000AF5-15 for ged-emacs-devel@m.gmane-mx.org; Thu, 14 Jul 2022 00:59:51 +0200 Original-Received: from localhost ([::1]:56012 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oBlKf-00060M-O5 for ged-emacs-devel@m.gmane-mx.org; Wed, 13 Jul 2022 18:59:49 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:57422) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oBlIK-0004pe-R0 for emacs-devel@gnu.org; Wed, 13 Jul 2022 18:57:24 -0400 Original-Received: from mail-yb1-xb2c.google.com ([2607:f8b0:4864:20::b2c]:36589) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oBlIJ-0000YZ-BH for emacs-devel@gnu.org; Wed, 13 Jul 2022 18:57:24 -0400 Original-Received: by mail-yb1-xb2c.google.com with SMTP id n74so353188yba.3 for ; Wed, 13 Jul 2022 15:57:22 -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=9h2P3DR2qHgdlB+csqrvlxrVrWlw1lup48ERnpq2ZIM=; b=ihR4HEvMhMYvEUR35jtNhOsSiEMjIs9xbt3HoYIX9EdMVtzzB9hwEz7hmUzVRcaM2E KyOGPEdkV5KasmJ+A6sml5kIJ9q5k+2L58/Vw2VIZk0JaoL58dGq5WgJLXzZxI50elCO +qeqHdNKWg6S0A7bP6a0Dr5WxwtsNxIOAUXVP8wurPxk4PYMl2iVf2b3VHQr5UgUibvy dP4Gbbp9H/5YY23vbz7VYpIDJ5LuUZmjE6P6y0zRvvD/nUo9B4ZcKGq6Ar4T9dutYfB3 ZQts6qFMgx69BTt8WhZzWRuuWA91b4OueFTSBLxgg+J7iv+qhcwYBIVPsLVzdKPZ1UxB qGwA== 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=9h2P3DR2qHgdlB+csqrvlxrVrWlw1lup48ERnpq2ZIM=; b=CrNQIdgKRj2WJHsR+rEJIm484abpwPaZvLeTKkq+g1WevWkScP+qADF/LuM/1hZhPG kbcjZ2UJPei6opySarEOfcjzL/rx/bnFWzRPSFuRofvysJ5p+zFl/dpclhjX5HtlVnBc K6KN5OqFguzpixdh6tu4LnfeUuo62w71jJbLZ77fcmnKGbTbjY4z/tswZbkuljVXGAr/ YkVMB0SWVfEbcJH3W16fBW9J0soQZKgcWP8IIJgoDWvfDgFRksudFF4si8LV7ndrWE7F qMJtvtEv4dzIsV+2zDBvPjCYIiHLN3YmZK4PRFDXfr/sGdp6vwjqozM97eaIkaGb1Wlt XGHw== X-Gm-Message-State: AJIora978EAFQw2CMLRkW52VGafBgZlMkuUuUyPFm+sJnF8KQCSQYWiS dVtZIAt7e9TDMePaN6KbCZIlPkV87rLMYWzzU9e8S6wWQ3s= X-Google-Smtp-Source: AGRyM1uQ+eV7g6B7GvCWwfBnfoJ6QARP6liUqUmoVQHyc45gUvdPq02CiU6WIWZrfvVjrHVEB7UCq8AywroUpQqx7As= X-Received: by 2002:a25:33d6:0:b0:64a:9d22:f005 with SMTP id z205-20020a2533d6000000b0064a9d22f005mr6074780ybz.54.1657753042491; Wed, 13 Jul 2022 15:57:22 -0700 (PDT) In-Reply-To: Received-SPF: pass client-ip=2607:f8b0:4864:20::b2c; envelope-from=davin.pearson@gmail.com; helo=mail-yb1-xb2c.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:292117 Archived-At: --000000000000391eb105e3b7b52d Content-Type: text/plain; charset="UTF-8" On Wed, 13 Jul 2022 at 15:08, Stefan Monnier wrote: > >> Parenthesis shall end together, not like this: > >> > >> (defun manifest--log-message (msg) > >> (save-excursion > >> (set-buffer manifest--buffer) > >> (goto-char (point-max)) > >> (setq latest-file (manifest--get-latest-file)) > >> (insert msg "\n") > >> ) > >> ) > >> > >> rather like: > >> > >> (defun manifest--log-message (msg) > >> (save-excursion > >> (set-buffer manifest--buffer) > >> (goto-char (point-max)) > >> (setq latest-file (manifest--get-latest-file)) > >> (insert msg "\n"))) > > I dislike those close-parens-on-their-own-lines as well, 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")))) Because the line (message &apple:4")))) will be deleted using some code that comments out all debugging checkpoints. Now that I think of it, I think I could get my code to behave sensibly in this case... It just adds 1 more layer of intelligence that I need to write. > but more > importantly: > - should use `with-current-buffer`. > is that instead of (set-buffer buf)? > - 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) Thanks for your valuable time in helping to make my code more standards compliant. --000000000000391eb105e3b7b52d Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
On Wed, 13 Jul 2022 at 15:08, Stefan Monnier <monnier@iro.umontreal.ca> wrote:
<= blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-l= eft:1px solid rgb(204,204,204);padding-left:1ex">>> Parenthesis shall= end together, not like this:
>>
>> (defun manifest--log-message (msg)
>>=C2=A0 =C2=A0(save-excursion
>>=C2=A0 =C2=A0 =C2=A0(set-buffer manifest--buffer)
>>=C2=A0 =C2=A0 =C2=A0(goto-char (point-max))
>>=C2=A0 =C2=A0 =C2=A0(setq latest-file (manifest--get-latest-file))<= br> >>=C2=A0 =C2=A0 =C2=A0(insert msg "\n")
>>=C2=A0 =C2=A0 =C2=A0)
>>=C2=A0 =C2=A0)
>>
>> rather like:
>>
>> (defun manifest--log-message (msg)
>>=C2=A0 =C2=A0(save-excursion
>>=C2=A0 =C2=A0 =C2=A0(set-buffer manifest--buffer)
>>=C2=A0 =C2=A0 =C2=A0(goto-char (point-max))
>>=C2=A0 =C2=A0 =C2=A0(setq latest-file (manifest--get-latest-file))<= br> >>=C2=A0 =C2=A0 =C2=A0(insert msg "\n")))

I dislike those close-parens-on-their-own-lines as well,
=
I use debugging checkpoints every second line
so t= he following code cannot be written:

(defun foo ()=
=C2=A0=C2=A0 (progn
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (pr= ogn
=C2=A0=C2=A0=C2=A0=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=C2=A0=C2=A0=C2=A0 (zap)
=C2=A0=C2=A0 =C2=A0=C2=A0 =C2=A0=C2=A0 (message "&apple= :2")
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (boo)<= br>
=C2=A0=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 (message &qu= ot;&apple:3")
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0 (bum)
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0 (message "&apple:4"))))

=
Because the line (message &apple:4")))) will be deleted
using some code that comments out all debugging checkpoints.
Now that I think of it, I think I could get my code to behave
<= div>sensibly in this case... It just adds 1 more layer of intelligence
that I need to write.
=C2=A0
> but more
importantly:
- should use `with-current-buffer`.

is = that instead of (set-buffer buf)?
=C2=A0
- should not `setq` on a global variable that doesn't have an appropria= te
=C2=A0 namespace prefix.

Do you mean th= e following is not allowed:

(setq apple 'banan= a)

but the following code is allowed:
(setq dmp-apple 'banana)

Thanks f= or your valuable time in helping
to make my code more standards c= ompliant.

--000000000000391eb105e3b7b52d--