From: Decebal <CLDWesterhof@gmail.com>
To: help-gnu-emacs@gnu.org
Subject: Re: Setting fill-column and others for text-mode
Date: Sat, 25 Oct 2008 01:03:24 -0700 (PDT) [thread overview]
Message-ID: <c2a5cc89-6622-49ba-9130-cd440b0c44f4@34g2000hsh.googlegroups.com> (raw)
In-Reply-To: mailman.2016.1224871573.25473.help-gnu-emacs@gnu.org
On Oct 24, 8:06 pm, "Lennart Borgman" <lennart.borg...@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.
I think I can best disable the hook and just execute text-
justification.
I have defined the folowing functions (and removed the add-hook) and
this seems to work:
(defun text-justification ()
(interactive)
(refill-mode 1)
(setq-default default-justification 'full)
)
(defun text-no-justification ()
(interactive)
(refill-mode 0)
(setq-default default-justification 'left)
)
Is there otherwise a possibility to execute text-justification only on
functions ending with (for example) .txt?
next prev parent reply other threads:[~2008-10-25 8:03 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
[not found] ` <mailman.2016.1224871573.25473.help-gnu-emacs@gnu.org>
2008-10-25 8:03 ` Decebal [this message]
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=c2a5cc89-6622-49ba-9130-cd440b0c44f4@34g2000hsh.googlegroups.com \
--to=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.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.