Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to enforce maximum line length in Emacs?

Tags:

In Emacs, how can I enforce a maximum line length of, say, 80 characters? I want it to insert proper line breaks in my code, much like fill-paragraph for text, if possible, with the correct insertion of the second part of the line.

Here a little example:

LongNameType<PrettyLong, AlsoLong> doSomethingWithLongFunctionName(int a, int b); foo(); 

If I actually do fill-paragraph it becomes:

LongNameType<PrettyLong, AlsoLong> doSomethingWithLongFunctionName(int a, int b); foo(); 

whereas I'd prefer this:

LongNameType<PrettyLong, AlsoLong>   doSomethingWithLongFunctionName(int a, int b); foo(); 
like image 735
Frank Avatar asked Apr 07 '09 01:04

Frank


1 Answers

There are a number of packages which warn you of line length limits. Personally, I use wide-column, which changes the cursor color depending on its current column.

like image 173
Trey Jackson Avatar answered Sep 20 '22 23:09

Trey Jackson