From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Volkan YAZICI Newsgroups: gmane.emacs.devel Subject: Re: [yazicivo@ttnet.net.tr: Locale Dependent Downcasing in smtpmail] Date: Tue, 03 Apr 2007 02:20:48 +0300 Message-ID: <87odm6xt0v.fsf@ttnet.net.tr> References: <87ejn2jsnu.fsf@stupidchicken.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1175584546 21107 80.91.229.12 (3 Apr 2007 07:15:46 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 3 Apr 2007 07:15:46 +0000 (UTC) Cc: emacs-devel@gnu.org, rms@gnu.org, Kenichi Handa To: Chong Yidong Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Apr 03 09:15:40 2007 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1HYdEw-0006zs-5Z for ged-emacs-devel@m.gmane.org; Tue, 03 Apr 2007 09:15:39 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HYdI2-0004dH-CS for ged-emacs-devel@m.gmane.org; Tue, 03 Apr 2007 03:18:50 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1HYVsF-0004fv-Am for emacs-devel@gnu.org; Mon, 02 Apr 2007 19:23:43 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1HYVsB-0004fI-W6 for emacs-devel@gnu.org; Mon, 02 Apr 2007 19:23:42 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HYVsB-0004fF-Rz for emacs-devel@gnu.org; Mon, 02 Apr 2007 19:23:39 -0400 Original-Received: from mail.ttnet.net.tr ([212.175.13.129] helo=fep04.ttnet.net.tr) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1HYVp4-0006Q6-RV; Mon, 02 Apr 2007 19:20:27 -0400 Original-Received: from (unknown [192.168.8.104]) by AVGW-I-5.ttnet.net.tr with smtp id 628e_ba17d074_e170_11db_a9b1_001422143cb8; Tue, 03 Apr 2007 02:20:21 +0300 Original-Received: from alamut ([85.96.24.164]) by fep04.ttnet.net.tr with ESMTP id <20070402232016.DNSZ4103.fep04.ttnet.net.tr@alamut>; Tue, 3 Apr 2007 02:20:16 +0300 Original-Received: from (unknown [85.96.24.164]) by AVGW-I-1.ttnet.net.tr with smtp id 424c_b3fe562c_e170_11db_b5df_001422175f0e; Tue, 03 Apr 2007 02:20:15 +0300 In-Reply-To: <87ejn2jsnu.fsf@stupidchicken.com> (Chong Yidong's message of "Mon\, 02 Apr 2007 18\:52\:21 -0400") User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.96 (gnu/linux) X-NAI-Spam-Rules: 1 Rules triggered BAYES_01=-1.2 X-detected-kernel: Linux 2.6, seldom 2.4 (older, 4) X-Mailman-Approved-At: Tue, 03 Apr 2007 03:18:05 -0400 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:68964 Archived-At: Chong Yidong writes: > Kenichi Handa writes: >> Does the attached change fix the problem? >> >> ! (let ((name (mapcar (lambda (s) >> ! (setq s (downcase s)) >> ! ;; If `I' is downcased to dotless-i, >> ! ;; convert it to `i'. >> ! (if (/= (downcase ?I) ?i) >> ! (subst-char-in-string >> ! (downcase ?I) ?i s t)) >> ! (intern s)) > > I wonder if there's a better way to do this. Indeed, here's my reply to Kenichi Handa (in case it didn't reach to you): Such a fix is quite unfeasible. What do you think to do for other problematic characters as well? Introduce a new if-else clause for every one? I am not faimilar with introducing a new macro policy of emacs team but it'd probably be useful (handy?) to have something similar to this macro: (with-locale-ctype 'ascii ;; Any call to DOWNCASE/UPCASE within this (dynamic?) scope will ;; use the case conversion table specified in the first argument ;; of the WITH-CASE-TABLE macro. ...) > Maybe we can define an ascii case table that doesn't get overwritten > by the locale; then code like the above can bind to this case table > temporarily (or we can define a downcase-ascii function that does > such a thing). I really wonder if is there really no possible way to switch between case conversion tables of different locales properly. At least, can't we totally switch to ASCII locale temporarily? > But maybe, for Emacs 22, the above hack is all we need. Is it true > that in practice, all we have to worry about is "i"? Yes. But I can only answer for Turkish characters. Somebody needs to look through whole locales. ;-) (BTW, did I mention that I suspect similar cases in other places as well, like gnus?) Regards.