From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/24568 Path: main.gmane.org!not-for-mail From: Vladimir Volovich Newsgroups: gmane.emacs.gnus.general Subject: Re: setting default MIME charset not works with emacs 20.4 Date: 01 Aug 1999 14:24:54 +0400 Sender: owner-ding@hpc.uh.edu Message-ID: References: NNTP-Posting-Host: coloc-standby.netfonds.no Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: main.gmane.org 1035162112 9411 80.91.224.250 (21 Oct 2002 01:01:52 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Mon, 21 Oct 2002 01:01:52 +0000 (UTC) Return-Path: Original-Received: from farabi.math.uh.edu (farabi.math.uh.edu [129.7.128.57]) by sclp3.sclp.com (8.8.5/8.8.5) with ESMTP id GAA03945 for ; Sun, 1 Aug 1999 06:32:58 -0400 (EDT) Original-Received: from sina.hpc.uh.edu (lists@Sina.HPC.UH.EDU [129.7.3.5]) by farabi.math.uh.edu (8.9.3/8.9.3) with ESMTP id FAB00336; Sun, 1 Aug 1999 05:32:37 -0500 (CDT) Original-Received: by sina.hpc.uh.edu (TLB v0.09a (1.20 tibbs 1996/10/09 22:03:07)); Sun, 01 Aug 1999 05:33:06 -0500 (CDT) Original-Received: from sclp3.sclp.com (root@sclp3.sclp.com [204.252.123.139]) by sina.hpc.uh.edu (8.9.3/8.9.3) with ESMTP id FAA10724 for ; Sun, 1 Aug 1999 05:32:52 -0500 (CDT) Original-Received: from relay2.vsu.ru (postfix@ftp.vsu.ru [62.76.169.7]) by sclp3.sclp.com (8.8.5/8.8.5) with ESMTP id GAA03940 for ; Sun, 1 Aug 1999 06:30:21 -0400 (EDT) Original-Received: by relay2.vsu.ru (Postfix, from userid 5) id 451F418DD; Sun, 1 Aug 1999 14:29:57 +0400 (MSD) Original-Received: (from vvv@localhost) by vvv.vsu.ru (8.9.3/8.9.3) id OAA01141; Sun, 1 Aug 1999 14:24:56 +0400 Original-To: ding@gnus.org In-Reply-To: Vladimir Volovich's message of "30 Jul 1999 04:16:11 +0400" Original-Lines: 66 User-Agent: Gnus/5.070095 (Pterodactyl Gnus v0.95) Emacs/20.4 Precedence: list X-Majordomo: 1.94.jlt7 Xref: main.gmane.org gmane.emacs.gnus.general:24568 X-Report-Spam: http://spam.gmane.org/gmane.emacs.gnus.general:24568 --=-=-= Content-Type: text/plain; charset=koi8-r Content-Transfer-Encoding: 8bit "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//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//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) --=-=-= Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable (find-coding-systems-for-charsets (find-charset-string "test =EA=E3=F5=EB=E5")) (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) --=-=-= Content-Type: text/plain; charset=koi8-r Content-Transfer-Encoding: 8bit (find-coding-systems-for-charsets (find-charset-string "test ΤΕΣΤ --=-=-= Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable =EA=E3=F5=EB=E5")) (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. --=-=-=--