aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMiles Bader2000-12-01 08:11:55 +0000
committerMiles Bader2000-12-01 08:11:55 +0000
commit45450dd56d90d4c3682af2ed3e42ddba6977d3fe (patch)
tree3b423d30fa8a74b7d945ef337dfb2526f52a82c9
parenta584be024c78d1fedcd03ccd3b9e28f92ec87db3 (diff)
downloademacs-45450dd56d90d4c3682af2ed3e42ddba6977d3fe.tar.gz
emacs-45450dd56d90d4c3682af2ed3e42ddba6977d3fe.zip
(fit-window-to-buffer): Handle non-nil `truncate-lines'.
-rw-r--r--lisp/ChangeLog4
-rw-r--r--lisp/window.el14
2 files changed, 15 insertions, 3 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 67bd785e5fb..139361e0b52 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,7 @@
12000-12-01 Miles Bader <miles@gnu.org>
2
3 * window.el (fit-window-to-buffer): Handle non-nil `truncate-lines'.
4
12000-12-01 Kenichi Handa <handa@etl.go.jp> 52000-12-01 Kenichi Handa <handa@etl.go.jp>
2 6
3 * international/mule-diag.el (describe-char-after): Fix typo. 7 * international/mule-diag.el (describe-char-after): Fix typo.
diff --git a/lisp/window.el b/lisp/window.el
index 86cb45f92e5..60ebba7f1f0 100644
--- a/lisp/window.el
+++ b/lisp/window.el
@@ -508,9 +508,17 @@ header-line."
508 (let ((end (with-current-buffer buf 508 (let ((end (with-current-buffer buf
509 (save-excursion 509 (save-excursion
510 (goto-char (point-max)) 510 (goto-char (point-max))
511 (if (and (bolp) (not (bobp))) 511 (when (and (bolp) (not (bobp)))
512 (1- (point)) 512 ;; Don't include final newline
513 (point)))))) 513 (backward-char 1))
514 (when truncate-lines
515 ;; If line-wrapping is turned off, test the
516 ;; beginning of the last line for visibility
517 ;; instead of the end, as the end of the line
518 ;; could be invisible by virtue of extending past
519 ;; the edge of the window.
520 (forward-line 0))
521 (point)))))
514 (set-window-vscroll window 0) 522 (set-window-vscroll window 0)
515 (while (and (< desired-height max-height) 523 (while (and (< desired-height max-height)
516 (= desired-height (window-height window)) 524 (= desired-height (window-height window))