all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* How to know in elisp if I am in the agenda ..
@ 2013-04-11 12:13 Rainer Stengele
  2013-04-11 12:31 ` Thorsten Jolitz
  0 siblings, 1 reply; 4+ messages in thread
From: Rainer Stengele @ 2013-04-11 12:13 UTC (permalink / raw)
  To: emacs-orgmode

Hi,

I try to automate clock in and clock out operations.

I have put something like this together:

(defun rst/clock-in-out ()
  (interactive)
  (when org-agenda-info
    ;; (org-agenda-switch-to))
    (org-agenda-goto))
  (show-subtree)
  (org-clock-in)
  (org-clock-out)
  (unless (org-at-heading-p) (outline-previous-heading))
  (search-forward "CLOCK: ")
  (forward-char 19)
  (org-shiftcontrolup)
  (org-shiftdown))

(define-key org-agenda-mode-map (kbd "<f10>") 'rst/clock-in-out)
(define-key org-mode-map (kbd "<f10>") 'rst/clock-in-out)


Being in any subtree it works flawlessly.
What I now want: Do the same when being on an agenda item and pressing F10.
I want to switch to the org file and start what already works.
What I have does not work, neither (org-agenda-switch-to) nor (org-agenda-goto)

Please help. Where could I find information/docs for something like
"How to determine when I am in agenda view"?

Thanks,
Rainer

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

end of thread, other threads:[~2013-04-11 14:07 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-04-11 12:13 How to know in elisp if I am in the agenda Rainer Stengele
2013-04-11 12:31 ` Thorsten Jolitz
2013-04-11 12:42   ` Tassilo Horn
2013-04-11 13:58     ` Rainer Stengele

Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.