comparison src/window.c @ 52852:ac400ff02a1c

(Fset_window_margins): Simplify arg checking.
author Kim F. Storm <storm@cua.dk>
date Tue, 14 Oct 2003 09:33:09 +0000
parents a832ae359532
children 91a9da753e30
comparison
equal deleted inserted replaced
52851:f137e448c2f2 52852:ac400ff02a1c
5854 (window, left, right) 5854 (window, left, right)
5855 Lisp_Object window, left, right; 5855 Lisp_Object window, left, right;
5856 { 5856 {
5857 struct window *w = decode_window (window); 5857 struct window *w = decode_window (window);
5858 5858
5859 /* Translate negative or zero widths to nil.
5860 Margins that are too wide have to be checked elsewhere. */
5861
5859 if (!NILP (left)) 5862 if (!NILP (left))
5860 CHECK_NUMBER (left); 5863 {
5864 CHECK_NUMBER (left);
5865 if (XINT (left) <= 0)
5866 left = Qnil;
5867 }
5868
5861 if (!NILP (right)) 5869 if (!NILP (right))
5862 CHECK_NUMBER (right); 5870 {
5863 5871 CHECK_NUMBER (right);
5864 /* Check widths < 0 and translate a zero width to nil. 5872 if (XINT (right) <= 0)
5865 Margins that are too wide have to be checked elsewhere. */ 5873 right = Qnil;
5866 if ((INTEGERP (left) && XINT (left) < 0) 5874 }
5867 || (FLOATP (left) && XFLOAT_DATA (left) <= 0))
5868 XSETFASTINT (left, 0);
5869 if (INTEGERP (left) && XFASTINT (left) == 0)
5870 left = Qnil;
5871
5872 if ((INTEGERP (right) && XINT (right) < 0)
5873 || (FLOATP (right) && XFLOAT_DATA (right) <= 0))
5874 XSETFASTINT (right, 0);
5875 if (INTEGERP (right) && XFASTINT (right) == 0)
5876 right = Qnil;
5877 5875
5878 if (!EQ (w->left_margin_cols, left) 5876 if (!EQ (w->left_margin_cols, left)
5879 || !EQ (w->right_margin_cols, right)) 5877 || !EQ (w->right_margin_cols, right))
5880 { 5878 {
5881 w->left_margin_cols = left; 5879 w->left_margin_cols = left;