help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Setting fill-column and others for text-mode


From: Lennart Borgman
Subject: Re: Setting fill-column and others for text-mode
Date: Fri, 24 Oct 2008 20:06:06 +0200

On Fri, Oct 24, 2008 at 6:54 PM, Decebal <CLDWesterhof@gmail.com> wrote:
> I also use:
>    (add-hook 'text-mode-hook (lambda () (refill-mode 1) (setq-default
> default-justification 'full)))
>    (add-hook 'org-mode-hook  (lambda () (refill-mode 0) (setq-default
> default-justification 'left)))
>
> But this only works partly. Refill-mode is t for text-mode and  nill
> for or-mode, but default-justification is for both full. What is going
> wrong here?

You hit a documentation barrier in space-time. The doc string for
org-mode simply does not tell you some essential things:

- org-mode is made by define-derived-mode from outline-mode
- outline-mode is similar made from text-mode
- the mode hooks from the ancestor modes are run before the mode hook

In this case it means that when you turn on org-mode then the
following hooks are run at the end by run-mode-hooks, in this order:

   text-mode-hook, outline-mode-hook, org-mode-hook

This (together with how setq-default works) can probably explain what you see.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]