diff options
| author | Stephen Berman | 2013-06-21 16:02:39 +0200 |
|---|---|---|
| committer | Stephen Berman | 2013-06-21 16:02:39 +0200 |
| commit | 4fe738d374d68aad467ff3329510c64bf3fcbd15 (patch) | |
| tree | 75fdc1366642f3684f0691174e24656d374ab987 | |
| parent | 03e6d46963d5fa9105f55416bf81cd6d1b57b8b5 (diff) | |
| download | emacs-4fe738d374d68aad467ff3329510c64bf3fcbd15.tar.gz emacs-4fe738d374d68aad467ff3329510c64bf3fcbd15.zip | |
* todo-mode.el: Clean up doc strings, comments and prompt strings,
mainly by changing "Todo" to "todo" when it is not part of a mode
name or does not begin a sentence.
| -rw-r--r-- | lisp/calendar/ChangeLog | 6 | ||||
| -rw-r--r-- | lisp/calendar/todo-mode.el | 336 |
2 files changed, 172 insertions, 170 deletions
diff --git a/lisp/calendar/ChangeLog b/lisp/calendar/ChangeLog index 411a2fcae3f..c5cf042abcc 100644 --- a/lisp/calendar/ChangeLog +++ b/lisp/calendar/ChangeLog | |||
| @@ -1,5 +1,11 @@ | |||
| 1 | 2013-06-21 Stephen Berman <stephen.berman@gmx.net> | 1 | 2013-06-21 Stephen Berman <stephen.berman@gmx.net> |
| 2 | 2 | ||
| 3 | * todo-mode.el: Clean up doc strings, comments and prompt strings, | ||
| 4 | mainly by changing "Todo" to "todo" when it is not part of a mode | ||
| 5 | name or does not begin a sentence. | ||
| 6 | |||
| 7 | 2013-06-21 Stephen Berman <stephen.berman@gmx.net> | ||
| 8 | |||
| 3 | * todo-mode.el: Offer to convert legacy file. Update commentary. | 9 | * todo-mode.el: Offer to convert legacy file. Update commentary. |
| 4 | (todo-show): If a legacy file is found and no new todo file | 10 | (todo-show): If a legacy file is found and no new todo file |
| 5 | exists, offer to convert it and show it. Restore autoload cookie. | 11 | exists, offer to convert it and show it. Restore autoload cookie. |
diff --git a/lisp/calendar/todo-mode.el b/lisp/calendar/todo-mode.el index e3b92950797..1f0d7c7a4f3 100644 --- a/lisp/calendar/todo-mode.el +++ b/lisp/calendar/todo-mode.el | |||
| @@ -80,11 +80,11 @@ | |||
| 80 | (require 'cl-lib) | 80 | (require 'cl-lib) |
| 81 | 81 | ||
| 82 | ;; ----------------------------------------------------------------------------- | 82 | ;; ----------------------------------------------------------------------------- |
| 83 | ;;; Setting up Todo files, categories, and items | 83 | ;;; Setting up todo files, categories, and items |
| 84 | ;; ----------------------------------------------------------------------------- | 84 | ;; ----------------------------------------------------------------------------- |
| 85 | 85 | ||
| 86 | (defcustom todo-directory (locate-user-emacs-file "todo/") | 86 | (defcustom todo-directory (locate-user-emacs-file "todo/") |
| 87 | "Directory where user's Todo files are saved." | 87 | "Directory where user's todo files are saved." |
| 88 | :type 'directory | 88 | :type 'directory |
| 89 | :group 'todo) | 89 | :group 'todo) |
| 90 | 90 | ||
| @@ -110,13 +110,13 @@ makes it return the value of the variable `todo-archives'." | |||
| 110 | :group 'todo) | 110 | :group 'todo) |
| 111 | 111 | ||
| 112 | (defvar todo-files (funcall todo-files-function) | 112 | (defvar todo-files (funcall todo-files-function) |
| 113 | "List of truenames of user's Todo files.") | 113 | "List of truenames of user's todo files.") |
| 114 | 114 | ||
| 115 | (defvar todo-archives (funcall todo-files-function t) | 115 | (defvar todo-archives (funcall todo-files-function t) |
| 116 | "List of truenames of user's Todo archives.") | 116 | "List of truenames of user's todo archives.") |
| 117 | 117 | ||
| 118 | (defvar todo-visited nil | 118 | (defvar todo-visited nil |
| 119 | "List of Todo files visited in this session by `todo-show'. | 119 | "List of todo files visited in this session by `todo-show'. |
| 120 | Used to determine initial display according to the value of | 120 | Used to determine initial display according to the value of |
| 121 | `todo-show-first'.") | 121 | `todo-show-first'.") |
| 122 | 122 | ||
| @@ -124,23 +124,23 @@ Used to determine initial display according to the value of | |||
| 124 | "List of file names of live Todo mode buffers.") | 124 | "List of file names of live Todo mode buffers.") |
| 125 | 125 | ||
| 126 | (defvar todo-global-current-todo-file nil | 126 | (defvar todo-global-current-todo-file nil |
| 127 | "Variable holding name of current Todo file. | 127 | "Variable holding name of current todo file. |
| 128 | Used by functions called from outside of Todo mode to visit the | 128 | Used by functions called from outside of Todo mode to visit the |
| 129 | current Todo file rather than the default Todo file (i.e. when | 129 | current todo file rather than the default todo file (i.e. when |
| 130 | users option `todo-show-current-file' is non-nil).") | 130 | users option `todo-show-current-file' is non-nil).") |
| 131 | 131 | ||
| 132 | (defvar todo-current-todo-file nil | 132 | (defvar todo-current-todo-file nil |
| 133 | "Variable holding the name of the currently active Todo file.") | 133 | "Variable holding the name of the currently active todo file.") |
| 134 | 134 | ||
| 135 | (defvar todo-categories nil | 135 | (defvar todo-categories nil |
| 136 | "Alist of categories in the current Todo file. | 136 | "Alist of categories in the current todo file. |
| 137 | The elements are cons cells whose car is a category name and | 137 | The elements are cons cells whose car is a category name and |
| 138 | whose cdr is a vector of the category's item counts. These are, | 138 | whose cdr is a vector of the category's item counts. These are, |
| 139 | in order, the numbers of todo items, of todo items included in | 139 | in order, the numbers of todo items, of todo items included in |
| 140 | the Diary, of done items and of archived items.") | 140 | the Diary, of done items and of archived items.") |
| 141 | 141 | ||
| 142 | (defvar todo-category-number 1 | 142 | (defvar todo-category-number 1 |
| 143 | "Variable holding the number of the current Todo category. | 143 | "Variable holding the number of the current todo category. |
| 144 | Todo categories are numbered starting from 1.") | 144 | Todo categories are numbered starting from 1.") |
| 145 | 145 | ||
| 146 | (defvar todo-categories-with-marks nil | 146 | (defvar todo-categories-with-marks nil |
| @@ -228,7 +228,7 @@ The final element is \"*\", indicating an unspecified month.") | |||
| 228 | (year "-?\\(?9:[0-9]+\\|\\*\\)")) | 228 | (year "-?\\(?9:[0-9]+\\|\\*\\)")) |
| 229 | (mapconcat 'eval calendar-date-display-form "")) | 229 | (mapconcat 'eval calendar-date-display-form "")) |
| 230 | "\\)")) | 230 | "\\)")) |
| 231 | "Regular expression matching a Todo date header.") | 231 | "Regular expression matching a todo item date header.") |
| 232 | 232 | ||
| 233 | ;; By itself this matches anything, because of the `?'; however, it's only | 233 | ;; By itself this matches anything, because of the `?'; however, it's only |
| 234 | ;; used in the context of `todo-date-pattern' (but Emacs Lisp lacks | 234 | ;; used in the context of `todo-date-pattern' (but Emacs Lisp lacks |
| @@ -252,7 +252,7 @@ The final element is \"*\", indicating an unspecified month.") | |||
| 252 | (defconst todo-item-start (concat "\\(" todo-date-string-start "\\|" | 252 | (defconst todo-item-start (concat "\\(" todo-date-string-start "\\|" |
| 253 | todo-done-string-start "\\)" | 253 | todo-done-string-start "\\)" |
| 254 | todo-date-pattern) | 254 | todo-date-pattern) |
| 255 | "String identifying start of a Todo item.") | 255 | "String identifying start of a todo item.") |
| 256 | 256 | ||
| 257 | ;; ----------------------------------------------------------------------------- | 257 | ;; ----------------------------------------------------------------------------- |
| 258 | ;;; Todo mode display options | 258 | ;;; Todo mode display options |
| @@ -281,17 +281,17 @@ These reflect the priorities of the items in each category." | |||
| 281 | 281 | ||
| 282 | (defun todo-mode-line-control (cat) | 282 | (defun todo-mode-line-control (cat) |
| 283 | "Return a mode line control for todo or archive file buffers. | 283 | "Return a mode line control for todo or archive file buffers. |
| 284 | Argument CAT is the name of the current Todo category. | 284 | Argument CAT is the name of the current todo category. |
| 285 | This function is the value of the user variable | 285 | This function is the value of the user variable |
| 286 | `todo-mode-line-function'." | 286 | `todo-mode-line-function'." |
| 287 | (let ((file (todo-short-file-name todo-current-todo-file))) | 287 | (let ((file (todo-short-file-name todo-current-todo-file))) |
| 288 | (format "%s category %d: %s" file todo-category-number cat))) | 288 | (format "%s category %d: %s" file todo-category-number cat))) |
| 289 | 289 | ||
| 290 | (defcustom todo-mode-line-function 'todo-mode-line-control | 290 | (defcustom todo-mode-line-function 'todo-mode-line-control |
| 291 | "Function that returns a mode line control for Todo buffers. | 291 | "Function that returns a mode line control for Todo mode buffers. |
| 292 | The function expects one argument holding the name of the current | 292 | The function expects one argument holding the name of the current |
| 293 | Todo category. The resulting control becomes the local value of | 293 | todo category. The resulting control becomes the local value of |
| 294 | `mode-line-buffer-identification' in each Todo buffer." | 294 | `mode-line-buffer-identification' in each Todo mode buffer." |
| 295 | :type 'function | 295 | :type 'function |
| 296 | :group 'todo-display) | 296 | :group 'todo-display) |
| 297 | 297 | ||
| @@ -370,7 +370,7 @@ shown in the Fancy Diary display." | |||
| 370 | (((class color) (min-colors 16) (background dark)) (:foreground "Aquamarine")) | 370 | (((class color) (min-colors 16) (background dark)) (:foreground "Aquamarine")) |
| 371 | (((class color) (min-colors 8)) (:foreground "magenta")) | 371 | (((class color) (min-colors 8)) (:foreground "magenta")) |
| 372 | (t (:weight bold :underline t))) | 372 | (t (:weight bold :underline t))) |
| 373 | "Face for Todo prefix or numerical priority string." | 373 | "Face for todo item prefix or numerical priority string." |
| 374 | :group 'todo-faces) | 374 | :group 'todo-faces) |
| 375 | 375 | ||
| 376 | (defface todo-top-priority | 376 | (defface todo-top-priority |
| @@ -385,7 +385,7 @@ shown in the Fancy Diary display." | |||
| 385 | (((class color) (min-colors 8) (background light)) :foreground "red") | 385 | (((class color) (min-colors 8) (background light)) :foreground "red") |
| 386 | (((class color) (min-colors 8) (background dark)) :foreground "yellow") | 386 | (((class color) (min-colors 8) (background dark)) :foreground "yellow") |
| 387 | (t :slant italic)) | 387 | (t :slant italic)) |
| 388 | "Face for top priority Todo item numerical priority string. | 388 | "Face for top priority todo item numerical priority string. |
| 389 | The item's priority number string has this face if the number is | 389 | The item's priority number string has this face if the number is |
| 390 | less than or equal the category's top priority setting." | 390 | less than or equal the category's top priority setting." |
| 391 | :group 'todo-faces) | 391 | :group 'todo-faces) |
| @@ -405,12 +405,12 @@ less than or equal the category's top priority setting." | |||
| 405 | 405 | ||
| 406 | (defface todo-date | 406 | (defface todo-date |
| 407 | '((t :inherit diary)) | 407 | '((t :inherit diary)) |
| 408 | "Face for the date string of a Todo item." | 408 | "Face for the date string of a todo item." |
| 409 | :group 'todo-faces) | 409 | :group 'todo-faces) |
| 410 | 410 | ||
| 411 | (defface todo-time | 411 | (defface todo-time |
| 412 | '((t :inherit diary-time)) | 412 | '((t :inherit diary-time)) |
| 413 | "Face for the time string of a Todo item." | 413 | "Face for the time string of a todo item." |
| 414 | :group 'todo-faces) | 414 | :group 'todo-faces) |
| 415 | 415 | ||
| 416 | (defface todo-diary-expired | 416 | (defface todo-diary-expired |
| @@ -440,7 +440,7 @@ less than or equal the category's top priority setting." | |||
| 440 | (((class color) (min-colors 16) (background dark)) :foreground "LightSteelBlue") | 440 | (((class color) (min-colors 16) (background dark)) :foreground "LightSteelBlue") |
| 441 | (((class color) (min-colors 8)) :foreground "blue" :weight bold) | 441 | (((class color) (min-colors 8)) :foreground "blue" :weight bold) |
| 442 | (t :weight bold)) | 442 | (t :weight bold)) |
| 443 | "Face for separator string bewteen done and not done Todo items." | 443 | "Face for separator string bewteen done and not done todo items." |
| 444 | :group 'todo-faces) | 444 | :group 'todo-faces) |
| 445 | 445 | ||
| 446 | (defface todo-done | 446 | (defface todo-done |
| @@ -453,7 +453,7 @@ less than or equal the category's top priority setting." | |||
| 453 | (((class color) (min-colors 16) (background dark)) :foreground "Cyan") | 453 | (((class color) (min-colors 16) (background dark)) :foreground "Cyan") |
| 454 | (((class color) (min-colors 8)) :foreground "cyan" :weight bold) | 454 | (((class color) (min-colors 8)) :foreground "cyan" :weight bold) |
| 455 | (t :weight bold)) | 455 | (t :weight bold)) |
| 456 | "Face for done Todo item header string." | 456 | "Face for done todo item header string." |
| 457 | :group 'todo-faces) | 457 | :group 'todo-faces) |
| 458 | 458 | ||
| 459 | (defface todo-comment | 459 | (defface todo-comment |
| @@ -475,7 +475,7 @@ less than or equal the category's top priority setting." | |||
| 475 | (((class color) (min-colors 8) (background dark)) | 475 | (((class color) (min-colors 8) (background dark)) |
| 476 | :foreground "yellow") | 476 | :foreground "yellow") |
| 477 | (t :weight bold :slant italic)) | 477 | (t :weight bold :slant italic)) |
| 478 | "Face for comments appended to done Todo items." | 478 | "Face for comments appended to done todo items." |
| 479 | :group 'todo-faces) | 479 | :group 'todo-faces) |
| 480 | 480 | ||
| 481 | (defface todo-search | 481 | (defface todo-search |
| @@ -565,14 +565,14 @@ less than or equal the category's top priority setting." | |||
| 565 | 565 | ||
| 566 | (defcustom todo-visit-files-commands (list 'find-file 'dired-find-file) | 566 | (defcustom todo-visit-files-commands (list 'find-file 'dired-find-file) |
| 567 | "List of file finding commands for `todo-display-as-todo-file'. | 567 | "List of file finding commands for `todo-display-as-todo-file'. |
| 568 | Invoking these commands to visit a Todo or Todo Archive file | 568 | Invoking these commands to visit a todo file or todo archive file |
| 569 | calls `todo-show' or `todo-find-archive', so that the file is | 569 | calls `todo-show' or `todo-find-archive', so that the file is |
| 570 | displayed correctly." | 570 | displayed correctly." |
| 571 | :type '(repeat function) | 571 | :type '(repeat function) |
| 572 | :group 'todo) | 572 | :group 'todo) |
| 573 | 573 | ||
| 574 | (defun todo-short-file-name (file) | 574 | (defun todo-short-file-name (file) |
| 575 | "Return short form of Todo FILE. | 575 | "Return the short form of todo file FILE's name. |
| 576 | This lacks the extension and directory components." | 576 | This lacks the extension and directory components." |
| 577 | (when (stringp file) | 577 | (when (stringp file) |
| 578 | (file-name-sans-extension (file-name-nondirectory file)))) | 578 | (file-name-sans-extension (file-name-nondirectory file)))) |
| @@ -586,7 +586,7 @@ This lacks the extension and directory components." | |||
| 586 | :group 'todo) | 586 | :group 'todo) |
| 587 | 587 | ||
| 588 | (defcustom todo-show-current-file t | 588 | (defcustom todo-show-current-file t |
| 589 | "Non-nil to make `todo-show' visit the current Todo file. | 589 | "Non-nil to make `todo-show' visit the current todo file. |
| 590 | Otherwise, `todo-show' always visits `todo-default-todo-file'." | 590 | Otherwise, `todo-show' always visits `todo-default-todo-file'." |
| 591 | :type 'boolean | 591 | :type 'boolean |
| 592 | :initialize 'custom-initialize-default | 592 | :initialize 'custom-initialize-default |
| @@ -608,12 +608,12 @@ Otherwise, `todo-show' always visits `todo-default-todo-file'." | |||
| 608 | :group 'todo-edit) | 608 | :group 'todo-edit) |
| 609 | 609 | ||
| 610 | (defcustom todo-initial-file "Todo" | 610 | (defcustom todo-initial-file "Todo" |
| 611 | "Default file name offered on adding first Todo file." | 611 | "Default file name offered on adding first todo file." |
| 612 | :type 'string | 612 | :type 'string |
| 613 | :group 'todo) | 613 | :group 'todo) |
| 614 | 614 | ||
| 615 | (defcustom todo-initial-category "Todo" | 615 | (defcustom todo-initial-category "Todo" |
| 616 | "Default category name offered on initializing a new Todo file." | 616 | "Default category name offered on initializing a new todo file." |
| 617 | :type 'string | 617 | :type 'string |
| 618 | :group 'todo) | 618 | :group 'todo) |
| 619 | 619 | ||
| @@ -644,14 +644,14 @@ file was last visited. | |||
| 644 | If you call this command before you have created any todo file in | 644 | If you call this command before you have created any todo file in |
| 645 | the current format, and you have an todo file in old format, it | 645 | the current format, and you have an todo file in old format, it |
| 646 | will ask you whether to convert that file and show it. | 646 | will ask you whether to convert that file and show it. |
| 647 | Otherwise, calling this command before any Todo file exists | 647 | Otherwise, calling this command before any todo file exists |
| 648 | prompts for a file name and an initial category (defaulting to | 648 | prompts for a file name and an initial category (defaulting to |
| 649 | `todo-initial-file' and `todo-initial-category'), creates both of | 649 | `todo-initial-file' and `todo-initial-category'), creates both of |
| 650 | these, visits the file and displays the category, and if option | 650 | these, visits the file and displays the category, and if option |
| 651 | `todo-add-item-if-new-category' is non-nil (the default), prompts | 651 | `todo-add-item-if-new-category' is non-nil (the default), prompts |
| 652 | for the first item. | 652 | for the first item. |
| 653 | 653 | ||
| 654 | The first invocation of this command on an existing Todo file | 654 | The first invocation of this command on an existing todo file |
| 655 | interacts with the option `todo-show-first': if its value is | 655 | interacts with the option `todo-show-first': if its value is |
| 656 | `first' (the default), show the first category in the file; if | 656 | `first' (the default), show the first category in the file; if |
| 657 | its value is `table', show the table of categories in the file; | 657 | its value is `table', show the table of categories in the file; |
| @@ -667,7 +667,7 @@ items. With non-nil user option `todo-show-with-done' both todo | |||
| 667 | and done items are always shown on visiting a category. | 667 | and done items are always shown on visiting a category. |
| 668 | 668 | ||
| 669 | Invoking this command in Todo Archive mode visits the | 669 | Invoking this command in Todo Archive mode visits the |
| 670 | corresponding Todo file, displaying the corresponding category." | 670 | corresponding todo file, displaying the corresponding category." |
| 671 | (interactive "P") | 671 | (interactive "P") |
| 672 | (catch 'shown | 672 | (catch 'shown |
| 673 | ;; If there is a legacy todo file but no todo file in the current | 673 | ;; If there is a legacy todo file but no todo file in the current |
| @@ -689,9 +689,9 @@ corresponding Todo file, displaying the corresponding category." | |||
| 689 | todo-archive-mode | 689 | todo-archive-mode |
| 690 | todo-filtered-items-mode)))) | 690 | todo-filtered-items-mode)))) |
| 691 | (if (funcall todo-files-function) | 691 | (if (funcall todo-files-function) |
| 692 | (todo-read-file-name "Choose a Todo file to visit: " | 692 | (todo-read-file-name "Choose a todo file to visit: " |
| 693 | nil t) | 693 | nil t) |
| 694 | (user-error "There are no Todo files"))) | 694 | (user-error "There are no todo files"))) |
| 695 | ((and (eq major-mode 'todo-archive-mode) | 695 | ((and (eq major-mode 'todo-archive-mode) |
| 696 | ;; Called noninteractively via todo-quit | 696 | ;; Called noninteractively via todo-quit |
| 697 | ;; to jump to corresponding category in | 697 | ;; to jump to corresponding category in |
| @@ -748,11 +748,11 @@ corresponding Todo file, displaying the corresponding category." | |||
| 748 | (eq todo-show-first 'first)) | 748 | (eq todo-show-first 'first)) |
| 749 | (set-window-buffer (selected-window) | 749 | (set-window-buffer (selected-window) |
| 750 | (set-buffer (find-file-noselect file 'nowarn))) | 750 | (set-buffer (find-file-noselect file 'nowarn))) |
| 751 | ;; When quitting archive file, show corresponding category in | 751 | ;; When quitting an archive file, show the corresponding |
| 752 | ;; Todo file, if it exists. | 752 | ;; category in the corresponding todo file, if it exists. |
| 753 | (when (assoc cat todo-categories) | 753 | (when (assoc cat todo-categories) |
| 754 | (setq todo-category-number (todo-category-number cat))) | 754 | (setq todo-category-number (todo-category-number cat))) |
| 755 | ;; If this is a new Todo file, add its first category. | 755 | ;; If this is a new todo file, add its first category. |
| 756 | (when (zerop (buffer-size)) | 756 | (when (zerop (buffer-size)) |
| 757 | (let (cat-added) | 757 | (let (cat-added) |
| 758 | (unwind-protect | 758 | (unwind-protect |
| @@ -781,7 +781,7 @@ corresponding Todo file, displaying the corresponding category." | |||
| 781 | (add-to-list 'todo-visited file)))) | 781 | (add-to-list 'todo-visited file)))) |
| 782 | 782 | ||
| 783 | (defun todo-save () | 783 | (defun todo-save () |
| 784 | "Save the current Todo file." | 784 | "Save the current todo file." |
| 785 | (interactive) | 785 | (interactive) |
| 786 | (cond ((eq major-mode 'todo-filtered-items-mode) | 786 | (cond ((eq major-mode 'todo-filtered-items-mode) |
| 787 | (todo-check-filtered-items-file) | 787 | (todo-check-filtered-items-file) |
| @@ -842,7 +842,7 @@ todo file." | |||
| 842 | :group 'todo-display) | 842 | :group 'todo-display) |
| 843 | 843 | ||
| 844 | (defun todo-forward-category (&optional back) | 844 | (defun todo-forward-category (&optional back) |
| 845 | "Visit the numerically next category in this Todo file. | 845 | "Visit the numerically next category in this todo file. |
| 846 | If the current category is the highest numbered, visit the first | 846 | If the current category is the highest numbered, visit the first |
| 847 | category. With non-nil argument BACK, visit the numerically | 847 | category. With non-nil argument BACK, visit the numerically |
| 848 | previous category (the highest numbered one, if the current | 848 | previous category (the highest numbered one, if the current |
| @@ -861,7 +861,7 @@ category is the first)." | |||
| 861 | (goto-char (point-min))) | 861 | (goto-char (point-min))) |
| 862 | 862 | ||
| 863 | (defun todo-backward-category () | 863 | (defun todo-backward-category () |
| 864 | "Visit the numerically previous category in this Todo file. | 864 | "Visit the numerically previous category in this todo file. |
| 865 | If the current category is the highest numbered, visit the first | 865 | If the current category is the highest numbered, visit the first |
| 866 | category." | 866 | category." |
| 867 | (interactive) | 867 | (interactive) |
| @@ -870,12 +870,12 @@ category." | |||
| 870 | (defvar todo-categories-buffer) | 870 | (defvar todo-categories-buffer) |
| 871 | 871 | ||
| 872 | (defun todo-jump-to-category (&optional file where) | 872 | (defun todo-jump-to-category (&optional file where) |
| 873 | "Prompt for a category in a Todo file and jump to it. | 873 | "Prompt for a category in a todo file and jump to it. |
| 874 | 874 | ||
| 875 | With non-nil FILE (interactively a prefix argument), prompt for a | 875 | With non-nil FILE (interactively a prefix argument), prompt for a |
| 876 | specific Todo file and choose (with TAB completion) a category | 876 | specific todo file and choose (with TAB completion) a category |
| 877 | in it to jump to; otherwise, choose and jump to any category in | 877 | in it to jump to; otherwise, choose and jump to any category in |
| 878 | either the current Todo file or a file in | 878 | either the current todo file or a file in |
| 879 | `todo-category-completions-files'. | 879 | `todo-category-completions-files'. |
| 880 | 880 | ||
| 881 | Also accept a non-existing category name and ask whether to add a | 881 | Also accept a non-existing category name and ask whether to add a |
| @@ -946,8 +946,8 @@ it moves point to the first done item; but if called with point | |||
| 946 | on the last todo item without a prefix argument, it moves point | 946 | on the last todo item without a prefix argument, it moves point |
| 947 | the the empty line above the done items separator." | 947 | the the empty line above the done items separator." |
| 948 | (interactive "p") | 948 | (interactive "p") |
| 949 | ;; It's not worth the trouble to allow prefix arg value < 1, since we have | 949 | ;; It's not worth the trouble to allow prefix arg value < 1, since |
| 950 | ;; the corresponding command. | 950 | ;; we have the corresponding command. |
| 951 | (cond ((and current-prefix-arg (< count 1)) | 951 | (cond ((and current-prefix-arg (< count 1)) |
| 952 | (user-error "The prefix argument must be a positive number")) | 952 | (user-error "The prefix argument must be a positive number")) |
| 953 | (current-prefix-arg | 953 | (current-prefix-arg |
| @@ -969,8 +969,8 @@ empty line above the done items separator." | |||
| 969 | (interactive "p") | 969 | (interactive "p") |
| 970 | ;; Avoid moving to bob if on the first item but not at bob. | 970 | ;; Avoid moving to bob if on the first item but not at bob. |
| 971 | (when (> (line-number-at-pos) 1) | 971 | (when (> (line-number-at-pos) 1) |
| 972 | ;; It's not worth the trouble to allow prefix arg value < 1, since we have | 972 | ;; It's not worth the trouble to allow prefix arg value < 1, since |
| 973 | ;; the corresponding command. | 973 | ;; we have the corresponding command. |
| 974 | (cond ((and current-prefix-arg (< count 1)) | 974 | (cond ((and current-prefix-arg (< count 1)) |
| 975 | (user-error "The prefix argument must be a positive number")) | 975 | (user-error "The prefix argument must be a positive number")) |
| 976 | (current-prefix-arg | 976 | (current-prefix-arg |
| @@ -1063,13 +1063,13 @@ the the original date-time string." | |||
| 1063 | ;; ----------------------------------------------------------------------------- | 1063 | ;; ----------------------------------------------------------------------------- |
| 1064 | 1064 | ||
| 1065 | (defun todo-add-file () | 1065 | (defun todo-add-file () |
| 1066 | "Name and initialize a new Todo file. | 1066 | "Name and initialize a new todo file. |
| 1067 | Interactively, prompt for a category and display it, and if | 1067 | Interactively, prompt for a category and display it, and if |
| 1068 | option `todo-add-item-if-new-category' is non-nil (the default), | 1068 | option `todo-add-item-if-new-category' is non-nil (the default), |
| 1069 | prompt for the first item. | 1069 | prompt for the first item. |
| 1070 | Noninteractively, return the name of the new file." | 1070 | Noninteractively, return the name of the new file." |
| 1071 | (interactive) | 1071 | (interactive) |
| 1072 | (let ((prompt (concat "Enter name of new Todo file " | 1072 | (let ((prompt (concat "Enter name of new todo file " |
| 1073 | "(TAB or SPC to see current names): ")) | 1073 | "(TAB or SPC to see current names): ")) |
| 1074 | file) | 1074 | file) |
| 1075 | (setq file (todo-read-file-name prompt)) | 1075 | (setq file (todo-read-file-name prompt)) |
| @@ -1109,17 +1109,17 @@ this command should be used with caution." | |||
| 1109 | "validity and return to Todo mode.\n")))) | 1109 | "validity and return to Todo mode.\n")))) |
| 1110 | 1110 | ||
| 1111 | (defun todo-add-category (&optional file cat) | 1111 | (defun todo-add-category (&optional file cat) |
| 1112 | "Add a new category to a Todo file. | 1112 | "Add a new category to a todo file. |
| 1113 | 1113 | ||
| 1114 | Called interactively with prefix argument FILE, prompt for a file | 1114 | Called interactively with prefix argument FILE, prompt for a file |
| 1115 | and then for a new category to add to that file, otherwise prompt | 1115 | and then for a new category to add to that file, otherwise prompt |
| 1116 | just for a category to add to the current Todo file. After | 1116 | just for a category to add to the current todo file. After |
| 1117 | adding the category, visit it in Todo mode and if option | 1117 | adding the category, visit it in Todo mode and if option |
| 1118 | `todo-add-item-if-new-category' is non-nil (the default), prompt | 1118 | `todo-add-item-if-new-category' is non-nil (the default), prompt |
| 1119 | for the first item. | 1119 | for the first item. |
| 1120 | 1120 | ||
| 1121 | Non-interactively, add category CAT to file FILE; if FILE is nil, | 1121 | Non-interactively, add category CAT to file FILE; if FILE is nil, |
| 1122 | add CAT to the current Todo file. After adding the category, | 1122 | add CAT to the current todo file. After adding the category, |
| 1123 | return the new category number." | 1123 | return the new category number." |
| 1124 | (interactive "P") | 1124 | (interactive "P") |
| 1125 | (let (catfil file0) | 1125 | (let (catfil file0) |
| @@ -1159,7 +1159,7 @@ return the new category number." | |||
| 1159 | num)))) | 1159 | num)))) |
| 1160 | 1160 | ||
| 1161 | (defun todo-rename-category () | 1161 | (defun todo-rename-category () |
| 1162 | "Rename current Todo category. | 1162 | "Rename current todo category. |
| 1163 | If this file has an archive containing this category, rename the | 1163 | If this file has an archive containing this category, rename the |
| 1164 | category there as well." | 1164 | category there as well." |
| 1165 | (interactive) | 1165 | (interactive) |
| @@ -1190,7 +1190,7 @@ category there as well." | |||
| 1190 | (save-excursion (todo-category-select))) | 1190 | (save-excursion (todo-category-select))) |
| 1191 | 1191 | ||
| 1192 | (defun todo-delete-category (&optional arg) | 1192 | (defun todo-delete-category (&optional arg) |
| 1193 | "Delete current Todo category provided it is empty. | 1193 | "Delete current todo category provided it is empty. |
| 1194 | With ARG non-nil delete the category unconditionally, | 1194 | With ARG non-nil delete the category unconditionally, |
| 1195 | i.e. including all existing todo and done items." | 1195 | i.e. including all existing todo and done items." |
| 1196 | (interactive "P") | 1196 | (interactive "P") |
| @@ -1241,7 +1241,7 @@ i.e. including all existing todo and done items." | |||
| 1241 | (set-buffer-modified-p nil) | 1241 | (set-buffer-modified-p nil) |
| 1242 | (delete-file file) | 1242 | (delete-file file) |
| 1243 | (kill-buffer) | 1243 | (kill-buffer) |
| 1244 | (message "Deleted Todo file %s." file)) | 1244 | (message "Deleted todo file %s." file)) |
| 1245 | (setq todo-categories (delete (assoc cat todo-categories) | 1245 | (setq todo-categories (delete (assoc cat todo-categories) |
| 1246 | todo-categories)) | 1246 | todo-categories)) |
| 1247 | (todo-update-categories-sexp) | 1247 | (todo-update-categories-sexp) |
| @@ -1252,7 +1252,7 @@ i.e. including all existing todo and done items." | |||
| 1252 | (message "Deleted category %s." cat))))))) | 1252 | (message "Deleted category %s." cat))))))) |
| 1253 | 1253 | ||
| 1254 | (defun todo-move-category () | 1254 | (defun todo-move-category () |
| 1255 | "Move current category to a different Todo file. | 1255 | "Move current category to a different todo file. |
| 1256 | If current category has archived items, also move those to the | 1256 | If current category has archived items, also move those to the |
| 1257 | archive of the file moved to, creating it if it does not exist." | 1257 | archive of the file moved to, creating it if it does not exist." |
| 1258 | (interactive) | 1258 | (interactive) |
| @@ -1263,7 +1263,7 @@ archive of the file moved to, creating it if it does not exist." | |||
| 1263 | (let* ((ofile todo-current-todo-file) | 1263 | (let* ((ofile todo-current-todo-file) |
| 1264 | (cat (todo-current-category)) | 1264 | (cat (todo-current-category)) |
| 1265 | (nfile (todo-read-file-name | 1265 | (nfile (todo-read-file-name |
| 1266 | "Choose a Todo file to move this category to: " nil t)) | 1266 | "Choose a todo file to move this category to: " nil t)) |
| 1267 | (archive (concat (file-name-sans-extension ofile) ".toda")) | 1267 | (archive (concat (file-name-sans-extension ofile) ".toda")) |
| 1268 | (buffers (append (list ofile) | 1268 | (buffers (append (list ofile) |
| 1269 | (unless (zerop (todo-get-count 'archived cat)) | 1269 | (unless (zerop (todo-get-count 'archived cat)) |
| @@ -1315,7 +1315,7 @@ archive of the file moved to, creating it if it does not exist." | |||
| 1315 | (funcall todo-files-function t)) | 1315 | (funcall todo-files-function t)) |
| 1316 | (setq new (read-from-minibuffer prompt)) | 1316 | (setq new (read-from-minibuffer prompt)) |
| 1317 | (setq new (todo-validate-name new 'category)))) | 1317 | (setq new (todo-validate-name new 'category)))) |
| 1318 | ;; Replace old with new name in Todo and archive files. | 1318 | ;; Replace old with new name in todo and archive files. |
| 1319 | (when new | 1319 | (when new |
| 1320 | (goto-char (point-max)) | 1320 | (goto-char (point-max)) |
| 1321 | (re-search-backward | 1321 | (re-search-backward |
| @@ -1360,10 +1360,10 @@ archive of the file moved to, creating it if it does not exist." | |||
| 1360 | (defun todo-merge-category (&optional file) | 1360 | (defun todo-merge-category (&optional file) |
| 1361 | "Merge current category into another existing category. | 1361 | "Merge current category into another existing category. |
| 1362 | 1362 | ||
| 1363 | With prefix argument FILE, prompt for a specific Todo file and | 1363 | With prefix argument FILE, prompt for a specific todo file and |
| 1364 | choose (with TAB completion) a category in it to merge into; | 1364 | choose (with TAB completion) a category in it to merge into; |
| 1365 | otherwise, choose and merge into a category in either the | 1365 | otherwise, choose and merge into a category in either the |
| 1366 | current Todo file or a file in `todo-category-completions-files'. | 1366 | current todo file or a file in `todo-category-completions-files'. |
| 1367 | 1367 | ||
| 1368 | After merging, the current category's todo and done items are | 1368 | After merging, the current category's todo and done items are |
| 1369 | appended to the chosen goal category's todo and done items, | 1369 | appended to the chosen goal category's todo and done items, |
| @@ -1501,12 +1501,12 @@ category." | |||
| 1501 | ;; ----------------------------------------------------------------------------- | 1501 | ;; ----------------------------------------------------------------------------- |
| 1502 | 1502 | ||
| 1503 | (defcustom todo-include-in-diary nil | 1503 | (defcustom todo-include-in-diary nil |
| 1504 | "Non-nil to allow new Todo items to be included in the diary." | 1504 | "Non-nil to allow new todo items to be included in the diary." |
| 1505 | :type 'boolean | 1505 | :type 'boolean |
| 1506 | :group 'todo-edit) | 1506 | :group 'todo-edit) |
| 1507 | 1507 | ||
| 1508 | (defcustom todo-diary-nonmarking nil | 1508 | (defcustom todo-diary-nonmarking nil |
| 1509 | "Non-nil to insert new Todo diary items as nonmarking by default. | 1509 | "Non-nil to insert new todo diary items as nonmarking by default. |
| 1510 | This appends `diary-nonmarking-symbol' to the front of an item on | 1510 | This appends `diary-nonmarking-symbol' to the front of an item on |
| 1511 | insertion provided it doesn't begin with `todo-nondiary-marker'." | 1511 | insertion provided it doesn't begin with `todo-nondiary-marker'." |
| 1512 | :type 'boolean | 1512 | :type 'boolean |
| @@ -1514,7 +1514,7 @@ insertion provided it doesn't begin with `todo-nondiary-marker'." | |||
| 1514 | 1514 | ||
| 1515 | (defcustom todo-always-add-time-string nil | 1515 | (defcustom todo-always-add-time-string nil |
| 1516 | "Non-nil adds current time to a new item's date header by default. | 1516 | "Non-nil adds current time to a new item's date header by default. |
| 1517 | When the Todo insertion commands have a non-nil \"maybe-notime\" | 1517 | When the todo insertion commands have a non-nil \"maybe-notime\" |
| 1518 | argument, this reverses the effect of | 1518 | argument, this reverses the effect of |
| 1519 | `todo-always-add-time-string': if t, these commands omit the | 1519 | `todo-always-add-time-string': if t, these commands omit the |
| 1520 | current time, if nil, they include it." | 1520 | current time, if nil, they include it." |
| @@ -1624,8 +1624,8 @@ marking of the next N items." | |||
| 1624 | 1624 | ||
| 1625 | (defun todo-basic-insert-item (&optional arg diary nonmarking date-type time | 1625 | (defun todo-basic-insert-item (&optional arg diary nonmarking date-type time |
| 1626 | region-or-here) | 1626 | region-or-here) |
| 1627 | "Insert a new Todo item into a category. | 1627 | "Insert a new todo item into a category. |
| 1628 | This is the function from which the generated Todo item | 1628 | This is the function from which the generated Todo mode item |
| 1629 | insertion commands derive. | 1629 | insertion commands derive. |
| 1630 | 1630 | ||
| 1631 | The generated commands have mnenomic key bindings based on the | 1631 | The generated commands have mnenomic key bindings based on the |
| @@ -1645,10 +1645,10 @@ is not given by HERE but by prompting. | |||
| 1645 | In command invocations, ARG is passed as a prefix argument as | 1645 | In command invocations, ARG is passed as a prefix argument as |
| 1646 | follows. With no prefix argument, add the item to the current | 1646 | follows. With no prefix argument, add the item to the current |
| 1647 | category; with one prefix argument (`C-u'), prompt for a category | 1647 | category; with one prefix argument (`C-u'), prompt for a category |
| 1648 | from the current Todo file; with two prefix arguments (`C-u C-u'), | 1648 | from the current todo file; with two prefix arguments (`C-u C-u'), |
| 1649 | first prompt for a Todo file, then a category in that file. If | 1649 | first prompt for a todo file, then a category in that file. If |
| 1650 | a non-existing category is entered, ask whether to add it to the | 1650 | a non-existing category is entered, ask whether to add it to the |
| 1651 | Todo file; if answered affirmatively, add the category and | 1651 | todo file; if answered affirmatively, add the category and |
| 1652 | insert the item there. | 1652 | insert the item there. |
| 1653 | 1653 | ||
| 1654 | The remaining arguments are set or left nil by the generated item | 1654 | The remaining arguments are set or left nil by the generated item |
| @@ -1778,11 +1778,11 @@ the new item: | |||
| 1778 | (find-file-noselect file 'nowarn) | 1778 | (find-file-noselect file 'nowarn) |
| 1779 | (set-window-buffer (selected-window) | 1779 | (set-window-buffer (selected-window) |
| 1780 | (set-buffer (find-buffer-visiting file))) | 1780 | (set-buffer (find-buffer-visiting file))) |
| 1781 | ;; If this command was invoked outside of a Todo buffer, the | 1781 | ;; If this command was invoked outside of a Todo mode buffer, |
| 1782 | ;; call to todo-current-category above returned nil. If we | 1782 | ;; the call to todo-current-category above returned nil. If |
| 1783 | ;; just entered Todo mode now, then cat was set to the file's | 1783 | ;; we just entered Todo mode now, then cat was set to the |
| 1784 | ;; first category, but if todo-mode was already enabled, cat | 1784 | ;; file's first category, but if todo-mode was already |
| 1785 | ;; did not get set, so we have to set it explicitly. | 1785 | ;; enabled, cat did not get set, so we have to do that. |
| 1786 | (unless cat | 1786 | (unless cat |
| 1787 | (setq cat (todo-current-category))) | 1787 | (setq cat (todo-current-category))) |
| 1788 | (setq todo-current-todo-file file) | 1788 | (setq todo-current-todo-file file) |
| @@ -1966,7 +1966,7 @@ the item at point." | |||
| 1966 | (if ov (delete-overlay ov))))) | 1966 | (if ov (delete-overlay ov))))) |
| 1967 | 1967 | ||
| 1968 | (defun todo-edit-item (&optional arg) | 1968 | (defun todo-edit-item (&optional arg) |
| 1969 | "Edit the Todo item at point. | 1969 | "Edit the todo item at point. |
| 1970 | With non-nil prefix argument ARG, include the item's date/time | 1970 | With non-nil prefix argument ARG, include the item's date/time |
| 1971 | header, making it also editable; otherwise, include only the item | 1971 | header, making it also editable; otherwise, include only the item |
| 1972 | content. | 1972 | content. |
| @@ -2010,7 +2010,7 @@ minibuffer; otherwise, edit it in Todo Edit mode." | |||
| 2010 | (move-to-column item-beg)))))) | 2010 | (move-to-column item-beg)))))) |
| 2011 | 2011 | ||
| 2012 | (defun todo-edit-multiline-item () | 2012 | (defun todo-edit-multiline-item () |
| 2013 | "Edit current Todo item in Todo Edit mode. | 2013 | "Edit current todo item in Todo Edit mode. |
| 2014 | Use of newlines invokes `todo-indent' to insure compliance with | 2014 | Use of newlines invokes `todo-indent' to insure compliance with |
| 2015 | the format of Diary entries." | 2015 | the format of Diary entries." |
| 2016 | (interactive) | 2016 | (interactive) |
| @@ -2031,9 +2031,9 @@ lines are indented by `todo-indent-to-here' to conform to diary | |||
| 2031 | format. | 2031 | format. |
| 2032 | 2032 | ||
| 2033 | If the whole file was in Todo Edit mode, check before returning | 2033 | If the whole file was in Todo Edit mode, check before returning |
| 2034 | whether the file is still a valid Todo file and if so, also | 2034 | whether the file is still a valid todo file and if so, also |
| 2035 | recalculate the Todo categories sexp, in case changes were made | 2035 | recalculate the todo file's categories sexp, in case changes were |
| 2036 | in the number or names of categories." | 2036 | made in the number or names of categories." |
| 2037 | (interactive) | 2037 | (interactive) |
| 2038 | (if (> (buffer-size) (- (point-max) (point-min))) | 2038 | (if (> (buffer-size) (- (point-max) (point-min))) |
| 2039 | ;; We got here via `e m'. | 2039 | ;; We got here via `e m'. |
| @@ -2578,15 +2578,15 @@ meaning to raise or lower the item's priority by one." | |||
| 2578 | If there are marked items, move all of these; otherwise, move | 2578 | If there are marked items, move all of these; otherwise, move |
| 2579 | the item at point. | 2579 | the item at point. |
| 2580 | 2580 | ||
| 2581 | With prefix argument FILE, prompt for a specific Todo file and | 2581 | With prefix argument FILE, prompt for a specific todo file and |
| 2582 | choose (with TAB completion) a category in it to move the item or | 2582 | choose (with TAB completion) a category in it to move the item or |
| 2583 | items to; otherwise, choose and move to any category in either | 2583 | items to; otherwise, choose and move to any category in either |
| 2584 | the current Todo file or one of the files in | 2584 | the current todo file or one of the files in |
| 2585 | `todo-category-completions-files'. If the chosen category is | 2585 | `todo-category-completions-files'. If the chosen category is |
| 2586 | not an existing categories, then it is created and the item(s) | 2586 | not an existing categories, then it is created and the item(s) |
| 2587 | become(s) the first entry/entries in that category. | 2587 | become(s) the first entry/entries in that category. |
| 2588 | 2588 | ||
| 2589 | With moved Todo items, prompt to set the priority in the category | 2589 | With moved todo items, prompt to set the priority in the category |
| 2590 | moved to (with multiple todo items, the one that had the highest | 2590 | moved to (with multiple todo items, the one that had the highest |
| 2591 | priority in the category moved from gets the new priority and the | 2591 | priority in the category moved from gets the new priority and the |
| 2592 | rest of the moved todo items are inserted in sequence below it). | 2592 | rest of the moved todo items are inserted in sequence below it). |
| @@ -2948,7 +2948,7 @@ comments without asking." | |||
| 2948 | ;; ----------------------------------------------------------------------------- | 2948 | ;; ----------------------------------------------------------------------------- |
| 2949 | 2949 | ||
| 2950 | (defun todo-find-archive (&optional ask) | 2950 | (defun todo-find-archive (&optional ask) |
| 2951 | "Visit the archive of the current Todo category, if it exists. | 2951 | "Visit the archive of the current todo category, if it exists. |
| 2952 | If the category has no archived items, prompt to visit the | 2952 | If the category has no archived items, prompt to visit the |
| 2953 | archive anyway. If there is no archive for this file or with | 2953 | archive anyway. If there is no archive for this file or with |
| 2954 | non-nil argument ASK, prompt to visit another archive. | 2954 | non-nil argument ASK, prompt to visit another archive. |
| @@ -2970,7 +2970,7 @@ displayed." | |||
| 2970 | "visit another archive? ")) | 2970 | "visit another archive? ")) |
| 2971 | 'other-archive)))) | 2971 | 'other-archive)))) |
| 2972 | (when (eq place 'other-archive) | 2972 | (when (eq place 'other-archive) |
| 2973 | (setq archive (todo-read-file-name "Choose a Todo archive: " t t))) | 2973 | (setq archive (todo-read-file-name "Choose a todo archive: " t t))) |
| 2974 | (when (and (eq place 'this-archive) (zerop count)) | 2974 | (when (and (eq place 'this-archive) (zerop count)) |
| 2975 | (setq place (when (todo-y-or-n-p | 2975 | (setq place (when (todo-y-or-n-p |
| 2976 | (concat "This category has no archived items;" | 2976 | (concat "This category has no archived items;" |
| @@ -3134,7 +3134,7 @@ If there are marked items, unarchive all of these; otherwise, | |||
| 3134 | unarchive the item at point. | 3134 | unarchive the item at point. |
| 3135 | 3135 | ||
| 3136 | Unarchived items are restored as done items to the corresponding | 3136 | Unarchived items are restored as done items to the corresponding |
| 3137 | category in the Todo file, inserted at the top of done items | 3137 | category in the todo file, inserted at the top of done items |
| 3138 | section. If all items in the archive category have been | 3138 | section. If all items in the archive category have been |
| 3139 | restored, the category is deleted from the archive. If this was | 3139 | restored, the category is deleted from the archive. If this was |
| 3140 | the only category in the archive, the archive file is deleted." | 3140 | the only category in the archive, the archive file is deleted." |
| @@ -3220,7 +3220,7 @@ the only category in the archive, the archive file is deleted." | |||
| 3220 | (setq todo-categories (delete (assoc cat todo-categories) | 3220 | (setq todo-categories (delete (assoc cat todo-categories) |
| 3221 | todo-categories)) | 3221 | todo-categories)) |
| 3222 | (todo-update-categories-sexp)))) | 3222 | (todo-update-categories-sexp)))) |
| 3223 | ;; Visit category in Todo file and show restored done items. | 3223 | ;; Visit category in todo file and show restored done items. |
| 3224 | (let ((tfile (buffer-file-name tbuf)) | 3224 | (let ((tfile (buffer-file-name tbuf)) |
| 3225 | (todo-show-with-done t)) | 3225 | (todo-show-with-done t)) |
| 3226 | (set-window-buffer (selected-window) | 3226 | (set-window-buffer (selected-window) |
| @@ -3230,7 +3230,7 @@ the only category in the archive, the archive file is deleted." | |||
| 3230 | (message "Items unarchived."))))) | 3230 | (message "Items unarchived."))))) |
| 3231 | 3231 | ||
| 3232 | (defun todo-jump-to-archive-category (&optional file) | 3232 | (defun todo-jump-to-archive-category (&optional file) |
| 3233 | "Prompt for a category in a Todo archive and jump to it. | 3233 | "Prompt for a category in a todo archive and jump to it. |
| 3234 | With prefix argument FILE, prompt for an archive and choose (with | 3234 | With prefix argument FILE, prompt for an archive and choose (with |
| 3235 | TAB completion) a category in it to jump to; otherwise, choose | 3235 | TAB completion) a category in it to jump to; otherwise, choose |
| 3236 | and jump to any category in the current archive." | 3236 | and jump to any category in the current archive." |
| @@ -3384,12 +3384,12 @@ decreasing or increasing its number." | |||
| 3384 | (forward-char col)))))) | 3384 | (forward-char col)))))) |
| 3385 | 3385 | ||
| 3386 | (defun todo-raise-category () | 3386 | (defun todo-raise-category () |
| 3387 | "Raise priority of category at point in Todo Categories buffer." | 3387 | "Raise priority of category at point in the table of categories." |
| 3388 | (interactive) | 3388 | (interactive) |
| 3389 | (todo-set-category-number 'raise)) | 3389 | (todo-set-category-number 'raise)) |
| 3390 | 3390 | ||
| 3391 | (defun todo-lower-category () | 3391 | (defun todo-lower-category () |
| 3392 | "Lower priority of category at point in Todo Categories buffer." | 3392 | "Lower priority of category at point in the table of categories." |
| 3393 | (interactive) | 3393 | (interactive) |
| 3394 | (todo-set-category-number 'lower)) | 3394 | (todo-set-category-number 'lower)) |
| 3395 | 3395 | ||
| @@ -3638,7 +3638,7 @@ which is the value of the user option | |||
| 3638 | (let ((archive (member todo-current-todo-file todo-archives)) | 3638 | (let ((archive (member todo-current-todo-file todo-archives)) |
| 3639 | buffer-read-only) | 3639 | buffer-read-only) |
| 3640 | (erase-buffer) | 3640 | (erase-buffer) |
| 3641 | (insert (format (concat "Category counts for Todo " | 3641 | (insert (format (concat "Category counts for todo " |
| 3642 | (if archive "archive" "file") | 3642 | (if archive "archive" "file") |
| 3643 | " \"%s\".") | 3643 | " \"%s\".") |
| 3644 | (todo-short-file-name todo-current-todo-file))) | 3644 | (todo-short-file-name todo-current-todo-file))) |
| @@ -3709,7 +3709,7 @@ which is the value of the user option | |||
| 3709 | ;; ----------------------------------------------------------------------------- | 3709 | ;; ----------------------------------------------------------------------------- |
| 3710 | 3710 | ||
| 3711 | (defun todo-search () | 3711 | (defun todo-search () |
| 3712 | "Search for a regular expression in this Todo file. | 3712 | "Search for a regular expression in this todo file. |
| 3713 | The search runs through the whole file and encompasses all and | 3713 | The search runs through the whole file and encompasses all and |
| 3714 | only todo and done items; it excludes category names. Multiple | 3714 | only todo and done items; it excludes category names. Multiple |
| 3715 | matches are shown sequentially, highlighted in `todo-search' | 3715 | matches are shown sequentially, highlighted in `todo-search' |
| @@ -3824,7 +3824,7 @@ See `todo-set-top-priorities' for more details." | |||
| 3824 | 3824 | ||
| 3825 | (defun todo-filter-top-priorities (&optional arg) | 3825 | (defun todo-filter-top-priorities (&optional arg) |
| 3826 | "Display a list of top priority items from different categories. | 3826 | "Display a list of top priority items from different categories. |
| 3827 | The categories can be any of those in the current Todo file. | 3827 | The categories can be any of those in the current todo file. |
| 3828 | 3828 | ||
| 3829 | With numerical prefix ARG show at most ARG top priority items | 3829 | With numerical prefix ARG show at most ARG top priority items |
| 3830 | from each category. With `C-u' as prefix argument show the | 3830 | from each category. With `C-u' as prefix argument show the |
| @@ -3832,7 +3832,7 @@ numbers of top priority items specified by category in | |||
| 3832 | `todo-top-priorities-overrides', if this has an entry for the file(s); | 3832 | `todo-top-priorities-overrides', if this has an entry for the file(s); |
| 3833 | otherwise show `todo-top-priorities' items per category in the | 3833 | otherwise show `todo-top-priorities' items per category in the |
| 3834 | file(s). With no prefix argument, if a top priorities file for | 3834 | file(s). With no prefix argument, if a top priorities file for |
| 3835 | the current Todo file has previously been saved (see | 3835 | the current todo file has previously been saved (see |
| 3836 | `todo-save-filtered-items-buffer'), visit this file; if there is | 3836 | `todo-save-filtered-items-buffer'), visit this file; if there is |
| 3837 | no such file, build the list as with prefix argument `C-u'. | 3837 | no such file, build the list as with prefix argument `C-u'. |
| 3838 | 3838 | ||
| @@ -3852,7 +3852,7 @@ from each category in each file. With `C-u' as prefix argument | |||
| 3852 | show the numbers of top priority items specified in | 3852 | show the numbers of top priority items specified in |
| 3853 | `todo-top-priorities-overrides', if this is non-nil; otherwise show | 3853 | `todo-top-priorities-overrides', if this is non-nil; otherwise show |
| 3854 | `todo-top-priorities' items per category. With no prefix | 3854 | `todo-top-priorities' items per category. With no prefix |
| 3855 | argument, if a top priorities file for the chosen Todo files | 3855 | argument, if a top priorities file for the chosen todo files |
| 3856 | exists (see `todo-save-filtered-items-buffer'), visit this file; | 3856 | exists (see `todo-save-filtered-items-buffer'), visit this file; |
| 3857 | if there is no such file, do the same as with prefix argument | 3857 | if there is no such file, do the same as with prefix argument |
| 3858 | `C-u'." | 3858 | `C-u'." |
| @@ -3861,10 +3861,10 @@ if there is no such file, do the same as with prefix argument | |||
| 3861 | 3861 | ||
| 3862 | (defun todo-filter-diary-items (&optional arg) | 3862 | (defun todo-filter-diary-items (&optional arg) |
| 3863 | "Display a list of todo diary items from different categories. | 3863 | "Display a list of todo diary items from different categories. |
| 3864 | The categories can be any of those in the current Todo file. | 3864 | The categories can be any of those in the current todo file. |
| 3865 | 3865 | ||
| 3866 | Called with no prefix ARG, if a diary items file for the current | 3866 | Called with no prefix ARG, if a diary items file for the current |
| 3867 | Todo file has previously been saved (see | 3867 | todo file has previously been saved (see |
| 3868 | `todo-save-filtered-items-buffer'), visit this file; if there is | 3868 | `todo-save-filtered-items-buffer'), visit this file; if there is |
| 3869 | no such file, build the list of diary items. Called with a | 3869 | no such file, build the list of diary items. Called with a |
| 3870 | prefix argument, build the list even if there is a saved file of | 3870 | prefix argument, build the list even if there is a saved file of |
| @@ -3879,7 +3879,7 @@ in `todo-filter-files', or if this nil, in the files chosen from | |||
| 3879 | a file selection dialog that pops up in this case. | 3879 | a file selection dialog that pops up in this case. |
| 3880 | 3880 | ||
| 3881 | Called with no prefix ARG, if a diary items file for the chosen | 3881 | Called with no prefix ARG, if a diary items file for the chosen |
| 3882 | Todo files has previously been saved (see | 3882 | todo files has previously been saved (see |
| 3883 | `todo-save-filtered-items-buffer'), visit this file; if there is | 3883 | `todo-save-filtered-items-buffer'), visit this file; if there is |
| 3884 | no such file, build the list of diary items. Called with a | 3884 | no such file, build the list of diary items. Called with a |
| 3885 | prefix argument, build the list even if there is a saved file of | 3885 | prefix argument, build the list even if there is a saved file of |
| @@ -3889,13 +3889,13 @@ diary items." | |||
| 3889 | 3889 | ||
| 3890 | (defun todo-filter-regexp-items (&optional arg) | 3890 | (defun todo-filter-regexp-items (&optional arg) |
| 3891 | "Prompt for a regular expression and display items that match it. | 3891 | "Prompt for a regular expression and display items that match it. |
| 3892 | The matches can be from any categories in the current Todo file | 3892 | The matches can be from any categories in the current todo file |
| 3893 | and with non-nil option `todo-filter-done-items', can include | 3893 | and with non-nil option `todo-filter-done-items', can include |
| 3894 | not only todo items but also done items, including those in | 3894 | not only todo items but also done items, including those in |
| 3895 | Archive files. | 3895 | Archive files. |
| 3896 | 3896 | ||
| 3897 | Called with no prefix ARG, if a regexp items file for the current | 3897 | Called with no prefix ARG, if a regexp items file for the current |
| 3898 | Todo file has previously been saved (see | 3898 | todo file has previously been saved (see |
| 3899 | `todo-save-filtered-items-buffer'), visit this file; if there is | 3899 | `todo-save-filtered-items-buffer'), visit this file; if there is |
| 3900 | no such file, build the list of regexp items. Called with a | 3900 | no such file, build the list of regexp items. Called with a |
| 3901 | prefix argument, build the list even if there is a saved file of | 3901 | prefix argument, build the list even if there is a saved file of |
| @@ -3913,7 +3913,7 @@ only todo items but also done items, including those in Archive | |||
| 3913 | files. | 3913 | files. |
| 3914 | 3914 | ||
| 3915 | Called with no prefix ARG, if a regexp items file for the current | 3915 | Called with no prefix ARG, if a regexp items file for the current |
| 3916 | Todo file has previously been saved (see | 3916 | todo file has previously been saved (see |
| 3917 | `todo-save-filtered-items-buffer'), visit this file; if there is | 3917 | `todo-save-filtered-items-buffer'), visit this file; if there is |
| 3918 | no such file, build the list of regexp items. Called with a | 3918 | no such file, build the list of regexp items. Called with a |
| 3919 | prefix argument, build the list even if there is a saved file of | 3919 | prefix argument, build the list even if there is a saved file of |
| @@ -4101,12 +4101,12 @@ the values of FILTER and FILE-LIST." | |||
| 4101 | (with-temp-buffer | 4101 | (with-temp-buffer |
| 4102 | (when (and todo-filter-done-items (eq filter 'regexp)) | 4102 | (when (and todo-filter-done-items (eq filter 'regexp)) |
| 4103 | ;; If there is a corresponding archive file for the | 4103 | ;; If there is a corresponding archive file for the |
| 4104 | ;; Todo file, insert it first and add identifiers for | 4104 | ;; todo file, insert it first and add identifiers for |
| 4105 | ;; todo-go-to-source-item. | 4105 | ;; todo-go-to-source-item. |
| 4106 | (let ((arch (concat (file-name-sans-extension f) ".toda"))) | 4106 | (let ((arch (concat (file-name-sans-extension f) ".toda"))) |
| 4107 | (when (file-exists-p arch) | 4107 | (when (file-exists-p arch) |
| 4108 | (insert-file-contents arch) | 4108 | (insert-file-contents arch) |
| 4109 | ;; Delete Todo archive file categories sexp. | 4109 | ;; Delete todo archive file's categories sexp. |
| 4110 | (delete-region (line-beginning-position) | 4110 | (delete-region (line-beginning-position) |
| 4111 | (1+ (line-end-position))) | 4111 | (1+ (line-end-position))) |
| 4112 | (save-excursion | 4112 | (save-excursion |
| @@ -4126,7 +4126,7 @@ the values of FILTER and FILE-LIST." | |||
| 4126 | (insert "(archive) ")) | 4126 | (insert "(archive) ")) |
| 4127 | (forward-line)))))) | 4127 | (forward-line)))))) |
| 4128 | (insert-file-contents f) | 4128 | (insert-file-contents f) |
| 4129 | ;; Delete Todo file categories sexp. | 4129 | ;; Delete todo file's categories sexp. |
| 4130 | (delete-region (line-beginning-position) (1+ (line-end-position))) | 4130 | (delete-region (line-beginning-position) (1+ (line-end-position))) |
| 4131 | (let (fnum) | 4131 | (let (fnum) |
| 4132 | ;; Unless the number of top priorities to show was | 4132 | ;; Unless the number of top priorities to show was |
| @@ -4238,7 +4238,7 @@ the values of FILTER and FILE-LIST." | |||
| 4238 | "Set number of top priorities shown by `todo-filter-top-priorities'. | 4238 | "Set number of top priorities shown by `todo-filter-top-priorities'. |
| 4239 | With non-nil ARG, set the number only for the current Todo | 4239 | With non-nil ARG, set the number only for the current Todo |
| 4240 | category; otherwise, set the number for all categories in the | 4240 | category; otherwise, set the number for all categories in the |
| 4241 | current Todo file. | 4241 | current todo file. |
| 4242 | 4242 | ||
| 4243 | Calling this function via either of the commands | 4243 | Calling this function via either of the commands |
| 4244 | `todo-set-top-priorities-in-file' or | 4244 | `todo-set-top-priorities-in-file' or |
| @@ -4274,7 +4274,7 @@ set the user customizable option `todo-top-priorities-overrides'." | |||
| 4274 | (todo-prefix-overlays))) | 4274 | (todo-prefix-overlays))) |
| 4275 | 4275 | ||
| 4276 | (defun todo-find-item (str) | 4276 | (defun todo-find-item (str) |
| 4277 | "Search for filtered item STR in its saved Todo file. | 4277 | "Search for filtered item STR in its saved todo file. |
| 4278 | Return the list (FOUND FILE CAT), where CAT and FILE are the | 4278 | Return the list (FOUND FILE CAT), where CAT and FILE are the |
| 4279 | item's category and file, and FOUND is a cons cell if the search | 4279 | item's category and file, and FOUND is a cons cell if the search |
| 4280 | succeeds, whose car is the start of the item in FILE and whose | 4280 | succeeds, whose car is the start of the item in FILE and whose |
| @@ -4399,7 +4399,7 @@ If the file already exists, overwrite it only on confirmation." | |||
| 4399 | (write-file filename t))) | 4399 | (write-file filename t))) |
| 4400 | 4400 | ||
| 4401 | ;; ----------------------------------------------------------------------------- | 4401 | ;; ----------------------------------------------------------------------------- |
| 4402 | ;;; Printing Todo buffers | 4402 | ;;; Printing Todo mode buffers |
| 4403 | ;; ----------------------------------------------------------------------------- | 4403 | ;; ----------------------------------------------------------------------------- |
| 4404 | 4404 | ||
| 4405 | (defcustom todo-print-buffer-function 'ps-print-buffer-with-faces | 4405 | (defcustom todo-print-buffer-function 'ps-print-buffer-with-faces |
| @@ -4408,10 +4408,10 @@ If the file already exists, overwrite it only on confirmation." | |||
| 4408 | :group 'todo) | 4408 | :group 'todo) |
| 4409 | 4409 | ||
| 4410 | (defvar todo-print-buffer "*Todo Print*" | 4410 | (defvar todo-print-buffer "*Todo Print*" |
| 4411 | "Name of buffer containing printable Todo text.") | 4411 | "Name of buffer with printable version of Todo mode buffer.") |
| 4412 | 4412 | ||
| 4413 | (defun todo-print-buffer (&optional to-file) | 4413 | (defun todo-print-buffer (&optional to-file) |
| 4414 | "Produce a printable version of the current Todo buffer. | 4414 | "Produce a printable version of the current Todo mode buffer. |
| 4415 | This converts overlays and soft line wrapping and, depending on | 4415 | This converts overlays and soft line wrapping and, depending on |
| 4416 | the value of `todo-print-buffer-function', includes faces. With | 4416 | the value of `todo-print-buffer-function', includes faces. With |
| 4417 | non-nil argument TO-FILE write the printable version to a file; | 4417 | non-nil argument TO-FILE write the printable version to a file; |
| @@ -4461,7 +4461,7 @@ otherwise, send it to the default printer." | |||
| 4461 | (kill-buffer buf))) | 4461 | (kill-buffer buf))) |
| 4462 | 4462 | ||
| 4463 | (defun todo-print-buffer-to-file () | 4463 | (defun todo-print-buffer-to-file () |
| 4464 | "Save printable version of this Todo buffer to a file." | 4464 | "Save printable version of this Todo mode buffer to a file." |
| 4465 | (interactive) | 4465 | (interactive) |
| 4466 | (todo-print-buffer t)) | 4466 | (todo-print-buffer t)) |
| 4467 | 4467 | ||
| @@ -4473,14 +4473,14 @@ otherwise, send it to the default printer." | |||
| 4473 | (concat "\\(?1:[0-9]\\{4\\}\\)-\\(?2:[0-9]\\{2\\}\\)-" | 4473 | (concat "\\(?1:[0-9]\\{4\\}\\)-\\(?2:[0-9]\\{2\\}\\)-" |
| 4474 | "\\(?3:[0-9]\\{2\\}\\) \\(?4:[0-9]\\{2\\}:[0-9]\\{2\\}\\)") | 4474 | "\\(?3:[0-9]\\{2\\}\\) \\(?4:[0-9]\\{2\\}:[0-9]\\{2\\}\\)") |
| 4475 | "Regexp matching legacy todo-mode.el item date-time strings. | 4475 | "Regexp matching legacy todo-mode.el item date-time strings. |
| 4476 | In order for `todo-convert-legacy-files' to correctly convert this | 4476 | In order for `todo-convert-legacy-files' to correctly convert |
| 4477 | string to the current Todo format, the regexp must contain four | 4477 | this string to the current Todo mode format, the regexp must |
| 4478 | explicitly numbered groups (see `(elisp) Regexp Backslash'), | 4478 | contain four explicitly numbered groups (see `(elisp) Regexp |
| 4479 | where group 1 matches a string for the year, group 2 a string for | 4479 | Backslash'), where group 1 matches a string for the year, group 2 |
| 4480 | the month, group 3 a string for the day and group 4 a string for | 4480 | a string for the month, group 3 a string for the day and group 4 |
| 4481 | the time. The default value converts date-time strings built | 4481 | a string for the time. The default value converts date-time |
| 4482 | using the default value of `todo-time-string-format' from | 4482 | strings built using the default value of |
| 4483 | todo-mode.el." | 4483 | `todo-time-string-format' from todo-mode.el." |
| 4484 | :type 'regexp | 4484 | :type 'regexp |
| 4485 | :group 'todo) | 4485 | :group 'todo) |
| 4486 | 4486 | ||
| @@ -4498,10 +4498,10 @@ Helper function for `todo-convert-legacy-files'." | |||
| 4498 | (when time (concat " " time))))) | 4498 | (when time (concat " " time))))) |
| 4499 | 4499 | ||
| 4500 | (defun todo-convert-legacy-files () | 4500 | (defun todo-convert-legacy-files () |
| 4501 | "Convert legacy Todo files to the current Todo format. | 4501 | "Convert legacy todo files to the current Todo mode format. |
| 4502 | The old-style files named by the variables `todo-file-do' and | 4502 | The old-style files named by the variables `todo-file-do' and |
| 4503 | `todo-file-done' from the old package are converted to the new | 4503 | `todo-file-done' from the old package are converted to the new |
| 4504 | format and saved (the latter as a Todo Archive file) with a new | 4504 | format and saved (the latter as a todo archive file) with a new |
| 4505 | name in `todo-directory'. See also the documentation string of | 4505 | name in `todo-directory'. See also the documentation string of |
| 4506 | `todo-legacy-date-time-regexp' for further details." | 4506 | `todo-legacy-date-time-regexp' for further details." |
| 4507 | (interactive) | 4507 | (interactive) |
| @@ -4519,7 +4519,7 @@ name in `todo-directory'. See also the documentation string of | |||
| 4519 | todo-prefix-tem) | 4519 | todo-prefix-tem) |
| 4520 | ;; Convert `todo-file-do'. | 4520 | ;; Convert `todo-file-do'. |
| 4521 | (if (not (file-exists-p todo-file-do-tem)) | 4521 | (if (not (file-exists-p todo-file-do-tem)) |
| 4522 | (message "No legacy Todo file exists") | 4522 | (message "No legacy todo file exists") |
| 4523 | (let ((default "todo-do-conv") | 4523 | (let ((default "todo-do-conv") |
| 4524 | file archive-sexp) | 4524 | file archive-sexp) |
| 4525 | (with-temp-buffer | 4525 | (with-temp-buffer |
| @@ -4656,7 +4656,7 @@ name in `todo-directory'. See also the documentation string of | |||
| 4656 | (line-beginning-position) | 4656 | (line-beginning-position) |
| 4657 | (line-end-position))))) | 4657 | (line-end-position))))) |
| 4658 | (setq file (concat (file-name-sans-extension file) ".todo")) | 4658 | (setq file (concat (file-name-sans-extension file) ".todo")) |
| 4659 | ;; Update categories sexp of converted Todo file again, adding | 4659 | ;; Update categories sexp of converted todo file again, adding |
| 4660 | ;; counts of archived items. | 4660 | ;; counts of archived items. |
| 4661 | (with-temp-buffer | 4661 | (with-temp-buffer |
| 4662 | (insert-file-contents file) | 4662 | (insert-file-contents file) |
| @@ -4682,14 +4682,14 @@ name in `todo-directory'. See also the documentation string of | |||
| 4682 | (todo-show)))))) | 4682 | (todo-show)))))) |
| 4683 | 4683 | ||
| 4684 | ;; ----------------------------------------------------------------------------- | 4684 | ;; ----------------------------------------------------------------------------- |
| 4685 | ;;; Utility functions for Todo files, categories and items | 4685 | ;;; Utility functions for todo files, categories and items |
| 4686 | ;; ----------------------------------------------------------------------------- | 4686 | ;; ----------------------------------------------------------------------------- |
| 4687 | 4687 | ||
| 4688 | (defun todo-absolute-file-name (name &optional type) | 4688 | (defun todo-absolute-file-name (name &optional type) |
| 4689 | "Return the absolute file name of short Todo file NAME. | 4689 | "Return the absolute file name of short todo file NAME. |
| 4690 | With TYPE `archive' or `top' return the absolute file name of the | 4690 | With TYPE `archive' or `top' return the absolute file name of the |
| 4691 | short Todo Archive or Top Priorities file name, respectively." | 4691 | short todo archive or top priorities file name, respectively." |
| 4692 | ;; NOP if there is no Todo file yet (i.e. don't concatenate nil). | 4692 | ;; No-op if there is no todo file yet (i.e. don't concatenate nil). |
| 4693 | (when name | 4693 | (when name |
| 4694 | (file-truename | 4694 | (file-truename |
| 4695 | (concat todo-directory name | 4695 | (concat todo-directory name |
| @@ -4700,7 +4700,7 @@ short Todo Archive or Top Priorities file name, respectively." | |||
| 4700 | (t ".todo")))))) | 4700 | (t ".todo")))))) |
| 4701 | 4701 | ||
| 4702 | (defun todo-category-number (cat) | 4702 | (defun todo-category-number (cat) |
| 4703 | "Return the number of category CAT in this Todo file. | 4703 | "Return the number of category CAT in this todo file. |
| 4704 | The buffer-local variable `todo-category-number' holds this | 4704 | The buffer-local variable `todo-category-number' holds this |
| 4705 | number as its value." | 4705 | number as its value." |
| 4706 | (let ((categories (mapcar 'car todo-categories))) | 4706 | (let ((categories (mapcar 'car todo-categories))) |
| @@ -4814,7 +4814,7 @@ With nil or omitted CATEGORY, default to the current category." | |||
| 4814 | (prin1 todo-categories (current-buffer)))))) | 4814 | (prin1 todo-categories (current-buffer)))))) |
| 4815 | 4815 | ||
| 4816 | (defun todo-make-categories-list (&optional force) | 4816 | (defun todo-make-categories-list (&optional force) |
| 4817 | "Return an alist of Todo categories and their item counts. | 4817 | "Return an alist of todo categories and their item counts. |
| 4818 | With non-nil argument FORCE parse the entire file to build the | 4818 | With non-nil argument FORCE parse the entire file to build the |
| 4819 | list; otherwise, get the value by reading the sexp at the top of | 4819 | list; otherwise, get the value by reading the sexp at the top of |
| 4820 | the file." | 4820 | the file." |
| @@ -4885,19 +4885,20 @@ the file." | |||
| 4885 | todo-categories) | 4885 | todo-categories) |
| 4886 | 4886 | ||
| 4887 | (defun todo-repair-categories-sexp () | 4887 | (defun todo-repair-categories-sexp () |
| 4888 | "Repair corrupt Todo categories sexp. | 4888 | "Repair corrupt todo file categories sexp. |
| 4889 | This should only be needed as a consequence of careless manual | 4889 | This should only be needed as a consequence of careless manual |
| 4890 | editing or a bug in todo.el. | 4890 | editing or a bug in todo.el. |
| 4891 | 4891 | ||
| 4892 | *Warning*: Calling this command restores the category order to | 4892 | *Warning*: Calling this command restores the category order to |
| 4893 | the list element order in the Todo categories sexp, so any order | 4893 | the list element order in the todo file categories sexp, so any |
| 4894 | changes made in Todo Categories mode will have to be made again." | 4894 | order changes made in Todo Categories mode will have to be made |
| 4895 | again." | ||
| 4895 | (interactive) | 4896 | (interactive) |
| 4896 | (let ((todo-categories (todo-make-categories-list t))) | 4897 | (let ((todo-categories (todo-make-categories-list t))) |
| 4897 | (todo-update-categories-sexp))) | 4898 | (todo-update-categories-sexp))) |
| 4898 | 4899 | ||
| 4899 | (defun todo-check-format () | 4900 | (defun todo-check-format () |
| 4900 | "Signal an error if the current Todo file is ill-formatted. | 4901 | "Signal an error if the current todo file is ill-formatted. |
| 4901 | Otherwise return t. Display a message if the file is well-formed | 4902 | Otherwise return t. Display a message if the file is well-formed |
| 4902 | but the categories sexp differs from the current value of | 4903 | but the categories sexp differs from the current value of |
| 4903 | `todo-categories'." | 4904 | `todo-categories'." |
| @@ -4927,7 +4928,7 @@ but the categories sexp differs from the current value of | |||
| 4927 | "\\|\\(" todo-done-string-start "\\)"))) | 4928 | "\\|\\(" todo-done-string-start "\\)"))) |
| 4928 | (while (not (eobp)) | 4929 | (while (not (eobp)) |
| 4929 | (unless (looking-at legit) | 4930 | (unless (looking-at legit) |
| 4930 | (user-error "Illegitimate Todo file format at line %d" | 4931 | (user-error "Illegitimate todo file format at line %d" |
| 4931 | (line-number-at-pos (point)))) | 4932 | (line-number-at-pos (point)))) |
| 4932 | (forward-line))) | 4933 | (forward-line))) |
| 4933 | ;; Warn user if categories sexp has changed. | 4934 | ;; Warn user if categories sexp has changed. |
| @@ -4941,7 +4942,7 @@ but the categories sexp differs from the current value of | |||
| 4941 | t) | 4942 | t) |
| 4942 | 4943 | ||
| 4943 | (defun todo-item-start () | 4944 | (defun todo-item-start () |
| 4944 | "Move to start of current Todo item and return its position." | 4945 | "Move to start of current todo item and return its position." |
| 4945 | (unless (or | 4946 | (unless (or |
| 4946 | ;; Buffer is empty (invocation possible e.g. via todo-forward-item | 4947 | ;; Buffer is empty (invocation possible e.g. via todo-forward-item |
| 4947 | ;; from todo-filter-items when processing category with no todo | 4948 | ;; from todo-filter-items when processing category with no todo |
| @@ -4962,7 +4963,7 @@ but the categories sexp differs from the current value of | |||
| 4962 | (point))) | 4963 | (point))) |
| 4963 | 4964 | ||
| 4964 | (defun todo-item-end () | 4965 | (defun todo-item-end () |
| 4965 | "Move to end of current Todo item and return its position." | 4966 | "Move to end of current todo item and return its position." |
| 4966 | ;; Items cannot end with a blank line. | 4967 | ;; Items cannot end with a blank line. |
| 4967 | (unless (looking-at "^$") | 4968 | (unless (looking-at "^$") |
| 4968 | (let* ((done (todo-done-item-p)) | 4969 | (let* ((done (todo-done-item-p)) |
| @@ -5152,7 +5153,7 @@ Overrides `diary-goto-entry'." | |||
| 5152 | "Non-nil if this item begins with `todo-item-mark'. | 5153 | "Non-nil if this item begins with `todo-item-mark'. |
| 5153 | In that case, return the item's prefix overlay." | 5154 | In that case, return the item's prefix overlay." |
| 5154 | (let* ((ov (todo-get-overlay 'prefix)) | 5155 | (let* ((ov (todo-get-overlay 'prefix)) |
| 5155 | ;; If an item insertion command is called on a Todo file | 5156 | ;; If an item insertion command is called on a todo file |
| 5156 | ;; before it is visited, it has no prefix overlays yet, so | 5157 | ;; before it is visited, it has no prefix overlays yet, so |
| 5157 | ;; check for this. | 5158 | ;; check for this. |
| 5158 | (pref (when ov (overlay-get ov 'before-string))) | 5159 | (pref (when ov (overlay-get ov 'before-string))) |
| @@ -5290,15 +5291,14 @@ The elements of ARGLIST may be atoms or lists." | |||
| 5290 | (setq l (append v nil)))) | 5291 | (setq l (append v nil)))) |
| 5291 | (setq new (append new (list l)))) | 5292 | (setq new (append new (list l)))) |
| 5292 | new) | 5293 | new) |
| 5293 | "List of all argument lists for Todo item insertion commands.") | 5294 | "List of all argument lists for Todo mode item insertion commands.") |
| 5294 | 5295 | ||
| 5295 | (defun todo-insertion-command-name (arglist) | 5296 | (defun todo-insertion-command-name (arglist) |
| 5296 | "Generate Todo item insertion command name from ARGLIST." | 5297 | "Generate Todo mode item insertion command name from ARGLIST." |
| 5297 | (replace-regexp-in-string | 5298 | (replace-regexp-in-string |
| 5298 | "-\\_>" "" | 5299 | "-\\_>" "" |
| 5299 | (replace-regexp-in-string | 5300 | (replace-regexp-in-string |
| 5300 | "-+" "-" | 5301 | "-+" "-" |
| 5301 | ;; (concat "todo-item-insert-" | ||
| 5302 | (concat "todo-insert-item-" | 5302 | (concat "todo-insert-item-" |
| 5303 | (mapconcat (lambda (e) (if e (symbol-name e))) arglist "-"))))) | 5303 | (mapconcat (lambda (e) (if e (symbol-name e))) arglist "-"))))) |
| 5304 | 5304 | ||
| @@ -5306,10 +5306,10 @@ The elements of ARGLIST may be atoms or lists." | |||
| 5306 | (mapcar (lambda (l) | 5306 | (mapcar (lambda (l) |
| 5307 | (todo-insertion-command-name l)) | 5307 | (todo-insertion-command-name l)) |
| 5308 | todo-insertion-commands-args) | 5308 | todo-insertion-commands-args) |
| 5309 | "List of names of Todo item insertion commands.") | 5309 | "List of names of Todo mode item insertion commands.") |
| 5310 | 5310 | ||
| 5311 | (defmacro todo-define-insertion-command (&rest args) | 5311 | (defmacro todo-define-insertion-command (&rest args) |
| 5312 | "Generate item insertion command definitions from ARGS." | 5312 | "Generate Todo mode item insertion command definitions from ARGS." |
| 5313 | (let ((name (intern (todo-insertion-command-name args))) | 5313 | (let ((name (intern (todo-insertion-command-name args))) |
| 5314 | (arg0 (nth 0 args)) | 5314 | (arg0 (nth 0 args)) |
| 5315 | (arg1 (nth 1 args)) | 5315 | (arg1 (nth 1 args)) |
| @@ -5317,7 +5317,7 @@ The elements of ARGLIST may be atoms or lists." | |||
| 5317 | (arg3 (nth 3 args)) | 5317 | (arg3 (nth 3 args)) |
| 5318 | (arg4 (nth 4 args))) | 5318 | (arg4 (nth 4 args))) |
| 5319 | `(defun ,name (&optional arg &rest args) | 5319 | `(defun ,name (&optional arg &rest args) |
| 5320 | "Todo item insertion command generated from ARGS. | 5320 | "Todo mode item insertion command generated from ARGS. |
| 5321 | For descriptions of the individual arguments, their values, and | 5321 | For descriptions of the individual arguments, their values, and |
| 5322 | their relation to key bindings, see `todo-basic-insert-item'." | 5322 | their relation to key bindings, see `todo-basic-insert-item'." |
| 5323 | (interactive (list current-prefix-arg)) | 5323 | (interactive (list current-prefix-arg)) |
| @@ -5327,7 +5327,7 @@ their relation to key bindings, see `todo-basic-insert-item'." | |||
| 5327 | (mapcar (lambda (c) | 5327 | (mapcar (lambda (c) |
| 5328 | (eval `(todo-define-insertion-command ,@c))) | 5328 | (eval `(todo-define-insertion-command ,@c))) |
| 5329 | todo-insertion-commands-args) | 5329 | todo-insertion-commands-args) |
| 5330 | "List of Todo item insertion commands.") | 5330 | "List of Todo mode item insertion commands.") |
| 5331 | 5331 | ||
| 5332 | (defvar todo-insertion-commands-arg-key-list | 5332 | (defvar todo-insertion-commands-arg-key-list |
| 5333 | '(("diary" "y" "yy") | 5333 | '(("diary" "y" "yy") |
| @@ -5338,7 +5338,7 @@ their relation to key bindings, see `todo-basic-insert-item'." | |||
| 5338 | ("time" "t" "tt") | 5338 | ("time" "t" "tt") |
| 5339 | ("here" "h" "h") | 5339 | ("here" "h" "h") |
| 5340 | ("region" "r" "r")) | 5340 | ("region" "r" "r")) |
| 5341 | "List of mappings of insertion command arguments to key sequences.") | 5341 | "List of mappings of item insertion command arguments to key sequences.") |
| 5342 | 5342 | ||
| 5343 | (defun todo-insertion-key-bindings (map) | 5343 | (defun todo-insertion-key-bindings (map) |
| 5344 | "Generate key binding definitions for item insertion keymap MAP." | 5344 | "Generate key binding definitions for item insertion keymap MAP." |
| @@ -5401,8 +5401,8 @@ or, with non-nil ARCHIVE, the current archive file." | |||
| 5401 | (dolist (f files listall) | 5401 | (dolist (f files listall) |
| 5402 | (with-current-buffer (find-file-noselect f 'nowarn) | 5402 | (with-current-buffer (find-file-noselect f 'nowarn) |
| 5403 | ;; Ensure category is properly displayed in case user | 5403 | ;; Ensure category is properly displayed in case user |
| 5404 | ;; switches to file via a non-Todo command. And if done | 5404 | ;; switches to file via a non-Todo mode command. And if |
| 5405 | ;; items in category are visible, keep them visible. | 5405 | ;; done items in category are visible, keep them visible. |
| 5406 | (let ((done todo-show-with-done)) | 5406 | (let ((done todo-show-with-done)) |
| 5407 | (when (> (buffer-size) (- (point-max) (point-min))) | 5407 | (when (> (buffer-size) (- (point-max) (point-min))) |
| 5408 | (save-excursion | 5408 | (save-excursion |
| @@ -5426,11 +5426,11 @@ or, with non-nil ARCHIVE, the current archive file." | |||
| 5426 | listf))))) | 5426 | listf))))) |
| 5427 | 5427 | ||
| 5428 | (defun todo-read-file-name (prompt &optional archive mustmatch) | 5428 | (defun todo-read-file-name (prompt &optional archive mustmatch) |
| 5429 | "Choose and return the name of a Todo file, prompting with PROMPT. | 5429 | "Choose and return the name of a todo file, prompting with PROMPT. |
| 5430 | 5430 | ||
| 5431 | Show completions with TAB or SPC; the names are shown in short | 5431 | Show completions with TAB or SPC; the names are shown in short |
| 5432 | form but the absolute truename is returned. With non-nil ARCHIVE | 5432 | form but the absolute truename is returned. With non-nil ARCHIVE |
| 5433 | return the absolute truename of a Todo archive file. With non-nil | 5433 | return the absolute truename of a todo archive file. With non-nil |
| 5434 | MUSTMATCH the name of an existing file must be chosen; | 5434 | MUSTMATCH the name of an existing file must be chosen; |
| 5435 | otherwise, a new file name is allowed." | 5435 | otherwise, a new file name is allowed." |
| 5436 | (let* ((completion-ignore-case todo-completion-ignore-case) | 5436 | (let* ((completion-ignore-case todo-completion-ignore-case) |
| @@ -5563,7 +5563,7 @@ TYPE can be either of the symbols `file' or `category'." | |||
| 5563 | (if files | 5563 | (if files |
| 5564 | "Enter a non-empty file name: " | 5564 | "Enter a non-empty file name: " |
| 5565 | ;; Empty string passed by todo-show to | 5565 | ;; Empty string passed by todo-show to |
| 5566 | ;; prompt for initial Todo file. | 5566 | ;; prompt for initial todo file. |
| 5567 | (concat "Initial file name [" | 5567 | (concat "Initial file name [" |
| 5568 | todo-initial-file "]: "))) | 5568 | todo-initial-file "]: "))) |
| 5569 | ((eq type 'category) | 5569 | ((eq type 'category) |
| @@ -5571,7 +5571,7 @@ TYPE can be either of the symbols `file' or `category'." | |||
| 5571 | "Enter a non-empty category name: " | 5571 | "Enter a non-empty category name: " |
| 5572 | ;; Empty string passed by todo-show to | 5572 | ;; Empty string passed by todo-show to |
| 5573 | ;; prompt for initial category of a new | 5573 | ;; prompt for initial category of a new |
| 5574 | ;; Todo file. | 5574 | ;; todo file. |
| 5575 | (concat "Initial category name [" | 5575 | (concat "Initial category name [" |
| 5576 | todo-initial-category "]: ")))))) | 5576 | todo-initial-category "]: ")))))) |
| 5577 | ((string-match "\\`\\s-+\\'" name) | 5577 | ((string-match "\\`\\s-+\\'" name) |
| @@ -5626,13 +5626,9 @@ number of the last the day of the month." | |||
| 5626 | (completion-ignore-case todo-completion-ignore-case)) | 5626 | (completion-ignore-case todo-completion-ignore-case)) |
| 5627 | (setq monthname (completing-read | 5627 | (setq monthname (completing-read |
| 5628 | "Month name (RET for current month, * for any month): " | 5628 | "Month name (RET for current month, * for any month): " |
| 5629 | ;; (mapcar 'list (append marray nil)) | ||
| 5630 | mlist nil t nil nil | 5629 | mlist nil t nil nil |
| 5631 | (calendar-month-name (calendar-extract-month | 5630 | (calendar-month-name (calendar-extract-month |
| 5632 | (calendar-current-date)) t)) | 5631 | (calendar-current-date)) t)) |
| 5633 | ;; month (cdr (assoc-string | ||
| 5634 | ;; monthname (calendar-make-alist marray nil nil | ||
| 5635 | ;; abbrevs)))))) | ||
| 5636 | month (1+ (- (length mlist) | 5632 | month (1+ (- (length mlist) |
| 5637 | (length (or (member monthname mlist) | 5633 | (length (or (member monthname mlist) |
| 5638 | (member monthname mablist)))))) | 5634 | (member monthname mablist)))))) |
| @@ -5859,7 +5855,7 @@ the empty string (i.e., no time string)." | |||
| 5859 | (hl-line-mode -1))))))))) | 5855 | (hl-line-mode -1))))))))) |
| 5860 | 5856 | ||
| 5861 | (defun todo-reevaluate-filelist-defcustoms () | 5857 | (defun todo-reevaluate-filelist-defcustoms () |
| 5862 | "Reevaluate defcustoms that provide choice list of Todo files." | 5858 | "Reevaluate defcustoms that provide choice list of todo files." |
| 5863 | (custom-set-default 'todo-default-todo-file | 5859 | (custom-set-default 'todo-default-todo-file |
| 5864 | (symbol-value 'todo-default-todo-file)) | 5860 | (symbol-value 'todo-default-todo-file)) |
| 5865 | (todo-reevaluate-default-file-defcustom) | 5861 | (todo-reevaluate-default-file-defcustom) |
| @@ -5871,7 +5867,7 @@ the empty string (i.e., no time string)." | |||
| 5871 | 5867 | ||
| 5872 | (defun todo-reevaluate-default-file-defcustom () | 5868 | (defun todo-reevaluate-default-file-defcustom () |
| 5873 | "Reevaluate defcustom of `todo-default-todo-file'. | 5869 | "Reevaluate defcustom of `todo-default-todo-file'. |
| 5874 | Called after adding or deleting a Todo file." | 5870 | Called after adding or deleting a todo file." |
| 5875 | (eval (defcustom todo-default-todo-file (car (funcall todo-files-function)) | 5871 | (eval (defcustom todo-default-todo-file (car (funcall todo-files-function)) |
| 5876 | "Todo file visited by first session invocation of `todo-show'." | 5872 | "Todo file visited by first session invocation of `todo-show'." |
| 5877 | :type `(radio ,@(mapcar (lambda (f) (list 'const f)) | 5873 | :type `(radio ,@(mapcar (lambda (f) (list 'const f)) |
| @@ -5881,7 +5877,7 @@ Called after adding or deleting a Todo file." | |||
| 5881 | 5877 | ||
| 5882 | (defun todo-reevaluate-category-completions-files-defcustom () | 5878 | (defun todo-reevaluate-category-completions-files-defcustom () |
| 5883 | "Reevaluate defcustom of `todo-category-completions-files'. | 5879 | "Reevaluate defcustom of `todo-category-completions-files'. |
| 5884 | Called after adding or deleting a Todo file." | 5880 | Called after adding or deleting a todo file." |
| 5885 | (eval (defcustom todo-category-completions-files nil | 5881 | (eval (defcustom todo-category-completions-files nil |
| 5886 | "List of files for building `todo-read-category' completions." | 5882 | "List of files for building `todo-read-category' completions." |
| 5887 | :type `(set ,@(mapcar (lambda (f) (list 'const f)) | 5883 | :type `(set ,@(mapcar (lambda (f) (list 'const f)) |
| @@ -5891,7 +5887,7 @@ Called after adding or deleting a Todo file." | |||
| 5891 | 5887 | ||
| 5892 | (defun todo-reevaluate-filter-files-defcustom () | 5888 | (defun todo-reevaluate-filter-files-defcustom () |
| 5893 | "Reevaluate defcustom of `todo-filter-files'. | 5889 | "Reevaluate defcustom of `todo-filter-files'. |
| 5894 | Called after adding or deleting a Todo file." | 5890 | Called after adding or deleting a todo file." |
| 5895 | (eval (defcustom todo-filter-files nil | 5891 | (eval (defcustom todo-filter-files nil |
| 5896 | "List of files for multifile item filtering." | 5892 | "List of files for multifile item filtering." |
| 5897 | :type `(set ,@(mapcar (lambda (f) (list 'const f)) | 5893 | :type `(set ,@(mapcar (lambda (f) (list 'const f)) |
| @@ -5904,7 +5900,7 @@ Called after adding or deleting a Todo file." | |||
| 5904 | ;; ----------------------------------------------------------------------------- | 5900 | ;; ----------------------------------------------------------------------------- |
| 5905 | 5901 | ||
| 5906 | (defun todo-nondiary-marker-matcher (lim) | 5902 | (defun todo-nondiary-marker-matcher (lim) |
| 5907 | "Search for Todo nondiary markers within LIM for font-locking." | 5903 | "Search for todo item nondiary markers within LIM for font-locking." |
| 5908 | (re-search-forward (concat "^\\(?1:" (regexp-quote todo-nondiary-start) "\\)" | 5904 | (re-search-forward (concat "^\\(?1:" (regexp-quote todo-nondiary-start) "\\)" |
| 5909 | todo-date-pattern "\\(?: " diary-time-regexp | 5905 | todo-date-pattern "\\(?: " diary-time-regexp |
| 5910 | "\\)?\\(?2:" (regexp-quote todo-nondiary-end) "\\)") | 5906 | "\\)?\\(?2:" (regexp-quote todo-nondiary-end) "\\)") |
| @@ -5916,12 +5912,12 @@ Called after adding or deleting a Todo file." | |||
| 5916 | "\\)" todo-date-pattern) lim t)) | 5912 | "\\)" todo-date-pattern) lim t)) |
| 5917 | 5913 | ||
| 5918 | (defun todo-date-string-matcher (lim) | 5914 | (defun todo-date-string-matcher (lim) |
| 5919 | "Search for Todo date string within LIM for font-locking." | 5915 | "Search for todo item date string within LIM for font-locking." |
| 5920 | (re-search-forward | 5916 | (re-search-forward |
| 5921 | (concat todo-date-string-start "\\(?1:" todo-date-pattern "\\)") lim t)) | 5917 | (concat todo-date-string-start "\\(?1:" todo-date-pattern "\\)") lim t)) |
| 5922 | 5918 | ||
| 5923 | (defun todo-time-string-matcher (lim) | 5919 | (defun todo-time-string-matcher (lim) |
| 5924 | "Search for Todo time string within LIM for font-locking." | 5920 | "Search for todo item time string within LIM for font-locking." |
| 5925 | (re-search-forward (concat todo-date-string-start todo-date-pattern | 5921 | (re-search-forward (concat todo-date-string-start todo-date-pattern |
| 5926 | " \\(?1:" diary-time-regexp "\\)") lim t)) | 5922 | " \\(?1:" diary-time-regexp "\\)") lim t)) |
| 5927 | 5923 | ||
| @@ -5940,18 +5936,18 @@ Called after adding or deleting a Todo file." | |||
| 5940 | (todo-diary-expired-matcher lim))))) | 5936 | (todo-diary-expired-matcher lim))))) |
| 5941 | 5937 | ||
| 5942 | (defun todo-done-string-matcher (lim) | 5938 | (defun todo-done-string-matcher (lim) |
| 5943 | "Search for Todo done header within LIM for font-locking." | 5939 | "Search for done todo item header within LIM for font-locking." |
| 5944 | (re-search-forward (concat todo-done-string-start | 5940 | (re-search-forward (concat todo-done-string-start |
| 5945 | "[^][]+]") | 5941 | "[^][]+]") |
| 5946 | lim t)) | 5942 | lim t)) |
| 5947 | 5943 | ||
| 5948 | (defun todo-comment-string-matcher (lim) | 5944 | (defun todo-comment-string-matcher (lim) |
| 5949 | "Search for Todo done comment within LIM for font-locking." | 5945 | "Search for done todo item comment within LIM for font-locking." |
| 5950 | (re-search-forward (concat "\\[\\(?1:" todo-comment-string "\\):") | 5946 | (re-search-forward (concat "\\[\\(?1:" todo-comment-string "\\):") |
| 5951 | lim t)) | 5947 | lim t)) |
| 5952 | 5948 | ||
| 5953 | (defun todo-category-string-matcher-1 (lim) | 5949 | (defun todo-category-string-matcher-1 (lim) |
| 5954 | "Search for Todo category name within LIM for font-locking. | 5950 | "Search for todo category name within LIM for font-locking. |
| 5955 | This is for fontifying category and file names appearing in Todo | 5951 | This is for fontifying category and file names appearing in Todo |
| 5956 | Filtered Items mode following done items." | 5952 | Filtered Items mode following done items." |
| 5957 | (if (eq major-mode 'todo-filtered-items-mode) | 5953 | (if (eq major-mode 'todo-filtered-items-mode) |
| @@ -5964,7 +5960,7 @@ Filtered Items mode following done items." | |||
| 5964 | lim t))) | 5960 | lim t))) |
| 5965 | 5961 | ||
| 5966 | (defun todo-category-string-matcher-2 (lim) | 5962 | (defun todo-category-string-matcher-2 (lim) |
| 5967 | "Search for Todo category name within LIM for font-locking. | 5963 | "Search for todo category name within LIM for font-locking. |
| 5968 | This is for fontifying category and file names appearing in Todo | 5964 | This is for fontifying category and file names appearing in Todo |
| 5969 | Filtered Items mode following todo (not done) items." | 5965 | Filtered Items mode following todo (not done) items." |
| 5970 | (if (eq major-mode 'todo-filtered-items-mode) | 5966 | (if (eq major-mode 'todo-filtered-items-mode) |
| @@ -6229,20 +6225,20 @@ Filtered Items mode following todo (not done) items." | |||
| 6229 | ;; ----------------------------------------------------------------------------- | 6225 | ;; ----------------------------------------------------------------------------- |
| 6230 | 6226 | ||
| 6231 | (defun todo-show-current-file () | 6227 | (defun todo-show-current-file () |
| 6232 | "Visit current instead of default Todo file with `todo-show'. | 6228 | "Visit current instead of default todo file with `todo-show'. |
| 6233 | This function is added to `pre-command-hook' when user option | 6229 | This function is added to `pre-command-hook' when user option |
| 6234 | `todo-show-current-file' is set to non-nil." | 6230 | `todo-show-current-file' is set to non-nil." |
| 6235 | (setq todo-global-current-todo-file todo-current-todo-file)) | 6231 | (setq todo-global-current-todo-file todo-current-todo-file)) |
| 6236 | 6232 | ||
| 6237 | (defun todo-display-as-todo-file () | 6233 | (defun todo-display-as-todo-file () |
| 6238 | "Show Todo files correctly when visited from outside of Todo mode." | 6234 | "Show todo files correctly when visited from outside of Todo mode." |
| 6239 | (and (member this-command todo-visit-files-commands) | 6235 | (and (member this-command todo-visit-files-commands) |
| 6240 | (= (- (point-max) (point-min)) (buffer-size)) | 6236 | (= (- (point-max) (point-min)) (buffer-size)) |
| 6241 | (member major-mode '(todo-mode todo-archive-mode)) | 6237 | (member major-mode '(todo-mode todo-archive-mode)) |
| 6242 | (todo-category-select))) | 6238 | (todo-category-select))) |
| 6243 | 6239 | ||
| 6244 | (defun todo-add-to-buffer-list () | 6240 | (defun todo-add-to-buffer-list () |
| 6245 | "Add name of just visited Todo file to `todo-file-buffers'. | 6241 | "Add name of just visited todo file to `todo-file-buffers'. |
| 6246 | This function is added to `find-file-hook' in Todo mode." | 6242 | This function is added to `find-file-hook' in Todo mode." |
| 6247 | (let ((filename (file-truename (buffer-file-name)))) | 6243 | (let ((filename (file-truename (buffer-file-name)))) |
| 6248 | (when (member filename todo-files) | 6244 | (when (member filename todo-files) |
| @@ -6258,7 +6254,7 @@ This function is added to `post-command-hook' in Todo mode." | |||
| 6258 | 6254 | ||
| 6259 | (defun todo-reset-global-current-todo-file () | 6255 | (defun todo-reset-global-current-todo-file () |
| 6260 | "Update the value of `todo-global-current-todo-file'. | 6256 | "Update the value of `todo-global-current-todo-file'. |
| 6261 | This becomes the latest existing Todo file or, if there is none, | 6257 | This becomes the latest existing todo file or, if there is none, |
| 6262 | the value of `todo-default-todo-file'. | 6258 | the value of `todo-default-todo-file'. |
| 6263 | This function is added to `kill-buffer-hook' in Todo mode." | 6259 | This function is added to `kill-buffer-hook' in Todo mode." |
| 6264 | (let ((filename (file-truename (buffer-file-name)))) | 6260 | (let ((filename (file-truename (buffer-file-name)))) |
| @@ -6304,7 +6300,7 @@ Added to `window-configuration-change-hook' in `todo-mode'." | |||
| 6304 | (put 'todo-mode 'mode-class 'special) | 6300 | (put 'todo-mode 'mode-class 'special) |
| 6305 | 6301 | ||
| 6306 | (define-derived-mode todo-mode special-mode "Todo" | 6302 | (define-derived-mode todo-mode special-mode "Todo" |
| 6307 | "Major mode for displaying, navigating and editing Todo lists. | 6303 | "Major mode for displaying, navigating and editing todo lists. |
| 6308 | 6304 | ||
| 6309 | \\{todo-mode-map}" | 6305 | \\{todo-mode-map}" |
| 6310 | ;; (easy-menu-add todo-menu) | 6306 | ;; (easy-menu-add todo-menu) |
| @@ -6330,7 +6326,7 @@ Added to `window-configuration-change-hook' in `todo-mode'." | |||
| 6330 | ;; If todo-mode is parent, all todo-mode key bindings appear to be | 6326 | ;; If todo-mode is parent, all todo-mode key bindings appear to be |
| 6331 | ;; available in todo-archive-mode (e.g. shown by C-h m). | 6327 | ;; available in todo-archive-mode (e.g. shown by C-h m). |
| 6332 | (define-derived-mode todo-archive-mode special-mode "Todo-Arch" | 6328 | (define-derived-mode todo-archive-mode special-mode "Todo-Arch" |
| 6333 | "Major mode for archived Todo categories. | 6329 | "Major mode for archived todo categories. |
| 6334 | 6330 | ||
| 6335 | \\{todo-archive-mode-map}" | 6331 | \\{todo-archive-mode-map}" |
| 6336 | (todo-modes-set-1) | 6332 | (todo-modes-set-1) |
| @@ -6360,7 +6356,7 @@ Added to `window-configuration-change-hook' in `todo-mode'." | |||
| 6360 | (setq-local todo-categories cats))) | 6356 | (setq-local todo-categories cats))) |
| 6361 | 6357 | ||
| 6362 | (define-derived-mode todo-edit-mode text-mode "Todo-Ed" | 6358 | (define-derived-mode todo-edit-mode text-mode "Todo-Ed" |
| 6363 | "Major mode for editing multiline Todo items. | 6359 | "Major mode for editing multiline todo items. |
| 6364 | 6360 | ||
| 6365 | \\{todo-edit-mode-map}" | 6361 | \\{todo-edit-mode-map}" |
| 6366 | (todo-modes-set-1) | 6362 | (todo-modes-set-1) |
| @@ -6370,7 +6366,7 @@ Added to `window-configuration-change-hook' in `todo-mode'." | |||
| 6370 | (put 'todo-categories-mode 'mode-class 'special) | 6366 | (put 'todo-categories-mode 'mode-class 'special) |
| 6371 | 6367 | ||
| 6372 | (define-derived-mode todo-categories-mode special-mode "Todo-Cats" | 6368 | (define-derived-mode todo-categories-mode special-mode "Todo-Cats" |
| 6373 | "Major mode for displaying and editing Todo categories. | 6369 | "Major mode for displaying and editing todo categories. |
| 6374 | 6370 | ||
| 6375 | \\{todo-categories-mode-map}" | 6371 | \\{todo-categories-mode-map}" |
| 6376 | (todo-mode-external-set)) | 6372 | (todo-mode-external-set)) |