From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: bojohan+news@dd.chalmers.se (Johan =?utf-8?Q?Bockg=C3=A5rd?=) Newsgroups: gmane.emacs.devel Subject: Re: [bojohan+mail@dd.chalmers.se: The `cl-functions' byte compiler warning doesn't work] Date: Mon, 03 Mar 2008 11:08:00 +0100 Message-ID: References: <466C2412.5040600@gmx.at> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: ger.gmane.org 1204538918 13969 80.91.229.12 (3 Mar 2008 10:08:38 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 3 Mar 2008 10:08:38 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Mar 03 11:09:05 2008 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1JW7bJ-0000Gt-T9 for ged-emacs-devel@m.gmane.org; Mon, 03 Mar 2008 11:08:54 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JW7am-00019p-CV for ged-emacs-devel@m.gmane.org; Mon, 03 Mar 2008 05:08:20 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1JW7af-00016l-LF for emacs-devel@gnu.org; Mon, 03 Mar 2008 05:08:13 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1JW7ae-00015k-NY for emacs-devel@gnu.org; Mon, 03 Mar 2008 05:08:13 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JW7ae-00015b-HN for emacs-devel@gnu.org; Mon, 03 Mar 2008 05:08:12 -0500 Original-Received: from main.gmane.org ([80.91.229.2] helo=ciao.gmane.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1JW7ae-0006Mt-2p for emacs-devel@gnu.org; Mon, 03 Mar 2008 05:08:12 -0500 Original-Received: from list by ciao.gmane.org with local (Exim 4.43) id 1JW7ac-0004dJ-5r for emacs-devel@gnu.org; Mon, 03 Mar 2008 10:08:10 +0000 Original-Received: from remote2.student.chalmers.se ([129.16.29.80]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 03 Mar 2008 10:08:10 +0000 Original-Received: from bojohan+news by remote2.student.chalmers.se with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 03 Mar 2008 10:08:10 +0000 X-Injected-Via-Gmane: http://gmane.org/ Mail-Followup-To: emacs-devel@gnu.org Original-Lines: 61 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: remote2.student.chalmers.se Mail-Copies-To: never User-Agent: Gnus/5.110007 (No Gnus v0.7) Emacs/23.0.60 (gnu/linux) Cancel-Lock: sha1:L17faqgtJepOvpa5zxLFoJo0+rg= X-detected-kernel: by monty-python.gnu.org: Linux 2.6, seldom 2.4 (older, 4) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:91162 Archived-At: So, byte-compile-find-cl-functions still has a few problems: 1. It expects functions to be represented by plain symbols rather than (defun . FOO) in load-history. 2. It modifies load-history as a side-effect. 3. byte-compile-cl-functions contains useless `(require/t/provide ...)' entries. This illustrates the problem: $ emacs -Q (require 'cl) (byte-compile (lambda () (subst nil nil nil))) => no warning (byte-compile (lambda () (subst-if nil nil nil))) => Warning: Function `subst-if' from cl package called at runtime ;; The (autoload . ) entries in `load-history' are gone. How about this version: (defun byte-compile-find-cl-functions () (unless byte-compile-cl-functions (dolist (elt load-history) (when (and (stringp (car elt)) (string-match "^cl\\>" (file-name-nondirectory (car elt)))) (dolist (e (cdr elt)) (when (memq (car-safe e) '(autoload defun)) (push (cdr e) byte-compile-cl-functions))))))) 2008-03-03 Johan Bockgård * emacs-lisp/bytecomp.el (byte-compile-find-cl-functions): Simplify. Collect `defun' and `autoload' entries. Avoid side-effecting load-history. And I see now that Martin's change wasn't checked in on the branch, which means that the original problem in this thread exists there (the compiler never warns about cl functions): 2007-06-10 Martin Rudalics * emacs-lisp/bytecomp.el (byte-compile-find-cl-functions): Match against file-name-nondirectory. -- Johan Bockgård