diff options
author | Bastien Guerry <bzg@altern.org> | 2013-01-22 16:39:23 +0100 |
---|---|---|
committer | Bastien Guerry <bzg@altern.org> | 2013-01-22 16:39:23 +0100 |
commit | 211b137ef46d04b17b46f256696eb5c1c3a1d2be (patch) | |
tree | 104f5f759bcec175cb88c528b5816790960619b7 | |
parent | ecd9a1cc21f8e1f0282917a7b5cefa2c85cba521 (diff) | |
download | org-mode-211b137ef46d04b17b46f256696eb5c1c3a1d2be.tar.gz |
org-agenda.el (org-agenda-skip): Correctly handle commented out scheduled/deadline lines
* org-agenda.el (org-agenda-skip): Correctly handle commented
out scheduled/deadline lines. Refactor.
Thanks to Rainer Stengele for reporting this and to Nick Dokos for
investigating further. This fix will not slow down the agenda as checking
for a text property seems equally fast (and perhaps even slightly faster)
than checking the character after.
-rw-r--r-- | lisp/org-agenda.el | 25 |
1 files changed, 12 insertions, 13 deletions
diff --git a/lisp/org-agenda.el b/lisp/org-agenda.el index 7db1730..f3540df 100644 --- a/lisp/org-agenda.el +++ b/lisp/org-agenda.el @@ -3728,19 +3728,18 @@ A good way to set it is through options in `org-agenda-custom-commands'.") Also moves point to the end of the skipped region, so that search can continue from there." (let ((p (point-at-bol)) to) - (when (org-in-src-block-p t) (throw :skip t)) - (and org-agenda-skip-archived-trees (not org-agenda-archives-mode) - (get-text-property p :org-archived) - (org-end-of-subtree t) - (throw :skip t)) - (and org-agenda-skip-comment-trees - (get-text-property p :org-comment) - (org-end-of-subtree t) - (throw :skip t)) - (if (equal (char-after p) ?#) (throw :skip t)) - (when (setq to (or (org-agenda-skip-eval org-agenda-skip-function-global) - (org-agenda-skip-eval org-agenda-skip-function))) - (goto-char to) + (when (or + (eq (get-text-property p 'face) 'font-lock-comment-face) + (and org-agenda-skip-archived-trees (not org-agenda-archives-mode) + (get-text-property p :org-archived) + (org-end-of-subtree t)) + (and org-agenda-skip-comment-trees + (get-text-property p :org-comment) + (org-end-of-subtree t)) + (and (setq to (or (org-agenda-skip-eval org-agenda-skip-function-global) + (org-agenda-skip-eval org-agenda-skip-function))) + (goto-char to)) + (org-in-src-block-p t)) (throw :skip t)))) (defun org-agenda-skip-eval (form) |