1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-15 10:30:25 -08:00

(dired-pop-to-buffer): Adjust count-lines val for last line.

This commit is contained in:
Richard M. Stallman 1993-04-06 17:11:57 +00:00
parent a1dd004b3d
commit 63ea14a5b2

View file

@ -1422,7 +1422,10 @@ Optional argument means return a file name relative to `default-directory'."
(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))