How can I visually truncate the lines of a buffer at a specific column instead at the last column of the buffer?
Is this even possible in Emacs?
If, so, is it possible to also choose at which column the line starts, so that when I have a big Emacs window (let's say with 200 columns), the text occupies only the central (80 columns)?
EDIT: Error message with debug on after trying JEanPierre answer:
Debugger entered--Lisp error: (wrong-type-argument number-or-marker-p nil)
+(4 nil 198)
(- (+ cur-l cur-r cur-width) width)
(let* ((cur-width (window-width)) (cur-m (window-margins)) (cur-l (if (and cur-m (car cur-m)) (car cur-m) 0)) (cur-r (if (and cur-m (car cur-m)) (cdr cur-m) 0)) (lr (- (+ cur-l cur-r cur-width) width)) (left (/ lr 2)) (right (if (= 0 (% lr 2)) left (1+ left)))) (set-window-margins nil (max left 0) (max right 0)))
(if (= 0 width) (set-window-margins nil 0 0) (let* ((cur-width (window-width)) (cur-m (window-margins)) (cur-l (if (and cur-m (car cur-m)) (car cur-m) 0)) (cur-r (if (and cur-m (car cur-m)) (cdr cur-m) 0)) (lr (- (+ cur-l cur-r cur-width) width)) (left (/ lr 2)) (right (if (= 0 (% lr 2)) left (1+ left)))) (set-window-margins nil (max left 0) (max right 0))))
my/change-window-width(80)
call-interactively(my/change-window-width record nil)
command-execute(my/change-window-width record)
helm-M-x(nil "my/change-window-width")
call-interactively(helm-M-x nil nil)
command-execute(helm-M-x)