Gnus development mailing list
 help / color / mirror / Atom feed
* Support for slrn-style verbatim marks
@ 2005-09-22 16:31 Reiner Steib
  2005-09-26 11:06 ` Adam Sjøgren
  0 siblings, 1 reply; 12+ messages in thread
From: Reiner Steib @ 2005-09-22 16:31 UTC (permalink / raw)


Hi,

slrn users often include verbatim text[1] like this:

#v+
some text
#v-

See e.g. <news:20050922091531.GA30618@nic-nac-project.de>
(gmane.network.leafnode) or <news:9361.20809.1127310956@news.jors.net>
(de.comp.security.misc)

I though it would be nice if Gnus would display these verbatim text in
a different color and it would also be nice to treat these parts as
MIME (save to file, ...).  So I implemented it.

Comments welcome.  Maybe someone can think of nicer names instead of
"verbatim-marks" or "mm-uu-extract".

Bye, Reiner.

[1]
,----[ http://www.slrn.org/manual/slrn-manual-6.html#ss6.81 ]
| 6.81 process_verbatim_marks
| 
| Type: integer
| Default: 1
| 
| If this variable is set to a non-zero value, slrn will interpret
| text enclosed by "#v+" and "#v-" (on a line of their own) as
| ``verbatim''. Verbatim text will be displayed according to the color
| object verbatim; emphasized text it might contain will not be
| highlighted. This is especially useful when dealing with source
| code.
| 
| Note: slrn is currently the only program that interprets these
| verbatim marks. This is due to the lack of a standard that would
| describe a way to mark text as ``verbatim'' in usenet articles.
`----

Obviously the first sentence of the note is not true anymore. ;-)
-- 
       ,,,
      (o o)
---ooO-(_)-Ooo---  |  PGP key available  |  http://rsteib.home.pages.de/




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

* Re: Support for slrn-style verbatim marks
  2005-09-22 16:31 Support for slrn-style verbatim marks Reiner Steib
@ 2005-09-26 11:06 ` Adam Sjøgren
  2005-09-26 18:08   ` Reiner Steib
  0 siblings, 1 reply; 12+ messages in thread
From: Adam Sjøgren @ 2005-09-26 11:06 UTC (permalink / raw)


On Thu, 22 Sep 2005 18:31:40 +0200, Reiner wrote:

[slrn's #v+ ... #v- for verbatim:]

> I though it would be nice if Gnus would display these verbatim text in
> a different color and it would also be nice to treat these parts as
> MIME (save to file, ...).  So I implemented it.

This is very nice - thanks!

> | Note: slrn is currently the only program that interprets these
> | verbatim marks. This is due to the lack of a standard that would
> | describe a way to mark text as ``verbatim'' in usenet articles.
> `----

> Obviously the first sentence of the note is not true anymore. ;-)

;-)


  Best regards,

-- 
 "He's got nothing to say, he's just happy to be there"       Adam Sjøgren
                                                         asjo@koldfront.dk




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

* Re: Support for slrn-style verbatim marks
  2005-09-26 11:06 ` Adam Sjøgren
@ 2005-09-26 18:08   ` Reiner Steib
  2005-09-26 19:15     ` Adam Sjøgren
  0 siblings, 1 reply; 12+ messages in thread
From: Reiner Steib @ 2005-09-26 18:08 UTC (permalink / raw)


On Mon, Sep 26 2005, Adam Sjøgren wrote:

> On Thu, 22 Sep 2005 18:31:40 +0200, Reiner wrote:
>
> [slrn's #v+ ... #v- for verbatim:]
>
>> I though it would be nice if Gnus would display these verbatim text in
>> a different color and it would also be nice to treat these parts as
>> MIME (save to file, ...).  So I implemented it.
>
> This is very nice - thanks!

Today I noticed that it doesn't work correctly when the verbatim text
contains non-ASCII characters:

#v+
some text with Latin-1: Sjøgren, Grüße
#v-

I couldn't figure out how to set the charset for the extracted part.
Anyone?

Bye, Reiner.
-- 
       ,,,
      (o o)
---ooO-(_)-Ooo---  |  PGP key available  |  http://rsteib.home.pages.de/




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

* Re: Support for slrn-style verbatim marks
  2005-09-26 18:08   ` Reiner Steib
@ 2005-09-26 19:15     ` Adam Sjøgren
  2005-09-26 21:09       ` Reiner Steib
  0 siblings, 1 reply; 12+ messages in thread
From: Adam Sjøgren @ 2005-09-26 19:15 UTC (permalink / raw)


On Mon, 26 Sep 2005 20:08:49 +0200, Reiner wrote:

> Today I noticed that it doesn't work correctly when the verbatim
> text contains non-ASCII characters:

> some text with Latin-1: Sjøgren, Grüße

Your test works for me (XEmacs 21.4 (patch 17)), I think (I see ø, ü
and ß, and they are there if I save the mime-part as well).


  Best regards,

-- 
 "Commandeer! We're going to 'commandeer' that ship.          Adam Sjøgren
  Nautical term."                                        asjo@koldfront.dk




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

* Re: Support for slrn-style verbatim marks
  2005-09-26 19:15     ` Adam Sjøgren
@ 2005-09-26 21:09       ` Reiner Steib
  2005-09-27  2:17         ` Katsumi Yamaoka
  0 siblings, 1 reply; 12+ messages in thread
From: Reiner Steib @ 2005-09-26 21:09 UTC (permalink / raw)


On Mon, Sep 26 2005, Adam Sjøgren wrote:

> On Mon, 26 Sep 2005 20:08:49 +0200, Reiner wrote:
>
>> Today I noticed that it doesn't work correctly when the verbatim
>> text contains non-ASCII characters:
>
>> some text with Latin-1: Sjøgren, Grüße
>
> Your test works for me (XEmacs 21.4 (patch 17)), I think (I see ø, ü
> and ß, and they are there if I save the mime-part as well).

I \201 in front of every non-ASCII character (Emacs/22.0.50).  The
saved MIME part (loading the file saved with `o') also is encoded as
`emacs-mule-unix'.

Bye, Reiner.
-- 
       ,,,
      (o o)
---ooO-(_)-Ooo---  |  PGP key available  |  http://rsteib.home.pages.de/




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

* Re: Support for slrn-style verbatim marks
  2005-09-26 21:09       ` Reiner Steib
@ 2005-09-27  2:17         ` Katsumi Yamaoka
  2005-09-27 12:53           ` Reiner Steib
  0 siblings, 1 reply; 12+ messages in thread
From: Katsumi Yamaoka @ 2005-09-27  2:17 UTC (permalink / raw)


>>>>> In <v9y85jilj7.fsf@marauder.physik.uni-ulm.de> Reiner Steib wrote:

> I \201 in front of every non-ASCII character (Emacs/22.0.50).  The
> saved MIME part (loading the file saved with `o') also is encoded as
> `emacs-mule-unix'.

Yes, it is caused by inserting decoded unibyte text into the
multibyte buffer.  I've fixed it in the CVS trunk.

Consequently, I made unrelated changes to displaying of
text/verbatim parts, but I think they all are reasonable, and
will commit them into the v5-10 branch later.



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

* Re: Support for slrn-style verbatim marks
  2005-09-27  2:17         ` Katsumi Yamaoka
@ 2005-09-27 12:53           ` Reiner Steib
  2005-09-27 15:04             ` Simon Josefsson
  2005-09-28  3:23             ` Katsumi Yamaoka
  0 siblings, 2 replies; 12+ messages in thread
From: Reiner Steib @ 2005-09-27 12:53 UTC (permalink / raw)


On Tue, Sep 27 2005, Katsumi Yamaoka wrote:

>>>>>> In <v9y85jilj7.fsf@marauder.physik.uni-ulm.de> Reiner Steib wrote:
>
>> I \201 in front of every non-ASCII character (Emacs/22.0.50).  The
>> saved MIME part (loading the file saved with `o') also is encoded as
>> `emacs-mule-unix'.
>
> Yes, it is caused by inserting decoded unibyte text into the
> multibyte buffer.  I've fixed it in the CVS trunk.

Thanks!

Maybe we could improve the documentation.  The doc-string of
`mm-make-handle' didn't explain that I should use 
  TYPE = '("text/plain" (charset . gnus-decoded))
instead of
  ENCODING = 'what-ever
here.

,----[ <f1> f mm-make-handle RET ]
| mm-make-handle is a Lisp macro in `mm-decode'.
| (mm-make-handle &optional BUFFER TYPE ENCODING UNDISPLAYER
| DISPOSITION DESCRIPTION CACHE ID)
| 
| Not documented.
`----

> Consequently, I made unrelated changes to displaying of
> text/verbatim parts, 

In case it wasn't clear: I invented the type "text/verbatim" (I don't
think it's used anywhere else).  If it is possible to get the same
result with an existing (and suitable) MIME type, say "text/plain", we
should use that instead.

The result I had in mind should include:

(1) Display a button so that the user can easily save, pipe, ... the
    part (the button should not be collapsed).

(2) The part should be displayed inline.

(3) The part should be fontified using the `mm-uu-extract' face.

Your addition of "text/verbatim" to `mm-automatic-display' cancels
(1).

OTOT: The user can press `K b' and then process the part.  And the
article buffer isn't cluttered with buttons.  I don't have a strong
opinion on this.  Opinions?

Using "text/verbatim" (instead of "text/plain") allows customizing the
display using `gnus-buttonized-mime-types' or
`gnus-unbuttonized-mime-types'.

Bye, Reiner.
-- 
       ,,,
      (o o)
---ooO-(_)-Ooo---  |  PGP key available  |  http://rsteib.home.pages.de/




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

* Re: Support for slrn-style verbatim marks
  2005-09-27 12:53           ` Reiner Steib
@ 2005-09-27 15:04             ` Simon Josefsson
  2005-09-27 16:18               ` Reiner Steib
  2005-09-28  3:23             ` Katsumi Yamaoka
  1 sibling, 1 reply; 12+ messages in thread
From: Simon Josefsson @ 2005-09-27 15:04 UTC (permalink / raw)


Reiner Steib <reinersteib+gmane@imap.cc> writes:

>> Consequently, I made unrelated changes to displaying of
>> text/verbatim parts, 
>
> In case it wasn't clear: I invented the type "text/verbatim" (I don't
> think it's used anywhere else).  If it is possible to get the same
> result with an existing (and suitable) MIME type, say "text/plain", we
> should use that instead.
>
> The result I had in mind should include:
>
> (1) Display a button so that the user can easily save, pipe, ... the
>     part (the button should not be collapsed).
>
> (2) The part should be displayed inline.
>
> (3) The part should be fontified using the `mm-uu-extract' face.
>
> Your addition of "text/verbatim" to `mm-automatic-display' cancels
> (1).
>
> OTOT: The user can press `K b' and then process the part.  And the
> article buffer isn't cluttered with buttons.  I don't have a strong
> opinion on this.  Opinions?
>
> Using "text/verbatim" (instead of "text/plain") allows customizing the
> display using `gnus-buttonized-mime-types' or
> `gnus-unbuttonized-mime-types'.

Is text/verbatim registered?  If not, I think Gnus should use
text/x-gnus-verbatim or something similar, to avoid confusion with
possible future registered MIME types.



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

* Re: Support for slrn-style verbatim marks
  2005-09-27 15:04             ` Simon Josefsson
@ 2005-09-27 16:18               ` Reiner Steib
  2005-09-28  9:43                 ` Simon Josefsson
  0 siblings, 1 reply; 12+ messages in thread
From: Reiner Steib @ 2005-09-27 16:18 UTC (permalink / raw)


On Tue, Sep 27 2005, Simon Josefsson wrote:

> Is text/verbatim registered?

It's not, AFAIK.

> If not, I think Gnus should use text/x-gnus-verbatim or something
> similar, to avoid confusion with possible future registered MIME
> types.

Fine with me.  "text/x-gnus-verbatim" or "text/x-verbatim"?
Preferences or other suggestions, anyone?

Bye, Reiner.
-- 
       ,,,
      (o o)
---ooO-(_)-Ooo---  |  PGP key available  |  http://rsteib.home.pages.de/




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

* Re: Support for slrn-style verbatim marks
  2005-09-27 12:53           ` Reiner Steib
  2005-09-27 15:04             ` Simon Josefsson
@ 2005-09-28  3:23             ` Katsumi Yamaoka
  2005-09-28  9:48               ` Reiner Steib
  1 sibling, 1 reply; 12+ messages in thread
From: Katsumi Yamaoka @ 2005-09-28  3:23 UTC (permalink / raw)


> On Tue, Sep 27 2005, Katsumi Yamaoka wrote:

>> Consequently, I made unrelated changes to displaying of
>> text/verbatim parts,

This sentence didn't make any sense.  Please never mind.

The chief aim of my changes was not to modify decoded text.  Some
functions which were used before insert text into a unibyte buffer
and take it out, or assume text exists in a unibyte buffer, even
if the text has been decoded.  Although that doesn't mean text is
always to be broken (it might be able to restore), such a process
is useless and especially it is hard to save text properties.

>>>>> In <v9achyfz9v.fsf@marauder.physik.uni-ulm.de> Reiner Steib wrote:

> In case it wasn't clear: I invented the type "text/verbatim" (I don't
> think it's used anywhere else).  If it is possible to get the same
> result with an existing (and suitable) MIME type, say "text/plain", we
> should use that instead.

I think my changes are effective regardless of MIME types, though
I might have forgotten to do it to some other functions.  Anyway,
the opportunity for it to be used effectively seems to be few.

> The result I had in mind should include:

> (1) Display a button so that the user can easily save, pipe, ... the
>     part (the button should not be collapsed).

Oops, I decided not to display a button to the verbatim part
because I recognized it's only a replacement for a text/plain
part.  However, if I am wrong, I agree to displaying buttons by
default.  To do that, please remove "text/x-gnus-verbatim" from
the `mm-automatic-display' variable.  In that case, the
`gnus-mime-display-single' function behaves differently, but
I've already fixed so that it works properly then.

> (2) The part should be displayed inline.

> (3) The part should be fontified using the `mm-uu-extract' face.

> Your addition of "text/verbatim" to `mm-automatic-display' cancels
> (1).

> OTOT: The user can press `K b' and then process the part.  And the
> article buffer isn't cluttered with buttons.  I don't have a strong
> opinion on this.  Opinions?

> Using "text/verbatim" (instead of "text/plain") allows customizing the
> display using `gnus-buttonized-mime-types' or
> `gnus-unbuttonized-mime-types'.

I'm not familiar with the verbatim parts, so I leave it to your
decision.  BTW, is it necessary to put `gnus' in the name of the
part type? (I feel `x-verbatim' is sufficient.)



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

* Re: Support for slrn-style verbatim marks
  2005-09-27 16:18               ` Reiner Steib
@ 2005-09-28  9:43                 ` Simon Josefsson
  0 siblings, 0 replies; 12+ messages in thread
From: Simon Josefsson @ 2005-09-28  9:43 UTC (permalink / raw)


Reiner Steib <reinersteib+gmane@imap.cc> writes:

> On Tue, Sep 27 2005, Simon Josefsson wrote:
>
>> Is text/verbatim registered?
>
> It's not, AFAIK.
>
>> If not, I think Gnus should use text/x-gnus-verbatim or something
>> similar, to avoid confusion with possible future registered MIME
>> types.
>
> Fine with me.  "text/x-gnus-verbatim" or "text/x-verbatim"?
> Preferences or other suggestions, anyone?

Doesn't matter, x-verbatim is fine too.  Perhaps better.



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

* Re: Support for slrn-style verbatim marks
  2005-09-28  3:23             ` Katsumi Yamaoka
@ 2005-09-28  9:48               ` Reiner Steib
  0 siblings, 0 replies; 12+ messages in thread
From: Reiner Steib @ 2005-09-28  9:48 UTC (permalink / raw)


On Wed, Sep 28 2005, Katsumi Yamaoka wrote:

> I'm not familiar with the verbatim parts, so I leave it to your
> decision.  BTW, is it necessary to put `gnus' in the name of the
> part type? (I feel `x-verbatim' is sufficient.)

For me, either one is fine.  See my reply to Simon.  If more people
prefer "x-verbatim" we can change it (maybe let's a couple of days).

Bye, Reiner.
-- 
       ,,,
      (o o)
---ooO-(_)-Ooo---  |  PGP key available  |  http://rsteib.home.pages.de/




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

end of thread, other threads:[~2005-09-28  9:48 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-09-22 16:31 Support for slrn-style verbatim marks Reiner Steib
2005-09-26 11:06 ` Adam Sjøgren
2005-09-26 18:08   ` Reiner Steib
2005-09-26 19:15     ` Adam Sjøgren
2005-09-26 21:09       ` Reiner Steib
2005-09-27  2:17         ` Katsumi Yamaoka
2005-09-27 12:53           ` Reiner Steib
2005-09-27 15:04             ` Simon Josefsson
2005-09-27 16:18               ` Reiner Steib
2005-09-28  9:43                 ` Simon Josefsson
2005-09-28  3:23             ` Katsumi Yamaoka
2005-09-28  9:48               ` Reiner Steib

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