X-Git-Url: http://git.hcoop.net/bpt/emacs.git/blobdiff_plain/d2fc7e3d0f6f57f962cbd94df3bf4fd15a37bb68..ed7f1a6c5caaf4159125c08db5d18c5471fdd032:/lisp/gnus/gnus-registry.el diff --git a/lisp/gnus/gnus-registry.el b/lisp/gnus/gnus-registry.el index 02e4ce7e2e..e0efbaf4f3 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 @@ -244,6 +254,8 @@ the Bit Bucket." (oset db :max-hard (or gnus-registry-max-entries most-positive-fixnum)) + (oset db :prune-factor + 0.1) (oset db :max-soft (or gnus-registry-max-pruned-entries most-positive-fixnum)) @@ -885,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."