Commit 85f24f61 authored by Paul Eggert's avatar Paul Eggert

* indent.c (MULTIBYTE_BYTES_WIDTH): New args bytes, width.

All uses changed.
(MULTIBYTE_BYTES_WIDTH, scan_for_column, compute_motion):
Rename locals to avoid shadowing.
parent e45a141a
2011-03-15 Paul Eggert <eggert@cs.ucla.edu>
* indent.c (MULTIBYTE_BYTES_WIDTH): New args bytes, width.
All uses changed.
(MULTIBYTE_BYTES_WIDTH, scan_for_column, compute_motion):
Rename locals to avoid shadowing.
* casefiddle.c (casify_object, casify_region): Now static.
(casify_region): Mark local as initialized.
......@@ -274,20 +274,20 @@ skip_invisible (EMACS_INT pos, EMACS_INT *next_boundary_p, EMACS_INT to, Lisp_Ob
This macro is used in current_column_1, Fmove_to_column, and
compute_motion. */
#define MULTIBYTE_BYTES_WIDTH(p, dp) \
#define MULTIBYTE_BYTES_WIDTH(p, dp, bytes, width) \
do { \
int c; \
int ch; \
\
wide_column = 0; \
c = STRING_CHAR_AND_LENGTH (p, bytes); \
ch = STRING_CHAR_AND_LENGTH (p, bytes); \
if (BYTES_BY_CHAR_HEAD (*p) != bytes) \
width = bytes * 4; \
else \
{ \
if (dp != 0 && VECTORP (DISP_CHAR_VECTOR (dp, c))) \
width = XVECTOR (DISP_CHAR_VECTOR (dp, c))->size; \
if (dp != 0 && VECTORP (DISP_CHAR_VECTOR (dp, ch))) \
width = XVECTOR (DISP_CHAR_VECTOR (dp, ch))->size; \
else \
width = CHAR_WIDTH (c); \
width = CHAR_WIDTH (ch); \
if (width > 1) \
wide_column = width; \
} \
......@@ -569,14 +569,14 @@ scan_for_column (EMACS_INT *endpos, EMACS_INT *goalcol, EMACS_INT *prevcol)
prev_col = col;
{ /* Check display property. */
EMACS_INT end;
int width = check_display_width (scan, col, &end);
EMACS_INT endp;
int width = check_display_width (scan, col, &endp);
if (width >= 0)
{
col += width;
if (end > scan) /* Avoid infinite loops with 0-width overlays. */
if (endp > scan) /* Avoid infinite loops with 0-width overlays. */
{
scan = end; scan_byte = charpos_to_bytepos (scan);
scan = endp; scan_byte = charpos_to_bytepos (scan);
continue;
}
}
......@@ -669,7 +669,7 @@ scan_for_column (EMACS_INT *endpos, EMACS_INT *goalcol, EMACS_INT *prevcol)
int bytes, width, wide_column;
ptr = BYTE_POS_ADDR (scan_byte);
MULTIBYTE_BYTES_WIDTH (ptr, dp);
MULTIBYTE_BYTES_WIDTH (ptr, dp, bytes, width);
/* Subtract one to compensate for the increment
that is going to happen below. */
scan_byte += bytes - 1;
......@@ -1657,15 +1657,15 @@ compute_motion (EMACS_INT from, EMACS_INT fromvpos, EMACS_INT fromhpos, int did_
{
/* Start of multi-byte form. */
unsigned char *ptr;
int bytes, width, wide_column;
int mb_bytes, mb_width, wide_column;
pos_byte--; /* rewind POS_BYTE */
ptr = BYTE_POS_ADDR (pos_byte);
MULTIBYTE_BYTES_WIDTH (ptr, dp);
pos_byte += bytes;
MULTIBYTE_BYTES_WIDTH (ptr, dp, mb_bytes, mb_width);
pos_byte += mb_bytes;
if (wide_column)
wide_column_end_hpos = hpos + wide_column;
hpos += width;
hpos += mb_width;
}
else if (VECTORP (charvec))
++hpos;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment