* setting default MIME charset not works with emacs 20.4
@ 1999-07-30 0:16 Vladimir Volovich
1999-08-01 10:24 ` Vladimir Volovich
0 siblings, 1 reply; 8+ messages in thread
From: Vladimir Volovich @ 1999-07-30 0:16 UTC (permalink / raw)
Hi,
with emacs-20.3.6, i had
(set-language-environment "Cyrillic-KOI8")
;...
(coding-system-put
(get-charset-property 'cyrillic-iso8859-5 'prefered-coding-system)
'mime-charset 'koi8-r)
to set the default MIME charset for posting messages with cyrillic in
KOI8-R (instead of ISO-8859-5). This worked fine; but when i upgraded
to emacs 20.4, this no longer works (yes, i renamed
prefered-coding-system to preferred-coding-system): my messages are
sent in iso-8859-5 instead of koi8-r.
what should i do in emacs 20.4 to get things working? :-)
Thanks.
Best regards, -- Vladimir.
--
Usage: fortune -P [] -a [xsz] [Q: [file]] [rKe9] -v6[+] dataspec ... inputdir
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: setting default MIME charset not works with emacs 20.4
1999-07-30 0:16 setting default MIME charset not works with emacs 20.4 Vladimir Volovich
@ 1999-08-01 10:24 ` Vladimir Volovich
1999-09-24 17:01 ` Lars Magne Ingebrigtsen
0 siblings, 1 reply; 8+ messages in thread
From: Vladimir Volovich @ 1999-08-01 10:24 UTC (permalink / raw)
[-- Attachment #1: Type: text/plain, Size: 2678 bytes --]
"VV" == Vladimir Volovich writes:
VV> Hi, with emacs-20.3.6, i had
VV> (set-language-environment "Cyrillic-KOI8") ;...
VV> (coding-system-put (get-charset-property 'cyrillic-iso8859-5
VV> 'prefered-coding-system) 'mime-charset 'koi8-r)
VV> to set the default MIME charset for posting messages with
VV> cyrillic in KOI8-R (instead of ISO-8859-5). This worked fine; but
VV> when i upgraded to emacs 20.4, this no longer works (yes, i
VV> renamed prefered-coding-system to preferred-coding-system): my
VV> messages are sent in iso-8859-5 instead of koi8-r.
VV> what should i do in emacs 20.4 to get things working? :-)
(1) well, finally the following works:
(put-charset-property 'cyrillic-iso8859-5 'prefered-coding-system 'koi8-r)
i.e. instead of coding-system-put, use put-charset-property. i wonder,
why that change was needed, i.e. what changed between emacs-20.3.6 and
emacs-20.4?
(2) mm-util.el reads:
(defun mm-preferred-coding-system (charset)
;; A typo in some Emacs versions.
(or (get-charset-property charset 'prefered-coding-system)
(get-charset-property charset 'preffered-coding-system)))
in emacs-20.3, the name was prefered-coding-system, in emacs-20.4, it
was corrected: preferred-coding-system; but gnus does not check for
this name, but instead checks for preffered-coding-system, which seems
to be a typo in _gnus_, not in emacs (or is preffered-coding-system
really used somewhere?). [i.e. it seems that in mm-util.el, one should
either change preffered-coding-system to preferred-coding-system, or
add a check for preferred-coding-system].
(3) files in emacs/<version>/language/ define preferred mime charsets
for coding systems, so gnus probably could extract that info from
there instead of insisting to use such things as
put-charset-property in .emacs file.
i.e. (coding-system-get 'cyrillic-koi8 'mime-charset) returns
koi8-r.
Also, emacs/<version>/lisp/international/ contains some useful
stuff for charsets, e.g. mule-cmds.el contains
find-coding-systems-for-charsets which could be used in gnus.
(find-coding-systems-for-charsets (find-charset-string "test тест"))
(cyrillic-koi8 cyrillic-iso-8bit x-ctext iso-2022-7bit iso-2022-7bit-lock iso-2022-8bit-ss2 emacs-mule raw-text cyrillic-alternativnyj thai-tis620-with-esc tibetan-iso-8bit-with-esc lao-with-esc korean-iso-8bit-with-esc japanese-iso-8bit-with-esc in-is13194-devanagari-with-esc chinese-iso-8bit-with-esc iso-latin-5-with-esc hebrew-iso-8bit-with-esc greek-iso-8bit-with-esc cyrillic-iso-8bit-with-esc iso-latin-4-with-esc iso-latin-3-with-esc iso-latin-2-with-esc iso-latin-1-with-esc compound-text iso-2022-7bit-ss2)
[-- Attachment #2: Type: text/plain, Size: 563 bytes --]
(find-coding-systems-for-charsets (find-charset-string "test êãõëå"))
(iso-latin-1 iso-2022-jp-2 x-ctext iso-2022-7bit iso-2022-7bit-lock iso-2022-8bit-ss2 emacs-mule raw-text thai-tis620-with-esc tibetan-iso-8bit-with-esc lao-with-esc korean-iso-8bit-with-esc japanese-iso-8bit-with-esc in-is13194-devanagari-with-esc chinese-iso-8bit-with-esc iso-latin-5-with-esc hebrew-iso-8bit-with-esc greek-iso-8bit-with-esc cyrillic-iso-8bit-with-esc iso-latin-4-with-esc iso-latin-3-with-esc iso-latin-2-with-esc iso-latin-1-with-esc compound-text iso-2022-7bit-ss2)
[-- Attachment #3: Type: text/plain, Size: 66 bytes --]
(find-coding-systems-for-charsets (find-charset-string "test тест
[-- Attachment #4: Type: text/plain, Size: 781 bytes --]
êãõëå"))
(x-ctext iso-2022-7bit iso-2022-7bit-lock iso-2022-8bit-ss2 emacs-mule raw-text thai-tis620-with-esc tibetan-iso-8bit-with-esc lao-with-esc korean-iso-8bit-with-esc japanese-iso-8bit-with-esc in-is13194-devanagari-with-esc chinese-iso-8bit-with-esc iso-latin-5-with-esc hebrew-iso-8bit-with-esc greek-iso-8bit-with-esc cyrillic-iso-8bit-with-esc iso-latin-4-with-esc iso-latin-3-with-esc iso-latin-2-with-esc iso-latin-1-with-esc compound-text iso-2022-7bit-ss2)
i.e. gnus should find-charset-string for the message part body, then
call find-coding-systems-for-charsets, and finally select the
appropriate charset from the returned list; it could then extract the
mime-charset to use for encoding that charset via coding-system-get.
Best regards, -- Vladimir.
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: setting default MIME charset not works with emacs 20.4
1999-08-01 10:24 ` Vladimir Volovich
@ 1999-09-24 17:01 ` Lars Magne Ingebrigtsen
1999-09-25 16:03 ` Vladimir Volovich
0 siblings, 1 reply; 8+ messages in thread
From: Lars Magne Ingebrigtsen @ 1999-09-24 17:01 UTC (permalink / raw)
Vladimir Volovich <vvv@vvv.vsu.ru> writes:
> (defun mm-preferred-coding-system (charset)
> ;; A typo in some Emacs versions.
> (or (get-charset-property charset 'prefered-coding-system)
> (get-charset-property charset 'preffered-coding-system)))
Yup. Fix in Pterodactyl Gnus v0.97.
> (3) files in emacs/<version>/language/ define preferred mime charsets
> for coding systems, so gnus probably could extract that info from
> there instead of insisting to use such things as
> put-charset-property in .emacs file.
>
> i.e. (coding-system-get 'cyrillic-koi8 'mime-charset) returns
> koi8-r.
There is code in mm to use that stuff, and it seems to work for me.
(Although I don't write Cyrillic, so I haven't really tested. :-)
Under what circumstances does it fail?
--
(domestic pets only, the antidote for overdose, milk.)
larsi@gnus.org * Lars Magne Ingebrigtsen
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: setting default MIME charset not works with emacs 20.4
1999-09-24 17:01 ` Lars Magne Ingebrigtsen
@ 1999-09-25 16:03 ` Vladimir Volovich
1999-09-27 17:28 ` Lars Magne Ingebrigtsen
0 siblings, 1 reply; 8+ messages in thread
From: Vladimir Volovich @ 1999-09-25 16:03 UTC (permalink / raw)
"LMI" == Lars Magne Ingebrigtsen writes:
>> (3) files in emacs/<version>/language/ define preferred mime
>> charsets for coding systems, so gnus probably could extract that
>> info from there instead of insisting to use such things as
>> put-charset-property in .emacs file.
>>
>> i.e. (coding-system-get 'cyrillic-koi8 'mime-charset) returns
>> koi8-r.
LMI> There is code in mm to use that stuff, and it seems to work for
LMI> me. (Although I don't write Cyrillic, so I haven't really
LMI> tested. :-) Under what circumstances does it fail?
Well, i set
(set-language-environment "Cyrillic-KOI8")
and i expect that in this language environment gnus should prefer
koi8-r when sending cyrillic letters. but gnus still uses iso-8859-5.
so, it seems that gnus does not extract that info from coding system
properties (or elsewhere), to guess the preferred charset to use.
Best regards, -- Vladimir.
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: setting default MIME charset not works with emacs 20.4
1999-09-25 16:03 ` Vladimir Volovich
@ 1999-09-27 17:28 ` Lars Magne Ingebrigtsen
1999-09-27 18:52 ` Vladimir Volovich
0 siblings, 1 reply; 8+ messages in thread
From: Lars Magne Ingebrigtsen @ 1999-09-27 17:28 UTC (permalink / raw)
Vladimir Volovich <vvv@vvv.vsu.ru> writes:
> Well, i set
>
> (set-language-environment "Cyrillic-KOI8")
>
> and i expect that in this language environment gnus should prefer
> koi8-r when sending cyrillic letters. but gnus still uses iso-8859-5.
> so, it seems that gnus does not extract that info from coding system
> properties (or elsewhere), to guess the preferred charset to use.
Hm.
What does
(mm-find-charset-region (point-min) (point-max))
and
(mm-find-mime-charset-region (point-min) (point-max))
evaluate to for you in a buffer with some cyrillic text?
--
(domestic pets only, the antidote for overdose, milk.)
larsi@gnus.org * Lars Magne Ingebrigtsen
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: setting default MIME charset not works with emacs 20.4
1999-09-27 17:28 ` Lars Magne Ingebrigtsen
@ 1999-09-27 18:52 ` Vladimir Volovich
1999-09-27 19:14 ` Lars Magne Ingebrigtsen
0 siblings, 1 reply; 8+ messages in thread
From: Vladimir Volovich @ 1999-09-27 18:52 UTC (permalink / raw)
"LMI" == Lars Magne Ingebrigtsen writes:
>> Well, i set
>>
>> (set-language-environment "Cyrillic-KOI8")
>>
>> and i expect that in this language environment gnus should prefer
>> koi8-r when sending cyrillic letters. but gnus still uses
>> iso-8859-5. so, it seems that gnus does not extract that info
>> from coding system properties (or elsewhere), to guess the
>> preferred charset to use.
LMI> Hm.
LMI> What does
LMI> (mm-find-charset-region (point-min) (point-max))
LMI> and
LMI> (mm-find-mime-charset-region (point-min) (point-max))
LMI> evaluate to for you in a buffer with some cyrillic text?
We have
(set-language-environment "Cyrillic-KOI8")
then, in the *mail* buffer with cyrillic letters,
(mm-find-charset-region (point-min) (point-max)) gives
(ascii cyrillic-iso8859-5)
(mm-find-mime-charset-region (point-min) (point-max)) gives
(iso-8859-5)
(note that current language environment is Cyrillic-KOI8, but mime
charset returned is iso-8859-5!)
After executing
(put-charset-property 'cyrillic-iso8859-5 'prefered-coding-system 'koi8-r)
we get the following results:
(mm-find-charset-region (point-min) (point-max)) gives
(ascii cyrillic-iso8859-5)
(mm-find-mime-charset-region (point-min) (point-max)) gives
(koi8-r)
So, i wonder, is gnus supposed to guess mime charset for cyrillic to
be koi8-r when the Cyrillic-KOI8 language environment is active, or i
should execute the above statement
(put-charset-property 'cyrillic-iso8859-5 'prefered-coding-system 'koi8-r)
in my .emacs?
Best regards, -- Vladimir.
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: setting default MIME charset not works with emacs 20.4
1999-09-27 18:52 ` Vladimir Volovich
@ 1999-09-27 19:14 ` Lars Magne Ingebrigtsen
1999-09-27 20:17 ` Arcady Genkin
0 siblings, 1 reply; 8+ messages in thread
From: Lars Magne Ingebrigtsen @ 1999-09-27 19:14 UTC (permalink / raw)
Vladimir Volovich <vvv@vvv.vsu.ru> writes:
> So, i wonder, is gnus supposed to guess mime charset for cyrillic to
> be koi8-r when the Cyrillic-KOI8 language environment is active, or i
> should execute the above statement
> (put-charset-property 'cyrillic-iso8859-5 'prefered-coding-system 'koi8-r)
> in my .emacs?
I thought the language-environment thingie was supposed to set the
preferred-coding-system property on the Mule charset? Is this a bug,
I wonder?
--
(domestic pets only, the antidote for overdose, milk.)
larsi@gnus.org * Lars Magne Ingebrigtsen
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: setting default MIME charset not works with emacs 20.4
1999-09-27 19:14 ` Lars Magne Ingebrigtsen
@ 1999-09-27 20:17 ` Arcady Genkin
0 siblings, 0 replies; 8+ messages in thread
From: Arcady Genkin @ 1999-09-27 20:17 UTC (permalink / raw)
Lars Magne Ingebrigtsen <larsi@gnus.org> writes:
> > So, i wonder, is gnus supposed to guess mime charset for cyrillic to
> > be koi8-r when the Cyrillic-KOI8 language environment is active, or i
> > should execute the above statement
> > (put-charset-property 'cyrillic-iso8859-5 'prefered-coding-system 'koi8-r)
> > in my .emacs?
FWIW, using Xemacs without Mule, I have to keep these in my .emacs:
(setq message-default-charset `koi8-r
gnus-default-posting-charset `koi8-r)
--
Arcady Genkin
"It seems as though I had not drunk from the cup of wisdom, but had
fallen into it." (S. Kierkegaard)
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~1999-09-27 20:17 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1999-07-30 0:16 setting default MIME charset not works with emacs 20.4 Vladimir Volovich
1999-08-01 10:24 ` Vladimir Volovich
1999-09-24 17:01 ` Lars Magne Ingebrigtsen
1999-09-25 16:03 ` Vladimir Volovich
1999-09-27 17:28 ` Lars Magne Ingebrigtsen
1999-09-27 18:52 ` Vladimir Volovich
1999-09-27 19:14 ` Lars Magne Ingebrigtsen
1999-09-27 20:17 ` Arcady Genkin
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).