emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* [patch] Add faces for highlighting calendar events in the agenda
@ 2011-11-18 12:47 Sebastien Vauban
  2011-12-11 17:49 ` Bastien
  0 siblings, 1 reply; 2+ messages in thread
From: Sebastien Vauban @ 2011-11-18 12:47 UTC (permalink / raw)
  To: emacs-orgmode-mXXj517/zsQ

[-- Attachment #1: Type: text/plain, Size: 306 bytes --]

Hello,

Find attached a patch to highlight 2 types of "calendar events":

- "appointments" (or whatever close to that), that is events based on an
  active timestamp;

- S-expressions to compute active timestamps for events.

The change is quite straightforward.

Best regards,
  Seb

-- 
Sebastien Vauban

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-Add-faces-for-calendar-events-active-timestamps-or-S.patch --]
[-- Type: text/x-patch, Size: 3268 bytes --]

From 271dc5a7bb1c377cc38df63c50f2af41019abb34 Mon Sep 17 00:00:00 2001
From: Sebastien Vauban <sva-D0wtAvR13HarG/iDocfnWg@public.gmane.org>
Date: Fri, 18 Nov 2011 13:41:47 +0100
Subject: [PATCH] Add faces for "calendar events" (active timestamps, or
 S-expressions).

	* org-agenda.el (org-agenda-get-timestamps)
	(org-agenda-get-sexps): Use face for highlighting "calendar"
	events.

	* org-faces.el: Add faces `org-agenda-calendar-event' and
	`org-agenda-calendar-sexp'.
---
 lisp/org-agenda.el |    9 +++++----
 lisp/org-faces.el  |   12 ++++++++++++
 2 files changed, 17 insertions(+), 4 deletions(-)

diff --git a/lisp/org-agenda.el b/lisp/org-agenda.el
index 0a98fbe..70c6c17 100644
--- a/lisp/org-agenda.el
+++ b/lisp/org-agenda.el
@@ -3636,7 +3636,7 @@ given in `org-agenda-start-on-weekday'."
 	      (setq rtn (apply 'org-agenda-get-day-entries
 			       file date
 			       org-agenda-entry-types)))))
-	  (setq rtnall (append rtnall rtn))))
+	  (setq rtnall (append rtnall rtn)))) ;; all entries
       (if org-agenda-include-diary
 	  (let ((org-agenda-search-headline-for-time t))
 	    (require 'diary-lib)
@@ -3658,7 +3658,7 @@ given in `org-agenda-start-on-weekday'."
 	    (put-text-property s (1- (point)) 'org-day-cnt day-cnt)
 	    (when todayp
 	      (put-text-property s (1- (point)) 'org-today t))
-	    (if rtnall (insert
+	    (if rtnall (insert ;; all entries
 			(org-finalize-agenda-entries
 			 (org-agenda-add-time-grid-maybe
 			  rtnall ndays todayp))
@@ -4721,7 +4721,7 @@ This function is invoked if `org-agenda-todo-ignore-deadlines',
 
 (defun org-agenda-get-timestamps ()
   "Return the date stamp information for agenda display."
-  (let* ((props (list 'face nil
+  (let* ((props (list 'face 'org-agenda-calendar-event
 		      'org-not-done-regexp org-not-done-regexp
 		      'org-todo-regexp org-todo-regexp
 		      'org-complex-heading-regexp org-complex-heading-regexp
@@ -4822,7 +4822,8 @@ This function is invoked if `org-agenda-todo-ignore-deadlines',
 (defun org-agenda-get-sexps ()
   "Return the sexp information for agenda display."
   (require 'diary-lib)
-  (let* ((props (list 'mouse-face 'highlight
+  (let* ((props (list 'face 'org-agenda-calendar-sexp
+		      'mouse-face 'highlight
 		      'help-echo
 		      (format "mouse-2 or RET jump to org file %s"
 			      (abbreviate-file-name buffer-file-name))))
diff --git a/lisp/org-faces.el b/lisp/org-faces.el
index 7b7dfa7..c15cb7d 100644
--- a/lisp/org-faces.el
+++ b/lisp/org-faces.el
@@ -695,6 +695,18 @@ month and 365.24 days for a year)."
   "Face used for agenda entries that come from the Emacs diary."
   :group 'org-faces)
 
+(defface org-agenda-calendar-event
+  '((((background light)) (:foreground "#FFFFFF" :background "#1662AF"))
+    (((background dark)) (:foreground "blue")))
+  "Face used to show events and appointments in the agenda."
+  :group 'org-faces)
+
+(defface org-agenda-calendar-sexp
+  '((((background light)) (:background "light blue"))
+    (((background dark)) (:foreground "light blue")))
+  "Face used to show events computed from a S-expression."
+  :group 'org-faces)
+
 (defconst org-level-faces
   '(org-level-1 org-level-2 org-level-3 org-level-4
     org-level-5 org-level-6 org-level-7 org-level-8
-- 
1.7.5.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [patch] Add faces for highlighting calendar events in the agenda
  2011-11-18 12:47 [patch] Add faces for highlighting calendar events in the agenda Sebastien Vauban
@ 2011-12-11 17:49 ` Bastien
  0 siblings, 0 replies; 2+ messages in thread
From: Bastien @ 2011-12-11 17:49 UTC (permalink / raw)
  To: Sebastien Vauban; +Cc: emacs-orgmode

Hi Sébastien,

"Sebastien Vauban" <wxhgmqzgwmuf@spammotel.com> writes:

> Find attached a patch to highlight 2 types of "calendar events":

Applied, thanks a lot!

-- 
 Bastien

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2011-12-11 17:48 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-11-18 12:47 [patch] Add faces for highlighting calendar events in the agenda Sebastien Vauban
2011-12-11 17:49 ` Bastien

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).