From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Joe Riel Newsgroups: gmane.emacs.help Subject: Avoiding 'reference to free variable' warnings while splitting elisp source files Date: Sat, 23 Mar 2013 09:08:00 -0700 Message-ID: <20130323090800.172d8df4@gauss> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1364054902 3704 80.91.229.3 (23 Mar 2013 16:08:22 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 23 Mar 2013 16:08:22 +0000 (UTC) To: Help GNU Emacs Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sat Mar 23 17:08:42 2013 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1UJQzp-0004CT-Sw for geh-help-gnu-emacs@m.gmane.org; Sat, 23 Mar 2013 17:08:42 +0100 Original-Received: from localhost ([::1]:58918 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UJQzS-0003rI-8m for geh-help-gnu-emacs@m.gmane.org; Sat, 23 Mar 2013 12:08:18 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:51520) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UJQzF-0003qB-Cb for help-gnu-emacs@gnu.org; Sat, 23 Mar 2013 12:08:06 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UJQzE-0005UX-EH for help-gnu-emacs@gnu.org; Sat, 23 Mar 2013 12:08:05 -0400 Original-Received: from cdptpa-omtalb.mail.rr.com ([75.180.132.120]:39694) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UJQzE-0005U7-AP for help-gnu-emacs@gnu.org; Sat, 23 Mar 2013 12:08:04 -0400 X-Authority-Analysis: v=2.0 cv=XNeyuHdE c=1 sm=0 a=GGzZdJT2oJO+GUpSCk/8YQ==:17 a=A67dEwaWxOsA:10 a=w4x0Pc6c15sA:10 a=05ChyHeVI94A:10 a=kj9zAlcOel0A:10 a=ayC55rCoAAAA:8 a=HGx_D_ErsIgA:10 a=y49E0Ri3ITkhNKWuwEwA:9 a=CjuIK1q_8ugA:10 a=GGzZdJT2oJO+GUpSCk/8YQ==:117 X-Cloudmark-Score: 0 X-Authenticated-User: X-Originating-IP: 66.75.5.27 Original-Received: from [66.75.5.27] ([66.75.5.27:48588] helo=gauss) by cdptpa-oedge02.mail.rr.com (envelope-from ) (ecelerity 2.2.3.46 r()) with ESMTP id 85/96-04559-163DD415; Sat, 23 Mar 2013 16:08:01 +0000 X-Mailer: Claws Mail 3.7.9 (GTK+ 2.24.4; x86_64-pc-linux-gnu) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 75.180.132.120 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:89689 Archived-At: 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. -- Joe Riel