From 6b8af94de3add24ae9b1a7a2aa144f5c6293f82c Mon Sep 17 00:00:00 2001 From: Carsten Dominik Date: Mon, 11 Jan 2010 18:43:54 +0100 Subject: [PATCH] Fix bug when all tags are hidden in the agenda Patch by Stephan Schmitt, who writes: > An error was thrown when all tags of a headline are hidden by > org-agenda-hide-tags-regexp (in this case the function > get-text-property got nil as third argument) --- lisp/ChangeLog | 5 +++++ lisp/org-agenda.el | 18 +++++++++--------- 2 files changed, 14 insertions(+), 9 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 0333c8c4..4ae11f2e 100755 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2010-01-11 Carsten Dominik + + * org-agenda.el (org-agenda-fix-displayed-tags): Fix bug when all + tags are hidden. + 2010-01-10 Carsten Dominik * org-latex.el (org-export-latex-fix-inputenc): New function. diff --git a/lisp/org-agenda.el b/lisp/org-agenda.el index e8e9e93a..771617e7 100644 --- a/lisp/org-agenda.el +++ b/lisp/org-agenda.el @@ -4762,16 +4762,16 @@ The modified list may contain inherited tags, and tags matched by (when (or add-inherited hide-re) (if (string-match (org-re "\\([ \t]+\\)\\(:[[:alnum:]_@:]+:\\)[ \t]*$") txt) (setq txt (substring txt 0 (match-beginning 0)))) + (setq tags + (delq nil + (mapcar (lambda (tg) + (if (or (and hide-re (string-match hide-re tg)) + (and (not add-inherited) + (get-text-property 0 'inherited tg))) + nil + tg)) + tags))) (when tags - (setq tags - (delq nil - (mapcar (lambda (tg) - (if (or (and hide-re (string-match hide-re tg)) - (and (not add-inherited) - (get-text-property 0 'inherited tg))) - nil - tg)) - tags))) (let ((have-i (get-text-property 0 'inherited (car tags))) i) (setq txt (concat txt " :" -- 2.11.4.GIT