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: Fri, 24 Oct 2008 09:54:57 -0700 (PDT) Organization: http://groups.google.com Message-ID: <5ddf8b9b-1144-454e-ae60-1be36de9ab03@u75g2000hsf.googlegroups.com> References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1224870051 7293 80.91.229.12 (24 Oct 2008 17:40:51 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 24 Oct 2008 17:40:51 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Fri Oct 24 19:41:51 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 1KtQfR-00023h-8C for geh-help-gnu-emacs@m.gmane.org; Fri, 24 Oct 2008 19:41:45 +0200 Original-Received: from localhost ([127.0.0.1]:39687 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KtQeL-0005PH-S3 for geh-help-gnu-emacs@m.gmane.org; Fri, 24 Oct 2008 13:40:37 -0400 Original-Path: news.stanford.edu!headwall.stanford.edu!news.glorb.com!postnews.google.com!u75g2000hsf.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 1224867298 5073 127.0.0.1 (24 Oct 2008 16:54:58 GMT) Original-X-Complaints-To: groups-abuse@google.com Original-NNTP-Posting-Date: Fri, 24 Oct 2008 16:54:58 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: u75g2000hsf.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:163795 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:59134 Archived-At: On 24 okt, 17:52, Nikolaj Schumacher wrote: \> > I would like to set fill-column, left-margin, tab-width and default- > > justification for text-mode, but I do not manage to get this working. > > How can this be done? > > You can set them inside a hook like this: > (setq fill-column 70) It has to be: (setq-default fill-column 72) For fill-column and tab-width I thought it better to do it globally. 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? I also tried: (add-hook 'org-mode-hook (lambda () (refill-mode 0))) (add-hook 'org-mode-hook (lambda () (setq-default default- justification 'left))) But with the same result. And I would prefer something like: (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) ) (add-hook 'text-mode-hook 'text-justification) (add-hook 'org-mode-hook 'text-no-justification) Can something like this be done?