emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: stardiviner <numbchild@gmail.com>
To: emacs-orgmode@gnu.org
Subject: How to setup this custom function with Org-mode functions? (org-habit)
Date: Fri, 28 Mar 2014 16:09:01 +0800	[thread overview]
Message-ID: <87siq2rbjf.fsf@gmail.com> (raw)


I want to create a custom keybinding to custom function which will execute all
necessary steps for creating an org habit.
The bellowing is my code, but seems it doesn't work at all.
I don't know how to write this custom function actually. (I just put some keybindings
corresponding functions in the custom function body.) And some org-mode
functions are interactively.

#+BEGIN_SRC emacs-lisp
;; TODO: create an key binding for all necessary steps for create a habit. (reference in Org-mode.org file)
(defun org-habit-apply ()
  "Apply org-habit on this task."
  (interactive)
  (lambda ()
    (org-todo "HABIT")
    (org-insert-property-drawer)        ; TODO: :STYLE: habit (value)
    (org-schedule)))

(define-key org-mode-map (kbd "C-c C-x h") 'org-habit-apply)
#+END_SRC

Does anybody can help me this? and thanks in advance.

-- 
[ stardiviner ] I want to save myself from this world.
IRC(freenode): stardiviner     \ Google+:  numbchild \
http://about.me/Evanescence/

             reply	other threads:[~2014-03-28  8:09 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-03-28  8:09 stardiviner [this message]
2014-03-29 15:13 ` How to setup this custom function with Org-mode functions? (org-habit) Marcin Borkowski
2014-07-26  8:23   ` stardiviner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87siq2rbjf.fsf@gmail.com \
    --to=numbchild@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).