all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* (require ...) and file dependencies.
@ 2014-12-27 23:42 Oleksandr Gavenko
  2014-12-27 23:59 ` Oleksandr Gavenko
                   ` (3 more replies)
  0 siblings, 4 replies; 11+ messages in thread
From: Oleksandr Gavenko @ 2014-12-27 23:42 UTC (permalink / raw)
  To: help-gnu-emacs

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!




^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2015-01-03 17:34 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <mailman.16796.1419723800.1147.help-gnu-emacs@gnu.org>
2014-12-28  0:22 ` (require ...) and file dependencies Stefan Monnier
2015-01-03 14:04   ` Oleksandr Gavenko
2015-01-03 14:30   ` Oleksandr Gavenko
2015-01-03  2:12 ` Emanuel Berg
2014-12-27 23:42 Oleksandr Gavenko
2014-12-27 23:59 ` Oleksandr Gavenko
2014-12-28  0:09 ` Dmitry Gutov
     [not found] ` <mailman.16797.1419724814.1147.help-gnu-emacs@gnu.org>
2014-12-28  0:24   ` Stefan Monnier
     [not found] ` <mailman.16798.1419725386.1147.help-gnu-emacs@gnu.org>
2015-01-03  2:14   ` Emanuel Berg
2015-01-03 14:51     ` Oleksandr Gavenko
     [not found]     ` <mailman.17173.1420296692.1147.help-gnu-emacs@gnu.org>
2015-01-03 17:34       ` Emanuel Berg

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.