[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [O] org-mode-hook not called when entering org files
From: |
Nick Dokos |
Subject: |
Re: [O] org-mode-hook not called when entering org files |
Date: |
Mon, 15 Sep 2014 17:33:21 -0400 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.4.50 (gnu/linux) |
address@hidden (Rémi Letot) writes:
> Nick Dokos <address@hidden> writes:
>
>> address@hidden (Rémi Letot) writes:
>>
>>> all org seems to work fine, but for some reason org-mode-hook is not
>>> called when I open an org file...
>>>
>>
>> That's very unlikely: the hook is run using a general emacs mechanism,
>> so if it were broken, a *lot* of things would be broken.
>>
>> You can check with
>>
>> (setq org-mode-hook nil)
>> (add-hook 'org-mode-hook (function (lambda () (message "RL - my
>> org-mode-hook ran this"))))
>
> emacs -Q, copied your instructions in scratch buffer and C-x C-e them
> both, then opened my test.org file, and nothing happened.
>
Not sure where you get your org-mode, but unless you are using the
org-mode that was bundled with your emacs, this may not be enough:
you might have to do some org-mode initialization (hence the suggestion
for a minimal .emacs file below).
> Tried in another emacs -Q to set up a basic org-crypt using scratch:
>
> (require 'org-crypt)
> (org-crypt-use-before-save-magic)
>
> C-x C-e on both, then opened a test.org. org-mode-hook is as it should,
> but before-save-hook is nil.
>
My advice would be to leave org-crypt to one side until you can get the
simpler test above to pass.
> Now I noticed a message that I have received for some times when I open
> an org file:
>
> File mode specification error: (error "`recenter'ing a window that does
> not display current-buffer.")
>
> I didn't notice it before since it has happened for quite some times and
> didn't appear to cause any problem, but could it be the cause of this
> problem ?
>
>>
>> perhaps in a minimal .emacs, and then opening a foo.org file (assuming
>> your auto-mode-alist is set up correctly).
>
> auto-mode-alist does include org-mode for org files.
>
> Any idea ? is the error message that I receive a possible cause ?
>
Yes, it might: Eric Fraga reported a problem where an error that's
caught causes buffer initialization to not run the hook:
http://thread.gmane.org/gmane.emacs.orgmode/90711
That *might* happen with your error too, although I cannot find the error
message either in current org-mode or current-emacs. Maybe I'm looking
in the wrong place, but which version of org-mode and which version of
emacs are you running?
--
Nick
- [O] org-crypt doesn't automatically encrypt on save, Rémi Letot, 2014/09/11
- Re: [O] org-crypt doesn't automatically encrypt on save, Darlan Cavalcante Moreira, 2014/09/11
- Re: [O] org-crypt doesn't automatically encrypt on save, Rémi Letot, 2014/09/12
- Re: [O] org-crypt doesn't automatically encrypt on save, Darlan Cavalcante Moreira, 2014/09/12
- [O] org-mode-hook not called when entering org files (Was: Re: org-crypt doesn't automatically encrypt on save), Rémi Letot, 2014/09/12
- Re: [O] org-mode-hook not called when entering org files, Nick Dokos, 2014/09/12
- Re: [O] org-mode-hook not called when entering org files, Rémi Letot, 2014/09/13
- Re: [O] org-mode-hook not called when entering org files,
Nick Dokos <=
- Re: [O] org-mode-hook not called when entering org files, Rémi Letot, 2014/09/16
- Re: [O] org-mode-hook not called when entering org files, Nick Dokos, 2014/09/16
- Re: [O] org-mode-hook not called when entering org files, Nick Dokos, 2014/09/15
Re: [O] org-crypt doesn't automatically encrypt on save, Jorge A. Alfaro-Murillo, 2014/09/12