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 16:42:44 +1200

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 <davin.pearson@gmail.com> 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 <monnier@iro.umontreal.ca> 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


reply via email to

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