Re: [Orgmode] modeline clock string

2010-04-14 Thread Eric S Fraga
On Mon, 12 Apr 2010 09:38:15 +0400, Yuri Goncharov  wrote:
> 
> 
> 
> 
> > Yuri Goncharov schrieb:
> > > I use xmonad with xmobar at my desktop. I'd like to add clock
> > > string from mode line to xmobar. Is there  way to save it to
> > > file every time when update mode line?
> > > 
> > ---Zitatende---
> > 
> > You can find information on various subjects with M-x apropos but it's
> > sometimes hard to find the right keyword. I emacs, certain functions
> > are called when certain events occur, those functions are called
> > hooks. I found display-time-hook by doing M-x aproposhook
> > and then searching for status (no result) and update (which yielded
> > display-time-hook).
> > 
> > See documentation of variable display-time-hook
> 
> Thanks to answer! I need some more help, because my knowledge of lisp
> too poor. I found two hooks like I need org-clock-in-hook and 
> org-clock-out-hook. Function  org-clock-get-clock-string returns string
> that is showing in mode line. I cant figure how to write it in file.
> Apologies to my english. 
> 
> -- 
> Yuri Goncharov

Maybe this will help:

--8<---cut here---start->8---
;;  
DISPLAY-TIME
(display-time)
(defun esf/org-clocking-info-to-file ()
  (with-temp-file "~/tmp/clocking"
;; (message (org-clock-get-clock-string))
(if (org-clock-is-active)
(insert (format "org: %d/%d min" 
(- (org-clock-get-clocked-time) org-clock-total-time)
(org-clock-get-clocked-time))
)
  ) ;;(org-clock-get-clock-string)
)
  )
(add-hook 'display-time-hook 'esf/org-clocking-info-to-file)
--8<---cut here---end--->8---

I use this to place information on clocking at the top of my display
(using dzen2 with ratpoison).  I have minimal space so only include
the time information, not the full information which typically
includes the org-heading being clocked.

This doesn't work properly if you have two emacs instances but I can't
be bothered to improve it as I *never* have two or more emacs
running...  that's what emacsclient is for, after all... ;-)

HTH,
eric


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


Re: [Orgmode] modeline clock string

2010-04-11 Thread Yuri Goncharov



> Yuri Goncharov schrieb:
> > I use xmonad with xmobar at my desktop. I'd like to add clock
> > string from mode line to xmobar. Is there  way to save it to
> > file every time when update mode line?
> > 
> ---Zitatende---
> 
> You can find information on various subjects with M-x apropos but it's
> sometimes hard to find the right keyword. I emacs, certain functions
> are called when certain events occur, those functions are called
> hooks. I found display-time-hook by doing M-x aproposhook
> and then searching for status (no result) and update (which yielded
> display-time-hook).
> 
> See documentation of variable display-time-hook

Thanks to answer! I need some more help, because my knowledge of lisp
too poor. I found two hooks like I need org-clock-in-hook and 
org-clock-out-hook. Function  org-clock-get-clock-string returns string
that is showing in mode line. I cant figure how to write it in file.
Apologies to my english. 

-- 
Yuri Goncharov
system administrator
Highlink Ltd. St-Peterburg, Russia
+7 812 3341212
http://www.hl.ru


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


Re: [Orgmode] modeline clock string

2010-04-09 Thread Friedrich Delgado Friedrichs
Yuri Goncharov schrieb:
> I use xmonad with xmobar at my desktop. I'd like to add clock
> string from mode line to xmobar. Is there  way to save it to
> file every time when update mode line?
> 
---Zitatende---

You can find information on various subjects with M-x apropos but it's
sometimes hard to find the right keyword. I emacs, certain functions
are called when certain events occur, those functions are called
hooks. I found display-time-hook by doing M-x aproposhook
and then searching for status (no result) and update (which yielded
display-time-hook).

See documentation of variable display-time-hook

HTH

-- 
Friedrich Delgado Friedrichs 
 TauPan on Ircnet and Freenode ;)


pgpy7Ch5cyPTB.pgp
Description: PGP signature
___
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


[Orgmode] modeline clock string

2010-04-09 Thread Yuri Goncharov
I use xmonad with xmobar at my desktop. I'd like to add clock
string from mode line to xmobar. Is there  way to save it to
file every time when update mode line?

-- 
Yuri Goncharov
system administrator
Highlink Ltd. St-Peterburg, Russia
+7 812 3341212
http://www.hl.ru


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