From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: "Stefan Monnier" Newsgroups: gmane.emacs.devel Subject: Re: po.el: line up po-compat.el (gettext) Date: Tue, 01 Oct 2002 10:25:18 -0400 Sender: emacs-devel-admin@gnu.org Message-ID: <200210011425.g91EPIw18223@rum.cs.yale.edu> References: <200209271512.g8RFChP23029@rum.cs.yale.edu> <200210010245.LAA06580@etlken.m17n.org> NNTP-Posting-Host: localhost.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: main.gmane.org 1033482598 14349 127.0.0.1 (1 Oct 2002 14:29:58 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Tue, 1 Oct 2002 14:29:58 +0000 (UTC) Cc: Kenichi Handa , emacs-devel@gnu.org Return-path: Original-Received: from quimby.gnus.org ([80.91.224.244]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 17wO28-0003j4-00 for ; Tue, 01 Oct 2002 16:29:56 +0200 Original-Received: from monty-python.gnu.org ([199.232.76.173]) by quimby.gnus.org with esmtp (Exim 3.12 #1 (Debian)) id 17wOmK-0001MW-00 for ; Tue, 01 Oct 2002 17:17:40 +0200 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.10) id 17wO2M-0006xk-00; Tue, 01 Oct 2002 10:30:10 -0400 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.10) id 17wNxq-0005oP-00 for emacs-devel@gnu.org; Tue, 01 Oct 2002 10:25:30 -0400 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.10) id 17wNxk-0005ma-00 for emacs-devel@gnu.org; Tue, 01 Oct 2002 10:25:27 -0400 Original-Received: from rum.cs.yale.edu ([128.36.229.169]) by monty-python.gnu.org with esmtp (Exim 4.10) id 17wNxj-0005mB-00 for emacs-devel@gnu.org; Tue, 01 Oct 2002 10:25:23 -0400 Original-Received: (from monnier@localhost) by rum.cs.yale.edu (8.11.6/8.11.6) id g91EPIw18223; Tue, 1 Oct 2002 10:25:18 -0400 X-Mailer: exmh version 2.4 06/23/2000 with nmh-1.0.4 Original-To: Karl Eichwalder Errors-To: emacs-devel-admin@gnu.org X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.0.11 Precedence: bulk List-Help: List-Post: List-Subscribe: , List-Id: Emacs development discussions. List-Unsubscribe: , List-Archive: Xref: main.gmane.org gmane.emacs.devel:8294 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:8294 > > I'm not sure. See these lines: > > ("ISO-8859-1" . iso-8859-1) > > ("ISO_8859-1" . iso-8859-1) > > > > We can't get rid of the second line. > > Thanks for spotting these lines. It turns out that my complaint is somewhat moot: the code I asked for is there already (thus koi8-u already works, even tho it's not explicitly listed in po-content-type-charset-alist). But in light of the above I suggest we also try (coding-system-p (intern-soft (subst-char-in-string ?_ ?- charset-lower))) > > Doesn't this imply that there's a merit to keep those lines > > the same as what po-copmat.el has? > > Yes, but I will always make sure the synch happens in both directions > (po.el (emacs) <-> po-compat.el (gettext)). Obviously this sync issue is very relelvant and it's for you to decide what's the best option from a maintainability POV. I suggest the patch below, but it trims down the explicit list whereas the current list keeps redundant entries (entries that would already be found by the (intern-soft charset-lower) in the code). Stefan --- po.el.~1.5.~ Sun Mar 17 15:45:37 2002 +++ po.el Fri Sep 27 12:11:37 2002 @@ -33,78 +33,15 @@ ;;; Code: (defconst po-content-type-charset-alist - '(; Note: Emacs 21 doesn't support all encodings, thus the missing entries. + '(; Note: Most encodings are automatically recognized. ("ASCII" . undecided) ("ANSI_X3.4-1968" . undecided) ("US-ASCII" . undecided) - ("ISO-8859-1" . iso-8859-1) - ("ISO_8859-1" . iso-8859-1) - ("ISO-8859-2" . iso-8859-2) - ("ISO_8859-2" . iso-8859-2) - ("ISO-8859-3" . iso-8859-3) - ("ISO_8859-3" . iso-8859-3) - ("ISO-8859-4" . iso-8859-4) - ("ISO_8859-4" . iso-8859-4) - ("ISO-8859-5" . iso-8859-5) - ("ISO_8859-5" . iso-8859-5) - ;("ISO-8859-6" . ??) - ;("ISO_8859-6" . ??) - ("ISO-8859-7" . iso-8859-7) - ("ISO_8859-7" . iso-8859-7) - ("ISO-8859-8" . iso-8859-8) - ("ISO_8859-8" . iso-8859-8) - ("ISO-8859-9" . iso-8859-9) - ("ISO_8859-9" . iso-8859-9) - ;("ISO-8859-13" . ??) - ;("ISO_8859-13" . ??) - ("ISO-8859-15" . iso-8859-15) ; requires Emacs 21 - ("ISO_8859-15" . iso-8859-15) ; requires Emacs 21 - ("KOI8-R" . koi8-r) - ;("KOI8-U" . ??) - ("CP437" . cp437) ; requires Emacs 20 - ("CP775" . cp775) ; requires Emacs 20 - ("CP850" . cp850) ; requires Emacs 20 - ("CP852" . cp852) ; requires Emacs 20 - ("CP855" . cp855) ; requires Emacs 20 - ;("CP856" . ??) - ("CP857" . cp857) ; requires Emacs 20 - ("CP861" . cp861) ; requires Emacs 20 - ("CP862" . cp862) ; requires Emacs 20 - ("CP864" . cp864) ; requires Emacs 20 - ("CP865" . cp865) ; requires Emacs 20 - ("CP866" . cp866) ; requires Emacs 21 - ("CP869" . cp869) ; requires Emacs 20 - ;("CP874" . ??) - ;("CP922" . ??) - ;("CP932" . ??) - ;("CP943" . ??) - ;("CP949" . ??) - ;("CP950" . ??) - ;("CP1046" . ??) - ;("CP1124" . ??) - ;("CP1129" . ??) - ("CP1250" . cp1250) ; requires Emacs 20 - ("CP1251" . cp1251) ; requires Emacs 20 ("CP1252" . iso-8859-1) ; approximation - ("CP1253" . cp1253) ; requires Emacs 20 ("CP1254" . iso-8859-9) ; approximation ("CP1255" . iso-8859-8) ; approximation - ;("CP1256" . ??) - ("CP1257" . cp1257) ; requires Emacs 20 ("GB2312" . cn-gb-2312) ; also named 'gb2312' in XEmacs 21 or Emacs 21 ; also named 'euc-cn' in Emacs 20 or Emacs 21 - ("EUC-JP" . euc-jp) - ("EUC-KR" . euc-kr) - ;("EUC-TW" . ??) - ("BIG5" . big5) - ;("BIG5-HKSCS" . ??) - ;("GBK" . ??) - ;("GB18030" . ??) - ("SHIFT_JIS" . shift_jis) - ;("JOHAB" . ??) - ("TIS-620" . tis-620) ; requires Emacs 20 or Emacs 21 - ("VISCII" . viscii) ; requires Emacs 20 or Emacs 21 - ("UTF-8" . utf-8) ; requires Mule-UCS in Emacs 20, or Emacs 21 ) "How to convert a GNU libc/libiconv canonical charset name as seen in Content-Type into a Mule coding system.") @@ -156,13 +93,17 @@ (list (cond ((and try (coding-system-p try)) try) ((and try - (string-match "\\`cp[1-9][0-9][0-9]?\\'" + (string-match "\\`cp[1-9][0-9]*\\'" (symbol-name try)) (assoc (substring (symbol-name try) 2) (cp-supported-codepages))) (codepage-setup (substring (symbol-name try) 2)) try) - ((and (string-match "\\`cp[1-9][0-9][0-9]?\\'" + ((progn (setq try (intern-soft (subst-char-in-string + ?_ ?- charset-lower))) + (coding-system-p try)) + try) + ((and (string-match "\\`cp[1-9][0-9]*\\'" charset-lower) (assoc (substring charset-lower 2) (cp-supported-codepages)))