aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOliver Seidel1997-12-04 17:45:22 +0000
committerOliver Seidel1997-12-04 17:45:22 +0000
commit0561decbb52019cd265516cd3e637829d72d5a1a (patch)
tree6f471109f00be5bdba67483245e2c2993122c22e
parentd89d0243979a85456895e72e658116b760527bdc (diff)
downloademacs-0561decbb52019cd265516cd3e637829d72d5a1a.tar.gz
emacs-0561decbb52019cd265516cd3e637829d72d5a1a.zip
Another patch by Michael Cook to fix annotation.
-rw-r--r--lisp/calendar/todo-mode.el63
1 files changed, 34 insertions, 29 deletions
diff --git a/lisp/calendar/todo-mode.el b/lisp/calendar/todo-mode.el
index bf1ff1a4d4b..7cd68bb9e7f 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.31 1997/10/28 22:16:24 os10000 Exp os10000 $ 7;; Version: $Id: todo-mode.el,v 1.32 1997/12/03 12:18: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.
@@ -96,7 +96,7 @@
96;; 96;;
97;; Which version of todo-mode.el does this documentation refer to? 97;; Which version of todo-mode.el does this documentation refer to?
98;; 98;;
99;; $Id: todo-mode.el,v 1.31 1997/10/28 22:16:24 os10000 Exp os10000 $ 99;; $Id: todo-mode.el,v 1.32 1997/12/03 12:18:20 os10000 Exp os10000 $
100;; 100;;
101;; Pre-Requisites 101;; Pre-Requisites
102;; 102;;
@@ -267,6 +267,9 @@
267;;; Change Log: 267;;; Change Log:
268 268
269;; $Log: todo-mode.el,v $ 269;; $Log: todo-mode.el,v $
270;; Revision 1.32 1997/12/03 12:18:20 os10000
271;; Added category patch by Michael R Cook <mcook@cognex.com>.
272;;
270;; Revision 1.31 1997/10/28 22:16:24 os10000 273;; Revision 1.31 1997/10/28 22:16:24 os10000
271;; Three insertion options: 274;; Three insertion options:
272;; i without prefix: ask for category, do binary insertion 275;; i without prefix: ask for category, do binary insertion
@@ -883,33 +886,35 @@ category."
883 (error "No TODO list entry to lower"))) 886 (error "No TODO list entry to lower")))
884(defalias 'todo-cmd-lowr 'todo-lower-item) 887(defalias 'todo-cmd-lowr 'todo-lower-item)
885 888
886(defun todo-file-item () "File the current TODO list entry away." 889(defun todo-file-item (&optional comment)
887 (interactive) 890 "File the current TODO list entry away,
888 (if (> (count-lines (point-min) (point-max)) 0) 891annotated with an optional COMMENT."
889 (let ((comment (read-from-minibuffer "Comment: ")) 892 (interactive "sComment: ")
890 (time-stamp-format todo-time-string-format)) 893 (or (> (count-lines (point-min) (point-max)) 0)
891 (if (> (length comment) 0) 894 (error "No TODO list entry to file away"))
892 (progn 895 (let ((time-stamp-format todo-time-string-format))
893 (goto-char (todo-item-end)) 896 (if (and comment (> (length comment) 0))
894 (insert 897 (progn
895 (if (save-excursion (beginning-of-line) 898 (goto-char (todo-item-end))
896 (looking-at (regexp-quote todo-prefix))) 899 (insert
897 " " 900 (if (save-excursion (beginning-of-line)
898 "\n\t") 901 (looking-at (regexp-quote todo-prefix)))
899 "(" (nth todo-category-number todo-categories) ": " 902 " "
900 comment ")"))) 903 "\n\t")
901 (goto-char (todo-item-start)) 904 "(" comment ")")))
902 (let ((temp-point (point))) 905 (goto-char (todo-item-end))
903 (if (looking-at (regexp-quote todo-prefix)) 906 (insert " [" (nth todo-category-number todo-categories) "]")
904 (replace-match (time-stamp-string)) 907 (goto-char (todo-item-start))
905 ;; Standard prefix -> timestamp 908 (let ((temp-point (point)))
906 ;; Else prefix non-standard item start with timestamp 909 (if (looking-at (regexp-quote todo-prefix))
907 (insert (time-stamp-string))) 910 (replace-match (time-stamp-string))
908 (append-to-file temp-point (1+ (todo-item-end)) todo-file-done) 911 ;; Standard prefix -> timestamp
909 (delete-region temp-point (1+ (todo-item-end)))) 912 ;; Else prefix non-standard item start with timestamp
910 (todo-backward-item) 913 (insert (time-stamp-string)))
911 (message "")) 914 (append-to-file temp-point (1+ (todo-item-end)) todo-file-done)
912 (error "No TODO list entry to file away"))) 915 (delete-region temp-point (1+ (todo-item-end))))
916 (todo-backward-item)
917 (message "")))
913 918
914;; --------------------------------------------------------------------------- 919;; ---------------------------------------------------------------------------
915 920