I know the command in the .emacs for long line truncation is:

(setq-default truncate-lines t)

or the keystroke:

M-x <RET> toggle-truncate-lines <RET>

but how do I pass these as parameters launching emacs from the shell?

1 Answer 1

emacs --eval '(setq-default truncate-lines t)'
  • Thank you! The quotes make all the difference it seems, I assume without them the shell tries to interpret them as a bash expression rather then a Lisp command passed to emacs?
    – Hooked
    Commented Sep 12, 2011 at 13:26
  • This parameter didn't enable truncate-line on my end. Something does not allow to enable truncate line by default. @Gilles 'SO- stop being evil'
    – alper
    Commented Jan 16, 2020 at 12:15
  • 1
    @alper Maybe something in your init file turns it off? Or maybe you're opening a file in a mode that turns it off? What exact commands are you using? Does it make a difference if you add -q to the command line? Commented Jan 16, 2020 at 19:21
  • In my init file file, (global-visual-line-mode 1) was the issue, when I removed it, everything is solved.
    – alper
    Commented Jan 17, 2020 at 7:30

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .