[gnus git] branch master updated: n0-17-47-ge315c59 =2= Gnus registry mark facility improvements. ; Update Gnus registry docs for gnus-registry-user-format-function-*.

Ted Zlatanov <[email protected]>
Newsgroups gmane.emacs.gnus.cvs
Message-ID <[email protected]>
       via  e315c595c678b5254c37612d6e0a939ba48ac664 (commit)
       via  62e1d66b863dc8fcc42f7b18e28a53f23f01f210 (commit)
      from  e7d2a85747a6d6c8079f2c544091fb94a312efb8 (commit)


- Log -----------------------------------------------------------------
commit e315c595c678b5254c37612d6e0a939ba48ac664
Author: Ted Zlatanov <[email protected]>
Date:   Wed May 18 15:41:21 2011 -0500

    Gnus registry mark facility improvements.
    
    * 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.

diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 7d6dffa..9ebcf3b 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,5 +1,9 @@
 2011-05-18  Teodor Zlatanov  <[email protected]>
 
+	* 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.
+
 	* nntp.el (nntp-send-authinfo): Use the "force" token for NNTP
 	authentication with auth-source.
 
diff --git a/lisp/gnus-registry.el b/lisp/gnus-registry.el
index 25d84b1..7d24168 100644
--- a/lisp/gnus-registry.el
+++ b/lisp/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))))
-    (apply 'concat (mapcar (lambda (mark)
-                             (let ((c
+    (mapconcat (lambda (mark)
                                     (plist-get
                                      (cdr-safe
                                       (assoc mark gnus-registry-marks))
-                                     :char)))
-                               (if c
-                                   (list c)
-                                 nil)))
-                           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))))
+    (mapconcat (lambda (mark) (symbol-name mark)) marks "")))
 
 (defun gnus-registry-read-mark ()
   "Read a mark name from the user with completion."

commit 62e1d66b863dc8fcc42f7b18e28a53f23f01f210
Author: Ted Zlatanov <[email protected]>
Date:   Wed May 18 15:39:39 2011 -0500

    Update Gnus registry docs for gnus-registry-user-format-function-*.
    
    * 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'.

diff --git a/texi/ChangeLog b/texi/ChangeLog
index b7986af..b0ea7fc 100644
--- a/texi/ChangeLog
+++ b/texi/ChangeLog
@@ -1,3 +1,10 @@
+2011-05-18  Teodor Zlatanov  <[email protected]>
+
+	* 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  Glenn Morris  <[email protected]>
 
 	* gnus.texi (Face): Fix typo.
diff --git a/texi/gnus.texi b/texi/gnus.texi
index 1f09f75..2068c24 100644
--- a/texi/gnus.texi
+++ b/texi/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
 

-----------------------------------------------------------------------
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we listed those
revisions in full, above.

Summary of changes:
 lisp/ChangeLog        |    4 ++++
 lisp/gnus-registry.el |   40 +++++++++++++++++++++++++++-------------
 texi/ChangeLog        |    7 +++++++
 texi/gnus.texi        |   21 ++++++++++++++++++---
 4 files changed, 56 insertions(+), 16 deletions(-)

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Gnus Project".

The branch, master has been updated


hooks/post-receive
-- 
Gnus Project
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.