From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/58279 Path: main.gmane.org!not-for-mail From: Jonas Steverud Newsgroups: gmane.emacs.gnus.general Subject: Re: Adulterate summary lines Date: Tue, 17 Aug 2004 09:41:10 +0200 Organization: The Deciples of Albericht Nibelungen Sender: ding-owner@lists.math.uh.edu Message-ID: References: NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1092728602 10058 80.91.224.253 (17 Aug 2004 07:43:22 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 17 Aug 2004 07:43:22 +0000 (UTC) Original-X-From: ding-owner+M6820@lists.math.uh.edu Tue Aug 17 09:43:11 2004 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 1Bwych-0006Tb-00 for ; Tue, 17 Aug 2004 09:43:11 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.math.uh.edu ident=lists) by malifon.math.uh.edu with smtp (Exim 3.20 #1) id 1Bwyaw-0007h0-00; Tue, 17 Aug 2004 02:41:22 -0500 Original-Received: from util2.math.uh.edu ([129.7.128.23]) by malifon.math.uh.edu with esmtp (Exim 3.20 #1) id 1Bwyan-0007gs-00 for ding@lists.math.uh.edu; Tue, 17 Aug 2004 02:41:13 -0500 Original-Received: from justine.libertine.org ([66.139.78.221] ident=postfix) by util2.math.uh.edu with esmtp (Exim 4.30) id 1Bwyam-0002XM-P4 for ding@lists.math.uh.edu; Tue, 17 Aug 2004 02:41:12 -0500 Original-Received: from mxfep02.bredband.com (mxfep02.bredband.com [195.54.107.73]) by justine.libertine.org (Postfix) with ESMTP id 1173D3A003A for ; Tue, 17 Aug 2004 02:41:06 -0500 (CDT) Original-Received: from c-ed5372d5.036-4-67626721.cust.bredbandsbolaget.se.bredband.net ([213.114.83.205] [213.114.83.205]) by mxfep02.bredband.com with ESMTP id <20040817074105.LKVF345.mxfep02.bredband.com@c-ed5372d5.036-4-67626721.cust.bredbandsbolaget.se.bredband.net> for ; Tue, 17 Aug 2004 09:41:05 +0200 Original-To: ding@gnus.org Mail-Copies-To: never In-Reply-To: (Harry Putnam's message of "Mon, 16 Aug 2004 20:14:07 -0500") User-Agent: Gnus/5.110002 (No Gnus v0.2) Emacs/21.3 (darwin) Precedence: bulk Xref: main.gmane.org gmane.emacs.gnus.general:58279 X-Report-Spam: http://spam.gmane.org/gmane.emacs.gnus.general:58279 Harry Putnam writes: > Jonas Steverud writes: [...] > I don't see the stuff you posted as a result of your function. What I > see is a summary buffer that looks like: I didn't document/comment sufficiently, sorry. > ? [ 59: test] Adulterate summary lines > RA [ 90: test] > R [ 28: test] Gnus for information storage (Was: Adulterate summary lines) > > Line one is my post, line 2 is your answer and line 3 is another > message from you about using gnus as info storage tool. > > I have not the slightest clue how or what is coding this. > > It would be handy if you provided some notes as to what is doing what. > (defun gnus-user-format-function-x (STR) > (message (prin1-to-string STR)) > "test") What is happening is that when Gnus encounter %u it concatenates "gnus-user-format-function-" with the letter following %u, in our example it is %ux, i.e. gnus-user-format-function-x is called. So far so good. According to the docs, as you have pointed out, something is sent to the function - and I wanted to find out what it was. prin1-to-string takes a lisp symbol/expression and converts it to a string and the message function takes whatever arguments it gets and puts it in the *Messages* buffer. This is so I can get a debug printout, similar to a printf() in a C program. It turns out that what is sent to the gnus-user-format-function-x function is a vector of a number of the values of the headers in the message. I do not know which value is which header except one can deduce which value is the subject, from and the date. But there are a number of helper functions, e.g. mail-header-date returns the date field. Since the result of gnus-user-format-function-x should be a string and that string is inserted in the *Summary* buffer I added a dummy result "test" to make sure that it returned a string and that my *Summary* buffer wasn't bogged down with very long strings - IIRC message returns its argument and if the message function call was the last in the function, it might return a very long string indeed depending on which arguments was passed to gnus-user-format-function-x. > As I posted to start the manual says "function would be passed the > current header" > > What header is being passed? The values/fields of the header in the current message. That is not header as in "the Date header" but as in "the header of the message". In my example this was passed to gnus-user-format-function-x as a vector (i.e. what ended up in the *Messages* buffer): [1841 "Adulterate summary lines" "Harry Putnam " "Mon, 16 Aug 2004 06:12:31 -0500" "" "" 4863 59 "c-ed5372d5.036-4-67626721.cust.bredbandsbolaget.se Ding:1841" ((To . "ding@gnus.org") (User-Agent . "Gnus/5.110003 (No Gnus v0.3) Emacs/21.3.50 (gnu/linux)"))] My guess is that it is the value of all the header fields that you has deemed interesting, i.e. the headers that ends up in the *Article* buffer when you read the message. In my case I have added a couple of extra headers (e.g. To) to my gnus-extra-headers, which ends up in the alist at the end of the vector. I have assumed that you are an experienced Emacs Lisp/Gnus programmer, the "homeboy indexing system" made me think this was the case. In case I'm mistaken I can easily elaborate more on my code. :-) -- ( http://hem.bredband.net/steverud/ ! Wei Wu Wei ) ( Meaning of U2 Lyrics, Roleplaying ! To Do Without Do )