From 3c12d4b5c6ad12d6f34fe34ecc94f7be54fe61b5 Mon Sep 17 00:00:00 2001 From: Thomas Morgan Date: Wed, 14 May 2014 01:54:17 -0400 Subject: [PATCH] Optionally abbreviate filtered tags in mode line. * lisp/org-agenda.el (org-agenda-abbreviate-tag-filter): New variable. (org-agenda-set-mode-name): Abbreviate tag filter if option is set. --- lisp/org-agenda.el | 25 ++++++++++++++++++++++--- 1 file changed, 22 insertions(+), 3 deletions(-) diff --git a/lisp/org-agenda.el b/lisp/org-agenda.el index 428d31f..69c3d38 100644 --- a/lisp/org-agenda.el +++ b/lisp/org-agenda.el @@ -236,6 +236,12 @@ you can \"misuse\" it to also add other text to the header." :group 'org-agenda :type 'boolean) +(defcustom org-agenda-abbreviate-tag-filter nil + "When set, abbreviate filtered tags indicated in mode line. +Tags are abbreviated with their fast selection letters, as configured." + :group 'org-agenda + :type 'boolean) + (defgroup org-agenda-custom-commands nil "Options concerning agenda views in Org-mode." :tag "Org Agenda Custom Commands" @@ -8227,9 +8233,22 @@ When called with a prefix argument, include all archive files as well." (concat " {" (mapconcat 'identity - (append - (get 'org-agenda-tag-filter :preset-filter) - org-agenda-tag-filter) + (mapcar + (lambda (f) + (if (and org-agenda-abbreviate-tag-filter + (string-match + "^\\([+-]\\)\\(.+\\)" f)) + (let* ((dir (match-string 1 f)) + (f0 (match-string 2 f)) + (alist org-tag-alist-for-agenda) + (a (assoc f0 alist))) + (if a + (format "%s%c." dir (cdr a)) + f)) + f)) + (append + (get 'org-agenda-tag-filter :preset-filter) + org-agenda-tag-filter)) "") "}") 'face 'org-agenda-filter-tags -- 1.7.10.4