diff options
| author | Oliver Seidel | 1997-08-05 16:47:01 +0000 |
|---|---|---|
| committer | Oliver Seidel | 1997-08-05 16:47:01 +0000 |
| commit | a360be793eb10c04895f004d1aa6d9c1291aa898 (patch) | |
| tree | 0151c513508dcf317161a3a360086d5df7c946c6 | |
| parent | da2ee6858f61cda1a41d73c90f47ee5f35338ab4 (diff) | |
| download | emacs-a360be793eb10c04895f004d1aa6d9c1291aa898.tar.gz emacs-a360be793eb10c04895f004d1aa6d9c1291aa898.zip | |
Incorporated menus for XEmacs from Allan.Cochrane@soton.sc.philips.com,
fixed TYPO, fixed todo-file-cmd, cleaned up rcs history.
| -rw-r--r-- | lisp/calendar/todo-mode.el | 63 |
1 files changed, 59 insertions, 4 deletions
diff --git a/lisp/calendar/todo-mode.el b/lisp/calendar/todo-mode.el index fb5049c6008..39f35a548fc 100644 --- a/lisp/calendar/todo-mode.el +++ b/lisp/calendar/todo-mode.el | |||
| @@ -6,9 +6,13 @@ | |||
| 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.4 1997/08/04 16:18:45 os10000 Exp os10000 $ | 9 | ;; $Id: todomode.el,v 1.5 1997/08/05 14:43:39 os10000 Exp os10000 $ |
| 10 | ;; | 10 | ;; |
| 11 | ;; $Log: todomode.el,v $ | 11 | ;; $Log: todomode.el,v $ |
| 12 | ;; Revision 1.5 1997/08/05 14:43:39 os10000 | ||
| 13 | ;; Added improvements from Ron Gut <rgut@aware.com>. | ||
| 14 | ;; Added category management. | ||
| 15 | ;; | ||
| 12 | ;; Revision 1.4 1997/08/04 16:18:45 os10000 | 16 | ;; Revision 1.4 1997/08/04 16:18:45 os10000 |
| 13 | ;; Added Raise/Lower item. | 17 | ;; Added Raise/Lower item. |
| 14 | ;; | 18 | ;; |
| @@ -29,7 +33,15 @@ | |||
| 29 | ;; To get this to work, make emacs execute the line "(require 'todomode)" | 33 | ;; To get this to work, make emacs execute the line "(require 'todomode)" |
| 30 | ;; and maybe initialise the variables below on startup. | 34 | ;; and maybe initialise the variables below on startup. |
| 31 | ;; | 35 | ;; |
| 32 | ;; Then you have the following facilities available: | 36 | ;; Just for the case that you are wondering about the ugly name of this |
| 37 | ;; package: I am one of those unfortunate people who have DOS, LINUX and | ||
| 38 | ;; OS/2 on one of their computers, so part of my home-filespace is shared | ||
| 39 | ;; and stored on a DOS partition, which is accessible to all systems. If | ||
| 40 | ;; you wish, you can of course rename the name of the file (and the last | ||
| 41 | ;; command) to something more aisthetically (please don't argue about | ||
| 42 | ;; this spelling ...) pleasing, like i.e. todo-mode. | ||
| 43 | ;; | ||
| 44 | ;; You will have the following facilities available: | ||
| 33 | ;; | 45 | ;; |
| 34 | ;; M-x todo-mode will enter the todo list screen, here type | 46 | ;; M-x todo-mode will enter the todo list screen, here type |
| 35 | ;; + to go to next category | 47 | ;; + to go to next category |
| @@ -46,6 +58,14 @@ | |||
| 46 | ;; r raise current entryk's priority | 58 | ;; r raise current entryk's priority |
| 47 | ;; s to save the list | 59 | ;; s to save the list |
| 48 | ;; | 60 | ;; |
| 61 | ;; When you add a new entry, you are asked for the text and then for the | ||
| 62 | ;; category. I for example have categories for things that I want to do | ||
| 63 | ;; in the office (like mail my mum), that I want to do in town (like buy | ||
| 64 | ;; cornflakes) and things I want to do at home (move my suitcases). The | ||
| 65 | ;; categories can be selected with the cursor keys and if you type in the | ||
| 66 | ;; name of a category which didn't exist before, an empty category of the | ||
| 67 | ;; desired name will be added. | ||
| 68 | ;; | ||
| 49 | ;; I would recommend to add the following bindings to your global keymap: | 69 | ;; I would recommend to add the following bindings to your global keymap: |
| 50 | ;; | 70 | ;; |
| 51 | ;; (global-set-key "\C-ct" 'todo-show) | 71 | ;; (global-set-key "\C-ct" 'todo-show) |
| @@ -58,6 +78,16 @@ | |||
| 58 | ;; I would also recommend that use the prefix "*/*" (by leaving the | 78 | ;; I would also recommend that use the prefix "*/*" (by leaving the |
| 59 | ;; variable 'todo-prefix' untouched) so that the diary displays | 79 | ;; variable 'todo-prefix' untouched) so that the diary displays |
| 60 | ;; each entry every day. | 80 | ;; each entry every day. |
| 81 | ;; | ||
| 82 | ;; For this, please read the documentation that goes with the calendar | ||
| 83 | ;; since that will tell you how you can set up the fancy diary display | ||
| 84 | ;; and use the #include command to include your todo list file as part | ||
| 85 | ;; of your diary. | ||
| 86 | ;; | ||
| 87 | ;; Enjoy this package and express your gratitude by sending valuables | ||
| 88 | ;; to my parents' address as listed above!!! | ||
| 89 | ;; | ||
| 90 | ;; Oliver Seidel | ||
| 61 | 91 | ||
| 62 | ;; --------------------------------------------------------------------------- | 92 | ;; --------------------------------------------------------------------------- |
| 63 | 93 | ||
| @@ -194,7 +224,7 @@ | |||
| 194 | (beginning-of-line nil) | 224 | (beginning-of-line nil) |
| 195 | (let* ((todo-entry (concat todo-prefix " " (read-from-minibuffer "New TODO entry: "))) | 225 | (let* ((todo-entry (concat todo-prefix " " (read-from-minibuffer "New TODO entry: "))) |
| 196 | (temp-catgs todo-cats) | 226 | (temp-catgs todo-cats) |
| 197 | (todo-hstry (cons 'temp-cats (+ todo-category-number 1)))) | 227 | (todo-hstry (cons 'temp-catgs (+ todo-category-number 1)))) |
| 198 | (save-window-excursion | 228 | (save-window-excursion |
| 199 | (setq todo-category | 229 | (setq todo-category |
| 200 | (read-from-minibuffer "Category: " (nth todo-category-number todo-cats) nil nil todo-hstry)) | 230 | (read-from-minibuffer "Category: " (nth todo-category-number todo-cats) nil nil todo-hstry)) |
| @@ -291,9 +321,10 @@ | |||
| 291 | (progn | 321 | (progn |
| 292 | (let ((time-stamp-format "%3b %2d, %y, %02I:%02M%p")) | 322 | (let ((time-stamp-format "%3b %2d, %y, %02I:%02M%p")) |
| 293 | (beginning-of-line nil) | 323 | (beginning-of-line nil) |
| 324 | (delete-region (point-at-bol) (search-forward todo-prefix)) | ||
| 294 | (insert (time-stamp-string)) | 325 | (insert (time-stamp-string)) |
| 295 | (end-of-line nil) | 326 | (end-of-line nil) |
| 296 | (insert (concat " (" (read-fromminibuffer "Comment: ") ")")) | 327 | (insert (concat " (" (read-from-minibuffer "Comment: ") ")")) |
| 297 | (append-to-file (point-at-bol) (+ 1 (point-at-eol)) todo-file-done) | 328 | (append-to-file (point-at-bol) (+ 1 (point-at-eol)) todo-file-done) |
| 298 | (delete-region (point-at-bol) (+ 1 (point-at-eol))) | 329 | (delete-region (point-at-bol) (+ 1 (point-at-eol))) |
| 299 | (forward-line -1) | 330 | (forward-line -1) |
| @@ -323,6 +354,29 @@ | |||
| 323 | 354 | ||
| 324 | ;; --------------------------------------------------------------------------- | 355 | ;; --------------------------------------------------------------------------- |
| 325 | 356 | ||
| 357 | (defvar todo-mode-popup-menu | ||
| 358 | (purecopy '("Todo Mode Menu" | ||
| 359 | ["Forward item" todo-cmd-forw t] | ||
| 360 | ["Backward item" todo-cmd-back t] | ||
| 361 | "---" | ||
| 362 | ["Edit item" todo-cmd-edit t] | ||
| 363 | ["File item" todo-cmd-file t] | ||
| 364 | ["Insert new item" todo-cmd-inst t] | ||
| 365 | ["Kill item" todo-cmd-kill t] | ||
| 366 | "---" | ||
| 367 | ["Lower item priority" todo-cmd-lowr t] | ||
| 368 | ["Raise item priority" todo-cmd-rais t] | ||
| 369 | "---" | ||
| 370 | ["Next item" todo-cmd-next t] | ||
| 371 | ["Previous item" todo-cmd-prev t] | ||
| 372 | "---" | ||
| 373 | ["Save" todo-cmd-save t] | ||
| 374 | "---" | ||
| 375 | ["Quit" todo-cmd-done t] | ||
| 376 | ) | ||
| 377 | ) | ||
| 378 | ) | ||
| 379 | |||
| 326 | (defvar todo-cats nil "TODO categories.") | 380 | (defvar todo-cats nil "TODO categories.") |
| 327 | (defvar todo-category-number 0 "TODO category number.") | 381 | (defvar todo-category-number 0 "TODO category number.") |
| 328 | 382 | ||
| @@ -331,6 +385,7 @@ | |||
| 331 | (setq major-mode 'todo-mode) | 385 | (setq major-mode 'todo-mode) |
| 332 | (setq mode-name "TODO") | 386 | (setq mode-name "TODO") |
| 333 | (use-local-map todo-mode-map) | 387 | (use-local-map todo-mode-map) |
| 388 | (setq mode-popup-menu todo-mode-popup-menu) | ||
| 334 | (run-hooks 'todo-mode-hook) | 389 | (run-hooks 'todo-mode-hook) |
| 335 | ) | 390 | ) |
| 336 | 391 | ||