From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Richard Hansen Newsgroups: gmane.emacs.help Subject: incorrect warning when byte compiling? Date: Sun, 24 Jun 2012 14:54:24 -0400 Message-ID: <4FE76260.4070709@bbn.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: dough.gmane.org 1340564215 14532 80.91.229.3 (24 Jun 2012 18:56:55 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sun, 24 Jun 2012 18:56:55 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sun Jun 24 20:56:55 2012 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1SirzS-0004P7-Sq for geh-help-gnu-emacs@m.gmane.org; Sun, 24 Jun 2012 20:56:55 +0200 Original-Received: from localhost ([::1]:45152 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SirzS-00060Q-OR for geh-help-gnu-emacs@m.gmane.org; Sun, 24 Jun 2012 14:56:54 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:38717) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SirxC-0005rh-7U for help-gnu-emacs@gnu.org; Sun, 24 Jun 2012 14:54:35 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SirxA-0008Nk-Aq for help-gnu-emacs@gnu.org; Sun, 24 Jun 2012 14:54:33 -0400 Original-Received: from smtp.bbn.com ([128.33.0.80]:48276) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SirxA-0008NP-7J for help-gnu-emacs@gnu.org; Sun, 24 Jun 2012 14:54:32 -0400 Original-Received: from socket.bbn.com ([192.1.120.102]:51202) by smtp.bbn.com with esmtps (TLSv1:AES256-SHA:256) (Exim 4.77 (FreeBSD)) (envelope-from ) id 1Sirx5-0000l3-7F for help-gnu-emacs@gnu.org; Sun, 24 Jun 2012 14:54:27 -0400 X-Submitted: to socket.bbn.com (Postfix) with ESMTPSA id A85493FE9C User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:13.0) Gecko/20120615 Thunderbird/13.0.1 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 128.33.0.80 X-Mailman-Approved-At: Sun, 24 Jun 2012 14:56:51 -0400 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:85436 Archived-At: Hi all, I'm getting a warning when byte compiling that I think shouldn't be a warning. I'm using Emacs 23.3.1 on Linux. If I put the following in foo.el: (defun whitespace-redraw () (eval-when-compile (require 'whitespace nil t)) (when (require 'whitespace nil t) (if whitespace-mode (whitespace-mode 0)) (whitespace-mode 1))) and then byte compile it: emacs -Q --batch --eval '(byte-compile-file "foo.el")' I get the following warning: In end of data: foo.el:7:1:Warning: the function `whitespace-mode' might not be defined at runtime. Wrote foo.elc Yes, whitespace-mode can be undefined at runtime, but only if the whitespace feature isn't available. If whitespace is NOT available, the body of the 'when' will not execute, so it won't try to execute the undefined whitespace-mode function. If whitespace IS available, whitespace-mode is guaranteed to be defined. Either way, there's no way Emacs will try to execute an undefined whitespace-mode function. So why is Emacs printing the warning? Is this a bug/limitation in the Emacs byte compiler? Or is there a subtle bug in my code? 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. Thanks, Richard