comparison src/indent.c @ 444:576fb035e263 r21-2-37

Import from CVS: tag r21-2-37
author cvs
date Mon, 13 Aug 2007 11:36:19 +0200
parents 8de8e3f6228a
children 183866b06e0b
comparison
equal deleted inserted replaced
443:a8296e22da4e 444:576fb035e263
270 } 270 }
271 271
272 272
273 DEFUN ("indent-to", Findent_to, 1, 3, "NIndent to column: ", /* 273 DEFUN ("indent-to", Findent_to, 1, 3, "NIndent to column: ", /*
274 Indent from point with tabs and spaces until COLUMN is reached. 274 Indent from point with tabs and spaces until COLUMN is reached.
275 Optional second argument MIN says always do at least MIN spaces 275 Optional second argument MINIMUM says always do at least MINIMUM spaces
276 even if that goes past COLUMN; by default, MIN is zero. 276 even if that goes past COLUMN; by default, MINIMUM is zero.
277 If BUFFER is nil, the current buffer is assumed. 277 If BUFFER is nil, the current buffer is assumed.
278 */ 278 */
279 (col, minimum, buffer)) 279 (column, minimum, buffer))
280 { 280 {
281 /* This function can GC */ 281 /* This function can GC */
282 int mincol; 282 int mincol;
283 int fromcol; 283 int fromcol;
284 struct buffer *buf = decode_buffer (buffer, 0); 284 struct buffer *buf = decode_buffer (buffer, 0);
285 int tab_width = XINT (buf->tab_width); 285 int tab_width = XINT (buf->tab_width);
286 Bufpos opoint = 0; 286 Bufpos opoint = 0;
287 287
288 CHECK_INT (col); 288 CHECK_INT (column);
289 if (NILP (minimum)) 289 if (NILP (minimum))
290 minimum = Qzero; 290 minimum = Qzero;
291 else 291 else
292 CHECK_INT (minimum); 292 CHECK_INT (minimum);
293 293
294 XSETBUFFER (buffer, buf); 294 XSETBUFFER (buffer, buf);
295 295
296 fromcol = current_column (buf); 296 fromcol = current_column (buf);
297 mincol = fromcol + XINT (minimum); 297 mincol = fromcol + XINT (minimum);
298 if (mincol < XINT (col)) mincol = XINT (col); 298 if (mincol < XINT (column)) mincol = XINT (column);
299 299
300 if (fromcol == mincol) 300 if (fromcol == mincol)
301 return make_int (mincol); 301 return make_int (mincol);
302 302
303 if (tab_width <= 0 || tab_width > 1000) tab_width = 8; 303 if (tab_width <= 0 || tab_width > 1000) tab_width = 8;