+2007-12-09 Reiner Steib <Reiner.Steib@gmx.de>
+
+ * imap.el (imap-string-to-integer): New function.
+
2007-12-07 Katsumi Yamaoka <yamaoka@jpl.org>
* dgnushack.el (dgnushack-emacs-compile-defcustom-p): New function; use
(concat "UID STORE " articles
" +FLAGS" (if silent ".SILENT") " (" flags ")"))))))
+;; Cf. http://thread.gmane.org/gmane.emacs.gnus.general/65317/focus=65343
+;; Signal an error if we'd get an integer overflow.
+;;
+;; FIXME: Identify relevant calls to `string-to-number' and replace them with
+;; `imap-string-to-integer'.
+(defun imap-string-to-integer (string &optional base)
+ (let ((number (string-to-number string base)))
+ (if (> number most-positive-fixnum)
+ (error
+ (format "String %s cannot be converted to a lisp integer" number))
+ number)))
+
(defun imap-message-copyuid-1 (mailbox)
(if (imap-capability 'UIDPLUS)
(list (nth 0 (imap-mailbox-get-1 'copyuid mailbox))