From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Sebastien Vauban" Subject: Re: Issue when jumping from agenda view to clock line Date: Mon, 19 Nov 2012 23:46:53 +0100 Message-ID: <80ip91nrc2.fsf@somewhere.org> References: <87fw53syc9.fsf@somewhere.org> <87boex91hv.fsf@somewhere.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: 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-mXXj517/zsQ@public.gmane.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org-mXXj517/zsQ@public.gmane.org To: emacs-orgmode-mXXj517/zsQ@public.gmane.org Hello Francesco, "Francesco Pizzolante" wrote: >> Here's a small example. >> >> #+begin_src org >> * My tasks >> >> ** First task >> :LOGBOOK: >> CLOCK: [2012-10-22 Mon 13:00]--[2012-10-22 Mon 14:30] =3D> 1:00 >> CLOCK: [2012-10-23 Tue 13:00]--[2012-10-23 Tue 14:30] =3D> 1:00 >> CLOCK: [2012-10-24 Wed 13:00]--[2012-10-24 Wed 14:30] =3D> 1:00 >> :END: >> #+end_src >> >> In the agenda view (C-c a a) for Wed 24, enable the check view (v c), th= en >> press ENTER on the log line for "First task", you jump to the correspond= ing >> heading (First task) but it positions the cursor just after the :LOGBOOK: >> keyword and the drawer remains closed. > > Just to let you know that I found the issue... > > It was coming from the following code I was using (taken from Worg: > http://orgmode.org/worg/org-configs/org-hooks.html): > > =E2=95=AD=E2=94=80=E2=94=80=E2=94=80=E2=94=80 > =E2=94=82 ;; get a compact view during follow mode in the agenda > =E2=94=82 (defun my-compact-follow () > =E2=94=82 "Make the view compact, then show the necessary m= inimum." > =E2=94=82 (ignore-errors > =E2=94=82 (save-excursion > =E2=94=82 (while (org-up-heading-safe)) > =E2=94=82 (hide-subtree))) > =E2=94=82 (let ((org-show-siblings nil) > =E2=94=82 (org-show-hierarchy-above t)) > =E2=94=82 (org-reveal)) > =E2=94=82 (save-excursion > =E2=94=82 (org-back-to-heading t) > =E2=94=82 (show-children))) > =E2=94=82 > =E2=94=82 (add-hook 'org-agenda-after-show-hook 'my-compact-fo= llow) > =E2=95=B0=E2=94=80=E2=94=80=E2=94=80=E2=94=80 > > But I don't understand the cause of it. As I ran against the same problem, I've bisected Org in order to try and get more info. Git bisect identifies 1e73d2bbc3ce635928ddd234d16ac9332460aa72 as the first= bad commit --8<---------------cut here---------------start------------->8--- commit 1e73d2bbc3ce635928ddd234d16ac9332460aa72 Author: Bastien Guerry Date: Fri Aug 10 10:08:58 2012 +0200 org-agenda.el (org-agenda-switch-to): Run hooks in `org-agenda-after-sh= ow-hook' * org-agenda.el (org-agenda-switch-to): Run hooks in `org-agenda-after-show-hook'. Thanks to Jack Erwin for suggesting this. --8<---------------cut here---------------end--------------->8--- The diff: --8<---------------cut here---------------start------------->8--- diff --git a/lisp/org-agenda.el b/lisp/org-agenda.el index a70e968..09e5eab 100644 --- a/lisp/org-agenda.el +++ b/lisp/org-agenda.el @@ -7512,7 +7512,8 @@ at the text of the entry itself." (and (outline-next-heading) (org-flag-heading nil))) ; show the next heading (when (outline-invisible-p) - (show-entry)))))) ; display invisible text + (show-entry)) ; display invisible text + (run-hooks 'org-agenda-after-show-hook))))) (defun org-agenda-goto-mouse (ev) "Go to the Org-mode file which contains the item at the mouse click." --8<---------------cut here---------------end--------------->8--- `org-agenda-after-show-hook' is well referenced in there. That's clearly it! Now, it'd be interesting to know whether: - it should be removed? or - the customization (found on Worg) should be place in another hook (not run at that stage)? Bastien? Best regards, Seb --=20 Sebastien Vauban