From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thomas Morgan Subject: Abbreviating filtered tags in mode line Date: Wed, 14 May 2014 02:24:45 -0400 Message-ID: <87k39o27yq.fsf@algol.ziiuu.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:51669) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WkSca-0003Lk-EU for emacs-orgmode@gnu.org; Wed, 14 May 2014 02:25:02 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WkScU-0005xn-9O for emacs-orgmode@gnu.org; Wed, 14 May 2014 02:24:56 -0400 Received: from mail-qg0-f53.google.com ([209.85.192.53]:43572) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WkScU-0005xa-5P for emacs-orgmode@gnu.org; Wed, 14 May 2014 02:24:50 -0400 Received: by mail-qg0-f53.google.com with SMTP id f51so2091349qge.12 for ; Tue, 13 May 2014 23:24:48 -0700 (PDT) Received: from algol.ziiuu.com (cpe-68-173-37-126.nyc.res.rr.com. [68.173.37.126]) by mx.google.com with ESMTPSA id 60sm576205qgr.29.2014.05.13.23.24.46 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 13 May 2014 23:24:46 -0700 (PDT) List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org --=-=-= Content-Type: text/plain Dear Org-mode hackers, This patch defines a variable org-agenda-abbreviate-tag-filter; when it is set, filtered tags indicated on the mode line are abbreviated according to their fast selection letters. For example, "-@home+@net" is abbreviated "-h.+n." if the fast selection letters of @home and @net are h and n respectively. Best, Thomas --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=0001-Optionally-abbreviate-filtered-tags-in-mode-line.patch >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 --=-=-=--