From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Dave Love Newsgroups: gmane.emacs.devel Subject: Re: cc-vars.el Date: 20 Nov 2002 16:38:14 +0000 Sender: emacs-devel-admin@gnu.org Message-ID: References: <200211180057.JAA24537@etlken.m17n.org> <5bbs4m8qz9.fsf@lister.roxen.com> <5badk5l2kx.fsf@lister.roxen.com> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: main.gmane.org 1037810536 15646 80.91.224.249 (20 Nov 2002 16:42:16 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Wed, 20 Nov 2002 16:42:16 +0000 (UTC) Cc: Kenichi Handa , rms@gnu.org, emacs-devel@gnu.org Return-path: Original-Received: from quimby.gnus.org ([80.91.224.244]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 18EXvX-00043e-00 for ; Wed, 20 Nov 2002 17:42:11 +0100 Original-Received: from monty-python.gnu.org ([199.232.76.173]) by quimby.gnus.org with esmtp (Exim 3.12 #1 (Debian)) id 18EXyn-0007L2-00 for ; Wed, 20 Nov 2002 17:45:34 +0100 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.10) id 18EXsj-0000Dx-00; Wed, 20 Nov 2002 11:39:17 -0500 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.10) id 18EXru-000802-00 for emacs-devel@gnu.org; Wed, 20 Nov 2002 11:38:26 -0500 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.10) id 18EXrr-0007xA-00 for emacs-devel@gnu.org; Wed, 20 Nov 2002 11:38:26 -0500 Original-Received: from albion.dl.ac.uk ([148.79.80.39]) by monty-python.gnu.org with esmtp (Exim 4.10) id 18EXrn-0007sJ-00; Wed, 20 Nov 2002 11:38:19 -0500 Original-Received: from fx by albion.dl.ac.uk with local (Exim 3.35 #1 (Debian)) id 18EXri-00030f-00; Wed, 20 Nov 2002 16:38:14 +0000 Original-To: Martin Stjernholm Original-Lines: 42 User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2 Errors-To: emacs-devel-admin@gnu.org X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.0.11 Precedence: bulk List-Help: List-Post: List-Subscribe: , List-Id: Emacs development discussions. List-Unsubscribe: , List-Archive: Xref: main.gmane.org gmane.emacs.devel:9568 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:9568 Martin Stjernholm writes: > So simple. ;) This is a good trick to know, but the same doesn't hold > for variables. I'm surprised it doesn't -- that's probably a minor omission -- but you avoid warnings about unbound variables with `(eval-when-compile (defvar fred))'. > Of course, that's no proof that the symbol-value thing > is (measurably) slower. I doubt it is. Of course not since it generates identical code, but the fact that it's optimized away means you don't suppress any warning. > There are still warnings that aren't addressed by these tricks, > though: The one about obsolete variables, and the one about incorrect > number of arguments (which cc-bytecomp-defun doesn't solve either). You can turn off such warnings in `byte-compile-warnings', but I think it's best to get the warnings in a small amount of compatibility code. > > I think CL used such a trick, but it's not (now) effective. > > What is not effective about it? It's optimized away. > I've not investigated Gnus so I don't know either. Perhaps they use > symbol-value and funcall everywhere. No. There are compatibility layers and (X)Emacs-specific files, and it doesn't attempt to eliminate all warnings. > Besides, cc-bytecomp also solves another matter, namely to make it > compile cleanly even in the presence of an earlier version of CC > Mode being loaded I don't think it should worry about such things. For builds of packages, I maintain that compilation should be done file-by-file in batch. (If you're developing them and not restarting Emacs, you probably want unload-feature to work properly with them.)