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

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

(require ...) and file dependencies.


From: Oleksandr Gavenko
Subject: (require ...) and file dependencies.
Date: Sun, 28 Dec 2014 01:42:59 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4 (gnu/linux)

During compilation I got:

  Warning: reference to free variable
  Warning: assignment to free variable

They may fixed by:

  (eval-when-compile
    (defvar ...))

But what to do with:

  Warning: the function `...' is not known to be defined.

I have:

  xxx-mode.el
  xxx-update.el

and both files mix uses of variables and functions. "xxx-mode.el" have

  (require 'xxx-update)

and designed to be loaded by user. So "xxx-update.el" can't use

  (require 'xxx-mode)

or you get:

  Error: Recursive `require' for feature `xxx-mode'

Is that right to use (this is used in CEDET):

  (eval-when-compile
    (require 'xxx-mode))

Seems that proper way to fix issue is by rearranging dependency hierarchy by
breaking dependency cycles, isn't?

I think that I need to move shared definitions from xxx-mode.el into
xxx-core.el:

  xxx-mode.el:
    (require 'xxx-core)
    (require 'xxx-update)

  xxx-update.el:
    (require 'xxx-core)

I check elisp sources for influence:

  cc-vars.el
  cc-defs.el
  cc-mode.el
  
  cedet-devel-load.el

so elisp sources usually organise dependency in acyclic graph and provides
special loaders.

-- 
Best regards!




reply via email to

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