emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Bastien <bzg@altern.org>
To: emacs-orgmode@gnu.org
Subject: Re: heads up: mode hooks not executed for agenda files
Date: Sat, 26 Jan 2013 14:25:18 +0100	[thread overview]
Message-ID: <877gn05b5t.fsf@bzg.ath.cx> (raw)
In-Reply-To: <87hamkbtrm.fsf@ucl.ac.uk> (Eric S. Fraga's message of "Mon, 14 Jan 2013 09:00:37 +1030")

Hi Eric,

Eric S Fraga <e.fraga@ucl.ac.uk> 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

      reply	other threads:[~2013-01-26 13:25 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-01-13 22:30 heads up: mode hooks not executed for agenda files Eric S Fraga
2013-01-26 13:25 ` Bastien [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=877gn05b5t.fsf@bzg.ath.cx \
    --to=bzg@altern.org \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).