* src/character.h (CHARACTER_WIDTH): Rename from CHAR_WIDTH.
All uses changed.
static ptrdiff_t
char_width (int c, struct Lisp_Char_Table *dp)
{
- ptrdiff_t width = CHAR_WIDTH (c);
+ ptrdiff_t width = CHARACTER_WIDTH (c);
if (dp)
{
ch = AREF (disp, i);
if (CHARACTERP (ch))
{
- int w = CHAR_WIDTH (XFASTINT (ch));
+ int w = CHARACTER_WIDTH (XFASTINT (ch));
if (INT_ADD_WRAPV (width, w, &width))
string_overflow ();
}
/* Return the width of character C. The width is measured by how many
columns C will occupy on the screen when displayed in the current
- buffer. */
+ buffer. The name CHARACTER_WIDTH avoids a collision with <limits.h>
+ CHAR_WIDTH when enabled; see ISO/IEC TS 18661-1:2014. */
-#define CHAR_WIDTH(c) \
+#define CHARACTER_WIDTH(c) \
(ASCII_CHAR_P (c) \
? ASCII_CHAR_WIDTH (c) \
: sanitize_char_width (XINT (CHAR_TABLE_REF (Vchar_width_table, c))))
ch = XINT (key_contents[i]);
/* TAB in a composition means display glyphs with padding
space on the left or right. */
- this_width = (ch == '\t' ? 1 : CHAR_WIDTH (ch));
+ this_width = (ch == '\t' ? 1 : CHARACTER_WIDTH (ch));
if (cmp->width < this_width)
cmp->width = this_width;
}
double leftmost = 0.0, rightmost;
ch = XINT (key_contents[0]);
- rightmost = ch != '\t' ? CHAR_WIDTH (ch) : 1;
+ rightmost = ch != '\t' ? CHARACTER_WIDTH (ch) : 1;
for (i = 1; i < glyph_len; i += 2)
{
rule = XINT (key_contents[i]);
ch = XINT (key_contents[i + 1]);
- this_width = ch != '\t' ? CHAR_WIDTH (ch) : 1;
+ this_width = ch != '\t' ? CHARACTER_WIDTH (ch) : 1;
/* A composition rule is specified by an integer value
that encodes global and new reference points (GREF and
{
c = XINT (LGSTRING_CHAR (gstring, from + i));
cmp_it->nbytes += CHAR_BYTES (c);
- cmp_it->width += CHAR_WIDTH (c);
+ cmp_it->width += CHARACTER_WIDTH (c);
}
}
return c;
/* Indices of the glyphs for the current grapheme cluster. */
int from, to;
/* Width of the current grapheme cluster in units of columns it will
- occupy on display; see CHAR_WIDTH. */
+ occupy on display; see CHARACTER_WIDTH. */
int width;
};
if (dp != 0 && VECTORP (DISP_CHAR_VECTOR (dp, ch))) \
width = sanitize_char_width (ASIZE (DISP_CHAR_VECTOR (dp, ch))); \
else \
- width = CHAR_WIDTH (ch); \
+ width = CHARACTER_WIDTH (ch); \
} \
} while (0)
int ch_len;
int ch = STRING_CHAR_AND_LENGTH (p, ch_len);
- len += CHAR_WIDTH (ch);
+ len += CHARACTER_WIDTH (ch);
p += ch_len;
}
return len;
continue;
if (char_charset (c, charset_list, NULL))
{
- if (CHAR_WIDTH (c) == 0
+ if (CHARACTER_WIDTH (c) == 0
&& i > 0 && COMPOSITION_GLYPH (cmp, i - 1) == '\t')
/* Should be left-padded */
{
if (char_charset (it->char_to_display, charset_list, NULL))
{
- it->pixel_width = CHAR_WIDTH (it->char_to_display);
+ it->pixel_width = CHARACTER_WIDTH (it->char_to_display);
it->nglyphs = it->pixel_width;
if (it->glyph_row)
append_glyph (it);
}
else if (it->glyphless_method == GLYPHLESS_DISPLAY_EMPTY_BOX)
{
- len = CHAR_WIDTH (it->c);
+ len = CHARACTER_WIDTH (it->c);
if (len == 0)
len = 1;
else if (len > 4)
}
else if (it->glyphless_method == GLYPHLESS_DISPLAY_EMPTY_BOX)
{
- width = CHAR_WIDTH (it->c);
+ width = CHARACTER_WIDTH (it->c);
if (width == 0)
width = 1;
else if (width > 4)