all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: "João Távora" <joaotavora@gmail.com>
To: Philipp Stephani <p.stephani2@gmail.com>
Cc: "Luís Borges de Oliveira" <luismbo@gmail.com>, 33828@debbugs.gnu.org
Subject: bug#33828: 26.1; Unbound defvar across compilation units
Date: Sun, 23 Dec 2018 01:16:38 +0000	[thread overview]
Message-ID: <CALDnm538UQ4Kkg6y1xh9QCfeZuCOfJmMM_J2T5ww7HYQg-K-GA@mail.gmail.com> (raw)
In-Reply-To: <CAArVCkSAXGy3j4E=Sj8GTvv95HVZq7waJ3Ot+CqPApKjiZv0FQ@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 1409 bytes --]

On Sat, Dec 22, 2018 at 10:41 PM Philipp Stephani <p.stephani2@gmail.com>
wrote:

> 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'.
>

I think in Luís original report there is a `require' of the library where
the variable is declared before using it. Unfortunately it only works
when it is declared with an initial value.

João

[-- Attachment #2: Type: text/html, Size: 2198 bytes --]

      reply	other threads:[~2018-12-23  1:16 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
2018-12-23  1:16       ` João Távora [this message]

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

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CALDnm538UQ4Kkg6y1xh9QCfeZuCOfJmMM_J2T5ww7HYQg-K-GA@mail.gmail.com \
    --to=joaotavora@gmail.com \
    --cc=33828@debbugs.gnu.org \
    --cc=luismbo@gmail.com \
    --cc=p.stephani2@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 external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.