unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Noam Postavsky <npostavs@users.sourceforge.net>
To: "Yuri D'Elia" <wavexx@thregr.org>
Cc: Emacs developers <emacs-devel@gnu.org>
Subject: Re: "reference to free variable" only during initialization
Date: Wed, 25 Jan 2017 14:50:22 -0500	[thread overview]
Message-ID: <CAM-tV-9zpRW+K46-RQ_Hxdt4Z9enkZ7n7KiWkGX5iAWGJJK9rg@mail.gmail.com> (raw)
In-Reply-To: <877f5j3vto.fsf@wavexx.thregr.org>

On Wed, Jan 25, 2017 at 12:15 PM, Yuri D'Elia <wavexx@thregr.org> wrote:
> 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.

It shouldn't be lost, `warning-suppress-types' just stops the
*Warnings* buffer from popping up. The warnings are still logged in
the background.

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

Hmm, I can't reproduce your original case in 25.1 or 24.5, even after commenting

(defvar isearchp-reg-beg)                 ; In `isearch+.el'
(defvar isearchp-reg-end)                 ; In `isearch+.el'
(defvar isearchp-restrict-to-region-flag) ; In `isearch+.el'

at the top of modeline-posn.el. I have init.el with contents



  reply	other threads:[~2017-01-25 19:50 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
2017-01-25 19:50     ` Noam Postavsky [this message]
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

  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=CAM-tV-9zpRW+K46-RQ_Hxdt4Z9enkZ7n7KiWkGX5iAWGJJK9rg@mail.gmail.com \
    --to=npostavs@users.sourceforge.net \
    --cc=emacs-devel@gnu.org \
    --cc=wavexx@thregr.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 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).