From mboxrd@z Thu Jan 1 00:00:00 1970 From: Rainer Stengele Subject: How to know in elisp if I am in the agenda .. Date: Thu, 11 Apr 2013 14:13:46 +0200 Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: 7bit Return-path: Received: from eggs.gnu.org ([208.118.235.92]:49208) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UQGO7-00086l-Td for emacs-orgmode@gnu.org; Thu, 11 Apr 2013 08:14:04 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UQGO4-0004GB-Oh for emacs-orgmode@gnu.org; Thu, 11 Apr 2013 08:13:59 -0400 Received: from plane.gmane.org ([80.91.229.3]:56016) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UQGO4-0004Fj-H7 for emacs-orgmode@gnu.org; Thu, 11 Apr 2013 08:13:56 -0400 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1UQGNz-00074w-Rf for emacs-orgmode@gnu.org; Thu, 11 Apr 2013 14:13:51 +0200 Received: from 212.34.176.74 ([212.34.176.74]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 11 Apr 2013 14:13:51 +0200 Received: from rainer.stengele by 212.34.176.74 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 11 Apr 2013 14:13:51 +0200 List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org 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 "") 'rst/clock-in-out) (define-key org-mode-map (kbd "") '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