From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/50920 Path: main.gmane.org!not-for-mail From: Kevin Greiner Newsgroups: gmane.emacs.gnus.general Subject: Re: trouble with gnus-define-group-parameter Date: Wed, 19 Mar 2003 22:11:59 -0600 Sender: owner-ding@hpc.uh.edu Message-ID: References: <4nwuj7krtf.fsf@lockgroove.bwh.harvard.edu> <4nsmtjq84q.fsf@lockgroove.bwh.harvard.edu> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: main.gmane.org 1048133609 28979 80.91.224.249 (20 Mar 2003 04:13:29 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Thu, 20 Mar 2003 04:13:29 +0000 (UTC) Original-X-From: owner-ding@hpc.uh.edu Thu Mar 20 05:13:26 2003 Return-path: Original-Received: from malifon.math.uh.edu ([129.7.128.13]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 18vrQk-0007Ws-00 for ; Thu, 20 Mar 2003 05:13:26 +0100 Original-Received: from sina.hpc.uh.edu ([129.7.128.10] ident=lists) by malifon.math.uh.edu with esmtp (Exim 3.20 #1) id 18vrPn-0002ss-00; Wed, 19 Mar 2003 22:12:27 -0600 Original-Received: by sina.hpc.uh.edu (TLB v0.09a (1.20 tibbs 1996/10/09 22:03:07)); Wed, 19 Mar 2003 22:13:29 -0600 (CST) Original-Received: from sclp3.sclp.com (sclp3.sclp.com [66.230.238.2]) by sina.hpc.uh.edu (8.9.3/8.9.3) with SMTP id WAA13146 for ; Wed, 19 Mar 2003 22:13:16 -0600 (CST) Original-Received: (qmail 78687 invoked by alias); 20 Mar 2003 04:12:10 -0000 Original-Received: (qmail 78682 invoked from network); 20 Mar 2003 04:12:10 -0000 Original-Received: from quimby.gnus.org (80.91.224.244) by 66.230.238.6 with SMTP; 20 Mar 2003 04:12:10 -0000 Original-Received: from news by quimby.gnus.org with local (Exim 3.12 #1 (Debian)) id 18vrQT-0005LG-00 for ; Thu, 20 Mar 2003 05:13:09 +0100 Original-To: ding@gnus.org Original-Path: not-for-mail Original-Newsgroups: gnus.ding Original-Lines: 65 Original-NNTP-Posting-Host: 216.12.206.45 Original-X-Trace: quimby.gnus.org 1048133589 20188 216.12.206.45 (20 Mar 2003 04:13:09 GMT) Original-X-Complaints-To: usenet@quimby.gnus.org Original-NNTP-Posting-Date: 20 Mar 2003 04:13:09 GMT User-Agent: Gnus/5.090017 (Oort Gnus v0.17) Emacs/21.2 (windows-nt) Cancel-Lock: sha1:6ut2mW1ECAZ/Iqw0uQtVhpRXlyk= Precedence: list X-Majordomo: 1.94.jlt7 Xref: main.gmane.org gmane.emacs.gnus.general:50920 X-Report-Spam: http://spam.gmane.org/gmane.emacs.gnus.general:50920 Ted Zlatanov writes: > On Tue, 11 Mar 2003, kgreiner@xpediantsolutions.com wrote: >> Not really. The gnus-define-group-parameter macro expanded to >> include this definition for ham-marks. Perhaps you can eval it then >> step through it with the debugger. >> >> (defun gnus-parameter-ham-marks (name) >> "" >> (and name >> (or (gnus-group-find-parameter name (quote ham-marks) nil) >> (let ((alist gnus-parameter-ham-marks-alist) elem value) >> (while (setq elem (pop alist)) >> (when (and name (string-match (car elem) name)) >> (setq alist nil value (cdr elem)))) >> (if (consp value) >> (car value) >> value))))) > > Out of curiosity, how did you obtain this macro expansion? Well, I'm sure that there is a better way but... I eval'd this: (progn (debug) (gnus-define-group-parameter ham-marks :parameter-type '(choice :tag "Ham marks" :value nil (list :tag "Ham mark choices" (set (variable-item gnus-del-mark) (variable-item gnus-read-mark) (variable-item gnus-killed-mark) (variable-item gnus-kill-file-mark) (variable-item gnus-low-score-mark)))) :parameter-document "Marks considered ham (positively not spam). Such articles will be processed as ham (non-spam) on group exit. When nil, the global spam-ham-marks variable takes precedence.")) If you step over the macro expansion, you see a return value that is the expanded form. Normally, that gets executed so it is hidden. Since you're in the debugger, you can cut-and-paste it to another buffer for detailed reflection. > The problem is this line: > >> (or (gnus-group-find-parameter name (quote ham-marks) nil) > > The allow-list parameter is nil. When it's t, I get the parameter > correctly. I was not setting the :type parameter to 'list. But it > had worked just fine for all my previous parameter definitions. > Puzzling. > > I think I have things working, I'll do a commit with the fixed and > revised code. Glad to see it working. Kevin