info-gnus-english
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: know perl for gnus-user-format-function-X but not lisp


From: Reiner Steib
Subject: Re: know perl for gnus-user-format-function-X but not lisp
Date: Fri, 22 Oct 2004 14:55:06 +0200
User-agent: Gnus/5.110003 (No Gnus v0.3) Emacs/21.3 (gnu/linux)

On Fri, Oct 22 2004, Dan Jacobson wrote:

> You see I want to do as I say in the comment:
> (setq
>  gnus-summary-line-format
>  (concat
>   "%U%R%z%I%(%t|%~(cut-left 3)d%~(max-right 2)d%4L|%-20,20f%)"
>   "%~(max-right 1)~(form(gnus-extra-header 'X-NOFFLE-Status))@:%s\n"))
>  ;I want to use (perl) regexp s/(\w)\w* */$1/g above to get the first
>  ;letter of each of the items on the X-NOFFLE-Status line, but don't know
>  ;how in gnus, so we just get the first letter.
>
> There is no example on gnus Info node 8.4.4 User-Defined Specs.

You may find some example code for the summary format line in[1].

For noffle a format function may look like this (not tested, I don't
know noffle):

(defun gnus-user-format-function-noffle (header)
  "Display noffle status in summary line.
You need to add `X-NOFFLE-Status' to `nnmail-extra-headers' and
`gnus-extra-headers', see Info node `(gnus)To From Newsgroups'."
  (let ((case-fold-search t)
        (val (or (cdr (assq 'X-NOFFLE-Status (mail-header-extra header)))
                 "unknown")))
    (gnus-replace-in-string val "^\\(\\w\\).*$" "\\1")))

Then you can use %u&noffle; in `gnus-summary-line-format'.

See the node on regular expressions in the Elisp manual on how to
adjust the regexps.

Bye, Reiner.

[1] http://theotp1.physik.uni-ulm.de/~ste/comp/emacs/gnus/rs-gnus-summary.el
    Note that the file is UTF-8 although the server says it's Latin-1.
-- 
       ,,,
      (o o)
---ooO-(_)-Ooo---  |  PGP key available  |  http://rsteib.home.pages.de/


reply via email to

[Prev in Thread] Current Thread [Next in Thread]