From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Yuri D'Elia Newsgroups: gmane.emacs.devel Subject: Re: "reference to free variable" only during initialization Date: Wed, 25 Jan 2017 18:15:15 +0100 Message-ID: <877f5j3vto.fsf@wavexx.thregr.org> References: <87ziiq4nll.fsf@wavexx.thregr.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: blaine.gmane.org 1485364561 21445 195.159.176.226 (25 Jan 2017 17:16:01 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Wed, 25 Jan 2017 17:16:01 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1 (gnu/linux) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Jan 25 18:15:57 2017 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cWRAh-0004Uy-Et for ged-emacs-devel@m.gmane.org; Wed, 25 Jan 2017 18:15:47 +0100 Original-Received: from localhost ([::1]:33245 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cWRAm-0000lk-Ob for ged-emacs-devel@m.gmane.org; Wed, 25 Jan 2017 12:15:52 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:36174) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cWRAg-0000lT-SY for emacs-devel@gnu.org; Wed, 25 Jan 2017 12:15:47 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cWRAd-0005Q0-Jr for emacs-devel@gnu.org; Wed, 25 Jan 2017 12:15:46 -0500 Original-Received: from [195.159.176.226] (port=34070 helo=blaine.gmane.org) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1cWRAd-0005Pf-Dm for emacs-devel@gnu.org; Wed, 25 Jan 2017 12:15:43 -0500 Original-Received: from list by blaine.gmane.org with local (Exim 4.84_2) (envelope-from ) id 1cWRAR-0003Om-5a for emacs-devel@gnu.org; Wed, 25 Jan 2017 18:15:31 +0100 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 34 Original-X-Complaints-To: usenet@blaine.gmane.org Cancel-Lock: sha1:EVqP9OCRfzCgK6npbpmtBa5/Y3M= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 195.159.176.226 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:211600 Archived-At: 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.