truncate-lines is buffer-local. To set the
default for all buffers, use
(setq-default truncate-lines t). Major-modes and minor-modes can reset this variable and it will be necessary to use a major-mode or minor-mode hook in that case, or directory-local variables, or file-local variables.
EXAMPLE [assumes we want to load a file with an extension of
el, which will default to the
/path/to/emacs --no-window-system --eval "(add-hook 'emacs-lisp-mode-hook (lambda nil (setq truncate-lines t)))" /path/to/file.el
When the file loads, check the value with
M-x describe-variable RET truncate-lines RET or
EDIT: In the commentary below, the O.P. has indicted that certain files may be opened in
fundamental-mode because a particular file extension may not be associated with a major-mode. While it is possible to use file-local variables or directory-local variables, the O.P. has expressed a preference to handle this entirely on the command-line. One way to accomplish that is as follows:
/path/to/emacs --no-window-system --eval "(progn (find-file \"/path/to/file.csv\") (setq truncate-lines t))"
find-file (with its underlying functions) set the buffer of the newly opened file as the
(setq truncate-lines t) is called subsequent to
(find-file ...), it is applied to said
current-buffer. If the target buffer did not have focus for whatever the reason (e.g.,
find-file-noselect), then it would be necessary to use something like
(with-current-buffer ...) to ensure that
truncate-lines is applied to the correct buffer.