+ (gnus-read-old-newsrc-el-file file)))
+ (when (and gnus-product-directory
+ (file-directory-p gnus-product-directory))
+ (let ((list gnus-product-variable-file-list))
+ (while list
+ (apply 'gnus-product-read-variable-file-1 (car list))
+ (setq list (cdr list))))))
+
+(defun gnus-re-read-newsrc-el-file (file)
+ "Attempt to re-read .newsrc.eld file. Returns `nil' if successful.
+The backup file \".newsrc.eld_\" will be created before re-reading."
+ (message "Error in %s; retrying..." file)
+ (if (and
+ (condition-case nil
+ (let ((backup (concat file "_")))
+ (copy-file file backup 'ok-if-already-exists 'keep-time)
+ (message " (The backup file %s has been created)" backup)
+ t)
+ (error nil))
+ (progn
+ (insert-file-contents-as-binary file nil nil nil 'replace)
+ (goto-char (point-min))
+ (when (re-search-forward
+ "^[\t ]*([\t\n\r ]*setq[\t\n\r ]+gnus-format-specs" nil t)
+ (delete-region (goto-char (match-beginning 0)) (forward-list 1))
+ (decode-coding-region (point-min) (point-max)
+ gnus-ding-file-coding-system)
+ (condition-case nil
+ (progn
+ (eval-region (point-min) (point-max))
+ t)
+ (error nil)))))
+ (prog1
+ nil
+ (message "Error in %s; retrying...done" file))
+ (message "Error in %s; retrying...failed" file)
+ t))
+
+(defun gnus-product-read-variable-file-1 (file checking-methods coding
+ &rest variables)
+ (let (error gnus-product-file-version method file-ver)
+ (when (or (condition-case err
+ (let ((coding-system-for-read coding)
+ (input-coding-system coding))
+ (load (expand-file-name file gnus-product-directory)
+ nil nil t)
+ nil)
+ (error
+ (message "Error while reading %s: %s"
+ (expand-file-name file gnus-product-directory)
+ (error-message-string err))
+ (setq error t)))
+ (and (setq method (assq 'product-version checking-methods))
+ (not (and (setq file-ver
+ (cdr (assq 'product-version
+ gnus-product-file-version)))
+ (zerop (product-version-compare file-ver
+ (cadr method))))))
+ (and (assq 'emacs-version checking-methods)
+ (not (and (assq 'emacs-version gnus-product-file-version)
+ (string-equal
+ emacs-version
+ (cdr (assq 'emacs-version
+ gnus-product-file-version))))))
+ (and (assq 'correct-string-widths checking-methods)
+ (not (and (assq 'correct-string-widths
+ gnus-product-file-version)
+ (eq (and gnus-use-correct-string-widths t)
+ (and (cdr (assq 'correct-string-widths
+ gnus-product-file-version))
+ t))))))
+ (unless error
+ (message "\"%s\" seems to have mismatched contents, updating..."
+ file))
+ (while variables
+ (set (car variables) nil)
+ (gnus-product-variable-touch (car variables))
+ (setq variables (cdr variables))))))