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: Splitting emacs source files without getting 'reference to free variable' errors Date: Sat, 23 Mar 2013 08:57:12 -0700 Organization: Maplesoft Message-ID: <20130323085712.1b4756e4@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 1364055481 9154 80.91.229.3 (23 Mar 2013 16:18:01 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 23 Mar 2013 16:18:01 +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:18:28 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 1UJR9H-0001vD-TY for geh-help-gnu-emacs@m.gmane.org; Sat, 23 Mar 2013 17:18:28 +0100 Original-Received: from localhost ([::1]:60365 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UJR8u-0006CY-BP for geh-help-gnu-emacs@m.gmane.org; Sat, 23 Mar 2013 12:18:04 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:53165) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UJR8h-0006CP-89 for help-gnu-emacs@gnu.org; Sat, 23 Mar 2013 12:17:53 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UJR8d-00082K-Ob for help-gnu-emacs@gnu.org; Sat, 23 Mar 2013 12:17:51 -0400 Original-Received: from icw8kmai01.maplesoft.com ([199.71.183.105]:40718) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UJR8d-00082A-Ke for help-gnu-emacs@gnu.org; Sat, 23 Mar 2013 12:17:47 -0400 Original-Received: from gauss (10.10.50.15) by ICW8KMAI01.maplesoft.com (10.10.1.105) with Microsoft SMTP Server (TLS) id 8.3.279.5; Sat, 23 Mar 2013 11:57:22 -0400 X-Mailer: Claws Mail 3.7.9 (GTK+ 2.24.4; x86_64-pc-linux-gnu) X-detected-operating-system: by eggs.gnu.org: Windows 7 or 8 X-Received-From: 199.71.183.105 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:89690 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