diff options
| author | Stephen Berman | 2012-10-30 17:41:14 +0000 |
|---|---|---|
| committer | Stephen Berman | 2012-10-30 17:41:14 +0000 |
| commit | 59ad682ff2476221cc4db597fb4f6a080ed3b36b (patch) | |
| tree | 2bf8de139935609df3b495be67ad4811b5ce1d49 | |
| parent | fec0fdaebb3e1db03b7b76ef5ea2dad61c2399f8 (diff) | |
| download | emacs-59ad682ff2476221cc4db597fb4f6a080ed3b36b.tar.gz emacs-59ad682ff2476221cc4db597fb4f6a080ed3b36b.zip | |
* calendar/todos.el (todos-define-insertion-command):
Let generated insertion commands accept a prefix argument.
| -rw-r--r-- | lisp/ChangeLog | 5 | ||||
| -rw-r--r-- | lisp/calendar/todos.el | 13 |
2 files changed, 16 insertions, 2 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index ae920322f8a..5be90afcb7f 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,8 @@ | |||
| 1 | 2012-10-30 Stephen Berman <stephen.berman@gmx.net> | ||
| 2 | |||
| 3 | * calendar/todos.el (todos-define-insertion-command): | ||
| 4 | Let generated insertion commands accept a prefix argument. | ||
| 5 | |||
| 1 | 2012-10-08 Stephen Berman <Stephen.Berman@rub.de> | 6 | 2012-10-08 Stephen Berman <Stephen.Berman@rub.de> |
| 2 | 7 | ||
| 3 | * calendar/todos.el (todos-move-item): If user quits before | 8 | * calendar/todos.el (todos-move-item): If user quits before |
diff --git a/lisp/calendar/todos.el b/lisp/calendar/todos.el index 977d74501a9..056ebc446a9 100644 --- a/lisp/calendar/todos.el +++ b/lisp/calendar/todos.el | |||
| @@ -2332,6 +2332,7 @@ which is the value of the user option | |||
| 2332 | "-\\_>" "" | 2332 | "-\\_>" "" |
| 2333 | (replace-regexp-in-string | 2333 | (replace-regexp-in-string |
| 2334 | "-+" "-" | 2334 | "-+" "-" |
| 2335 | ;; FIXME: "todos-insert-item-" | ||
| 2335 | (concat "todos-item-insert-" | 2336 | (concat "todos-item-insert-" |
| 2336 | (mapconcat (lambda (e) (if e (symbol-name e))) arglist "-"))))) | 2337 | (mapconcat (lambda (e) (if e (symbol-name e))) arglist "-"))))) |
| 2337 | 2338 | ||
| @@ -2341,6 +2342,7 @@ which is the value of the user option | |||
| 2341 | todos-insertion-commands-args) | 2342 | todos-insertion-commands-args) |
| 2342 | "List of names of Todos insertion commands.") | 2343 | "List of names of Todos insertion commands.") |
| 2343 | 2344 | ||
| 2345 | ;; FIXME: prefix argument ARG is nil | ||
| 2344 | (defmacro todos-define-insertion-command (&rest args) | 2346 | (defmacro todos-define-insertion-command (&rest args) |
| 2345 | (let ((name (intern (todos-insertion-command-name args))) | 2347 | (let ((name (intern (todos-insertion-command-name args))) |
| 2346 | (arg0 (nth 0 args)) | 2348 | (arg0 (nth 0 args)) |
| @@ -2348,11 +2350,14 @@ which is the value of the user option | |||
| 2348 | (arg2 (nth 2 args)) | 2350 | (arg2 (nth 2 args)) |
| 2349 | (arg3 (nth 3 args)) | 2351 | (arg3 (nth 3 args)) |
| 2350 | (arg4 (nth 4 args))) | 2352 | (arg4 (nth 4 args))) |
| 2351 | `(defun ,name (&optional arg) | 2353 | `(defun ,name (&optional arg &rest args) |
| 2352 | "Todos item insertion command generated from ARGS." | 2354 | "Todos item insertion command generated from ARGS." |
| 2353 | (interactive) | 2355 | (interactive (list current-prefix-arg)) |
| 2354 | (todos-insert-item arg ',arg0 ',arg1 ',arg2 ',arg3 ',arg4)))) | 2356 | (todos-insert-item arg ',arg0 ',arg1 ',arg2 ',arg3 ',arg4)))) |
| 2355 | 2357 | ||
| 2358 | ;; FIXME: exclude todos-insert-item (or rather from | ||
| 2359 | ;; todos-insertion-key-bindings?), otherwise its doc string won't be | ||
| 2360 | ;; found with C-h k (but it will with M-x todos-insert-item) | ||
| 2356 | (defvar todos-insertion-commands | 2361 | (defvar todos-insertion-commands |
| 2357 | (mapcar (lambda (c) | 2362 | (mapcar (lambda (c) |
| 2358 | (eval `(todos-define-insertion-command ,@c))) | 2363 | (eval `(todos-define-insertion-command ,@c))) |
| @@ -4235,6 +4240,8 @@ the priority is not given by HERE but by prompting." | |||
| 4235 | "\\(\n\\)[^[:blank:]]" | 4240 | "\\(\n\\)[^[:blank:]]" |
| 4236 | (concat "\n" (make-string todos-indent-to-here 32)) | 4241 | (concat "\n" (make-string todos-indent-to-here 32)) |
| 4237 | new-item nil nil 1)) | 4242 | new-item nil nil 1)) |
| 4243 | ;; FIXME: after jumping to another category due to `C-u i h', | ||
| 4244 | ;; item is inserted as first item -- ok? | ||
| 4238 | (if here | 4245 | (if here |
| 4239 | (cond ((not (eq major-mode 'todos-mode)) | 4246 | (cond ((not (eq major-mode 'todos-mode)) |
| 4240 | (error "Cannot insert a todo item here outside of Todos mode")) | 4247 | (error "Cannot insert a todo item here outside of Todos mode")) |
| @@ -4618,6 +4625,8 @@ items in this category." | |||
| 4618 | (insert diary-nonmarking-symbol)))) | 4625 | (insert diary-nonmarking-symbol)))) |
| 4619 | (todos-forward-item))))))) | 4626 | (todos-forward-item))))))) |
| 4620 | 4627 | ||
| 4628 | ;; FIXME: Make NOP if point isn't on a todo item (cf. todos-copy-item, | ||
| 4629 | ;; todos-move-item | ||
| 4621 | (defun todos-set-item-priority (&optional item cat new arg) | 4630 | (defun todos-set-item-priority (&optional item cat new arg) |
| 4622 | "Set todo ITEM's priority in CATegory and move item accordingly. | 4631 | "Set todo ITEM's priority in CATegory and move item accordingly. |
| 4623 | 4632 | ||