From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/65138 Path: news.gmane.org!not-for-mail From: Katsumi Yamaoka Newsgroups: gmane.emacs.gnus.general Subject: Re: Wrong customize type for the "Extra" score entry Date: Wed, 05 Sep 2007 18:52:58 +0900 Organization: Emacsen advocacy group Message-ID: References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: sea.gmane.org 1188986087 7814 80.91.229.12 (5 Sep 2007 09:54:47 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Wed, 5 Sep 2007 09:54:47 +0000 (UTC) Cc: ding@gnus.org To: Andreas Schwab Original-X-From: ding-owner+M13651@lists.math.uh.edu Wed Sep 05 11:54:47 2007 Return-path: Envelope-to: ding-account@gmane.org Original-Received: from util0.math.uh.edu ([129.7.128.18]) by lo.gmane.org with esmtp (Exim 4.50) id 1ISrat-0004kD-Ux for ding-account@gmane.org; Wed, 05 Sep 2007 11:54:44 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.math.uh.edu) by util0.math.uh.edu with smtp (Exim 4.63) (envelope-from ) id 1ISrZy-0008QL-J8; Wed, 05 Sep 2007 04:53:46 -0500 Original-Received: from mx2.math.uh.edu ([129.7.128.33]) by util0.math.uh.edu with esmtps (TLSv1:AES256-SHA:256) (Exim 4.63) (envelope-from ) id 1ISrZw-0008Q2-RF for ding@lists.math.uh.edu; Wed, 05 Sep 2007 04:53:44 -0500 Original-Received: from quimby.gnus.org ([80.91.231.51]) by mx2.math.uh.edu with esmtp (Exim 4.67) (envelope-from ) id 1ISrZs-00088X-M3 for ding@lists.math.uh.edu; Wed, 05 Sep 2007 04:53:44 -0500 Original-Received: from orlando.hostforweb.net ([216.246.45.90]) by quimby.gnus.org with esmtp (Exim 3.35 #1 (Debian)) id 1ISrZr-0006iS-00 for ; Wed, 05 Sep 2007 11:53:39 +0200 Original-Received: from [66.225.201.151] (port=56586 helo=mail.jpl.org) by orlando.hostforweb.net with esmtpa (Exim 4.66) (envelope-from ) id 1ISrZF-0007Oq-K8; Wed, 05 Sep 2007 04:53:01 -0500 X-Hashcash: 1:20:070905:schwab@suse.de::Vocg+xb9ASC4Bg42:0001zCo X-Hashcash: 1:20:070905:ding@gnus.org::w+sssoRGsd7matf4:00005vIE X-Face: #kKnN,xUnmKia.'[pp`;Omh}odZK)?7wQSl"4o04=EixTF+V[""w~iNbM9ZL+.b*_CxUmFk B#Fu[*?MZZH@IkN:!"\w%I_zt>[$nm7nQosZ<3eu;B:$Q_:p!',P.c0-_Cy[dz4oIpw0ESA^D*1Lw= L&i*6&( User-Agent: Gnus/5.110007 (No Gnus v0.7) Emacs/23.0.50 (gnu/linux) Cancel-Lock: sha1:obY4TiJrlhqvPjDq7VrFeKuTaYY= X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - orlando.hostforweb.net X-AntiAbuse: Original Domain - gnus.org X-AntiAbuse: Originator/Caller UID/GID - [0 0] / [47 12] X-AntiAbuse: Sender Address Domain - jpl.org X-Source: X-Source-Args: X-Source-Dir: X-Spam-Score: -2.4 (--) List-ID: Precedence: bulk Xref: news.gmane.org gmane.emacs.gnus.general:65138 Archived-At: --=-=-= >>>>> Andreas Schwab wrote: > The score rule for extra headers is a five element element list (the > fifth being the actual extra header to match against), unlike the other > string keys. But the customize type for the "Extra" entry is the same > (gnus-score-string) as for the other keys, thus it will not match, and > you cannot enter such a score entry via customize, and any existing > entry is presented as a lisp expression. I've installed a fix in the Gnus trunk and the v5-10 branch. Here's a patch for No Gnus 0.6 that you use: --=-=-= Content-Type: text/x-patch Content-Disposition: attachment --- gnus-cus.el~ 2007-01-24 07:15:37 +0000 +++ gnus-cus.el 2007-09-05 09:47:02 +0000 @@ -766,6 +766,67 @@ ,group)))) widget) +(define-widget 'gnus-score-extra 'group + "Edit score entries for extra headers." + :convert-widget 'gnus-score-extra-convert) + +(defun gnus-score-extra-convert (widget) + ;; Set args appropriately. + (let* ((tag (widget-get widget :tag)) + (item `(const :format "" :value ,(downcase tag))) + (match '(string :tag "Match")) + (score '(choice :tag "Score" + (const :tag "default" nil) + (integer :format "%v" + :hide-front-space t))) + (expire '(choice :tag "Expire" + (const :tag "off" nil) + (integer :format "%v" + :hide-front-space t))) + (type '(choice :tag "Type" + :value s + ;; I should really create a forgiving :match + ;; function for each type below, that only + ;; looked at the first letter. + (const :tag "Regexp" r) + (const :tag "Regexp (fixed case)" R) + (const :tag "Substring" s) + (const :tag "Substring (fixed case)" S) + (const :tag "Exact" e) + (const :tag "Exact (fixed case)" E) + (const :tag "Word" w) + (const :tag "Word (fixed case)" W) + (const :tag "default" nil))) + (header (if gnus-extra-headers + (let (name) + `(choice :tag "Header" + ,@(mapcar (lambda (h) + (setq name (symbol-name h)) + (list 'const :tag name name)) + gnus-extra-headers) + (string :tag "Other" :format "%v"))) + '(string :tag "Header"))) + (group `(group ,match ,score ,expire ,type ,header)) + (doc (concat (or (widget-get widget :doc) + (concat "Change score based on the " tag + " header.\n"))))) + (widget-put + widget :args + `(,item + (repeat :inline t + :indent 0 + :tag ,tag + :doc ,doc + :format "%t:\n%h%v%i\n\n" + (choice :format "%v" + :value ("" nil nil s + ,(if gnus-extra-headers + (symbol-name (car gnus-extra-headers)) + "")) + ,group + sexp))))) + widget) + (defvar gnus-custom-scores) (defvar gnus-custom-score-alist) @@ -822,7 +883,7 @@ (gnus-score-string :tag "Subject") (gnus-score-string :tag "References") (gnus-score-string :tag "Xref") - (gnus-score-string :tag "Extra") + (gnus-score-extra :tag "Extra") (gnus-score-string :tag "Message-ID") (gnus-score-integer :tag "Lines") (gnus-score-integer :tag "Chars") --=-=-=--