all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* indenting and wrapping
@ 2005-07-27 10:14 Jeff Hartnell
       [not found] ` <42E75E91.6050603-Xz5UVyKf4VA@public.gmane.org>
  0 siblings, 1 reply; 8+ messages in thread
From: Jeff Hartnell @ 2005-07-27 10:14 UTC (permalink / raw)


Hi,
I have a couple of problems with emacs version 21.3.1 that came with 
SuSE linux 9.2.

1.) C++ mode related

The "basic offset" refered to in FAQ 5.19 is currently set to 4 
white-spaces. I want to set it to 2 white-spaces. I tried
(setq standard-indent 2)
but it has no effect.

Also, another problem, when I write a comment it wont indent on the TAB 
command unless it is at least one white-space away from the margin.

e.g.

if (bla)
  //this will indent on tab
//this one wont until I insert a space in front of it



2.) Latex mode related
I can't change the "M-q" command that wraps all the text to a certain 
width. I tried:

M-x customize-option RET fill-column RET 72

but it doesn't work for latex files (it works fine if I have file.txt say)


I have a feeling that both my problems are related to being in c++ or 
latex mode? Is this right? How do I get round it?

Many thanks,
Jeff.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: indenting and wrapping
       [not found] <mailman.1863.1122460990.20277.help-gnu-emacs@gnu.org>
@ 2005-07-27 11:59 ` Marc Tfardy
  0 siblings, 0 replies; 8+ messages in thread
From: Marc Tfardy @ 2005-07-27 11:59 UTC (permalink / raw)


Jeff Hartnell schrieb:
> Hi,
> I have a couple of problems with emacs version 21.3.1 that came with 
> SuSE linux 9.2.
> 
> 1.) C++ mode related
> 
> The "basic offset" refered to in FAQ 5.19 is currently set to 4 
> white-spaces. I want to set it to 2 white-spaces. I tried
> (setq standard-indent 2)
> but it has no effect.

Use c-basic-offset and set it to 2.


regards

Marc

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: indenting and wrapping
       [not found] ` <42E75E91.6050603-Xz5UVyKf4VA@public.gmane.org>
@ 2005-07-28 19:37   ` Jochen Küpper
  0 siblings, 0 replies; 8+ messages in thread
From: Jochen Küpper @ 2005-07-28 19:37 UTC (permalink / raw)


Jeff Hartnell <j.j.hartnell-Xz5UVyKf4VA@public.gmane.org> writes:

> 2.) Latex mode related
> I can't change the "M-q" command that wraps all the text to a
> certain width. I tried:

[...]

> but it doesn't work for latex files (it works fine if I have
> file.txt say)

,----[ C-h v fill-column RET ]
| fill-column's value is 70
| Automatically becomes buffer-local when set in any fashion.
`----
Therefore I use Local Variables and it works nicely:
,----
| %% Local Variables:
| %% mode: LaTeX
| %% mode: auto-fill
| %% fill-column: 80
| %% End:
`----


Greetings,
Jochen
-- 
Einigkeit und Recht und Freiheit                http://www.Jochen-Kuepper.de
    Liberté, Égalité, Fraternité                GnuPG key: CC1B0B4D
        (Part 3 you find in my messages before fall 2003.)

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: indenting and wrapping
       [not found] ` <42F09F36.6020803-Xz5UVyKf4VA@public.gmane.org>
@ 2005-08-03 11:06   ` Jochen Küpper
       [not found]     ` <42F32BF9.1000002@rl.ac.uk>
  0 siblings, 1 reply; 8+ messages in thread
From: Jochen Küpper @ 2005-08-03 11:06 UTC (permalink / raw)
  Cc: help-gnu-emacs

Jeff Hartnell <j.j.hartnell-Xz5UVyKf4VA@public.gmane.org> writes:

> However, I don't understand this
> ,----
> | %% Local Variables:
> | %% mode: LaTeX
> | %% mode: auto-fill
> | %% fill-column: 80
> | %% End:
> `----
> How do I configure the local variables? 

Put the above text (all lines starting at %%) at the end of your
tex-file and see
,----[ (info "(emacs)File Variables") ]
| A file can specify local variable values for use when you edit the file
| with Emacs.  Visiting the file checks for local variable
| specifications; it automatically makes these variables local to the
| buffer, and sets them to the values specified in the file.
`----

> What do I have to [...] put in my .emacs? 

Nothing;)

Greetings,
Jochen
-- 
Einigkeit und Recht und Freiheit                http://www.Jochen-Kuepper.de
    Liberté, Égalité, Fraternité                GnuPG key: CC1B0B4D
        (Part 3 you find in my messages before fall 2003.)

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: indenting and wrapping
       [not found]       ` <42F32BF9.1000002-Xz5UVyKf4VA@public.gmane.org>
@ 2005-08-05 11:41         ` Jochen Küpper
  2005-08-05 12:33           ` Johan Meskens CS3 jmcs3
  2005-08-05 13:41           ` Jeff Hartnell
  0 siblings, 2 replies; 8+ messages in thread
From: Jochen Küpper @ 2005-08-05 11:41 UTC (permalink / raw)
  Cc: Jeff Hartnell

Jeff Hartnell <j.j.hartnell-Xz5UVyKf4VA@public.gmane.org> writes:

> Thanks very much for your email.

Please keep the discussion on the Emacs mailing list. And no need to
copy me.

> 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
-- 
Einigkeit und Recht und Freiheit                http://www.Jochen-Kuepper.de
    Liberté, Égalité, Fraternité                GnuPG key: CC1B0B4D
        (Part 3 you find in my messages before fall 2003.)

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: indenting and wrapping
  2005-08-05 11:41         ` Jochen Küpper
@ 2005-08-05 12:33           ` Johan Meskens CS3 jmcs3
  2005-08-05 13:03             ` Peter Dyballa
  2005-08-05 13:41           ` Jeff Hartnell
  1 sibling, 1 reply; 8+ messages in thread
From: Johan Meskens CS3 jmcs3 @ 2005-08-05 12:33 UTC (permalink / raw)



> Please keep the discussion on the Emacs mailing list. And no need to
> copy me.

maybe this mailing list could be configured
so that
  if you hit reply
  it is sent by default to the list
   , instead of to the sender

thanks
jmcs3

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: indenting and wrapping
  2005-08-05 12:33           ` Johan Meskens CS3 jmcs3
@ 2005-08-05 13:03             ` Peter Dyballa
  0 siblings, 0 replies; 8+ messages in thread
From: Peter Dyballa @ 2005-08-05 13:03 UTC (permalink / raw)
  Cc: help-gnu-emacs


Am 05.08.2005 um 14:33 schrieb Johan Meskens CS3 jmcs3:

> maybe this mailing list could be configured
> so that
>  if you hit reply
>  it is sent by default to the list
>   , instead of to the sender
>

Yes, particularly when so many senders use addresses that don't work ...

--
Greetings

   Pete

Got Mole problems?
Call Avogadro 6.02 x 10^23

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: indenting and wrapping
  2005-08-05 11:41         ` Jochen Küpper
  2005-08-05 12:33           ` Johan Meskens CS3 jmcs3
@ 2005-08-05 13:41           ` Jeff Hartnell
  1 sibling, 0 replies; 8+ messages in thread
From: Jeff Hartnell @ 2005-08-05 13:41 UTC (permalink / raw)


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

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2005-08-05 13:41 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <42F09F36.6020803@rl.ac.uk>
     [not found] ` <42F09F36.6020803-Xz5UVyKf4VA@public.gmane.org>
2005-08-03 11:06   ` indenting and wrapping Jochen Küpper
     [not found]     ` <42F32BF9.1000002@rl.ac.uk>
     [not found]       ` <42F32BF9.1000002-Xz5UVyKf4VA@public.gmane.org>
2005-08-05 11:41         ` Jochen Küpper
2005-08-05 12:33           ` Johan Meskens CS3 jmcs3
2005-08-05 13:03             ` Peter Dyballa
2005-08-05 13:41           ` Jeff Hartnell
     [not found] <mailman.1863.1122460990.20277.help-gnu-emacs@gnu.org>
2005-07-27 11:59 ` Marc Tfardy
2005-07-27 10:14 Jeff Hartnell
     [not found] ` <42E75E91.6050603-Xz5UVyKf4VA@public.gmane.org>
2005-07-28 19:37   ` Jochen Küpper

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.