From mboxrd@z Thu Jan 1 00:00:00 1970 From: stardiviner Subject: How to setup this custom function with Org-mode functions? (org-habit) Date: Fri, 28 Mar 2014 16:09:01 +0800 Message-ID: <87siq2rbjf.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:54750) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WTRr7-0001iG-9O for emacs-orgmode@gnu.org; Fri, 28 Mar 2014 04:09:42 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WTRr2-0002rz-Hn for emacs-orgmode@gnu.org; Fri, 28 Mar 2014 04:09:37 -0400 Received: from mail-pb0-x234.google.com ([2607:f8b0:400e:c01::234]:57158) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WTRr2-0002rr-Aj for emacs-orgmode@gnu.org; Fri, 28 Mar 2014 04:09:32 -0400 Received: by mail-pb0-f52.google.com with SMTP id rr13so4692312pbb.11 for ; Fri, 28 Mar 2014 01:09:31 -0700 (PDT) Received: from localhost ([36.250.89.32]) by mx.google.com with ESMTPSA id om6sm19510486pbc.43.2014.03.28.01.09.21 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Fri, 28 Mar 2014 01:09:29 -0700 (PDT) List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org 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/