unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Davin Pearson <davin.pearson@gmail.com>
To: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: emacs-devel <emacs-devel@gnu.org>
Subject: Re: Special Event: Davin reveals his own personal additions to Emacs.
Date: Thu, 14 Jul 2022 10:57:10 +1200	[thread overview]
Message-ID: <CAG9ihEvniotL4T2X=DRq4L4A-og_J2o41aSSJPNtrp7+=avAyA@mail.gmail.com> (raw)
In-Reply-To: <jwvilo11zjp.fsf-monnier+emacs@gnu.org>

[-- Attachment #1: Type: text/plain, Size: 1682 bytes --]

On Wed, 13 Jul 2022 at 15:08, Stefan Monnier <monnier@iro.umontreal.ca>
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.

[-- Attachment #2: Type: text/html, Size: 3093 bytes --]

  reply	other threads:[~2022-07-13 22:57 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-10  3:39 Special Event: Davin reveals his own personal additions to Emacs Davin Pearson
2022-07-10  8:56 ` Philip Kaludercic
2022-07-12 23:20   ` Davin Pearson
2022-07-10 11:45 ` Jean Louis
2022-07-12 22:35   ` Davin Pearson
2022-07-13  3:08     ` Stefan Monnier
2022-07-13 22:57       ` Davin Pearson [this message]
2022-07-14  1:47         ` Stefan Monnier
2022-07-14  2:30           ` Davin Pearson
2022-07-14  4:42             ` Davin Pearson
2022-07-14 14:13             ` Stefan Monnier
2022-07-10 12:57 ` Stefan Monnier
2022-07-10 16:03   ` Document that symbol prefix "my-" (or other) should be left for users Teemu Likonen
2022-07-10 16:59     ` Stefan Kangas
2022-07-10 18:11       ` Bozhidar Batsov
2022-07-10 19:20         ` Tim Cross
2022-07-11  3:17           ` Richard Stallman
2022-07-10 18:22   ` Special Event: Davin reveals his own personal additions to Emacs Clément Pit-Claudel
2022-07-10 19:50     ` Rudolf Adamkovič
2022-07-17  1:43 ` Davin Pearson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAG9ihEvniotL4T2X=DRq4L4A-og_J2o41aSSJPNtrp7+=avAyA@mail.gmail.com' \
    --to=davin.pearson@gmail.com \
    --cc=emacs-devel@gnu.org \
    --cc=monnier@iro.umontreal.ca \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).