From 3d02600149dcc0228ca39e5cb5241fb881f701b4 Mon Sep 17 00:00:00 2001 From: Carsten Dominik Date: Wed, 4 Mar 2009 09:46:19 +0100 Subject: [PATCH] Tags: Use internal tags list for agenda An agenda item carries a full list of tags. The list must normally be made, but not during a tags scan. So now the tags scan does pass on its list instead, which should make things faster. --- lisp/ChangeLog | 2 ++ lisp/org.el | 14 ++++++++------ 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 8cc2a3de1..a66e70f72 100755 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -3,6 +3,8 @@ * org.el (org-scan-tags): Improve tag inheritance. (org-scan-tags, org-make-tags-matcher): Make tag comparison case-sensitive. + (org-scan-tags): Use the internal tags list instead of creating it + from scratch. 2009-03-03 Carsten Dominik diff --git a/lisp/org.el b/lisp/org.el index 6207b0654..22c5c92fc 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -9800,8 +9800,8 @@ only lines with a TODO keyword are included in the output." (org-remove-occur-highlights)) (while (re-search-forward re nil t) (catch :skip - (setq todo (if (match-end 1) (match-string 2)) - tags (if (match-end 4) (match-string 4))) + (setq todo (if (match-end 1) (org-match-string-no-properties 2)) + tags (if (match-end 4) (org-match-string-no-properties 4))) (goto-char (setq lspos (1+ (match-beginning 0)))) (setq level (org-reduced-level (funcall outline-level)) category (org-get-category)) @@ -9822,15 +9822,14 @@ only lines with a TODO keyword are included in the output." (apply 'append (mapcar 'cdr (reverse tags-alist))) tags)) (when org-use-tag-inheritance - (setcdr (car tags-alist) - (org-remove-uniherited-tags (cdar tags-alist))) (setcdr (car tags-alist) (mapcar (lambda (x) (setq x (copy-sequence x)) (org-add-prop-inherited x)) (cdar tags-alist)))) (when (and tags org-use-tag-inheritance - (not (eq t org-use-tag-inheritance))) + (or (not (eq t org-use-tag-inheritance)) + org-tags-exclude-from-inheritance)) ;; selective inheritance, remove uninherited ones (setcdr (car tags-alist) (org-remove-uniherited-tags (cdar tags-alist)))) @@ -9862,7 +9861,10 @@ only lines with a TODO keyword are included in the output." (if org-tags-match-list-sublevels (make-string (1- level) ?.) "") (org-get-heading)) - category (org-get-tags-at)) + category + ;(org-get-tags-at) + tags-list + ) priority (org-get-priority txt)) (goto-char lspos) (setq marker (org-agenda-new-marker))