aboutsummaryrefslogtreecommitdiffstats
path: root/src/indent.c
diff options
context:
space:
mode:
authorStefan Monnier2011-03-21 12:42:16 -0400
committerStefan Monnier2011-03-21 12:42:16 -0400
commitcafdcef32d55cbb44389d7e322e7f973cbb72dfd (patch)
tree7ee0c41ea8a589650ce6f4311fb10e61a63807b9 /src/indent.c
parenta08a25d7aaf251aa18f2ef747be53734bc55cae9 (diff)
parent4e05e67e4cd0bc1b0a4ef3176a4d0d91c6b3738e (diff)
downloademacs-cafdcef32d55cbb44389d7e322e7f973cbb72dfd.tar.gz
emacs-cafdcef32d55cbb44389d7e322e7f973cbb72dfd.zip
Merge from trunk
Diffstat (limited to 'src/indent.c')
-rw-r--r--src/indent.c34
1 files changed, 17 insertions, 17 deletions
diff --git a/src/indent.c b/src/indent.c
index 37ce647556d..baea0641948 100644
--- a/src/indent.c
+++ b/src/indent.c
@@ -274,20 +274,20 @@ skip_invisible (EMACS_INT pos, EMACS_INT *next_boundary_p, EMACS_INT to, Lisp_Ob
274 This macro is used in current_column_1, Fmove_to_column, and 274 This macro is used in current_column_1, Fmove_to_column, and
275 compute_motion. */ 275 compute_motion. */
276 276
277#define MULTIBYTE_BYTES_WIDTH(p, dp) \ 277#define MULTIBYTE_BYTES_WIDTH(p, dp, bytes, width) \
278 do { \ 278 do { \
279 int c; \ 279 int ch; \
280 \ 280 \
281 wide_column = 0; \ 281 wide_column = 0; \
282 c = STRING_CHAR_AND_LENGTH (p, bytes); \ 282 ch = STRING_CHAR_AND_LENGTH (p, bytes); \
283 if (BYTES_BY_CHAR_HEAD (*p) != bytes) \ 283 if (BYTES_BY_CHAR_HEAD (*p) != bytes) \
284 width = bytes * 4; \ 284 width = bytes * 4; \
285 else \ 285 else \
286 { \ 286 { \
287 if (dp != 0 && VECTORP (DISP_CHAR_VECTOR (dp, c))) \ 287 if (dp != 0 && VECTORP (DISP_CHAR_VECTOR (dp, ch))) \
288 width = XVECTOR (DISP_CHAR_VECTOR (dp, c))->size; \ 288 width = XVECTOR (DISP_CHAR_VECTOR (dp, ch))->size; \
289 else \ 289 else \
290 width = CHAR_WIDTH (c); \ 290 width = CHAR_WIDTH (ch); \
291 if (width > 1) \ 291 if (width > 1) \
292 wide_column = width; \ 292 wide_column = width; \
293 } \ 293 } \
@@ -569,14 +569,14 @@ scan_for_column (EMACS_INT *endpos, EMACS_INT *goalcol, EMACS_INT *prevcol)
569 prev_col = col; 569 prev_col = col;
570 570
571 { /* Check display property. */ 571 { /* Check display property. */
572 EMACS_INT end; 572 EMACS_INT endp;
573 int width = check_display_width (scan, col, &end); 573 int width = check_display_width (scan, col, &endp);
574 if (width >= 0) 574 if (width >= 0)
575 { 575 {
576 col += width; 576 col += width;
577 if (end > scan) /* Avoid infinite loops with 0-width overlays. */ 577 if (endp > scan) /* Avoid infinite loops with 0-width overlays. */
578 { 578 {
579 scan = end; scan_byte = charpos_to_bytepos (scan); 579 scan = endp; scan_byte = charpos_to_bytepos (scan);
580 continue; 580 continue;
581 } 581 }
582 } 582 }
@@ -669,7 +669,7 @@ scan_for_column (EMACS_INT *endpos, EMACS_INT *goalcol, EMACS_INT *prevcol)
669 int bytes, width, wide_column; 669 int bytes, width, wide_column;
670 670
671 ptr = BYTE_POS_ADDR (scan_byte); 671 ptr = BYTE_POS_ADDR (scan_byte);
672 MULTIBYTE_BYTES_WIDTH (ptr, dp); 672 MULTIBYTE_BYTES_WIDTH (ptr, dp, bytes, width);
673 /* Subtract one to compensate for the increment 673 /* Subtract one to compensate for the increment
674 that is going to happen below. */ 674 that is going to happen below. */
675 scan_byte += bytes - 1; 675 scan_byte += bytes - 1;
@@ -1657,15 +1657,15 @@ compute_motion (EMACS_INT from, EMACS_INT fromvpos, EMACS_INT fromhpos, int did_
1657 { 1657 {
1658 /* Start of multi-byte form. */ 1658 /* Start of multi-byte form. */
1659 unsigned char *ptr; 1659 unsigned char *ptr;
1660 int bytes, width, wide_column; 1660 int mb_bytes, mb_width, wide_column;
1661 1661
1662 pos_byte--; /* rewind POS_BYTE */ 1662 pos_byte--; /* rewind POS_BYTE */
1663 ptr = BYTE_POS_ADDR (pos_byte); 1663 ptr = BYTE_POS_ADDR (pos_byte);
1664 MULTIBYTE_BYTES_WIDTH (ptr, dp); 1664 MULTIBYTE_BYTES_WIDTH (ptr, dp, mb_bytes, mb_width);
1665 pos_byte += bytes; 1665 pos_byte += mb_bytes;
1666 if (wide_column) 1666 if (wide_column)
1667 wide_column_end_hpos = hpos + wide_column; 1667 wide_column_end_hpos = hpos + wide_column;
1668 hpos += width; 1668 hpos += mb_width;
1669 } 1669 }
1670 else if (VECTORP (charvec)) 1670 else if (VECTORP (charvec))
1671 ++hpos; 1671 ++hpos;
@@ -1995,7 +1995,7 @@ whether or not it is currently displayed in some window. */)
1995 Lisp_Object old_buffer; 1995 Lisp_Object old_buffer;
1996 struct gcpro gcpro1; 1996 struct gcpro gcpro1;
1997 Lisp_Object lcols = Qnil; 1997 Lisp_Object lcols = Qnil;
1998 double cols; 1998 double cols IF_LINT (= 0);
1999 1999
2000 /* Allow LINES to be of the form (HPOS . VPOS) aka (COLUMNS . LINES). */ 2000 /* Allow LINES to be of the form (HPOS . VPOS) aka (COLUMNS . LINES). */
2001 if (CONSP (lines) && (NUMBERP (XCAR (lines)))) 2001 if (CONSP (lines) && (NUMBERP (XCAR (lines))))
@@ -2029,7 +2029,7 @@ whether or not it is currently displayed in some window. */)
2029 } 2029 }
2030 else 2030 else
2031 { 2031 {
2032 int it_start, first_x, it_overshoot_expected; 2032 int it_start, first_x, it_overshoot_expected IF_LINT (= 0);
2033 2033
2034 SET_TEXT_POS (pt, PT, PT_BYTE); 2034 SET_TEXT_POS (pt, PT, PT_BYTE);
2035 start_display (&it, w, pt); 2035 start_display (&it, w, pt);