From: Richard M. Stallman Date: Sat, 26 Oct 2002 22:40:31 +0000 (+0000) Subject: (toggle-truncate-lines): When turning off truncation, X-Git-Tag: ttn-vms-21-2-B4~12714 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=4f01718584e0f704ee6129547f700af3f56efa7d;p=emacs.git (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. --- 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")))