* gnus-registry.el (gnus-registry-user-format-function-M): Added
authorTeodor Zlatanov <tzz@lifelogs.com>
Tue, 4 Mar 2008 22:35:59 +0000 (22:35 +0000)
committerTeodor Zlatanov <tzz@lifelogs.com>
Tue, 4 Mar 2008 22:35:59 +0000 (22:35 +0000)
formatting function.

lisp/ChangeLog
lisp/gnus-registry.el

index ee37e01..5fb2212 100644 (file)
@@ -1,3 +1,8 @@
+2008-03-04  Teodor Zlatanov  <tzz@lifelogs.com>
+
+       * gnus-registry.el (gnus-registry-user-format-function-M): Added
+       formatting function.
+
 2008-03-03  Teodor Zlatanov  <tzz@lifelogs.com>
 
        * gnus-registry.el (gnus-registry-marks): Changed format to be nicer
index 241b18b..b1f8a36 100644 (file)
@@ -771,6 +771,23 @@ Uses `gnus-registry-marks' to find what shortcuts to install."
     "t" gnus-registry-set-article-To-Do-mark
     "T" gnus-registry-remove-article-To-Do-mark))
 
+;;; use like this:
+;;; (defalias 'gnus-user-format-function-M 'gnus-registry-user-format-function-M)
+(defun gnus-registry-user-format-function-M (headers)
+  (let* ((id (mail-header-message-id headers))
+        (marks (when id (gnus-registry-fetch-extra-marks id)))
+        (out ""))
+    (dolist (mark marks)
+      (let ((c (plist-get
+               (cdr-safe
+                (assoc mark gnus-registry-marks)) :char)))
+       (setq out (format "%s%s"
+                         out
+                         (if c
+                             (char-to-string c)
+                           "")))))
+      out))
+
 (defun gnus-registry-read-mark ()
   "Read a mark name from the user with completion."
   (let ((mark (gnus-completing-read-with-default