* gnus-art.el (gnus-save-all-headers): Mention it might be overridden.
[gnus] / lisp / gnus-registry.el
index ddb6696..4d87893 100644 (file)
@@ -1,6 +1,7 @@
 ;;; gnus-registry.el --- article registry for Gnus
-;; Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004
-;;        Free Software Foundation, Inc.
+
+;; Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
+;;   2005, 2006 Free Software Foundation, Inc.
 
 ;; Author: Ted Zlatanov <tzz@lifelogs.com>
 ;; Keywords: news
@@ -59,6 +60,7 @@
 (require 'gnus)
 (require 'gnus-int)
 (require 'gnus-sum)
+(require 'gnus-util)
 (require 'nnmail)
 
 (defvar gnus-registry-dirty t
@@ -169,6 +171,7 @@ way."
              (standard-output (current-buffer)))
          (gnus-gnus-to-quick-newsrc-format t "gnus registry startup file" 'gnus-registry-alist)
          (gnus-registry-cache-whitespace file)
+         (set-text-properties (point-min) (point-max) nil)
          (save-buffer))
       (let ((coding-system-for-write gnus-ding-file-coding-system)
            (version-control gnus-backup-startup-file)
@@ -241,7 +244,8 @@ way."
        (gnus-registry-clean-empty-function))
       ;; now trim the registry appropriately
       (setq gnus-registry-alist (gnus-registry-trim
-                                (hashtable-to-alist gnus-registry-hashtb)))
+                                (gnus-hashtable-to-alist
+                                 gnus-registry-hashtb)))
       ;; really save
       (gnus-registry-cache-save)
       (setq gnus-registry-entry-caching caching)
@@ -286,7 +290,7 @@ way."
 
 (defun gnus-registry-read ()
   (gnus-registry-cache-read)
-  (setq gnus-registry-hashtb (alist-to-hashtable gnus-registry-alist))
+  (setq gnus-registry-hashtb (gnus-alist-to-hashtable gnus-registry-alist))
   (setq gnus-registry-dirty nil))
 
 (defun gnus-registry-trim (alist)
@@ -315,26 +319,6 @@ Also, drop all gnus-registry-ignored-groups matches."
                      (or (cdr (gethash (car a) timehash)) '(0 0 0))
                      (or (cdr (gethash (car b) timehash)) '(0 0 0))))))))))
 
-(defun alist-to-hashtable (alist)
-  "Build a hashtable from the values in ALIST."
-  (let ((ht (make-hash-table
-            :size 4096
-            :test 'equal)))
-    (mapc
-     (lambda (kv-pair)
-       (puthash (car kv-pair) (cdr kv-pair) ht))
-     alist)
-     ht))
-
-(defun hashtable-to-alist (hash)
-  "Build an alist from the values in HASH."
-  (let ((list nil))
-    (maphash
-     (lambda (key value)
-       (setq list (cons (cons key value) list)))
-     hash)
-    list))
-
 (defun gnus-registry-action (action data-header from &optional to method)
   (let* ((id (mail-header-id data-header))
         (subject (gnus-registry-simplify-subject
@@ -713,7 +697,7 @@ Returns the first place where the trail finds a group name."
   "Clear the Gnus registry."
   (interactive)
   (setq gnus-registry-alist nil)
-  (setq gnus-registry-hashtb (alist-to-hashtable gnus-registry-alist))
+  (setq gnus-registry-hashtb (gnus-alist-to-hashtable gnus-registry-alist))
   (setq gnus-registry-dirty t))
 
 ;;;###autoload