From 4f01718584e0f704ee6129547f700af3f56efa7d Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Sat, 26 Oct 2002 22:40:31 +0000 Subject: [PATCH] (toggle-truncate-lines): When turning off truncation, clear out the hscroll value in this buffer's windows. (display-message-or-buffer): Don't display empty output in the echo area. --- lisp/simple.el | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/lisp/simple.el b/lisp/simple.el index ecf0e95a620..47f43dea1c3 100644 --- a/lisp/simple.el +++ b/lisp/simple.el @@ -1343,7 +1343,8 @@ and only used if a buffer is displayed." (if (= (buffer-size) 0) 0 (count-lines (point-min) (point-max))))) - (cond ((and (or (<= lines 1) + (cond ((= lines 0)) + ((and (or (<= lines 1) (<= lines (if resize-mini-windows (cond ((floatp max-mini-window-height) @@ -3234,6 +3235,12 @@ Note that in side-by-side windows, truncation is always enabled." (not truncate-lines) (> (prefix-numeric-value arg) 0))) (force-mode-line-update) + (unless truncate-lines + (let ((buffer (current-buffer))) + (walk-windows (lambda (window) + (if (eq buffer (window-buffer window)) + (set-window-hscroll window 0))) + nil t))) (message "Truncate long lines %s" (if truncate-lines "enabled" "disabled"))) -- 2.39.5