Gnus development mailing list
 help / color / mirror / Atom feed
From: Reiner Steib <reinersteib+gmane@imap.cc>
Subject: Re: set labels in nnml or nnfolder groups
Date: Mon, 06 Feb 2006 14:22:27 +0100	[thread overview]
Message-ID: <v9lkwofwq4.fsf@marauder.physik.uni-ulm.de> (raw)
In-Reply-To: <877j88zq93.fsf@mat.ucm.es>

On Mon, Feb 06 2006, Uwe Brauer wrote:

> A while ago I asked whether it is posible to set labels in nnimap
> groups and the answer was, not yet. 
>
> Now I cannot find in the manual anything about labels in (local)
> groups such that nnml and nnfolder.
>
> By label I understand things like
> IM (important)
> NR (need reply)

Below is a *draft* version to display the content of an X-Gnus-Label
header by adding "%4u&label;" in `gnus-summary-line-format'.  What is
missing is a command to add labels without manually editing the
article.

--8<---------------cut here---------------start------------->8---
;; Related URLs:
;; http://thread.gmane.org/m2n05mr2iv.fsf%40catbert.dok.org
;; http://www.fas.harvard.edu/computing/kb/kb1059.html
;; http://ilias.ca/blog/2005/09/gmail-labels-in-thunderbird.html

(defcustom rs-gnus-summary-line-label-alist
  '(("Important" "Im")
    ("Work" "Wo")
    ("Personal" "Pe")
    ("To do" "TD")
    ("Later" "La")
    ("Need reply" "NR"))
  "Alist of regular expressions and summary line indicators."
  :group 'gnus-summary-format
  :type '(repeat (list (regexp :tag "Regexp")
		       (string :tag "Indicator"))))

;;;###autoload
(defun rs-gnus-summary-line-label (header)
  "Display label of message in summary line.

This function is intended to be used in `gnus-summary-line-format-alist', with
\(defalias 'gnus-user-format-function-X 'rs-gnus-summary-line-label).
See (info \"(gnus)Group Line Specification\").

You need to add `X-Gnus-Label' to `nnmail-extra-headers' and
`gnus-extra-headers', see Info node `(gnus)To From Newsgroups'."
  (let ((case-fold-search t)
	(label (or (cdr (assq 'X-Gnus-Label (mail-header-extra header)))
		   ""))
	indicator)
    (mapc (lambda (el)
	    (when (string-match (car el) label)
	      (setq indicator (cadr el))))
	  rs-gnus-summary-line-label-alist)
    (if indicator
	indicator
      label)))

;;;###autoload
(defun rs-gnus-summary-limit-to-label (regexp &optional not-matching)
  "Limit the summary buffer to articles that match a label."
  (interactive
   (list (read-string
	  (format "%s label (regexp): "
		  (if current-prefix-arg "Exclude" "Limit to")))
	 current-prefix-arg))
  (gnus-summary-limit-to-extra 'X-Gnus-Label regexp not-matching))

(defalias 'gnus-user-format-function-label 'rs-gnus-summary-line-label)
--8<---------------cut here---------------end--------------->8---

Bye, Reiner.
-- 
       ,,,
      (o o)
---ooO-(_)-Ooo---  |  PGP key available  |  http://rsteib.home.pages.de/




  reply	other threads:[~2006-02-06 13:22 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-02-06 11:22 Uwe Brauer
2006-02-06 13:22 ` Reiner Steib [this message]
2006-02-06 14:37   ` Uwe Brauer
2006-02-06 15:09   ` mozilla (was: set labels in nnml or nnfolder groups) Uwe Brauer
2006-02-06 19:06     ` mozilla Ted Zlatanov
2006-02-07 12:25       ` mozilla Uwe Brauer
2006-02-07 15:41         ` mozilla Ted Zlatanov
2006-02-07 17:54           ` mozilla Uwe Brauer
2006-02-07 19:11             ` nnimap: editing articles (was: mozilla) Reiner Steib
2006-02-08 20:11               ` nnimap: editing articles Ted Zlatanov
2006-02-09 15:23                 ` Reiner Steib
2006-02-11 22:01               ` Simon Josefsson
2006-02-13 19:24                 ` Ted Zlatanov
2006-02-13 20:06                   ` Simon Josefsson
2006-02-13 22:22                   ` Steven E. Harris
2006-02-07 12:27       ` mozilla Uwe Brauer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=v9lkwofwq4.fsf@marauder.physik.uni-ulm.de \
    --to=reinersteib+gmane@imap.cc \
    --cc=Reiner.Steib@gmx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).