emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Special Event: Davin reveals his own personal additions to Emacs.


From: Davin Pearson
Subject: Re: Special Event: Davin reveals his own personal additions to Emacs.
Date: Thu, 14 Jul 2022 10:57:10 +1200

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.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]