diff options
| author | Oliver Seidel | 1997-08-03 12:47:26 +0000 |
|---|---|---|
| committer | Oliver Seidel | 1997-08-03 12:47:26 +0000 |
| commit | 7e6ed9b9b51fac2dd51ce08d75cc8252e63cbdc8 (patch) | |
| tree | 5a55a35c7be190f9baac8d4b8815b16342150ff1 | |
| parent | 384af0dd163717dabccfc95a32741cea932d161c (diff) | |
| download | emacs-7e6ed9b9b51fac2dd51ce08d75cc8252e63cbdc8.tar.gz emacs-7e6ed9b9b51fac2dd51ce08d75cc8252e63cbdc8.zip | |
Cleaned up variables, prefix and cursor position.
| -rw-r--r-- | lisp/calendar/todo-mode.el | 49 |
1 files changed, 46 insertions, 3 deletions
diff --git a/lisp/calendar/todo-mode.el b/lisp/calendar/todo-mode.el index ffc67fd4f9d..6c30f45f73f 100644 --- a/lisp/calendar/todo-mode.el +++ b/lisp/calendar/todo-mode.el | |||
| @@ -6,18 +6,57 @@ | |||
| 6 | ;; please contact (address) O Seidel, Lessingstr 8, Eschborn, FRG | 6 | ;; please contact (address) O Seidel, Lessingstr 8, Eschborn, FRG |
| 7 | ;; (e-mail ) Oliver.Seidel@cl.cam.ac.uk (2 Aug 1997) | 7 | ;; (e-mail ) Oliver.Seidel@cl.cam.ac.uk (2 Aug 1997) |
| 8 | 8 | ||
| 9 | ;; $Id: todomode.el,v 1.1 1997/08/03 12:15:13 os10000 Exp os10000 $ | 9 | ;; $Id: todomode.el,v 1.2 1997/08/03 12:15:28 os10000 Exp os10000 $ |
| 10 | ;; | 10 | ;; |
| 11 | ;; $Log: todomode.el,v $ | 11 | ;; $Log: todomode.el,v $ |
| 12 | ;; Revision 1.2 1997/08/03 12:15:28 os10000 | ||
| 13 | ;; It appears to work. | ||
| 14 | ;; | ||
| 12 | ;; Revision 1.1 1997/08/03 12:15:13 os10000 | 15 | ;; Revision 1.1 1997/08/03 12:15:13 os10000 |
| 13 | ;; Initial revision | 16 | ;; Initial revision |
| 14 | ;; | 17 | ;; |
| 15 | 18 | ||
| 16 | ;; --------------------------------------------------------------------------- | 19 | ;; --------------------------------------------------------------------------- |
| 17 | 20 | ||
| 21 | ;; Description: | ||
| 22 | ;; | ||
| 23 | ;; To get this to work, make emacs execute the line "(require 'todomode)" | ||
| 24 | ;; and maybe initialise the variables below on startup. | ||
| 25 | ;; | ||
| 26 | ;; Then you have the following facilities available: | ||
| 27 | ;; | ||
| 28 | ;; M-x todo-mode will enter the todo list screen, here type | ||
| 29 | ;; p for the previous entry | ||
| 30 | ;; n for the next entry | ||
| 31 | ;; q to save the list and exit the buffer | ||
| 32 | ;; e to edit the current entry | ||
| 33 | ;; i to insert a new entry | ||
| 34 | ;; k to kill the current entry | ||
| 35 | ;; f to file the current entry, including a | ||
| 36 | ;; comment and timestamp | ||
| 37 | ;; | ||
| 38 | ;; I would recommend to add the following bindings to your global keymap: | ||
| 39 | ;; | ||
| 40 | ;; (global-set-key "\C-ct" 'todo-mode) | ||
| 41 | ;; (global-set-key "\C-ci" 'todo-cmd-inst) | ||
| 42 | ;; | ||
| 43 | ;; This will enable you to quickly find the todo-list, or to simply add an | ||
| 44 | ;; entry, without changing to it and getting sidetracked from your current | ||
| 45 | ;; project. | ||
| 46 | ;; | ||
| 47 | ;; I would also recommend that you execute the command | ||
| 48 | ;; | ||
| 49 | ;; (setq todo-prefix "*/* ") | ||
| 50 | ;; | ||
| 51 | ;; to have all your entries prefixed in such a way that the diary displays | ||
| 52 | ;; them every day. | ||
| 53 | |||
| 54 | ;; --------------------------------------------------------------------------- | ||
| 55 | |||
| 18 | ;; User-configurable variables: | 56 | ;; User-configurable variables: |
| 19 | 57 | ||
| 20 | (defvar todo-file-do "~/.todo-do" "TODO mode filename of list file") | 58 | (defvar todo-prefix "" "TODO mode prefix when creating entries") |
| 59 | (defvar todo-file-do "~/.todo-do" "TODO mode filename of list file") | ||
| 21 | (defvar todo-file-done "~/.todo-done" "TODO mode filename of archive file") | 60 | (defvar todo-file-done "~/.todo-done" "TODO mode filename of archive file") |
| 22 | (defvar todo-mode-hook nil "Hooks invoked when the *TODO* buffer is created.") | 61 | (defvar todo-mode-hook nil "Hooks invoked when the *TODO* buffer is created.") |
| 23 | 62 | ||
| @@ -54,6 +93,8 @@ | |||
| 54 | 93 | ||
| 55 | (defun todo-cmd-done () "Done with todo list for now." | 94 | (defun todo-cmd-done () "Done with todo list for now." |
| 56 | (interactive) | 95 | (interactive) |
| 96 | (beginning-of-line nil) | ||
| 97 | (message "") | ||
| 57 | (save-buffer) | 98 | (save-buffer) |
| 58 | (bury-buffer) | 99 | (bury-buffer) |
| 59 | ) | 100 | ) |
| @@ -89,7 +130,8 @@ | |||
| 89 | 130 | ||
| 90 | (defun todo-cmd-inst () "Insert new todo list entry." | 131 | (defun todo-cmd-inst () "Insert new todo list entry." |
| 91 | (interactive) | 132 | (interactive) |
| 92 | (setq todo-entry (read-from-minibuffer "New TODO entry: ")) | 133 | (beginning-of-line nil) |
| 134 | (setq todo-entry (concat "*/* " (read-from-minibuffer "New TODO entry: "))) | ||
| 93 | (save-window-excursion | 135 | (save-window-excursion |
| 94 | (find-file todo-file-do) | 136 | (find-file todo-file-do) |
| 95 | (setq todo-prv-lne 0) | 137 | (setq todo-prv-lne 0) |
| @@ -155,6 +197,7 @@ | |||
| 155 | (setq major-mode 'todo-mode) | 197 | (setq major-mode 'todo-mode) |
| 156 | (setq mode-name "TODO") | 198 | (setq mode-name "TODO") |
| 157 | (use-local-map todo-mode-map) | 199 | (use-local-map todo-mode-map) |
| 200 | (beginning-of-line nil) | ||
| 158 | (run-hooks 'todo-mode-hook) ) | 201 | (run-hooks 'todo-mode-hook) ) |
| 159 | 202 | ||
| 160 | (provide 'todomode) | 203 | (provide 'todomode) |