emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* How to setup this custom function with Org-mode functions? (org-habit)
@ 2014-03-28  8:09 stardiviner
  2014-03-29 15:13 ` Marcin Borkowski
  0 siblings, 1 reply; 3+ messages in thread
From: stardiviner @ 2014-03-28  8:09 UTC (permalink / raw)
  To: emacs-orgmode


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/

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: How to setup this custom function with Org-mode functions? (org-habit)
  2014-03-28  8:09 How to setup this custom function with Org-mode functions? (org-habit) stardiviner
@ 2014-03-29 15:13 ` Marcin Borkowski
  2014-07-26  8:23   ` stardiviner
  0 siblings, 1 reply; 3+ messages in thread
From: Marcin Borkowski @ 2014-03-29 15:13 UTC (permalink / raw)
  To: emacs-orgmode

Dnia 2014-03-28, o godz. 16:09:01
stardiviner <numbchild@gmail.com> napisał(a):

> 
> 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.

Is this of any help?

http://mbork.pl/2013-09-23_Automatic_insertion_of_habit_templates_%28en%29

Hth,

-- 
Marcin Borkowski
http://octd.wmi.amu.edu.pl/en/Marcin_Borkowski
Adam Mickiewicz University

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: How to setup this custom function with Org-mode functions? (org-habit)
  2014-03-29 15:13 ` Marcin Borkowski
@ 2014-07-26  8:23   ` stardiviner
  0 siblings, 0 replies; 3+ messages in thread
From: stardiviner @ 2014-07-26  8:23 UTC (permalink / raw)
  To: Marcin Borkowski; +Cc: emacs-orgmode


This is what I want, thanks very much.

Marcin Borkowski <mbork@wmi.amu.edu.pl> writes:

> Dnia 2014-03-28, o godz. 16:09:01
> stardiviner <numbchild@gmail.com> napisał(a):
>
>> 
>> 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.
>
> Is this of any help?
>
> http://mbork.pl/2013-09-23_Automatic_insertion_of_habit_templates_%28en%29
>
> Hth,

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2014-07-26  8:26 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-03-28  8:09 How to setup this custom function with Org-mode functions? (org-habit) stardiviner
2014-03-29 15:13 ` Marcin Borkowski
2014-07-26  8:23   ` stardiviner

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).