Gnus development mailing list
 help / color / mirror / Atom feed
* Pterodactyl Gnus v0.5 is released
@ 1998-08-29 21:26 Lars Magne Ingebrigtsen
  1998-08-29 21:36 ` Michael Harnois
                   ` (2 more replies)
  0 siblings, 3 replies; 22+ messages in thread
From: Lars Magne Ingebrigtsen @ 1998-08-29 21:26 UTC (permalink / raw)


Slight bug fixes.  I forgot to mention that Pterodactyl Gnus is not
supported by anything older than Emacs 20 and XEmacs 20.  The teens
are definitely over.  If you wish to stick to Emacs/XEmacs 19, the
last version usable there will be Gnus 5.6.43, which will be released
next week some time.

Get it from <URL:http://www.gnus.org/pgnus.tar.gz> or
"/ftp@ftp.gnus.org:/pub/emacs/gnus/".  The patch is available as
<URL:http://www.gnus.org/patches/pgnus-0.4-0.5.diff.gz>.

ChangeLog since last release:

Sat Aug 29 23:24:31 1998  Lars Magne Ingebrigtsen  <larsi@menja.ifi.uio.no>

	* gnus.el: Pterodactyl Gnus v0.5 is released.

1998-08-29 22:38:35  Lars Magne Ingebrigtsen  <larsi@gnus.org>

	* gnus-art.el (gnus-article-mode): Make article buffer multibyte. 
	(gnus-hack-decode-rfc1522): Removed.

	* mm-decode.el (mm-charset-coding-system-alist): Check better.



-- 
(domestic pets only, the antidote for overdose, milk.)
  larsi@ifi.uio.no * Lars Magne Ingebrigtsen


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

* Re: Pterodactyl Gnus v0.5 is released
  1998-08-29 21:26 Pterodactyl Gnus v0.5 is released Lars Magne Ingebrigtsen
@ 1998-08-29 21:36 ` Michael Harnois
  1998-08-29 21:41   ` SL Baur
  1998-08-29 21:45   ` Lars Magne Ingebrigtsen
  1998-08-29 22:08 ` SL Baur
  1998-08-31 12:29 ` Hallvard B Furuseth
  2 siblings, 2 replies; 22+ messages in thread
From: Michael Harnois @ 1998-08-29 21:36 UTC (permalink / raw)


Lars Magne Ingebrigtsen <larsi@ifi.uio.no> writes:

> Get it from <URL:http://www.gnus.org/pgnus.tar.gz> or
> "/ftp@ftp.gnus.org:/pub/emacs/gnus/".  The patch is available as
> <URL:http://www.gnus.org/patches/pgnus-0.4-0.5.diff.gz>.

It's 54 bytes long. That certainly does represent a size reduction ...

-- 
Michael D. Harnois, Redeemer Lutheran Church, Washburn, IA 
mharnois@sbt.net                      aa0bt@aa0bt.ampr.org 
"There can be no transforming of darkness into light and 
 of apathy into movement without emotion." - Carl Jung


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

* Re: Pterodactyl Gnus v0.5 is released
  1998-08-29 21:36 ` Michael Harnois
@ 1998-08-29 21:41   ` SL Baur
  1998-08-29 21:45   ` Lars Magne Ingebrigtsen
  1 sibling, 0 replies; 22+ messages in thread
From: SL Baur @ 1998-08-29 21:41 UTC (permalink / raw)


Michael Harnois <mharnois@sbt.net> writes in ding@gnus.org:

> Lars Magne Ingebrigtsen <larsi@ifi.uio.no> writes:
>> Get it from <URL:http://www.gnus.org/pgnus.tar.gz> or
>> "/ftp@ftp.gnus.org:/pub/emacs/gnus/".  The patch is available as
>> <URL:http://www.gnus.org/patches/pgnus-0.4-0.5.diff.gz>.

> It's 54 bytes long. That certainly does represent a size reduction ...

All of the pgnus tarballs are 54 bytes long.  The 5.6.42 tarball
seemed to come through O.K.


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

* Re: Pterodactyl Gnus v0.5 is released
  1998-08-29 21:36 ` Michael Harnois
  1998-08-29 21:41   ` SL Baur
@ 1998-08-29 21:45   ` Lars Magne Ingebrigtsen
  1998-08-29 21:57     ` Lloyd Zusman
                       ` (3 more replies)
  1 sibling, 4 replies; 22+ messages in thread
From: Lars Magne Ingebrigtsen @ 1998-08-29 21:45 UTC (permalink / raw)


Michael Harnois <mharnois@sbt.net> writes:

> It's 54 bytes long. That certainly does represent a size reduction ...

It's the new, effective, but instable compression technology.  The
size spontaneously expanded to ~700kb a few jiffies ago.

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


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

* Re: Pterodactyl Gnus v0.5 is released
  1998-08-29 21:45   ` Lars Magne Ingebrigtsen
@ 1998-08-29 21:57     ` Lloyd Zusman
  1998-08-29 22:01     ` SL Baur
                       ` (2 subsequent siblings)
  3 siblings, 0 replies; 22+ messages in thread
From: Lloyd Zusman @ 1998-08-29 21:57 UTC (permalink / raw)


Lars Magne Ingebrigtsen <larsi@gnus.org> writes:

> Michael Harnois <mharnois@sbt.net> writes:
> 
> > It's 54 bytes long. That certainly does represent a size reduction ...
> 
> It's the new, effective, but instable compression technology.  The
> size spontaneously expanded to ~700kb a few jiffies ago.

You must not have yet come across the compression algorithm that I
recently invented.  It will compress any amount of data down to one
bit.

... of course, I'm still working on the decompression algorithm.

-- 
 Lloyd Zusman
 ljz@asfast.com


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

* Re: Pterodactyl Gnus v0.5 is released
  1998-08-29 21:45   ` Lars Magne Ingebrigtsen
  1998-08-29 21:57     ` Lloyd Zusman
@ 1998-08-29 22:01     ` SL Baur
  1998-08-29 22:09       ` Hrvoje Niksic
  1998-08-29 22:29     ` Michael Harnois
  1998-08-30  1:28     ` François Pinard
  3 siblings, 1 reply; 22+ messages in thread
From: SL Baur @ 1998-08-29 22:01 UTC (permalink / raw)


Lars Magne Ingebrigtsen <larsi@gnus.org> writes in ding@gnus.org:

> Michael Harnois <mharnois@sbt.net> writes:
>> It's 54 bytes long. That certainly does represent a size reduction ...

> It's the new, effective, but instable compression technology.  The
> size spontaneously expanded to ~700kb a few jiffies ago.

Yup.  I'm trying a test build now.


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

* Re: Pterodactyl Gnus v0.5 is released
  1998-08-29 21:26 Pterodactyl Gnus v0.5 is released Lars Magne Ingebrigtsen
  1998-08-29 21:36 ` Michael Harnois
@ 1998-08-29 22:08 ` SL Baur
  1998-08-29 22:57   ` Lars Magne Ingebrigtsen
  1998-08-31 12:29 ` Hallvard B Furuseth
  2 siblings, 1 reply; 22+ messages in thread
From: SL Baur @ 1998-08-29 22:08 UTC (permalink / raw)


Lars Magne Ingebrigtsen <larsi@ifi.uio.no> writes in ding@gnus.org:

> Slight bug fixes.  I forgot to mention that Pterodactyl Gnus is not
> supported by anything older than Emacs 20 and XEmacs 20.  The teens
> are definitely over.

O.K.  with me.

How are we supposed to be testing this?  I presume we're going to need 
to turn off tm.  What's the preferred feature test for startup code
that needs to decide whether to initialize for tm or for Gnus native
MIME?


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

* Re: Pterodactyl Gnus v0.5 is released
  1998-08-29 22:01     ` SL Baur
@ 1998-08-29 22:09       ` Hrvoje Niksic
  1998-08-29 22:35         ` SL Baur
  1998-08-29 22:58         ` Lars Magne Ingebrigtsen
  0 siblings, 2 replies; 22+ messages in thread
From: Hrvoje Niksic @ 1998-08-29 22:09 UTC (permalink / raw)


SL Baur <steve@xemacs.org> writes:

> Lars Magne Ingebrigtsen <larsi@gnus.org> writes in ding@gnus.org:
> 
> > Michael Harnois <mharnois@sbt.net> writes:
> >> It's 54 bytes long. That certainly does represent a size reduction ...
> 
> > It's the new, effective, but instable compression technology.  The
> > size spontaneously expanded to ~700kb a few jiffies ago.
> 
> Yup.  I'm trying a test build now.

No go.  encode-coding-string is undefined.

-- 
Hrvoje Niksic <hniksic@srce.hr> | Student at FER Zagreb, Croatia
--------------------------------+--------------------------------
Predestination was doomed from the start.


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

* Re: Pterodactyl Gnus v0.5 is released
  1998-08-29 21:45   ` Lars Magne Ingebrigtsen
  1998-08-29 21:57     ` Lloyd Zusman
  1998-08-29 22:01     ` SL Baur
@ 1998-08-29 22:29     ` Michael Harnois
  1998-08-29 23:02       ` Lars Magne Ingebrigtsen
  1998-08-30  1:28     ` François Pinard
  3 siblings, 1 reply; 22+ messages in thread
From: Michael Harnois @ 1998-08-29 22:29 UTC (permalink / raw)


Where is this function set-buffer-multibyte that's referred to in
gnus-art.el supposed to come from?

-- 
Michael D. Harnois, Redeemer Lutheran Church, Washburn, IA 
mharnois@sbt.net                      aa0bt@aa0bt.ampr.org 
"There can be no transforming of darkness into light and 
 of apathy into movement without emotion." - Carl Jung


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

* Re: Pterodactyl Gnus v0.5 is released
  1998-08-29 22:09       ` Hrvoje Niksic
@ 1998-08-29 22:35         ` SL Baur
  1998-08-29 22:45           ` Hrvoje Niksic
  1998-08-29 22:45           ` Hrvoje Niksic
  1998-08-29 22:58         ` Lars Magne Ingebrigtsen
  1 sibling, 2 replies; 22+ messages in thread
From: SL Baur @ 1998-08-29 22:35 UTC (permalink / raw)


Hrvoje Niksic <hniksic@srce.hr> writes in ding@gnus.org:

> SL Baur <steve@xemacs.org> writes:
>> Lars Magne Ingebrigtsen <larsi@gnus.org> writes in ding@gnus.org:
>> 
>> > Michael Harnois <mharnois@sbt.net> writes:
>> >> It's 54 bytes long. That certainly does represent a size reduction ...
>> 
>> > It's the new, effective, but instable compression technology.  The
>> > size spontaneously expanded to ~700kb a few jiffies ago.
>> 
>> Yup.  I'm trying a test build now.

> No go.  encode-coding-string is undefined.

Please try evaluating (fset 'encode-coding-string 'ignore) and
applying this patch and see if you get any further.

1998-08-29  SL Baur  <steve@altair.xemacs.org>

	* gnus-art.el (gnus-article-mode): Don't use `set-buffer-multibyte'
	atrocity in XEmacs.

--- pgnus-0.5/lisp/gnus-art.el~	Sat Aug 29 14:25:45 1998
+++ pgnus-0.5/lisp/gnus-art.el	Sat Aug 29 15:21:31 1998
@@ -1935,7 +1935,7 @@
   (buffer-disable-undo (current-buffer))
   (setq buffer-read-only t)
   (set-syntax-table gnus-article-mode-syntax-table)
-  (set-buffer-multibyte t)
+  (and (fboundp 'set-buffer-multibyte) (set-buffer-multibyte t))
   (gnus-run-hooks 'gnus-article-mode-hook))
 
 (defun gnus-article-setup-buffer ()


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

* Re: Pterodactyl Gnus v0.5 is released
  1998-08-29 22:35         ` SL Baur
@ 1998-08-29 22:45           ` Hrvoje Niksic
  1998-08-29 23:05             ` Lars Magne Ingebrigtsen
  1998-08-29 22:45           ` Hrvoje Niksic
  1 sibling, 1 reply; 22+ messages in thread
From: Hrvoje Niksic @ 1998-08-29 22:45 UTC (permalink / raw)


SL Baur <steve@xemacs.org> writes:

> Please try evaluating (fset 'encode-coding-string 'ignore) and
> applying this patch and see if you get any further.

This is what I needed so far.  Other than that, Gnus appears to work.

(fset 'encode-coding-string 'ignore)
(fset 'set-buffer-multibyte 'ignore)
(fset 'coding-system-list 'ignore)

-- 
Hrvoje Niksic <hniksic@srce.hr> | Student at FER Zagreb, Croatia
--------------------------------+--------------------------------
You have an unusual magnetic personality.  Don't walk too close to
metal objects which are not fastened down.


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

* Re: Pterodactyl Gnus v0.5 is released
  1998-08-29 22:35         ` SL Baur
  1998-08-29 22:45           ` Hrvoje Niksic
@ 1998-08-29 22:45           ` Hrvoje Niksic
  1 sibling, 0 replies; 22+ messages in thread
From: Hrvoje Niksic @ 1998-08-29 22:45 UTC (permalink / raw)


SL Baur <steve@xemacs.org> writes:

> Please try evaluating (fset 'encode-coding-string 'ignore) and
> applying this patch and see if you get any further.

This is what I needed so far.  Other than that, Gnus appears to work.

(fset 'encode-coding-string 'ignore)
(fset 'set-buffer-multibyte 'ignore)
(fset 'coding-system-list 'ignore)

-- 
Hrvoje Niksic <hniksic@srce.hr> | Student at FER Zagreb, Croatia
--------------------------------+--------------------------------
You have an unusual magnetic personality.  Don't walk too close to
metal objects which are not fastened down.


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

* Re: Pterodactyl Gnus v0.5 is released
  1998-08-29 22:08 ` SL Baur
@ 1998-08-29 22:57   ` Lars Magne Ingebrigtsen
  0 siblings, 0 replies; 22+ messages in thread
From: Lars Magne Ingebrigtsen @ 1998-08-29 22:57 UTC (permalink / raw)


SL Baur <steve@xemacs.org> writes:

> How are we supposed to be testing this?  I presume we're going to need 
> to turn off tm.  What's the preferred feature test for startup code
> that needs to decide whether to initialize for tm or for Gnus native
> MIME?

(> (gnus-continuum-version gnus-version) 5.070015)

or whenever the MIME support becomes usable.  Before that, tm would be 
nice, after that point tm would perhaps be less necessary.

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


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

* Re: Pterodactyl Gnus v0.5 is released
  1998-08-29 22:09       ` Hrvoje Niksic
  1998-08-29 22:35         ` SL Baur
@ 1998-08-29 22:58         ` Lars Magne Ingebrigtsen
  1 sibling, 0 replies; 22+ messages in thread
From: Lars Magne Ingebrigtsen @ 1998-08-29 22:58 UTC (permalink / raw)


Hrvoje Niksic <hniksic@srce.hr> writes:

> > Yup.  I'm trying a test build now.
> 
> No go.  encode-coding-string is undefined.

All my Emacsen are built with MULE at the moment, but I think this
should be fixed in 0.6.

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


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

* Re: Pterodactyl Gnus v0.5 is released
  1998-08-29 22:29     ` Michael Harnois
@ 1998-08-29 23:02       ` Lars Magne Ingebrigtsen
  0 siblings, 0 replies; 22+ messages in thread
From: Lars Magne Ingebrigtsen @ 1998-08-29 23:02 UTC (permalink / raw)


Michael Harnois <mharnois@sbt.net> writes:

> Where is this function set-buffer-multibyte that's referred to in
> gnus-art.el supposed to come from?

Emacs 20.  0.6 checks a bit more before using it.

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


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

* Re: Pterodactyl Gnus v0.5 is released
  1998-08-29 22:45           ` Hrvoje Niksic
@ 1998-08-29 23:05             ` Lars Magne Ingebrigtsen
  0 siblings, 0 replies; 22+ messages in thread
From: Lars Magne Ingebrigtsen @ 1998-08-29 23:05 UTC (permalink / raw)


Hrvoje Niksic <hniksic@srce.hr> writes:

> (fset 'coding-system-list 'ignore)

I've added a check for this to 0.7.

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


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

* Re: Pterodactyl Gnus v0.5 is released
  1998-08-29 21:45   ` Lars Magne Ingebrigtsen
                       ` (2 preceding siblings ...)
  1998-08-29 22:29     ` Michael Harnois
@ 1998-08-30  1:28     ` François Pinard
  3 siblings, 0 replies; 22+ messages in thread
From: François Pinard @ 1998-08-30  1:28 UTC (permalink / raw)


Lars Magne Ingebrigtsen <larsi@gnus.org> writes:

> Michael Harnois <mharnois@sbt.net> writes:

> > It's 54 bytes long. That certainly does represent a size reduction ...

> It's the new, effective, but instable compression technology.  The
> size spontaneously expanded to ~700kb a few jiffies ago.

The technology Lars used is very effective compression.  Here is
the algorithm.  Consider that a file is nothing more than an sequence
alternating 0-runs with 1-runs (the first 0-run has zero bits if the file
starts with a 1).  Using the alternating principle, replace each X-run by
the binary expression of its length.  So, you have the length of the first
0-run, and the length of the first 1-run, the length of the second 0-run,
the length of the second 1-run, etc.  These lengths convey all information
needed to recover the original file, so replace the original file by the
file made up of all lengths.  Iterate the compression on this new file, and
continue this way until the file does not shrink anymore.  This _is_ quite
effective compression.  After that, who bothers about decompression? :-)

-- 
François Pinard                            mailto:pinard@iro.umontreal.ca
Join the free Translation Project!    http://www.iro.umontreal.ca/~pinard


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

* Re: Pterodactyl Gnus v0.5 is released
  1998-08-29 21:26 Pterodactyl Gnus v0.5 is released Lars Magne Ingebrigtsen
  1998-08-29 21:36 ` Michael Harnois
  1998-08-29 22:08 ` SL Baur
@ 1998-08-31 12:29 ` Hallvard B Furuseth
  1998-08-31 12:52   ` Lars Magne Ingebrigtsen
  2 siblings, 1 reply; 22+ messages in thread
From: Hallvard B Furuseth @ 1998-08-31 12:29 UTC (permalink / raw)


Lars Magne Ingebrigtsen writes:

> Pterodactyl Gnus is not supported by anything older than Emacs 20 and
> XEmacs 20.  (...)  If you wish to stick to Emacs/XEmacs 19, the last
> version usable there will be Gnus 5.6.43,

Would a `mule-compat.el' with dummy definitions of some MULE functions
let me run pgnus on emacs19?  I'm not about to trust emacs20 with my
binary files, or to start another emacs just to read news.

-- 
Hallvard


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

* Re: Pterodactyl Gnus v0.5 is released
  1998-08-31 12:29 ` Hallvard B Furuseth
@ 1998-08-31 12:52   ` Lars Magne Ingebrigtsen
  1998-08-31 16:25     ` Hallvard B Furuseth
  0 siblings, 1 reply; 22+ messages in thread
From: Lars Magne Ingebrigtsen @ 1998-08-31 12:52 UTC (permalink / raw)


Hallvard B Furuseth <h.b.furuseth@usit.uio.no> writes:

> Would a `mule-compat.el' with dummy definitions of some MULE functions
> let me run pgnus on emacs19?  I'm not about to trust emacs20 with my
> binary files, or to start another emacs just to read news.

pgnus works without MULE; for instance on MULE-less XEmacs 20's.  The
new things it uses are things like `with-temp-buffer', `split-string',
`point-at-eol'/`line-end-position' and stuff.  (I would guess
increasing number of those things after a while.)

You could probably hack up a library that defined those things,
though. 

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


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

* Re: Pterodactyl Gnus v0.5 is released
  1998-08-31 12:52   ` Lars Magne Ingebrigtsen
@ 1998-08-31 16:25     ` Hallvard B Furuseth
  1998-08-31 21:17       ` Lars Magne Ingebrigtsen
  0 siblings, 1 reply; 22+ messages in thread
From: Hallvard B Furuseth @ 1998-08-31 16:25 UTC (permalink / raw)


Lars Magne Ingebrigtsen writes:
> You could probably hack up a library that defined those things,
> though. 

Here, except it doesn't define char-charset (rfc1522.el, rfc2047.el),
find-non-ascii-charset-region (rfc1522.el) and find-charset-region
(rfc2047.el).  I don't know how they should work.  If someone has xemacs
without MULE installed, maybe they could be copied from there.


;; gnus-e20.el -- emacs20 compatibility for Gnus on emacs19

;; Version 1, 1998-08-31

;; Copyright:  The part below the copyright notice below
;; is Copyright Free Software Foundation.


;; Cloned from emacs-20.3/src/charset.c
(if (or (not (fboundp 'char-width))
	(eq (car-safe (indirect-function 'char-width)) 'autoload))
    (defun char-width (ch)
      "Return width of CHAR when displayed in the current buffer.
The width is measured by how many columns it occupies on the screen."
      (let ((dp
	     (cond (buffer-display-table   (aref buffer-display-table   ch))
		   (standard-display-table (aref standard-display-table ch)))))
	(cond ((vectorp dp) (length dp))
	      ((< ch 32)    (cond ((eq ch 9)  tab-width)
				  ((eq ch 10) 0)
				  (t          (if ctl-arrow 2 4))))
	      ((< ch 127)   1)
	      ((eq ch 127)  (if ctl-arrow 2 4))
	      (t            4)))))

;; Cloned from emacs-20.3/src/editfns.c
(if (or (not (fboundp 'save-current-buffer))
	(eq (car-safe (indirect-function 'save-current-buffer)) 'autoload))
    (defmacro save-current-buffer (&rest args)
      "Save the current buffer; execute BODY; restore the current buffer.
Executes BODY just like `progn'."
      (let ((ScB-buffer (make-symbol "ScB-buffer")))
	`(let ((,ScB-buffer (current-buffer)))
	   (unwind-protect
	       (progn ,@args)
	     (if (buffer-name ,ScB-buffer)
		 (set-buffer ,ScB-buffer)))))))


;; Copyright (C) 1985, 1986, 1992, 1994, 1995 Free Software Foundation, Inc.

;; GNU Emacs is free software; you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation; either version 2, or (at your option)
;; any later version.

;; GNU Emacs is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
;; GNU General Public License for more details.

;; You should have received a copy of the GNU General Public License
;; along with GNU Emacs; see the file COPYING.  If not, write to the
;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
;; Boston, MA 02111-1307, USA.


;; From emacs-20.3/lisp/subr.el

(if (or (not (fboundp 'with-current-buffer))
	(eq (car-safe (indirect-function 'with-current-buffer)) 'autoload))
    (defmacro with-current-buffer (buffer &rest body)
      "Execute the forms in BODY with BUFFER as the current buffer.
The value returned is the value of the last form in BODY.
See also `with-temp-buffer'."
      `(save-current-buffer
	 (set-buffer ,buffer)
	 ,@body)))

(if (or (not (fboundp 'with-temp-file))
	(eq (car-safe (indirect-function 'with-temp-file)) 'autoload))
    (defmacro with-temp-file (file &rest forms)
      "Create a new buffer, evaluate FORMS there, and write the buffer to FILE.
The value of the last form in FORMS is returned, like `progn'.
See also `with-temp-buffer'."
      (let ((temp-file (make-symbol "temp-file"))
	    (temp-buffer (make-symbol "temp-buffer")))
	`(let ((,temp-file ,file)
	       (,temp-buffer
		(get-buffer-create (generate-new-buffer-name " *temp file*"))))
	   (unwind-protect
	       (prog1
		   (with-current-buffer ,temp-buffer
		     ,@forms)
		 (with-current-buffer ,temp-buffer
		   (widen)
		   (write-region (point-min) (point-max) ,temp-file nil 0)))
	     (and (buffer-name ,temp-buffer)
		  (kill-buffer ,temp-buffer)))))))

(if (or (not (fboundp 'with-temp-buffer))
	(eq (car-safe (indirect-function 'with-temp-buffer)) 'autoload))
    (defmacro with-temp-buffer (&rest forms)
      "Create a temporary buffer, and evaluate FORMS there like `progn'.
See also `with-temp-file' and `with-output-to-string'."
      (let ((temp-buffer (make-symbol "temp-buffer")))
	`(let ((,temp-buffer
		(get-buffer-create (generate-new-buffer-name " *temp*"))))
	   (unwind-protect
	       (with-current-buffer ,temp-buffer
		 ,@forms)
	     (and (buffer-name ,temp-buffer)
		  (kill-buffer ,temp-buffer)))))))

(if (or (not (fboundp 'with-output-to-string))
	(eq (car-safe (indirect-function 'with-output-to-string)) 'autoload))
    (defmacro with-output-to-string (&rest body)
      "Execute BODY, return the text it sent to `standard-output', as a string."
      `(let ((standard-output
	      (get-buffer-create (generate-new-buffer-name " *string-output*"))))
	 (let ((standard-output standard-output))
	   ,@body)
	 (with-current-buffer standard-output
	   (prog1
	       (buffer-string)
	     (kill-buffer nil))))))


(if (or (not (fboundp 'split-string))
	(eq (car-safe (indirect-function 'split-string)) 'autoload))
    (defun split-string (string &optional separators)
      "Splits STRING into substrings where there are matches for SEPARATORS.
Each match for SEPARATORS is a splitting point.
The substrings between the splitting points are made into a list
which is returned.
If SEPARATORS is absent, it defaults to \"[ \\f\\t\\n\\r\\v]+\".

If there is match for SEPARATORS at the beginning of STRING, we do not
include a null substring for that.  Likewise, if there is a match
at the end of STRING, we don't include a null substring for that."
      (let ((rexp (or separators "[ \f\t\n\r\v]+"))
	    (start 0)
	    notfirst
	    (list nil))
	(while (and (string-match rexp string
				  (if (and notfirst
					   (= start (match-beginning 0))
					   (< start (length string)))
				      (1+ start) start))
		    (< (match-beginning 0) (length string)))
	  (setq notfirst t)
	  (or (eq (match-beginning 0) 0)
	      (and (eq (match-beginning 0) (match-end 0))
		   (eq (match-beginning 0) start))
	      (setq list
		    (cons (substring string start (match-beginning 0))
			  list)))
	  (setq start (match-end 0)))
	(or (eq start (length string))
	    (setq list
		  (cons (substring string start)
			list)))
	(nreverse list))))


;; From emacs-20.3/lisp/international/mule-util.el

(if (or (not (fboundp 'truncate-string-to-width))
	(eq (car-safe (indirect-function 'truncate-string-to-width)) 'autoload))
    (defun truncate-string-to-width (str end-column &optional start-column padding)
      "Truncate string STR to end at column END-COLUMN.
The optional 2nd arg START-COLUMN, if non-nil, specifies
the starting column; that means to return the characters occupying
columns START-COLUMN ... END-COLUMN of STR.

The optional 3rd arg PADDING, if non-nil, specifies a padding character
to add at the end of the result if STR doesn't reach column END-COLUMN,
or if END-COLUMN comes in the middle of a character in STR.
PADDING is also added at the beginning of the result
if column START-COLUMN appears in the middle of a character in STR.

If PADDING is nil, no padding is added in these cases, so
the resulting string may be narrower than END-COLUMN."
      (or start-column
	  (setq start-column 0))
      (let ((len (length str))
	    (idx 0)
	    (column 0)
	    (head-padding "") (tail-padding "")
	    ch last-column last-idx from-idx)
	(condition-case nil
	    (while (< column start-column)
	      (setq ch (aref str idx)
		    column (+ column (char-width ch))
		    idx (1+ idx)))
	  (args-out-of-range (setq idx len)))
	(if (< column start-column)
	    (if padding (make-string end-column padding) "")
	  (if (and padding (> column start-column))
	      (setq head-padding (make-string (- column start-column) padding)))
	  (setq from-idx idx)
	  (if (< end-column column)
	      (setq idx from-idx)
	    (condition-case nil
		(while (< column end-column)
		  (setq last-column column
			last-idx idx
			ch (aref str idx)
			column (+ column (char-width ch))
			idx (1+ idx)))
	      (args-out-of-range (setq idx len)))
	    (if (> column end-column)
		(setq column last-column idx last-idx))
	    (if (and padding (< column end-column))
		(setq tail-padding (make-string (- end-column column) padding))))
	  (setq str (substring str from-idx idx))
	  (if padding
	      (concat head-padding str tail-padding)
	    str)))))

;;; For backward compatiblity ...
(if (or (not (fboundp 'truncate-string))
	(eq (car-safe (indirect-function 'truncate-string)) 'autoload))
    (defalias 'truncate-string 'truncate-string-to-width))

-- 
Hallvard


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

* Re: Pterodactyl Gnus v0.5 is released
  1998-08-31 16:25     ` Hallvard B Furuseth
@ 1998-08-31 21:17       ` Lars Magne Ingebrigtsen
  1998-09-12 16:10         ` Hallvard B Furuseth
  0 siblings, 1 reply; 22+ messages in thread
From: Lars Magne Ingebrigtsen @ 1998-08-31 21:17 UTC (permalink / raw)


Hallvard B Furuseth <h.b.furuseth@usit.uio.no> writes:

> > You could probably hack up a library that defined those things,
> > though. 
> 
> Here, except it doesn't define char-charset (rfc1522.el, rfc2047.el),
> find-non-ascii-charset-region (rfc1522.el) and find-charset-region
> (rfc2047.el).  I don't know how they should work.  If someone has xemacs
> without MULE installed, maybe they could be copied from there.

Looks OK.  I'm not including it in the distribution, though -- perhaps 
you could be put up on a web site somewhere?  

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


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

* Re: Pterodactyl Gnus v0.5 is released
  1998-08-31 21:17       ` Lars Magne Ingebrigtsen
@ 1998-09-12 16:10         ` Hallvard B Furuseth
  0 siblings, 0 replies; 22+ messages in thread
From: Hallvard B Furuseth @ 1998-09-12 16:10 UTC (permalink / raw)


I forgot to post this one:

Lars Magne Ingebrigtsen writes:
>>> You could probably hack up a library that defined those things,
>>> though. 
>> 
>> Here, except it doesn't define char-charset (rfc1522.el, rfc2047.el),
>> find-non-ascii-charset-region (rfc1522.el) and find-charset-region
>> (rfc2047.el).  I don't know how they should work.  If someone has xemacs
>> without MULE installed, maybe they could be copied from there.
> 
> Looks OK.  I'm not including it in the distribution, though -- perhaps 
> you could be put up on a web site somewhere?  

<URL:http://www.uio.no/~hbf/gnus-e20.el>.

I've added a few extra things for the latest gnus, but I suspect it's a
losing battle to keep up.  I doubt I'll maintain it.

-- 
Hallvard


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

end of thread, other threads:[~1998-09-12 16:10 UTC | newest]

Thread overview: 22+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1998-08-29 21:26 Pterodactyl Gnus v0.5 is released Lars Magne Ingebrigtsen
1998-08-29 21:36 ` Michael Harnois
1998-08-29 21:41   ` SL Baur
1998-08-29 21:45   ` Lars Magne Ingebrigtsen
1998-08-29 21:57     ` Lloyd Zusman
1998-08-29 22:01     ` SL Baur
1998-08-29 22:09       ` Hrvoje Niksic
1998-08-29 22:35         ` SL Baur
1998-08-29 22:45           ` Hrvoje Niksic
1998-08-29 23:05             ` Lars Magne Ingebrigtsen
1998-08-29 22:45           ` Hrvoje Niksic
1998-08-29 22:58         ` Lars Magne Ingebrigtsen
1998-08-29 22:29     ` Michael Harnois
1998-08-29 23:02       ` Lars Magne Ingebrigtsen
1998-08-30  1:28     ` François Pinard
1998-08-29 22:08 ` SL Baur
1998-08-29 22:57   ` Lars Magne Ingebrigtsen
1998-08-31 12:29 ` Hallvard B Furuseth
1998-08-31 12:52   ` Lars Magne Ingebrigtsen
1998-08-31 16:25     ` Hallvard B Furuseth
1998-08-31 21:17       ` Lars Magne Ingebrigtsen
1998-09-12 16:10         ` Hallvard B Furuseth

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