aboutsummaryrefslogtreecommitdiffstats
path: root/lisp
diff options
context:
space:
mode:
authorOliver Seidel1999-03-17 11:10:29 +0000
committerOliver Seidel1999-03-17 11:10:29 +0000
commitbd40f1f23ab9cf2f990d166e2ecb325b354ab406 (patch)
tree59a61effe81a1bb3f2e0b1b99f42fbf1479bb4c1 /lisp
parent50f53db3159885c4dc4c1770944f5bde27d6e7e1 (diff)
downloademacs-bd40f1f23ab9cf2f990d166e2ecb325b354ab406.tar.gz
emacs-bd40f1f23ab9cf2f990d166e2ecb325b354ab406.zip
Alastair Burt <alastair.burt@dfki.de> sent in a patch on 17.Mar.98
which removes duplicates from the category list and saves the buffer after category addition. Thanks. Uwe Brauer <oub@sunma4.mat.ucm.es> sent in a request on 3.Apr.98 to implement a "move-between-categories" function. I haven't done that yet. Thanks. "Edward S. Hirgelt" <ehirgelt@directinterfaces.com> fixed a problem with multi-line editing 29.Oct.98. Thanks. tom <tom@pixelpark.com> sent in a replacement for the outmoded time-format that I had been using on 13.Nov.98. Thanks. Jerome Thebert <thebertj@felixstowe.rms.slb.com> sent in a binding to show/hide continuation lines using the space bar on 11.Jan.99. Instead of leaving it as a hook, I integrated it. Thanks. Sorry again to everybody. I sat on your patches for a year.
Diffstat (limited to 'lisp')
-rw-r--r--lisp/calendar/todo-mode.el67
1 files changed, 48 insertions, 19 deletions
diff --git a/lisp/calendar/todo-mode.el b/lisp/calendar/todo-mode.el
index 7ae81aa9861..7617ed38679 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.34 1998/01/12 11:43:22 os10000 Exp os10000 $ 7;; Version: $Id: todo-mode.el,v 1.35 1998/09/29 18:20:36 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.
@@ -117,15 +117,17 @@
117;; 117;;
118;; Which version of todo-mode.el does this documentation refer to? 118;; Which version of todo-mode.el does this documentation refer to?
119;; 119;;
120;; $Id: todo-mode.el,v 1.34 1998/01/12 11:43:22 os10000 Exp os10000 $ 120;; $Id: todo-mode.el,v 1.35 1998/09/29 18:20:36 os10000 Exp os10000 $
121;; 121;;
122;; Pre-Requisites 122;; Pre-Requisites
123;; 123;;
124;; This package will require the following packages to be 124;; This package will require the following packages to be
125;; available on the load-path: 125;; available on the load-path:
126;; 126;;
127;; time-stamp 127;; cl
128;; custom
128;; easymenu 129;; easymenu
130;; time-stamp
129;; 131;;
130;; Operation 132;; Operation
131;; 133;;
@@ -133,6 +135,8 @@
133;; 135;;
134;; M-x todo-show will enter the todo list screen, here type 136;; M-x todo-show will enter the todo list screen, here type
135;; 137;;
138;; spc will toggle the display of sub-trees
139;;
136;; + to go to next category 140;; + to go to next category
137;; - to go to previous category 141;; - to go to previous category
138;; d to file the current entry, including a 142;; d to file the current entry, including a
@@ -288,6 +292,9 @@
288;;; Change Log: 292;;; Change Log:
289 293
290;; $Log: todo-mode.el,v $ 294;; $Log: todo-mode.el,v $
295;; Revision 1.35 1998/09/29 18:20:36 os10000
296;; Alex Schroeder startup description added.
297;;
291;; Revision 1.34 1998/01/12 11:43:22 os10000 298;; Revision 1.34 1998/01/12 11:43:22 os10000
292;; Added patch from Don Hejna <djhejna@oasis.ambit.com>. 299;; Added patch from Don Hejna <djhejna@oasis.ambit.com>.
293;; 300;;
@@ -598,7 +605,7 @@ Automatically generated when `todo-save-top-priorities' is non-nil."
598;; My format string for the appt.el package is "%3b %2d, %y, %02I:%02M%p". 605;; My format string for the appt.el package is "%3b %2d, %y, %02I:%02M%p".
599;; 606;;
600(defcustom todo-time-string-format 607(defcustom todo-time-string-format
601 "%:y-%02m-%02d %02H:%02M" 608 "%04y-%02m-%02d %02H:%02M"
602 "*TODO mode time string format for done entries. 609 "*TODO mode time string format for done entries.
603For details see the variable `time-stamp-format'." 610For details see the variable `time-stamp-format'."
604 :type 'string 611 :type 'string
@@ -622,8 +629,9 @@ For details see the variable `time-stamp-format'."
622 629
623;; Get some outside help ... 630;; Get some outside help ...
624 631
625(require 'time-stamp) 632(require 'cl)
626(require 'easymenu) 633(require 'easymenu)
634(require 'time-stamp)
627 635
628;; --------------------------------------------------------------------------- 636;; ---------------------------------------------------------------------------
629 637
@@ -657,6 +665,8 @@ Use `todo-categories' instead.")
657 nil 665 nil
658 (let ((map (make-keymap))) 666 (let ((map (make-keymap)))
659 (suppress-keymap map t) 667 (suppress-keymap map t)
668 (define-key map "?" 'todo-help)
669 (define-key map " " 'todo-hide-show-subtree)
660 (define-key map "+" 'todo-forward-category) 670 (define-key map "+" 'todo-forward-category)
661 (define-key map "-" 'todo-backward-category) 671 (define-key map "-" 'todo-backward-category)
662 (define-key map "d" 'todo-file-item) ;done/delete 672 (define-key map "d" 'todo-file-item) ;done/delete
@@ -682,7 +692,6 @@ Use `todo-categories' instead.")
682 "Make TODO mode display the current category correctly." 692 "Make TODO mode display the current category correctly."
683 (let ((name (nth todo-category-number todo-categories))) 693 (let ((name (nth todo-category-number todo-categories)))
684 (setq mode-line-buffer-identification 694 (setq mode-line-buffer-identification
685;; (concat "Category: " name))
686 (concat "Category: " (format "%18s" name))) 695 (concat "Category: " (format "%18s" name)))
687 (widen) 696 (widen)
688 (goto-char (point-min)) 697 (goto-char (point-min))
@@ -696,6 +705,18 @@ Use `todo-categories' instead.")
696 (goto-char (point-min))))) 705 (goto-char (point-min)))))
697(defalias 'todo-cat-slct 'todo-category-select) 706(defalias 'todo-cat-slct 'todo-category-select)
698 707
708(defun todo-help () "Show TODO mode help."
709 (interactive)
710 (describe-function 'todo-mode))
711
712(defun todo-hide-show-subtree () "Hide or Show subtrees in the TODO list."
713 (interactive)
714 (save-excursion
715 (end-of-line)
716 (if (outline-visible)
717 (hide-subtree)
718 (show-subtree))))
719
699(defun todo-forward-category () "Go forward to TODO list of next category." 720(defun todo-forward-category () "Go forward to TODO list of next category."
700 (interactive) 721 (interactive)
701 (setq todo-category-number 722 (setq todo-category-number
@@ -760,7 +781,7 @@ Use `todo-categories' instead.")
760 (let ((buffer-name (generate-new-buffer-name todo-edit-buffer))) 781 (let ((buffer-name (generate-new-buffer-name todo-edit-buffer)))
761 (switch-to-buffer 782 (switch-to-buffer
762 (make-indirect-buffer 783 (make-indirect-buffer
763 (file-name-nondirectory todo-file-do) buffer-name)) 784 (find-buffer-visiting todo-file-do) buffer-name))
764 (message "To exit, simply kill this buffer and return to list.") 785 (message "To exit, simply kill this buffer and return to list.")
765 (todo-edit-mode) 786 (todo-edit-mode)
766 (narrow-to-region (todo-item-start) (todo-item-end)))) 787 (narrow-to-region (todo-item-start) (todo-item-end))))
@@ -770,7 +791,7 @@ Use `todo-categories' instead.")
770 "Add new category CAT to the TODO list." 791 "Add new category CAT to the TODO list."
771 (interactive "sCategory: ") 792 (interactive "sCategory: ")
772 (save-window-excursion 793 (save-window-excursion
773 (setq todo-categories (cons cat todo-categories)) 794 (pushnew cat todo-categories)
774 (find-file todo-file-do) 795 (find-file todo-file-do)
775 (widen) 796 (widen)
776 (goto-char (point-min)) 797 (goto-char (point-min))
@@ -786,7 +807,8 @@ Use `todo-categories' instead.")
786 (insert (format "%s%s%s\n%s\n%s %s\n" 807 (insert (format "%s%s%s\n%s\n%s %s\n"
787 todo-prefix todo-category-beg cat 808 todo-prefix todo-category-beg cat
788 todo-category-end 809 todo-category-end
789 todo-prefix todo-category-sep))) 810 todo-prefix todo-category-sep))
811 (save-buffer))
790 0) 812 0)
791 813
792;;;### autoload 814;;;### autoload
@@ -797,11 +819,9 @@ Use `todo-categories' instead.")
797 (save-excursion 819 (save-excursion
798 (if (string= "" category) 820 (if (string= "" category)
799 (setq category (nth todo-category-number todo-categories))) 821 (setq category (nth todo-category-number todo-categories)))
800 (let ((cat-exists (member category todo-categories))) 822 (setq todo-category-number
801 (setq todo-category-number 823 (or (position category todo-categories :test 'equal)
802 (if cat-exists 824 (todo-add-category category)))
803 (- (length todo-categories) (length cat-exists))
804 (todo-add-category category))))
805 (todo-show) 825 (todo-show)
806 (setq todo-previous-line 0) 826 (setq todo-previous-line 0)
807 (let ((top 1) 827 (let ((top 1)
@@ -819,6 +839,11 @@ Use `todo-categories' instead.")
819 (forward-line (1- top))) 839 (forward-line (1- top)))
820 (insert new-item "\n") 840 (insert new-item "\n")
821 (todo-backward-item) 841 (todo-backward-item)
842 (progn ;;; horrible os10000 hack to make items appear when inserting into empty buffer
843 (widen)
844 (show-all)
845 (todo-forward-category)
846 (todo-backward-category))
822 (todo-save) 847 (todo-save)
823 (message ""))) 848 (message "")))
824 849
@@ -1054,7 +1079,7 @@ Number of entries for each category is given by
1054 "Jump to a category. Default is previous category." 1079 "Jump to a category. Default is previous category."
1055 (interactive) 1080 (interactive)
1056 (let* ((categories todo-categories) 1081 (let* ((categories todo-categories)
1057 (history (cons 'categories (1+ todo-category-number))) 1082 (history (cons 'categories (1+ todo-category-number)))
1058 (category (completing-read 1083 (category (completing-read
1059 (concat "Category [" 1084 (concat "Category ["
1060 (nth todo-category-number todo-categories) "]: ") 1085 (nth todo-category-number todo-categories) "]: ")
@@ -1062,10 +1087,8 @@ Number of entries for each category is given by
1062 (if (string= "" category) 1087 (if (string= "" category)
1063 (setq category (nth todo-category-number todo-categories))) 1088 (setq category (nth todo-category-number todo-categories)))
1064 (setq todo-category-number 1089 (setq todo-category-number
1065 (if (member category todo-categories) 1090 (or (position category todo-categories :test 'equal)
1066 (- (length todo-categories) 1091 (todo-add-category category)))
1067 (length (member category todo-categories)))
1068 (todo-add-category category)))
1069 (todo-show))) 1092 (todo-show)))
1070 1093
1071(defun todo-line-string () "Return current line in buffer as a string." 1094(defun todo-line-string () "Return current line in buffer as a string."
@@ -1186,6 +1209,12 @@ If SEPARATORS is absent, it defaults to \"[ \\f\\t\\n\\r\\v]+\"."
1186 (setq mode-name "TODO") 1209 (setq mode-name "TODO")
1187 (use-local-map todo-mode-map) 1210 (use-local-map todo-mode-map)
1188 (easy-menu-add todo-menu) 1211 (easy-menu-add todo-menu)
1212 (setq paragraph-separate "\*/\*")
1213 (setq fill-prefix "\t\t")
1214 (setq outline-regexp "\\*/\\*")
1215 (outline-minor-mode 1)
1216 (hide-other)
1217 (auto-fill-mode 1)
1189 (run-hooks 'todo-mode-hook)) 1218 (run-hooks 'todo-mode-hook))
1190 1219
1191;; Read about this function in the setup instructions above! 1220;; Read about this function in the setup instructions above!