diff options
| author | Kim F. Storm | 2003-10-14 09:33:09 +0000 |
|---|---|---|
| committer | Kim F. Storm | 2003-10-14 09:33:09 +0000 |
| commit | c2c3f20258e994024bfea4cf2e2ceec1fedf4ee4 (patch) | |
| tree | 2b6994131b14757505a99c4b685fb8879c945719 | |
| parent | 07107abc30c7867a8c3315a1ef1cfbcf753cd389 (diff) | |
| download | emacs-c2c3f20258e994024bfea4cf2e2ceec1fedf4ee4.tar.gz emacs-c2c3f20258e994024bfea4cf2e2ceec1fedf4ee4.zip | |
(Fset_window_margins): Simplify arg checking.
| -rw-r--r-- | src/window.c | 30 |
1 files changed, 14 insertions, 16 deletions
diff --git a/src/window.c b/src/window.c index 824200dc18f..10de132fcce 100644 --- a/src/window.c +++ b/src/window.c | |||
| @@ -5856,24 +5856,22 @@ A nil width parameter means no margin. */) | |||
| 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 | { |
| 5861 | if (!NILP (right)) | 5864 | CHECK_NUMBER (left); |
| 5862 | CHECK_NUMBER (right); | 5865 | if (XINT (left) <= 0) |
| 5866 | left = Qnil; | ||
| 5867 | } | ||
| 5863 | 5868 | ||
| 5864 | /* Check widths < 0 and translate a zero width to nil. | 5869 | if (!NILP (right)) |
| 5865 | Margins that are too wide have to be checked elsewhere. */ | 5870 | { |
| 5866 | if ((INTEGERP (left) && XINT (left) < 0) | 5871 | CHECK_NUMBER (right); |
| 5867 | || (FLOATP (left) && XFLOAT_DATA (left) <= 0)) | 5872 | if (XINT (right) <= 0) |
| 5868 | XSETFASTINT (left, 0); | 5873 | right = Qnil; |
| 5869 | if (INTEGERP (left) && XFASTINT (left) == 0) | 5874 | } |
| 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)) |