emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Hooks and publishing
@ 2009-08-26 22:37 Sebastian Rose
  2009-08-27  5:46 ` Carsten Dominik
  0 siblings, 1 reply; 3+ messages in thread
From: Sebastian Rose @ 2009-08-26 22:37 UTC (permalink / raw)
  To: Emacs-orgmode mailing list

Hi,


I have this in one of my setup files:

   (add-hook 'text-mode-hook 'turn-on-flyspell)
   ;; (add-hook 'org-mode-hook 'turn-on-flyspell)
   (add-hook 'message-mode-hook 'turn-on-flyspell)

As you can see, the second line is already commented. But it seems,
org-mode runs text-mode-hook, too. This slows down export (especially,
if ispell is not yet installed on a new system...).


Is it possible (and does it make sense) to load all Org-files without
running any of the hooks?



   Sebastian

...who finally has a new machine (T500 + Ubuntu is great) and is now
online on a more regular base again :)

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Hooks and publishing
  2009-08-26 22:37 Hooks and publishing Sebastian Rose
@ 2009-08-27  5:46 ` Carsten Dominik
  2009-08-27 12:39   ` Sebastian Rose
  0 siblings, 1 reply; 3+ messages in thread
From: Carsten Dominik @ 2009-08-27  5:46 UTC (permalink / raw)
  To: Sebastian Rose; +Cc: Emacs-orgmode mailing list


On Aug 27, 2009, at 12:37 AM, Sebastian Rose wrote:

> Hi,
>
>
> I have this in one of my setup files:
>
>   (add-hook 'text-mode-hook 'turn-on-flyspell)
>   ;; (add-hook 'org-mode-hook 'turn-on-flyspell)
>   (add-hook 'message-mode-hook 'turn-on-flyspell)
>
> As you can see, the second line is already commented. But it seems,
> org-mode runs text-mode-hook, too. This slows down export (especially,
> if ispell is not yet installed on a new system...).
>
>
> Is it possible (and does it make sense) to load all Org-files without
> running any of the hooks?

Org-mode is derived from outline-mode, which is derived from text mode.
A derived mode runs all the hooks from the parent modes.

I don't know how to turn this off, but you can work around this
by changing the function you put into the text-mode-hook:

(defun my-turn-on-flyspell-not-in-org-though ()
    (or (eq major-mode 'org-mode) (turn-on-flyspell)))

HTH

- Carsten

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Hooks and publishing
  2009-08-27  5:46 ` Carsten Dominik
@ 2009-08-27 12:39   ` Sebastian Rose
  0 siblings, 0 replies; 3+ messages in thread
From: Sebastian Rose @ 2009-08-27 12:39 UTC (permalink / raw)
  To: Carsten Dominik; +Cc: Emacs-orgmode mailing list

Carsten Dominik <carsten.dominik@gmail.com> writes:
> On Aug 27, 2009, at 12:37 AM, Sebastian Rose wrote:
>
>> Hi,
>>
>>
>> I have this in one of my setup files:
>>
>>   (add-hook 'text-mode-hook 'turn-on-flyspell)
>>   ;; (add-hook 'org-mode-hook 'turn-on-flyspell)
>>   (add-hook 'message-mode-hook 'turn-on-flyspell)
>>
>> As you can see, the second line is already commented. But it seems,
>> org-mode runs text-mode-hook, too. This slows down export (especially,
>> if ispell is not yet installed on a new system...).
>>
>>
>> Is it possible (and does it make sense) to load all Org-files without
>> running any of the hooks?
>
> Org-mode is derived from outline-mode, which is derived from text mode.
> A derived mode runs all the hooks from the parent modes.
>
> I don't know how to turn this off, but you can work around this
> by changing the function you put into the text-mode-hook:
>
> (defun my-turn-on-flyspell-not-in-org-though ()
>    (or (eq major-mode 'org-mode) (turn-on-flyspell)))
>
> HTH


It does :)

Thanks,

   Sebastian

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2009-08-27 12:39 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-08-26 22:37 Hooks and publishing Sebastian Rose
2009-08-27  5:46 ` Carsten Dominik
2009-08-27 12:39   ` Sebastian Rose

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).