I'm using Emacs 23 in a Debian GNU/Linux variant distribution. In a default Emacs session launched with
emacs -q (to confirm the settings) I execute the following to setup the environment I would like:
M-x toggle-truncate-lines <RET> M-x set-variable word-wrap t <RET>
visual-line-mode set to whatever it's default is.
I would like to place these settings into my ~/.emacs file so that they are always active. I did this with the following:
(setq word-wrap t) (setq-default truncate-lines nil) (setq visual-line-mode nil)
However, these settings do not replicate the environment I would like. Long lines are not wrapped -- they extend beyond the right edge. If I then run
M-x toggle-truncate-lines they wrap as I want, but not on word boundaries, so the word-wrap setting has also not taken effect. I also tried setting
truncate-lines in ~/.emacs to
t, but this made no difference. The documentation for
truncate-lines reads as follows, so setting this variable to
nil appears to be what I am looking for:
*Non-nil means do not display continuation lines. Instead, give each line of text just one screen line.
I have not split any windows horizontally, so
truncate-partial-width-windows does not apply.
How do I setup the environment I would like in ~/.emacs?