+2011-02-27 Lars Magne Ingebrigtsen <larsi@gnus.org>
+
+ * gnus-group.el (gnus-import-other-newsrc-file): New function.
+
2011-02-25 Teodor Zlatanov <tzz@lifelogs.com>
* auth-source.el (auth-source-search): Cache empty result sets.
(defun gnus-group-set-params-info (group params)
(gnus-group-set-info params group 'params))
+;; Ad-hoc function for inserting data from a different newsrc.eld
+;; file. Use with caution, if at all.
+(defun gnus-import-other-newsrc-file (file)
+ (with-temp-buffer
+ (insert-file file)
+ (let (form)
+ (while (ignore-errors
+ (setq form (read (current-buffer))))
+ (when (and (consp form)
+ (eq (cadr form) 'gnus-newsrc-alist))
+ (let ((infos (cadr (nth 2 form))))
+ (dolist (info infos)
+ (when (gnus-get-info (car info))
+ (gnus-set-info (car info) info)))))))))
+
(defun gnus-add-marked-articles (group type articles &optional info force)
;; Add ARTICLES of TYPE to the info of GROUP.
;; If INFO is non-nil, use that info. If FORCE is non-nil, don't
(defmacro gnus-get-info (group)
`(nth 2 (gnus-gethash ,group gnus-newsrc-hashtb)))
+(defun gnus-set-info (group info)
+ (setcar (nthcdr 2 (gnus-gethash group gnus-newsrc-hashtb))
+ info))
+
;;; Load the compatibility functions.
(require 'gnus-ems)