aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMiles Bader2000-10-27 01:16:47 +0000
committerMiles Bader2000-10-27 01:16:47 +0000
commitf28b75a9b9290ebdd74135f633c878f26f4008e2 (patch)
tree6d9b056871dd4fa7b067c88f9ebedab0b93bb6c7 /src
parente8d4d4dadb56bfdf9861ee03bcecbf1aca92433f (diff)
downloademacs-f28b75a9b9290ebdd74135f633c878f26f4008e2.tar.gz
emacs-f28b75a9b9290ebdd74135f633c878f26f4008e2.zip
(Fpos_visible_in_window_p):
Make POS default to WINDOW's point, not the current buffer's point.
Diffstat (limited to 'src')
-rw-r--r--src/window.c20
1 files changed, 11 insertions, 9 deletions
diff --git a/src/window.c b/src/window.c
index 38724e22bbc..b408c40f8fd 100644
--- a/src/window.c
+++ b/src/window.c
@@ -1,6 +1,6 @@
1/* Window creation, deletion and examination for GNU Emacs. 1/* Window creation, deletion and examination for GNU Emacs.
2 Does not include redisplay. 2 Does not include redisplay.
3 Copyright (C) 1985,86,87,93,94,95,96,97,1998 Free Software Foundation, Inc. 3 Copyright (C) 1985,86,87,93,94,95,96,97,1998,2000 Free Software Foundation, Inc.
4 4
5This file is part of GNU Emacs. 5This file is part of GNU Emacs.
6 6
@@ -299,7 +299,7 @@ DEFUN ("pos-visible-in-window-p", Fpos_visible_in_window_p,
299 "Return t if position POS is currently on the frame in WINDOW.\n\ 299 "Return t if position POS is currently on the frame in WINDOW.\n\
300Return nil if that position is scrolled vertically out of view.\n\ 300Return nil if that position is scrolled vertically out of view.\n\
301If FULLY is non-nil, then only return t when POS is completely visible.\n\ 301If FULLY is non-nil, then only return t when POS is completely visible.\n\
302POS defaults to point; WINDOW defaults to the selected window.") 302POS defaults to point in WINDOW; WINDOW defaults to the selected window.")
303 (pos, window, fully) 303 (pos, window, fully)
304 Lisp_Object pos, window, fully; 304 Lisp_Object pos, window, fully;
305{ 305{
@@ -310,17 +310,19 @@ POS defaults to point; WINDOW defaults to the selected window.")
310 Lisp_Object in_window; 310 Lisp_Object in_window;
311 int fully_p; 311 int fully_p;
312 312
313 if (NILP (pos)) 313 w = decode_window (window);
314 posint = PT; 314 buf = XBUFFER (w->buffer);
315 else 315 SET_TEXT_POS_FROM_MARKER (top, w->start);
316
317 if (!NILP (pos))
316 { 318 {
317 CHECK_NUMBER_COERCE_MARKER (pos, 0); 319 CHECK_NUMBER_COERCE_MARKER (pos, 0);
318 posint = XINT (pos); 320 posint = XINT (pos);
319 } 321 }
320 322 else if (w == XWINDOW (selected_window))
321 w = decode_window (window); 323 posint = PT;
322 buf = XBUFFER (w->buffer); 324 else
323 SET_TEXT_POS_FROM_MARKER (top, w->start); 325 posint = XMARKER (w->pointm)->charpos;
324 326
325 /* If position is above window start, it's not visible. */ 327 /* If position is above window start, it's not visible. */
326 if (posint < CHARPOS (top)) 328 if (posint < CHARPOS (top))