aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOliver Seidel1997-10-28 21:47:12 +0000
committerOliver Seidel1997-10-28 21:47:12 +0000
commitd145aa839c859041eec4a54bf84d8837cc32d4c7 (patch)
tree36b409e724cd75804cbaf41edbe5c0d2ce9c3987
parent5d035cad7d3a36e658b6a4048de7de7bbd3a4bdd (diff)
downloademacs-d145aa839c859041eec4a54bf84d8837cc32d4c7.tar.gz
emacs-d145aa839c859041eec4a54bf84d8837cc32d4c7.zip
Implemented "insert-under-cursor" as suggested by
Kai Grossjohann <grossjohann@ls6.cs.uni-dortmund.de>.
-rw-r--r--lisp/calendar/todo-mode.el25
1 files changed, 21 insertions, 4 deletions
diff --git a/lisp/calendar/todo-mode.el b/lisp/calendar/todo-mode.el
index 9a925e01935..5275c9e4364 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.27 1997/10/28 21:26:55 os10000 Exp os10000 $ 7;; Version: $Id: todo-mode.el,v 1.28 1997/10/28 21:37:05 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.27 1997/10/28 21:26:55 os10000 Exp os10000 $ 99;; $Id: todo-mode.el,v 1.28 1997/10/28 21:37:05 os10000 Exp os10000 $
100;; 100;;
101;; Pre-Requisites 101;; Pre-Requisites
102;; 102;;
@@ -265,6 +265,10 @@
265;;; Change Log: 265;;; Change Log:
266 266
267;; $Log: todo-mode.el,v $ 267;; $Log: todo-mode.el,v $
268;; Revision 1.28 1997/10/28 21:37:05 os10000
269;; Incorporated simplifying suggestions from
270;; Carsten Dominik <dominik@strw.LeidenUniv.nl>.
271;;
268;; Revision 1.27 1997/10/28 21:26:55 os10000 272;; Revision 1.27 1997/10/28 21:26:55 os10000
269;; Patch from Paul Stodghill <stodghil@CS.Cornell.EDU>: 273;; Patch from Paul Stodghill <stodghil@CS.Cornell.EDU>:
270;; The patch below fixes todo-insert-item so that it will 274;; The patch below fixes todo-insert-item so that it will
@@ -615,6 +619,7 @@ Use `todo-categories' instead.")
615 (define-key map "d" 'todo-file-item) ;done/delete 619 (define-key map "d" 'todo-file-item) ;done/delete
616 (define-key map "f" 'todo-file-item) 620 (define-key map "f" 'todo-file-item)
617 (define-key map "i" 'todo-insert-item) 621 (define-key map "i" 'todo-insert-item)
622 (define-key map "I" 'todo-insert-item-here)
618 (define-key map "j" 'todo-jump-to-category) 623 (define-key map "j" 'todo-jump-to-category)
619 (define-key map "k" 'todo-delete-item) 624 (define-key map "k" 'todo-delete-item)
620 (define-key map "l" 'todo-lower-item) 625 (define-key map "l" 'todo-lower-item)
@@ -782,7 +787,6 @@ category."
782 (interactive "P") 787 (interactive "P")
783 (save-excursion 788 (save-excursion
784 (todo-show) 789 (todo-show)
785 )
786 (let* ((new-item (concat todo-prefix " " 790 (let* ((new-item (concat todo-prefix " "
787 (read-from-minibuffer 791 (read-from-minibuffer
788 "New TODO entry: " 792 "New TODO entry: "
@@ -798,10 +802,22 @@ category."
798 (concat "Category [" 802 (concat "Category ["
799 current-category "]: ") 803 current-category "]: ")
800 (todo-category-alist) nil nil nil history)))) 804 (todo-category-alist) nil nil nil history))))
801 (todo-add-item-non-interactively new-item category ARG))) 805 (todo-add-item-non-interactively new-item category ARG))))
802 806
803(defalias 'todo-cmd-inst 'todo-insert-item) 807(defalias 'todo-cmd-inst 'todo-insert-item)
804 808
809;;;### autoload
810(defun todo-insert-item-here ()
811 "Insert new TODO list entry under the cursor."
812 (interactive)
813 (save-excursion
814 (let* ((new-item (concat todo-prefix " "
815 (read-from-minibuffer
816 "New TODO entry: "
817 (if todo-entry-prefix-function
818 (funcall todo-entry-prefix-function))))))
819 (insert (concat new-item "\n")))))
820
805(defun todo-more-important-p (line) 821(defun todo-more-important-p (line)
806 "Ask whether entry is more important than the one at LINE." 822 "Ask whether entry is more important than the one at LINE."
807 (if (not (equal todo-previous-line line)) 823 (if (not (equal todo-previous-line line))
@@ -1101,6 +1117,7 @@ If SEPARATORS is absent, it defaults to \"[ \\f\\t\\n\\r\\v]+\"."
1101 ["Edit item" todo-edit-item t] 1117 ["Edit item" todo-edit-item t]
1102 ["File item" todo-file-item t] 1118 ["File item" todo-file-item t]
1103 ["Insert new item" todo-insert-item t] 1119 ["Insert new item" todo-insert-item t]
1120 ["Insert item here" todo-insert-item-here t]
1104 ["Kill item" todo-delete-item t] 1121 ["Kill item" todo-delete-item t]
1105 "---" 1122 "---"
1106 ["Lower item priority" todo-lower-item t] 1123 ["Lower item priority" todo-lower-item t]