emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[O] How to know in elisp if I am in the agenda ..


From: Rainer Stengele
Subject: [O] How to know in elisp if I am in the agenda ..
Date: Thu, 11 Apr 2013 14:13:46 +0200
User-agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:17.0) Gecko/20130307 Thunderbird/17.0.4

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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]