Mercurial > emacs
comparison lisp/org/org.el @ 101757:6d71fc980cde
2009-02-02 Carsten Dominik <carsten.dominik@gmail.com>
* org.el (org-mode): Make dependence stuff work more reliably.
(org-update-parent-todo-statistics): Fix bug with updating
statistics cookie.
(org-yank-adjusted-subtrees, org-return-follows-link)
(org-use-fast-todo-selection, org-tags-column): New default
setting for variables.
* org-export-latex.el (org-export-latex-emphasis-alist): Use = and
~ as verbatim delimiters, to avoid table bug.
(org-export-latex-classes): Remove the a4paper option from the
default styles.
* org-exp.el (org-export-html-format-image): New argument
PAR-OPEN, to fix XHTM validation bug.
(org-export-as-html): Pass par-open to
`org-export-html-format-image'.
(org-export-html-footnotes-section): Use a more consistent id for
footnotes.
* org-agenda.el (org-agenda-sorting-strategy)
(org-agenda-tags-column): New default setting for variables, based
on a poll what typical uses use.
(org-agenda-dim-blocked-tasks): Keep dimming blocked entries from
setting the blocked tag.
author | Carsten Dominik <dominik@science.uva.nl> |
---|---|
date | Mon, 02 Feb 2009 20:57:14 +0000 |
parents | 832fdb28f500 |
children | 9f3e0387f078 |
comparison
equal
deleted
inserted
replaced
101756:5f840f1a34d4 | 101757:6d71fc980cde |
---|---|
4 ;; Free Software Foundation, Inc. | 4 ;; Free Software Foundation, Inc. |
5 ;; | 5 ;; |
6 ;; Author: Carsten Dominik <carsten at orgmode dot org> | 6 ;; Author: Carsten Dominik <carsten at orgmode dot org> |
7 ;; Keywords: outlines, hypermedia, calendar, wp | 7 ;; Keywords: outlines, hypermedia, calendar, wp |
8 ;; Homepage: http://orgmode.org | 8 ;; Homepage: http://orgmode.org |
9 ;; Version: 6.20h | 9 ;; Version: 6.21b |
10 ;; | 10 ;; |
11 ;; This file is part of GNU Emacs. | 11 ;; This file is part of GNU Emacs. |
12 ;; | 12 ;; |
13 ;; GNU Emacs is free software: you can redistribute it and/or modify | 13 ;; GNU Emacs is free software: you can redistribute it and/or modify |
14 ;; it under the terms of the GNU General Public License as published by | 14 ;; it under the terms of the GNU General Public License as published by |
92 | 92 |
93 ;;;; Customization variables | 93 ;;;; Customization variables |
94 | 94 |
95 ;;; Version | 95 ;;; Version |
96 | 96 |
97 (defconst org-version "6.20h" | 97 (defconst org-version "6.21b" |
98 "The version number of the file org.el.") | 98 "The version number of the file org.el.") |
99 | 99 |
100 (defun org-version (&optional here) | 100 (defun org-version (&optional here) |
101 "Show the org-mode version in the echo area. | 101 "Show the org-mode version in the echo area. |
102 With prefix arg HERE, insert it at point." | 102 With prefix arg HERE, insert it at point." |
687 or siblings, then fold all the subtrees. However, do this only if no | 687 or siblings, then fold all the subtrees. However, do this only if no |
688 text after the yank would be swallowed into a folded tree by this action." | 688 text after the yank would be swallowed into a folded tree by this action." |
689 :group 'org-edit-structure | 689 :group 'org-edit-structure |
690 :type 'boolean) | 690 :type 'boolean) |
691 | 691 |
692 (defcustom org-yank-adjusted-subtrees t | 692 (defcustom org-yank-adjusted-subtrees nil |
693 "Non-nil means, when yanking subtrees, adjust the level. | 693 "Non-nil means, when yanking subtrees, adjust the level. |
694 With this setting, `org-paste-subtree' is used to insert the subtree, see | 694 With this setting, `org-paste-subtree' is used to insert the subtree, see |
695 this function for details." | 695 this function for details." |
696 :group 'org-edit-structure | 696 :group 'org-edit-structure |
697 :type 'boolean) | 697 :type 'boolean) |
1111 "Non-nil means, on links TAB will follow the link. | 1111 "Non-nil means, on links TAB will follow the link. |
1112 Needs to be set before org.el is loaded." | 1112 Needs to be set before org.el is loaded." |
1113 :group 'org-link-follow | 1113 :group 'org-link-follow |
1114 :type 'boolean) | 1114 :type 'boolean) |
1115 | 1115 |
1116 (defcustom org-return-follows-link nil | 1116 (defcustom org-return-follows-link t |
1117 "Non-nil means, on links RET will follow the link. | 1117 "Non-nil means, on links RET will follow the link. |
1118 Needs to be set before org.el is loaded." | 1118 Needs to be set before org.el is loaded." |
1119 :group 'org-link-follow | 1119 :group 'org-link-follow |
1120 :type 'boolean) | 1120 :type 'boolean) |
1121 | 1121 |
1563 :group 'org-todo | 1563 :group 'org-todo |
1564 :group 'org-keywords | 1564 :group 'org-keywords |
1565 :type '(choice (const sequence) | 1565 :type '(choice (const sequence) |
1566 (const type))) | 1566 (const type))) |
1567 | 1567 |
1568 (defcustom org-use-fast-todo-selection 'prefix | 1568 (defcustom org-use-fast-todo-selection t |
1569 "Non-nil means, use the fast todo selection scheme with C-c C-t. | 1569 "Non-nil means, use the fast todo selection scheme with C-c C-t. |
1570 This variable describes if and under what circumstances the cycling | 1570 This variable describes if and under what circumstances the cycling |
1571 mechanism for TODO keywords will be replaced by a single-key, direct | 1571 mechanism for TODO keywords will be replaced by a single-key, direct |
1572 selection scheme. | 1572 selection scheme. |
1573 | 1573 |
1634 | 1634 |
1635 (defcustom org-enforce-todo-dependencies nil | 1635 (defcustom org-enforce-todo-dependencies nil |
1636 "Non-nil means, undone TODO entries will block switching the parent to DONE. | 1636 "Non-nil means, undone TODO entries will block switching the parent to DONE. |
1637 Also, if a parent has an :ORDERED: property, switching an entry to DONE will | 1637 Also, if a parent has an :ORDERED: property, switching an entry to DONE will |
1638 be blocked if any prior sibling is not yet done. | 1638 be blocked if any prior sibling is not yet done. |
1639 You need to set this variable through the customize interface, or to | 1639 This variable needs to be set before org.el is loaded, and you need to |
1640 restart emacs after changing the value." | 1640 restart Emacs after a change to make the change effective. The only way |
1641 to change is while Emacs is running is through the customize interface." | |
1641 :set (lambda (var val) | 1642 :set (lambda (var val) |
1642 (set var val) | 1643 (set var val) |
1643 (if val | 1644 (if val |
1644 (add-hook 'org-blocker-hook | 1645 (add-hook 'org-blocker-hook |
1645 'org-block-todo-from-children-or-siblings) | 1646 'org-block-todo-from-children-or-siblings) |
1651 (defcustom org-enforce-todo-checkbox-dependencies nil | 1652 (defcustom org-enforce-todo-checkbox-dependencies nil |
1652 "Non-nil means, unchecked boxes will block switching the parent to DONE. | 1653 "Non-nil means, unchecked boxes will block switching the parent to DONE. |
1653 When this is nil, checkboxes have no influence on switching TODO states. | 1654 When this is nil, checkboxes have no influence on switching TODO states. |
1654 When non-nil, you first need to check off all check boxes before the TODO | 1655 When non-nil, you first need to check off all check boxes before the TODO |
1655 entry can be switched to DONE. | 1656 entry can be switched to DONE. |
1656 You need to set this variable through the customize interface, or to | 1657 This variable needs to be set before org.el is loaded, and you need to |
1657 restart emacs after changing the value." | 1658 restart Emacs after a change to make the change effective. The only way |
1659 to change is while Emacs is running is through the customize interface." | |
1658 :set (lambda (var val) | 1660 :set (lambda (var val) |
1659 (set var val) | 1661 (set var val) |
1660 (if val | 1662 (if val |
1661 (add-hook 'org-blocker-hook | 1663 (add-hook 'org-blocker-hook |
1662 'org-block-todo-from-checkboxes) | 1664 'org-block-todo-from-checkboxes) |
2041 | 2043 |
2042 (defvar org-fast-tag-selection-include-todo nil | 2044 (defvar org-fast-tag-selection-include-todo nil |
2043 "Non-nil means, fast tags selection interface will also offer TODO states. | 2045 "Non-nil means, fast tags selection interface will also offer TODO states. |
2044 This is an undocumented feature, you should not rely on it.") | 2046 This is an undocumented feature, you should not rely on it.") |
2045 | 2047 |
2046 (defcustom org-tags-column (if (featurep 'xemacs) -79 -80) | 2048 (defcustom org-tags-column (if (featurep 'xemacs) -76 -77) |
2047 "The column to which tags should be indented in a headline. | 2049 "The column to which tags should be indented in a headline. |
2048 If this number is positive, it specifies the column. If it is negative, | 2050 If this number is positive, it specifies the column. If it is negative, |
2049 it means that the tags should be flushright to that column. For example, | 2051 it means that the tags should be flushright to that column. For example, |
2050 -80 works well for a normal 80 character screen." | 2052 -80 works well for a normal 80 character screen." |
2051 :group 'org-tags | 2053 :group 'org-tags |
3593 (org-add-hook 'kill-buffer-hook 'org-check-running-clock nil 'local) | 3595 (org-add-hook 'kill-buffer-hook 'org-check-running-clock nil 'local) |
3594 ;; Paragraphs and auto-filling | 3596 ;; Paragraphs and auto-filling |
3595 (org-set-autofill-regexps) | 3597 (org-set-autofill-regexps) |
3596 (setq indent-line-function 'org-indent-line-function) | 3598 (setq indent-line-function 'org-indent-line-function) |
3597 (org-update-radio-target-regexp) | 3599 (org-update-radio-target-regexp) |
3600 ;; Make sure dependence stuff works reliably, even for users who set it | |
3601 ;; too late :-( | |
3602 (if org-enforce-todo-dependencies | |
3603 (add-hook 'org-blocker-hook | |
3604 'org-block-todo-from-children-or-siblings) | |
3605 (remove-hook 'org-blocker-hook | |
3606 'org-block-todo-from-children-or-siblings)) | |
3607 (if org-enforce-todo-checkbox-dependencies | |
3608 (add-hook 'org-blocker-hook | |
3609 'org-block-todo-from-checkboxes) | |
3610 (remove-hook 'org-blocker-hook | |
3611 'org-block-todo-from-checkboxes)) | |
3598 | 3612 |
3599 ;; Comment characters | 3613 ;; Comment characters |
3600 ; (org-set-local 'comment-start "#") ;; FIXME: this breaks wrapping | 3614 ; (org-set-local 'comment-start "#") ;; FIXME: this breaks wrapping |
3601 (org-set-local 'comment-padding " ") | 3615 (org-set-local 'comment-padding " ") |
3602 | 3616 |
8629 | 8643 |
8630 (defun org-update-parent-todo-statistics () | 8644 (defun org-update-parent-todo-statistics () |
8631 "Update any statistics cookie in the parent of the current headline." | 8645 "Update any statistics cookie in the parent of the current headline." |
8632 (interactive) | 8646 (interactive) |
8633 (let ((box-re "\\(\\(\\[[0-9]*%\\]\\)\\|\\(\\[[0-9]*/[0-9]*\\]\\)\\)") | 8647 (let ((box-re "\\(\\(\\[[0-9]*%\\]\\)\\|\\(\\[[0-9]*/[0-9]*\\]\\)\\)") |
8634 level (cnt-all 0) (cnt-done 0) is-percent kwd) | 8648 level (cnt-all 0) (cnt-done 0) is-percent kwd cookie-present) |
8635 (catch 'exit | 8649 (catch 'exit |
8636 (save-excursion | 8650 (save-excursion |
8637 (setq level (org-up-heading-safe)) | 8651 (setq level (org-up-heading-safe)) |
8638 (unless level | 8652 (unless level |
8639 (throw 'exit nil)) | 8653 (throw 'exit nil)) |
8640 (while (re-search-forward box-re (point-at-eol) t) | 8654 (while (re-search-forward box-re (point-at-eol) t) |
8655 (setq cnt-all 0 cnt-done 0 cookie-present t) | |
8641 (setq is-percent (match-end 2)) | 8656 (setq is-percent (match-end 2)) |
8642 (save-match-data | 8657 (save-match-data |
8643 (unless (outline-next-heading) (throw 'exit nil)) | 8658 (unless (outline-next-heading) (throw 'exit nil)) |
8644 (while (looking-at org-todo-line-regexp) | 8659 (while (looking-at org-todo-line-regexp) |
8645 (setq kwd (match-string 2)) | 8660 (setq kwd (match-string 2)) |
8651 (error (end-of-line 1))))) | 8666 (error (end-of-line 1))))) |
8652 (replace-match | 8667 (replace-match |
8653 (if is-percent | 8668 (if is-percent |
8654 (format "[%d%%]" (/ (* 100 cnt-done) (max 1 cnt-all))) | 8669 (format "[%d%%]" (/ (* 100 cnt-done) (max 1 cnt-all))) |
8655 (format "[%d/%d]" cnt-done cnt-all)))) | 8670 (format "[%d/%d]" cnt-done cnt-all)))) |
8656 (run-hook-with-args 'org-after-todo-statistics-hook | 8671 (when cookie-present |
8657 cnt-done (- cnt-all cnt-done)))))) | 8672 (run-hook-with-args 'org-after-todo-statistics-hook |
8673 cnt-done (- cnt-all cnt-done))))))) | |
8658 | 8674 |
8659 (defvar org-after-todo-statistics-hook nil | 8675 (defvar org-after-todo-statistics-hook nil |
8660 "Hook that is called after a TODO statistics cookie has been updated. | 8676 "Hook that is called after a TODO statistics cookie has been updated. |
8661 Each function is called with two arguments: the number of not-done entries | 8677 Each function is called with two arguments: the number of not-done entries |
8662 and the number of done entries. | 8678 and the number of done entries. |