From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Sebastien Vauban" Subject: Re: Trying to use a custom face for highlighting tags used in agenda filtering Date: Thu, 27 Oct 2011 23:20:19 +0200 Message-ID: <801utyrv1o.fsf@somewhere.org> References: <80pqhjpkoy.fsf@somewhere.org> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Return-path: 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-mXXj517/zsQ@public.gmane.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org-mXXj517/zsQ@public.gmane.org To: emacs-orgmode-mXXj517/zsQ@public.gmane.org --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Hello, Please find a (very useful=C2=A0;-)) patch for highlighting (in the mode-li= ne) the tags which are used to filter the agenda. I'd like even to be able to put in one color the "positive" tags and in another the "negative" ones, but that's above my current knowledge of text-properties... Anyway, here is a usable first version -- where all tags are in the same color, much more easily to spot (before you wonder why you have so few lines in your agenda!). Best regards, Seb --=20 Sebastien Vauban --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0002-Add-custom-face-for-highlighting-tags-used-in-agenda.patch >From 9492f3a5defeae992685d90e187ceb441c2ebea1 Mon Sep 17 00:00:00 2001 From: Sebastien Vauban Date: Thu, 27 Oct 2011 23:08:04 +0200 Subject: [PATCH 2/2] Add custom face for highlighting tags used in agenda filtering. --- lisp/org-agenda.el | 17 ++++++++++++----- lisp/org-faces.el | 7 +++++++ 2 files changed, 19 insertions(+), 5 deletions(-) diff --git a/lisp/org-agenda.el b/lisp/org-agenda.el index 66686f9..fe26b11 100644 --- a/lisp/org-agenda.el +++ b/lisp/org-agenda.el @@ -6761,13 +6761,20 @@ When called with a prefix argument, include all archive files as well." ((eq org-agenda-show-log 'clockcheck) " ClkCk") (org-agenda-show-log " Log") (t "")) + ;; show tags used for filtering in a custom face (if (or org-agenda-filter (get 'org-agenda-filter :preset-filter)) - (concat " {" (mapconcat - 'identity - (append (get 'org-agenda-filter - :preset-filter) - org-agenda-filter) "") "}") + '(:eval (propertize + (concat " {" + (mapconcat + 'identity + (append + (get 'org-agenda-filter :preset-filter) + org-agenda-filter) + "") + "}") + 'face 'org-agenda-filter-tags + 'help-echo "Tags used in filtering")) "") (if org-agenda-archives-mode (if (eq org-agenda-archives-mode t) diff --git a/lisp/org-faces.el b/lisp/org-faces.el index aac82c9..519c858 100644 --- a/lisp/org-faces.el +++ b/lisp/org-faces.el @@ -672,6 +672,13 @@ month and 365.24 days for a year)." "Face for showing the agenda restriction lock." :group 'org-faces) +(defface org-agenda-filter-tags + (org-compatible-face nil + '((((background light)) (:foreground "orange")) + (((background dark)) (:foreground "orange")))) + "Face for showing the tags (in the mode-line) which are used in the agenda filtering." + :group 'org-faces) + (defface org-time-grid ;; originally copied from font-lock-variable-name-face (org-compatible-face nil '((((class color) (min-colors 16) (background light)) (:foreground "DarkGoldenrod")) -- 1.7.5.1 --=-=-= Content-Type: application/octet-stream Content-Disposition: attachment; filename=ChangeLog Content-Transfer-Encoding: base64 MjAxMS0xMC0yNyAgU2ViIFZhdWJhbiAgPHN2YUBteWdvb2dsZXN0LmNvbT4KCgkqIG9yZy1hZ2Vu ZGEuZWwgKG9yZy1hZ2VuZGEtc2V0LW1vZGUtbmFtZSk6IEhpZ2hsaWdodCB0YWdzCgl1c2VkIGZv ciBmaWx0ZXJpbmcgKHNob3duIGluIHRoZSBtb2RlLWxpbmUpLgoKCSogb3JnLWZhY2VzLmVsOiBB ZGQgZmFjZSBgb3JnLWFnZW5kYS1maWx0ZXItdGFncycuCgo= --=-=-=--