From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/47190 Path: main.gmane.org!not-for-mail From: Katsumi Yamaoka Newsgroups: gmane.emacs.gnus.general Subject: Re: Gnus always loads cl Date: Tue, 15 Oct 2002 18:29:31 +0900 Organization: Emacsen advocacy group Sender: owner-ding@hpc.uh.edu Message-ID: References: <87u1jolt7k.fsf@crybaby.cs.uni-dortmund.de> <87adlgb3w7.fsf@crybaby.cs.uni-dortmund.de> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: main.gmane.org 1034674185 26553 80.91.224.249 (15 Oct 2002 09:29:45 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Tue, 15 Oct 2002 09:29:45 +0000 (UTC) Return-path: Original-Received: from malifon.math.uh.edu ([129.7.128.13]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 181O1I-0006u8-00 for ; Tue, 15 Oct 2002 11:29:44 +0200 Original-Received: from sina.hpc.uh.edu ([129.7.128.10] ident=lists) by malifon.math.uh.edu with esmtp (Exim 3.20 #1) id 181O1b-0004dY-00; Tue, 15 Oct 2002 04:30:03 -0500 Original-Received: by sina.hpc.uh.edu (TLB v0.09a (1.20 tibbs 1996/10/09 22:03:07)); Tue, 15 Oct 2002 04:30:46 -0500 (CDT) Original-Received: from sclp3.sclp.com (qmailr@sclp3.sclp.com [209.196.61.66]) by sina.hpc.uh.edu (8.9.3/8.9.3) with SMTP id EAA01644 for ; Tue, 15 Oct 2002 04:30:34 -0500 (CDT) Original-Received: (qmail 7142 invoked by alias); 15 Oct 2002 09:29:46 -0000 Original-Received: (qmail 7137 invoked from network); 15 Oct 2002 09:29:46 -0000 Original-Received: from unknown (HELO mars.web-hosting.com) (207.228.244.150) by gnus.org with SMTP; 15 Oct 2002 09:29:46 -0000 Original-Received: from localhost ([207.228.245.242]) by mars.web-hosting.com (8.11.1/8.11.1) with ESMTP id g9F9Tid09106 for ; Tue, 15 Oct 2002 05:29:44 -0400 (EDT) Original-To: ding@gnus.org Mail-Copies-To: never User-Agent: Gnus/5.090008 (Oort Gnus v0.08) XEmacs/21.4 (Military Intelligence (RC3), sparc-sun-solaris2.6) X-Face: #kKnN,xUnmKia.'[pp`;Omh}odZK)?7wQSl"4o04=EixTF+V[""w~iNbM9ZL+.b*_CxUmFk B#Fu[*?MZZH@IkN:!"\w%I_zt>[$nm7nQosZ<3eu;B:$Q_:p!',P.c0-_Cy[dz4oIpw0ESA^D*1Lw= L&i*6&( Cancel-Lock: sha1:hRJYM7rBM7Zbip8zwODH09zhiO0= X-Hashcash: 021015:ding@gnus.org:21f8702be55f8469 Precedence: list X-Majordomo: 1.94.jlt7 Xref: main.gmane.org gmane.emacs.gnus.general:47190 X-Report-Spam: http://spam.gmane.org/gmane.emacs.gnus.general:47190 >>>>> In <87adlgb3w7.fsf@crybaby.cs.uni-dortmund.de> >>>>> Kai.Grossjohann@CS.Uni-Dortmund.DE (Kai Gro=DFjohann) wrote: > (eval-and-compile > (when (=3D emacs-major-version 20) > ;; gethash, hash-table-count, make-hash-table, mapc > (require 'cl) > (defalias 'puthash 'cl-puthash))) Kai> I'm not so happy with this. It is better to just check whether the Kai> functions are defined, I think. Maybe something like this? Kai> (unless (fboundp 'puthash) Kai> (require 'cl) Kai> (defalias 'puthash 'cl-puthash)) It is correct if you mean there might be puthash provided by other than cl even if Emacs 20 is running. And that form will also load the other cl run-time functions, gethash, hash-table-count, etc., which are required by spam-stat.el. Probably, it should strictly be made as follows: (unless (and (fboundp 'gethash) (fboundp 'hash-table-count) (fboundp 'make-hash-table) (fboundp 'mapc) (fboundp 'puthash)) (require 'cl) (unless (fboundp 'puthash) (defalias 'puthash 'cl-puthash))) However, if such a thing is required, my will inclines to forsake Emacs 20 users. Do you have any other ideas? Kai> In principle, it is also bad to do the defalias, but maybe in this Kai> case `puthash' is sufficiently standard so that the defalias is good Kai> anyway. I think I understand your opinion. Kai> Hmmm... But isn't puthash defined as a macro in cl-macs.el or cl.el, Kai> even in Emacs 20? So I'm surprised that you need the defalias. Or Kai> maybe only gethash etc are macros, and the macro is missing for Kai> puthash? All cl run-time functions used by spam-stat.el are the normal functions in Emacs 20. I was also surprised that puthash isn't available in Emacs 20. gethash is an alias to cl-gethash in cl-extra.el, but puthash isn't. Kai> In this case, please add a comment saying "alias puthash is Kai> missing from Emacs 20 cl.el" or something like that. I agree. To be sure, it is required. --=20 Katsumi Yamaoka