emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] Changes to emacs/lisp/window.el


From: Stefan Monnier
Subject: [Emacs-diffs] Changes to emacs/lisp/window.el
Date: Mon, 28 Mar 2005 09:52:03 -0500

Index: emacs/lisp/window.el
diff -c emacs/lisp/window.el:1.98 emacs/lisp/window.el:1.99
*** emacs/lisp/window.el:1.98   Thu Jan 20 14:22:52 2005
--- emacs/lisp/window.el        Mon Mar 28 14:52:01 2005
***************
*** 397,416 ****
  
  (defun window-buffer-height (window)
    "Return the height (in screen lines) of the buffer that WINDOW is 
displaying."
!   (save-excursion
!     (set-buffer (window-buffer window))
!     (goto-char (point-min))
!     (let ((ignore-final-newline
!            ;; If buffer ends with a newline, ignore it when counting height
!            ;; unless point is after it.
!            (and (not (eobp)) (eq ?\n (char-after (1- (point-max)))))))
!       (+ 1 (nth 2 (compute-motion (point-min)
!                                   '(0 . 0)
!                                   (- (point-max) (if ignore-final-newline 1 
0))
!                                   (cons 0 100000000)
!                                   nil
!                                   nil
!                                   window))))))
  
  (defun count-screen-lines (&optional beg end count-final-newline window)
    "Return the number of screen lines in the region.
--- 397,409 ----
  
  (defun window-buffer-height (window)
    "Return the height (in screen lines) of the buffer that WINDOW is 
displaying."
!   (with-current-buffer (window-buffer window)
!     (max 1
!        (count-screen-lines (point-min) (point-max)
!                            ;; If buffer ends with a newline, ignore it when
!                            ;; counting height unless point is after it.
!                            (eobp)
!                            window))))
  
  (defun count-screen-lines (&optional beg end count-final-newline window)
    "Return the number of screen lines in the region.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]