unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* po.el: line up po-compat.el (gettext)
@ 2002-09-27  5:37 Karl Eichwalder
  2002-09-27 15:12 ` Stefan Monnier
  0 siblings, 1 reply; 8+ messages in thread
From: Karl Eichwalder @ 2002-09-27  5:37 UTC (permalink / raw)


Please apply the following cosmetical patch to line it up with the
po-compat.el file coming with GNU gettext:

*** po.el.~1.5.~	Sun Mar 17 10:26:47 2002
--- po.el	Fri Sep 27 07:31:27 2002
***************
*** 57,66 ****
--- 57,69 ----
      ("ISO_8859-9" . iso-8859-9)
      ;("ISO-8859-13" . ??)
      ;("ISO_8859-13" . ??)
+     ;("ISO-8859-14" . ??)
+     ;("ISO_8859-14" . ??)
      ("ISO-8859-15" . iso-8859-15) ; requires Emacs 21
      ("ISO_8859-15" . iso-8859-15) ; requires Emacs 21
      ("KOI8-R" . koi8-r)
      ;("KOI8-U" . ??)
+     ;("KOI8-T" . ??)
      ("CP437" . cp437) ; requires Emacs 20
      ("CP775" . cp775) ; requires Emacs 20
      ("CP850" . cp850) ; requires Emacs 20
***************
*** 104,109 ****
--- 107,113 ----
      ;("JOHAB" . ??)
      ("TIS-620" . tis-620)    ; requires Emacs 20 or Emacs 21
      ("VISCII" . viscii)      ; requires Emacs 20 or Emacs 21
+     ;("GEORGIAN-PS" . ??)
      ("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

-- 
ke@suse.de (work) / keichwa@gmx.net (home):              |
http://www.suse.de/~ke/                                  |      ,__o
Free Translation Project:                                |    _-\_<,
http://www.iro.umontreal.ca/contrib/po/HTML/             |   (*)/'(*)

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: po.el: line up po-compat.el (gettext)
  2002-09-27  5:37 po.el: line up po-compat.el (gettext) Karl Eichwalder
@ 2002-09-27 15:12 ` Stefan Monnier
  2002-09-27 15:41   ` Karl Eichwalder
  2002-09-28  3:20   ` Richard Stallman
  0 siblings, 2 replies; 8+ messages in thread
From: Stefan Monnier @ 2002-09-27 15:12 UTC (permalink / raw)
  Cc: emacs-devel

> Please apply the following cosmetical patch to line it up with the
> po-compat.el file coming with GNU gettext:
[...]
>       ("KOI8-R" . koi8-r)
>       ;("KOI8-U" . ??)
> +     ;("KOI8-T" . ??)

And change that to say ("KOI8-U" . koi8-u).
Although I still don't understand why the code doesn't use

	(coding-system-p (intern (downcase name)))

so as to remove the need for most of those entries (and so that it
can automatically support new coding systems when they are added to
Emacs, as long as they use the same name).


	Stefan

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: po.el: line up po-compat.el (gettext)
  2002-09-27 15:12 ` Stefan Monnier
@ 2002-09-27 15:41   ` Karl Eichwalder
  2002-09-28  3:20   ` Richard Stallman
  1 sibling, 0 replies; 8+ messages in thread
From: Karl Eichwalder @ 2002-09-27 15:41 UTC (permalink / raw)
  Cc: emacs-devel

"Stefan Monnier" <monnier+gnu/emacs@rum.cs.yale.edu> writes:

> And change that to say ("KOI8-U" . koi8-u).

Okay, thanks.

> Although I still don't understand why the code doesn't use
>
> 	(coding-system-p (intern (downcase name)))
>
> so as to remove the need for most of those entries (and so that it
> can automatically support new coding systems when they are added to
> Emacs, as long as they use the same name).

I don't understand all this stuff, sorry.  Last time Eli changed
somethings (thanks!) and the current implementation works.  If you
think something different is better, don't hesitate to change it,
please.  Once done drop me a line and I'll test it.

-- 
ke@suse.de (work) / keichwa@gmx.net (home):              |
http://www.suse.de/~ke/                                  |      ,__o
Free Translation Project:                                |    _-\_<,
http://www.iro.umontreal.ca/contrib/po/HTML/             |   (*)/'(*)

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: po.el: line up po-compat.el (gettext)
  2002-09-27 15:12 ` Stefan Monnier
  2002-09-27 15:41   ` Karl Eichwalder
@ 2002-09-28  3:20   ` Richard Stallman
  2002-10-01  2:45     ` Kenichi Handa
  1 sibling, 1 reply; 8+ messages in thread
From: Richard Stallman @ 2002-09-28  3:20 UTC (permalink / raw)
  Cc: keichwa, emacs-devel

    Although I still don't understand why the code doesn't use

	    (coding-system-p (intern (downcase name)))

    so as to remove the need for most of those entries (and so that it
    can automatically support new coding systems when they are added to
    Emacs, as long as they use the same name).

It seems reasonable to me in principle.  Handa, is there any reason
why not?  If you think it is correct, would you please install it?

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: po.el: line up po-compat.el (gettext)
  2002-09-28  3:20   ` Richard Stallman
@ 2002-10-01  2:45     ` Kenichi Handa
  2002-10-01  4:42       ` Karl Eichwalder
  0 siblings, 1 reply; 8+ messages in thread
From: Kenichi Handa @ 2002-10-01  2:45 UTC (permalink / raw)
  Cc: monnier+gnu/emacs, keichwa, emacs-devel

In article <E17v89G-00033w-00@fencepost.gnu.org>, Richard Stallman <rms@gnu.org> writes:
>     Although I still don't understand why the code doesn't use
> 	    (coding-system-p (intern (downcase name)))

>     so as to remove the need for most of those entries (and so that it
>     can automatically support new coding systems when they are added to
>     Emacs, as long as they use the same name).

> It seems reasonable to me in principle.

In principle, yes.  But...

> Handa, is there any reason why not?

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.  So, we anyway have to
maintain the list `po-content-type-charset-alist'.  Then,
the merit of using (coding-system-p ...) is not that much.

And, Karl wrote:
> Please apply the following cosmetical patch to line it up with the
> po-compat.el file coming with GNU gettext:

Doesn't this imply that there's a merit to keep those lines
the same as what po-copmat.el has?

> If you think it is correct, would you please install it?

I'd like to leave this issue to the maintainer(s) of po.el.
I don't know how *.el in gettext is maintained, thus can't
judge what is the right thing.

---
Ken'ichi HANDA
handa@m17n.org

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: po.el: line up po-compat.el (gettext)
  2002-10-01  2:45     ` Kenichi Handa
@ 2002-10-01  4:42       ` Karl Eichwalder
  2002-10-01 14:25         ` Stefan Monnier
  0 siblings, 1 reply; 8+ messages in thread
From: Karl Eichwalder @ 2002-10-01  4:42 UTC (permalink / raw)
  Cc: rms, monnier+gnu/emacs, emacs-devel

Kenichi Handa <handa@m17n.org> writes:

> 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.

> And, Karl wrote:
>> Please apply the following cosmetical patch to line it up with the
>> po-compat.el file coming with GNU gettext:
>
> 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)).

> I'd like to leave this issue to the maintainer(s) of po.el.
> I don't know how *.el in gettext is maintained, thus can't
> judge what is the right thing.

It's basically me (and Bruno Haible) who apply change to the *.el files
in gettext.

-- 
ke@suse.de (work) / keichwa@gmx.net (home):              |
http://www.suse.de/~ke/                                  |      ,__o
Free Translation Project:                                |    _-\_<,
http://www.iro.umontreal.ca/contrib/po/HTML/             |   (*)/'(*)

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: po.el: line up po-compat.el (gettext)
  2002-10-01  4:42       ` Karl Eichwalder
@ 2002-10-01 14:25         ` Stefan Monnier
  2002-11-02 16:43           ` Karl Eichwalder
  0 siblings, 1 reply; 8+ messages in thread
From: Stefan Monnier @ 2002-10-01 14:25 UTC (permalink / raw)
  Cc: Kenichi Handa, emacs-devel

> > 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)))

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: po.el: line up po-compat.el (gettext)
  2002-10-01 14:25         ` Stefan Monnier
@ 2002-11-02 16:43           ` Karl Eichwalder
  0 siblings, 0 replies; 8+ messages in thread
From: Karl Eichwalder @ 2002-11-02 16:43 UTC (permalink / raw)
  Cc: Kenichi Handa, emacs-devel, Dave Love

"Stefan Monnier" <monnier+gnu/emacs@rum.cs.yale.edu> writes:

> But in light of the above I suggest we also try
>
>   (coding-system-p (intern-soft (subst-char-in-string ?_ ?- charset-lower)))

[...]

> 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).

Thanks for your work!  I just saw that Dave checked in something along
your lines.

I guess in the long run the coding detection code can go into mule.el
as one of the auto-coding-functions.

-- 
ke@suse.de (work) / keichwa@gmx.net (home):              |
http://www.gnu.franken.de/ke/                            |      ,__o
Free Translation Project:                                |    _-\_<,
http://www.iro.umontreal.ca/contrib/po/HTML/             |   (*)/'(*)

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2002-11-02 16:43 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-09-27  5:37 po.el: line up po-compat.el (gettext) Karl Eichwalder
2002-09-27 15:12 ` Stefan Monnier
2002-09-27 15:41   ` Karl Eichwalder
2002-09-28  3:20   ` Richard Stallman
2002-10-01  2:45     ` Kenichi Handa
2002-10-01  4:42       ` Karl Eichwalder
2002-10-01 14:25         ` Stefan Monnier
2002-11-02 16:43           ` Karl Eichwalder

Code repositories for project(s) associated with this public inbox

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

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 read-only IMAP folder(s) and NNTP newsgroup(s).