Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

emacs: adding spaces does wrap line

Tags:

emacs

I would like to see a latex table without the wrapped lines so I changed to the truncate with M-x toggle-truncate-lines.

But if I add some spaces between two latex symbols "&" the line wraps where a I did the last space. I assume that a certain number of spaces have been interpreted by emacs. How can I avoid this?

Thanks for any hint, giordano

GNU Emacs 23.3.1 (i386-mingw-nt5.1.2600)

like image 971
giordano Avatar asked May 21 '26 08:05

giordano


1 Answers

There are two different issues here. The first is the visual truncation of long lines. This is what toggle-truncate-lines does. If it's toggled on, then a line that is longer than the width of the window gets wrapped so it all fits on the screen. However, this wrapping is purely visual - the actual file is not altered, Emacs just modifies how it is displayed.

The second issue is paragraph filling. If auto-fill-mode is on, Emacs will automatically break a long line when it is wider than a set threshold. By default I think it is usually set to 72. So whenever a line is longer than 72 characters, Emacs will add a newline to break the long line into two lines. This will actually change the file, and is independent of the actual width of the window.

In your case, it sounds like Emacs is auto-filling lines you don't want filled. You have a few options. The quickest is just to turn off auto-fill-mode, which you can do with M-x auto-fill-mode. You could also set the fill-column to a large number, so that the threshold is something greater than 72. You can do this temporarily with C-x f 100 <RET>, replacing 100 with however wide you want your lines to be. For a more permanent change, you can add your preferred fill-column to your .emacs:

(set-default fill-column 100)
like image 133
Tyler Avatar answered May 24 '26 18:05

Tyler



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!