[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [O] heads up: mode hooks not executed for agenda files
From: |
Bastien |
Subject: |
Re: [O] heads up: mode hooks not executed for agenda files |
Date: |
Sat, 26 Jan 2013 14:25:18 +0100 |
User-agent: |
Gnus/5.130006 (Ma Gnus v0.6) Emacs/24.3.50 (gnu/linux) |
Hi Eric,
Eric S Fraga <address@hidden> writes:
> a problem I have had for a long time is that agenda files are opened
> without =org-mode-hook= and =text-mode-hook= being processed. This is a
> problem because I work within the agenda view all the time, writing notes
> by accessing entries from the agenda view.
>
> If I open an org file directly, both hooks are executed just fine.
Because your are opening the org file for the first time, so org-mode
and text-mode are run along with the associated hooks.
> However, if I hit =RET= on an agenda view line, I get put into the org
> file, at the correct point, but without those hooks having been executed.
> This means that the behaviour is different depending on how I ended up in
> the org file.
Because the files are already opened (check this with C-x C-b) so
org-mode and text-mode are not run.
> This is confusing!
>
> The solution is to add the same processing to =org-agenda-after-show-hook=
> as is included in =text-mode=hook= and =org-mode=hook=. This works.
> However, it seems clumsy to me.
This is the way to go. The idea is to have different hooks
when *opening* an org-mode file, and when *visiting* an entry
from the agenda, in a file that is already opened in Emacs.
> Bastien: enjoy your two week break and don't you dare read this email
> before then! ;-)
:)
Thanks,
--
Bastien