From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Ludwig, Mark" Newsgroups: gmane.emacs.help Subject: Compilation warnings of ELisp seem wrong and misleading Date: Mon, 30 Mar 2015 13:47:41 +0000 Message-ID: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1427724555 20390 80.91.229.3 (30 Mar 2015 14:09:15 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 30 Mar 2015 14:09: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 Mar 30 16:09:01 2015 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 1YcaMu-0005sY-MB for geh-help-gnu-emacs@m.gmane.org; Mon, 30 Mar 2015 16:08:44 +0200 Original-Received: from localhost ([::1]:34142 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YcaMt-0006iN-NQ for geh-help-gnu-emacs@m.gmane.org; Mon, 30 Mar 2015 10:08:43 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:54784) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YcaMW-0006Yc-2r for help-gnu-emacs@gnu.org; Mon, 30 Mar 2015 10:08:26 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YcaMN-0000Ry-Qk for help-gnu-emacs@gnu.org; Mon, 30 Mar 2015 10:08:20 -0400 Original-Received: from usslmhub002.ugs.com ([134.244.32.85]:50471 helo=ugs.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YcaMN-0000RX-GI for help-gnu-emacs@gnu.org; Mon, 30 Mar 2015 10:08:11 -0400 Original-Received: from USSLMMBX003.net.plm.eds.com ([169.254.2.251]) by USSLMHUB002.net.plm.eds.com ([134.244.32.85]) with mapi id 14.03.0224.002; Mon, 30 Mar 2015 08:47:44 -0500 Thread-Topic: Compilation warnings of ELisp seem wrong and misleading Thread-Index: AdBq7hwEwUskBuT4QGSNSCDnD05eEw== Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [146.122.224.127] X-detected-operating-system: by eggs.gnu.org: Windows 7 or 8 X-Received-From: 134.244.32.85 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:103448 Archived-At: Greetings, I've been using an ancient Emacs (19.29) on Solaris and finally got around to installing a current one (24.4). I don't normally compile my ".emacs" code, but stumbled across a change in the compile code (compile-internal is no longer present), and that prompted me to explicitly byte-compile my custom Elisp code to see what other problems that would expose, so I could take care of all of them at the same time. I find my custom Elisp generates warnings that seem pretty stupid. For example: emacs.el:255:10:Warning: reference to free variable `if' emacs.el:219:8:Warning: reference to free variable `save-excursion' emacs.el:331:41:Warning: reference to free variable `forward-char' emacs.el:261:17:Warning: reference to free variable `insert' emacs.el:261:17:Warning: reference to free variable `forward-sexp' Those are all valid functions. For example, here are lines 255-258: (if (not (=3D ans ?q)) (progn (goto-char found-start) (delete-region found-start found-end))) This is inside a large-ish "let*" form (111 lines). Most of this code is duplicated on Windows, where I'm using Emacs 24.2 (just to give some context that my Elisp knowledge isn't all completely ancient). I can't see how these warnings can be correct, but there are so many that they obscure the "meaningful" ones. Are these sorts of warnings known flaws in the byte compiler, do I need to compile differently, am I doing something stupid, or what? BTW, I /very/ /much/ /like/ this warning: emacs.el:1326:76:Warning: Use `with-current-buffer' rather than save-excursion+set-buffer Thanks for that! Cheers, Mark Ludwig Lifecycle Coll Product Lifecycle Management Siemens Industry Sector Siemens Product Lifecycle Management Software Inc. 5939 Rice Creek Parkway Shoreview, MN 55126 United States=20 Tel. :+1 (651) 855-6140 Fax :+1 (651) 855-6280 ludwig.mark@siemens.com=20 www.siemens.com/plm=20