]> git.eshelyaron.com Git - emacs.git/commitdiff
(toggle-truncate-lines): When turning off truncation,
authorRichard M. Stallman <rms@gnu.org>
Sat, 26 Oct 2002 22:40:31 +0000 (22:40 +0000)
committerRichard M. Stallman <rms@gnu.org>
Sat, 26 Oct 2002 22:40:31 +0000 (22:40 +0000)
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

index ecf0e95a6204fbde8b9574db5f6c63ae3c4ffcc2..47f43dea1c3a76f929f64ba9c6f7500563e97c63 100644 (file)
@@ -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")))