X-Git-Url: http://cgit.sxemacs.org/?a=blobdiff_plain;f=lisp%2Fgnus-registry.el;h=5989b8885bc2f855e1955b6538efc7d434e20abf;hb=9a5c0ef5be3aa743f82281d0fa62a6fce8fa8ea4;hp=8aecc98ee86583a8dd863a5e3487a229d12c2efc;hpb=ea4986256b5af077008d52ee4299847bf28fc7d9;p=gnus diff --git a/lisp/gnus-registry.el b/lisp/gnus-registry.el index 8aecc98ee..5989b8885 100644 --- a/lisp/gnus-registry.el +++ b/lisp/gnus-registry.el @@ -1,6 +1,6 @@ ;;; gnus-registry.el --- article registry for Gnus -;; Copyright (C) 2002-2012 Free Software Foundation, Inc. +;; Copyright (C) 2002-2014 Free Software Foundation, Inc. ;; Author: Ted Zlatanov ;; Keywords: news registry @@ -87,6 +87,12 @@ (require 'easymenu) (require 'registry) +;; Silence XEmacs byte compiler, which will otherwise complain about +;; call to `eieio-persistent-read'. +(when (featurep 'xemacs) + (byte-compiler-options + (warnings (- callargs)))) + (defvar gnus-adaptive-word-syntax-table) (defvar gnus-registry-dirty t @@ -296,8 +302,14 @@ This is not required after changing `gnus-registry-cache-file'." (condition-case nil (progn (gnus-message 5 "Reading Gnus registry from %s..." file) - (setq gnus-registry-db (gnus-registry-fixup-registry - (eieio-persistent-read file))) + (setq gnus-registry-db + (gnus-registry-fixup-registry + (condition-case nil + (with-no-warnings + (eieio-persistent-read file 'registry-db)) + ;; Older EIEIO versions do not check the class name. + ('wrong-number-of-arguments + (eieio-persistent-read file))))) (gnus-message 5 "Reading Gnus registry from %s...done" file)) (error (gnus-message @@ -982,7 +994,7 @@ only the last one's marks are returned." (let* ((article (last articles)) (id (gnus-registry-fetch-message-id-fast article)) (marks (when id (gnus-registry-get-id-key id 'mark)))) - (when (interactive-p) + (when (gmm-called-interactively-p 'any) (gnus-message 1 "Marks are %S" marks)) marks)) @@ -1169,9 +1181,33 @@ data stored in the registry." ;; Try to activate the group. If that fails, just move ;; along. We may have more groups to work with - (ignore-errors - (gnus-select-group-with-message-id group message-id)) - (throw 'found t))))))) + (when + (ignore-errors + (gnus-select-group-with-message-id group message-id) t) + (throw 'found t)))))))) + +(defun gnus-registry-remove-extra-data (extra) + "Remove tracked EXTRA data from the gnus registry. +EXTRA is a list of symbols. Valid symbols are those contained in +the docs of `gnus-registry-track-extra'. This command is useful +when you stop tracking some extra data and now want to purge it +from your existing entries." + (interactive (list (mapcar 'intern + (completing-read-multiple + "Extra data: " + '("subject" "sender" "recipient"))))) + (when extra + (let ((db gnus-registry-db)) + (registry-reindex db) + (loop for k being the hash-keys of (oref db :data) + using (hash-value v) + do (let ((newv (delq nil (mapcar #'(lambda (entry) + (unless (member (car entry) extra) + entry)) + v)))) + (registry-delete db (list k) nil) + (gnus-registry-insert db k newv))) + (registry-reindex db)))) ;; TODO: a few things