diff options
| author | Oliver Seidel | 1997-10-15 14:30:41 +0000 |
|---|---|---|
| committer | Oliver Seidel | 1997-10-15 14:30:41 +0000 |
| commit | b7e041703482cedd2738c78242f037216d9daa17 (patch) | |
| tree | 551560a7af830d799eaa15de0ddb861cd5406337 /lisp | |
| parent | 91e9443e0bbbdf77ac97970073d72b0321b67041 (diff) | |
| download | emacs-b7e041703482cedd2738c78242f037216d9daa17.tar.gz emacs-b7e041703482cedd2738c78242f037216d9daa17.zip | |
Attempted to reconcile Harald's changes with mine since 1997-10-14T22:22:35Z!os10000@seidel-space.de.
Diffstat (limited to 'lisp')
| -rw-r--r-- | lisp/calendar/todo-mode.el | 41 |
1 files changed, 24 insertions, 17 deletions
diff --git a/lisp/calendar/todo-mode.el b/lisp/calendar/todo-mode.el index 3b96f8987b7..c2c6009d014 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.15 1997/10/14 22:22:35 os10000 Exp os10000 $ | 7 | ;; Version: $Id: todo-mode.el,v 1.16 1997/10/15 14:00:12 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. |
| @@ -225,6 +225,9 @@ | |||
| 225 | ;;; Change Log: | 225 | ;;; Change Log: |
| 226 | 226 | ||
| 227 | ;; $Log: todo-mode.el,v $ | 227 | ;; $Log: todo-mode.el,v $ |
| 228 | ;; Revision 1.16 1997/10/15 14:00:12 os10000 | ||
| 229 | ;; Fixed 'file-item' and added 20.02 split-string function. | ||
| 230 | ;; | ||
| 228 | ;; Revision 1.15 1997/10/14 22:22:35 os10000 | 231 | ;; Revision 1.15 1997/10/14 22:22:35 os10000 |
| 229 | ;; Added string-split (which I stole from ediff-util), changed | 232 | ;; Added string-split (which I stole from ediff-util), changed |
| 230 | ;; pop-to-buffer to switch-to-buffer and added message on how | 233 | ;; pop-to-buffer to switch-to-buffer and added message on how |
| @@ -307,12 +310,12 @@ | |||
| 307 | 310 | ||
| 308 | ;; User-configurable variables: | 311 | ;; User-configurable variables: |
| 309 | 312 | ||
| 310 | (defvar todo-prefix "*/*" "TODO mode prefix for entries.") | 313 | (defvar todo-prefix "*/*" "*TODO mode prefix for entries.") |
| 311 | (defvar todo-file-do "~/.todo-do" "TODO mode list file.") | 314 | (defvar todo-file-do "~/.todo-do" "*TODO mode list file.") |
| 312 | (defvar todo-file-done "~/.todo-done" "TODO mode archive file.") | 315 | (defvar todo-file-done "~/.todo-done" "*TODO mode archive file.") |
| 313 | (defvar todo-mode-hook nil "TODO mode hooks.") | 316 | (defvar todo-mode-hook nil "*TODO mode hooks.") |
| 314 | (defvar todo-edit-mode-hook nil "TODO Edit mode hooks.") | 317 | (defvar todo-edit-mode-hook nil "*TODO Edit mode hooks.") |
| 315 | (defvar todo-insert-treshold 0 "TODO mode insertion accuracy.") | 318 | (defvar todo-insert-treshold 0 "*TODO mode insertion accuracy.") |
| 316 | (defvar todo-edit-buffer " *TODO Edit*" "TODO Edit buffer name.") | 319 | (defvar todo-edit-buffer " *TODO Edit*" "TODO Edit buffer name.") |
| 317 | 320 | ||
| 318 | ;; Thanks for the ISO time stamp format go to Karl Eichwalder <ke@suse.de> | 321 | ;; Thanks for the ISO time stamp format go to Karl Eichwalder <ke@suse.de> |
| @@ -334,8 +337,10 @@ For details see the variable `time-stamp-format'.") | |||
| 334 | ;; Set up some helpful context ... | 337 | ;; Set up some helpful context ... |
| 335 | 338 | ||
| 336 | (defvar todo-categories nil "TODO categories.") | 339 | (defvar todo-categories nil "TODO categories.") |
| 337 | (defvar todo-previous-line 0 "previous line that I asked about.") | 340 | (defvar todo-cats nil |
| 338 | (defvar todo-previous-answer 0 "previous answer that I got.") | 341 | "Old variable for holding the TODO categories. Use `todo-categories' instead.") |
| 342 | (defvar todo-previous-line 0 "Previous line that I asked about.") | ||
| 343 | (defvar todo-previous-answer 0 "Previous answer that I got.") | ||
| 339 | (defvar todo-mode-map nil "TODO mode keymap.") | 344 | (defvar todo-mode-map nil "TODO mode keymap.") |
| 340 | (defvar todo-category-number 0 "TODO category number.") | 345 | (defvar todo-category-number 0 "TODO category number.") |
| 341 | 346 | ||
| @@ -557,12 +562,13 @@ For details see the variable `time-stamp-format'.") | |||
| 557 | " " | 562 | " " |
| 558 | "\n\t") | 563 | "\n\t") |
| 559 | "(" (nth todo-category-number todo-categories) ": " | 564 | "(" (nth todo-category-number todo-categories) ": " |
| 560 | comment ")") | 565 | comment ")\n") |
| 561 | (widen) | ||
| 562 | (goto-char (todo-item-start)) | 566 | (goto-char (todo-item-start)) |
| 563 | (delete-region (point) (search-forward todo-prefix)) | ||
| 564 | (let ((temp-point (point))) | 567 | (let ((temp-point (point))) |
| 565 | (insert (time-stamp-string)) | 568 | (if (looking-at (regexp-quote todo-prefix)) |
| 569 | (replace-match (time-stamp-string)) ; Standard prefix -> timestamp | ||
| 570 | ;; Else prefix non-standard item start with timestamp | ||
| 571 | (insert (time-stamp-string))) | ||
| 566 | (append-to-file temp-point (todo-item-end) todo-file-done) | 572 | (append-to-file temp-point (todo-item-end) todo-file-done) |
| 567 | (delete-region temp-point (1+ (todo-item-end))) | 573 | (delete-region temp-point (1+ (todo-item-end))) |
| 568 | ) | 574 | ) |
| @@ -615,10 +621,8 @@ For details see the variable `time-stamp-format'.") | |||
| 615 | 621 | ||
| 616 | (defun todo-category-alist () | 622 | (defun todo-category-alist () |
| 617 | "Generate an alist fro use in `completing-read' from `todo-categories'" | 623 | "Generate an alist fro use in `completing-read' from `todo-categories'" |
| 618 | (let (alist) | 624 | (mapcar (lambda (cat) (cons cat nil)) |
| 619 | (mapcar (lambda (cat) (setq alist (cons (cons cat nil) alist))) | 625 | todo-categories)) |
| 620 | todo-categories) | ||
| 621 | alist)) | ||
| 622 | 626 | ||
| 623 | ;; utility functions: These are available in XEmacs, but not in Emacs 19.34 | 627 | ;; utility functions: These are available in XEmacs, but not in Emacs 19.34 |
| 624 | 628 | ||
| @@ -704,6 +708,9 @@ If SEPARATORS is absent, it defaults to \"[ \\f\\t\\n\\r\\v]+\"." | |||
| 704 | (if (null todo-cats) | 708 | (if (null todo-cats) |
| 705 | (error "Error in %s: No categories in list `todo-categories'" | 709 | (error "Error in %s: No categories in list `todo-categories'" |
| 706 | todo-file-do) | 710 | todo-file-do) |
| 711 | (goto-char (point-min)) | ||
| 712 | (and (search-forward "todo-cats:" nil t) | ||
| 713 | (replace-match "todo-categories:")) | ||
| 707 | (make-local-variable todo-categories) | 714 | (make-local-variable todo-categories) |
| 708 | (setq todo-categories todo-cats))) | 715 | (setq todo-categories todo-cats))) |
| 709 | (beginning-of-line) | 716 | (beginning-of-line) |