summaryrefslogtreecommitdiff
path: root/lisp/calendar/parse-time.el
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2018-08-22 20:45:47 -0700
committerPaul Eggert <eggert@cs.ucla.edu>2018-08-22 20:46:08 -0700
commita4a3c92e9de59bd0251f36326375cce898919edc (patch)
treecbc9d41f826266a3545c9c537929294b18d87108 /lisp/calendar/parse-time.el
parentee641b87cf220250ba89f219fb47a4406a05deb7 (diff)
downloademacs-a4a3c92e9de59bd0251f36326375cce898919edc.tar.gz
Prune most-positive-fixnum from Lisp source
I looked through all instances of most-negative-fixnum and most-positive-fixnum in the Lisp source code, and when it was easy I removed assumptions that integers fit in fixnums. The remaining instances are either nontrivial to fix, or are inherent to the algorithm. * lisp/arc-mode.el (archive-l-e): Do not convert to float, since we have bignums now. All uses changed. * lisp/calc/calc.el (math-bignum): Don’t special-case most-negative-fixnum. * lisp/calendar/parse-time.el (parse-time-string): * lisp/emacs-lisp/edebug.el (edebug-read-special): * lisp/emacs-lisp/package.el (package--remove-hidden): * lisp/gnus/nnfolder.el (nnfolder-read-folder): * lisp/international/mule-util.el (filepos-to-bufferpos--dos): * lisp/menu-bar.el (menu-bar-update-buffers): * lisp/net/rcirc.el (rcirc-handler-317): * lisp/org/org-agenda.el (org-cmp-ts): * lisp/window.el (window--resize-child-windows): Avoid arbitrary limit to most-positive-fixnum or to most-negative-fixnum. * lisp/calendar/time-date.el (days-to-time): * lisp/erc/erc-dcc.el (erc-unpack-int): Don’t worry about integer overflow. * lisp/cedet/semantic/wisent/comp.el (wisent-BITS-PER-WORD): * lisp/gnus/message.el (message-unique-id): * lisp/org/org-footnote.el (org-footnote-new): Simplify. * lisp/erc/erc-dcc.el (erc-most-positive-int-bytes) (erc-most-positive-int-msb): Remove; no longer needed. * lisp/net/imap.el (imap-string-to-integer): Remove; unused. * lisp/org/org-element.el (org-element--cache-generate-key): Document fixnum limitation.
Diffstat (limited to 'lisp/calendar/parse-time.el')
-rw-r--r--lisp/calendar/parse-time.el6
1 files changed, 4 insertions, 2 deletions
diff --git a/lisp/calendar/parse-time.el b/lisp/calendar/parse-time.el
index c4727339040..2f9e557dabc 100644
--- a/lisp/calendar/parse-time.el
+++ b/lisp/calendar/parse-time.el
@@ -98,7 +98,7 @@ letters, digits, plus or minus signs or colons."
`(((6) parse-time-weekdays)
((3) (1 31))
((4) parse-time-months)
- ((5) (100 ,most-positive-fixnum))
+ ((5) (100))
((2 1 0)
,#'(lambda () (and (stringp parse-time-elt)
(= (length parse-time-elt) 8)
@@ -170,7 +170,9 @@ any values that are unknown are returned as nil."
'lambda)))
(and (numberp parse-time-elt)
(<= (car predicate) parse-time-elt)
- (<= parse-time-elt (cadr predicate))
+ (or (not (cdr predicate))
+ (<= parse-time-elt
+ (cadr predicate)))
parse-time-elt))
((symbolp predicate)
(cdr (assoc parse-time-elt