unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* .emacs can only turn on auto-fill for text-mode *not* c-mode!?!?
@ 2003-01-08  1:56 Christian Seberino
  2003-01-09 22:37 ` Jonathon Isaac Swiderski
  0 siblings, 1 reply; 3+ messages in thread
From: Christian Seberino @ 2003-01-08  1:56 UTC (permalink / raw)


This works great in .emacs for text mode...

(setq default-major-mode 'text-mode)
(add-hook 'text-mode-hook 'turn-on-auto-fill)


However, this does *not* work for c-mode...

(add-hook 'c-mode-hook 'turn-on-auto-fill)

*Why*?

I modified c-mode this way...

   (defun cs-c-mode()
      (c-mode)
      (c-set-style "K&R")
      (setq c-basic-offset 3)
      (turn-on-font-lock)
      (local-set-key "\C-d" 'cs-kill-line))

Will that affect this problem?? I tried adding
(turn-on-auto-fill) to this defun  with no success.

Chris

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

* Re: .emacs can only turn on auto-fill for text-mode *not* c-mode!?!?
  2003-01-08  1:56 .emacs can only turn on auto-fill for text-mode *not* c-mode!?!? Christian Seberino
@ 2003-01-09 22:37 ` Jonathon Isaac Swiderski
  2003-01-09 22:58   ` Barry Margolin
  0 siblings, 1 reply; 3+ messages in thread
From: Jonathon Isaac Swiderski @ 2003-01-09 22:37 UTC (permalink / raw)


On 7 Jan 2003, Christian Seberino wrote:

> This works great in .emacs for text mode...
>
> (setq default-major-mode 'text-mode)
> (add-hook 'text-mode-hook 'turn-on-auto-fill)
>
>
> However, this does *not* work for c-mode...
>
> (add-hook 'c-mode-hook 'turn-on-auto-fill)

What do you mean, "it does not work"?  Are you getting an error message
(please post it!), or does it simply appear that nothing is happening?

Likely nothing is happening --- if c-mode uses the text-mode hook, then
auto-fill-mode is already on, and emacs is likely finding it rather
difficult to turn on what is already on.


-- 
Jonathon Isaac Swiderski \\ dangercat-20@dangercat.net
cs.oberlin.edu/~jswiders  \\  www.dangercat.net/resume

a cow is of bovine ilk
one end is moo
the other milk

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

* Re: .emacs can only turn on auto-fill for text-mode *not* c-mode!?!?
  2003-01-09 22:37 ` Jonathon Isaac Swiderski
@ 2003-01-09 22:58   ` Barry Margolin
  0 siblings, 0 replies; 3+ messages in thread
From: Barry Margolin @ 2003-01-09 22:58 UTC (permalink / raw)


In article <Pine.SOL.4.44.0301091729150.13478-100000@mspacman.gpcc.itd.umich.edu>,
Jonathon Isaac Swiderski  <jonswid@umich.edu> wrote:
>On 7 Jan 2003, Christian Seberino wrote:
>
>> This works great in .emacs for text mode...
>>
>> (setq default-major-mode 'text-mode)
>> (add-hook 'text-mode-hook 'turn-on-auto-fill)
>>
>>
>> However, this does *not* work for c-mode...
>>
>> (add-hook 'c-mode-hook 'turn-on-auto-fill)
>
>What do you mean, "it does not work"?  Are you getting an error message
>(please post it!), or does it simply appear that nothing is happening?
>
>Likely nothing is happening --- if c-mode uses the text-mode hook, then

Why would c-mode run the text-mode hook?

>auto-fill-mode is already on, and emacs is likely finding it rather
>difficult to turn on what is already on.

But this would accomplish his goal (getting auto-fill turned on in C
buffers), so I doubt that he would have written asking for help.

-- 
Barry Margolin, barmar@genuity.net
Genuity, Woburn, MA
*** DON'T SEND TECHNICAL QUESTIONS DIRECTLY TO ME, post them to newsgroups.
Please DON'T copy followups to me -- I'll assume it wasn't posted to the group.

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

end of thread, other threads:[~2003-01-09 22:58 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-01-08  1:56 .emacs can only turn on auto-fill for text-mode *not* c-mode!?!? Christian Seberino
2003-01-09 22:37 ` Jonathon Isaac Swiderski
2003-01-09 22:58   ` Barry Margolin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).