From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: John Wiegley Newsgroups: gmane.emacs.help Subject: Re: incorrect warning when byte compiling? Date: Mon, 25 Jun 2012 02:20:17 -0500 Message-ID: References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: dough.gmane.org 1340628915 20732 80.91.229.3 (25 Jun 2012 12:55:15 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Mon, 25 Jun 2012 12:55:15 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Mon Jun 25 14:55:14 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 1Sj8oy-0001qh-IR for geh-help-gnu-emacs@m.gmane.org; Mon, 25 Jun 2012 14:55:12 +0200 Original-Received: from localhost ([::1]:38739 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Sj8oy-0004d7-HR for geh-help-gnu-emacs@m.gmane.org; Mon, 25 Jun 2012 08:55:12 -0400 Original-Path: usenet.stanford.edu!newsfeed.hal-mli.net!feeder3.hal-mli.net!204.52.135.9.MISMATCH!newsfeed.hal-mli.net!feeder1.hal-mli.net!216.196.98.144.MISMATCH!border3.nntp.dca.giganews.com!Xl.tags.giganews.com!border1.nntp.dca.giganews.com!nntp.giganews.com!local2.nntp.dca.giganews.com!news.giganews.com.POSTED!not-for-mail Original-NNTP-Posting-Date: Mon, 25 Jun 2012 07:52:46 -0500 Original-Newsgroups: gnu.emacs.help User-Agent: Gnus/5.130006 (Ma Gnus v0.6) Emacs/24.1 (darwin) Cancel-Lock: sha1:CeZYPUjXHuoQTAC0M2uiW1MXGM8= Original-Lines: 28 X-Usenet-Provider: http://www.giganews.com Original-X-Trace: sv3-otWxcCWNWJwZdqYPgMByijLyynG9WZ7cAwMsXrKHYYmAwHPAlQwKsrUzdEBGnPxve3fHLGWIh9QYOWp!hBAKbszeFrb15gewxZHof+BN4HA8aSDIApaulY5DyLmCwbqUaOwRrf+Bg/8AGoJqV5OSLc+K8kib!tIlC3CrkmH4X0pOf9V6taWoPjqXmqu1MG6ydfgOy Original-X-Complaints-To: abuse@giganews.com X-DMCA-Notifications: http://www.giganews.com/info/dmca.html X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.3.40 X-Original-Bytes: 2327 Original-Xref: usenet.stanford.edu gnu.emacs.help:193057 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:85452 Archived-At: >>>>> Richard Hansen writes: > 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. The byte-compiler doesn't do as much code-flow analysis as you're expecting here. Since the call to `require' is inside a function definition, it doesn't actually need to invoke the `require' to byte-compile the function. So it doesn't know if the function is going to get pulled in by the require or not. You can try moving your require outside the function. > 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. A better way to wrap the code with: (with-no-warnings ...) John