/[emacs]/emacs/lisp/window.el
ViewVC logotype

Diff of /emacs/lisp/window.el

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.98 by monnier, Thu Jan 20 14:22:52 2005 UTC revision 1.99 by monnier, Mon Mar 28 14:52:01 2005 UTC
# Line 397  lines than are actually needed in the ca Line 397  lines than are actually needed in the ca
397    
398  (defun window-buffer-height (window)  (defun window-buffer-height (window)
399    "Return the height (in screen lines) of the buffer that WINDOW is displaying."    "Return the height (in screen lines) of the buffer that WINDOW is displaying."
400    (save-excursion    (with-current-buffer (window-buffer window)
401      (set-buffer (window-buffer window))      (max 1
402      (goto-char (point-min))           (count-screen-lines (point-min) (point-max)
403      (let ((ignore-final-newline                               ;; If buffer ends with a newline, ignore it when
404             ;; If buffer ends with a newline, ignore it when counting height                               ;; counting height unless point is after it.
405             ;; unless point is after it.                               (eobp)
406             (and (not (eobp)) (eq ?\n (char-after (1- (point-max)))))))                               window))))
       (+ 1 (nth 2 (compute-motion (point-min)  
                                   '(0 . 0)  
                                   (- (point-max) (if ignore-final-newline 1 0))  
                                   (cons 0 100000000)  
                                   nil  
                                   nil  
                                   window))))))  
407    
408  (defun count-screen-lines (&optional beg end count-final-newline window)  (defun count-screen-lines (&optional beg end count-final-newline window)
409    "Return the number of screen lines in the region.    "Return the number of screen lines in the region.

Legend:
Removed from v.1.98  
changed lines
  Added in v.1.99

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26