Gnus development mailing list
 help / color / mirror / Atom feed
* Message - which charset?
@ 1999-03-14  7:49 Dmitry Yaitskov
  1999-03-14 16:19 ` Lars Magne Ingebrigtsen
  0 siblings, 1 reply; 6+ messages in thread
From: Dmitry Yaitskov @ 1999-03-14  7:49 UTC (permalink / raw)


Hi,

Could somebody help me please? I want to set up my messages so that:

1) the charset of a message, if it is a reply or a followup, would be
the same as the charset of the original message (somehow I supposed
that this would be the default behavior but I don't think it is on my
system).

2) do something in the message buffer depending on the charset of the
message. I wanted to use the message-setup-hook for this but don't
know how to make sure that I have the charset available in the message
headers when the message setup hook is called. Even if I reply to a
message with a specified charset, I don't see it in the reply's
headers although I have message-generate-headers-first set to t.

Any advice would be much appreciated. Thanks.

-- 
Cheers,
-Dima.



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

* Re: Message - which charset?
  1999-03-14  7:49 Message - which charset? Dmitry Yaitskov
@ 1999-03-14 16:19 ` Lars Magne Ingebrigtsen
  1999-03-14 17:49   ` Dmitry Yaitskov
  0 siblings, 1 reply; 6+ messages in thread
From: Lars Magne Ingebrigtsen @ 1999-03-14 16:19 UTC (permalink / raw)


Dmitry Yaitskov <dimas@home.com> writes:

> 1) the charset of a message, if it is a reply or a followup, would be
> the same as the charset of the original message (somehow I supposed
> that this would be the default behavior but I don't think it is on my
> system).

If you are using a Mule-enabled Emacs, then that should be the case.

> 2) do something in the message buffer depending on the charset of the
> message. I wanted to use the message-setup-hook for this but don't
> know how to make sure that I have the charset available in the message
> headers when the message setup hook is called. Even if I reply to a
> message with a specified charset, I don't see it in the reply's
> headers although I have message-generate-headers-first set to t.

Well, there may be several charsets in an article, so there's no easy
way to do that.

(mm-find-mime-charset-region (point-min) (point-max))

will return a list of charsets in the current buffer.

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


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

* Re: Message - which charset?
  1999-03-14 16:19 ` Lars Magne Ingebrigtsen
@ 1999-03-14 17:49   ` Dmitry Yaitskov
  1999-03-16  7:23     ` Hrvoje Niksic
  0 siblings, 1 reply; 6+ messages in thread
From: Dmitry Yaitskov @ 1999-03-14 17:49 UTC (permalink / raw)


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

> Dmitry Yaitskov <dimas@home.com> writes:
> 
> > 1) the charset of a message, if it is a reply or a followup, would be
> > the same as the charset of the original message (somehow I supposed
> > that this would be the default behavior but I don't think it is on my
> > system).
> 
> If you are using a Mule-enabled Emacs, then that should be the case.

Thanks, but no, I am using a non-Mule emacs. I don't want to pay the
performance penalty for the very limited multilingual support that I
really need. Basically, besides English I only *sometimes* need
Russian support in news and email - which would work fine out of the
box if it were not for the 2 different coding sysems used for Russian.
Even with that, most problems are solved by a lisp module enabling to
select the coding system. And with some simple elisp, I can now
determine which of the 2 coding systems is used in a particular
incoming message. My only problem left is - I'd like to be able to
specify the charset "of my choice" for the message that I compose (for
the whole message or for the 1st part of a mime one), based on the
headers/body of the (1st part of the 1st) message being replied
to/followed up. (For new messages, the default Gnus charset works
fine.) Is it possible to set up a hook like that to tell Gnus which
charset to specify?

> > 2) do something in the message buffer depending on the charset of the
> > message. I wanted to use the message-setup-hook for this but don't
> > know how to make sure that I have the charset available in the message
> > headers when the message setup hook is called. Even if I reply to a
> > message with a specified charset, I don't see it in the reply's
> > headers although I have message-generate-headers-first set to t.
> 
> Well, there may be several charsets in an article, so there's no easy
> way to do that.
> 
> (mm-find-mime-charset-region (point-min) (point-max))
> 
> will return a list of charsets in the current buffer.

Thanks, I will try to use it. I am not sure though this would help as
I'd like the list of charsets in the message(s) being replied to, not
the current (new?) one. In other words: while in the original message
buffer, I can determine (using mm-find-mime-charset-region or
otherwise) what the charset in the reply should be. Now, I hit
reply/followup/whatever, and in the new message buffer need to tell
Gnus somehow to change its "default" charset for this message only to
the one that I just found out in step 1. Is there a way to achieve
this? Thanks.

-- 
Cheers,
-Dima.



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

* Re: Message - which charset?
  1999-03-14 17:49   ` Dmitry Yaitskov
@ 1999-03-16  7:23     ` Hrvoje Niksic
  1999-03-16  7:55       ` Dmitry Yaitskov
  0 siblings, 1 reply; 6+ messages in thread
From: Hrvoje Niksic @ 1999-03-16  7:23 UTC (permalink / raw)


Dmitry Yaitskov <dimas@home.com> writes:

> select the coding system. And with some simple elisp, I can now
> determine which of the 2 coding systems is used in a particular
> incoming message. My only problem left is - I'd like to be able to
> specify the charset "of my choice" for the message that I compose (for
> the whole message or for the 1st part of a mime one), based on the
> headers/body of the (1st part of the 1st) message being replied
> to/followed up.

Try setting `message-default-charset', or making your simple elisp set 
it for you.


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

* Re: Message - which charset?
  1999-03-16  7:23     ` Hrvoje Niksic
@ 1999-03-16  7:55       ` Dmitry Yaitskov
  1999-03-16  8:09         ` Hrvoje Niksic
  0 siblings, 1 reply; 6+ messages in thread
From: Dmitry Yaitskov @ 1999-03-16  7:55 UTC (permalink / raw)


Hrvoje Niksic <hniksic@srce.hr> wrote:

> Dmitry Yaitskov <dimas@home.com> writes:
> 
> > select the coding system. And with some simple elisp, I can now
> > determine which of the 2 coding systems is used in a particular
> > incoming message. My only problem left is - I'd like to be able to
> > specify the charset "of my choice" for the message that I compose (for
> > the whole message or for the 1st part of a mime one), based on the
> > headers/body of the (1st part of the 1st) message being replied
> > to/followed up.
> 
> Try setting `message-default-charset', or making your simple elisp set 
> it for you.

Thanks. Prob is - my "simple elisp" does a good job of determining the
charset of the message being viewed by gnus (run by
gnus-part-display-hook) - but when should I set the
message-default-charset? It is global (right?) and I don't want to
change it while I'm browsing my mail - I want to change it only when I
reply/follow up a particular message, and only for the duration of
that reply... Otherwise my message-default-charset would depend on
which particular message I last viewed, even if I happen to compose a
completely new message... any ideas? Or am I missing something here?
Thanks.

-- 
Cheers,
-Dima.



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

* Re: Message - which charset?
  1999-03-16  7:55       ` Dmitry Yaitskov
@ 1999-03-16  8:09         ` Hrvoje Niksic
  0 siblings, 0 replies; 6+ messages in thread
From: Hrvoje Niksic @ 1999-03-16  8:09 UTC (permalink / raw)


Dmitry Yaitskov <dimas@home.com> writes:

> Thanks. Prob is - my "simple elisp" does a good job of determining
> the charset of the message being viewed by gnus (run by
> gnus-part-display-hook) - but when should I set the
> message-default-charset? It is global (right?) and I don't want to
> change it while I'm browsing my mail - I want to change it only when
> I reply/follow up a particular message, and only for the duration of
> that reply...

Well, you could hook into one of the message hooks,
e.g. `message-send-hook' and have "simple elisp" analyze the contents
of the message buffer.


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

end of thread, other threads:[~1999-03-16  8:09 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1999-03-14  7:49 Message - which charset? Dmitry Yaitskov
1999-03-14 16:19 ` Lars Magne Ingebrigtsen
1999-03-14 17:49   ` Dmitry Yaitskov
1999-03-16  7:23     ` Hrvoje Niksic
1999-03-16  7:55       ` Dmitry Yaitskov
1999-03-16  8:09         ` Hrvoje Niksic

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