[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: incorrect warning when byte compiling?
From: |
Stefan Monnier |
Subject: |
Re: incorrect warning when byte compiling? |
Date: |
Mon, 25 Jun 2012 18:55:49 -0400 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.1.50 (gnu/linux) |
> Is this a bug/limitation in the Emacs byte compiler?
Bug, no, limitation, yes.
> It's easy enough to silence this warning (e.g., with (when (fboundp
> whitespace-mode) ...)), but I want to know why Emacs thinks this
> is a problem.
Doing "(eval-when-compile (require 'whitespace nil t))" and
then "(when (require 'whitespace nil t)" is very unusual so the
byte-compiler does not try to handle this kind of circumstance cleverly.
Really, (eval-when-compile (require 'whitespace nil t)) is meant for the
case where `whitespace' defines functions or macros which will be called
during byte-compilation; it's not meant to silence compiler warnings.
Rather than fboundp, you can also use `declare-function', whose purpose
is specifically to silence compiler warnings.
Stefan