[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[mhc:02290] Re: toggle todos



commited:

2008-07-04  David Bremner / Yoshinari Nomura <nom@xxxxxxxxxxxxx>

        * emacs/mhc-draft.el, emacs/mhc.el:
        (mhc-draft-toggle-done), (mhc-todo-toggle-done): new functions.

On Mon, 30 Jun 2008 16:03:57 +0200,
	David Bremner <bremner@xxxxxx> said:

> [ I hope it is OK to write to this list in English. My Nihongo pretty
> much starts and stops at sumimasen and o-kudasai. ]
> 
> I just started to use mhc, and I like it very much so far.
> 
> Here is a simple addition to allow toggling todo's with "ctrl-C . @".
> 
> (define-key mhc-prefix-map "@" 'mhc-todo-toggle-done)
> (defun mhc-todo-toggle-done ()
>   "Toggle between done and not for todo"
>   (interactive)
>   (mhc-modify-file (mhc-summary-filename))
>   (mhc-draft-toggle-done)
>   (mhc-draft-finish)
>   (message ""))
> 
> (defun mhc-draft-toggle-done ()
>   "Set current draft as DONE if not; remove done if there."
>   (interactive)
>   (if  (mhc-draft-in-category-p "todo")
>       (if (mhc-draft-in-category-p "done")
> 	  (mhc-draft-delete-category "done")
> 	(mhc-draft-append-category "Done"))))