From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/54192 Path: main.gmane.org!not-for-mail From: Ted Zlatanov Newsgroups: gmane.emacs.gnus.general Subject: Re: loading spam.el and gnus-registry.el with set variables only Date: Thu, 09 Oct 2003 14:00:43 -0400 Organization: =?koi8-r?q?=F4=C5=CF=C4=CF=D2=20=FA=CC=C1=D4=C1=CE=CF=D7?= @ Cienfuegos Sender: ding-owner@lists.math.uh.edu Message-ID: <4n8ynutho4.fsf@lockgroove.bwh.harvard.edu> References: <4ny8vwnb04.fsf@lockgroove.bwh.harvard.edu> <4nbrsqzd41.fsf@lockgroove.bwh.harvard.edu> NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: sea.gmane.org 1065722555 15877 80.91.224.253 (9 Oct 2003 18:02:35 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Thu, 9 Oct 2003 18:02:35 +0000 (UTC) Original-X-From: ding-owner+M2733@lists.math.uh.edu Thu Oct 09 20:02:33 2003 Return-path: Original-Received: from malifon.math.uh.edu ([129.7.128.13]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1A7f7Q-0007e0-00 for ; Thu, 09 Oct 2003 20:02:33 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.math.uh.edu) by malifon.math.uh.edu with smtp (Exim 3.20 #1) id 1A7f6H-0004Dn-00; Thu, 09 Oct 2003 13:01:21 -0500 Original-Received: from justine.libertine.org ([66.139.78.221]) by malifon.math.uh.edu with esmtp (Exim 3.20 #1) id 1A7f69-0004Dh-00 for ding@lists.math.uh.edu; Thu, 09 Oct 2003 13:01:13 -0500 Original-Received: from clifford.bwh.harvard.edu (clifford.bwh.harvard.edu [134.174.9.41]) by justine.libertine.org (Postfix) with ESMTP id 2CE6A3A004E for ; Thu, 9 Oct 2003 13:01:12 -0500 (CDT) Original-Received: from lockgroove.bwh.harvard.edu (lockgroove [134.174.9.133]) by clifford.bwh.harvard.edu (8.10.2+Sun/8.11.0) with ESMTP id h99I0v709930 for ; Thu, 9 Oct 2003 14:00:57 -0400 (EDT) Original-Received: (from tzz@localhost) by lockgroove.bwh.harvard.edu (8.11.6+Sun/8.11.0) id h99I0hM09017; Thu, 9 Oct 2003 14:00:43 -0400 (EDT) Original-To: ding@gnus.org X-Face: bd.DQ~'29fIs`T_%O%C\g%6jW)yi[zuz6;d4V0`@y-~$#3P_Ng{@m+e4o<4P'#(_GJQ%TT= D}[Ep*b!\e,fBZ'j_+#"Ps?s2!4H2-Y"sx" Mail-Followup-To: ding@gnus.org In-Reply-To: (Reiner Steib's message of "Thu, 09 Oct 2003 18:24:28 +0200") User-Agent: Gnus/5.1003 (Gnus v5.10.3) Emacs/21.3.50 (usg-unix-v) Precedence: bulk Xref: main.gmane.org gmane.emacs.gnus.general:54192 X-Report-Spam: http://spam.gmane.org/gmane.emacs.gnus.general:54192 --=-=-= On Thu, 09 Oct 2003, 4.uce.03.r.s@nurfuerspam.de wrote: > The importance of the order seems quite fragile to me, isn't it? Definitely, that's why I'd like to make it simpler and more robust. > I'd use functions, say `gnus-registry-initialize' and > `spam-initialize' (or -install?) and autoload those functions: Excellent, I don't know why I didn't think of something so obvious. Thanks a lot, Reiner! Let me know if the attached patch looks OK. Ted --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=autoloading-registry-and-spam.patch ? autoloading-registry-and-spam.patch Index: gnus-registry.el =================================================================== RCS file: /usr/local/cvsroot/gnus/lisp/gnus-registry.el,v retrieving revision 6.33 diff -u -r6.33 gnus-registry.el --- gnus-registry.el 8 Sep 2003 18:25:57 -0000 6.33 +++ gnus-registry.el 9 Oct 2003 18:00:31 -0000 @@ -569,6 +569,14 @@ (setq gnus-registry-hashtb (alist-to-hashtable gnus-registry-alist)) (setq gnus-registry-dirty t)) +;;;###autoload +(defun gnus-registry-initialize () + (interactive) + (setq gnus-registry-install t) + (gnus-registry-install-hooks) + (gnus-registry-read)) + +;;;###autoload (defun gnus-registry-install-hooks () "Install the registry hooks." (interactive) Index: spam.el =================================================================== RCS file: /usr/local/cvsroot/gnus/lisp/spam.el,v retrieving revision 6.116 diff -u -r6.116 spam.el --- spam.el 3 Oct 2003 18:58:33 -0000 6.116 +++ spam.el 9 Oct 2003 18:00:32 -0000 @@ -370,13 +370,6 @@ "Msx" gnus-summary-mark-as-spam "\M-d" gnus-summary-mark-as-spam) -;;; How to highlight a spam summary line. - -;; TODO: How do we redo this every time spam-face is customized? - -(push '((eq mark gnus-spam-mark) . spam-face) - gnus-summary-highlight) - ;; convenience functions (defun spam-group-ham-mark-p (group mark &optional spam) (when (stringp group) @@ -1222,6 +1215,15 @@ nil)) ;;;; Hooks + +;;;###autoload +(defun spam-initialize () + (interactive) + (setq spam-install-hooks t) + (spam-install-hooks-function) + ;; TODO: How do we redo this every time spam-face is customized? + (push '((eq mark gnus-spam-mark) . spam-face) + gnus-summary-highlight)) ;;;###autoload (defun spam-install-hooks-function () --=-=-=--