From 627abcddd1c45a07d58b9c0cbfd6bb62caf256a9 Mon Sep 17 00:00:00 2001 From: Teodor Zlatanov Date: Wed, 18 May 2011 22:16:26 +0000 Subject: [PATCH] gnus.texi (Gnus Registry Setup): Rename from "Setup". (Store custom flags and keywords): Mention `gnus-registry-user-format-function-M' and `gnus-registry-user-format-function-M2'. gnus-registry.el (gnus-registry-user-format-function-M): Use `mapconcat'. (gnus-registry-user-format-function-M2): Use to see the full text of the marks. Make "," the mark text separator. --- doc/misc/ChangeLog | 7 +++++++ doc/misc/gnus.texi | 21 ++++++++++++++++++--- lisp/gnus/ChangeLog | 5 +++++ lisp/gnus/gnus-registry.el | 40 +++++++++++++++++++++++++++------------- 4 files changed, 57 insertions(+), 16 deletions(-) diff --git a/doc/misc/ChangeLog b/doc/misc/ChangeLog index 65dcdd80bca..917ebf0d675 100644 --- a/doc/misc/ChangeLog +++ b/doc/misc/ChangeLog @@ -1,3 +1,10 @@ +2011-05-18 Teodor Zlatanov + + * gnus.texi (Gnus Registry Setup): Rename from "Setup". + (Store custom flags and keywords): Mention + `gnus-registry-user-format-function-M' and + `gnus-registry-user-format-function-M2'. + 2011-05-17 Paul Eggert * texinfo.tex: Sync from gnulib, version 2011-05-11.16. diff --git a/doc/misc/gnus.texi b/doc/misc/gnus.texi index 931a9bedb39..a6b79237f08 100644 --- a/doc/misc/gnus.texi +++ b/doc/misc/gnus.texi @@ -25906,15 +25906,15 @@ of all messages matching a particular set of criteria. @end enumerate @menu -* Setup:: +* Gnus Registry Setup:: * Fancy splitting to parent:: * Registry Article Refer Method:: * Store custom flags and keywords:: * Store arbitrary data:: @end menu -@node Setup -@subsection Setup +@node Gnus Registry Setup +@subsection Gnus Registry Setup Fortunately, setting up the Gnus registry is pretty easy: @@ -26086,6 +26086,21 @@ Call this function to mark an article with a custom registry mark. It will offer the available marks for completion. @end defun +You can use @code{defalias} to install a summary line formatting +function that will show the registry marks. There are two flavors of +this function, either showing the marks as single characters, using +their @code{:char} property, or showing the marks as full strings. + +@lisp +;; show the marks as single characters (see the :char property in +;; `gnus-registry-marks'): +;; (defalias 'gnus-user-format-function-M 'gnus-registry-user-format-function-M) + +;; show the marks by name (see `gnus-registry-marks'): +;; (defalias 'gnus-user-format-function-M 'gnus-registry-user-format-function-M2) +@end lisp + + @node Store arbitrary data @subsection Store arbitrary data diff --git a/lisp/gnus/ChangeLog b/lisp/gnus/ChangeLog index bb70816f298..66f30f03eff 100644 --- a/lisp/gnus/ChangeLog +++ b/lisp/gnus/ChangeLog @@ -1,5 +1,10 @@ 2011-05-18 Teodor Zlatanov + * gnus-registry.el (gnus-registry-user-format-function-M): + Use `mapconcat'. + (gnus-registry-user-format-function-M2): Use to see the full text of + the marks. Make "," the mark text separator. + * nntp.el (nntp-send-authinfo): Use the "force" token for NNTP authentication with auth-source. diff --git a/lisp/gnus/gnus-registry.el b/lisp/gnus/gnus-registry.el index 25d84b11d41..e0efbaf4f30 100644 --- a/lisp/gnus/gnus-registry.el +++ b/lisp/gnus/gnus-registry.el @@ -57,6 +57,16 @@ ;; You should also consider using the nnregistry backend to look up ;; articles. See the Gnus manual for more information. +;; Finally, you can put %uM in your summary line format to show the +;; registry marks if you do this: + +;; show the marks as single characters (see the :char property in +;; `gnus-registry-marks'): +;; (defalias 'gnus-user-format-function-M 'gnus-registry-user-format-function-M) + +;; show the marks by name (see `gnus-registry-marks'): +;; (defalias 'gnus-user-format-function-M 'gnus-registry-user-format-function-M2) + ;; TODO: ;; - get the correct group on spool actions @@ -887,22 +897,26 @@ Uses `gnus-registry-marks' to find what shortcuts to install." nil (cons "Registry Marks" gnus-registry-misc-menus)))))) -;;; use like this: -;;; (defalias 'gnus-user-format-function-M -;;; 'gnus-registry-user-format-function-M) +;; use like this: +;; (defalias 'gnus-user-format-function-M 'gnus-registry-user-format-function-M) (defun gnus-registry-user-format-function-M (headers) + "Show the marks for an article by the :char property" + (let* ((id (mail-header-message-id headers)) + (marks (when id (gnus-registry-get-id-key id 'mark)))) + (mapconcat (lambda (mark) + (plist-get + (cdr-safe + (assoc mark gnus-registry-marks)) + :char)) + marks ""))) + +;; use like this: +;; (defalias 'gnus-user-format-function-M 'gnus-registry-user-format-function-M2) +(defun gnus-registry-user-format-function-M2 (headers) + "Show the marks for an article by name" (let* ((id (mail-header-message-id headers)) (marks (when id (gnus-registry-get-id-key id 'mark)))) - (apply 'concat (mapcar (lambda (mark) - (let ((c - (plist-get - (cdr-safe - (assoc mark gnus-registry-marks)) - :char))) - (if c - (list c) - nil))) - marks)))) + (mapconcat (lambda (mark) (symbol-name mark)) marks ","))) (defun gnus-registry-read-mark () "Read a mark name from the user with completion." -- 2.11.4.GIT