comparison src/cmds.c @ 40656:cdfd4d09b79a

Update usage of CHECK_ macros (remove unused second argument).
author Pavel Jan?k <Pavel@Janik.cz>
date Fri, 02 Nov 2001 20:46:55 +0000
parents 9d6d2c8564b3
children a17c8b15ef1b
comparison
equal deleted inserted replaced
40655:45453187feeb 40656:cdfd4d09b79a
46 DEFUN ("forward-point", Fforward_point, Sforward_point, 1, 1, 0, 46 DEFUN ("forward-point", Fforward_point, Sforward_point, 1, 1, 0,
47 "Return buffer position N characters after (before if N negative) point.") 47 "Return buffer position N characters after (before if N negative) point.")
48 (n) 48 (n)
49 Lisp_Object n; 49 Lisp_Object n;
50 { 50 {
51 CHECK_NUMBER (n, 0); 51 CHECK_NUMBER (n);
52 52
53 return make_number (PT + XINT (n)); 53 return make_number (PT + XINT (n));
54 } 54 }
55 55
56 DEFUN ("forward-char", Fforward_char, Sforward_char, 0, 1, "p", 56 DEFUN ("forward-char", Fforward_char, Sforward_char, 0, 1, "p",
60 Lisp_Object n; 60 Lisp_Object n;
61 { 61 {
62 if (NILP (n)) 62 if (NILP (n))
63 XSETFASTINT (n, 1); 63 XSETFASTINT (n, 1);
64 else 64 else
65 CHECK_NUMBER (n, 0); 65 CHECK_NUMBER (n);
66 66
67 /* This used to just set point to point + XINT (n), and then check 67 /* This used to just set point to point + XINT (n), and then check
68 to see if it was within boundaries. But now that SET_PT can 68 to see if it was within boundaries. But now that SET_PT can
69 potentially do a lot of stuff (calling entering and exiting 69 potentially do a lot of stuff (calling entering and exiting
70 hooks, etcetera), that's not a good approach. So we validate the 70 hooks, etcetera), that's not a good approach. So we validate the
96 Lisp_Object n; 96 Lisp_Object n;
97 { 97 {
98 if (NILP (n)) 98 if (NILP (n))
99 XSETFASTINT (n, 1); 99 XSETFASTINT (n, 1);
100 else 100 else
101 CHECK_NUMBER (n, 0); 101 CHECK_NUMBER (n);
102 102
103 XSETINT (n, - XINT (n)); 103 XSETINT (n, - XINT (n));
104 return Fforward_char (n); 104 return Fforward_char (n);
105 } 105 }
106 106
121 121
122 if (NILP (n)) 122 if (NILP (n))
123 count = 1; 123 count = 1;
124 else 124 else
125 { 125 {
126 CHECK_NUMBER (n, 0); 126 CHECK_NUMBER (n);
127 count = XINT (n); 127 count = XINT (n);
128 } 128 }
129 129
130 if (count <= 0) 130 if (count <= 0)
131 shortage = scan_newline (PT, PT_BYTE, BEGV, BEGV_BYTE, count - 1, 1); 131 shortage = scan_newline (PT, PT_BYTE, BEGV, BEGV_BYTE, count - 1, 1);
166 Lisp_Object n; 166 Lisp_Object n;
167 { 167 {
168 if (NILP (n)) 168 if (NILP (n))
169 XSETFASTINT (n, 1); 169 XSETFASTINT (n, 1);
170 else 170 else
171 CHECK_NUMBER (n, 0); 171 CHECK_NUMBER (n);
172 172
173 SET_PT (XINT (Fline_beginning_position (n))); 173 SET_PT (XINT (Fline_beginning_position (n)));
174 174
175 return Qnil; 175 return Qnil;
176 } 176 }
188 Lisp_Object n; 188 Lisp_Object n;
189 { 189 {
190 if (NILP (n)) 190 if (NILP (n))
191 XSETFASTINT (n, 1); 191 XSETFASTINT (n, 1);
192 else 192 else
193 CHECK_NUMBER (n, 0); 193 CHECK_NUMBER (n);
194 194
195 SET_PT (XINT (Fline_end_position (n))); 195 SET_PT (XINT (Fline_end_position (n)));
196 196
197 return Qnil; 197 return Qnil;
198 } 198 }
205 (n, killflag) 205 (n, killflag)
206 Lisp_Object n, killflag; 206 Lisp_Object n, killflag;
207 { 207 {
208 int pos; 208 int pos;
209 209
210 CHECK_NUMBER (n, 0); 210 CHECK_NUMBER (n);
211 211
212 pos = PT + XINT (n); 212 pos = PT + XINT (n);
213 if (NILP (killflag)) 213 if (NILP (killflag))
214 { 214 {
215 if (XINT (n) < 0) 215 if (XINT (n) < 0)
245 { 245 {
246 Lisp_Object value; 246 Lisp_Object value;
247 int deleted_special = 0; 247 int deleted_special = 0;
248 int pos, pos_byte, i; 248 int pos, pos_byte, i;
249 249
250 CHECK_NUMBER (n, 0); 250 CHECK_NUMBER (n);
251 251
252 /* See if we are about to delete a tab or newline backwards. */ 252 /* See if we are about to delete a tab or newline backwards. */
253 pos = PT; 253 pos = PT;
254 pos_byte = PT_BYTE; 254 pos_byte = PT_BYTE;
255 for (i = 0; i < XINT (n) && pos_byte > BEGV_BYTE; i++) 255 for (i = 0; i < XINT (n) && pos_byte > BEGV_BYTE; i++)
292 (n) 292 (n)
293 Lisp_Object n; 293 Lisp_Object n;
294 { 294 {
295 int character = XINT (last_command_char); 295 int character = XINT (last_command_char);
296 296
297 CHECK_NUMBER (n, 0); 297 CHECK_NUMBER (n);
298 298
299 /* Barf if the key that invoked this was not a character. */ 299 /* Barf if the key that invoked this was not a character. */
300 if (!INTEGERP (last_command_char)) 300 if (!INTEGERP (last_command_char))
301 bitch_at_user (); 301 bitch_at_user ();
302 else if (XINT (n) >= 2 && NILP (current_buffer->overwrite_mode)) 302 else if (XINT (n) >= 2 && NILP (current_buffer->overwrite_mode))