From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Jeff Hartnell Newsgroups: gmane.emacs.help Subject: Re: indenting and wrapping Date: Fri, 05 Aug 2005 14:41:18 +0100 Message-ID: <42F36C7E.8070703@rl.ac.uk> References: <42F09F36.6020803@rl.ac.uk> <9eslxrp9eq.fsf@gowron.rz-berlin.mpg.de> <42F32BF9.1000002@rl.ac.uk> <9eacjwvce5.fsf@gowron.rz-berlin.mpg.de> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1123250579 12484 80.91.229.2 (5 Aug 2005 14:02:59 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Fri, 5 Aug 2005 14:02:59 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Fri Aug 05 16:02:58 2005 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1E12l2-00044Y-GO for geh-help-gnu-emacs@m.gmane.org; Fri, 05 Aug 2005 16:01:08 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1E12nr-0000PT-Pj for geh-help-gnu-emacs@m.gmane.org; Fri, 05 Aug 2005 10:04:05 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1E12jg-0007j9-Vb for help-gnu-emacs@gnu.org; Fri, 05 Aug 2005 09:59:45 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1E12jK-0007dE-Hx for help-gnu-emacs@gnu.org; Fri, 05 Aug 2005 09:59:25 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1E12jJ-0007Op-PN for help-gnu-emacs@gnu.org; Fri, 05 Aug 2005 09:59:21 -0400 Original-Received: from [129.67.1.163] (helo=relay4.mail.ox.ac.uk) by monty-python.gnu.org with esmtp (Exim 4.34) id 1E12eo-0000VE-8C for help-gnu-emacs@gnu.org; Fri, 05 Aug 2005 09:54:42 -0400 Original-Received: from smtp0.herald.ox.ac.uk ([163.1.0.246]) by relay4.mail.ox.ac.uk with esmtp (Exim 4.50) id 1E12Rm-0002XT-Cu for help-gnu-emacs@gnu.org; Fri, 05 Aug 2005 14:41:14 +0100 Original-Received: from pplxgen.physics.ox.ac.uk ([163.1.243.80] helo=[127.0.0.1]) by smtp0.herald.ox.ac.uk with esmtp (Exim 3.35 #1) id 1E12Rl-0003dW-00 for help-gnu-emacs@gnu.org; Fri, 05 Aug 2005 14:41:13 +0100 User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.7) Gecko/20050414 X-Accept-Language: en-us, en Original-To: help-gnu-emacs In-Reply-To: <9eacjwvce5.fsf@gowron.rz-berlin.mpg.de> X-Enigmail-Version: 0.86.0.0 X-Enigmail-Supports: pgp-inline, pgp-mime 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:28439 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:28439 Hi Jochen, Thanks again for your continuing emails. My problems are solved! Your talk about "hooks" sent me off in the right direction (I guess hooks are a little snippet of code that gets run for particular file types - effectively overriding the defaults). On reading my .emacs I saw that it was loading /etc/skel/.gnu-emacs after checking that ~/.gnu-emacs didn't exist. I copied /etc/skel/.gnu-emacs to ~/.gnu-emacs and then I edited the lines ;; Fill-column ;; ----------- ;; Fill-column ist hier auf 78 Charakter gesetzt, nach Wunsch "andern! (setq-default fill-column 78) (add-hook 'TeX-mode-hook '(lambda () (setq fill-column 78))) and also ;; ;; Common to all C modes ;; --------------------- (add-hook 'c-mode-common-hook '(lambda () (c-set-style "linux") (c-set-offset 'case-label 4) (setq c-basic-offset 4))) to the values of 72 and 2 respectively. Now, I have the defaults that I want! Thanks to you and Marek for your help, Jeff. >>I tried putting the lines into a tex file and it works. :-) The >>problem is that I have a lot of tex files... what I would ideally >>like is a way to tell emacs to *always* wrap to 72 for tex files by >>default. > > > Use customize to put it into TeX-mode-hook. > ,----[ C-h v TeX-mode-hook RET ] > | TeX-mode-hook's value is nil > | > | A hook run in TeX mode buffers. > | > | You can customize this variable. > | > | Defined in `tex'. > | > | [back] > `---- > Maybe you also want text-mode-hook or similar? > ,----[ C-h v text-mode-hook RET ] > | text-mode-hook's value is > | (turn-on-auto-fill dirvars-hack-local-variables-before text-mode-hook-identify) > | > | Hook run when entering Text mode. > | > | You can customize this variable. > | > | Defined in `textmodes/text-mode'. > | > | [back] > `---- > > Greetings, > Jochen