comparison src/window.c @ 1161:8e95979f01c6

[xemacs-hg @ 2002-12-16 02:32:47 by ben] fixes for window-config problems and set-window-point
author ben
date Mon, 16 Dec 2002 02:33:04 +0000
parents a123f88fa975
children e22b0213b713
comparison
equal deleted inserted replaced
1160:21dcf7ccd9a3 1161:8e95979f01c6
1807 return make_int (dl->ascent + dl->descent - dl->clip); 1807 return make_int (dl->ascent + dl->descent - dl->clip);
1808 } 1808 }
1809 1809
1810 DEFUN ("set-window-point", Fset_window_point, 2, 2, 0, /* 1810 DEFUN ("set-window-point", Fset_window_point, 2, 2, 0, /*
1811 Make point value in WINDOW be at position POS in WINDOW's buffer. 1811 Make point value in WINDOW be at position POS in WINDOW's buffer.
1812 If WINDOW is the selected window, this actually changes the buffer's point 1812 If WINDOW is the selected window, and window's buffer is the current
1813 instead of the window's point. (The equivalence of the selected window's 1813 buffer, this actually changes the buffer's point instead of the window's
1814 point with its buffer's point is maintained throughout XEmacs.) 1814 point. (The equivalence of the selected window's point with its buffer's
1815 point is maintained throughout XEmacs. However, enforcing the additional
1816 restriction on the current buffer is "bug compatible" with FSF and is
1817 perhaps more logical.)
1815 */ 1818 */
1816 (window, pos)) 1819 (window, pos))
1817 { 1820 {
1818 struct window *w = decode_window (window); 1821 struct window *w = decode_window (window);
1819 1822
1820 CHECK_INT_COERCE_MARKER (pos); 1823 CHECK_INT_COERCE_MARKER (pos);
1824
1821 /* Don't dereference selected-window because there may not 1825 /* Don't dereference selected-window because there may not
1822 be one -- e.g. at startup */ 1826 be one -- e.g. at startup */
1823 if (EQ (wrap_window (w), Fselected_window (Qnil))) 1827 if (EQ (wrap_window (w), Fselected_window (Qnil))
1824 /* Even though window selected, buffer may not be current */ 1828 && EQ (w->buffer, Fcurrent_buffer ()))
1825 Fgoto_char (pos, w->buffer); 1829 Fgoto_char (pos, Qnil);
1826 else 1830 else
1827 set_marker_restricted (w->pointm[CURRENT_DISP], pos, w->buffer); 1831 set_marker_restricted (w->pointm[CURRENT_DISP], pos, w->buffer);
1828 1832
1829 MARK_POINT_CHANGED; 1833 MARK_POINT_CHANGED;
1830 return pos; 1834 return pos;