From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Decebal Newsgroups: gmane.emacs.help Subject: Re: Setting fill-column and others for text-mode Date: Sat, 25 Oct 2008 01:03:24 -0700 (PDT) Organization: http://groups.google.com Message-ID: References: <5ddf8b9b-1144-454e-ae60-1be36de9ab03@u75g2000hsf.googlegroups.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1224924225 6443 80.91.229.12 (25 Oct 2008 08:43:45 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 25 Oct 2008 08:43:45 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sat Oct 25 10:44:47 2008 connect(): Connection refused Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1Ktekt-0005m5-MR for geh-help-gnu-emacs@m.gmane.org; Sat, 25 Oct 2008 10:44:20 +0200 Original-Received: from localhost ([127.0.0.1]:48670 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Ktejn-0008SO-VE for geh-help-gnu-emacs@m.gmane.org; Sat, 25 Oct 2008 04:43:11 -0400 Original-Path: news.stanford.edu!newsfeed.stanford.edu!postnews.google.com!34g2000hsh.googlegroups.com!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 48 Original-NNTP-Posting-Host: 84.53.123.169 Original-X-Trace: posting.google.com 1224921804 1416 127.0.0.1 (25 Oct 2008 08:03:24 GMT) Original-X-Complaints-To: groups-abuse@google.com Original-NNTP-Posting-Date: Sat, 25 Oct 2008 08:03:24 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: 34g2000hsh.googlegroups.com; posting-host=84.53.123.169; posting-account=K-cdeAoAAAD_0d505kUtHXJaT5LFIu-3 User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (X11; U; Linux i686; nl; rv:1.9.0.1) Gecko/2008070206 Firefox/3.0.1,gzip(gfe),gzip(gfe) Original-Xref: news.stanford.edu gnu.emacs.help:163813 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:59149 Archived-At: On Oct 24, 8:06=A0pm, "Lennart Borgman" wrote: > > I also use: > > =A0 =A0(add-hook 'text-mode-hook (lambda () (refill-mode 1) (setq-defau= lt > > default-justification 'full))) > > =A0 =A0(add-hook 'org-mode-hook =A0(lambda () (refill-mode 0) (setq-def= ault > > default-justification 'left))) > > > But this only works partly. Refill-mode is t for text-mode and =A0nill > > 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: > > =A0 =A0text-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?