comparison lisp/calendar/todo-mode.el @ 34968:c8d0a552d56e

(todo): Add :link, :version. (todo-save-top-priorities): Remove autoload cookie. (todo-add-category, todo-add-item-non-interactively) (todo-insert-item, todo-mode, todo-cp, todo-show): Fix autoload cookie.
author Dave Love <fx@gnu.org>
date Tue, 02 Jan 2001 14:06:15 +0000
parents 152ae6b57597
children 5bcd50b6b826
comparison
equal deleted inserted replaced
34967:78e2d17df950 34968:c8d0a552d56e
3 ;; Copyright (C) 1997, 1999 Free Software Foundation, Inc. 3 ;; Copyright (C) 1997, 1999 Free Software Foundation, Inc.
4 4
5 ;; Author: Oliver Seidel <os10000@seidel-space.de> 5 ;; Author: Oliver Seidel <os10000@seidel-space.de>
6 ;; [Not clear the above works, July 2000] 6 ;; [Not clear the above works, July 2000]
7 ;; Created: 2 Aug 1997 7 ;; Created: 2 Aug 1997
8 ;; Version: $Id: todo-mode.el,v 1.43 2000/07/04 11:15:24 fx Exp $ 8 ;; Version: $Id: todo-mode.el,v 1.44 2000/11/22 22:51:33 fx Exp $
9 ;; Keywords: calendar, todo 9 ;; Keywords: calendar, todo
10 10
11 ;; This file is part of GNU Emacs. 11 ;; This file is part of GNU Emacs.
12 12
13 ;; GNU Emacs is free software; you can redistribute it and/or modify 13 ;; GNU Emacs is free software; you can redistribute it and/or modify
95 ;; 95 ;;
96 ;; Version 96 ;; Version
97 ;; 97 ;;
98 ;; Which version of todo-mode.el does this documentation refer to? 98 ;; Which version of todo-mode.el does this documentation refer to?
99 ;; 99 ;;
100 ;; $Id: todo-mode.el,v 1.43 2000/07/04 11:15:24 fx Exp $ 100 ;; $Id: todo-mode.el,v 1.44 2000/11/22 22:51:33 fx Exp $
101 ;; 101 ;;
102 ;; Pre-Requisites 102 ;; Pre-Requisites
103 ;; 103 ;;
104 ;; This package will require the following packages to be 104 ;; This package will require the following packages to be
105 ;; available on the load-path: 105 ;; available on the load-path:
266 266
267 ;; User-configurable variables: 267 ;; User-configurable variables:
268 268
269 (defgroup todo nil 269 (defgroup todo nil
270 "Maintain a list of todo items." 270 "Maintain a list of todo items."
271 :link '(emacs-commentary-link "todo-mode")
272 :version "21.1"
271 :group 'calendar) 273 :group 'calendar)
272 274
273 (defcustom todo-prefix "*/*" 275 (defcustom todo-prefix "*/*"
274 "*TODO mode prefix for entries. 276 "*TODO mode prefix for entries.
275 277
528 (file-name-nondirectory todo-file-do) buffer-name)) 530 (file-name-nondirectory todo-file-do) buffer-name))
529 (message "To exit, simply kill this buffer and return to list.") 531 (message "To exit, simply kill this buffer and return to list.")
530 (todo-edit-mode) 532 (todo-edit-mode)
531 (narrow-to-region (todo-item-start) (todo-item-end)))) 533 (narrow-to-region (todo-item-start) (todo-item-end))))
532 534
533 ;;;### autoload 535 ;;;###autoload
534 (defun todo-add-category (cat) 536 (defun todo-add-category (cat)
535 "Add new category CAT to the TODO list." 537 "Add new category CAT to the TODO list."
536 (interactive "sCategory: ") 538 (interactive "sCategory: ")
537 (save-window-excursion 539 (save-window-excursion
538 (setq todo-categories (cons cat todo-categories)) 540 (setq todo-categories (cons cat todo-categories))
552 todo-prefix todo-category-beg cat 554 todo-prefix todo-category-beg cat
553 todo-category-end 555 todo-category-end
554 todo-prefix todo-category-sep))) 556 todo-prefix todo-category-sep)))
555 0) 557 0)
556 558
557 ;;;### autoload 559 ;;;###autoload
558 (defun todo-add-item-non-interactively (new-item category) 560 (defun todo-add-item-non-interactively (new-item category)
559 "Insert NEW-ITEM in TODO list as a new entry in CATEGORY." 561 "Insert NEW-ITEM in TODO list as a new entry in CATEGORY."
560 (save-excursion 562 (save-excursion
561 (todo-show)) 563 (todo-show))
562 (save-excursion 564 (save-excursion
585 (insert new-item "\n") 587 (insert new-item "\n")
586 (todo-backward-item) 588 (todo-backward-item)
587 (todo-save) 589 (todo-save)
588 (message ""))) 590 (message "")))
589 591
590 ;;;### autoload 592 ;;;###autoload
591 (defun todo-insert-item (arg) 593 (defun todo-insert-item (arg)
592 "Insert new TODO list entry. 594 "Insert new TODO list entry.
593 With a prefix argument solicit the category, otherwise use the current 595 With a prefix argument solicit the category, otherwise use the current
594 category." 596 category."
595 (interactive "P") 597 (interactive "P")
611 history current-category)))) 613 history current-category))))
612 (todo-add-item-non-interactively new-item category)))) 614 (todo-add-item-non-interactively new-item category))))
613 615
614 (defalias 'todo-cmd-inst 'todo-insert-item) 616 (defalias 'todo-cmd-inst 'todo-insert-item)
615 617
616 ;;;### autoload
617 (defun todo-insert-item-here () 618 (defun todo-insert-item-here ()
618 "Insert new TODO list entry under the cursor." 619 "Insert new TODO list entry under the cursor."
619 (interactive "") 620 (interactive "")
620 (save-excursion 621 (save-excursion
621 (if (not (string-equal mode-name "TODO")) (todo-show)) 622 (if (not (string-equal mode-name "TODO")) (todo-show))
773 ;; Else we could have used pop-to-buffer. 774 ;; Else we could have used pop-to-buffer.
774 (display-buffer todo-print-buffer-name) 775 (display-buffer todo-print-buffer-name)
775 (message "Type C-x 1 to remove %s window. M-C-v to scroll the help." 776 (message "Type C-x 1 to remove %s window. M-C-v to scroll the help."
776 todo-print-buffer-name))) 777 todo-print-buffer-name)))
777 778
778 ;;;###autoload
779 (defun todo-save-top-priorities (&optional nof-priorities) 779 (defun todo-save-top-priorities (&optional nof-priorities)
780 "Save top priorities for each category in `todo-file-top'. 780 "Save top priorities for each category in `todo-file-top'.
781 781
782 Number of entries for each category is given by NOF-PRIORITIES which 782 Number of entries for each category is given by NOF-PRIORITIES which
783 defaults to `todo-show-priorities'." 783 defaults to `todo-show-priorities'."
902 "---" 902 "---"
903 ["Quit" todo-quit t] 903 ["Quit" todo-quit t]
904 )) 904 ))
905 905
906 ;; As calendar reads .todo-do before todo-mode is loaded. 906 ;; As calendar reads .todo-do before todo-mode is loaded.
907 ;;;### autoload 907 ;;;###autoload
908 (defun todo-mode () 908 (defun todo-mode ()
909 "Major mode for editing TODO lists. 909 "Major mode for editing TODO lists.
910 910
911 \\{todo-mode-map}" 911 \\{todo-mode-map}"
912 (interactive) 912 (interactive)
919 (eval-when-compile 919 (eval-when-compile
920 (defvar date) 920 (defvar date)
921 (defvar entry)) 921 (defvar entry))
922 922
923 ;; Read about this function in the setup instructions above! 923 ;; Read about this function in the setup instructions above!
924 ;;;### autoload 924 ;;;###autoload
925 (defun todo-cp () 925 (defun todo-cp ()
926 "Make a diary entry appear only in the current date's diary." 926 "Make a diary entry appear only in the current date's diary."
927 (if (equal (calendar-current-date) date) 927 (if (equal (calendar-current-date) date)
928 entry)) 928 entry))
929 929
930 (define-derived-mode todo-edit-mode text-mode "TODO Edit" 930 (define-derived-mode todo-edit-mode text-mode "TODO Edit"
931 "Major mode for editing items in the TODO list. 931 "Major mode for editing items in the TODO list.
932 932
933 \\{todo-edit-mode-map}") 933 \\{todo-edit-mode-map}")
934 934
935 ;;;### autoload 935 ;;;###autoload
936 (defun todo-show () 936 (defun todo-show ()
937 "Show TODO list." 937 "Show TODO list."
938 (interactive) 938 (interactive)
939 (if (file-exists-p todo-file-do) 939 (if (file-exists-p todo-file-do)
940 (find-file todo-file-do) 940 (find-file todo-file-do)