From: Stefan Monnier <monnier@iro.umontreal.ca>
To: Dan Nicolaescu <dann@ics.uci.edu>
Cc: emacs-devel@gnu.org
Subject: Re: byte compiler warnings when bootstrapping
Date: Sun, 21 Oct 2007 15:38:06 -0400 [thread overview]
Message-ID: <jwv1wbos21l.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <200710211558.l9LFwIBv003882@oogie-boogie.ics.uci.edu> (Dan Nicolaescu's message of "Sun\, 21 Oct 2007 08\:58\:18 -0700")
>> > With that and with adding a few more (eval-when-compile (require 'blah))
>> What is the use of (eval-when-compile (require 'blah)) in this context?
>> I expect it's the wrong solution.
> When the number of warnings for undefined functions is too high it
> might be better to just require the package that defines them. But you
> might be right...
The bytecomp.el has code (which ssems not to work any more) that tries to
re-add the warnings in this case (turns the "unknown function" warnings you
get without the `require' into "not sure it'll be defined at runtime" with
the eval-when-compile require).
So it's not the right approach. `eval-when-compile' should really be used
to require packages that provide a macro or something like that: something
you really need to properly compile the file.
I agree that we need something to turn off specific warnings. Someone at
some point suggested (defun <foo>) following the same idea as (defvar <foo>).
I think it would be good. Although I think I'd rather allow the
external-function-delcaration to give an arglist so that the bytecompiler
can check you passed the right number of arguments as well. So maybe
something like
(declare-function <foo> <fooarglist>)
would work better.
Along similar lines I'd like to add a
(require-lazily <feature>)
which would behave similarly to `require' except that the byte-compiler
would replace it with a bunch of autoloads. so the package would only be
"required" when one of its functions was used.
In any case, for the issue of "dependencies" (e.g. calling
`Info-read-node-name' after `info', or calling `help-buffer' after
`help-setup-xref') I'm not sure what we should ideally do, but the
require-lazily seems like an acceptable solution.
Stefan
next prev parent reply other threads:[~2007-10-21 19:38 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-10-21 7:38 byte compiler warnings when bootstrapping Dan Nicolaescu
2007-10-21 9:50 ` martin rudalics
2007-10-22 9:00 ` Richard Stallman
2007-10-22 20:25 ` Eli Zaretskii
2007-10-23 10:39 ` Richard Stallman
2007-10-21 14:05 ` Stefan Monnier
2007-10-21 15:58 ` Dan Nicolaescu
2007-10-21 16:15 ` David Kastrup
2007-10-21 16:33 ` Dan Nicolaescu
2007-10-21 18:44 ` David Kastrup
2007-10-21 19:38 ` Stefan Monnier [this message]
2007-10-21 23:24 ` Bob Rogers
2007-10-23 7:12 ` Richard Stallman
2007-10-23 7:12 ` Richard Stallman
2007-10-23 14:21 ` Stefan Monnier
2007-10-24 2:49 ` Richard Stallman
2007-10-24 3:49 ` Stefan Monnier
2007-10-25 2:10 ` Richard Stallman
2007-10-23 14:23 ` Stefan Monnier
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=jwv1wbos21l.fsf-monnier+emacs@gnu.org \
--to=monnier@iro.umontreal.ca \
--cc=dann@ics.uci.edu \
--cc=emacs-devel@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.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
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).