comparison src/window.c @ 5581:56144c8593a8

Mechanically change INT to FIXNUM in our sources. src/ChangeLog addition: 2011-10-09 Aidan Kehoe <kehoea@parhasard.net> [...] Mechanically change INT (where it refers to non-bignum Lisp integers) to FIXNUM in our sources. Done for the following functions, enums, and macros: Lisp_Type_Int_Even, Lisp_Type_Int_Odd, INT_GCBITS, INT_VALBITS, make_int(), INTP(), XINT(), CHECK_INT(), XREALINT(), INT_PLUS(), INT_MINUS(), EMACS_INT_MAX (to MOST_POSITIVE_FIXNUM), EMACS_INT_MIN (to MOST_NEGATIVE_FIXNUM), NUMBER_FITS_IN_AN_EMACS_INT() to NUMBER_FITS_IN_A_FIXNUM(), XFLOATINT, XCHAR_OR_INT, INT_OR_FLOAT. The EMACS_INT typedef was not changed, it does not describe non-bignum Lisp integers. Script that did the change available in http://mid.gmane.org/20067.17650.181273.12014@parhasard.net . modules/ChangeLog addition: 2011-10-09 Aidan Kehoe <kehoea@parhasard.net> [...] Mechanically change INT to FIXNUM, where the usage describes non-bignum Lisp integers. See the src/ChangeLog entry for more details. man/ChangeLog addition: 2011-10-09 Aidan Kehoe <kehoea@parhasard.net> * internals/internals.texi (How Lisp Objects Are Represented in C): * internals/internals.texi (Integers and Characters): Mechanically change INT to FIXNUM, where the usage describes non-bignum Lisp integers.
author Aidan Kehoe <kehoea@parhasard.net>
date Sun, 09 Oct 2011 09:51:57 +0100
parents 4dee0387b9de
children 3fde0e346ad7
comparison
equal deleted inserted replaced
5580:a0e81357194e 5581:56144c8593a8
1029 /* the shadow thickness can be negative. This means that the divider 1029 /* the shadow thickness can be negative. This means that the divider
1030 will have a depressed look */ 1030 will have a depressed look */
1031 1031
1032 if (FRAME_WIN_P (XFRAME (WINDOW_FRAME (w)))) 1032 if (FRAME_WIN_P (XFRAME (WINDOW_FRAME (w))))
1033 return 1033 return
1034 XINT (w->vertical_divider_line_width) 1034 XFIXNUM (w->vertical_divider_line_width)
1035 + 2 * XINT (w->vertical_divider_spacing) 1035 + 2 * XFIXNUM (w->vertical_divider_spacing)
1036 + 2 * abs (XINT (w->vertical_divider_shadow_thickness)); 1036 + 2 * abs (XFIXNUM (w->vertical_divider_shadow_thickness));
1037 else 1037 else
1038 return XINT (w->vertical_divider_line_width) == 0 ? 0 : 1; 1038 return XFIXNUM (w->vertical_divider_line_width) == 0 ? 0 : 1;
1039 } 1039 }
1040 1040
1041 int 1041 int
1042 window_scrollbar_width (struct window * USED_IF_SCROLLBARS (w)) 1042 window_scrollbar_width (struct window * USED_IF_SCROLLBARS (w))
1043 { 1043 {
1047 || NILP (w->buffer) 1047 || NILP (w->buffer)
1048 || NILP (w->vertical_scrollbar_visible_p)) 1048 || NILP (w->vertical_scrollbar_visible_p))
1049 /* #### when does NILP (w->buffer) happen? */ 1049 /* #### when does NILP (w->buffer) happen? */
1050 return 0; 1050 return 0;
1051 1051
1052 return XINT (w->scrollbar_width); 1052 return XFIXNUM (w->scrollbar_width);
1053 #else 1053 #else
1054 return 0; 1054 return 0;
1055 #endif /* HAVE_SCROLLBARS */ 1055 #endif /* HAVE_SCROLLBARS */
1056 } 1056 }
1057 1057
1066 || NILP (w->buffer) 1066 || NILP (w->buffer)
1067 || NILP (w->horizontal_scrollbar_visible_p) 1067 || NILP (w->horizontal_scrollbar_visible_p)
1068 || !window_truncation_on (w)) 1068 || !window_truncation_on (w))
1069 return 0; 1069 return 0;
1070 1070
1071 return XINT (w->scrollbar_height); 1071 return XFIXNUM (w->scrollbar_height);
1072 #else 1072 #else
1073 return 0; 1073 return 0;
1074 #endif /* HAVE_SCROLLBARS */ 1074 #endif /* HAVE_SCROLLBARS */
1075 } 1075 }
1076 1076
1165 /* The minibuffer never has margins. */ 1165 /* The minibuffer never has margins. */
1166 if (MINI_WINDOW_P (w)) 1166 if (MINI_WINDOW_P (w))
1167 return 0; 1167 return 0;
1168 1168
1169 window = wrap_window (w); 1169 window = wrap_window (w);
1170 margin_cwidth = (left_margin ? XINT (w->left_margin_width) : 1170 margin_cwidth = (left_margin ? XFIXNUM (w->left_margin_width) :
1171 XINT (w->right_margin_width)); 1171 XFIXNUM (w->right_margin_width));
1172 1172
1173 default_face_width_and_height (window, &font_width, 0); 1173 default_face_width_and_height (window, &font_width, 0);
1174 1174
1175 /* The left margin takes precedence over the right margin so we 1175 /* The left margin takes precedence over the right margin so we
1176 subtract its width from the space available for the right 1176 subtract its width from the space available for the right
1177 margin. */ 1177 margin. */
1178 if (!left_margin) 1178 if (!left_margin)
1179 window_cwidth -= XINT (w->left_margin_width); 1179 window_cwidth -= XFIXNUM (w->left_margin_width);
1180 1180
1181 /* The margin cannot be wider than the window is. We allow the 1181 /* The margin cannot be wider than the window is. We allow the
1182 value to be bigger since it is possible for the user to enlarge 1182 value to be bigger since it is possible for the user to enlarge
1183 the window such that the left margin value would no longer be too 1183 the window such that the left margin value would no longer be too
1184 big, but we won't return a value that is larger. */ 1184 big, but we won't return a value that is larger. */
1483 1483
1484 if (NILP (pos)) 1484 if (NILP (pos))
1485 posint = BUF_PT (buf); 1485 posint = BUF_PT (buf);
1486 else 1486 else
1487 { 1487 {
1488 CHECK_INT_COERCE_MARKER (pos); 1488 CHECK_FIXNUM_COERCE_MARKER (pos);
1489 posint = XINT (pos); 1489 posint = XFIXNUM (pos);
1490 } 1490 }
1491 1491
1492 if (posint < top || posint > BUF_ZV (buf)) 1492 if (posint < top || posint > BUF_ZV (buf))
1493 return Qnil; 1493 return Qnil;
1494 1494
1571 (rows/columns) ---- window-displayed-height 1571 (rows/columns) ---- window-displayed-height
1572 (pixels) ---- window-displayed-text-pixel-height 1572 (pixels) ---- window-displayed-text-pixel-height
1573 */ 1573 */
1574 (window)) 1574 (window))
1575 { 1575 {
1576 return make_int (window_char_height (decode_window (window), 1)); 1576 return make_fixnum (window_char_height (decode_window (window), 1));
1577 } 1577 }
1578 1578
1579 DEFUN ("window-displayed-height", Fwindow_displayed_height, 0, 1, 0, /* 1579 DEFUN ("window-displayed-height", Fwindow_displayed_height, 0, 1, 0, /*
1580 Return the number of lines currently displayed in WINDOW. 1580 Return the number of lines currently displayed in WINDOW.
1581 This counts the actual number of lines displayed in WINDOW 1581 This counts the actual number of lines displayed in WINDOW
1585 function pretends that there are lines of text in the default 1585 function pretends that there are lines of text in the default
1586 font there. 1586 font there.
1587 */ 1587 */
1588 (window)) 1588 (window))
1589 { 1589 {
1590 return make_int (window_displayed_height (decode_window (window))); 1590 return make_fixnum (window_displayed_height (decode_window (window)));
1591 } 1591 }
1592 1592
1593 DEFUN ("window-pixel-height", Fwindow_pixel_height, 0, 1, 0, /* 1593 DEFUN ("window-pixel-height", Fwindow_pixel_height, 0, 1, 0, /*
1594 Return the height of WINDOW in pixels. Defaults to current window. 1594 Return the height of WINDOW in pixels. Defaults to current window.
1595 This includes the window's modeline and horizontal scrollbar (if any). 1595 This includes the window's modeline and horizontal scrollbar (if any).
1596 */ 1596 */
1597 (window)) 1597 (window))
1598 { 1598 {
1599 return make_int (window_pixel_height (decode_window (window))); 1599 return make_fixnum (window_pixel_height (decode_window (window)));
1600 } 1600 }
1601 1601
1602 DEFUN ("window-text-area-height", Fwindow_text_area_height, 0, 1, 0, /* 1602 DEFUN ("window-text-area-height", Fwindow_text_area_height, 0, 1, 0, /*
1603 Return the number of default lines in the text area of WINDOW. 1603 Return the number of default lines in the text area of WINDOW.
1604 This actually works by dividing the window's text area pixel height (i.e. 1604 This actually works by dividing the window's text area pixel height (i.e.
1607 be different. 1607 be different.
1608 See also `window-height' and `window-displayed-height'. 1608 See also `window-height' and `window-displayed-height'.
1609 */ 1609 */
1610 (window)) 1610 (window))
1611 { 1611 {
1612 return make_int (window_char_height (decode_window (window), 0)); 1612 return make_fixnum (window_char_height (decode_window (window), 0));
1613 } 1613 }
1614 1614
1615 DEFUN ("window-text-area-pixel-height", 1615 DEFUN ("window-text-area-pixel-height",
1616 Fwindow_text_area_pixel_height, 0, 1, 0, /* 1616 Fwindow_text_area_pixel_height, 0, 1, 0, /*
1617 Return the height in pixels of the text-displaying portion of WINDOW. 1617 Return the height in pixels of the text-displaying portion of WINDOW.
1620 */ 1620 */
1621 (window)) 1621 (window))
1622 { 1622 {
1623 struct window *w = decode_window (window); 1623 struct window *w = decode_window (window);
1624 1624
1625 return make_int (WINDOW_TEXT_HEIGHT (w)); 1625 return make_fixnum (WINDOW_TEXT_HEIGHT (w));
1626 } 1626 }
1627 1627
1628 DEFUN ("window-displayed-text-pixel-height", 1628 DEFUN ("window-displayed-text-pixel-height",
1629 Fwindow_displayed_text_pixel_height, 0, 2, 0, /* 1629 Fwindow_displayed_text_pixel_height, 0, 2, 0, /*
1630 Return the height in pixels of the text displayed in WINDOW. 1630 Return the height in pixels of the text displayed in WINDOW.
1668 height = 0; 1668 height = 0;
1669 for (i = elt; i < nelt; i++) { 1669 for (i = elt; i < nelt; i++) {
1670 line = Dynarr_atp (cache, i)->height; 1670 line = Dynarr_atp (cache, i)->height;
1671 1671
1672 if (height + line > hlimit) 1672 if (height + line > hlimit)
1673 return make_int (!NILP (noclipped) ? height : hlimit); 1673 return make_fixnum (!NILP (noclipped) ? height : hlimit);
1674 1674
1675 height += line; 1675 height += line;
1676 1676
1677 if (height == hlimit || Dynarr_atp (cache, i)->end >= eobuf) 1677 if (height == hlimit || Dynarr_atp (cache, i)->end >= eobuf)
1678 return make_int (height); 1678 return make_fixnum (height);
1679 } 1679 }
1680 1680
1681 /* get here => need more cache lines. try again. */ 1681 /* get here => need more cache lines. try again. */
1682 assert(height > prev_height); /* progress? */ 1682 assert(height > prev_height); /* progress? */
1683 prev_height = height; 1683 prev_height = height;
1684 1684
1685 needed += ((hlimit - height)*(nelt - elt) + height-1)/height + 3; 1685 needed += ((hlimit - height)*(nelt - elt) + height-1)/height + 3;
1686 } 1686 }
1687 1687
1688 RETURN_NOT_REACHED(make_int (0)); /* shut up compiler */ 1688 RETURN_NOT_REACHED(make_fixnum (0)); /* shut up compiler */
1689 } 1689 }
1690 1690
1691 DEFUN ("window-width", Fwindow_width, 0, 1, 0, /* 1691 DEFUN ("window-width", Fwindow_width, 0, 1, 0, /*
1692 Return the number of display columns in WINDOW. 1692 Return the number of display columns in WINDOW.
1693 This is the width that is usable columns available for text in WINDOW, 1693 This is the width that is usable columns available for text in WINDOW,
1694 and does not include vertical scrollbars, dividers, or the like. See also 1694 and does not include vertical scrollbars, dividers, or the like. See also
1695 `window-full-width' and `window-height'. 1695 `window-full-width' and `window-height'.
1696 */ 1696 */
1697 (window)) 1697 (window))
1698 { 1698 {
1699 return make_int (window_char_width (decode_window (window), 0)); 1699 return make_fixnum (window_char_width (decode_window (window), 0));
1700 } 1700 }
1701 1701
1702 DEFUN ("window-full-width", Fwindow_full_width, 0, 1, 0, /* 1702 DEFUN ("window-full-width", Fwindow_full_width, 0, 1, 0, /*
1703 Return the total number of columns in WINDOW. 1703 Return the total number of columns in WINDOW.
1704 This is like `window-width' but includes vertical scrollbars, dividers, 1704 This is like `window-width' but includes vertical scrollbars, dividers,
1705 etc. 1705 etc.
1706 */ 1706 */
1707 (window)) 1707 (window))
1708 { 1708 {
1709 return make_int (window_char_width (decode_window (window), 1)); 1709 return make_fixnum (window_char_width (decode_window (window), 1));
1710 } 1710 }
1711 1711
1712 DEFUN ("window-pixel-width", Fwindow_pixel_width, 0, 1, 0, /* 1712 DEFUN ("window-pixel-width", Fwindow_pixel_width, 0, 1, 0, /*
1713 Return the width of WINDOW in pixels. Defaults to current window. 1713 Return the width of WINDOW in pixels. Defaults to current window.
1714 */ 1714 */
1715 (window)) 1715 (window))
1716 { 1716 {
1717 return make_int (decode_window (window)->pixel_width); 1717 return make_fixnum (decode_window (window)->pixel_width);
1718 } 1718 }
1719 1719
1720 DEFUN ("window-text-area-pixel-width", 1720 DEFUN ("window-text-area-pixel-width",
1721 Fwindow_text_area_pixel_width, 0, 1, 0, /* 1721 Fwindow_text_area_pixel_width, 0, 1, 0, /*
1722 Return the width in pixels of the text-displaying portion of WINDOW. 1722 Return the width in pixels of the text-displaying portion of WINDOW.
1725 */ 1725 */
1726 (window)) 1726 (window))
1727 { 1727 {
1728 struct window *w = decode_window (window); 1728 struct window *w = decode_window (window);
1729 1729
1730 return make_int (WINDOW_TEXT_WIDTH (w)); 1730 return make_fixnum (WINDOW_TEXT_WIDTH (w));
1731 } 1731 }
1732 1732
1733 DEFUN ("window-hscroll", Fwindow_hscroll, 0, 1, 0, /* 1733 DEFUN ("window-hscroll", Fwindow_hscroll, 0, 1, 0, /*
1734 Return the number of columns by which WINDOW is scrolled from left margin. 1734 Return the number of columns by which WINDOW is scrolled from left margin.
1735 */ 1735 */
1736 (window)) 1736 (window))
1737 { 1737 {
1738 return make_int (decode_window (window)->hscroll); 1738 return make_fixnum (decode_window (window)->hscroll);
1739 } 1739 }
1740 1740
1741 DEFUN ("modeline-hscroll", Fmodeline_hscroll, 0, 1, 0, /* 1741 DEFUN ("modeline-hscroll", Fmodeline_hscroll, 0, 1, 0, /*
1742 Return the horizontal scrolling amount of WINDOW's modeline. 1742 Return the horizontal scrolling amount of WINDOW's modeline.
1743 If the window has no modeline, return nil. 1743 If the window has no modeline, return nil.
1744 */ 1744 */
1745 (window)) 1745 (window))
1746 { 1746 {
1747 struct window *w = decode_window (window); 1747 struct window *w = decode_window (window);
1748 1748
1749 return (WINDOW_HAS_MODELINE_P (w)) ? make_int ((int) w->modeline_hscroll) : 1749 return (WINDOW_HAS_MODELINE_P (w)) ? make_fixnum ((int) w->modeline_hscroll) :
1750 Qnil; 1750 Qnil;
1751 } 1751 }
1752 1752
1753 DEFUN ("set-modeline-hscroll", Fset_modeline_hscroll, 2, 2, 0, /* 1753 DEFUN ("set-modeline-hscroll", Fset_modeline_hscroll, 2, 2, 0, /*
1754 Set the horizontal scrolling amount of WINDOW's modeline to NCOL. 1754 Set the horizontal scrolling amount of WINDOW's modeline to NCOL.
1762 1762
1763 if (WINDOW_HAS_MODELINE_P (w)) 1763 if (WINDOW_HAS_MODELINE_P (w))
1764 { 1764 {
1765 Charcount ncols; 1765 Charcount ncols;
1766 1766
1767 CHECK_INT (ncol); 1767 CHECK_FIXNUM (ncol);
1768 ncols = (XINT (ncol) <= 0) ? 0 : (Charcount) XINT (ncol); 1768 ncols = (XFIXNUM (ncol) <= 0) ? 0 : (Charcount) XFIXNUM (ncol);
1769 if (ncols != w->modeline_hscroll) 1769 if (ncols != w->modeline_hscroll)
1770 { 1770 {
1771 MARK_MODELINE_CHANGED; 1771 MARK_MODELINE_CHANGED;
1772 w->modeline_hscroll = ncols; 1772 w->modeline_hscroll = ncols;
1773 } 1773 }
1774 return make_int ((int) ncols); 1774 return make_fixnum ((int) ncols);
1775 } 1775 }
1776 1776
1777 return Qnil; 1777 return Qnil;
1778 } 1778 }
1779 1779
1784 (window, ncol)) 1784 (window, ncol))
1785 { 1785 {
1786 struct window *w; 1786 struct window *w;
1787 int ncols; 1787 int ncols;
1788 1788
1789 CHECK_INT (ncol); 1789 CHECK_FIXNUM (ncol);
1790 ncols = XINT (ncol); 1790 ncols = XFIXNUM (ncol);
1791 if (ncols < 0) ncols = 0; 1791 if (ncols < 0) ncols = 0;
1792 w = decode_window (window); 1792 w = decode_window (window);
1793 if (w->hscroll != ncols) 1793 if (w->hscroll != ncols)
1794 MARK_CLIP_CHANGED; /* FSF marks differently but we aren't FSF. */ 1794 MARK_CLIP_CHANGED; /* FSF marks differently but we aren't FSF. */
1795 w->hscroll = ncols; 1795 w->hscroll = ncols;
1809 struct frame *f = XFRAME (w->frame); 1809 struct frame *f = XFRAME (w->frame);
1810 1810
1811 int left = w->pixel_left - FRAME_PANED_LEFT_EDGE (f); 1811 int left = w->pixel_left - FRAME_PANED_LEFT_EDGE (f);
1812 int top = w->pixel_top - FRAME_PANED_TOP_EDGE (f); 1812 int top = w->pixel_top - FRAME_PANED_TOP_EDGE (f);
1813 1813
1814 return list4 (make_int (left), 1814 return list4 (make_fixnum (left),
1815 make_int (top), 1815 make_fixnum (top),
1816 make_int (left + w->pixel_width), 1816 make_fixnum (left + w->pixel_width),
1817 make_int (top + w->pixel_height)); 1817 make_fixnum (top + w->pixel_height));
1818 } 1818 }
1819 1819
1820 DEFUN ("window-text-area-pixel-edges", 1820 DEFUN ("window-text-area-pixel-edges",
1821 Fwindow_text_area_pixel_edges, 0, 1, 0, /* 1821 Fwindow_text_area_pixel_edges, 0, 1, 0, /*
1822 Return a list of the pixel edge coordinates of the text area of WINDOW. 1822 Return a list of the pixel edge coordinates of the text area of WINDOW.
1831 int left = window_left_gutter_width (w, /* modeline = */ 0); 1831 int left = window_left_gutter_width (w, /* modeline = */ 0);
1832 int top = window_top_gutter_height (w); 1832 int top = window_top_gutter_height (w);
1833 int right = WINDOW_WIDTH (w) - window_right_gutter_width (w, 0); 1833 int right = WINDOW_WIDTH (w) - window_right_gutter_width (w, 0);
1834 int bottom = WINDOW_HEIGHT (w) - window_bottom_gutter_height (w); 1834 int bottom = WINDOW_HEIGHT (w) - window_bottom_gutter_height (w);
1835 1835
1836 return list4 (make_int (left), 1836 return list4 (make_fixnum (left),
1837 make_int (top), 1837 make_fixnum (top),
1838 make_int (right), 1838 make_fixnum (right),
1839 make_int (bottom)); 1839 make_fixnum (bottom));
1840 } 1840 }
1841 1841
1842 DEFUN ("window-point", Fwindow_point, 0, 1, 0, /* 1842 DEFUN ("window-point", Fwindow_point, 0, 1, 0, /*
1843 Return current value of point in WINDOW. 1843 Return current value of point in WINDOW.
1844 For a non-selected window, this is the value point would have 1844 For a non-selected window, this is the value point would have
1889 if (NILP (guarantee)) 1889 if (NILP (guarantee))
1890 { 1890 {
1891 Lisp_Object buf; 1891 Lisp_Object buf;
1892 buf = w->buffer; 1892 buf = w->buffer;
1893 CHECK_BUFFER (buf); 1893 CHECK_BUFFER (buf);
1894 return make_int (BUF_Z (XBUFFER (buf)) - w->window_end_pos[CURRENT_DISP]); 1894 return make_fixnum (BUF_Z (XBUFFER (buf)) - w->window_end_pos[CURRENT_DISP]);
1895 } 1895 }
1896 else 1896 else
1897 { 1897 {
1898 Charbpos startp = marker_position (w->start[CURRENT_DISP]); 1898 Charbpos startp = marker_position (w->start[CURRENT_DISP]);
1899 return make_int (end_of_last_line (w, startp)); 1899 return make_fixnum (end_of_last_line (w, startp));
1900 } 1900 }
1901 } 1901 }
1902 1902
1903 DEFUN ("window-last-line-visible-height", Fwindow_last_line_visible_height, 0, 1, 0, /* 1903 DEFUN ("window-last-line-visible-height", Fwindow_last_line_visible_height, 0, 1, 0, /*
1904 Return pixel height of visible part of last window line if it is clipped. 1904 Return pixel height of visible part of last window line if it is clipped.
1917 1917
1918 dl = Dynarr_atp (dla, num_lines - 1); 1918 dl = Dynarr_atp (dla, num_lines - 1);
1919 if (dl->clip == 0) 1919 if (dl->clip == 0)
1920 return Qnil; 1920 return Qnil;
1921 1921
1922 return make_int (dl->ascent + dl->descent - dl->clip); 1922 return make_fixnum (dl->ascent + dl->descent - dl->clip);
1923 } 1923 }
1924 1924
1925 DEFUN ("set-window-point", Fset_window_point, 2, 2, 0, /* 1925 DEFUN ("set-window-point", Fset_window_point, 2, 2, 0, /*
1926 Make point value in WINDOW be at position POS in WINDOW's buffer. 1926 Make point value in WINDOW be at position POS in WINDOW's buffer.
1927 If WINDOW is the selected window, and window's buffer is the current 1927 If WINDOW is the selected window, and window's buffer is the current
1933 */ 1933 */
1934 (window, pos)) 1934 (window, pos))
1935 { 1935 {
1936 struct window *w = decode_window (window); 1936 struct window *w = decode_window (window);
1937 1937
1938 CHECK_INT_COERCE_MARKER (pos); 1938 CHECK_FIXNUM_COERCE_MARKER (pos);
1939 1939
1940 /* Don't dereference selected-window because there may not 1940 /* Don't dereference selected-window because there may not
1941 be one -- e.g. at startup */ 1941 be one -- e.g. at startup */
1942 if (EQ (wrap_window (w), Fselected_window (Qnil)) 1942 if (EQ (wrap_window (w), Fselected_window (Qnil))
1943 && EQ (w->buffer, Fcurrent_buffer ())) 1943 && EQ (w->buffer, Fcurrent_buffer ()))
1956 */ 1956 */
1957 (window, pos, noforce)) 1957 (window, pos, noforce))
1958 { 1958 {
1959 struct window *w = decode_window (window); 1959 struct window *w = decode_window (window);
1960 1960
1961 CHECK_INT_COERCE_MARKER (pos); 1961 CHECK_FIXNUM_COERCE_MARKER (pos);
1962 set_marker_restricted (w->start[CURRENT_DISP], pos, w->buffer); 1962 set_marker_restricted (w->start[CURRENT_DISP], pos, w->buffer);
1963 /* this is not right, but much easier than doing what is right. */ 1963 /* this is not right, but much easier than doing what is right. */
1964 /* w->start_at_line_beg = 0; */ 1964 /* w->start_at_line_beg = 0; */
1965 /* WTF is the above supposed to mean? GE */ 1965 /* WTF is the above supposed to mean? GE */
1966 w->start_at_line_beg = beginning_of_line_p (XBUFFER (w->buffer), 1966 w->start_at_line_beg = beginning_of_line_p (XBUFFER (w->buffer),
2051 { 2051 {
2052 marker = Fmake_marker (); 2052 marker = Fmake_marker ();
2053 Fputhash (buf, marker, w->saved_point_cache); 2053 Fputhash (buf, marker, w->saved_point_cache);
2054 } 2054 }
2055 Fset_marker (marker, 2055 Fset_marker (marker,
2056 selected ? make_int (BUF_PT (b)) : w->pointm[CURRENT_DISP], 2056 selected ? make_fixnum (BUF_PT (b)) : w->pointm[CURRENT_DISP],
2057 buf); 2057 buf);
2058 2058
2059 marker = Fgethash (buf, w->saved_last_window_start_cache, Qnil); 2059 marker = Fgethash (buf, w->saved_last_window_start_cache, Qnil);
2060 2060
2061 if (NILP (marker)) 2061 if (NILP (marker))
2752 (count, which_frames, which_devices)) 2752 (count, which_frames, which_devices))
2753 { 2753 {
2754 int i; 2754 int i;
2755 Lisp_Object w; 2755 Lisp_Object w;
2756 2756
2757 CHECK_INT (count); 2757 CHECK_FIXNUM (count);
2758 w = Fselected_window (Qnil); 2758 w = Fselected_window (Qnil);
2759 i = XINT (count); 2759 i = XFIXNUM (count);
2760 2760
2761 while (i > 0) 2761 while (i > 0)
2762 { 2762 {
2763 w = Fnext_window (w, Qnil, which_frames, which_devices); 2763 w = Fnext_window (w, Qnil, which_frames, which_devices);
2764 i--; 2764 i--;
2924 /* Ignore dedicated windows and minibuffers. */ 2924 /* Ignore dedicated windows and minibuffers. */
2925 if (MINI_WINDOW_P (p) 2925 if (MINI_WINDOW_P (p)
2926 || (dedicated_too ? 0 : !NILP (p->dedicated))) 2926 || (dedicated_too ? 0 : !NILP (p->dedicated)))
2927 break; 2927 break;
2928 if (NILP (best_window) 2928 if (NILP (best_window)
2929 || (XINT (XWINDOW (best_window)->use_time) 2929 || (XFIXNUM (XWINDOW (best_window)->use_time)
2930 > XINT (p->use_time))) 2930 > XFIXNUM (p->use_time)))
2931 best_window = w; 2931 best_window = w;
2932 break; 2932 break;
2933 } 2933 }
2934 2934
2935 case GET_BUFFER_MRU_WINDOW: 2935 case GET_BUFFER_MRU_WINDOW:
2941 break; 2941 break;
2942 2942
2943 if (XBUFFER (p->buffer) == XBUFFER (obj)) 2943 if (XBUFFER (p->buffer) == XBUFFER (obj))
2944 { 2944 {
2945 if (NILP (best_window) 2945 if (NILP (best_window)
2946 || (XINT (XWINDOW (best_window)->use_time) 2946 || (XFIXNUM (XWINDOW (best_window)->use_time)
2947 < XINT (p->use_time))) 2947 < XFIXNUM (p->use_time)))
2948 best_window = w; 2948 best_window = w;
2949 } 2949 }
2950 break; 2950 break;
2951 } 2951 }
2952 2952
3042 3042
3043 w = next_window; 3043 w = next_window;
3044 } 3044 }
3045 } 3045 }
3046 3046
3047 return type == GET_BUFFER_WINDOW_COUNT ? make_int (count) : best_window; 3047 return type == GET_BUFFER_WINDOW_COUNT ? make_fixnum (count) : best_window;
3048 } 3048 }
3049 3049
3050 #if 0 /* not currently used */ 3050 #if 0 /* not currently used */
3051 3051
3052 int 3052 int
3055 Lisp_Object buffer, frame; 3055 Lisp_Object buffer, frame;
3056 3056
3057 frame = wrap_frame (f); 3057 frame = wrap_frame (f);
3058 buffer = wrap_buffer (b); 3058 buffer = wrap_buffer (b);
3059 3059
3060 return XINT (window_loop (GET_BUFFER_WINDOW_COUNT, buffer, 0, frame, 1, 3060 return XFIXNUM (window_loop (GET_BUFFER_WINDOW_COUNT, buffer, 0, frame, 1,
3061 Qnil)); 3061 Qnil));
3062 } 3062 }
3063 3063
3064 int 3064 int
3065 buffer_window_mru (struct window *w) 3065 buffer_window_mru (struct window *w)
3203 Return the width in pixels of the left outside margin of window WINDOW. 3203 Return the width in pixels of the left outside margin of window WINDOW.
3204 If WINDOW is nil, the selected window is assumed. 3204 If WINDOW is nil, the selected window is assumed.
3205 */ 3205 */
3206 (window)) 3206 (window))
3207 { 3207 {
3208 return make_int (window_left_margin_width (decode_window (window))); 3208 return make_fixnum (window_left_margin_width (decode_window (window)));
3209 } 3209 }
3210 3210
3211 DEFUN ("window-right-margin-pixel-width", Fwindow_right_margin_pixel_width, 3211 DEFUN ("window-right-margin-pixel-width", Fwindow_right_margin_pixel_width,
3212 0, 1, 0, /* 3212 0, 1, 0, /*
3213 Return the width in pixels of the right outside margin of window WINDOW. 3213 Return the width in pixels of the right outside margin of window WINDOW.
3214 If WINDOW is nil, the selected window is assumed. 3214 If WINDOW is nil, the selected window is assumed.
3215 */ 3215 */
3216 (window)) 3216 (window))
3217 { 3217 {
3218 return make_int (window_right_margin_width (decode_window (window))); 3218 return make_fixnum (window_right_margin_width (decode_window (window)));
3219 } 3219 }
3220 3220
3221 DEFUN ("delete-other-windows", Fdelete_other_windows, 0, 1, "", /* 3221 DEFUN ("delete-other-windows", Fdelete_other_windows, 0, 1, "", /*
3222 Make WINDOW (or the selected window) fill its frame. 3222 Make WINDOW (or the selected window) fill its frame.
3223 Only the frame WINDOW is on is affected. 3223 Only the frame WINDOW is on is affected.
3259 { 3259 {
3260 Charbpos new_start = start_with_line_at_pixpos (w, start_pos, old_top); 3260 Charbpos new_start = start_with_line_at_pixpos (w, start_pos, old_top);
3261 3261
3262 if (new_start >= BUF_BEGV (b) && new_start <= BUF_ZV (b)) 3262 if (new_start >= BUF_BEGV (b) && new_start <= BUF_ZV (b))
3263 { 3263 {
3264 Fset_marker (w->start[CURRENT_DISP], make_int (new_start), 3264 Fset_marker (w->start[CURRENT_DISP], make_fixnum (new_start),
3265 w->buffer); 3265 w->buffer);
3266 w->start_at_line_beg = beginning_of_line_p (b, new_start); 3266 w->start_at_line_beg = beginning_of_line_p (b, new_start);
3267 } 3267 }
3268 /* We need to do this, so that the window-scroll-functions 3268 /* We need to do this, so that the window-scroll-functions
3269 get called. */ 3269 get called. */
3698 w->window_end_pos[CURRENT_DISP] = 0; 3698 w->window_end_pos[CURRENT_DISP] = 0;
3699 w->hscroll = 0; 3699 w->hscroll = 0;
3700 w->modeline_hscroll = 0; 3700 w->modeline_hscroll = 0;
3701 #if 0 /* pre point caches */ 3701 #if 0 /* pre point caches */
3702 Fset_marker (w->pointm[CURRENT_DISP], 3702 Fset_marker (w->pointm[CURRENT_DISP],
3703 make_int (BUF_PT (XBUFFER (buffer))), 3703 make_fixnum (BUF_PT (XBUFFER (buffer))),
3704 buffer); 3704 buffer);
3705 set_marker_restricted (w->start[CURRENT_DISP], 3705 set_marker_restricted (w->start[CURRENT_DISP],
3706 make_int (XBUFFER (buffer)->last_window_start), 3706 make_fixnum (XBUFFER (buffer)->last_window_start),
3707 buffer); 3707 buffer);
3708 #else 3708 #else
3709 { 3709 {
3710 Lisp_Object marker = Fgethash (buffer, w->saved_point_cache, Qnil); 3710 Lisp_Object marker = Fgethash (buffer, w->saved_point_cache, Qnil);
3711 Lisp_Object newpoint = 3711 Lisp_Object newpoint =
3712 !NILP (marker) ? make_int (marker_position (marker)) : 3712 !NILP (marker) ? make_fixnum (marker_position (marker)) :
3713 make_int (BUF_PT (XBUFFER (buffer))); 3713 make_fixnum (BUF_PT (XBUFFER (buffer)));
3714 /* Previously, we had in here set-window-point, which did one of the 3714 /* Previously, we had in here set-window-point, which did one of the
3715 following two, but not both. However, that could result in pointm 3715 following two, but not both. However, that could result in pointm
3716 being in a different buffer from the window's buffer! Probably 3716 being in a different buffer from the window's buffer! Probably
3717 not a travesty since it always occurred when the window was 3717 not a travesty since it always occurred when the window was
3718 selected, meaning its value of point was ignored in favor of the 3718 selected, meaning its value of point was ignored in favor of the
3722 Fgoto_char (newpoint, buffer); /* this will automatically clip to 3722 Fgoto_char (newpoint, buffer); /* this will automatically clip to
3723 accessible */ 3723 accessible */
3724 marker = Fgethash (buffer, w->saved_last_window_start_cache, Qnil); 3724 marker = Fgethash (buffer, w->saved_last_window_start_cache, Qnil);
3725 set_marker_restricted (w->start[CURRENT_DISP], 3725 set_marker_restricted (w->start[CURRENT_DISP],
3726 !NILP (marker) ? 3726 !NILP (marker) ?
3727 make_int (marker_position (marker)) : 3727 make_fixnum (marker_position (marker)) :
3728 make_int (XBUFFER (buffer)->last_window_start), 3728 make_fixnum (XBUFFER (buffer)->last_window_start),
3729 buffer); 3729 buffer);
3730 } 3730 }
3731 #endif 3731 #endif
3732 3732
3733 Fset_marker (w->sb_point, w->start[CURRENT_DISP], buffer); 3733 Fset_marker (w->sb_point, w->start[CURRENT_DISP], buffer);
3754 Frecord_buffer (buffer); 3754 Frecord_buffer (buffer);
3755 3755
3756 Fset_buffer (buffer); 3756 Fset_buffer (buffer);
3757 } 3757 }
3758 if (NILP (XBUFFER (buffer)->display_count)) 3758 if (NILP (XBUFFER (buffer)->display_count))
3759 XBUFFER (buffer)->display_count = make_int (1); 3759 XBUFFER (buffer)->display_count = make_fixnum (1);
3760 else 3760 else
3761 XBUFFER (buffer)->display_count = make_int (1 + XINT (XBUFFER (buffer)->display_count)); 3761 XBUFFER (buffer)->display_count = make_fixnum (1 + XFIXNUM (XBUFFER (buffer)->display_count));
3762 XBUFFER (buffer)->display_time = Fcurrent_time(); 3762 XBUFFER (buffer)->display_time = Fcurrent_time();
3763 return Qnil; 3763 return Qnil;
3764 } 3764 }
3765 3765
3766 DEFUN ("select-window", Fselect_window, 1, 2, 0, /* 3766 DEFUN ("select-window", Fselect_window, 1, 2, 0, /*
3781 3781
3782 /* we have already caught dead-window errors */ 3782 /* we have already caught dead-window errors */
3783 if (!NILP (w->hchild) || !NILP (w->vchild)) 3783 if (!NILP (w->hchild) || !NILP (w->vchild))
3784 invalid_operation ("Trying to select non-leaf window", Qunbound); 3784 invalid_operation ("Trying to select non-leaf window", Qunbound);
3785 3785
3786 w->use_time = make_int (++window_select_count); 3786 w->use_time = make_fixnum (++window_select_count);
3787 3787
3788 if (EQ (window, old_selected_window)) 3788 if (EQ (window, old_selected_window))
3789 return window; 3789 return window;
3790 3790
3791 /* deselect the old window, if it exists (it might not exist if 3791 /* deselect the old window, if it exists (it might not exist if
3793 if (!NILP (old_selected_window)) 3793 if (!NILP (old_selected_window))
3794 { 3794 {
3795 struct window *ow = XWINDOW (old_selected_window); 3795 struct window *ow = XWINDOW (old_selected_window);
3796 3796
3797 Fset_marker (ow->pointm[CURRENT_DISP], 3797 Fset_marker (ow->pointm[CURRENT_DISP],
3798 make_int (BUF_PT (XBUFFER (ow->buffer))), 3798 make_fixnum (BUF_PT (XBUFFER (ow->buffer))),
3799 ow->buffer); 3799 ow->buffer);
3800 3800
3801 MARK_WINDOWS_CHANGED (ow); 3801 MARK_WINDOWS_CHANGED (ow);
3802 } 3802 }
3803 3803
3861 3861
3862 Vminibuffer_scroll_window = window; 3862 Vminibuffer_scroll_window = window;
3863 w = XWINDOW (window); 3863 w = XWINDOW (window);
3864 w->hscroll = 0; 3864 w->hscroll = 0;
3865 w->modeline_hscroll = 0; 3865 w->modeline_hscroll = 0;
3866 set_marker_restricted (w->start[CURRENT_DISP], make_int (1), buf); 3866 set_marker_restricted (w->start[CURRENT_DISP], make_fixnum (1), buf);
3867 set_marker_restricted (w->pointm[CURRENT_DISP], make_int (1), buf); 3867 set_marker_restricted (w->pointm[CURRENT_DISP], make_fixnum (1), buf);
3868 set_marker_restricted (w->sb_point, make_int (1), buf); 3868 set_marker_restricted (w->sb_point, make_fixnum (1), buf);
3869 } 3869 }
3870 } 3870 }
3871 3871
3872 static void 3872 static void
3873 make_dummy_parent (Lisp_Object window) 3873 make_dummy_parent (Lisp_Object window)
3954 csize = window_pixel_height_to_char_height (o, psize, 1); 3954 csize = window_pixel_height_to_char_height (o, psize, 1);
3955 } 3955 }
3956 } 3956 }
3957 else 3957 else
3958 { 3958 {
3959 CHECK_INT (size); 3959 CHECK_FIXNUM (size);
3960 csize = XINT (size); 3960 csize = XFIXNUM (size);
3961 if (!NILP (horflag)) 3961 if (!NILP (horflag))
3962 psize = window_char_width_to_pixel_width (o, csize, 0); 3962 psize = window_char_width_to_pixel_width (o, csize, 0);
3963 else 3963 else
3964 psize = window_char_height_to_pixel_height (o, csize, 1); 3964 psize = window_char_height_to_pixel_height (o, csize, 1);
3965 } 3965 }
3972 check_min_window_sizes (); 3972 check_min_window_sizes ();
3973 3973
3974 if (NILP (horflag)) 3974 if (NILP (horflag))
3975 { 3975 {
3976 if (csize < window_min_height) 3976 if (csize < window_min_height)
3977 signal_error (Qinvalid_operation, "Window height too small (after splitting)", make_int (csize)); 3977 signal_error (Qinvalid_operation, "Window height too small (after splitting)", make_fixnum (csize));
3978 if (csize + window_min_height > window_char_height (o, 1)) 3978 if (csize + window_min_height > window_char_height (o, 1))
3979 signal_error (Qinvalid_operation, "Window height too small (after splitting)", 3979 signal_error (Qinvalid_operation, "Window height too small (after splitting)",
3980 make_int (window_char_height (o, 1) - csize)); 3980 make_fixnum (window_char_height (o, 1) - csize));
3981 if (NILP (o->parent) 3981 if (NILP (o->parent)
3982 || NILP (XWINDOW (o->parent)->vchild)) 3982 || NILP (XWINDOW (o->parent)->vchild))
3983 { 3983 {
3984 make_dummy_parent (window); 3984 make_dummy_parent (window);
3985 #if 0 3985 #if 0
3994 } 3994 }
3995 } 3995 }
3996 else 3996 else
3997 { 3997 {
3998 if (csize < window_min_width) 3998 if (csize < window_min_width)
3999 signal_error (Qinvalid_operation, "Window width too small (after splitting)", make_int (csize)); 3999 signal_error (Qinvalid_operation, "Window width too small (after splitting)", make_fixnum (csize));
4000 if (csize + window_min_width > window_char_width (o, 0)) 4000 if (csize + window_min_width > window_char_width (o, 0))
4001 signal_error (Qinvalid_operation, "Window width too small (after splitting)", 4001 signal_error (Qinvalid_operation, "Window width too small (after splitting)",
4002 make_int (window_char_width (o, 0) - csize)); 4002 make_fixnum (window_char_width (o, 0) - csize));
4003 if (NILP (o->parent) 4003 if (NILP (o->parent)
4004 || NILP (XWINDOW (o->parent)->hchild)) 4004 || NILP (XWINDOW (o->parent)->hchild))
4005 { 4005 {
4006 make_dummy_parent (window); 4006 make_dummy_parent (window);
4007 #if 0 4007 #if 0
4072 sideways COUNT columns, and optional third arg WINDOW specifies the 4072 sideways COUNT columns, and optional third arg WINDOW specifies the
4073 window to change instead of the selected window. 4073 window to change instead of the selected window.
4074 */ 4074 */
4075 (count, horizontalp, window)) 4075 (count, horizontalp, window))
4076 { 4076 {
4077 CHECK_INT (count); 4077 CHECK_FIXNUM (count);
4078 change_window_height (window, XINT (count), horizontalp, /* inpixels */ 0); 4078 change_window_height (window, XFIXNUM (count), horizontalp, /* inpixels */ 0);
4079 return Qnil; 4079 return Qnil;
4080 } 4080 }
4081 4081
4082 DEFUN ("enlarge-window-pixels", Fenlarge_window_pixels, 1, 3, "_p", /* 4082 DEFUN ("enlarge-window-pixels", Fenlarge_window_pixels, 1, 3, "_p", /*
4083 Make the selected window COUNT pixels taller. 4083 Make the selected window COUNT pixels taller.
4085 sideways COUNT pixels, and optional third arg WINDOW specifies the 4085 sideways COUNT pixels, and optional third arg WINDOW specifies the
4086 window to change instead of the selected window. 4086 window to change instead of the selected window.
4087 */ 4087 */
4088 (count, horizontalp, window)) 4088 (count, horizontalp, window))
4089 { 4089 {
4090 CHECK_INT (count); 4090 CHECK_FIXNUM (count);
4091 change_window_height (window, XINT (count), horizontalp, /* inpixels */ 1); 4091 change_window_height (window, XFIXNUM (count), horizontalp, /* inpixels */ 1);
4092 return Qnil; 4092 return Qnil;
4093 } 4093 }
4094 4094
4095 DEFUN ("shrink-window", Fshrink_window, 1, 3, "_p", /* 4095 DEFUN ("shrink-window", Fshrink_window, 1, 3, "_p", /*
4096 Make the selected window COUNT lines shorter. 4096 Make the selected window COUNT lines shorter.
4098 sideways COUNT columns, and optional third arg WINDOW specifies the 4098 sideways COUNT columns, and optional third arg WINDOW specifies the
4099 window to change instead of the selected window. 4099 window to change instead of the selected window.
4100 */ 4100 */
4101 (count, horizontalp, window)) 4101 (count, horizontalp, window))
4102 { 4102 {
4103 CHECK_INT (count); 4103 CHECK_FIXNUM (count);
4104 change_window_height (window, -XINT (count), horizontalp, /* inpixels */ 0); 4104 change_window_height (window, -XFIXNUM (count), horizontalp, /* inpixels */ 0);
4105 return Qnil; 4105 return Qnil;
4106 } 4106 }
4107 4107
4108 DEFUN ("shrink-window-pixels", Fshrink_window_pixels, 1, 3, "_p", /* 4108 DEFUN ("shrink-window-pixels", Fshrink_window_pixels, 1, 3, "_p", /*
4109 Make the selected window COUNT pixels smaller. 4109 Make the selected window COUNT pixels smaller.
4111 sideways COUNT pixels, and optional third arg WINDOW specifies the 4111 sideways COUNT pixels, and optional third arg WINDOW specifies the
4112 window to change instead of the selected window. 4112 window to change instead of the selected window.
4113 */ 4113 */
4114 (count, horizontalp, window)) 4114 (count, horizontalp, window))
4115 { 4115 {
4116 CHECK_INT (count); 4116 CHECK_FIXNUM (count);
4117 change_window_height (window, -XINT (count), horizontalp, /* inpixels */ 1); 4117 change_window_height (window, -XFIXNUM (count), horizontalp, /* inpixels */ 1);
4118 return Qnil; 4118 return Qnil;
4119 } 4119 }
4120 4120
4121 static int 4121 static int
4122 window_pixel_height_to_char_height (struct window *w, int pixel_height, 4122 window_pixel_height_to_char_height (struct window *w, int pixel_height,
4535 display_line_dynarr *dla; 4535 display_line_dynarr *dla;
4536 int fheight, fwidth, modeline = 0; 4536 int fheight, fwidth, modeline = 0;
4537 struct display_line* dl; 4537 struct display_line* dl;
4538 4538
4539 if (selected) 4539 if (selected)
4540 point = make_int (BUF_PT (b)); 4540 point = make_fixnum (BUF_PT (b));
4541 else 4541 else
4542 { 4542 {
4543 Charbpos pos = marker_position (w->pointm[CURRENT_DISP]); 4543 Charbpos pos = marker_position (w->pointm[CURRENT_DISP]);
4544 4544
4545 if (pos < BUF_BEGV (b)) 4545 if (pos < BUF_BEGV (b))
4546 pos = BUF_BEGV (b); 4546 pos = BUF_BEGV (b);
4547 else if (pos > BUF_ZV (b)) 4547 else if (pos > BUF_ZV (b))
4548 pos = BUF_ZV (b); 4548 pos = BUF_ZV (b);
4549 4549
4550 point = make_int (pos); 4550 point = make_fixnum (pos);
4551 } 4551 }
4552 4552
4553 /* Always set force_start so that redisplay_window will run 4553 /* Always set force_start so that redisplay_window will run
4554 the window-scroll-functions. */ 4554 the window-scroll-functions. */
4555 w->force_start = 1; 4555 w->force_start = 1;
4558 completely documented the behavior of the scrolling functions under 4558 completely documented the behavior of the scrolling functions under
4559 all circumstances. */ 4559 all circumstances. */
4560 tem = Fpos_visible_in_window_p (point, window, Qnil); 4560 tem = Fpos_visible_in_window_p (point, window, Qnil);
4561 if (NILP (tem)) 4561 if (NILP (tem))
4562 { 4562 {
4563 Fvertical_motion (make_int (-window_char_height (w, 0) / 2), 4563 Fvertical_motion (make_fixnum (-window_char_height (w, 0) / 2),
4564 window, Qnil); 4564 window, Qnil);
4565 Fset_marker (w->start[CURRENT_DISP], point, w->buffer); 4565 Fset_marker (w->start[CURRENT_DISP], point, w->buffer);
4566 w->start_at_line_beg = beginning_of_line_p (b, XINT (point)); 4566 w->start_at_line_beg = beginning_of_line_p (b, XFIXNUM (point));
4567 WINDOW_TEXT_TOP_CLIP (w) = 0; 4567 WINDOW_TEXT_TOP_CLIP (w) = 0;
4568 MARK_WINDOWS_CHANGED (w); 4568 MARK_WINDOWS_CHANGED (w);
4569 } 4569 }
4570 4570
4571 if (!NILP (count)) 4571 if (!NILP (count))
4573 if (EQ (count, Qminus)) 4573 if (EQ (count, Qminus))
4574 direction *= -1; 4574 direction *= -1;
4575 else 4575 else
4576 { 4576 {
4577 count = Fprefix_numeric_value (count); 4577 count = Fprefix_numeric_value (count);
4578 value = XINT (count) * direction; 4578 value = XFIXNUM (count) * direction;
4579 4579
4580 if (!value) 4580 if (!value)
4581 return; /* someone just made a pointless call */ 4581 return; /* someone just made a pointless call */
4582 } 4582 }
4583 } 4583 }
4610 } 4610 }
4611 4611
4612 /* Determine parameters to test for partial line scrolling with. */ 4612 /* Determine parameters to test for partial line scrolling with. */
4613 dla = window_display_lines (w, CURRENT_DISP); 4613 dla = window_display_lines (w, CURRENT_DISP);
4614 4614
4615 if (INTP (Vwindow_pixel_scroll_increment)) 4615 if (FIXNUMP (Vwindow_pixel_scroll_increment))
4616 fheight = XINT (Vwindow_pixel_scroll_increment); 4616 fheight = XFIXNUM (Vwindow_pixel_scroll_increment);
4617 else if (!NILP (Vwindow_pixel_scroll_increment)) 4617 else if (!NILP (Vwindow_pixel_scroll_increment))
4618 default_face_width_and_height (window, &fwidth, &fheight); 4618 default_face_width_and_height (window, &fwidth, &fheight);
4619 4619
4620 if (Dynarr_length (dla) >= 1) 4620 if (Dynarr_length (dla) >= 1)
4621 modeline = Dynarr_begin (dla)->modeline; 4621 modeline = Dynarr_begin (dla)->modeline;
4657 maybe_signal_error_1 (Qend_of_buffer, Qnil, Qwindow, errb); 4657 maybe_signal_error_1 (Qend_of_buffer, Qnil, Qwindow, errb);
4658 return; 4658 return;
4659 } 4659 }
4660 else 4660 else
4661 { 4661 {
4662 set_marker_restricted (w->start[CURRENT_DISP], make_int (startp), 4662 set_marker_restricted (w->start[CURRENT_DISP], make_fixnum (startp),
4663 w->buffer); 4663 w->buffer);
4664 w->force_start = 1; 4664 w->force_start = 1;
4665 w->start_at_line_beg = beginning_of_line_p (b, startp); 4665 w->start_at_line_beg = beginning_of_line_p (b, startp);
4666 MARK_WINDOWS_CHANGED (w); 4666 MARK_WINDOWS_CHANGED (w);
4667 4667
4668 if (!point_would_be_visible (w, startp, XINT (point), 0)) 4668 if (!point_would_be_visible (w, startp, XFIXNUM (point), 0))
4669 Fset_window_point (wrap_window (w), make_int (startp)); 4669 Fset_window_point (wrap_window (w), make_fixnum (startp));
4670 } 4670 }
4671 } 4671 }
4672 } 4672 }
4673 else if (value < 0) 4673 else if (value < 0)
4674 { 4674 {
4707 maybe_signal_error_1 (Qbeginning_of_buffer, Qnil, Qwindow, errb); 4707 maybe_signal_error_1 (Qbeginning_of_buffer, Qnil, Qwindow, errb);
4708 return; 4708 return;
4709 } 4709 }
4710 else 4710 else
4711 { 4711 {
4712 set_marker_restricted (w->start[CURRENT_DISP], make_int (startp), 4712 set_marker_restricted (w->start[CURRENT_DISP], make_fixnum (startp),
4713 w->buffer); 4713 w->buffer);
4714 w->force_start = 1; 4714 w->force_start = 1;
4715 w->start_at_line_beg = beginning_of_line_p (b, startp); 4715 w->start_at_line_beg = beginning_of_line_p (b, startp);
4716 MARK_WINDOWS_CHANGED (w); 4716 MARK_WINDOWS_CHANGED (w);
4717 4717
4731 && dl->ascent + fheight * value > 0) 4731 && dl->ascent + fheight * value > 0)
4732 { 4732 {
4733 WINDOW_TEXT_TOP_CLIP (w) = (dl->ascent + fheight * value); 4733 WINDOW_TEXT_TOP_CLIP (w) = (dl->ascent + fheight * value);
4734 } 4734 }
4735 4735
4736 if (!point_would_be_visible (w, startp, XINT (point), 0)) 4736 if (!point_would_be_visible (w, startp, XFIXNUM (point), 0))
4737 { 4737 {
4738 Charbpos new_point; 4738 Charbpos new_point;
4739 4739
4740 if (MINI_WINDOW_P (w)) 4740 if (MINI_WINDOW_P (w))
4741 new_point = startp; 4741 new_point = startp;
4742 else 4742 else
4743 new_point = start_of_last_line (w, startp); 4743 new_point = start_of_last_line (w, startp);
4744 4744
4745 Fset_window_point (wrap_window (w), make_int (new_point)); 4745 Fset_window_point (wrap_window (w), make_fixnum (new_point));
4746 } 4746 }
4747 } 4747 }
4748 } 4748 }
4749 } 4749 }
4750 else /* value == 0 && direction == -1 */ 4750 else /* value == 0 && direction == -1 */
4770 -1 - (movement - vtarget)); 4770 -1 - (movement - vtarget));
4771 4771
4772 if (startp >= old_startp) 4772 if (startp >= old_startp)
4773 startp = vmotion (w, old_startp, -1, NULL); 4773 startp = vmotion (w, old_startp, -1, NULL);
4774 4774
4775 set_marker_restricted (w->start[CURRENT_DISP], make_int (startp), 4775 set_marker_restricted (w->start[CURRENT_DISP], make_fixnum (startp),
4776 w->buffer); 4776 w->buffer);
4777 w->force_start = 1; 4777 w->force_start = 1;
4778 w->start_at_line_beg = beginning_of_line_p (b, startp); 4778 w->start_at_line_beg = beginning_of_line_p (b, startp);
4779 MARK_WINDOWS_CHANGED (w); 4779 MARK_WINDOWS_CHANGED (w);
4780 4780
4781 if (!point_would_be_visible (w, startp, XINT (point), 0)) 4781 if (!point_would_be_visible (w, startp, XFIXNUM (point), 0))
4782 { 4782 {
4783 Charbpos new_point = start_of_last_line (w, startp); 4783 Charbpos new_point = start_of_last_line (w, startp);
4784 4784
4785 Fset_window_point (wrap_window (w), make_int (new_point)); 4785 Fset_window_point (wrap_window (w), make_fixnum (new_point));
4786 } 4786 }
4787 } 4787 }
4788 } 4788 }
4789 } 4789 }
4790 4790
4903 { 4903 {
4904 Lisp_Object window = Fselected_window (Qnil); 4904 Lisp_Object window = Fselected_window (Qnil);
4905 struct window *w = XWINDOW (window); 4905 struct window *w = XWINDOW (window);
4906 int n = (NILP (count) ? 4906 int n = (NILP (count) ?
4907 window_char_width (w, 0) - 2 : 4907 window_char_width (w, 0) - 2 :
4908 XINT (Fprefix_numeric_value (count))); 4908 XFIXNUM (Fprefix_numeric_value (count)));
4909 4909
4910 return Fset_window_hscroll (window, make_int (w->hscroll + n)); 4910 return Fset_window_hscroll (window, make_fixnum (w->hscroll + n));
4911 } 4911 }
4912 4912
4913 DEFUN ("scroll-right", Fscroll_right, 0, 1, "_P", /* 4913 DEFUN ("scroll-right", Fscroll_right, 0, 1, "_P", /*
4914 Scroll selected window display COUNT columns right. 4914 Scroll selected window display COUNT columns right.
4915 Default for COUNT is window width minus 2. 4915 Default for COUNT is window width minus 2.
4923 { 4923 {
4924 Lisp_Object window = Fselected_window (Qnil); 4924 Lisp_Object window = Fselected_window (Qnil);
4925 struct window *w = XWINDOW (window); 4925 struct window *w = XWINDOW (window);
4926 int n = (NILP (count) ? 4926 int n = (NILP (count) ?
4927 window_char_width (w, 0) - 2 : 4927 window_char_width (w, 0) - 2 :
4928 XINT (Fprefix_numeric_value (count))); 4928 XFIXNUM (Fprefix_numeric_value (count)));
4929 4929
4930 return Fset_window_hscroll (window, make_int (w->hscroll - n)); 4930 return Fset_window_hscroll (window, make_fixnum (w->hscroll - n));
4931 } 4931 }
4932 4932
4933 DEFUN ("center-to-window-line", Fcenter_to_window_line, 0, 2, "_P", /* 4933 DEFUN ("center-to-window-line", Fcenter_to_window_line, 0, 2, "_P", /*
4934 Center point in WINDOW. With N, put point on line N. 4934 Center point in WINDOW. With N, put point on line N.
4935 The desired position of point is always relative to the window. 4935 The desired position of point is always relative to the window.
4945 if (NILP (n)) 4945 if (NILP (n))
4946 startp = start_with_line_at_pixpos (w, opoint, window_half_pixpos (w)); 4946 startp = start_with_line_at_pixpos (w, opoint, window_half_pixpos (w));
4947 else 4947 else
4948 { 4948 {
4949 n = Fprefix_numeric_value (n); 4949 n = Fprefix_numeric_value (n);
4950 CHECK_INT (n); 4950 CHECK_FIXNUM (n);
4951 startp = start_with_point_on_display_line (w, opoint, XINT (n)); 4951 startp = start_with_point_on_display_line (w, opoint, XFIXNUM (n));
4952 } 4952 }
4953 4953
4954 Fset_marker (w->start[CURRENT_DISP], make_int (startp), w->buffer); 4954 Fset_marker (w->start[CURRENT_DISP], make_fixnum (startp), w->buffer);
4955 4955
4956 w->start_at_line_beg = beginning_of_line_p (b, startp); 4956 w->start_at_line_beg = beginning_of_line_p (b, startp);
4957 w->force_start = 1; 4957 w->force_start = 1;
4958 MARK_WINDOWS_CHANGED (w); 4958 MARK_WINDOWS_CHANGED (w);
4959 return Qnil; 4959 return Qnil;
4988 4988
4989 if (NILP (arg)) 4989 if (NILP (arg))
4990 { 4990 {
4991 int retval; 4991 int retval;
4992 4992
4993 if (XINT (w->last_modified[CURRENT_DISP]) >= BUF_MODIFF (b) 4993 if (XFIXNUM (w->last_modified[CURRENT_DISP]) >= BUF_MODIFF (b)
4994 && XINT (w->last_facechange[CURRENT_DISP]) >= BUF_FACECHANGE (b)) 4994 && XFIXNUM (w->last_facechange[CURRENT_DISP]) >= BUF_FACECHANGE (b))
4995 { 4995 {
4996 new_point = point_at_center (w, CURRENT_DISP, 0, 0); 4996 new_point = point_at_center (w, CURRENT_DISP, 0, 0);
4997 4997
4998 /* #### Here we are checking the selected window of the frame 4998 /* #### Here we are checking the selected window of the frame
4999 instead of the selected window period. Elsewhere we check 4999 instead of the selected window period. Elsewhere we check
5000 the selected window of the device. What a mess! */ 5000 the selected window of the device. What a mess! */
5001 if (selected) 5001 if (selected)
5002 BUF_SET_PT (b, new_point); 5002 BUF_SET_PT (b, new_point);
5003 else 5003 else
5004 Fset_window_point (window, make_int (new_point)); 5004 Fset_window_point (window, make_fixnum (new_point));
5005 5005
5006 retval = line_at_center (w, CURRENT_DISP, 0, 0); 5006 retval = line_at_center (w, CURRENT_DISP, 0, 0);
5007 } 5007 }
5008 else 5008 else
5009 { 5009 {
5021 new_point = point_at_center (w, CMOTION_DISP, start, BUF_PT (b)); 5021 new_point = point_at_center (w, CMOTION_DISP, start, BUF_PT (b));
5022 5022
5023 if (selected) 5023 if (selected)
5024 BUF_SET_PT (b, new_point); 5024 BUF_SET_PT (b, new_point);
5025 else 5025 else
5026 Fset_window_point (window, make_int (new_point)); 5026 Fset_window_point (window, make_fixnum (new_point));
5027 5027
5028 retval = line_at_center (w, CMOTION_DISP, start, BUF_PT (b)); 5028 retval = line_at_center (w, CMOTION_DISP, start, BUF_PT (b));
5029 } 5029 }
5030 5030
5031 return make_int (retval); 5031 return make_fixnum (retval);
5032 } 5032 }
5033 else 5033 else
5034 { 5034 {
5035 /* #### Is this going to work right when at eob? */ 5035 /* #### Is this going to work right when at eob? */
5036 arg = Fprefix_numeric_value (arg); 5036 arg = Fprefix_numeric_value (arg);
5037 if (XINT (arg) < 0) 5037 if (XFIXNUM (arg) < 0)
5038 arg = make_int (XINT (arg) + height); 5038 arg = make_fixnum (XFIXNUM (arg) + height);
5039 } 5039 }
5040 5040
5041 start = marker_position (w->start[CURRENT_DISP]); 5041 start = marker_position (w->start[CURRENT_DISP]);
5042 if (start < BUF_BEGV (b) || start > BUF_ZV (b)) 5042 if (start < BUF_BEGV (b) || start > BUF_ZV (b))
5043 { 5043 {
5049 new_point = vmotion (XWINDOW (window), new_point, -height / 2, 0); 5049 new_point = vmotion (XWINDOW (window), new_point, -height / 2, 0);
5050 5050
5051 if (selected) 5051 if (selected)
5052 BUF_SET_PT (b, new_point); 5052 BUF_SET_PT (b, new_point);
5053 else 5053 else
5054 Fset_window_point (window, make_int (new_point)); 5054 Fset_window_point (window, make_fixnum (new_point));
5055 5055
5056 Fset_marker (w->start[CURRENT_DISP], make_int (new_point), 5056 Fset_marker (w->start[CURRENT_DISP], make_fixnum (new_point),
5057 w->buffer); 5057 w->buffer);
5058 w->start_at_line_beg = beginning_of_line_p (b, new_point); 5058 w->start_at_line_beg = beginning_of_line_p (b, new_point);
5059 w->force_start = 1; 5059 w->force_start = 1;
5060 } 5060 }
5061 else 5061 else
5062 { 5062 {
5063 if (selected) 5063 if (selected)
5064 BUF_SET_PT (b, start); 5064 BUF_SET_PT (b, start);
5065 else 5065 else
5066 Fset_window_point (window, make_int (start)); 5066 Fset_window_point (window, make_fixnum (start));
5067 } 5067 }
5068 5068
5069 if (selected) 5069 if (selected)
5070 return Fvertical_motion (arg, window, Qnil); 5070 return Fvertical_motion (arg, window, Qnil);
5071 else 5071 else
5072 { 5072 {
5073 int vpos; 5073 int vpos;
5074 new_point = vmotion (XWINDOW (window), 5074 new_point = vmotion (XWINDOW (window),
5075 marker_position (w->pointm[CURRENT_DISP]), 5075 marker_position (w->pointm[CURRENT_DISP]),
5076 XINT (arg), &vpos); 5076 XFIXNUM (arg), &vpos);
5077 Fset_window_point (window, make_int (new_point)); 5077 Fset_window_point (window, make_fixnum (new_point));
5078 return make_int (vpos); 5078 return make_fixnum (vpos);
5079 } 5079 }
5080 } 5080 }
5081 5081
5082 5082
5083 static int 5083 static int
5304 Charbpos point; 5304 Charbpos point;
5305 5305
5306 if (NILP (pos)) 5306 if (NILP (pos))
5307 pos = Fwindow_point (window); 5307 pos = Fwindow_point (window);
5308 5308
5309 CHECK_INT (pos); 5309 CHECK_FIXNUM (pos);
5310 point = XINT (pos); 5310 point = XFIXNUM (pos);
5311 5311
5312 if (Dynarr_length (dla) && Dynarr_begin (dla)->modeline) 5312 if (Dynarr_length (dla) && Dynarr_begin (dla)->modeline)
5313 first_line = 1; 5313 first_line = 1;
5314 else 5314 else
5315 first_line = 0; 5315 first_line = 0;
5367 struct rune* rb; 5367 struct rune* rb;
5368 5368
5369 if (!get_current_pixel_pos(window, pos, &w, &rb, &dl)) 5369 if (!get_current_pixel_pos(window, pos, &w, &rb, &dl))
5370 return Qnil; 5370 return Qnil;
5371 5371
5372 return make_int (rb->xpos - WINDOW_LEFT (w)); 5372 return make_fixnum (rb->xpos - WINDOW_LEFT (w));
5373 } 5373 }
5374 5374
5375 DEFUN ("current-pixel-row", Fcurrent_pixel_row, 0, 2, 0, /* 5375 DEFUN ("current-pixel-row", Fcurrent_pixel_row, 0, 2, 0, /*
5376 Return the vertical pixel position of point POS in window. Top of 5376 Return the vertical pixel position of point POS in window. Top of
5377 window is row 0. If WINDOW is nil, the current window is assumed. If 5377 window is row 0. If WINDOW is nil, the current window is assumed. If
5390 struct rune* rb; 5390 struct rune* rb;
5391 5391
5392 if (!get_current_pixel_pos(window, pos, &w, &rb, &dl)) 5392 if (!get_current_pixel_pos(window, pos, &w, &rb, &dl))
5393 return Qnil; 5393 return Qnil;
5394 5394
5395 return make_int (dl->ypos - dl->ascent - WINDOW_TOP (w)); 5395 return make_fixnum (dl->ypos - dl->ascent - WINDOW_TOP (w));
5396 } 5396 }
5397 5397
5398 5398
5399 #ifdef DEBUG_XEMACS 5399 #ifdef DEBUG_XEMACS
5400 /* This is short and simple in elisp, but... it was written to debug 5400 /* This is short and simple in elisp, but... it was written to debug
5655 /* The initial value for modeline-shadow-thickness is 2, but if the 5655 /* The initial value for modeline-shadow-thickness is 2, but if the
5656 user removes all specifications we provide a fallback value of 0, 5656 user removes all specifications we provide a fallback value of 0,
5657 which is probably what was expected. */ 5657 which is probably what was expected. */
5658 set_specifier_fallback (Vmodeline_shadow_thickness, 5658 set_specifier_fallback (Vmodeline_shadow_thickness,
5659 list1 (Fcons (Qnil, Qzero))); 5659 list1 (Fcons (Qnil, Qzero)));
5660 Fadd_spec_to_specifier (Vmodeline_shadow_thickness, make_int (2), 5660 Fadd_spec_to_specifier (Vmodeline_shadow_thickness, make_fixnum (2),
5661 Qnil, Qnil, Qnil); 5661 Qnil, Qnil, Qnil);
5662 set_specifier_caching (Vmodeline_shadow_thickness, 5662 set_specifier_caching (Vmodeline_shadow_thickness,
5663 offsetof (struct window, modeline_shadow_thickness), 5663 offsetof (struct window, modeline_shadow_thickness),
5664 modeline_shadow_thickness_changed, 5664 modeline_shadow_thickness_changed,
5665 0, 0, 0); 5665 0, 0, 0);
5704 This is a specifier; use `set-specifier' to change it. 5704 This is a specifier; use `set-specifier' to change it.
5705 */ ); 5705 */ );
5706 Vvertical_divider_shadow_thickness = Fmake_specifier (Qinteger); 5706 Vvertical_divider_shadow_thickness = Fmake_specifier (Qinteger);
5707 set_specifier_fallback (Vvertical_divider_shadow_thickness, 5707 set_specifier_fallback (Vvertical_divider_shadow_thickness,
5708 list1 (Fcons (Qnil, Qzero))); 5708 list1 (Fcons (Qnil, Qzero)));
5709 Fadd_spec_to_specifier (Vvertical_divider_shadow_thickness, make_int (2), 5709 Fadd_spec_to_specifier (Vvertical_divider_shadow_thickness, make_fixnum (2),
5710 Qnil, Qnil, Qnil); 5710 Qnil, Qnil, Qnil);
5711 set_specifier_caching (Vvertical_divider_shadow_thickness, 5711 set_specifier_caching (Vvertical_divider_shadow_thickness,
5712 offsetof (struct window, 5712 offsetof (struct window,
5713 vertical_divider_shadow_thickness), 5713 vertical_divider_shadow_thickness),
5714 vertical_divider_changed_in_window, 5714 vertical_divider_changed_in_window,
5726 5726
5727 Vvertical_divider_line_width = Fmake_specifier (Qnatnum); 5727 Vvertical_divider_line_width = Fmake_specifier (Qnatnum);
5728 { 5728 {
5729 Lisp_Object fb = Qnil; 5729 Lisp_Object fb = Qnil;
5730 #ifdef HAVE_TTY 5730 #ifdef HAVE_TTY
5731 fb = Fcons (Fcons (list1 (Qtty), make_int (1)), fb); 5731 fb = Fcons (Fcons (list1 (Qtty), make_fixnum (1)), fb);
5732 #endif 5732 #endif
5733 #ifdef HAVE_GTK 5733 #ifdef HAVE_GTK
5734 fb = Fcons (Fcons (list1 (Qgtk), make_int (3)), fb); 5734 fb = Fcons (Fcons (list1 (Qgtk), make_fixnum (3)), fb);
5735 #endif 5735 #endif
5736 #ifdef HAVE_X_WINDOWS 5736 #ifdef HAVE_X_WINDOWS
5737 fb = Fcons (Fcons (list1 (Qx), make_int (3)), fb); 5737 fb = Fcons (Fcons (list1 (Qx), make_fixnum (3)), fb);
5738 #endif 5738 #endif
5739 #ifdef HAVE_MS_WINDOWS 5739 #ifdef HAVE_MS_WINDOWS
5740 /* #### This should be made magic and made to obey system settings */ 5740 /* #### This should be made magic and made to obey system settings */
5741 fb = Fcons (Fcons (list1 (Qmswindows), make_int (3)), fb); 5741 fb = Fcons (Fcons (list1 (Qmswindows), make_fixnum (3)), fb);
5742 #endif 5742 #endif
5743 set_specifier_fallback (Vvertical_divider_line_width, fb); 5743 set_specifier_fallback (Vvertical_divider_line_width, fb);
5744 } 5744 }
5745 set_specifier_caching (Vvertical_divider_line_width, 5745 set_specifier_caching (Vvertical_divider_line_width,
5746 offsetof (struct window, 5746 offsetof (struct window,
5763 fb = Fcons (Fcons (list1 (Qtty), Qzero), fb); 5763 fb = Fcons (Fcons (list1 (Qtty), Qzero), fb);
5764 #endif 5764 #endif
5765 #ifdef HAVE_X_WINDOWS 5765 #ifdef HAVE_X_WINDOWS
5766 /* #### 3D dividers look great on MS Windows with spacing = 0. 5766 /* #### 3D dividers look great on MS Windows with spacing = 0.
5767 Should not the same value be the fallback under X? - kkm */ 5767 Should not the same value be the fallback under X? - kkm */
5768 fb = Fcons (Fcons (list1 (Qx), make_int (2)), fb); 5768 fb = Fcons (Fcons (list1 (Qx), make_fixnum (2)), fb);
5769 #endif 5769 #endif
5770 #ifdef HAVE_GTK 5770 #ifdef HAVE_GTK
5771 fb = Fcons (Fcons (list1 (Qgtk), Qzero), fb); 5771 fb = Fcons (Fcons (list1 (Qgtk), Qzero), fb);
5772 #endif 5772 #endif
5773 #ifdef HAVE_MS_WINDOWS 5773 #ifdef HAVE_MS_WINDOWS