3

Almost every text editor is able to truncate lines by default, but in Emacs I'm still using the cumbersome M-x toggle-truncate-lines in every buffer with long lines. Unfortunately, buffers with long lines are very common, so one has to do M-x toggle-truncate-lines constantly.

Solutions currently posted on StackOverflow do not work (e.g., link):

  • (setq-default truncate-lines t) in init.el does not have any effect.
  • (custom-set-variables '(truncate-lines t)) in init.el does not have any effect.
  • (global-set-key "\C-x\ w" 'toggle-truncate-lines) does not really solve the problem.

I must be overlooking something here; what's the actual setting for truncating long lines by default?

  • The answer given so far is correct, but solves it the issue? – Andreas Röhler Aug 5 at 7:08
6

truncate-lines possibly overridden

The built-in help for truncate-lines mention that it is overridden by the variable truncate-partial-width-windows. You might want to check if it is set by using <C-h> v and typing truncate-partial-width-windows.

Relevant portion of built-in help for truncate-lines

...
Note that this is overridden by the variable
`truncate-partial-width-windows' if that variable is non-nil
and this buffer is not full-frame width.
...

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.