unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Philipp Stephani <p.stephani2@gmail.com>
To: "João Távora" <joaotavora@gmail.com>
Cc: luismbo@gmail.com, 33828@debbugs.gnu.org
Subject: bug#33828: 26.1; Unbound defvar across compilation units
Date: Sat, 22 Dec 2018 23:40:50 +0100	[thread overview]
Message-ID: <CAArVCkSAXGy3j4E=Sj8GTvv95HVZq7waJ3Ot+CqPApKjiZv0FQ@mail.gmail.com> (raw)
In-Reply-To: <87lg4i8ek3.fsf@gmail.com>

Am Sa., 22. Dez. 2018 um 03:46 Uhr schrieb João Távora <joaotavora@gmail.com>:
>
> Eli Zaretskii <eliz@gnu.org> writes:
>
> >> From: Luís Oliveira <luismbo@gmail.com>
> >> Date: Fri, 21 Dec 2018 12:02:55 +0000
> >> Cc: João Távora <joaotavora@gmail.com>
> >>
> >> I think I've come across a bug.
> >
> > Doesn't look like a bug to me.
>
> Indeed, it's the behaviour described in the Emacs manual, but the
> motivation is questionable: it says it's useful for shooshing the
> byte-compiler's warnings.  Aren't there better alternatives to do this
> instead of imposing this seeming inconsistency?

The better alternative is to explicitly `require' the library that
defines the variable.
I see the one-argument `defvar' as the variable equivalent to
`declare-function' - it announces that a variable exists without
defining it. (Maybe there should be a `declare-variable' macro to
mirror `declare-function'.) As such, its use should be exceptional;
most libraries should make sure to not have cyclic dependencies and
use plain `require'.





  parent reply	other threads:[~2018-12-22 22:40 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-12-21 12:02 bug#33828: 26.1; Unbound defvar across compilation units Luís Oliveira
2018-12-21 13:50 ` Luís Oliveira
2018-12-21 20:02 ` Eli Zaretskii
2018-12-22  2:45   ` João Távora
2018-12-22  7:43     ` Eli Zaretskii
2018-12-22 22:40     ` Philipp Stephani [this message]
2018-12-23  1:16       ` João Távora

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='CAArVCkSAXGy3j4E=Sj8GTvv95HVZq7waJ3Ot+CqPApKjiZv0FQ@mail.gmail.com' \
    --to=p.stephani2@gmail.com \
    --cc=33828@debbugs.gnu.org \
    --cc=joaotavora@gmail.com \
    --cc=luismbo@gmail.com \
    /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).