aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lisp/calendar/todo-mode.el69
1 files changed, 40 insertions, 29 deletions
diff --git a/lisp/calendar/todo-mode.el b/lisp/calendar/todo-mode.el
index d265b258cae..3d7eac6902a 100644
--- a/lisp/calendar/todo-mode.el
+++ b/lisp/calendar/todo-mode.el
@@ -4,7 +4,7 @@
4 4
5;; Author: Oliver.Seidel@cl.cam.ac.uk (was valid on Aug 2, 1997) 5;; Author: Oliver.Seidel@cl.cam.ac.uk (was valid on Aug 2, 1997)
6;; Created: 2 Aug 1997 6;; Created: 2 Aug 1997
7;; Version: $Id: todo-mode.el,v 1.21 1997/10/24 16:51:02 os10000 Exp os10000 $ 7;; Version: $Id: todo-mode.el,v 1.22 1997/10/24 16:53:20 os10000 Exp os10000 $
8;; Keywords: Categorised TODO list editor, todo-mode 8;; Keywords: Categorised TODO list editor, todo-mode
9 9
10;; This file is part of GNU Emacs. 10;; This file is part of GNU Emacs.
@@ -32,17 +32,12 @@
32;; 32;;
33;; To get this to work, make emacs execute the line 33;; To get this to work, make emacs execute the line
34;; 34;;
35;; (require 'todo-mode) ;; load the TODO package
36;;
37;; If you don't like "require", do as Harald Backer prescribes:
38;;
39;; "I don't like require statements as they slow down startup
40;; emacs. As I include .todo-do in diary and start calendar
41;; at startup of emacs, the mode indicator of .todo-do will
42;; make emacs fail, unless the following is defined:"
43;;
44;; (autoload 'todo-mode "todo-mode" 35;; (autoload 'todo-mode "todo-mode"
45;; "Major mode for editing TODO lists." t) 36;; "Major mode for editing TODO lists." t)
37;; (autoload 'todo-show "todo-mode"
38;; "Show TODO items." t)
39;; (autoload 'todo-insert-item "todo-mode"
40;; "Add TODO item." t)
46;; 41;;
47;; You may now enter new items by typing "M-x todo-insert-item", 42;; You may now enter new items by typing "M-x todo-insert-item",
48;; or enter your TODO list file by typing "M-x todo-show". 43;; or enter your TODO list file by typing "M-x todo-show".
@@ -77,7 +72,7 @@
77;; 72;;
78;; Which version of todo-mode.el does this documentation refer to? 73;; Which version of todo-mode.el does this documentation refer to?
79;; 74;;
80;; $Id: todo-mode.el,v 1.21 1997/10/24 16:51:02 os10000 Exp os10000 $ 75;; $Id: todo-mode.el,v 1.22 1997/10/24 16:53:20 os10000 Exp os10000 $
81;; 76;;
82;; Pre-Requisites 77;; Pre-Requisites
83;; 78;;
@@ -250,6 +245,13 @@
250;;; Change Log: 245;;; Change Log:
251 246
252;; $Log: todo-mode.el,v $ 247;; $Log: todo-mode.el,v $
248;; Revision 1.22 1997/10/24 16:53:20 os10000
249;; Paul Stodghill <stodghil@CS.Cornell.EDU> writes:
250;;
251;; When invoked with a prefix, todo-insert-item
252;; should not prompt for a category. (He adds:
253;; At least that's what I think.)
254;;
253;; Revision 1.21 1997/10/24 16:51:02 os10000 255;; Revision 1.21 1997/10/24 16:51:02 os10000
254;; Rafael Laboissiere <rafael@icp.inpg.fr> writes: 256;; Rafael Laboissiere <rafael@icp.inpg.fr> writes:
255;; 257;;
@@ -595,24 +597,10 @@ TODO categories. Use `todo-categories' instead.")
595 0) 597 0)
596 598
597;;;### autoload 599;;;### autoload
598(defun todo-insert-item (ARG) 600(defun todo-add-item-non-interactively (new-item category)
599 "Insert new TODO list entry." 601 "Insert new TODO list entry."
600 (interactive "P") 602 (save-excursion
601 (let* ((new-item (concat todo-prefix " " 603 (todo-show)
602 (read-from-minibuffer
603 "New TODO entry: "
604 (if todo-entry-prefix-function
605 (funcall todo-entry-prefix-function)))))
606 (categories todo-categories)
607 (history (cons 'categories (1+ todo-category-number)))
608 (current-category (nth todo-category-number todo-categories))
609 (category
610 (if ARG
611 current-category
612 (completing-read
613 (concat "Category ["
614 current-category "]: ")
615 (todo-category-alist) nil nil nil history))))
616 (if (string= "" category) 604 (if (string= "" category)
617 (setq category (nth todo-category-number todo-categories))) 605 (setq category (nth todo-category-number todo-categories)))
618 (let ((cat-exists (member category todo-categories))) 606 (let ((cat-exists (member category todo-categories)))
@@ -642,6 +630,29 @@ TODO categories. Use `todo-categories' instead.")
642 (todo-backward-item) 630 (todo-backward-item)
643 (save-buffer) 631 (save-buffer)
644 (message ""))) 632 (message "")))
633
634;;;### autoload
635(defun todo-insert-item (ARG)
636 "Insert new TODO list entry."
637 (interactive "P")
638 (todo-show)
639 (let* ((new-item (concat todo-prefix " "
640 (read-from-minibuffer
641 "New TODO entry: "
642 (if todo-entry-prefix-function
643 (funcall todo-entry-prefix-function)))))
644 (categories todo-categories)
645 (history (cons 'categories (1+ todo-category-number)))
646 (current-category (nth todo-category-number todo-categories))
647 (category
648 (if ARG
649 current-category
650 (completing-read
651 (concat "Category ["
652 current-category "]: ")
653 (todo-category-alist) nil nil nil history))))
654 (todo-add-item-non-interactively new-item category)))
655
645(defalias 'todo-cmd-inst 'todo-insert-item) 656(defalias 'todo-cmd-inst 'todo-insert-item)
646 657
647(defun todo-more-important-p (line) 658(defun todo-more-important-p (line)