Gnus development mailing list
 help / color / mirror / Atom feed
From: Katsumi Yamaoka <yamaoka@jpl.org>
Subject: Re: Gnus always loads cl
Date: Tue, 15 Oct 2002 18:29:31 +0900	[thread overview]
Message-ID: <yotl7kgk6oec.fsf@jpl.org> (raw)
In-Reply-To: <87adlgb3w7.fsf@crybaby.cs.uni-dortmund.de>

>>>>> In <87adlgb3w7.fsf@crybaby.cs.uni-dortmund.de>
>>>>>	Kai.Grossjohann@CS.Uni-Dortmund.DE (Kai Großjohann) wrote:

> (eval-and-compile
>   (when (= 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.
-- 
Katsumi Yamaoka <yamaoka@jpl.org>



  reply	other threads:[~2002-10-15  9:29 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-10-08 11:24 Katsumi Yamaoka
2002-10-10 11:12 ` Katsumi Yamaoka
2002-10-14  9:15   ` Katsumi Yamaoka
2002-10-14 19:24     ` Kai Großjohann
2002-10-14 22:46       ` Katsumi Yamaoka
2002-10-15  6:41         ` Kai Großjohann
2002-10-15  9:29           ` Katsumi Yamaoka [this message]
2002-10-15 13:54             ` Kai Großjohann
2002-10-15 15:46               ` Katsumi
2002-10-15 19:27                 ` Kai Großjohann
2002-10-16 12:11                   ` Katsumi Yamaoka
2002-10-15 21:34             ` Alex Schroeder
2002-12-29  0:18     ` Lars Magne Ingebrigtsen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=yotl7kgk6oec.fsf@jpl.org \
    --to=yamaoka@jpl.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).