emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Ingo Lohmar <i.lohmar@gmail.com>
To: Bastien <bzg@altern.org>
Cc: emacs-orgmode@gnu.org
Subject: Re: [PATCH] Nicer fontification for org-todo-list
Date: Thu, 06 Dec 2012 21:14:49 +0100	[thread overview]
Message-ID: <87vccfx7ie.fsf@acer.localhost.com> (raw)
In-Reply-To: <87hao1q3ts.fsf@bzg.ath.cx>

On Tue, Dec 04 2012 15:39 (+0100), Bastien wrote:

> Hi Ingo,
>
> sorry nobody had the time to test the patch and report.
>
> It looks good to me and does the right thing.  
>
> Do you mind resending it using git?  Don't forget to add a changelog
> entry (with `C-x 4 a' in the modified places) and a TINYCHANGE cookie 
> at the end of the entry.
>
> Note that we cannot accept patches larger than 20 lines, so if you
> want to contribute further, maybe you can consider signing the FSF
> papers?
>
> See
> http://orgmode.org/cgit.cgi/org-mode.git/plain/request-assign-future.txt
>
> Thanks for your contribution/patience!
>
> -- 
>  Bastien

Hi Bastien,

No worries, and thanks for taking the time.  Below is the patch in git
format, I hope the format is ok (incl changelog), otherwise please bear
with me...  Will send the mail regarding the FSF papers soon!

Ingo



From 1ecc9832bcda75638dc29565f71516416e599e89 Mon Sep 17 00:00:00 2001
From: Ingo Lohmar <i.lohmar@gmail.com>
Date: Thu, 6 Dec 2012 20:51:59 +0100
Subject: [PATCH] Propertize keywords in todo list header

* org-agenda.el (org-todo-list): Propertize keywords with
  their proper faces in the header of a todo list agenda.

TINYCHANGE
---
 lisp/org-agenda.el |   15 ++++++++++++---
 1 file changed, 12 insertions(+), 3 deletions(-)

diff --git a/lisp/org-agenda.el b/lisp/org-agenda.el
index 2c484b5..15321e1 100644
--- a/lisp/org-agenda.el
+++ b/lisp/org-agenda.el
@@ -4509,6 +4509,17 @@ in `org-agenda-text-search-extra-files'.
 
 ;;; Agenda TODO list
 
+(defun org-propertize-todo-keyword-list (keywords)
+  (concat
+   (if (or (equal keywords "ALL") (not keywords))
+       (propertize "ALL" 'face 'warning)
+     (mapconcat
+      (lambda (kw)
+        (propertize kw 'face (org-get-todo-face kw)))
+      (org-split-string keywords "|")
+      "|"))
+   "\n"))
+
 (defvar org-select-this-todo-keyword nil)
 (defvar org-last-arg nil)
 
@@ -4569,9 +4580,7 @@ for a keyword.  A numeric prefix directly selects the Nth keyword in
 				   (concat "ToDo: "
 					   (or org-select-this-todo-keyword "ALL"))))
 	(org-agenda-mark-header-line (point-min))
-	(setq pos (point))
-	(insert (or org-select-this-todo-keyword "ALL") "\n")
-	(add-text-properties pos (1- (point)) (list 'face 'org-warning))
+	(insert (org-propertize-todo-keyword-list org-select-this-todo-keyword))
 	(setq pos (point))
 	(unless org-agenda-multi
 	  (insert "Available with `N r': (0)[ALL]")
-- 
1.7.10.4

  reply	other threads:[~2012-12-06 20:15 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-11-02 17:47 [PATCH] Nicer fontification for org-todo-list Ingo Lohmar
2012-11-02 17:50 ` Ingo Lohmar
2012-12-04 14:01   ` Ingo Lohmar
2012-12-04 14:39     ` Bastien
2012-12-06 20:14       ` Ingo Lohmar [this message]
2012-12-18 17:23         ` Ingo Lohmar
2012-12-18 17:51           ` Bastien

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=87vccfx7ie.fsf@acer.localhost.com \
    --to=i.lohmar@gmail.com \
    --cc=bzg@altern.org \
    --cc=emacs-orgmode@gnu.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).