Mercurial > hg > xemacs-beta
diff src/indent.c @ 16:0293115a14e9 r19-15b91
Import from CVS: tag r19-15b91
author | cvs |
---|---|
date | Mon, 13 Aug 2007 08:49:20 +0200 |
parents | 376386a54a3c |
children | 859a2309aef8 |
line wrap: on
line diff
--- a/src/indent.c Mon Aug 13 08:48:43 2007 +0200 +++ b/src/indent.c Mon Aug 13 08:49:20 2007 +0200 @@ -129,6 +129,7 @@ int tab_width = XINT (buf->tab_width); int post_tab; Bufpos pos = init_pos; + Emchar c; if (tab_width <= 0 || tab_width > 1000) tab_width = 8; col = tab_seen = post_tab = 0; @@ -139,7 +140,8 @@ break; pos--; - if (BUF_FETCH_CHAR (buf, pos) == '\t') + c = BUF_FETCH_CHAR (buf, pos); + if (c == '\t') { if (tab_seen) col = ((col + tab_width) / tab_width) * tab_width; @@ -148,9 +150,8 @@ col = 0; tab_seen = 1; } - else if (BUF_FETCH_CHAR (buf, pos) == '\n' || - (EQ (buf->selective_display, Qt) && - BUF_FETCH_CHAR (buf, pos) == '\r')) + else if (c == '\n' || + (EQ (buf->selective_display, Qt) && c == '\r')) break; else { @@ -164,9 +165,9 @@ col += (displayed_glyphs->columns - (displayed_glyphs->begin_columns + displayed_glyphs->end_columns)); -#else - col++; -#endif +#else /* XEmacs */ + col ++; +#endif /* XEmacs */ } } @@ -358,7 +359,7 @@ int tab_width = XINT (buf->tab_width); int prev_col = 0; - Emchar c = 0; + Emchar c; XSETBUFFER (buffer, buf); if (tab_width <= 0 || tab_width > 1000) tab_width = 8; @@ -403,9 +404,9 @@ col += (displayed_glyphs->columns - (displayed_glyphs->begin_columns + displayed_glyphs->end_columns)); -#else - col++; -#endif +#else /* XEmacs */ + col ++; +#endif /* XEmacs */ } pos++;