bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

no easy way to detect errors with encode-time


From: Jonathan Kamens
Subject: no easy way to detect errors with encode-time
Date: Mon, 9 Sep 2002 05:46:38 -0400

This bug report will be sent to the Free Software Foundation,
not to your local site managers!
Please write in English, because the Emacs maintainers do not have
translators to read other languages for them.

Your bug report will be posted to the bug-gnu-emacs@gnu.org mailing list,
and to the gnu.emacs.bug news group.

In GNU Emacs 21.2.1 (i686-pc-linux-gnu, X toolkit, Xaw3d scroll bars)
 of 2002-08-28 on astest
configured using `configure  --host=i686-pc-linux-gnu --build=i686-pc-linux-gnu 
--target=i386-redhat-linux-gnu --program-prefix= --prefix=/usr 
--exec-prefix=/usr --bindir=/usr/bin --sbindir=/usr/sbin --sysconfdir=/etc 
--datadir=/usr/share --includedir=/usr/include --libdir=/usr/lib 
--libexecdir=/usr/libexec --localstatedir=/var --sharedstatedir=/usr/com 
--mandir=/usr/share/man --infodir=/usr/share/info --with-gcc --with-pop 
--with-sound'
Important settings:
  value of $LC_ALL: nil
  value of $LC_COLLATE: C
  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: en_US
  locale-coding-system: iso-latin-1
  default-enable-multibyte-characters: nil

Please describe exactly what actions triggered the bug
and the precise symptoms of the bug:

If you feed bad values to encode-time, it raises an error.  This means
that if you want to discover that the parameters you're feeding to it
are not representable without your code erroring out, you need to use
ignore-errors or condition-case or some other inelegant construct.
There should be a way to ask encode-time, or some other similar
function, to give you the encoded time or tell you that it's not
representable without erroring out.

I realize that given the defined interface of encode-time, there's no
way to add this functionality to it -- since "You can pass more than 7
arguments; ..." (from the documentation of the function) it's
impossible at this point to add an additional parameter indicating
whether to ignore errors.  But perhaps a new function could be added,
something like safe-encode-time, that returns nil instead of
signalling an error when there is a problem with the parameters
specified to it.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]