Commit 63ea14a5 authored by Richard M. Stallman's avatar Richard M. Stallman
Browse files

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

parent a1dd004b
......@@ -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))
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment