From: Andreas Schwab <schwab@suse.de>
To: Kenichi Handa <handa@m17n.org>
Cc: Levin Du <zslevin@gmail.com>, emacs-devel@gnu.org
Subject: Re: Fwd: parse-time-string error with non ASCII timestamp
Date: Tue, 17 Apr 2007 13:33:23 +0200 [thread overview]
Message-ID: <jek5wbxmkc.fsf@sykes.suse.de> (raw)
In-Reply-To: <E1Hdljz-0001bH-RR@etlken.m17n.org> (Kenichi Handa's message of "Tue, 17 Apr 2007 20:20:55 +0900")
Kenichi Handa <handa@m17n.org> writes:
> In article <9649271a0704170310s5c92163bv15f8d6e8eaef37db@mail.gmail.com>, "Levin Du" <zslevin@gmail.com> writes:
> [...]
>> My timestamp includes Chinese number, when the following executes:
>
>> (parse-time-string "<2007-04-02 一>") ; the 12nd char is the
>> Chinese number.
>
>> An error will occur:
>
>> Debugger entered--Lisp error: (args-out-of-range [nil nil nil nil nil
>> nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil
> [...]
>> This is a patch I wrote to solve this problem:
>> *** /home/zslevin/Cook/emacs/lisp/calendar/parse-time.el.orig
>> 2007-04-02 10:01:27.000000000 +0800
>> --- /home/zslevin/Cook/emacs/lisp/calendar/parse-time.el 2007-04-02
>> 15:35:07.000000000 +0800
>> ***************
>> *** 66,72 ****
>> (aref parse-time-digits char))
>
>> (defsubst parse-time-string-chars (char)
>> ! (aref parse-time-syntax char))
>
>> (put 'parse-error 'error-conditions '(parse-error error))
>> (put 'parse-error 'error-message "Parsing error")
>> --- 66,73 ----
>> (aref parse-time-digits char))
>
>> (defsubst parse-time-string-chars (char)
>> ! (and (< char (length parse-time-syntax))
>> ! (aref parse-time-syntax char)))
>
> It seems that this is the right fix at the moment because
> parse-time.el doesn't pay attention to non-ASCII characters
> at all. In the future, we may have to improve it for
> non-ASCII characters if necesary.
I'd guess all that needs to be done is to make parse-time-digits and
parse-time-syntax char tables.
> Shall I install that change?
digit-char-p has the same problem.
Andreas.
--
Andreas Schwab, SuSE Labs, schwab@suse.de
SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany
PGP key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5
"And now for something completely different."
next prev parent reply other threads:[~2007-04-17 11:33 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <1175499420.269736.200740@b75g2000hsg.googlegroups.com>
2007-04-17 10:10 ` Fwd: parse-time-string error with non ASCII timestamp Levin Du
2007-04-17 11:20 ` Kenichi Handa
2007-04-17 11:33 ` Andreas Schwab [this message]
2007-04-17 11:50 ` Kenichi Handa
2007-04-17 14:32 ` Andreas Schwab
2007-04-17 23:07 ` Kenichi Handa
2007-04-18 2:02 ` Richard Stallman
2007-04-18 2:46 ` Kenichi Handa
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=jek5wbxmkc.fsf@sykes.suse.de \
--to=schwab@suse.de \
--cc=emacs-devel@gnu.org \
--cc=handa@m17n.org \
--cc=zslevin@gmail.com \
/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.