changeset 2466:e766b88d67ce

(dired-pop-to-buffer): Adjust count-lines val for last line.
author Richard M. Stallman <rms@gnu.org>
date Tue, 06 Apr 1993 17:11:57 +0000
parents cc54f01475dd
children a3bdf5ac2e9d
files lisp/dired.el
diffstat 1 files changed, 4 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/dired.el	Tue Apr 06 02:42:52 1993 +0000
+++ b/lisp/dired.el	Tue Apr 06 17:11:57 1993 +0000
@@ -1422,7 +1422,10 @@
 	(set-buffer buf)
 	(goto-char (point-max))
 	(skip-chars-backward "\n\r\t ")
-	(setq target-lines (count-lines (point-min) (point))))
+	(setq target-lines (count-lines (point-min) (point)))
+	;; Don't forget to count the last line.
+	(if (not (bolp))
+	    (setq target-lines (1+ target-lines))))
       (if (<= (window-height window) (* 2 window-min-height))
 	  ;; At this point, every window on the frame is too small to split.
 	  (setq w2 (display-buffer buf))