From: "Sebastien Vauban" <wxhgmqzgwmuf-geNee64TY+gS+FvcfC7Uqw@public.gmane.org>
To: emacs-orgmode-mXXj517/zsQ@public.gmane.org
Subject: Re: Trying to use a custom face for highlighting tags used in agenda filtering
Date: Thu, 27 Oct 2011 23:20:19 +0200 [thread overview]
Message-ID: <801utyrv1o.fsf@somewhere.org> (raw)
In-Reply-To: 80pqhjpkoy.fsf@somewhere.org
[-- Attachment #1: Type: text/plain, Size: 521 bytes --]
Hello,
Please find a (very useful ;-)) patch for highlighting (in the mode-line) 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
--
Sebastien Vauban
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0002-Add-custom-face-for-highlighting-tags-used-in-agenda.patch --]
[-- Type: text/x-patch, Size: 2153 bytes --]
From 9492f3a5defeae992685d90e187ceb441c2ebea1 Mon Sep 17 00:00:00 2001
From: Sebastien Vauban <sva-D0wtAvR13HarG/iDocfnWg@public.gmane.org>
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
[-- Attachment #3: ChangeLog --]
[-- Type: application/octet-stream, Size: 206 bytes --]
2011-10-27 Seb Vauban <sva@mygooglest.com>
* org-agenda.el (org-agenda-set-mode-name): Highlight tags
used for filtering (shown in the mode-line).
* org-faces.el: Add face `org-agenda-filter-tags'.
next prev parent reply other threads:[~2011-10-27 21:20 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-10-26 20:22 Trying to use a custom face for highlighting tags used in agenda filtering Sebastien Vauban
2011-10-27 21:20 ` Sebastien Vauban [this message]
2011-10-29 11:25 ` Bastien
2011-10-29 19:36 ` Sebastien Vauban
2011-10-29 23:39 ` Bastien
2011-12-08 13:49 ` Sebastien Vauban
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.orgmode.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=801utyrv1o.fsf@somewhere.org \
--to=wxhgmqzgwmuf-genee64ty+gs+fvcfc7uqw@public.gmane.org \
--cc=emacs-orgmode-mXXj517/zsQ@public.gmane.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).