unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* PO files and Emacs
@ 2002-03-09 14:11 Karl Eichwalder
  2002-03-10  5:03 ` Richard Stallman
  2002-03-12 13:30 ` Bruno Haible
  0 siblings, 2 replies; 36+ messages in thread
From: Karl Eichwalder @ 2002-03-09 14:11 UTC (permalink / raw)
  Cc: sanvila, neil, haible, handa

[-- Attachment #1: Type: text/plain, Size: 920 bytes --]

As Eli proposed I'm forwarding this mail thread to thedevel list.
Short summary: po-mode.el coming with GNU gettext helps to edit so
called PO files.  Thanslators provide the 'msgstr ""' fields;
'msgid ""' fields containing the original program messages:

#: plugins/dif/dif.c:77 plugins/excel/ms-excel-read.c:4076
msgid "Reading file..."
msgstr "Leyendo archivo..."

The tough part is the very first message of every file holding meta
info:

msgid ""
msgstr ""
"Project-Id-Version: gnumeric 0.69\n"
"POT-Creation-Date: 2001-07-17 22:49-0400\n"
"PO-Revision-Date: 2001-08-12 16:34GMT\n"
"Last-Translator: Germán Poo Caamaño <gpoo@ubiobio.cl>\n"
"Language-Team: es <es@li.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=iso-8859-1\n"
"Content-Transfer-Encoding: 8bit\n"

Emacs has to learn to look for the charset info and choose the correct
coding.

Here are the old mails:


[-- Attachment #2: Type: message/rfc822, Size: 12516 bytes --]

[-- Attachment #2.1.1: Type: text/plain, Size: 257 bytes --]

As said in the last mail, here is the old mail thread condensed.  We
should start to add the contents of po.el to Emacs.

Personally, I wouldn't mind to add the whole po-mode.el to Emacs; but
if Bruno doesn't agree we can continue to ship it with gettext.


[-- Attachment #2.1.2.1: Type: text/plain, Size: 152 bytes --]

Subject: Topics
MIME-Version: 1.0

Topics:
   Re: PO files and Emacs (coding:)
   Re: PO files and Emacs (coding:)
   Re: PO files and Emacs (coding:)


[-- Attachment #2.1.2.2: Type: text/plain, Size: 5842 bytes --]

Date: Thu, 24 May 2001 01:04:34 +0200 (CEST)
From: Bruno Haible <haible@ilog.fr>
To: emacs-pretest-bug@gnu.org, Karl Eichwalder <keichwa@gmx.net>,
	Eli Zaretskii <eliz@is.elta.co.il>, translation@IRO.UMontreal.CA,
	Bruno Haible <haible@ilog.fr>,
	Pablo Saratxaga <pablo@mandrakesoft.com>,
	Primoz Peterlin <primoz.peterlin@biofiz.mf.uni-lj.si>,
	=?iso-8859-1?q?Fran=E7ois?= Pinard <pinard@IRO.UMontreal.CA>
Subject: Re: PO files and Emacs (coding:)
Message-ID: <15116.16898.335177.134247@honolulu.ilog.fr>
References: <Pine.SUN.3.91.1001010084249.6606M-100000@is>
	<sh8zjok6c6.fsf@tux.gnu.franken.de>
	<15115.49289.625922.181172@honolulu.ilog.fr>
	<sheltf7rif.fsf_-_@tux.gnu.franken.de>
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="=======-=-="

--=======-=-=
Content-Description: message body text

Dear Emacs maintainers,

To make Karl Eichwalder's proposition more concrete.

PO file support consists of two parts:

  1) Make sure that Emacs displays the file in the right encoding.
     All PO files contains multilingual text; the right choice of
     coding-system is essential for them.

  2) A special editing mode for use by translators (po-mode.el by
     Francois Pinard et al.)

I would like to push part 1) into Emacs. Part 2) is probably best
maintained as part of gettext.

There are probably fewer users who need 2) than 1) - it is perfectly
well possible (though tedious) to edit PO files in text-mode.


The support consists of three parts.
1) A new file, attached to this mail.

2001-05-23  Bruno Haible  <haible@clisp.cons.org>

	* lisp/textmodes/po.el: New file, extracted from GNU gettext's
	po-mode.el.

2) Make sure that loaddefs.el scans that new file for autoloads.

I don't know how to do this.

3) Put the following form into startup.el or any other files that is
included by startup.el in all cases:

(modify-coding-system-alist 'file "\\.po[tx]?\\'\\|\\.po\\."
                            'po-find-file-coding-system)

Thanks.



--=======-=-=
Content-Type: text/x-elisp; charset=utf-8
Content-Disposition: inline; filename=po.el
Content-Transfer-Encoding: quoted-printable
Content-Description: po.el

;;; po.el --- basic support of PO translation files -*- coding: utf-8; -*-

;; Copyright (C) 1995-1998, 2000, 2001 Free Software Foundation, Inc.

;; Authors: Fran=C3=A7ois Pinard <pinard@iro.umontreal.ca>,
;;          Greg McGary <gkm@magilla.cichlid.com>,
;;          Bruno Haible <haible@clisp.cons.org>.

;; This file is part of GNU Emacs.

;; GNU Emacs is free software; you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation; either version 2, or (at your option)
;; any later version.

;; GNU Emacs is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
;; GNU General Public License for more details.

;; You should have received a copy of the GNU General Public License
;; along with GNU Emacs; see the file COPYING.  If not, write to the
;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
;; Boston, MA 02111-1307, USA.


(defconst po-content-type-charset-alist
  '(; Note: Emacs 21 doesn't support all encodings, thus the missing entrie=
s.
    (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 . ??)
    (KOI8-R . koi8-r)
    ;(KOI8-U . ??)
    ;(CP850 . ??)
    ;(CP866 . ??)
    ;(CP874 . ??)
    ;(CP932 . ??)
    ;(CP949 . ??)
    ;(CP950 . ??)
    ;(CP1250 . ??)
    ;(CP1251 . ??)
    ;(CP1252 . ??)
    ;(CP1253 . ??)
    ;(CP1254 . ??)
    ;(CP1255 . ??)
    ;(CP1256 . ??)
    ;(CP1257 . ??)
    ;(GB2312 . euc-cn)
    ;(EUC-JP . euc-jp)
    ;(EUC-KR . euc-kr)
    ;(EUC-TW . ??)
    ;(BIG5 . big5)
    ;(BIG5HKSCS . ??)
    ;(GBK . ??)
    ;(GB18030 . ??)
    ;(SJIS . shift_jis)
    ;(JOHAB . ??)
    ;(TIS-620 . th-tis620)
    ;(VISCII . viscii)
    (UTF-8 . utf-8)
    )
  "How to convert a GNU libc/libiconv canonical charset name as seen in
Content-Type into a Mule coding system.")

;;;###autoload
(defun po-find-file-coding-system (arg-list)
  "Return a Mule (DECODING . ENCODING) pair, according to PO file charset.
Called through file-coding-system-alist, before the file is visited for rea=
l."
  (and (eq (car arg-list) 'insert-file-contents)
       (with-temp-buffer
         (let ((coding-system-for-read 'no-conversion))
           (insert-file-contents (nth 1 arg-list) nil 0 4096)
           (if (re-search-forward
                 "^\"Content-Type: text/plain;[ \t]*charset=3D\\([^\\]+\\)"
                 nil t)
             (let* ((charset (buffer-substring
                               (match-beginning 1) (match-end 1)))
                    (charset-upper (intern (upcase charset)))
                    (charset-lower (intern (downcase charset))))
               (list (or (cdr (assq charset-upper
                                    po-content-type-charset-alist))
                         (if (memq charset-lower (coding-system-list))
                           charset-lower
                           'no-conversion))))
             '(no-conversion))))))


--=======-=-=--

[-- Attachment #2.1.2.3: Type: text/plain, Size: 4527 bytes --]

Date: Thu, 24 May 2001 20:38:38 +0300
From: "Eli Zaretskii" <eliz@is.elta.co.il>
To: haible@ilog.fr, handa@etl.go.jp
Cc: emacs-pretest-bug@gnu.org, keichwa@gmx.net,
	translation@IRO.UMontreal.CA, haible@ilog.fr, pablo@mandrakesoft.com,
	primoz.peterlin@biofiz.mf.uni-lj.si, pinard@IRO.UMontreal.CA
Subject: Re: PO files and Emacs (coding:)
Message-Id: <2950-Thu24May2001203837+0300-eliz@is.elta.co.il>
References: <Pine.SUN.3.91.1001010084249.6606M-100000@is>
	<sh8zjok6c6.fsf@tux.gnu.franken.de>
	<15115.49289.625922.181172@honolulu.ilog.fr>
	<sheltf7rif.fsf_-_@tux.gnu.franken.de> <15116.16898.335177.134247@honolulu.ilog.fr>
MIME-Version: 1.0

> From: Bruno Haible <haible@ilog.fr>
> Date: Thu, 24 May 2001 01:04:34 +0200 (CEST)
> 
> PO file support consists of two parts:
> 
>   1) Make sure that Emacs displays the file in the right encoding.
>      All PO files contains multilingual text; the right choice of
>      coding-system is essential for them.
> 
>   2) A special editing mode for use by translators (po-mode.el by
>      Francois Pinard et al.)
> 
> I would like to push part 1) into Emacs. Part 2) is probably best
> maintained as part of gettext.

Personally, I think po-mode.el should be part of Emacs.  If Karl (or
someone else) wants to remain its maintainer, it can be easily
arranged, so the danger of losing control over its development does
not need to bother you.

But of course, this is something the current po-mode maintainer(s)
should decide.

> The support consists of three parts.
> 1) A new file, attached to this mail.

Thanks.  Some comments below.

> 2) Make sure that loaddefs.el scans that new file for autoloads.
> 
> I don't know how to do this.

This is done automatically when the distribution is tarred.  There's a
special target in lisp/Makefile ("make autoloads") which updates
loaddefs.el.

> 3) Put the following form into startup.el or any other files that is
> included by startup.el in all cases:
> 
> (modify-coding-system-alist 'file "\\.po[tx]?\\'\\|\\.po\\."
>                             'po-find-file-coding-system)

Shouldn't this go into lisp/international/mule-conf.el, where the
default value of file-coding-system-alist is set up?

Also, at least the *.pot files are pure ASCII, no?

> ;;; po.el --- basic support of PO translation files -*- coding: utf-8; -*-

This is not a good idea: Emacs does not yet support Unicode well
enough to distribute files encoded in UTF.  It seems like the only
non-ASCII characters in this file are Latin-1 characters in a name of
the author, so latin-1 encoding should be good enough.  If you would
like a more general encoding, please use iso-2022-7bit.

> (defconst po-content-type-charset-alist
>   '(; Note: Emacs 21 doesn't support all encodings, thus the missing en=
> tries.
>     (ASCII . undecided)
>     (ANSI_X3.4-1968 . undecided)
>     (US-ASCII . undecided)
>     (ISO-8859-1 . iso-8859-1)
>     (ISO_8859-1 . iso-8859-1)

I don't understand why do you need the upper-case variety: it should
be enough to downcase the original name, as the code already does.

>     ;(ISO-8859-6 . ??)

Emacs doesn't yet support Arabic :-(.

>     ;(ISO-8859-13 . ??)

Not supported yet.

>     ;(ISO-8859-15 . ??)

This is supported: use iso-8859-15.

>     ;(CP850 . ??)

Are there really *.po files encoded in cpNNN?  I don't think I saw
these in the list of charsets taht the robot says it supports.

Anyway, most of these are supported, and Emacs calls them cpNNN, so
just use them.  One caveat: cpNNN systems need to be created before
they can be used.  To create a cpNNN coding system, evaluate this
expression:

	(codepage-setup NNN)

where NNN is the number of the codepage; it can be given either as a
string "NNN" or as a number.

>     ;(GB2312 . euc-cn)
>     ;(EUC-JP . euc-jp)
>     ;(EUC-KR . euc-kr)
>     ;(BIG5 . big5)
>     ;(SJIS . shift_jis)
>     ;(VISCII . viscii)

Why did you comment these out?

>     ;(EUC-TW . ??)

Unsupported, I think.

>     ;(BIG5HKSCS . ??)
>     ;(GBK . ??)
>     ;(GB18030 . ??)
>     ;(JOHAB . ??)

Don't know anything about these.

>     ;(TIS-620 . th-tis620)

Use tis-620.

>                          (if (memq charset-lower (coding-system-list))
>                            charset-lower
>                            'no-conversion))))

I think it is much more efficient to use coding-system-p instead of
looking in the result of (coding-system-list).  Handa-san, could you
please comment on that (and also on the charsets shown above)?

Thanks again for your contribution.



[-- Attachment #2.1.2.4: Type: text/plain, Size: 919 bytes --]

Date: Sun, 3 Jun 2001 09:38:02 +0300 (IDT)
From: Eli Zaretskii <eliz@is.elta.co.il>
To: haible@ilog.fr, handa@etl.go.jp, emacs-pretest-bug@gnu.org,
	keichwa@gmx.net, translation@IRO.UMontreal.CA,
	pablo@mandrakesoft.com, primoz.peterlin@biofiz.mf.uni-lj.si,
	pinard@IRO.UMontreal.CA
Cc: Richard Stallman <rms@gnu.org>, Gerd Moellmann <gerd@gnu.org>
Subject: Re: PO files and Emacs (coding:)
Message-ID: <Pine.SUN.3.91.1010603093715.553B-100000@is>
MIME-Version: 1.0


On Thu, 24 May 2001, I wrote:

> > The support consists of three parts.
> > 1) A new file, attached to this mail.
> 
> Thanks.  Some comments below.

Bruno, do you plan changing the file you sent based on those comments?

Or is the conclusion of this discussion that po-mode.el should be made
part of Emacs (perhaps with a `msgfmt' script)?

I'd like to get some practical results out of this thread, before
Emacs 21.1 hits the street, if possible.



[-- Attachment #2.1.3: Type: text/plain, Size: 272 bytes --]


-- 
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/             |   (*)/'(*)

[-- Attachment #3: Type: text/plain, Size: 273 bytes --]



-- 
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] 36+ messages in thread

* Re: PO files and Emacs
  2002-03-09 14:11 PO files and Emacs Karl Eichwalder
@ 2002-03-10  5:03 ` Richard Stallman
  2002-03-10  5:29   ` Karl Eichwalder
  2002-03-10 11:10   ` Neil Darlow
  2002-03-12 13:30 ` Bruno Haible
  1 sibling, 2 replies; 36+ messages in thread
From: Richard Stallman @ 2002-03-10  5:03 UTC (permalink / raw)
  Cc: emacs-devel, emacs-devel, sanvila, neil, haible, handa

I don't understand this part of your message:

    The tough part is the very first message of every file holding meta
    info:

Are you saying that this is a problem which po.el does not handle and
that we need to fix?  The other messages don't seem to describe an
outstanding problem.  They seem to describe a file that already works
fine.


_______________________________________________
Emacs-devel mailing list
Emacs-devel@gnu.org
http://mail.gnu.org/mailman/listinfo/emacs-devel


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

* Re: PO files and Emacs
  2002-03-10  5:03 ` Richard Stallman
@ 2002-03-10  5:29   ` Karl Eichwalder
  2002-03-11  9:00     ` Richard Stallman
  2002-03-10 11:10   ` Neil Darlow
  1 sibling, 1 reply; 36+ messages in thread
From: Karl Eichwalder @ 2002-03-10  5:29 UTC (permalink / raw)
  Cc: emacs-devel, sanvila, neil, haible, handa

Richard Stallman <rms@gnu.org> writes:

> Are you saying that this is a problem which po.el does not handle and
> that we need to fix?

It was my intention to describe the PO file format informally.

> The other messages don't seem to describe an outstanding problem.
> They seem to describe a file that already works fine.

Yes.  The feature request is to add po.el to Emacs---is this possible?
The code is already disclaimed, since it's basically distributed with
GNU gettext and the algorithms ware invented by François and Bruno.

Then some updates (check list of available encodings) or minor fixes are
necessary (change encoding from UTF-8 to something else; UTF-8 is only
used for po.el because of 1 "ç" inside of a comment string).

When po.el is installed I'll help to 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/             |   (*)/'(*)

_______________________________________________
Emacs-devel mailing list
Emacs-devel@gnu.org
http://mail.gnu.org/mailman/listinfo/emacs-devel


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

* Re: PO files and Emacs
  2002-03-10  5:03 ` Richard Stallman
  2002-03-10  5:29   ` Karl Eichwalder
@ 2002-03-10 11:10   ` Neil Darlow
  2002-03-11  5:46     ` Eli Zaretskii
  1 sibling, 1 reply; 36+ messages in thread
From: Neil Darlow @ 2002-03-10 11:10 UTC (permalink / raw)
  Cc: keichwa, emacs-devel, sanvila, haible, handa

Hi Richard,

On 3/10/02, 5:03:45 AM, Richard Stallman wrote:

> Are you saying that this is a problem which po.el does not handle and
> that we need to fix?  The other messages don't seem to describe an
> outstanding problem.  They seem to describe a file that already works
> fine.

This whole discussion came about as a result of a bug report I filed
against the Debian packaging of emacs-21.1.

The situation is that po.el generates an argument type error when emacs
is started on a non-existant .po[tx] file.

If you create the file using touch, beforehand, po.el responds with a
basic PO template, as you might expect.

I believe that the behaviour of po.el requires fixing for the case of a
non-existent .po[tx] file.

Regards,
Neil Darlow M.Sc.

_______________________________________________
Emacs-devel mailing list
Emacs-devel@gnu.org
http://mail.gnu.org/mailman/listinfo/emacs-devel


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

* Re: PO files and Emacs
  2002-03-10 11:10   ` Neil Darlow
@ 2002-03-11  5:46     ` Eli Zaretskii
  2002-03-11  6:45       ` Karl Eichwalder
  0 siblings, 1 reply; 36+ messages in thread
From: Eli Zaretskii @ 2002-03-11  5:46 UTC (permalink / raw)
  Cc: rms, keichwa, emacs-devel, sanvila, haible, handa


On Sun, 10 Mar 2002, Neil Darlow wrote:

> This whole discussion came about as a result of a bug report I filed
> against the Debian packaging of emacs-21.1.
> 
> The situation is that po.el generates an argument type error when emacs
> is started on a non-existant .po[tx] file.

In response to that (or so I thought), Karl said something about Emacs 
assuming that ``'filename is 1 the first time''.  That sounded like some 
problem outside po-mode.el, so I asked for a simple Lisp example that 
could be used to reproduce this without po-mode.  Did I misunderstand?  
If not, could someone please try to show such a Lisp fragment?

_______________________________________________
Emacs-devel mailing list
Emacs-devel@gnu.org
http://mail.gnu.org/mailman/listinfo/emacs-devel


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

* Re: PO files and Emacs
  2002-03-11  5:46     ` Eli Zaretskii
@ 2002-03-11  6:45       ` Karl Eichwalder
  2002-03-11  6:53         ` Eli Zaretskii
  0 siblings, 1 reply; 36+ messages in thread
From: Karl Eichwalder @ 2002-03-11  6:45 UTC (permalink / raw)
  Cc: Neil Darlow, rms, emacs-devel, sanvila, haible, handa

Eli Zaretskii <eliz@is.elta.co.il> writes:

> If not, could someone please try to show such a Lisp fragment?

Neil said it's possible to reproduce the problem using po.el; is this
small enough for debugging?

-- 
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/             |   (*)/'(*)

_______________________________________________
Emacs-devel mailing list
Emacs-devel@gnu.org
http://mail.gnu.org/mailman/listinfo/emacs-devel


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

* Re: PO files and Emacs
  2002-03-11  6:45       ` Karl Eichwalder
@ 2002-03-11  6:53         ` Eli Zaretskii
  0 siblings, 0 replies; 36+ messages in thread
From: Eli Zaretskii @ 2002-03-11  6:53 UTC (permalink / raw)
  Cc: Neil Darlow, rms, emacs-devel, sanvila, haible, handa


On Mon, 11 Mar 2002, Karl Eichwalder wrote:

> Eli Zaretskii <eliz@is.elta.co.il> writes:
> 
> > If not, could someone please try to show such a Lisp fragment?
> 
> Neil said it's possible to reproduce the problem using po.el; is this
> small enough for debugging?

Something smaller would be more useful.  Failing that, please show the 
fragment in po-mode which was failing, and please identify the offending 
variable/function.

I'm asking for this because your past message seemed to imply that some 
infrastructure in Emacs was misbehaving.  I'd like to find out what 
infrastructure is that, so that I could dig into that.

TIA

_______________________________________________
Emacs-devel mailing list
Emacs-devel@gnu.org
http://mail.gnu.org/mailman/listinfo/emacs-devel


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

* Re: PO files and Emacs
  2002-03-10  5:29   ` Karl Eichwalder
@ 2002-03-11  9:00     ` Richard Stallman
  2002-03-11 11:03       ` Eli Zaretskii
                         ` (2 more replies)
  0 siblings, 3 replies; 36+ messages in thread
From: Richard Stallman @ 2002-03-11  9:00 UTC (permalink / raw)
  Cc: emacs-devel, sanvila, neil, haible, handa

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 466 bytes --]

    Yes.  The feature request is to add po.el to Emacs---is this possible?
    The code is already disclaimed, since it's basically distributed with
    GNU gettext and the algorithms ware invented by François and Bruno.

Ok.  Eli, could you install it?  Meanwhile, Karl, could you look at
the bug that has been reported?

_______________________________________________
Emacs-devel mailing list
Emacs-devel@gnu.org
http://mail.gnu.org/mailman/listinfo/emacs-devel


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

* Re: PO files and Emacs
  2002-03-11  9:00     ` Richard Stallman
@ 2002-03-11 11:03       ` Eli Zaretskii
  2002-03-11 17:54         ` Karl Eichwalder
  2002-03-11 20:02       ` Karl Eichwalder
  2002-03-15 13:54       ` Eli Zaretskii
  2 siblings, 1 reply; 36+ messages in thread
From: Eli Zaretskii @ 2002-03-11 11:03 UTC (permalink / raw)
  Cc: keichwa, emacs-devel, sanvila, neil, haible, handa


On Mon, 11 Mar 2002, Richard Stallman wrote:

>     Yes.  The feature request is to add po.el to Emacs---is this possible?
>     The code is already disclaimed, since it's basically distributed with
>     GNU gettext and the algorithms ware invented by François and Bruno.
> 
> Ok.  Eli, could you install it?

Sure.  Karl, where do I get the version you suggest to include?

_______________________________________________
Emacs-devel mailing list
Emacs-devel@gnu.org
http://mail.gnu.org/mailman/listinfo/emacs-devel


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

* Re: PO files and Emacs
  2002-03-11 11:03       ` Eli Zaretskii
@ 2002-03-11 17:54         ` Karl Eichwalder
  2002-03-11 19:29           ` Andreas Schwab
  0 siblings, 1 reply; 36+ messages in thread
From: Karl Eichwalder @ 2002-03-11 17:54 UTC (permalink / raw)
  Cc: Richard Stallman, emacs-devel, sanvila, neil, haible, handa

[-- Attachment #1: Type: text/plain, Size: 833 bytes --]

Eli Zaretskii <eliz@is.elta.co.il> writes:

> Sure.  Karl, where do I get the version you suggest to include?

It was attached to my first mail.  I'll attach it here again as po.el,
plus this check:

    (file-exists-p (car (cdr arg-list)))

I also attach file-4.1.5.hu.po; loading this Hungarian file will set
the coding system to iso-8859-2/latin-2:

    emacs --no-site-file -q -l po.el file-4.1.5.hu.po

Now you can edit and save the file.  Starting with a non-existing file
emacs will produce an error message when you will try to save it:

    emacs --no-site-file -q -l po.el not-there.hu.po

Enter:

    # a comment line
    C-x C-s
    error--> and: Wrong type argument: stringp, 1

This used to work with Emacs 20.  As I said: I don't understand
`po-find-file-coding-system'; maybe it's worth to re-write it from
scratch.


[-- Attachment #2: po.el --]
[-- Type: application/emacs-lisp, Size: 3826 bytes --]

[-- Attachment #3: file-4.1.5.hu.po --]
[-- Type: application/octet-stream, Size: 998 bytes --]

# Hungarian translation of GNU fileutils
# Copyright (C) 2002 Free Software Foundation, Inc.
# Emese Kovács <emese@gnome.hu>, 2002
#
msgid ""
msgstr ""
"Project-Id-Version: GNU fileutils 4.1.5\n"
"POT-Creation-Date: 2002-01-05 22:13+0100\n"
"PO-Revision-Date: 2002-03-03 21:01+0100\n"
"Last-Translator: Emese Kovacs <emese@gnome.hu>\n"
"Language-Team: Hungarian <hu@li.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=iso-8859-2\n"
"Content-Transfer-Encoding: 8bit\n"

#: lib/argmatch.c:161
#, c-format
msgid "invalid argument %s for %s"
msgstr "A `%s' argumentum érvénytelen ehhez: %s"

#: lib/argmatch.c:162
#, c-format
msgid "ambiguous argument %s for %s"
msgstr "`%s' argumentum nem egyértelmû a következõhöz: `%s'"

#. We try to put synonyms on the same line.  The assumption is that
#. synonyms follow each other
#: lib/argmatch.c:181
msgid "Valid arguments are:"
msgstr "Az érvényes argumentumok a következõk:"

#: lib/closeout.c:107
msgid "write error"
msgstr "írási hiba"


[-- Attachment #4: Type: text/plain, Size: 272 bytes --]


-- 
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] 36+ messages in thread

* Re: PO files and Emacs
  2002-03-11 17:54         ` Karl Eichwalder
@ 2002-03-11 19:29           ` Andreas Schwab
  0 siblings, 0 replies; 36+ messages in thread
From: Andreas Schwab @ 2002-03-11 19:29 UTC (permalink / raw)
  Cc: Eli Zaretskii, Richard Stallman, emacs-devel, sanvila, neil,
	haible, handa

Karl Eichwalder <ke@gnu.franken.de> writes:

|> Eli Zaretskii <eliz@is.elta.co.il> writes:
|> 
|> > Sure.  Karl, where do I get the version you suggest to include?
|> 
|> It was attached to my first mail.  I'll attach it here again as po.el,
|> plus this check:
|> 
|>     (file-exists-p (car (cdr arg-list)))
|> 
|> I also attach file-4.1.5.hu.po; loading this Hungarian file will set
|> the coding system to iso-8859-2/latin-2:
|> 
|>     emacs --no-site-file -q -l po.el file-4.1.5.hu.po
|> 
|> Now you can edit and save the file.  Starting with a non-existing file
|> emacs will produce an error message when you will try to save it:
|> 
|>     emacs --no-site-file -q -l po.el not-there.hu.po
|> 
|> Enter:
|> 
|>     # a comment line
|>     C-x C-s
|>     error--> and: Wrong type argument: stringp, 1

That's because your function is called with the same arguments as
find-operation-coding-system, which itself gets the same arguments as the
I/O primitives.  Those are, for file I/O, insert-file-contents and
write-region.  The latter has the signature

(write-region START END FILENAME &optional APPEND VISIT LOCKNAME MUSTBENEW)

which means that (car (cdr arg-list)) == START.  You should just move the
second test before the first one.

|> ;;;###autoload
|> (defun po-find-file-coding-system (arg-list)
|>   "Return a Mule (DECODING . ENCODING) pair, according to PO file charset.
|> Called through file-coding-system-alist, before the file is visited for real."
|>   (and (file-exists-p (car (cdr arg-list)))
|>        (eq (car arg-list) 'insert-file-contents)

  (and (eq (car arg-list) 'insert-file-contents)
       (file-exists-p (car (cdr arg-list)))

Andreas.

-- 
Andreas Schwab, SuSE Labs, schwab@suse.de
SuSE GmbH, Deutschherrnstr. 15-19, D-90429 Nürnberg
Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."

_______________________________________________
Emacs-devel mailing list
Emacs-devel@gnu.org
http://mail.gnu.org/mailman/listinfo/emacs-devel


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

* Re: PO files and Emacs
  2002-03-11  9:00     ` Richard Stallman
  2002-03-11 11:03       ` Eli Zaretskii
@ 2002-03-11 20:02       ` Karl Eichwalder
  2002-03-12  5:53         ` Eli Zaretskii
  2002-03-15 13:54       ` Eli Zaretskii
  2 siblings, 1 reply; 36+ messages in thread
From: Karl Eichwalder @ 2002-03-11 20:02 UTC (permalink / raw)
  Cc: emacs-devel, sanvila, neil, haible, handa, schwab

Richard Stallman <rms@gnu.org> writes:

> Ok.  Eli, could you install it?  Meanwhile, Karl, could you look at
> the bug that has been reported?

Andreas found the problem; I'll fix po-mode.el coming with GNU gettext
accordingly.

Andreas Schwab <schwab@suse.de> writes:

> That's because your function is called with the same arguments as
> find-operation-coding-system, which itself gets the same arguments as the
> I/O primitives.  Those are, for file I/O, insert-file-contents and
> write-region.  The latter has the signature
>
> (write-region START END FILENAME &optional APPEND VISIT LOCKNAME MUSTBENEW)
>
> which means that (car (cdr arg-list)) == START.  You should just move the
> second test before the first one.

Thanks for explaining the error I made!

>   (and (eq (car arg-list) 'insert-file-contents)
>        (file-exists-p (car (cdr arg-list)))

Eli, will you be able to install po.el now?

-- 
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/             |   (*)/'(*)

_______________________________________________
Emacs-devel mailing list
Emacs-devel@gnu.org
http://mail.gnu.org/mailman/listinfo/emacs-devel


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

* Re: PO files and Emacs
  2002-03-11 20:02       ` Karl Eichwalder
@ 2002-03-12  5:53         ` Eli Zaretskii
  2002-03-12 13:41           ` Bruno Haible
  0 siblings, 1 reply; 36+ messages in thread
From: Eli Zaretskii @ 2002-03-12  5:53 UTC (permalink / raw)
  Cc: rms, emacs-devel, sanvila, neil, haible, handa, schwab


On Mon, 11 Mar 2002, Karl Eichwalder wrote:

> >   (and (eq (car arg-list) 'insert-file-contents)
> >        (file-exists-p (car (cdr arg-list)))
> 
> Eli, will you be able to install po.el now?

Yes (although it might take a few days until I get to it).

However, I'm confused: should it be called po.el or po-mode.el?  Are we 
talking about 2 different files here?

_______________________________________________
Emacs-devel mailing list
Emacs-devel@gnu.org
http://mail.gnu.org/mailman/listinfo/emacs-devel


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

* PO files and Emacs
@ 2002-03-12  8:44 Karl Eichwalder
  0 siblings, 0 replies; 36+ messages in thread
From: Karl Eichwalder @ 2002-03-12  8:44 UTC (permalink / raw)
  Cc: emacs-devel, haible

> Yes (although it might take a few days until I get to it).

Thanks!

> However, I'm confused: should it be called po.el or po-mode.el?  Are we
> talking about 2 different files here?

I think we should start with something small (po.el as send in my last
mail); in po-mode.el is much too much compatibility code.

For more info, please read this message again (it is also available as
a part of:
http://mail.gnu.org/pipermail/emacs-devel/2002-March/006474.html):

-=-=-=-=-=-=-=-=-=-=-=-=-=- cut here -=-=-=-=-=-=-=-=-=-=-=-=-=-
Date: Thu, 24 May 2001 01:04:34 +0200 (CEST)
From: Bruno Haible <haible@ilog.fr>
To: emacs-pretest-bug@gnu.org, Karl Eichwalder <keichwa@gmx.net>,  
        Eli Zaretskii <eliz@is.elta.co.il>, translation@IRO.UMontreal.CA,
        Bruno Haible <haible@ilog.fr>,
        Pablo Saratxaga <pablo@mandrakesoft.com>,
        Primoz Peterlin <primoz.peterlin@biofiz.mf.uni-lj.si>,
        =?iso-8859-1?q?Fran=E7ois?= Pinard <pinard@IRO.UMontreal.CA>
Subject: Re: PO files and Emacs (coding:)   
Message-ID: <15116.16898.335177.134247@honolulu.ilog.fr>

Dear Emacs maintainers,

To make Karl Eichwalder's proposition more concrete.

PO file support consists of two parts:

  1) Make sure that Emacs displays the file in the right encoding.
     All PO files contains multilingual text; the right choice of
     coding-system is essential for them.

  2) A special editing mode for use by translators (po-mode.el by
     Francois Pinard et al.)

I would like to push part 1) into Emacs. Part 2) is probably best
maintained as part of gettext.

There are probably fewer users who need 2) than 1) - it is perfectly
well possible (though tedious) to edit PO files in text-mode.


The support consists of three parts.
1) A new file, attached to this mail.

2001-05-23  Bruno Haible  <haible@clisp.cons.org>

        * lisp/textmodes/po.el: New file, extracted from GNU gettext's
        po-mode.el.

2) Make sure that loaddefs.el scans that new file for autoloads.

I don't know how to do this.

3) Put the following form into startup.el or any other files that is
included by startup.el in all cases:

(modify-coding-system-alist 'file "\\.po[tx]?\\'\\|\\.po\\."
                            'po-find-file-coding-system)

Thanks.
-=-=-=-=-=-=-=-=-=-=-=-=-=- cut here -=-=-=-=-=-=-=-=-=-=-=-=-=-


-- 
Linux frechet 2.4.16-4GB #1 Wed Dec 12 13:42:58 GMT 2001 i686 unknown
  9:37am  up 40 days, 23:01, 16 users,  load average: 0.07, 0.39, 0.73
                                             work    :      ke@suse.de
Karl Eichwalder                              home    : keichwa@gmx.net

_______________________________________________
Emacs-devel mailing list
Emacs-devel@gnu.org
http://mail.gnu.org/mailman/listinfo/emacs-devel


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

* Re: PO files and Emacs
  2002-03-09 14:11 PO files and Emacs Karl Eichwalder
  2002-03-10  5:03 ` Richard Stallman
@ 2002-03-12 13:30 ` Bruno Haible
  2002-03-15 13:29   ` Eli Zaretskii
  1 sibling, 1 reply; 36+ messages in thread
From: Bruno Haible @ 2002-03-12 13:30 UTC (permalink / raw)
  Cc: devel-emacs, sanvila, neil, handa

[-- Attachment #1: message body text --]
[-- Type: text/plain, Size: 420 bytes --]

Karl Eichwalder writes:

> When po.el is installed I'll help to test it.

The version you submitted is 10 months old. Here is the current
version, which includes extensions by Francois Pinard, updates for
Emacs 21 by me, and fixes by yourself and Andreas Schwab. I suggest to
include this one.

And please keep the comments about XEmacs. There would be no point in
making life harder for the XEmacs maintainers.

Bruno


[-- Attachment #2: po.el --]
[-- Type: text/x-elisp, Size: 6537 bytes --]

;;; po.el --- basic support of PO translation files -*- coding: utf-8; -*-

;; Copyright (C) 1995-1998, 2000-2002 Free Software Foundation, Inc.

;; Authors: François Pinard <pinard@iro.umontreal.ca>,
;;          Greg McGary <gkm@magilla.cichlid.com>,
;;          Bruno Haible <bruno@clisp.org>.

;; This file is part of GNU Emacs.

;; GNU Emacs is free software; you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation; either version 2, or (at your option)
;; any later version.

;; GNU Emacs is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
;; GNU General Public License for more details.

;; You should have received a copy of the GNU General Public License
;; along with GNU Emacs; see the file COPYING.  If not, write to the
;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
;; Boston, MA 02111-1307, USA.


; Make the cpnnn codesets available.
(if (not (string-match "XEmacs\\|Lucid" emacs-version))
  (mapc #'codepage-setup (mapcar #'car (cp-supported-codepages))))

(defconst po-content-type-charset-alist
  '(; Note: Emacs 21 doesn't support all encodings, thus the missing entries.
    (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.")

(defun po-find-charset (filename)
  "Return PO file charset value."
  (interactive)
  (let ((charset-regexp
	 "^\"Content-Type: text/plain;[ \t]*charset=\\(.*\\)\\\\n\"")
	(short-read nil))
    ;; Try the first 4096 bytes.  In case we cannot find the charset value
    ;; within the first 4096 bytes (the PO file might start with a long
    ;; comment) try the next 4096 bytes repeatedly until we'll know for sure
    ;; we've checked the empty header entry entirely.
    (while (not (or short-read (re-search-forward "^msgid" nil t)))
      (save-excursion
        (goto-char (point-max))
	(let ((pair (insert-file-contents-literally filename nil
						    (1- (point))
						    (1- (+ (point) 4096)))))
	  (setq short-read (< (nth 1 pair) 4096)))))
    (cond (short-read nil)
	  ((re-search-forward charset-regexp nil t) (match-string 1))
	  ;; We've found the first msgid; maybe, only a part of the msgstr
	  ;; value was loaded.  Load the next 1024 bytes; if charset still
	  ;; isn't available, give up.
	  (t (save-excursion
	       (goto-char (point-max))
	       (insert-file-contents-literally filename nil
					       (1- (point))
					       (1- (+ (point) 1024))))
	     (if (re-search-forward charset-regexp nil t)
		 (match-string 1))))))

(defun po-find-file-coding-system-guts (operation filename)
  "\
Return a Mule (DECODING . ENCODING) pair, according to PO file charset.
Called through file-coding-system-alist, before the file is visited for real."
  (and (eq operation 'insert-file-contents)
       (file-exists-p filename)
       (po-with-temp-buffer
	 (let* ((coding-system-for-read 'no-conversion)
                (charset (or (po-find-charset filename) "ascii"))
                (charset-upper (intern (upcase charset)))
                (charset-lower (intern (downcase charset))))
           (list (or (cdr (assq charset-upper po-content-type-charset-alist))
                     (if (memq charset-lower (coding-system-list))
                       charset-lower
                      'no-conversion)))))))

;;;###autoload
(defun po-find-file-coding-system (arg-list)
  "\
Return a Mule (DECODING . ENCODING) pair, according to PO file charset.
Called through file-coding-system-alist, before the file is visited for real."
  (po-find-file-coding-system-guts (car arg-list) (car (cdr arg-list))))
;; This is for XEmacs.
;(defun po-find-file-coding-system (operation filename)
;  "\
;Return a Mule (DECODING . ENCODING) pair, according to PO file charset.
;Called through file-coding-system-alist, before the file is visited for real."
;  (po-find-file-coding-system-guts operation filename))


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

* Re: PO files and Emacs
  2002-03-12  5:53         ` Eli Zaretskii
@ 2002-03-12 13:41           ` Bruno Haible
  2002-03-12 15:53             ` Kim F. Storm
  2002-03-12 17:17             ` Eli Zaretskii
  0 siblings, 2 replies; 36+ messages in thread
From: Bruno Haible @ 2002-03-12 13:41 UTC (permalink / raw)
  Cc: Karl Eichwalder, rms, emacs-devel, sanvila, neil, handa, schwab

Eli Zaretskii writes:

> However, I'm confused: should it be called po.el or po-mode.el?  Are we 
> talking about 2 different files here?

We are talking about two different files. po.el does only the encoding
recognition. It is suitable for viewing PO files and doesn't need a
manual. Whereas po-mode.el is a major mode for editing (not just
viewing) PO files. po-mode.el is and remains included in the GNU
gettext package, because it is documented in the GNU gettext manual
and needs some of the GNU gettext programs to be installed.

Please don't name the file po-mode.el inside Emacs; (load-library
"po-mode.el") would not work any more.

Bruno

_______________________________________________
Emacs-devel mailing list
Emacs-devel@gnu.org
http://mail.gnu.org/mailman/listinfo/emacs-devel


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

* Re: PO files and Emacs
  2002-03-12 13:41           ` Bruno Haible
@ 2002-03-12 15:53             ` Kim F. Storm
  2002-03-12 16:25               ` Karl Eichwalder
                                 ` (2 more replies)
  2002-03-12 17:17             ` Eli Zaretskii
  1 sibling, 3 replies; 36+ messages in thread
From: Kim F. Storm @ 2002-03-12 15:53 UTC (permalink / raw)
  Cc: Eli Zaretskii, Karl Eichwalder, rms, emacs-devel, sanvila, neil,
	handa, schwab

Bruno Haible <haible@ilog.fr> writes:

> Eli Zaretskii writes:
> 
> > However, I'm confused: should it be called po.el or po-mode.el?  Are we 
> > talking about 2 different files here?
> 
> We are talking about two different files. po.el does only the encoding
> recognition. It is suitable for viewing PO files and doesn't need a
> manual. Whereas po-mode.el is a major mode for editing (not just
> viewing) PO files. po-mode.el is and remains included in the GNU
> gettext package, because it is documented in the GNU gettext manual
> and needs some of the GNU gettext programs to be installed.
> 

IMO, the commentary in the po.el file is *very* sparse, and it is hard
to see when this file is needed, and for what purpose...

Also, IMHO, the name 'po.el' doesn't suggest anything about this being
an "extract" of a larger po-mode.el.

  Maybe one of po-file.el, po-view.el, po-find.el, po-mule.el,
po-basic.el, or po-coding.el would be a better choice.

Should this go into lisp/textmodes/ or lisp/international/  ?


-- 
Kim F. Storm <storm@cua.dk> http://www.cua.dk


_______________________________________________
Emacs-devel mailing list
Emacs-devel@gnu.org
http://mail.gnu.org/mailman/listinfo/emacs-devel


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

* Re: PO files and Emacs
  2002-03-12 15:53             ` Kim F. Storm
@ 2002-03-12 16:25               ` Karl Eichwalder
  2002-03-12 17:19               ` Bruno Haible
  2002-03-12 17:20               ` Bruno Haible
  2 siblings, 0 replies; 36+ messages in thread
From: Karl Eichwalder @ 2002-03-12 16:25 UTC (permalink / raw)
  Cc: Bruno Haible, Eli Zaretskii, rms, emacs-devel, sanvila, neil,
	handa, schwab

storm@cua.dk (Kim F. Storm) writes:

> IMO, the commentary in the po.el file is *very* sparse, and it is hard
> to see when this file is needed, and for what purpose...

A mechanism is needed to display arbitrary .po files correctly without
special user invention.  Yes, that's all for the moment :)

-- 
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/             |   (*)/'(*)

_______________________________________________
Emacs-devel mailing list
Emacs-devel@gnu.org
http://mail.gnu.org/mailman/listinfo/emacs-devel


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

* Re: PO files and Emacs
  2002-03-12 13:41           ` Bruno Haible
  2002-03-12 15:53             ` Kim F. Storm
@ 2002-03-12 17:17             ` Eli Zaretskii
  1 sibling, 0 replies; 36+ messages in thread
From: Eli Zaretskii @ 2002-03-12 17:17 UTC (permalink / raw)
  Cc: Karl Eichwalder, rms, emacs-devel, sanvila, neil, handa, schwab


On Tue, 12 Mar 2002, Bruno Haible wrote:

> Whereas po-mode.el is a major mode for editing (not just
> viewing) PO files. po-mode.el is and remains included in the GNU
> gettext package, because it is documented in the GNU gettext manual
> and needs some of the GNU gettext programs to be installed.

It's your decision, of course, but I don't think these reasons are grave 
enough to prevent inclusion of po-mode.el in Emacs.  Texinfo Mode has the 
same status: it's documented in the Texinfo manual and needs programs 
from the Texinfo package to be fully useful; and yet it is distributed as 
part of Emacs.

The important consideration (IMHO) is that, while po-mode.el could be 
useful with Emacs but without gettext, it is useless with gettext but 
without Emacs.

_______________________________________________
Emacs-devel mailing list
Emacs-devel@gnu.org
http://mail.gnu.org/mailman/listinfo/emacs-devel


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

* Re: PO files and Emacs
  2002-03-12 15:53             ` Kim F. Storm
  2002-03-12 16:25               ` Karl Eichwalder
@ 2002-03-12 17:19               ` Bruno Haible
  2002-03-12 17:20               ` Bruno Haible
  2 siblings, 0 replies; 36+ messages in thread
From: Bruno Haible @ 2002-03-12 17:19 UTC (permalink / raw)
  Cc: Eli Zaretskii, Karl Eichwalder, rms, emacs-devel, sanvila, neil,
	handa, schwab

storm@cua.dk writes:

> IMO, the commentary in the po.el file is *very* sparse, and it is hard
> to see when this file is needed, and for what purpose...

The appended update has more comments.

> Should this go into lisp/textmodes/ or lisp/international/  ?

It fits better in lisp/textmodes/ IMO, (even though it doesn't define a
text mode), because it provides support for a particular kind of text
files.

Bruno

_______________________________________________
Emacs-devel mailing list
Emacs-devel@gnu.org
http://mail.gnu.org/mailman/listinfo/emacs-devel


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

* Re: PO files and Emacs
  2002-03-12 15:53             ` Kim F. Storm
  2002-03-12 16:25               ` Karl Eichwalder
  2002-03-12 17:19               ` Bruno Haible
@ 2002-03-12 17:20               ` Bruno Haible
  2002-03-15 13:53                 ` Eli Zaretskii
  2 siblings, 1 reply; 36+ messages in thread
From: Bruno Haible @ 2002-03-12 17:20 UTC (permalink / raw)
  Cc: Eli Zaretskii, Karl Eichwalder, rms, emacs-devel, sanvila, neil,
	handa, schwab

[-- Attachment #1: message body text --]
[-- Type: text/plain, Size: 149 bytes --]

> IMO, the commentary in the po.el file is *very* sparse, and it is hard
> to see when this file is needed, and for what purpose...

Take this one.


[-- Attachment #2: po.el --]
[-- Type: text/x-elisp, Size: 6796 bytes --]

;;; po.el --- basic support of PO translation files -*- coding: utf-8; -*-

;; Copyright (C) 1995-1998, 2000-2002 Free Software Foundation, Inc.

;; Authors: François Pinard <pinard@iro.umontreal.ca>,
;;          Greg McGary <gkm@magilla.cichlid.com>,
;;          Bruno Haible <bruno@clisp.org>.

;; This file is part of GNU Emacs.

;; GNU Emacs is free software; you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation; either version 2, or (at your option)
;; any later version.

;; GNU Emacs is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
;; GNU General Public License for more details.

;; You should have received a copy of the GNU General Public License
;; along with GNU Emacs; see the file COPYING.  If not, write to the
;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
;; Boston, MA 02111-1307, USA.

;;; Commentary:

;;  Basic support for viewing PO files.

;;  Usage:
;;  (autoload 'po-find-file-coding-system "po")
;;  (modify-coding-system-alist 'file "\\.po\\'\\|\\.po\\."
;;                              'po-find-file-coding-system)

;;; Code:

; Make the cpnnn codesets available.
(if (not (string-match "XEmacs\\|Lucid" emacs-version))
  (mapc #'codepage-setup (mapcar #'car (cp-supported-codepages))))

(defconst po-content-type-charset-alist
  '(; Note: Emacs 21 doesn't support all encodings, thus the missing entries.
    (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.")

(defun po-find-charset (filename)
  "Return PO file charset value."
  (interactive)
  (let ((charset-regexp
	 "^\"Content-Type: text/plain;[ \t]*charset=\\(.*\\)\\\\n\"")
	(short-read nil))
    ;; Try the first 4096 bytes.  In case we cannot find the charset value
    ;; within the first 4096 bytes (the PO file might start with a long
    ;; comment) try the next 4096 bytes repeatedly until we'll know for sure
    ;; we've checked the empty header entry entirely.
    (while (not (or short-read (re-search-forward "^msgid" nil t)))
      (save-excursion
        (goto-char (point-max))
	(let ((pair (insert-file-contents-literally filename nil
						    (1- (point))
						    (1- (+ (point) 4096)))))
	  (setq short-read (< (nth 1 pair) 4096)))))
    (cond (short-read nil)
	  ((re-search-forward charset-regexp nil t) (match-string 1))
	  ;; We've found the first msgid; maybe, only a part of the msgstr
	  ;; value was loaded.  Load the next 1024 bytes; if charset still
	  ;; isn't available, give up.
	  (t (save-excursion
	       (goto-char (point-max))
	       (insert-file-contents-literally filename nil
					       (1- (point))
					       (1- (+ (point) 1024))))
	     (if (re-search-forward charset-regexp nil t)
		 (match-string 1))))))

(defun po-find-file-coding-system-guts (operation filename)
  "\
Return a Mule (DECODING . ENCODING) pair, according to PO file charset.
Called through file-coding-system-alist, before the file is visited for real."
  (and (eq operation 'insert-file-contents)
       (file-exists-p filename)
       (po-with-temp-buffer
	 (let* ((coding-system-for-read 'no-conversion)
                (charset (or (po-find-charset filename) "ascii"))
                (charset-upper (intern (upcase charset)))
                (charset-lower (intern (downcase charset))))
           (list (or (cdr (assq charset-upper po-content-type-charset-alist))
                     (if (memq charset-lower (coding-system-list))
                       charset-lower
                      'no-conversion)))))))

;;;###autoload
(defun po-find-file-coding-system (arg-list)
  "\
Return a Mule (DECODING . ENCODING) pair, according to PO file charset.
Called through file-coding-system-alist, before the file is visited for real."
  (po-find-file-coding-system-guts (car arg-list) (car (cdr arg-list))))
;; This is for XEmacs.
;(defun po-find-file-coding-system (operation filename)
;  "\
;Return a Mule (DECODING . ENCODING) pair, according to PO file charset.
;Called through file-coding-system-alist, before the file is visited for real."
;  (po-find-file-coding-system-guts operation filename))


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

* Re: PO files and Emacs
  2002-03-12 13:30 ` Bruno Haible
@ 2002-03-15 13:29   ` Eli Zaretskii
  2002-03-15 18:43     ` Bruno Haible
  0 siblings, 1 reply; 36+ messages in thread
From: Eli Zaretskii @ 2002-03-15 13:29 UTC (permalink / raw)
  Cc: keichwa, emacs-devel

> From: Bruno Haible <haible@ilog.fr>
> Date: Tue, 12 Mar 2002 14:30:06 +0100 (CET)
> 
> Karl Eichwalder writes:
> 
> > When po.el is installed I'll help to test it.
> 
> The version you submitted is 10 months old. Here is the current
> version, which includes extensions by Francois Pinard, updates for
> Emacs 21 by me, and fixes by yourself and Andreas Schwab. I suggest to
> include this one.

Does this version work for you without po-mode.el being loaded?  It
uses po-with-temp-buffer, which seems to be undefined.  How should I
define it?

> And please keep the comments about XEmacs. There would be no point in
> making life harder for the XEmacs maintainers.

Why should it be commented-out?  Why not make po-find-file-coding-system
work in both flavors?

_______________________________________________
Emacs-devel mailing list
Emacs-devel@gnu.org
http://mail.gnu.org/mailman/listinfo/emacs-devel


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

* Re: PO files and Emacs
  2002-03-12 17:20               ` Bruno Haible
@ 2002-03-15 13:53                 ` Eli Zaretskii
  2002-03-16  3:41                   ` Karl Eichwalder
  0 siblings, 1 reply; 36+ messages in thread
From: Eli Zaretskii @ 2002-03-15 13:53 UTC (permalink / raw)
  Cc: keichwa, rms, emacs-devel, schwab

> From: Bruno Haible <haible@ilog.fr>
> Date: Tue, 12 Mar 2002 18:20:40 +0100 (CET)
> 
> ; Make the cpnnn codesets available.
> (if (not (string-match "XEmacs\\|Lucid" emacs-version))
>   (mapc #'codepage-setup (mapcar #'car (cp-supported-codepages))))

Is it really a good idea to load all the cpNNN tables whenever some
PO file is visited?  Isn't it better to load them only on demand?

_______________________________________________
Emacs-devel mailing list
Emacs-devel@gnu.org
http://mail.gnu.org/mailman/listinfo/emacs-devel


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

* Re: PO files and Emacs
  2002-03-11  9:00     ` Richard Stallman
  2002-03-11 11:03       ` Eli Zaretskii
  2002-03-11 20:02       ` Karl Eichwalder
@ 2002-03-15 13:54       ` Eli Zaretskii
  2 siblings, 0 replies; 36+ messages in thread
From: Eli Zaretskii @ 2002-03-15 13:54 UTC (permalink / raw)
  Cc: keichwa, emacs-devel, sanvila, neil, haible, handa

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 503 bytes --]

> From: Richard Stallman <rms@gnu.org>
> Date: Mon, 11 Mar 2002 02:00:21 -0700 (MST)
> 
>     Yes.  The feature request is to add po.el to Emacs---is this possible?
>     The code is already disclaimed, since it's basically distributed with
>     GNU gettext and the algorithms ware invented by François and Bruno.
> 
> Ok.  Eli, could you install it?

Done.

_______________________________________________
Emacs-devel mailing list
Emacs-devel@gnu.org
http://mail.gnu.org/mailman/listinfo/emacs-devel


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

* Re: PO files and Emacs
  2002-03-15 13:29   ` Eli Zaretskii
@ 2002-03-15 18:43     ` Bruno Haible
  2002-03-16  4:36       ` Karl Eichwalder
  2002-03-16 10:39       ` Alex Schroeder
  0 siblings, 2 replies; 36+ messages in thread
From: Bruno Haible @ 2002-03-15 18:43 UTC (permalink / raw)
  Cc: keichwa, emacs-devel

Eli Zaretskii writes:

> Does this version work for you without po-mode.el being loaded?  It
> uses po-with-temp-buffer, which seems to be undefined.  How should I
> define it?

Oops, please use 'with-temp-buffer' instead. 'po-with-temp-buffer' is
for older versions of Emacs.

> > And please keep the comments about XEmacs. There would be no point in
> > making life harder for the XEmacs maintainers.
> 
> Why should it be commented-out?  Why not make po-find-file-coding-system
> work in both flavors?

I thought it was more acceptable to you when commented out. Of course
it's better to have the proper 'if' conditionalization.

   (if (string-match "XEmacs\\|Lucid" emacs-version)
     (defun po-find-file-coding-system (operation filename)  ...)
     (defun po-find-file-coding-system (arg-list) ...))

> > (if (not (string-match "XEmacs\\|Lucid" emacs-version))
> >   (mapc #'codepage-setup (mapcar #'car (cp-supported-codepages))))
>
> Is it really a good idea to load all the cpNNN tables whenever some
> PO file is visited?  Isn't it better to load them only on demand?

Sure. I was lazy on this point because I think all possible encodings
should be provided by Emacs by default, and there should be no need to
explicitly 'setup' them.

Thanks, Eli!

Bruno

_______________________________________________
Emacs-devel mailing list
Emacs-devel@gnu.org
http://mail.gnu.org/mailman/listinfo/emacs-devel


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

* Re: PO files and Emacs
  2002-03-15 13:53                 ` Eli Zaretskii
@ 2002-03-16  3:41                   ` Karl Eichwalder
  0 siblings, 0 replies; 36+ messages in thread
From: Karl Eichwalder @ 2002-03-16  3:41 UTC (permalink / raw)
  Cc: haible, rms, emacs-devel, schwab

"Eli Zaretskii" <eliz@is.elta.co.il> writes:

> Is it really a good idea to load all the cpNNN tables whenever some
> PO file is visited?  Isn't it better to load them only on demand?

Yes, they are rarely used in the translation project these days; Maybe,
the Bulgarian team still depends on a cpNNN table, though.

-- 
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/             |   (*)/'(*)

_______________________________________________
Emacs-devel mailing list
Emacs-devel@gnu.org
http://mail.gnu.org/mailman/listinfo/emacs-devel


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

* Re: PO files and Emacs
  2002-03-15 18:43     ` Bruno Haible
@ 2002-03-16  4:36       ` Karl Eichwalder
  2002-03-16  9:26         ` Eli Zaretskii
  2002-03-16 10:39       ` Alex Schroeder
  1 sibling, 1 reply; 36+ messages in thread
From: Karl Eichwalder @ 2002-03-16  4:36 UTC (permalink / raw)
  Cc: Eli Zaretskii, emacs-devel

Bruno Haible <haible@ilog.fr> writes:

> Eli Zaretskii writes:
>
>> Does this version work for you without po-mode.el being loaded?  It
>> uses po-with-temp-buffer, which seems to be undefined.  How should I
>> define it?
>
> Oops, please use 'with-temp-buffer' instead. 'po-with-temp-buffer' is
> for older versions of Emacs.

Unfortunately, something else is missing.  It's not the version of po.el
I _tested_ and posted for installation.  I don't know how to make the
installed po.el work.  For sure, something like

(modify-coding-system-alist 'file "\\.po\\'\\|\\.po\\."
			    'po-find-file-coding-system)

must be added (I tried to add it without success).

-- 
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/             |   (*)/'(*)

_______________________________________________
Emacs-devel mailing list
Emacs-devel@gnu.org
http://mail.gnu.org/mailman/listinfo/emacs-devel


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

* Re: PO files and Emacs
  2002-03-16  4:36       ` Karl Eichwalder
@ 2002-03-16  9:26         ` Eli Zaretskii
  2002-03-16 13:05           ` Karl Eichwalder
  0 siblings, 1 reply; 36+ messages in thread
From: Eli Zaretskii @ 2002-03-16  9:26 UTC (permalink / raw)
  Cc: haible, emacs-devel

> From: Karl Eichwalder <ke@gnu.franken.de>
> Date: Sat, 16 Mar 2002 05:36:28 +0100
> 
> Unfortunately, something else is missing.  It's not the version of po.el
> I _tested_ and posted for installation.  I don't know how to make the
> installed po.el work.  For sure, something like
> 
> (modify-coding-system-alist 'file "\\.po\\'\\|\\.po\\."
> 			    'po-find-file-coding-system)
> 
> must be added (I tried to add it without success).

Please try to sync with the CVS and see if po.el works there; it does
for me.

I didn't just add po.el to the repository; I carefully read the
comments you sent with the package and made sure all of them are taken
care of.  In particular, the necessary magic to invoke
po-find-file-coding-system when a PO file is visited is now part of
file-coding-system-alist (see mule-conf.el).

_______________________________________________
Emacs-devel mailing list
Emacs-devel@gnu.org
http://mail.gnu.org/mailman/listinfo/emacs-devel


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

* Re: PO files and Emacs
  2002-03-15 18:43     ` Bruno Haible
  2002-03-16  4:36       ` Karl Eichwalder
@ 2002-03-16 10:39       ` Alex Schroeder
  1 sibling, 0 replies; 36+ messages in thread
From: Alex Schroeder @ 2002-03-16 10:39 UTC (permalink / raw)
  Cc: emacs-devel

Bruno Haible <haible@ilog.fr> writes:

>    (if (string-match "XEmacs\\|Lucid" emacs-version)
>      (defun po-find-file-coding-system (operation filename)  ...)
>      (defun po-find-file-coding-system (arg-list) ...))

In recent times I have switched to using (featurep 'xemacs) in my own
code.

Alex.
-- 
http://www.emacswiki.org/

_______________________________________________
Emacs-devel mailing list
Emacs-devel@gnu.org
http://mail.gnu.org/mailman/listinfo/emacs-devel


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

* Re: PO files and Emacs
  2002-03-16  9:26         ` Eli Zaretskii
@ 2002-03-16 13:05           ` Karl Eichwalder
  2002-03-16 17:29             ` Eli Zaretskii
  0 siblings, 1 reply; 36+ messages in thread
From: Karl Eichwalder @ 2002-03-16 13:05 UTC (permalink / raw)
  Cc: haible, emacs-devel

"Eli Zaretskii" <eliz@is.elta.co.il> writes:

> Please try to sync with the CVS and see if po.el works there; it does
> for me.

Okay, it did work for all .po files coming with gettext.  It does not
work for short files.  Reading the docstring of
`insert-file-contents-literally' I think it isn't necessary to play
with a temp buffer and insert parts of the file only.  IIRC, you told
us something along these lines in the past, Eli?

-- 
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/             |   (*)/'(*)

_______________________________________________
Emacs-devel mailing list
Emacs-devel@gnu.org
http://mail.gnu.org/mailman/listinfo/emacs-devel


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

* Re: PO files and Emacs
  2002-03-16 13:05           ` Karl Eichwalder
@ 2002-03-16 17:29             ` Eli Zaretskii
  2002-03-16 18:41               ` Karl Eichwalder
  0 siblings, 1 reply; 36+ messages in thread
From: Eli Zaretskii @ 2002-03-16 17:29 UTC (permalink / raw)
  Cc: haible, emacs-devel

> From: Karl Eichwalder <ke@gnu.franken.de>
> Date: Sat, 16 Mar 2002 14:05:26 +0100
> 
> Okay, it did work for all .po files coming with gettext.  It does not
> work for short files.

I think I fixed that (and also the cpNNN support without loading all
of the tables at startup).  Please try the CVS version of po.el.

_______________________________________________
Emacs-devel mailing list
Emacs-devel@gnu.org
http://mail.gnu.org/mailman/listinfo/emacs-devel


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

* Re: PO files and Emacs
  2002-03-16 17:29             ` Eli Zaretskii
@ 2002-03-16 18:41               ` Karl Eichwalder
  2002-03-17  4:35                 ` Eli Zaretskii
  0 siblings, 1 reply; 36+ messages in thread
From: Karl Eichwalder @ 2002-03-16 18:41 UTC (permalink / raw)
  Cc: haible, emacs-devel

"Eli Zaretskii" <eliz@is.elta.co.il> writes:

> I think I fixed that (and also the cpNNN support without loading all
> of the tables at startup).  Please try the CVS version of po.el.

Trying to load any PO file I see this error message (happens for
LANG=C, too):

vc-file-clearprops: Wrong type argument: stringp, nil

In GNU Emacs 21.2.50.1 (i686-pc-linux-gnu, X toolkit, Xaw3d scroll bars)
 of 2002-03-16 on tux
configured using `configure --prefix=/gnu --with-gif=yes'
Important settings:
  value of $LC_ALL: nil
  value of $LC_COLLATE: nil
  value of $LC_CTYPE: nil
  value of $LC_MESSAGES: nil
  value of $LC_MONETARY: nil
  value of $LC_NUMERIC: nil
  value of $LC_TIME: nil
  value of $LANG: de_DE@euro
  locale-coding-system: iso-latin-9
  default-enable-multibyte-characters: t

(src/emacs -q --no-site de.po)
Loading disp-table...done
Loading encoded-kb...done
Loading tool-bar...done
Loading image...done
Loading tooltip...done
For information about the GNU Project and its goals, type C-h C-p.
vc-file-clearprops: Wrong type argument: stringp, nil

-- 
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/             |   (*)/'(*)

_______________________________________________
Emacs-devel mailing list
Emacs-devel@gnu.org
http://mail.gnu.org/mailman/listinfo/emacs-devel


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

* Re: PO files and Emacs
  2002-03-16 18:41               ` Karl Eichwalder
@ 2002-03-17  4:35                 ` Eli Zaretskii
  2002-03-17  5:26                   ` Karl Eichwalder
  0 siblings, 1 reply; 36+ messages in thread
From: Eli Zaretskii @ 2002-03-17  4:35 UTC (permalink / raw)
  Cc: haible, emacs-devel

> From: Karl Eichwalder <ke@gnu.franken.de>
> Date: Sat, 16 Mar 2002 19:41:47 +0100
> 
> "Eli Zaretskii" <eliz@is.elta.co.il> writes:
> 
> > I think I fixed that (and also the cpNNN support without loading all
> > of the tables at startup).  Please try the CVS version of po.el.
> 
> Trying to load any PO file I see this error message (happens for
> LANG=C, too):
> 
> vc-file-clearprops: Wrong type argument: stringp, nil

Thanks, but I need either a full backtrace or a file where it
happened to you.

_______________________________________________
Emacs-devel mailing list
Emacs-devel@gnu.org
http://mail.gnu.org/mailman/listinfo/emacs-devel


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

* Re: PO files and Emacs
  2002-03-17  4:35                 ` Eli Zaretskii
@ 2002-03-17  5:26                   ` Karl Eichwalder
  2002-03-17 11:40                     ` Patch for GNU gettext (Re: PO files and Emacs) Karl Eichwalder
  2002-03-17 11:42                     ` PO files and Emacs Eli Zaretskii
  0 siblings, 2 replies; 36+ messages in thread
From: Karl Eichwalder @ 2002-03-17  5:26 UTC (permalink / raw)
  Cc: haible, emacs-devel

"Eli Zaretskii" <eliz@is.elta.co.il> writes:

> Thanks, but I need either a full backtrace or a file where it
> happened to you.

Sorry.  After cvs up this morning I'm unable to reproduce the problem.
Now it works for all .po files coming with gettext and for hand crafted
short .po files; it's also possible to load empty, non-existing, or
incomplete .po files.

Thanks a lot, Eli!

Now I'll try to find a way make it load gettext's po-mode.el in addition.

-- 
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/             |   (*)/'(*)

_______________________________________________
Emacs-devel mailing list
Emacs-devel@gnu.org
http://mail.gnu.org/mailman/listinfo/emacs-devel


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

* Patch for GNU gettext (Re: PO files and Emacs)
  2002-03-17  5:26                   ` Karl Eichwalder
@ 2002-03-17 11:40                     ` Karl Eichwalder
  2002-03-17 11:42                     ` PO files and Emacs Eli Zaretskii
  1 sibling, 0 replies; 36+ messages in thread
From: Karl Eichwalder @ 2002-03-17 11:40 UTC (permalink / raw)
  Cc: Eli Zaretskii, emacs-devel

Karl Eichwalder <ke@gnu.franken.de> writes:

> Now I'll try to find a way make it load gettext's po-mode.el in addition.

A special hook isn't required; applying the appended patch against
gettext's po-mode.el works for me.  Poeple wanting to use it for Emacs
< 21.2.50 or for XEmacs must change this line in their .emacs:

    (autoload 'po-find-file-coding-system "po-mode")

This `po-find-file-coding-system' now comes with po-compat.el.

2002-03-17  Karl Eichwalder  <ke@suse.de>

	* po-compat.el: New file.  Copy compatibility variables from
	po-mode.el.
	(po-content-type-charset-alist): Takeover from po-mode.el.
	(po-find-charset): Likewise.
	(po-find-file-coding-system-guts): Likewise.

	* po-mode (po-content-type-charset-alist): Delete.
	(po-find-charset): Likewise.
	(po-find-file-coding-system-guts): Likewise.
	Check for `po-find-file-coding-system'; on Emacs < 21.2.50 and
	XEmacs load po-compat.el.


*** gettext/misc/po-mode.el	Sat Mar 16 15:28:09 2002
--- gettext/misc/po-mode.el	Sun Mar 17 12:15:03 2002
***************
*** 38,46 ****
  ;;   (setq auto-mode-alist (cons '("\\.po\\'\\|\\.po\\." . po-mode)
  ;;				  auto-mode-alist))
  ;;
! ;; To use the right coding system automatically under Emacs 20, also add:
  ;;
! ;;   (autoload 'po-find-file-coding-system "po-mode")
  ;;   (modify-coding-system-alist 'file "\\.po\\'\\|\\.po\\."
  ;;				  'po-find-file-coding-system)
  ;;
--- 38,47 ----
  ;;   (setq auto-mode-alist (cons '("\\.po\\'\\|\\.po\\." . po-mode)
  ;;				  auto-mode-alist))
  ;;
! ;; To use the right coding system automatically under Emacs 20.x, 21.1,
! ;; and 21.2, also add:
  ;;
! ;;   (autoload 'po-find-file-coding-system "po-compat")
  ;;   (modify-coding-system-alist 'file "\\.po\\'\\|\\.po\\."
  ;;				  'po-find-file-coding-system)
  ;;
***************
*** 49,55 ****
  
  ;;; Code:
  \f
! (defconst po-mode-version-string "1.91" "\
  Version number of this version of po-mode.el.")
  
  ;;; Emacs portability matters - part I.
--- 50,56 ----
  
  ;;; Code:
  \f
! (defconst po-mode-version-string "2.00" "\
  Version number of this version of po-mode.el.")
  
  ;;; Emacs portability matters - part I.
***************
*** 774,860 ****
    (_"Type 'C-c C-c' once done, or 'C-c C-k' to abort edit")
    "Message to post in the minibuffer when an edit buffer is displayed.")
  
- ; Make the cpnnn codesets available.
- (if po-EMACS20
-   (mapc #'codepage-setup (mapcar #'car (cp-supported-codepages))))
- 
- (defconst po-content-type-charset-alist
-   '(; Note: Emacs 21 doesn't support all encodings, thus the missing entries.
-     (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.")
- 
  (defvar po-auxiliary-list nil
    "List of auxiliary PO files, in completing read format.")
  
--- 775,780 ----
***************
*** 931,1001 ****
  \f
  ;;; Mode activation.
  
! (defun po-find-charset (filename)
!   "Return PO file charset value."
!   (interactive)
!   (let ((charset-regexp
! 	 "^\"Content-Type: text/plain;[ \t]*charset=\\(.*\\)\\\\n\"")
! 	(short-read nil))
!     ;; Try the first 4096 bytes.  In case we cannot find the charset value
!     ;; within the first 4096 bytes (the PO file might start with a long
!     ;; comment) try the next 4096 bytes repeatedly until we'll know for sure
!     ;; we've checked the empty header entry entirely.
!     (while (not (or short-read (re-search-forward "^msgid" nil t)))
!       (save-excursion
!         (goto-char (point-max))
! 	(let ((pair (insert-file-contents-literally filename nil
! 						    (1- (point))
! 						    (1- (+ (point) 4096)))))
! 	  (setq short-read (< (nth 1 pair) 4096)))))
!     (cond (short-read nil)
! 	  ((re-search-forward charset-regexp nil t) (match-string 1))
! 	  ;; We've found the first msgid; maybe, only a part of the msgstr
! 	  ;; value was loaded.  Load the next 1024 bytes; if charset still
! 	  ;; isn't available, give up.
! 	  (t (save-excursion
! 	       (goto-char (point-max))
! 	       (insert-file-contents-literally filename nil
! 					       (1- (point))
! 					       (1- (+ (point) 1024))))
! 	     (if (re-search-forward charset-regexp nil t)
! 		 (match-string 1))))))
! 
! (eval-and-compile
!   (if (or po-EMACS20 po-XEMACS)
!       (defun po-find-file-coding-system-guts (operation filename)
! 	"\
! Return a Mule (DECODING . ENCODING) pair, according to PO file charset.
! Called through file-coding-system-alist, before the file is visited for real."
! 	(and (eq operation 'insert-file-contents)
! 	     (file-exists-p filename)
! 	     (po-with-temp-buffer
! 	       (let ((coding-system-for-read 'no-conversion))
!                  (let* ((charset (or (po-find-charset filename)
! 				     "ascii"))
!                         (charset-upper (intern (upcase charset)))
!                         (charset-lower (intern (downcase charset))))
!                    (list (or (cdr (assq charset-upper
!                                         po-content-type-charset-alist))
!                              (if (memq charset-lower (coding-system-list))
!                                  charset-lower
!                                'no-conversion)))))))))
! 
!   (if po-EMACS20
!       (defun po-find-file-coding-system (arg-list)
! 	"\
! Return a Mule (DECODING . ENCODING) pair, according to PO file charset.
! Called through file-coding-system-alist, before the file is visited for real."
! 	(po-find-file-coding-system-guts (car arg-list) (car (cdr arg-list)))))
! 
!   (if po-XEMACS
!       (defun po-find-file-coding-system (operation filename)
! 	"\
! Return a Mule (DECODING . ENCODING) pair, according to PO file charset.
! Called through file-coding-system-alist, before the file is visited for real."
! 	(po-find-file-coding-system-guts operation filename)))
! 
!  )
  
  (defvar po-mode-abbrev-table nil
    "Abbrev table used while in PO mode.")
--- 851,859 ----
  \f
  ;;; Mode activation.
  
! ;; Emacs 21.2.50 comes with po-find-file-coding-system
! (if (not (fboundp 'po-find-file-coding-system))
!     (require 'po-compat))
  
  (defvar po-mode-abbrev-table nil
    "Abbrev table used while in PO mode.")
*** /dev/null	Mon Sep 24 03:54:15 2001
--- gettext/misc/po-compat.el	Sun Mar 17 12:10:54 2002
***************
*** 0 ****
--- 1,178 ----
+ (eval-and-compile
+   (cond ((string-match "XEmacs\\|Lucid" emacs-version)
+ 	 (setq po-EMACS20 nil po-XEMACS t))
+ 	((and (string-lessp "19" emacs-version) (featurep 'faces))
+ 	 (setq po-EMACS20 t po-XEMACS nil))
+ 	(t (setq po-EMACS20 nil po-XEMACS nil))))
+ 
+ ;; Handle missing 'with-temp-buffer' function.
+ (eval-and-compile
+   (if (fboundp 'with-temp-buffer)
+       (fset 'po-with-temp-buffer (symbol-function 'with-temp-buffer))
+ 
+     (defmacro po-with-temp-buffer (&rest forms)
+       "Create a temporary buffer, and evaluate FORMS there like 'progn'."
+       (let ((curr-buffer (make-symbol "curr-buffer"))
+ 	    (temp-buffer (make-symbol "temp-buffer")))
+ 	`(let ((,curr-buffer (current-buffer))
+ 	       (,temp-buffer (get-buffer-create
+ 			      (generate-new-buffer-name " *po-temp*"))))
+ 	   (unwind-protect
+ 	       (progn
+ 		 (set-buffer ,temp-buffer)
+ 		 ,@forms)
+ 	     (set-buffer ,curr-buffer)
+ 	     (and (buffer-name ,temp-buffer)
+ 		  (kill-buffer ,temp-buffer))))))))
+ 
+ ; Make the cpnnn codesets available.
+ (if po-EMACS20
+   (mapc #'codepage-setup (mapcar #'car (cp-supported-codepages))))
+ 
+ (defconst po-content-type-charset-alist
+   '(; Note: Emacs 21 doesn't support all encodings, thus the missing entries.
+     (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.")
+ 
+ (defun po-find-charset (filename)
+   "Return PO file charset value."
+   (interactive)
+   (let ((charset-regexp
+ 	 "^\"Content-Type: text/plain;[ \t]*charset=\\(.*\\)\\\\n\"")
+ 	(short-read nil))
+     ;; Try the first 4096 bytes.  In case we cannot find the charset value
+     ;; within the first 4096 bytes (the PO file might start with a long
+     ;; comment) try the next 4096 bytes repeatedly until we'll know for sure
+     ;; we've checked the empty header entry entirely.
+     (while (not (or short-read (re-search-forward "^msgid" nil t)))
+       (save-excursion
+         (goto-char (point-max))
+ 	(let ((pair (insert-file-contents-literally filename nil
+ 						    (1- (point))
+ 						    (1- (+ (point) 4096)))))
+ 	  (setq short-read (< (nth 1 pair) 4096)))))
+     (cond (short-read nil)
+ 	  ((re-search-forward charset-regexp nil t) (match-string 1))
+ 	  ;; We've found the first msgid; maybe, only a part of the msgstr
+ 	  ;; value was loaded.  Load the next 1024 bytes; if charset still
+ 	  ;; isn't available, give up.
+ 	  (t (save-excursion
+ 	       (goto-char (point-max))
+ 	       (insert-file-contents-literally filename nil
+ 					       (1- (point))
+ 					       (1- (+ (point) 1024))))
+ 	     (if (re-search-forward charset-regexp nil t)
+ 		 (match-string 1))))))
+ 
+ 
+ (eval-and-compile
+   (if (or po-EMACS20 po-XEMACS)
+       (defun po-find-file-coding-system-guts (operation filename)
+ 	"\
+ Return a Mule (DECODING . ENCODING) pair, according to PO file charset.
+ Called through file-coding-system-alist, before the file is visited for real."
+ 	(and (eq operation 'insert-file-contents)
+ 	     (file-exists-p filename)
+ 	     (po-with-temp-buffer
+ 	       (let ((coding-system-for-read 'no-conversion))
+                  (let* ((charset (or (po-find-charset filename)
+ 				     "ascii"))
+                         (charset-upper (intern (upcase charset)))
+                         (charset-lower (intern (downcase charset))))
+                    (list (or (cdr (assq charset-upper
+                                         po-content-type-charset-alist))
+                              (if (memq charset-lower (coding-system-list))
+                                  charset-lower
+                                'no-conversion)))))))))
+ 
+   (if po-EMACS20
+       (defun po-find-file-coding-system (arg-list)
+ 	"\
+ Return a Mule (DECODING . ENCODING) pair, according to PO file charset.
+ Called through file-coding-system-alist, before the file is visited for real."
+ 	(po-find-file-coding-system-guts (car arg-list) (car (cdr arg-list)))))
+ 
+   (if po-XEMACS
+       (defun po-find-file-coding-system (operation filename)
+ 	"\
+ Return a Mule (DECODING . ENCODING) pair, according to PO file charset.
+ Called through file-coding-system-alist, before the file is visited for real."
+ 	(po-find-file-coding-system-guts operation filename)))
+ 
+  )
+ 
+ (provide 'po-compat)
+ 
+ ;; end of file po-compat.el



-- 
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/             |   (*)/'(*)

_______________________________________________
Emacs-devel mailing list
Emacs-devel@gnu.org
http://mail.gnu.org/mailman/listinfo/emacs-devel


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

* Re: PO files and Emacs
  2002-03-17  5:26                   ` Karl Eichwalder
  2002-03-17 11:40                     ` Patch for GNU gettext (Re: PO files and Emacs) Karl Eichwalder
@ 2002-03-17 11:42                     ` Eli Zaretskii
  1 sibling, 0 replies; 36+ messages in thread
From: Eli Zaretskii @ 2002-03-17 11:42 UTC (permalink / raw)
  Cc: haible, emacs-devel


On Sun, 17 Mar 2002, Karl Eichwalder wrote:

> Now it works for all .po files coming with gettext and for hand crafted
> short .po files; it's also possible to load empty, non-existing, or
> incomplete .po files.

That's good news.

> Thanks a lot, Eli!

You are welcome.

_______________________________________________
Emacs-devel mailing list
Emacs-devel@gnu.org
http://mail.gnu.org/mailman/listinfo/emacs-devel


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

end of thread, other threads:[~2002-03-17 11:42 UTC | newest]

Thread overview: 36+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-03-09 14:11 PO files and Emacs Karl Eichwalder
2002-03-10  5:03 ` Richard Stallman
2002-03-10  5:29   ` Karl Eichwalder
2002-03-11  9:00     ` Richard Stallman
2002-03-11 11:03       ` Eli Zaretskii
2002-03-11 17:54         ` Karl Eichwalder
2002-03-11 19:29           ` Andreas Schwab
2002-03-11 20:02       ` Karl Eichwalder
2002-03-12  5:53         ` Eli Zaretskii
2002-03-12 13:41           ` Bruno Haible
2002-03-12 15:53             ` Kim F. Storm
2002-03-12 16:25               ` Karl Eichwalder
2002-03-12 17:19               ` Bruno Haible
2002-03-12 17:20               ` Bruno Haible
2002-03-15 13:53                 ` Eli Zaretskii
2002-03-16  3:41                   ` Karl Eichwalder
2002-03-12 17:17             ` Eli Zaretskii
2002-03-15 13:54       ` Eli Zaretskii
2002-03-10 11:10   ` Neil Darlow
2002-03-11  5:46     ` Eli Zaretskii
2002-03-11  6:45       ` Karl Eichwalder
2002-03-11  6:53         ` Eli Zaretskii
2002-03-12 13:30 ` Bruno Haible
2002-03-15 13:29   ` Eli Zaretskii
2002-03-15 18:43     ` Bruno Haible
2002-03-16  4:36       ` Karl Eichwalder
2002-03-16  9:26         ` Eli Zaretskii
2002-03-16 13:05           ` Karl Eichwalder
2002-03-16 17:29             ` Eli Zaretskii
2002-03-16 18:41               ` Karl Eichwalder
2002-03-17  4:35                 ` Eli Zaretskii
2002-03-17  5:26                   ` Karl Eichwalder
2002-03-17 11:40                     ` Patch for GNU gettext (Re: PO files and Emacs) Karl Eichwalder
2002-03-17 11:42                     ` PO files and Emacs Eli Zaretskii
2002-03-16 10:39       ` Alex Schroeder
  -- strict thread matches above, loose matches on Subject: below --
2002-03-12  8:44 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).