[comp.emacs] word-wrap in emacs?

iws9027@eva.fmi.uni-passau.de (Andreas Holzmann) (05/15/91)

It is possible to do an automatical word-wrap in emacs? When I type in
text emacs should look if I've already typed 60 or 70 chars in a line
and then does a newline so no line is longer than 60 or 70 chars.
Please help
	-Andreas
--
Andreas Holzmann                    \ Was laesst einen Luftballon zerplatzen,
                                     \ die zuletzt hineingepustete Luft oder
E-Mail: iws9027@eva.fmi.uni-passau.de \ die, die schon darin war ...

woan@exeter.austin.ibm.com (Ronald S Woan) (05/16/91)

In article <1991May15.141420.25052@forwiss.uni-passau.de> iws9027@eva.fmi.uni-passau.de (Andreas Holzmann) writes:
>It is possible to do an automatical word-wrap in emacs? When I type in
>text emacs should look if I've already typed 60 or 70 chars in a line
>and then does a newline so no line is longer than 60 or 70 chars.
>Please help

Look up auto-fill-mode in your documentation if you are using GNU
EMACS.

-- 
+-----All Views Expressed Are My Own And Are Not Necessarily Shared By------+
+------------------------------My Employer----------------------------------+
+ Ronald S. Woan                woan@cactus.org or woan@austin.vnet.ibm.com +
+ other email addresses             Prodigy: XTCR74A Compuserve: 73530,2537 +

robertsr@cs.unca.edu (Ralph Roberts) (05/16/91)

In article <3913@d75.UUCP> woan@cactus.org writes:
>In article <1991May15.141420.25052@forwiss.uni-passau.de> iws9027@eva.fmi.uni-passau.de (Andreas Holzmann) writes:
>>It is possible to do an automatical word-wrap in emacs? When I type in
>>text emacs should look if I've already typed 60 or 70 chars in a line
>>and then does a newline so no line is longer than 60 or 70 chars.
>>Please help
>
>Look up auto-fill-mode in your documentation if you are using GNU
>EMACS.

Typing either Esc x auto-fill-mode or M-x auto-fill-mode (where 'M' is
your meta key)  turns on auto-fill-mode  (word wrap) as  a minor  mode
modifying  the current  major mode   in   GNU  Emacs, UniPress  Emacs,
Epsilon, AND Freemacs.

Lots of useful little goodies like this  are in the UNIX DESKTOP GUIDE
TO EMACS coming out in August from Howard W. Sams.

--
Ralph Roberts  author@cs.unca.edu    |     The Desktop Guide to Emacs 
               Asheville, N.C.       |     Compute!'s Computer Viruses 
               (704) 252-9515        |    The Veteran's Guide To Benefits
               (704) 255-8719 (fax)  |  + 17 other books & 1000s of articles

abrown@hpcvca.CV.HP.COM (Allen Brown) (05/17/91)

> It is possible to do an automatical word-wrap in emacs? When I type
> in text emacs should look if I've already typed 60 or 70 chars in a
> line and then does a newline so no line is longer than 60 or 70
> chars.  Please help
>	-Andreas

When you ask a question about emacs you should reveal what type and
version of emacs you are using.

For GNU emacs (all versions I know of) auto-fill-mode will do what you
want.  And the variable fill-column sets the column.  I think the
default is 72.
--
  Allen Brown  abrown@cv.hp.com or abrown%hpcvca@hplabs.hp.com
	    or hplabs!hpcvca!abrown or "Hey you!"
  Not representing my employer.
  If all economists were laid end to end, they would not reach a
  conclusion. ---George Bernard Shaw

pravin@eniac.seas.upenn.edu (05/17/91)

In a previous article iws9027@eva.fmi.uni-passau.de (Andreas Holzmann) writes:
>It is possible to do an automatical word-wrap in emacs? When I type in
>text emacs should look if I've already typed 60 or 70 chars in a line
>and then does a newline so no line is longer than 60 or 70 chars.

You can do M-x auto-fill for word wrap or put a line in your .emacs
file:

(setq text-mode-hook '(lambda () (auto-fill-mode 1)))

or

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

Either of these work.  I think the default width is 72 columns..

pravin

--
This program posts news to billions of machines throughout the galaxy.
Your message will cost the net enough to bankrupt your entire planet, and
as a result your species will be sold into slavery. Be sure you know what
you are doing.