unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: "Lennart Borgman" <lennart.borgman@gmail.com>
To: Decebal <CLDWesterhof@gmail.com>
Cc: help-gnu-emacs@gnu.org
Subject: Re: Setting fill-column and others for text-mode
Date: Fri, 24 Oct 2008 20:06:06 +0200	[thread overview]
Message-ID: <e01d8a50810241106q13d871ccub7bbe5fcd7770383@mail.gmail.com> (raw)
In-Reply-To: <5ddf8b9b-1144-454e-ae60-1be36de9ab03@u75g2000hsf.googlegroups.com>

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	other threads:[~2008-10-24 18:06 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-10-24 14:13 Setting fill-column and others for text-mode Decebal
2008-10-24 15:52 ` Nikolaj Schumacher
     [not found] ` <mailman.2012.1224863529.25473.help-gnu-emacs@gnu.org>
2008-10-24 16:54   ` Decebal
2008-10-24 18:06     ` Lennart Borgman [this message]
     [not found]     ` <mailman.2016.1224871573.25473.help-gnu-emacs@gnu.org>
2008-10-25  8:03       ` Decebal
2008-10-25  8:49         ` Lennart Borgman
2008-10-26 13:58     ` Kevin Rodgers

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.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=e01d8a50810241106q13d871ccub7bbe5fcd7770383@mail.gmail.com \
    --to=lennart.borgman@gmail.com \
    --cc=CLDWesterhof@gmail.com \
    --cc=help-gnu-emacs@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.
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).