diff options
| -rw-r--r-- | lisp/ChangeLog | 5 | ||||
| -rw-r--r-- | lisp/calendar/todos.el | 12 |
2 files changed, 17 insertions, 0 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 05c3436b3b8..0c58a997c81 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,5 +1,10 @@ | |||
| 1 | 2012-09-24 Stephen Berman <stephen.berman@gmx.net> | 1 | 2012-09-24 Stephen Berman <stephen.berman@gmx.net> |
| 2 | 2 | ||
| 3 | * calendar/todos.el (todos-copy-item): New command. | ||
| 4 | (todos-insertion-map): Add key binding for it. | ||
| 5 | |||
| 6 | 2012-09-24 Stephen Berman <stephen.berman@gmx.net> | ||
| 7 | |||
| 3 | * calendar/todos.el (todos-undo-item-omit-comment): New defcustom. | 8 | * calendar/todos.el (todos-undo-item-omit-comment): New defcustom. |
| 4 | (todos-item-undo): Use it. | 9 | (todos-item-undo): Use it. |
| 5 | (todos-allcats-file, todos-all-categories-alist): New variables. | 10 | (todos-allcats-file, todos-all-categories-alist): New variables. |
diff --git a/lisp/calendar/todos.el b/lisp/calendar/todos.el index b3ff3191b96..5c07f620770 100644 --- a/lisp/calendar/todos.el +++ b/lisp/calendar/todos.el | |||
| @@ -2382,6 +2382,7 @@ which is the value of the user option | |||
| 2382 | (defvar todos-insertion-map | 2382 | (defvar todos-insertion-map |
| 2383 | (let ((map (make-keymap))) | 2383 | (let ((map (make-keymap))) |
| 2384 | (todos-insertion-key-bindings map) | 2384 | (todos-insertion-key-bindings map) |
| 2385 | (define-key map "p" 'todos-copy-item) | ||
| 2385 | map) | 2386 | map) |
| 2386 | "Keymap for Todos mode insertion commands.") | 2387 | "Keymap for Todos mode insertion commands.") |
| 2387 | 2388 | ||
| @@ -4241,6 +4242,17 @@ the priority is not given by HERE but by prompting." | |||
| 4241 | (if (or diary todos-include-in-diary) (todos-update-count 'diary 1)) | 4242 | (if (or diary todos-include-in-diary) (todos-update-count 'diary 1)) |
| 4242 | (todos-update-categories-sexp))))) | 4243 | (todos-update-categories-sexp))))) |
| 4243 | 4244 | ||
| 4245 | (defun todos-copy-item () | ||
| 4246 | "Copy item at point and insert the copy as a new item." | ||
| 4247 | (interactive) | ||
| 4248 | (unless (or (todos-done-item-p) (looking-at "^$")) | ||
| 4249 | (let ((copy (todos-item-string)) | ||
| 4250 | (diary-item (todos-diary-item-p))) | ||
| 4251 | (todos-set-item-priority copy (todos-current-category) t) | ||
| 4252 | (todos-update-count 'todo 1) | ||
| 4253 | (when diary-item (todos-update-count 'diary 1)) | ||
| 4254 | (todos-update-categories-sexp)))) | ||
| 4255 | |||
| 4244 | (defvar todos-date-from-calendar nil | 4256 | (defvar todos-date-from-calendar nil |
| 4245 | "Helper variable for setting item date from the Emacs Calendar.") | 4257 | "Helper variable for setting item date from the Emacs Calendar.") |
| 4246 | 4258 | ||