Gnus development mailing list
 help / color / mirror / Atom feed
* Gnus always loads cl
@ 2002-10-08 11:24 Katsumi Yamaoka
  2002-10-10 11:12 ` Katsumi Yamaoka
  0 siblings, 1 reply; 13+ messages in thread
From: Katsumi Yamaoka @ 2002-10-08 11:24 UTC (permalink / raw)


[-- Attachment #1: Type: text/plain, Size: 257 bytes --]

Hi,

gnus-groups.elc always require mm-url for the command
gnus-group-fetch-charter, mm-url.elc always require url, url.elc
always require cl by default, and then we always have cl.  IMHO,
we don't need to do until so much.  How about changing as follows?


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: Type: text/x-patch, Size: 589 bytes --]

--- gnus-group.el~	2002-10-03 21:54:53 +0000
+++ gnus-group.el	2002-10-08 11:23:15 +0000
@@ -38,7 +38,8 @@
 (require 'gnus-undo)
 (require 'time-date)
 (require 'gnus-ems)
-(require 'mm-url)
+
+(eval-when-compile (require 'mm-url))
 
 (defcustom gnus-group-archive-directory
   "*ftp@ftp.hpc.uh.edu:/pub/emacs/ding-list/"
@@ -3532,6 +3533,7 @@
 	     gnus-newsgroup-name)))
   (unless group
     (error "No group name given"))
+  (require 'mm-url)
   (let ((name (mm-url-form-encode-xwfu (gnus-group-real-name group)))
 	url hierarchy)
     (when (string-match "\\(^[^\\.]+\\)\\..*" name)

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: Gnus always loads cl
  2002-10-08 11:24 Gnus always loads cl Katsumi Yamaoka
@ 2002-10-10 11:12 ` Katsumi Yamaoka
  2002-10-14  9:15   ` Katsumi Yamaoka
  0 siblings, 1 reply; 13+ messages in thread
From: Katsumi Yamaoka @ 2002-10-10 11:12 UTC (permalink / raw)


Probably, I should set the option `mm-url-use-external' to t.
It is unnecessary to XEmacs of course.



^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: Gnus always loads cl
  2002-10-10 11:12 ` Katsumi Yamaoka
@ 2002-10-14  9:15   ` Katsumi Yamaoka
  2002-10-14 19:24     ` Kai Großjohann
  2002-12-29  0:18     ` Lars Magne Ingebrigtsen
  0 siblings, 2 replies; 13+ messages in thread
From: Katsumi Yamaoka @ 2002-10-14  9:15 UTC (permalink / raw)


Hi,

I have two questions to Gnus developers.

I've believed for a long time that we must not load cl while
running Gnus.  It seems that it is required by FSF Emacs or RMS.
So, I've made some compiler macros in dgnushack.el, I've
sometimes advised not to use cl run-time functions in Gnus and
all they have been accepted.  Is this rule -- Gnus does not use
cl run-time functions -- effective even now?  Otherwise, doesn't
such a rule exist from the beginning?

If a module in Gnus uses a function which is built-in under FSF
Emacs 21 but is defined in cl under FSF Emacs 20, should Gnus
load cl for Emacs 20 users?

If anything, I've enjoyed exterminating cl run-time functions in
Gnus.  Though it might have been useless for Gnus, it was
significant for me. ;-)
-- 
Katsumi Yamaoka <yamaoka@jpl.org>



^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: Gnus always loads cl
  2002-10-14  9:15   ` Katsumi Yamaoka
@ 2002-10-14 19:24     ` Kai Großjohann
  2002-10-14 22:46       ` Katsumi Yamaoka
  2002-12-29  0:18     ` Lars Magne Ingebrigtsen
  1 sibling, 1 reply; 13+ messages in thread
From: Kai Großjohann @ 2002-10-14 19:24 UTC (permalink / raw)


Katsumi Yamaoka <yamaoka@jpl.org> writes:

> I've believed for a long time that we must not load cl while
> running Gnus.  It seems that it is required by FSF Emacs or RMS.

Yes.  But this holds for Emacs only, so since new Gnus versions will
be added only to new Emacs versions, it should be okay to require cl
in Emacs 20.

kai
-- 
~/.signature is: umop ap!sdn    (Frank Nobis)



^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: Gnus always loads cl
  2002-10-14 19:24     ` Kai Großjohann
@ 2002-10-14 22:46       ` Katsumi Yamaoka
  2002-10-15  6:41         ` Kai Großjohann
  0 siblings, 1 reply; 13+ messages in thread
From: Katsumi Yamaoka @ 2002-10-14 22:46 UTC (permalink / raw)


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

>> I've believed for a long time that we must not load cl while
>> running Gnus.  It seems that it is required by FSF Emacs or RMS.

Kai> Yes.  But this holds for Emacs only, so since new Gnus versions will
Kai> be added only to new Emacs versions, it should be okay to require cl
Kai> in Emacs 20.

That's quite lucid!  Thank you.
I've added the following lines in spam-stat.el instantly.

(eval-and-compile
  (when (= emacs-major-version 20)
    ;; gethash, hash-table-count, make-hash-table, mapc
    (require 'cl)
    (defalias 'puthash 'cl-puthash)))

(eval-when-compile
  (unless (fboundp 'with-syntax-table)
    ;; Imported from Emacs 21.2
    (defmacro with-syntax-table (table &rest body)
[...]
-- 
Katsumi Yamaoka <yamaoka@jpl.org>



^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: Gnus always loads cl
  2002-10-14 22:46       ` Katsumi Yamaoka
@ 2002-10-15  6:41         ` Kai Großjohann
  2002-10-15  9:29           ` Katsumi Yamaoka
  0 siblings, 1 reply; 13+ messages in thread
From: Kai Großjohann @ 2002-10-15  6:41 UTC (permalink / raw)


Katsumi Yamaoka <yamaoka@jpl.org> writes:

> (eval-and-compile
>   (when (= emacs-major-version 20)
>     ;; gethash, hash-table-count, make-hash-table, mapc
>     (require 'cl)
>     (defalias 'puthash 'cl-puthash)))

I'm not so happy with this.  It is better to just check whether the
functions are defined, I think.  Maybe something like this?

(unless (fboundp 'puthash)
  (require 'cl)
  (defalias 'puthash 'cl-puthash))

In principle, it is also bad to do the defalias, but maybe in this
case `puthash' is sufficiently standard so that the defalias is good
anyway.

Hmmm...  But isn't puthash defined as a macro in cl-macs.el or cl.el,
even in Emacs 20?  So I'm surprised that you need the defalias.  Or
maybe only gethash etc are macros, and the macro is missing for
puthash?  In this case, please add a comment saying "alias puthash is
missing from Emacs 20 cl.el" or something like that.

What do you think?

kai
-- 
~/.signature is: umop ap!sdn    (Frank Nobis)



^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: Gnus always loads cl
  2002-10-15  6:41         ` Kai Großjohann
@ 2002-10-15  9:29           ` Katsumi Yamaoka
  2002-10-15 13:54             ` Kai Großjohann
  2002-10-15 21:34             ` Alex Schroeder
  0 siblings, 2 replies; 13+ messages in thread
From: Katsumi Yamaoka @ 2002-10-15  9:29 UTC (permalink / raw)


>>>>> 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>



^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: Gnus always loads cl
  2002-10-15  9:29           ` Katsumi Yamaoka
@ 2002-10-15 13:54             ` Kai Großjohann
  2002-10-15 15:46               ` Katsumi
  2002-10-15 21:34             ` Alex Schroeder
  1 sibling, 1 reply; 13+ messages in thread
From: Kai Großjohann @ 2002-10-15 13:54 UTC (permalink / raw)


Katsumi Yamaoka <yamaoka@jpl.org> writes:

> 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?

Why forsake Emacs 20 users?  The code is not that terrible :-)

And then, maybe it's sufficient to test some of those functions
instead of all of them -- we expect them to be defined in the same
file anyway, right?

kai
-- 
~/.signature is: umop ap!sdn    (Frank Nobis)



^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: Gnus always loads cl
  2002-10-15 13:54             ` Kai Großjohann
@ 2002-10-15 15:46               ` Katsumi
  2002-10-15 19:27                 ` Kai Großjohann
  0 siblings, 1 reply; 13+ messages in thread
From: Katsumi @ 2002-10-15 15:46 UTC (permalink / raw)


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset=iso-2022-jp-2, Size: 1447 bytes --]

Hi, I am the same as that of Katsumi Yamaoka <yamaoka@jpl.org>. :)

>>>>> In <87hefnu7sn.fsf@crybaby.cs.uni-dortmund.de> 
>>>>>	Kai.Grossjohann@CS.Uni-Dortmund.DE (Kai Gro^[.A^[N_johann) wrote:

>> (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> Why forsake Emacs 20 users?  The code is not that terrible :-)

Since I'm not using Emacs 20 usually, I come to feel it
troublesome.  But we cannot forsake Meadow users. ;-)

Kai> And then, maybe it's sufficient to test some of those functions
Kai> instead of all of them -- we expect them to be defined in the same
Kai> file anyway, right?

I make an issue of only cl run-time functions and I graspe all
of them.  Which function do you think we can remove from a
subject of examination?  I don't know.

By the way, I've made gnus-clfns.el in T-gnus (which is base on
Oort Gnus, using FLIM and SEMI for MIME functions, using APEL
to support Mule 19.34 as well as Emacs 20/21).  That file
provides compiler macros for cl run-time functions as it is done
by dgnushack.el in Oort Gnus.  If such demand increases, we
should probably do the same thing also in Oort Gnus.
-- 
Katsumi@Yamaoka.cc



^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: Gnus always loads cl
  2002-10-15 15:46               ` Katsumi
@ 2002-10-15 19:27                 ` Kai Großjohann
  2002-10-16 12:11                   ` Katsumi Yamaoka
  0 siblings, 1 reply; 13+ messages in thread
From: Kai Großjohann @ 2002-10-15 19:27 UTC (permalink / raw)


Katsumi@Yamaoka.cc writes:

>>>>>> In <87hefnu7sn.fsf@crybaby.cs.uni-dortmund.de> 
>>>>>>	Kai.Grossjohann@CS.Uni-Dortmund.DE (Kai Großjohann) wrote:
>
>>> (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> Why forsake Emacs 20 users?  The code is not that terrible :-)
>
> Since I'm not using Emacs 20 usually, I come to feel it
> troublesome.  But we cannot forsake Meadow users. ;-)

Well.  Hm.  How to make it prettier?  Maybe this one:

(when (memq nil (mapcar 'fboundp
                        '(gethash hash-table make-hash-table
                          mapc puthash)))
  (require 'cl)
  (unless (fboundp 'puthash)
    (defalias 'puthash 'cl-puthash)))

> Kai> And then, maybe it's sufficient to test some of those functions
> Kai> instead of all of them -- we expect them to be defined in the same
> Kai> file anyway, right?
>
> I make an issue of only cl run-time functions and I graspe all
> of them.  Which function do you think we can remove from a
> subject of examination?  I don't know.

As a zero-th approximation, any function that is not fboundp in Emacs
20 will do.  Maybe make-hash-table is the most basic function.
(Without a hash table, you cannot do anything with it, so any Emacs
which provides hash tables will also provide make-hash-table, I
guess.)

> By the way, I've made gnus-clfns.el in T-gnus (which is base on
> Oort Gnus, using FLIM and SEMI for MIME functions, using APEL
> to support Mule 19.34 as well as Emacs 20/21).  That file
> provides compiler macros for cl run-time functions as it is done
> by dgnushack.el in Oort Gnus.  If such demand increases, we
> should probably do the same thing also in Oort Gnus.

Whee.  dgnushack is really weird.  But if it's necessary...

kai
-- 
~/.signature is: umop ap!sdn    (Frank Nobis)



^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: Gnus always loads cl
  2002-10-15  9:29           ` Katsumi Yamaoka
  2002-10-15 13:54             ` Kai Großjohann
@ 2002-10-15 21:34             ` Alex Schroeder
  1 sibling, 0 replies; 13+ messages in thread
From: Alex Schroeder @ 2002-10-15 21:34 UTC (permalink / raw)


Katsumi Yamaoka <yamaoka@jpl.org> writes:

> 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.

Probably CL users would write (setf (gethash x y) z) anyway...

Alex.



^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: Gnus always loads cl
  2002-10-15 19:27                 ` Kai Großjohann
@ 2002-10-16 12:11                   ` Katsumi Yamaoka
  0 siblings, 0 replies; 13+ messages in thread
From: Katsumi Yamaoka @ 2002-10-16 12:11 UTC (permalink / raw)


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

Kai> Well.  Hm.  How to make it prettier?  Maybe this one:

Kai> (when (memq nil (mapcar 'fboundp
Kai>                         '(gethash hash-table make-hash-table
Kai>                           mapc puthash)))
Kai>   (require 'cl)
Kai>   (unless (fboundp 'puthash)
Kai>     (defalias 'puthash 'cl-puthash)))

That's more smart.  I'll use it.  Thanks.

[...]

Kai> As a zero-th approximation, any function that is not fboundp in Emacs
Kai> 20 will do.  Maybe make-hash-table is the most basic function.
Kai> (Without a hash table, you cannot do anything with it, so any Emacs
Kai> which provides hash tables will also provide make-hash-table, I
Kai> guess.)

The built-in function make-hash-table has appeared in Emacs 21.1.
Emacs 18 didn't provide it.  cl-extra.el provided it till Emacs
20.  I had been knowing `(make-vector 2^N-1 0)' for some time,
on the one hand.

By the way, I found the past things.  In Gnus 5.3 which is
bundled with Emacs 19.34, gnus-gl.el uses make-hash-table.
gnus-gl.el and nnml.el require cl in the toplevel. ;-)

>> By the way, I've made gnus-clfns.el in T-gnus...
>>                                              ...That file
>> provides compiler macros for cl run-time functions as it is done
>> by dgnushack.el in Oort Gnus.  If such demand increases, we
>> should probably do the same thing also in Oort Gnus.

Kai> Whee.  dgnushack is really weird.  But if it's necessary...

Developers who don't have Emacs 20 will increase from now on.
We probably have to decide some time.  It might be now...
-- 
Katsumi Yamaoka <yamaoka@jpl.org>



^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: Gnus always loads cl
  2002-10-14  9:15   ` Katsumi Yamaoka
  2002-10-14 19:24     ` Kai Großjohann
@ 2002-12-29  0:18     ` Lars Magne Ingebrigtsen
  1 sibling, 0 replies; 13+ messages in thread
From: Lars Magne Ingebrigtsen @ 2002-12-29  0:18 UTC (permalink / raw)


Katsumi Yamaoka <yamaoka@jpl.org> writes:

> I've believed for a long time that we must not load cl while
> running Gnus.  It seems that it is required by FSF Emacs or RMS.

Yup; RMS told me a couple of years ago that loading cl while running
should be avoided.

-- 
(domestic pets only, the antidote for overdose, milk.)
   larsi@gnus.org * Lars Magne Ingebrigtsen



^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2002-12-29  0:18 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-10-08 11:24 Gnus always loads cl 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
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

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).