Mercurial > emacs
comparison lisp/textmodes/org.el @ 71652:4df24233cf1e
(org-agenda-get-todos): Skip subtree also if entry is
skipped because it has been scheduled.
(org-prepare-agenda-buffers): Don't mark buffers as modified when
changing `:org-archived' and `:org-comment' properties.
author | Carsten Dominik <dominik@science.uva.nl> |
---|---|
date | Fri, 07 Jul 2006 06:31:30 +0000 |
parents | f008b5943ba4 |
children | 1c9c6dd0b6d3 8a8e69664178 |
comparison
equal
deleted
inserted
replaced
71651:731edb6e5b4f | 71652:4df24233cf1e |
---|---|
3 ;; Copyright (C) 2004, 2005, 2006 Free Software Foundation, Inc. | 3 ;; Copyright (C) 2004, 2005, 2006 Free Software Foundation, Inc. |
4 ;; | 4 ;; |
5 ;; Author: Carsten Dominik <dominik at science dot uva dot nl> | 5 ;; Author: Carsten Dominik <dominik at science dot uva dot nl> |
6 ;; Keywords: outlines, hypermedia, calendar, wp | 6 ;; Keywords: outlines, hypermedia, calendar, wp |
7 ;; Homepage: http://www.astro.uva.nl/~dominik/Tools/org/ | 7 ;; Homepage: http://www.astro.uva.nl/~dominik/Tools/org/ |
8 ;; Version: 4.42 | 8 ;; Version: 4.43 |
9 ;; | 9 ;; |
10 ;; This file is part of GNU Emacs. | 10 ;; This file is part of GNU Emacs. |
11 ;; | 11 ;; |
12 ;; GNU Emacs is free software; you can redistribute it and/or modify | 12 ;; GNU Emacs is free software; you can redistribute it and/or modify |
13 ;; it under the terms of the GNU General Public License as published by | 13 ;; it under the terms of the GNU General Public License as published by |
88 ;; excellent reference card made by Philip Rooke. This card can be found | 88 ;; excellent reference card made by Philip Rooke. This card can be found |
89 ;; in the etc/ directory of Emacs 22. | 89 ;; in the etc/ directory of Emacs 22. |
90 ;; | 90 ;; |
91 ;; Recent changes | 91 ;; Recent changes |
92 ;; -------------- | 92 ;; -------------- |
93 ;; Version 4.43 | |
94 ;; - Big fixes | |
95 ;; | |
93 ;; Version 4.42 | 96 ;; Version 4.42 |
94 ;; - Bug fixes | 97 ;; - Bug fixes |
95 ;; - `s' key in the agenda saves all org-mode buffers. | 98 ;; - `s' key in the agenda saves all org-mode buffers. |
96 ;; | 99 ;; |
97 ;; Version 4.41 | 100 ;; Version 4.41 |
207 (require 'time-date) | 210 (require 'time-date) |
208 (require 'easymenu) | 211 (require 'easymenu) |
209 | 212 |
210 ;;; Customization variables | 213 ;;; Customization variables |
211 | 214 |
212 (defvar org-version "4.42" | 215 (defvar org-version "4.43" |
213 "The version number of the file org.el.") | 216 "The version number of the file org.el.") |
214 (defun org-version () | 217 (defun org-version () |
215 (interactive) | 218 (interactive) |
216 (message "Org-mode version %s" org-version)) | 219 (message "Org-mode version %s" org-version)) |
217 | 220 |
4698 (interactive) | 4701 (interactive) |
4699 (let ((pa '(:org-archived t)) | 4702 (let ((pa '(:org-archived t)) |
4700 (pc '(:org-comment t)) | 4703 (pc '(:org-comment t)) |
4701 (pall '(:org-archived t :org-comment t)) | 4704 (pall '(:org-archived t :org-comment t)) |
4702 (rea (concat ":" org-archive-tag ":")) | 4705 (rea (concat ":" org-archive-tag ":")) |
4703 file re) | 4706 bmp file re) |
4704 (save-excursion | 4707 (save-excursion |
4705 (while (setq file (pop files)) | 4708 (while (setq file (pop files)) |
4706 (org-check-agenda-file file) | 4709 (org-check-agenda-file file) |
4707 (set-buffer (org-get-agenda-file-buffer file)) | 4710 (set-buffer (org-get-agenda-file-buffer file)) |
4708 (widen) | 4711 (widen) |
4712 (setq bmp (buffer-modified-p)) | |
4709 (save-excursion | 4713 (save-excursion |
4710 (remove-text-properties (point-min) (point-max) pall) | 4714 (remove-text-properties (point-min) (point-max) pall) |
4711 (when org-agenda-skip-archived-trees | 4715 (when org-agenda-skip-archived-trees |
4712 (goto-char (point-min)) | 4716 (goto-char (point-min)) |
4713 (while (re-search-forward rea nil t) | 4717 (while (re-search-forward rea nil t) |
4715 (add-text-properties (point-at-bol) (org-end-of-subtree t) pa)))) | 4719 (add-text-properties (point-at-bol) (org-end-of-subtree t) pa)))) |
4716 (goto-char (point-min)) | 4720 (goto-char (point-min)) |
4717 (setq re (concat "^\\*+ +" org-comment-string "\\>")) | 4721 (setq re (concat "^\\*+ +" org-comment-string "\\>")) |
4718 (while (re-search-forward re nil t) | 4722 (while (re-search-forward re nil t) |
4719 (add-text-properties | 4723 (add-text-properties |
4720 (match-beginning 0) (org-end-of-subtree t) pc))))))) | 4724 (match-beginning 0) (org-end-of-subtree t) pc))) |
4725 (set-buffer-modified-p bmp))))) | |
4721 | 4726 |
4722 (defun org-agenda-skip () | 4727 (defun org-agenda-skip () |
4723 "Throw to `:skip' in places that should be skipped." | 4728 "Throw to `:skip' in places that should be skipped." |
4724 (let ((p (point-at-bol))) | 4729 (let ((p (point-at-bol))) |
4725 (and org-agenda-skip-archived-trees | 4730 (and org-agenda-skip-archived-trees |
7430 marker priority category tags | 7435 marker priority category tags |
7431 ee txt) | 7436 ee txt) |
7432 (goto-char (point-min)) | 7437 (goto-char (point-min)) |
7433 (while (re-search-forward regexp nil t) | 7438 (while (re-search-forward regexp nil t) |
7434 (catch :skip | 7439 (catch :skip |
7435 (and org-agenda-todo-ignore-scheduled | 7440 (when (and org-agenda-todo-ignore-scheduled |
7436 (looking-at sched-re) | 7441 (looking-at sched-re)) |
7437 (throw :skip nil)) | 7442 ;; FIXME: the following test also happens below, but we need it here |
7443 (or org-agenda-todo-list-sublevels (org-end-of-subtree 'invisible)) | |
7444 (throw :skip nil)) | |
7438 (org-agenda-skip) | 7445 (org-agenda-skip) |
7439 (goto-char (match-beginning 1)) | 7446 (goto-char (match-beginning 1)) |
7440 (setq marker (org-agenda-new-marker (1+ (match-beginning 0))) | 7447 (setq marker (org-agenda-new-marker (1+ (match-beginning 0))) |
7441 category (org-get-category) | 7448 category (org-get-category) |
7442 tags (org-get-tags-at (point)) | 7449 tags (org-get-tags-at (point)) |
8694 (let ((org-add-colon-after-tag-completion t)) | 8701 (let ((org-add-colon-after-tag-completion t)) |
8695 (completing-read "Tags: " 'org-tags-completion-function | 8702 (completing-read "Tags: " 'org-tags-completion-function |
8696 nil nil current 'org-tags-history)))) | 8703 nil nil current 'org-tags-history)))) |
8697 (while (string-match "[-+&]+" tags) | 8704 (while (string-match "[-+&]+" tags) |
8698 (setq tags (replace-match ":" t t tags)))) | 8705 (setq tags (replace-match ":" t t tags)))) |
8699 | 8706 |
8700 (unless (setq empty (string-match "\\`[\t ]*\\'" tags)) | 8707 (unless (setq empty (string-match "\\`[\t ]*\\'" tags)) |
8701 (unless (string-match ":$" tags) (setq tags (concat tags ":"))) | 8708 (unless (string-match ":$" tags) (setq tags (concat tags ":"))) |
8702 (unless (string-match "^:" tags) (setq tags (concat ":" tags)))) | 8709 (unless (string-match "^:" tags) (setq tags (concat ":" tags)))) |
8703 (if (equal current "") | 8710 (if (equal current "") |
8704 (progn | 8711 (progn |