emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] /srv/bzr/emacs/trunk r103436: gnus-group.el (gnus-import-o


From: Katsumi Yamaoka
Subject: [Emacs-diffs] /srv/bzr/emacs/trunk r103436: gnus-group.el (gnus-import-other-newsrc-file): New function.
Date: Sun, 27 Feb 2011 08:20:21 +0000
User-agent: Bazaar (2.0.3)

------------------------------------------------------------
revno: 103436
author: Lars Ingebrigtsen <address@hidden>
committer: Katsumi Yamaoka <address@hidden>
branch nick: trunk
timestamp: Sun 2011-02-27 08:20:21 +0000
message:
  gnus-group.el (gnus-import-other-newsrc-file): New function.
modified:
  lisp/gnus/ChangeLog
  lisp/gnus/gnus-group.el
  lisp/gnus/gnus.el
=== modified file 'lisp/gnus/ChangeLog'
--- a/lisp/gnus/ChangeLog       2011-02-25 23:52:19 +0000
+++ b/lisp/gnus/ChangeLog       2011-02-27 08:20:21 +0000
@@ -1,3 +1,7 @@
+2011-02-27  Lars Magne Ingebrigtsen  <address@hidden>
+
+       * gnus-group.el (gnus-import-other-newsrc-file): New function.
+
 2011-02-25  Teodor Zlatanov  <address@hidden>
 
        * auth-source.el (auth-source-search): Cache empty result sets.

=== modified file 'lisp/gnus/gnus-group.el'
--- a/lisp/gnus/gnus-group.el   2011-01-31 02:19:13 +0000
+++ b/lisp/gnus/gnus-group.el   2011-02-27 08:20:21 +0000
@@ -4400,6 +4400,21 @@
 (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

=== modified file 'lisp/gnus/gnus.el'
--- a/lisp/gnus/gnus.el 2011-02-19 19:40:59 +0000
+++ b/lisp/gnus/gnus.el 2011-02-27 08:20:21 +0000
@@ -3114,6 +3114,10 @@
 (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)


reply via email to

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