all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Yuri D'Elia <wavexx@thregr.org>
To: emacs-devel@gnu.org
Subject: Re: "reference to free variable" only during initialization
Date: Wed, 25 Jan 2017 18:15:15 +0100	[thread overview]
Message-ID: <877f5j3vto.fsf@wavexx.thregr.org> (raw)
In-Reply-To: CAM-tV-8DEB_V7xyQEanAYfpjC0vDOTPStqu6giDuUXdap9rLDQ@mail.gmail.com

On Mon, Jan 16 2017, Noam Postavsky wrote:
>> Warning (bytecomp): reference to free variable ‘isearchp-reg-beg’
>>
>> during startup. The warning is generated by requiring
>> modeline-posn.el[1], which is using ``isearchp-reg-beg`` (actually
>> defvar-ed early on) inside a defadvice form.
>>
>> Is this expected?
>
> There is some unexpected interaction of defadvice with delayed
> warnings. I had noticed this a while back, but never got around to
> fixing it. `ad-compile-function' binds `warning-suppress-types', but
> if warnings are delayed, then the warning call happens after that
> binding is finished.

This explains one difference, but it would mean that when the warning is
not delayed, it would be lost[!]. That would be more serious.

I assumed instead that defadvice was evaluating the body too early,
before defvar (and thus generating an /incorrect/ warning).

>>   emacs -q -l ~/.emacs
>
> In this case, the warnings are not delayed. If you set after-init-time
> to nil, then warnings will be delayed, so the same problem should
> occur, I think:
>
>     emacs -q --eval '(setq after-init-time nil)' -l ~/.emacs

Actually, it doesn't work. No warning is generated in this case.

But if I do the opposite: set after-init-time in the beginning of my
~/.emacs, then I can suppress the warning which indeed suggests some
problem with the delaying.




  reply	other threads:[~2017-01-25 17:15 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-16 23:00 "reference to free variable" only during initialization Yuri D'Elia
2017-01-16 23:47 ` Noam Postavsky
2017-01-25 17:15   ` Yuri D'Elia [this message]
2017-01-25 19:50     ` Noam Postavsky
2017-01-25 19:51       ` Noam Postavsky
2017-02-18 23:01         ` Yuri D'Elia
2017-02-19  4:18           ` Noam Postavsky
2017-02-19 12:32             ` Yuri D'Elia
2017-02-19 13:44               ` Noam Postavsky
2017-02-19 14:22                 ` Yuri D'Elia
2017-02-19 15:58                   ` Drew Adams

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=877f5j3vto.fsf@wavexx.thregr.org \
    --to=wavexx@thregr.org \
    --cc=emacs-devel@gnu.org \
    /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.