[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#59057: Emacs 29. Byte compiler sometimes forgets about a defvar.
From: |
Eli Zaretskii |
Subject: |
bug#59057: Emacs 29. Byte compiler sometimes forgets about a defvar. |
Date: |
Thu, 24 Nov 2022 21:33:24 +0200 |
> Cc: Alan Mackenzie <acm@muc.de>, 59057@debbugs.gnu.org
> From: Stefan Kangas <stefankangas@gmail.com>
> Date: Thu, 24 Nov 2022 11:29:32 -0800
>
> Stefan Monnier <monnier@iro.umontreal.ca> writes:
>
> >> The basic problem is that defvar is a dog's breakfast of a function. In
> >> fact, it's two distinct functions sharing a name. These two functions
> >> have little else to do with eachother.
> >
> > Yup.
> >
> >> And defvar appears to be the only function in Emacs where supplying nil
> >> as an &optional argument has an effect different from omitting it. This
> >> is bad for anybody trying to learn Emacs Lisp.
> >
> > Not the only one, sadly (`declare-function` comes to mind :-)), but yes,
> > it's unusual.
>
> I guess defvar will have to stay as it is. But would it make sense to
> add a new `declare-variable' function, and then document the form
>
> (defvar <foo>)
>
> to be considered deprecated?
It makes no sense to me to deprecate (defvar FOO). There are only
disadvantages down that path (massive annoyance or breakage of third-party
code, if nothing else). Please don't.
- bug#59057: Emacs 29. Byte compiler sometimes forgets about a defvar., Alan Mackenzie, 2022/11/05
- bug#59057: Emacs 29. Byte compiler sometimes forgets about a defvar., Stefan Monnier, 2022/11/07
- bug#59057: Emacs 29. Byte compiler sometimes forgets about a defvar., Stefan Monnier, 2022/11/07
- bug#59057: Emacs 29. Byte compiler sometimes forgets about a defvar., Alan Mackenzie, 2022/11/09
- bug#59057: Emacs 29. Byte compiler sometimes forgets about a defvar., Stefan Monnier, 2022/11/09
- bug#59057: Emacs 29. Byte compiler sometimes forgets about a defvar., Stefan Kangas, 2022/11/24
- bug#59057: Emacs 29. Byte compiler sometimes forgets about a defvar.,
Eli Zaretskii <=
- bug#59057: Emacs 29. Byte compiler sometimes forgets about a defvar., Stefan Monnier, 2022/11/24
- bug#59057: Emacs 29. Byte compiler sometimes forgets about a defvar., Stefan Kangas, 2022/11/24
- bug#59057: Emacs 29. Byte compiler sometimes forgets about a defvar., Alan Mackenzie, 2022/11/25