all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Chong Yidong <cyd@stupidchicken.com>
To: Eli Zaretskii <eliz@gnu.org>
Cc: simon@josefsson.org, Volkan YAZICI <yazicivo@ttnet.net.tr>,
	handa@m17n.org, emacs-devel@gnu.org
Subject: Re: [yazicivo@ttnet.net.tr: Locale Dependent Downcasing in smtpmail]
Date: Tue, 03 Apr 2007 12:30:37 -0400	[thread overview]
Message-ID: <87ircdh13m.fsf@stupidchicken.com> (raw)
In-Reply-To: <ups6l4gt5.fsf@gnu.org> (Eli Zaretskii's message of "Tue\, 03 Apr 2007 18\:29\:42 +0300")

Eli Zaretskii <eliz@gnu.org> writes:

>> nndoc.el:511:   (intern (downcase (mail-header-strip encoding))))))
>> nndoc.el:905:   subtype (downcase (match-string 2 content-type))
>> rfc2047.el:674: (concat "=?" (downcase (symbol-name mime-charset))
>> 
>> Failing Cases:
>> (downcase "ISO-8859-1") ==> ıso-8859-1
>> (downcase "text/plain") ==> text-plaın
>
> Perhaps we should have something like downcase-ascii for such
> situations.

Yeah.

How about the following approach?  At the beginning of characters.el,
save the standard case table (which AFAICT hasn't been modified at
that point), as a variable ascii-case-table.  Then downcase-ascii can
use it.

*** emacs/lisp/international/characters.el.~1.65.~	2007-03-05 02:00:16.000000000 -0500
--- emacs/lisp/international/characters.el	2007-04-03 12:18:07.000000000 -0400
***************
*** 43,48 ****
--- 43,54 ----
  
  ;;; Predefined categories.
  
+ ;; Save ASCII case table.
+ 
+ (require 'case-table)
+ (defvar ascii-case-table (copy-case-table (standard-case-table))
+   "Case table for the ASCII character set.")
+ 
  ;; For each character set.
  
  (define-category ?a "ASCII graphic characters 32-126 (ISO646 IRV:1983[4/0])")
*** emacs/lisp/subr.el.~1.549.~	2007-03-19 14:37:19.000000000 -0400
--- emacs/lisp/subr.el	2007-04-03 12:26:04.000000000 -0400
***************
*** 2804,2809 ****
--- 2804,2819 ----
        ;; Reconstruct a string from the pieces.
        (setq matches (cons (substring string start l) matches)) ; leftover
        (apply #'concat (nreverse matches)))))
+ 
+ (defun downcase-ascii (string)
+   "Convert ASCII argument to lower case and return that.
+ The argument may be a character or string.  The result has the same type.
+ The argument object is not altered--the value is a copy."
+   (let ((old-case-table (current-case-table)))
+     (unwind-protect
+ 	(progn (set-case-table ascii-case-table)
+ 	       (downcase string))
+       (set-case-table old-case-table))))
  \f
  ;;;; invisibility specs
  

  parent reply	other threads:[~2007-04-03 16:30 UTC|newest]

Thread overview: 45+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-03-31 20:43 [yazicivo@ttnet.net.tr: Locale Dependent Downcasing in smtpmail] Richard Stallman
2007-04-01 17:39 ` Chong Yidong
2007-04-02  6:51 ` Kenichi Handa
2007-04-02 22:52   ` Chong Yidong
2007-04-02 23:20     ` Volkan YAZICI
2007-04-03  1:24     ` Kenichi Handa
2007-04-03 21:40     ` Richard Stallman
2007-04-02 17:31 ` Volkan YAZICI
2007-04-03  8:06   ` Kenichi Handa
2007-04-03  8:28     ` Werner LEMBERG
2007-04-03  9:24     ` Eli Zaretskii
2007-04-03  9:33       ` Simon Josefsson
2007-04-03 13:44         ` Volkan YAZICI
2007-04-03 15:29           ` Eli Zaretskii
2007-04-03 15:50             ` David Kastrup
2007-04-03 16:03               ` Andreas Schwab
     [not found]               ` <87k5wt5tnx.fsf@ttnet.net.tr>
2007-04-03 16:21                 ` David Kastrup
     [not found]                 ` <87slbhquuw.fsf@ttnet.net.tr>
2007-04-03 18:44                   ` David Kastrup
2007-04-03 16:30             ` Chong Yidong [this message]
2007-04-03 17:57               ` with-case-table / ascii-case-table (was: [yazicivo@ttnet.net.tr: Locale Dependent Downcasing in smtpmail]) Reiner Steib
2007-04-04 15:40                 ` with-case-table / ascii-case-table Chong Yidong
2007-04-04 14:02               ` [yazicivo@ttnet.net.tr: Locale Dependent Downcasing in smtpmail] Richard Stallman
2007-04-04 14:27                 ` Andreas Schwab
2007-04-05 23:11                   ` Richard Stallman
2007-04-06  6:15                     ` Kenichi Handa
2007-04-06  6:49                       ` Werner LEMBERG
2007-04-06  7:15                         ` Kenichi Handa
2007-04-06  7:30                           ` Werner LEMBERG
2007-04-06  8:56                           ` Eli Zaretskii
2007-04-06  9:24                             ` Werner LEMBERG
2007-04-06 13:54                               ` Eli Zaretskii
2007-04-07  8:01                                 ` Werner LEMBERG
2007-04-06 19:47                       ` Richard Stallman
2007-04-07  7:30                         ` martin rudalics
2007-04-07 17:31                           ` Richard Stallman
2007-04-04 18:01                 ` Eli Zaretskii
2007-04-05 23:11                   ` Richard Stallman
2007-04-06  8:31                     ` Eli Zaretskii
2007-04-06 19:47                       ` Richard Stallman
2007-04-07  9:18                         ` Eli Zaretskii
2007-04-07 15:03                           ` Chong Yidong
2007-04-07 17:36                             ` Eli Zaretskii
2007-04-07 17:31                           ` Richard Stallman
2007-04-07 17:47                             ` Eli Zaretskii
2007-04-03 21:16           ` Davis Herring

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87ircdh13m.fsf@stupidchicken.com \
    --to=cyd@stupidchicken.com \
    --cc=eliz@gnu.org \
    --cc=emacs-devel@gnu.org \
    --cc=handa@m17n.org \
    --cc=simon@josefsson.org \
    --cc=yazicivo@ttnet.net.tr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.