From: Oleksandr Gavenko <gavenkoa@gmail.com>
To: help-gnu-emacs@gnu.org
Subject: (require ...) and file dependencies.
Date: Sun, 28 Dec 2014 01:42:59 +0200 [thread overview]
Message-ID: <87iogwd5h8.fsf@gavenkoa.example.com> (raw)
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!
next reply other threads:[~2014-12-27 23:42 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-12-27 23:42 Oleksandr Gavenko [this message]
2014-12-27 23:59 ` (require ...) and file dependencies 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
[not found] <mailman.16796.1419723800.1147.help-gnu-emacs@gnu.org>
2014-12-28 0:22 ` Stefan Monnier
2015-01-03 14:04 ` Oleksandr Gavenko
2015-01-03 14:30 ` Oleksandr Gavenko
2015-01-03 2:12 ` Emanuel Berg
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87iogwd5h8.fsf@gavenkoa.example.com \
--to=gavenkoa@gmail.com \
--cc=help-gnu-emacs@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).