all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* any Emacs features to help keep code/comments under 80 columns width?
@ 2002-11-28 23:22 seberino
  2002-11-30  1:40 ` ken
  0 siblings, 1 reply; 10+ messages in thread
From: seberino @ 2002-11-28 23:22 UTC (permalink / raw)


I often write comments and code and look at modeline's Column# display
to verify I did not go beyond the 80th column when I type.

Are there any goodies in Emacs to help me accomplish this???


Maybe....

1. Emacs flashes the screen when I reach column 80

2. Emacs automatically adds a hard return and moves me to next line
   when I reach column 80.

3. Emacs just doesn't let me type beyond column 80.

Chris
-- 
_______________________________________

Dr. Christian Seberino
SPAWAR Systems Center San Diego
Code 2363
49590 Lassing Road, Room A339
San Diego, CA 92152-6147
U.S.A.

Phone: (619) 553-7940
Fax:   (619) 553-1269
Email: seberino@spawar.navy.mil
_______________________________________

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

* Re: any Emacs features to help keep code/comments under 80 columns width?
       [not found] <mailman.1038525802.11759.help-gnu-emacs@gnu.org>
@ 2002-11-28 23:48 ` lawrence mitchell
  2002-11-29 12:32 ` Phillip Lord
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 10+ messages in thread
From: lawrence mitchell @ 2002-11-28 23:48 UTC (permalink / raw)


seberino@spawar.navy.mil wrote:

> I often write comments and code and look at modeline's Column# display
> to verify I did not go beyond the 80th column when I type.

> Are there any goodies in Emacs to help me accomplish this???

> Maybe....

> 1. Emacs flashes the screen when I reach column 80

> 2. Emacs automatically adds a hard return and moves me to next line
>    when I reach column 80.

You could use `auto-fill-mode'[1] which automatically wraps text
once it reaches a certain column (specified by the variable
`fill-column').  Alternately, if you merely want a visual
indication of whether you've typed beyond a certain column, take
a look at vvb-mode <URL:
http://www.geocities.com/gchen275/xemacs/>.  If you're using it
with Emacs (as opposed to XEmacs), you'll have to
(require 'lucid) first.

[1]  Enabled by typing M-x auto-fill-mode RET

-- 
lawrence mitchell <wence@gmx.li>

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

* Re: any Emacs features to help keep code/comments under 80 columns width?
       [not found] <mailman.1038525802.11759.help-gnu-emacs@gnu.org>
  2002-11-28 23:48 ` lawrence mitchell
@ 2002-11-29 12:32 ` Phillip Lord
  2002-12-02 15:03 ` kgold
  2002-12-04 14:38 ` Gareth Rees
  3 siblings, 0 replies; 10+ messages in thread
From: Phillip Lord @ 2002-11-29 12:32 UTC (permalink / raw)


>>>>> "seberino" == seberino  <seberino@spawar.navy.mil> writes:

  seberino> Maybe....

  seberino> 1. Emacs flashes the screen when I reach column 80


http://www.google.com/search?q=wide-column.el


  seberino> 2. Emacs automatically adds a hard return and moves me to
  seberino>    next line when I reach column 80.

M-x auto-fill-mode

  seberino> 3. Emacs just doesn't let me type beyond column 80.

No that I know of.

Phil

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

* Re: any Emacs features to help keep code/comments under 80 columns width?
  2002-11-28 23:22 seberino
@ 2002-11-30  1:40 ` ken
  0 siblings, 0 replies; 10+ messages in thread
From: ken @ 2002-11-30  1:40 UTC (permalink / raw)
  Cc: help-gnu-emacs


Chris,

To get this when emacs loads, put the following in your .emacs:

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

As can be seen, that just sets it for text mode.  Do another for, say, 
html-helper-mode:

(setq html-helper-mode-hook 'turn-on-auto-fill)

Personally, I turnaround at 78:

(setq-default fill-column 78)

Since versions seem to be more than normally critical, mine's 20.7.1.


hth,
ken

-- 
AMD crashes?  See http://cleveland.lug.net/~ken/amd-problem/.

seberino@spawar.navy.mil at 15:22 (UTC-0800) on Thu, 28 Nov 2002 said:

= I often write comments and code and look at modeline's Column# display
= to verify I did not go beyond the 80th column when I type.
= 
= Are there any goodies in Emacs to help me accomplish this???
= 
= 
= Maybe....
= 
= 1. Emacs flashes the screen when I reach column 80
= 
= 2. Emacs automatically adds a hard return and moves me to next line
=    when I reach column 80.
= 
= 3. Emacs just doesn't let me type beyond column 80.
= 
= Chris
= 

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

* Re: any Emacs features to help keep code/comments under 80 columns width?
       [not found] <mailman.1038620491.29401.help-gnu-emacs@gnu.org>
@ 2002-11-30 17:19 ` Kai Großjohann
  2002-11-30 23:26   ` ken
  0 siblings, 1 reply; 10+ messages in thread
From: Kai Großjohann @ 2002-11-30 17:19 UTC (permalink / raw)


ken <ken@cleveland.lug.net> writes:

> (setq text-mode-hook 'turn-on-auto-fill)

Don't do that!  (At least, don't advise others to do it.)

In general, a mode hook can contain many functions, and usually one
wants to add a function (or, more rarely, remove one).  Therefore,
add-hook (and possibly remove-hook) is your friend.

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

-- 
~/.signature is: umop ap!sdn    (Frank Nobis)

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

* Re: any Emacs features to help keep code/comments under 80 columns width?
  2002-11-30 17:19 ` Kai Großjohann
@ 2002-11-30 23:26   ` ken
  2002-12-01 13:17     ` Kai Großjohann
  0 siblings, 1 reply; 10+ messages in thread
From: ken @ 2002-11-30 23:26 UTC (permalink / raw)
  Cc: help-gnu-emacs


Kai,

What you say makes sense now that I think about it.  I can't remember
who it was who gave me the advice... I've been using it for years.  
Haven't had a problem.

-- 
AMD crashes?  See http://cleveland.lug.net/~ken/amd-problem/.

Kai Großjohann at 18:19 (UTC+0100) on Sat, 30 Nov 2002 said:

= ken <ken@cleveland.lug.net> writes:
= 
= > (setq text-mode-hook 'turn-on-auto-fill)
= 
= Don't do that!  (At least, don't advise others to do it.)
= 
= In general, a mode hook can contain many functions, and usually one
= wants to add a function (or, more rarely, remove one).  Therefore,
= add-hook (and possibly remove-hook) is your friend.
= 
= (add-hook 'text-mode-hook 'turn-on-auto-fill)
= 
= 

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

* Re: any Emacs features to help keep code/comments under 80 columns width?
  2002-11-30 23:26   ` ken
@ 2002-12-01 13:17     ` Kai Großjohann
  0 siblings, 0 replies; 10+ messages in thread
From: Kai Großjohann @ 2002-12-01 13:17 UTC (permalink / raw)
  Cc: help-gnu-emacs

ken <ken@cleveland.lug.net> writes:

> What you say makes sense now that I think about it.  I can't remember
> who it was who gave me the advice... I've been using it for years.  
> Haven't had a problem.

Yes, I didn't expect you would.  It seems that text-mode-hook has no
other entries by default.

But there are other mode hooks which do have other entries by
default, so using setq to override the old value does bad things.

But it was only luck that it worked for text mode, so that's why I
issued the warning.

-- 
~/.signature is: umop ap!sdn    (Frank Nobis)

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

* Re: any Emacs features to help keep code/comments under 80 columns width?
       [not found] <mailman.1038525802.11759.help-gnu-emacs@gnu.org>
  2002-11-28 23:48 ` lawrence mitchell
  2002-11-29 12:32 ` Phillip Lord
@ 2002-12-02 15:03 ` kgold
  2002-12-04 14:38 ` Gareth Rees
  3 siblings, 0 replies; 10+ messages in thread
From: kgold @ 2002-12-02 15:03 UTC (permalink / raw)



A really low-tech way is to narrow the frame to 80 characters.  It
becomes really obvious when you go past the limit.

seberino@spawar.navy.mil writes:
> I often write comments and code and look at modeline's Column# display
> to verify I did not go beyond the 80th column when I type.
> 
> Are there any goodies in Emacs to help me accomplish this???
> 
> Maybe....
> 
> 1. Emacs flashes the screen when I reach column 80
> 
> 2. Emacs automatically adds a hard return and moves me to next line
>    when I reach column 80.
> 
> 3. Emacs just doesn't let me type beyond column 80.

-- 
Ken Goldman   kgold@watson.ibm.com   914-784-7646

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

* Re: any Emacs features to help keep code/comments under 80 columns width?
       [not found] <20021202173058.A3985@spawar.navy.mil>
@ 2002-12-03 21:09 ` ken
  0 siblings, 0 replies; 10+ messages in thread
From: ken @ 2002-12-03 21:09 UTC (permalink / raw)
  Cc: help-gnu-emacs


seberino@spawar.navy.mil at 17:30 (UTC-0800) on Mon, 2 Dec 2002 said:

= Ken
= 
= Thanks for the help.
= 
= Do you know why I would be able to turn on auto-fill-mode
= interactively with "M-x auto-fill-mode" but *not* 
= by putting
= 
= (setq-default fill-column 80)
= (setq text-mode-hook 'turn-on-auto-fill)
= 
= in .emacs?

First, follow Kai's advice and use:

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

I haven't tested it yet, but I'm taking his word for it.

The .emacs file is read when emacs is started.  You would need to 
restart emacs-- i.e., close it and then open it up again-- for it to 
take effect.

Note that you can set the fill-column number a couple other ways: 

- e.g., if you want wrapping at column 45, do C-4 C-5 C-x f

- Put the cursor where you want wrapping to happen and do C-u C-x f

= 
= BTW, will this turn on auto-fill-mode for *all* modes
= like c-mode? (programming)

No, it would be just for text mode.


hth,
ken

= 
= Chris
= 
= On Fri, Nov 29, 2002 at 08:40:18PM -0500, ken wrote:
= > 
= > Chris,
= > 
= > To get this when emacs loads, put the following in your .emacs:
= > 
= > (setq text-mode-hook 'turn-on-auto-fill)
= > 
= > As can be seen, that just sets it for text mode.  Do another for, say, 
= > html-helper-mode:
= > 
= > (setq html-helper-mode-hook 'turn-on-auto-fill)
= > 
= > Personally, I turnaround at 78:
= > 
= > (setq-default fill-column 78)
= > 
= > Since versions seem to be more than normally critical, mine's 20.7.1.
= > 
= > 
= > hth,
= > ken
= > 
= > -- 
= > AMD crashes?  See http://cleveland.lug.net/~ken/amd-problem/.
= > 
= > seberino@spawar.navy.mil at 15:22 (UTC-0800) on Thu, 28 Nov 2002 said:
= > 
= > = I often write comments and code and look at modeline's Column# display
= > = to verify I did not go beyond the 80th column when I type.
= > = 
= > = Are there any goodies in Emacs to help me accomplish this???
= > = 
= > = 
= > = Maybe....
= > = 
= > = 1. Emacs flashes the screen when I reach column 80
= > = 
= > = 2. Emacs automatically adds a hard return and moves me to next line
= > =    when I reach column 80.
= > = 
= > = 3. Emacs just doesn't let me type beyond column 80.
= > = 
= > = Chris
= > = 
= > 
= > 
= > 
= > _______________________________________________
= > Help-gnu-emacs mailing list
= > Help-gnu-emacs@gnu.org
= > http://mail.gnu.org/mailman/listinfo/help-gnu-emacs
= 
= 


-- 
AMD crashes?  See http://cleveland.lug.net/~ken/amd-problem/.

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

* Re: any Emacs features to help keep code/comments under 80 columns width?
       [not found] <mailman.1038525802.11759.help-gnu-emacs@gnu.org>
                   ` (2 preceding siblings ...)
  2002-12-02 15:03 ` kgold
@ 2002-12-04 14:38 ` Gareth Rees
  3 siblings, 0 replies; 10+ messages in thread
From: Gareth Rees @ 2002-12-04 14:38 UTC (permalink / raw)


Christian Seberino wrote:
> I often write comments and code and look at modeline's Column# display
> to verify I did not go beyond the 80th column when I type.
> 
> Are there any goodies in Emacs to help me accomplish this???

You could try line-limit-mode.  See
<http://groups.google.com/groups?selm=uhfdaw35e.fsf%40pobox.com>.

-- 
Gareth Rees

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

end of thread, other threads:[~2002-12-04 14:38 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <20021202173058.A3985@spawar.navy.mil>
2002-12-03 21:09 ` any Emacs features to help keep code/comments under 80 columns width? ken
     [not found] <mailman.1038620491.29401.help-gnu-emacs@gnu.org>
2002-11-30 17:19 ` Kai Großjohann
2002-11-30 23:26   ` ken
2002-12-01 13:17     ` Kai Großjohann
     [not found] <mailman.1038525802.11759.help-gnu-emacs@gnu.org>
2002-11-28 23:48 ` lawrence mitchell
2002-11-29 12:32 ` Phillip Lord
2002-12-02 15:03 ` kgold
2002-12-04 14:38 ` Gareth Rees
2002-11-28 23:22 seberino
2002-11-30  1:40 ` ken

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.