all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Andreas Schwab <schwab@suse.de>
Cc: Eli Zaretskii <eliz@is.elta.co.il>,
	Richard Stallman <rms@gnu.org>,
	emacs-devel@gnu.org, sanvila@unex.es, neil@darlow.co.uk,
	haible@ilog.fr, handa@etl.go.jp
Subject: Re: PO files and Emacs
Date: Mon, 11 Mar 2002 20:29:35 +0100	[thread overview]
Message-ID: <jer8mq7vj4.fsf@sykes.suse.de> (raw)
In-Reply-To: <shg0372dnl.fsf@tux.gnu.franken.de> (Karl Eichwalder's message of "Mon, 11 Mar 2002 18:54:38 +0100")

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


  reply	other threads:[~2002-03-11 19:29 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
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

Reply instructions:

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

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

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

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

  git send-email \
    --in-reply-to=jer8mq7vj4.fsf@sykes.suse.de \
    --to=schwab@suse.de \
    --cc=eliz@is.elta.co.il \
    --cc=emacs-devel@gnu.org \
    --cc=haible@ilog.fr \
    --cc=handa@etl.go.jp \
    --cc=neil@darlow.co.uk \
    --cc=rms@gnu.org \
    --cc=sanvila@unex.es \
    /path/to/YOUR_REPLY

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

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

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

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