unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Drew Adams <drew.adams@oracle.com>
To: Michael Heerdegen <michael_heerdegen@web.de>,
	Emacs Development <emacs-devel@gnu.org>
Subject: RE: defvar without value
Date: Tue, 31 Mar 2020 17:36:36 -0700 (PDT)	[thread overview]
Message-ID: <37aee3f6-e95f-471d-b565-79022ab8980b@default> (raw)
In-Reply-To: <87k1302htp.fsf@web.de>

> Using `defvar' (on top-level) without specifying a value differs in two
> ways from calls that specify a value: (1) the variable's value is not
> set, and (2) the variable is made special only in the context of the
> (rest of the) current file or buffer.
> 
> I wonder if it is good that these two things are chained together, and
> if there are alternatives to what we have now.  Latest changes have
> revealed that in some cases, people wanted (1) to always get compiler
> warnings when a variable is not explicitly bound, but they didn't
> intend
> that the variable is not always special.  Dunno to how many people this
> happened, but it is a kind of pitfall.

I've thought the same thing.  I don't see a logical connection.  If that's right then linking them is a bit ugly.

For one thing, it seems wrong that the only way to proclaim that a variable is to special globally is to give it a defvar default value.



  reply	other threads:[~2020-04-01  0:36 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-01  0:03 defvar without value Michael Heerdegen
2020-04-01  0:36 ` Drew Adams [this message]
2020-04-01  0:59 ` Stefan Monnier
2020-04-01 22:45   ` Michael Heerdegen
2020-04-02  2:37     ` Stefan Monnier
2020-04-09  1:52       ` Michael Heerdegen
2020-04-09  2:04         ` Emanuel Berg via Emacs development discussions.
2020-04-09  2:20         ` Stefan Monnier
2020-04-09 23:34           ` Emanuel Berg via Emacs development discussions.
2020-04-10 15:20             ` Bruno Félix Rezende Ribeiro
2020-04-10 23:07               ` Emanuel Berg via Emacs development discussions.
2020-04-10 21:57           ` Michael Heerdegen
2020-04-01  1:21 ` Noam Postavsky
2020-04-01  1:53   ` Michael Heerdegen

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=37aee3f6-e95f-471d-b565-79022ab8980b@default \
    --to=drew.adams@oracle.com \
    --cc=emacs-devel@gnu.org \
    --cc=michael_heerdegen@web.de \
    /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).