From mboxrd@z Thu Jan 1 00:00:00 1970 From: Derek Feichtinger Subject: PATCH: invoking RET on agenda clock log line ends up with point in closed clock drawer Date: Thu, 28 Apr 2016 05:29:13 +0000 (UTC) Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:52354) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aveVv-0002mA-Ny for emacs-orgmode@gnu.org; Thu, 28 Apr 2016 01:29:24 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aveVs-0002zs-Hm for emacs-orgmode@gnu.org; Thu, 28 Apr 2016 01:29:23 -0400 Received: from plane.gmane.org ([80.91.229.3]:56614) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aveVs-0002zl-Ac for emacs-orgmode@gnu.org; Thu, 28 Apr 2016 01:29:20 -0400 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1aveVq-00039S-Ld for emacs-orgmode@gnu.org; Thu, 28 Apr 2016 07:29:18 +0200 Received: from 185.32.106.92.dynamic.wline.res.cust.swisscom.ch ([92.106.32.185]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 28 Apr 2016 07:29:18 +0200 Received: from dfeich by 185.32.106.92.dynamic.wline.res.cust.swisscom.ch with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 28 Apr 2016 07:29:18 +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" To: emacs-orgmode@gnu.org Hello A longer time ago, hitting RET on an agenda clock log line brought up the respective org buffer with the cursor positioned on the clock line. At some point this stopped to work cleanly, at least when using clock drawers. The clock drawer would always be closed (even when it was opened in the org buffer before jumping.) with the cursor being in the hidden drawer. So, it became impossible to find the target clock line for e.g. modifying it. I had fixed it for myself a longer time ago and forgot to submit my proposal for a patch, until yesterday another user raised my attention to it. My proposal for a patch is ;; when jumping to the agenda from a log message, the point ends up at ;; a CLOCK item in a LOGBOOK drawer, but the drawer gets closed, even ;; if the drawer was open before. I add a drawer opening function to ;; the respective agenda hook (defun org-open-if-in-drawer () (let ((element (org-element-at-point))) (while (and element (not (memq (org-element-type element) '(drawer property-drawer)))) (setq element (org-element-property :parent element))) (when element (let ((pos (point))) (goto-char (org-element-property :begin element)) (org-flag-drawer nil) (goto-char pos))))) (add-hook 'org-agenda-after-show-hook #'org-open-if-in-drawer) Best regards, Derek