[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: indenting and wrapping

From: Jeff Hartnell
Subject: Re: indenting and wrapping
Date: Fri, 05 Aug 2005 14:41:18 +0100
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.7) Gecko/20050414

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,

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

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]


reply via email to

[Prev in Thread] Current Thread [Next in Thread]