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

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

Re: Splitting emacs source files without getting 'reference to free vari


From: Pascal J. Bourguignon
Subject: Re: Splitting emacs source files without getting 'reference to free variable' errors
Date: Sat, 23 Mar 2013 17:20:01 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.2 (gnu/linux)

Joe Riel <jriel@maplesoft.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?
> I have half a dozen source files that are all required
> by one package.  A variable may be used in several files
> (generally it is used mainly in one file, which is where
> it is defined (with defvar), but, must be used in another.
> I've tried adding 
>
> (eval-when-compile
>   (require 'other-source-file))
>
> to avoid the error; that sort of works, but not
> when two files each uses a variable defined in the other.
>
> There has to be a better way.

See the other thread.

-- 
__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]