changeset 32937:dc58e218a878

(Fpos_visible_in_window_p): Make POS default to WINDOW's point, not the current buffer's point.
author Miles Bader <miles@gnu.org>
date Fri, 27 Oct 2000 01:16:47 +0000
parents 3b8c8450514e
children 4b9c0e6751e7
files src/window.c
diffstat 1 files changed, 11 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/src/window.c	Fri Oct 27 00:55:09 2000 +0000
+++ b/src/window.c	Fri Oct 27 01:16:47 2000 +0000
@@ -1,6 +1,6 @@
 /* Window creation, deletion and examination for GNU Emacs.
    Does not include redisplay.
-   Copyright (C) 1985,86,87,93,94,95,96,97,1998 Free Software Foundation, Inc.
+   Copyright (C) 1985,86,87,93,94,95,96,97,1998,2000 Free Software Foundation, Inc.
 
 This file is part of GNU Emacs.
 
@@ -299,7 +299,7 @@
   "Return t if position POS is currently on the frame in WINDOW.\n\
 Return nil if that position is scrolled vertically out of view.\n\
 If FULLY is non-nil, then only return t when POS is completely visible.\n\
-POS defaults to point; WINDOW defaults to the selected window.")
+POS defaults to point in WINDOW; WINDOW defaults to the selected window.")
   (pos, window, fully)
      Lisp_Object pos, window, fully;
 {
@@ -310,17 +310,19 @@
   Lisp_Object in_window;
   int fully_p;
 
-  if (NILP (pos))
-    posint = PT;
-  else
+  w = decode_window (window);
+  buf = XBUFFER (w->buffer);
+  SET_TEXT_POS_FROM_MARKER (top, w->start);
+
+  if (!NILP (pos))
     {
       CHECK_NUMBER_COERCE_MARKER (pos, 0);
       posint = XINT (pos);
     }
-
-  w = decode_window (window);
-  buf = XBUFFER (w->buffer);
-  SET_TEXT_POS_FROM_MARKER (top, w->start);
+  else if (w == XWINDOW (selected_window))
+    posint = PT;
+  else
+    posint = XMARKER (w->pointm)->charpos;
 
   /* If position is above window start, it's not visible.  */
   if (posint < CHARPOS (top))