help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Avoiding 'reference to free variable' warnings while splitting elisp


From: Pascal J. Bourguignon
Subject: Re: Avoiding 'reference to free variable' warnings while splitting elisp source files
Date: Sat, 23 Mar 2013 17:19:40 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.2 (gnu/linux)

Jay Belanger <jay.p.belanger@gmail.com> writes:

>> Is there a sane way to split the source of an elisp file
>> while avoiding the 'reference to free variable' warnings
>> when byte-compiling?
>>
>> The problem arises when a variable defined in one file
>> is used in another.   How does one avoid those errors?
>
> You can put
> (defvar variable-name)
> in the other file.

Nope.  Because then the initialization depends on the order of loading
the files.

You can put the defvar in a variable.el file that is required by all the
others.

-- 
__Pascal Bourguignon__                     http://www.informatimago.com/
A bad day in () is better than a good day in {}.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]