[Orgmode] Re: Error message when running remember - byte-code: Before first headline at position 363 in buffer *Remember*

2009-04-09 Thread dericbytes
Deric Bytes  gmail.com> writes:

> 
> I was hoping to add a top-level heading to my file. I changed
> 
>   (setq org-remember-templates
>   '(("* Task" ?t "%^{Task status|TODO|STARTED|SUBTASK} %^{Brief
> Description} %^G\n %^{subject}p  %^{other-subjects}p
> %^{sub-subjects}p  %^{keywords}p %?\nCalled from: %a\nAdded: %U"
> "~/notes/notes-log-090410.org"))
> 
>  to this  ( subsituted '* Task'  for 'Task' )
> 
>   (setq org-remember-templates
>   '(("Task" ?t "%^{Task status|TODO|STARTED|SUBTASK} %^{Brief
> Description} %^G\n %^{subject}p  %^{other-subjects}p
> %^{sub-subjects}p  %^{keywords}p %?\nCalled from: %a\nAdded: %U"
> "~/notes/notes-log-090410.org"))
> 
>  i did this because it was adding double stars.
> 
> I got the following error message when adding properties to my template
> 
> byte-code: Before first headline at position 363 in buffer *Remember*
> 
> 
> ___
> Emacs-orgmode mailing list
> Remember: use `Reply All' to send replies to the list.
> Emacs-orgmode  gnu.org
> http://lists.gnu.org/mailman/listinfo/emacs-orgmode
> 
> 


 Just in case I confused someone. Here was the code that worked originally. ( I
made a typo )

   (setq org-remember-templates
   '(("Task" ?t "* %^{Task status|TODO|STARTED|SUBTASK} %^{Brief
 Description} %^G\n %^{subject}p  %^{other-subjects}p
 %^{sub-subjects}p  %^{keywords}p %?\nCalled from: %a\nAdded: %U"
 "~/notes/notes-log-090410.org"))





___
Emacs-orgmode mailing list
Remember: use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


[Orgmode] SOLVED: Changing todo status to waiting before clocked out.

2009-04-11 Thread dericbytes
Bernt, thanks for your email. It helped solve the problem... I thought
my reply would not get routed to the mailing list. He is my problem
and solution, for all to see

I used Sacha's code to automatically clock in and out when the TODO state
swapped between STARTED and WAITING.

I then added code to note if my remember template had the TODO state of
STARTED.  If so, I set it up to clock in that task on insertion (automatically
clocking out my old task)

My problem was the old task still had the STARTED state.





;; org-mode automatic clocking on TODO
;; --
(defun sacha/org-clock-in-if-starting ()
  "Clock in when the task is marked STARTED."
  (when (and (string= state "STARTED")
 (not (string= last-state state)))
(org-clock-in)))

(add-hook 'org-after-todo-state-change-hook
  'sacha/org-clock-in-if-starting)

(defadvice org-clock-in (after sacha activate)
  "Set this task's status to 'STARTED'."
  (org-todo "STARTED"))

(defun sacha/org-clock-out-if-waiting ()
  "Clock in when the task is marked STARTED."
  (when (and (string= state "WAITING")
 (not (string= last-state state)))
(org-clock-out)))

(add-hook 'org-after-todo-state-change-hook
  'sacha/org-clock-out-if-waiting)







;; start the clock if there is a STARTED todo tag in template
;
(add-hook 'org-remember-before-finalize-hook 'my-start-clock-if-needed)
(defun my-start-clock-if-needed ()

 (save-excursion
 (goto-char (point-min))
(when (re-search-forward "* STARTED" nil t)
 (change-todo-state-on-old-clock)
 (org-clock-in





; change the state of the old clock
;---
(defun change-todo-state-on-old-clock ()
; old-clock needs state changed if STARTED
(save-excursion
(progn
(if (not (marker-buffer org-clock-marker))
(if select
(error "No task selected")
  (error "No active clock")))
(set-buffer (marker-buffer org-clock-marker))
(goto-char (point-min))
(when  (re-search-forward "^\** STARTED" nil t)
(org-todo "WAITING")






; example template
;
 (setq org-remember-templates
  '(("Task" ?t "* %^{Task status|TODO|STARTED|SUBTASK|DONE} %^{Brief
Description} %^G\n %^{subject}p  %^{other-subjects}p  %^{sub-subjects}p 
%^{keywords}p %?\nAdded: %U \n" "~/notes/notes-log-090410.org" "Task")






___
Emacs-orgmode mailing list
Remember: use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


[Orgmode] fixed error in my code

2009-04-12 Thread dericbytes
- changed regex
- it now works if there is no clock running

(defun change-todo-state-on-old-clock ()
; old-clock needs state changed if STARTED
(save-excursion
(progn
(when (marker-buffer org-clock-marker)
(set-buffer (marker-buffer org-clock-marker))
(goto-char (point-min))
(when  (re-search-forward "^\*+ STARTED" nil t)
(org-todo "WAITING"))



___
Emacs-orgmode mailing list
Remember: use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


[Orgmode] example - add remember template as a top-level heading

2009-04-13 Thread dericbytes
Carsten Dominik  gmail.com> writes:

> 
> 
> On Apr 9, 2009, at 3:37 PM, Deric Bytes wrote:
> 
> > I was hoping to add a top-level heading to my file. I changed
> 
> Set the headline field in the template to 'top or 'bottom to get top- 
> level headlines and the beginning or end of the file, respectively.
> 
> - Carsten

Thanks  I had to look up what the headline field was. Also didn't know
whether to use "top", 'top, or top.  So here's my working template to save
some people time.


  (setq org-remember-templates
  '(("Task" ?t "* %^{Task status|TODO|STARTED|SUBTASK|DONE} %^{Brief
Description} %^G\n %^{subject}p  %^{other-subjects}p  %^{sub-subjects}p 
%^{keywords}p %?\nAdded: %U \n" "~/notes/now.org" top))






___
Emacs-orgmode mailing list
Remember: use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


[Orgmode] headline entries order.

2009-04-14 Thread dericbytes
I want to reverse the entries of my logs. So the newest is at the top. I know
there is the C-c ^ sort function, but I'm not sure if any are applicable. (Not
all of my entries are dated)



___
Emacs-orgmode mailing list
Remember: use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


[Orgmode] I wrote code to reverse top-level entries order within region

2009-04-18 Thread dericbytes
 
> I want to reverse the entries of my logs. So the newest is at the top. I know
> there is the C-c ^ sort function, but I'm not sure if any are applicable. (Not
> all of my entries are dated)


Here's a link to the code I wrote to reverse top-level entries on region.
http://dericbytes.blogspot.com/2009/04/emacs-orgmode-my-code-to-reverse.html

NOTE: its my first attempt at elisp, any tips for improving future code welcome.







___
Emacs-orgmode mailing list
Remember: use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


[Orgmode] thanks nick

2009-04-19 Thread dericbytes
Thanks nick,
 
made those changes + I do use indenting in emacs (indent-region)



___
Emacs-orgmode mailing list
Remember: use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode