Commit 409f2919 authored by Juanma Barranquero's avatar Juanma Barranquero
Browse files

Remove obsolete macro BASE_LEADING_CODE_P.

* character.h (BASE_LEADING_CODE_P): Remove.
* regex.c [!emacs] (BASE_LEADING_CODE_P): Remove.
* buffer.c (Fset_buffer_multibyte):
* indent.c (scan_for_column, compute_motion):
* insdel.c (count_combining_before, count_combining_after):
  Use LEADING_CODE_P instead of BASE_LEADING_CODE_P.
parent 0665f661
2010-06-05 Juanma Barranquero <lekktu@gmail.com>
Remove obsolete macro BASE_LEADING_CODE_P.
* character.h (BASE_LEADING_CODE_P): Remove.
* regex.c [!emacs] (BASE_LEADING_CODE_P): Remove.
* buffer.c (Fset_buffer_multibyte):
* indent.c (scan_for_column, compute_motion):
* insdel.c (count_combining_before, count_combining_after):
Use LEADING_CODE_P instead of BASE_LEADING_CODE_P.
2010-06-04 Juanma Barranquero <lekktu@gmail.com> 2010-06-04 Juanma Barranquero <lekktu@gmail.com>
Turn `directory-sep-char' into a noop. Turn `directory-sep-char' into a noop.
......
...@@ -2189,7 +2189,7 @@ DEFUN ("buffer-swap-text", Fbuffer_swap_text, Sbuffer_swap_text, ...@@ -2189,7 +2189,7 @@ DEFUN ("buffer-swap-text", Fbuffer_swap_text, Sbuffer_swap_text,
other_buffer = XBUFFER (buffer); other_buffer = XBUFFER (buffer);
if (NILP (other_buffer->name)) if (NILP (other_buffer->name))
error ("Cannot swap a dead buffer's text"); error ("Cannot swap a dead buffer's text");
/* Actually, it probably works just fine. /* Actually, it probably works just fine.
* if (other_buffer == current_buffer) * if (other_buffer == current_buffer)
...@@ -2436,7 +2436,7 @@ current buffer is cleared. */) ...@@ -2436,7 +2436,7 @@ current buffer is cleared. */)
unsigned char *p = GPT_ADDR - 1; unsigned char *p = GPT_ADDR - 1;
while (! CHAR_HEAD_P (*p) && p > BEG_ADDR) p--; while (! CHAR_HEAD_P (*p) && p > BEG_ADDR) p--;
if (BASE_LEADING_CODE_P (*p)) if (LEADING_CODE_P (*p))
{ {
int new_gpt = GPT_BYTE - (GPT_ADDR - p); int new_gpt = GPT_BYTE - (GPT_ADDR - p);
...@@ -4339,7 +4339,7 @@ add_overlay_mod_hooklist (functionlist, overlay) ...@@ -4339,7 +4339,7 @@ add_overlay_mod_hooklist (functionlist, overlay)
int oldsize = XVECTOR (last_overlay_modification_hooks)->size; int oldsize = XVECTOR (last_overlay_modification_hooks)->size;
if (last_overlay_modification_hooks_used == oldsize) if (last_overlay_modification_hooks_used == oldsize)
last_overlay_modification_hooks = larger_vector last_overlay_modification_hooks = larger_vector
(last_overlay_modification_hooks, oldsize * 2, Qnil); (last_overlay_modification_hooks, oldsize * 2, Qnil);
ASET (last_overlay_modification_hooks, last_overlay_modification_hooks_used, ASET (last_overlay_modification_hooks, last_overlay_modification_hooks_used,
functionlist); last_overlay_modification_hooks_used++; functionlist); last_overlay_modification_hooks_used++;
......
...@@ -221,10 +221,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ ...@@ -221,10 +221,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
(ASCII_BYTE_P (byte) || LEADING_CODE_P (byte)) */ (ASCII_BYTE_P (byte) || LEADING_CODE_P (byte)) */
#define CHAR_HEAD_P(byte) (((byte) & 0xC0) != 0x80) #define CHAR_HEAD_P(byte) (((byte) & 0xC0) != 0x80)
/* Kept for backward compatibility. This macro will be removed in the
future. */
#define BASE_LEADING_CODE_P LEADING_CODE_P
/* How many bytes a character that starts with BYTE occupies in a /* How many bytes a character that starts with BYTE occupies in a
multibyte form. */ multibyte form. */
#define BYTES_BY_CHAR_HEAD(byte) \ #define BYTES_BY_CHAR_HEAD(byte) \
...@@ -591,7 +587,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ ...@@ -591,7 +587,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
: 0) : 0)
/* If C is a high surrogate, return 1. If C is a low surrogate, /* If C is a high surrogate, return 1. If C is a low surrogate,
return 0. Otherwise, return 0. */ return 0. Otherwise, return 0. */
#define CHAR_SURROGATE_PAIR_P(c) \ #define CHAR_SURROGATE_PAIR_P(c) \
((c) < 0xD800 ? 0 \ ((c) < 0xD800 ? 0 \
......
...@@ -506,7 +506,7 @@ check_display_width (EMACS_INT pos, EMACS_INT col, EMACS_INT *endpos) ...@@ -506,7 +506,7 @@ check_display_width (EMACS_INT pos, EMACS_INT col, EMACS_INT *endpos)
width = XINT (prop) - col; width = XINT (prop) - col;
else if (FLOATP (prop)) else if (FLOATP (prop))
width = (int)(XFLOAT_DATA (prop) + 0.5) - col; width = (int)(XFLOAT_DATA (prop) + 0.5) - col;
if (width >= 0) if (width >= 0)
{ {
EMACS_INT start; EMACS_INT start;
...@@ -628,7 +628,7 @@ scan_for_column (EMACS_INT *endpos, EMACS_INT *goalcol, EMACS_INT *prevcol) ...@@ -628,7 +628,7 @@ scan_for_column (EMACS_INT *endpos, EMACS_INT *goalcol, EMACS_INT *prevcol)
to this character. */ to this character. */
if (dp != 0 if (dp != 0
&& ! (multibyte && BASE_LEADING_CODE_P (c)) && ! (multibyte && LEADING_CODE_P (c))
&& VECTORP (DISP_CHAR_VECTOR (dp, c))) && VECTORP (DISP_CHAR_VECTOR (dp, c)))
{ {
Lisp_Object charvec; Lisp_Object charvec;
...@@ -679,7 +679,7 @@ scan_for_column (EMACS_INT *endpos, EMACS_INT *goalcol, EMACS_INT *prevcol) ...@@ -679,7 +679,7 @@ scan_for_column (EMACS_INT *endpos, EMACS_INT *goalcol, EMACS_INT *prevcol)
col += tab_width; col += tab_width;
col = col / tab_width * tab_width; col = col / tab_width * tab_width;
} }
else if (multibyte && BASE_LEADING_CODE_P (c)) else if (multibyte && LEADING_CODE_P (c))
{ {
/* Start of multi-byte form. */ /* Start of multi-byte form. */
unsigned char *ptr; unsigned char *ptr;
...@@ -1577,7 +1577,7 @@ compute_motion (from, fromvpos, fromhpos, did_motion, to, tovpos, tohpos, width, ...@@ -1577,7 +1577,7 @@ compute_motion (from, fromvpos, fromhpos, did_motion, to, tovpos, tohpos, width,
} }
if (dp != 0 if (dp != 0
&& ! (multibyte && BASE_LEADING_CODE_P (c)) && ! (multibyte && LEADING_CODE_P (c))
&& VECTORP (DISP_CHAR_VECTOR (dp, c))) && VECTORP (DISP_CHAR_VECTOR (dp, c)))
{ {
charvec = DISP_CHAR_VECTOR (dp, c); charvec = DISP_CHAR_VECTOR (dp, c);
...@@ -1683,7 +1683,7 @@ compute_motion (from, fromvpos, fromhpos, did_motion, to, tovpos, tohpos, width, ...@@ -1683,7 +1683,7 @@ compute_motion (from, fromvpos, fromhpos, did_motion, to, tovpos, tohpos, width,
hpos = width; hpos = width;
} }
} }
else if (multibyte && BASE_LEADING_CODE_P (c)) else if (multibyte && LEADING_CODE_P (c))
{ {
/* Start of multi-byte form. */ /* Start of multi-byte form. */
unsigned char *ptr; unsigned char *ptr;
......
...@@ -437,7 +437,7 @@ adjust_markers_for_insert (EMACS_INT from, EMACS_INT from_byte, ...@@ -437,7 +437,7 @@ adjust_markers_for_insert (EMACS_INT from, EMACS_INT from_byte,
} }
/* Adjusting only markers whose insertion-type is t may result in /* Adjusting only markers whose insertion-type is t may result in
- disordered start and end in overlays, and - disordered start and end in overlays, and
- disordered overlays in the slot `overlays_before' of current_buffer. */ - disordered overlays in the slot `overlays_before' of current_buffer. */
if (adjusted) if (adjusted)
{ {
...@@ -843,7 +843,7 @@ count_combining_before (const unsigned char *string, EMACS_INT length, ...@@ -843,7 +843,7 @@ count_combining_before (const unsigned char *string, EMACS_INT length,
len = 1; len = 1;
p = BYTE_POS_ADDR (pos_byte - 1); p = BYTE_POS_ADDR (pos_byte - 1);
while (! CHAR_HEAD_P (*p)) p--, len++; while (! CHAR_HEAD_P (*p)) p--, len++;
if (! BASE_LEADING_CODE_P (*p)) /* case (3) */ if (! LEADING_CODE_P (*p)) /* case (3) */
return 0; return 0;
combining_bytes = BYTES_BY_CHAR_HEAD (*p) - len; combining_bytes = BYTES_BY_CHAR_HEAD (*p) - len;
...@@ -906,7 +906,7 @@ count_combining_after (const unsigned char *string, ...@@ -906,7 +906,7 @@ count_combining_after (const unsigned char *string,
i = pos_byte - 2; i = pos_byte - 2;
while (i >= 0 && ! CHAR_HEAD_P (p[i])) while (i >= 0 && ! CHAR_HEAD_P (p[i]))
i--; i--;
if (i < 0 || !BASE_LEADING_CODE_P (p[i])) if (i < 0 || !LEADING_CODE_P (p[i]))
return 0; return 0;
bytes = BYTES_BY_CHAR_HEAD (p[i]); bytes = BYTES_BY_CHAR_HEAD (p[i]);
...@@ -914,7 +914,7 @@ count_combining_after (const unsigned char *string, ...@@ -914,7 +914,7 @@ count_combining_after (const unsigned char *string,
? 0 ? 0
: bytes - (pos_byte - 1 - i + length)); : bytes - (pos_byte - 1 - i + length));
} }
if (!BASE_LEADING_CODE_P (string[i])) if (!LEADING_CODE_P (string[i]))
return 0; return 0;
bytes = BYTES_BY_CHAR_HEAD (string[i]) - (length - i); bytes = BYTES_BY_CHAR_HEAD (string[i]) - (length - i);
......
...@@ -290,7 +290,6 @@ enum syntaxcode { Swhitespace = 0, Sword = 1, Ssymbol = 2 }; ...@@ -290,7 +290,6 @@ enum syntaxcode { Swhitespace = 0, Sword = 1, Ssymbol = 2 };
# define SWITCH_ENUM_CAST(x) (x) # define SWITCH_ENUM_CAST(x) (x)
/* Dummy macros for non-Emacs environments. */ /* Dummy macros for non-Emacs environments. */
# define BASE_LEADING_CODE_P(c) (0)
# define CHAR_CHARSET(c) 0 # define CHAR_CHARSET(c) 0
# define CHARSET_LEADING_CODE_BASE(c) 0 # define CHARSET_LEADING_CODE_BASE(c) 0
# define MAX_MULTIBYTE_LENGTH 1 # define MAX_MULTIBYTE_LENGTH 1
...@@ -3805,7 +3804,7 @@ regex_compile (pattern, size, syntax, bufp) ...@@ -3805,7 +3804,7 @@ regex_compile (pattern, size, syntax, bufp)
if (c1 != c2 && (c1 = RE_CHAR_TO_UNIBYTE (c2)) >= 0) if (c1 != c2 && (c1 = RE_CHAR_TO_UNIBYTE (c2)) >= 0)
c = c1; c = c1;
} }
*b++ = c; *b++ = c;
len = 1; len = 1;
} }
...@@ -4125,7 +4124,7 @@ analyse_first (p, pend, fastmap, multibyte) ...@@ -4125,7 +4124,7 @@ analyse_first (p, pend, fastmap, multibyte)
if (/* Any leading code can possibly start a character if (/* Any leading code can possibly start a character
which doesn't match the specified set of characters. */ which doesn't match the specified set of characters. */
not not
|| ||
/* If we can match a character class, we can match any /* If we can match a character class, we can match any
multibyte characters. */ multibyte characters. */
(CHARSET_RANGE_TABLE_EXISTS_P (&p[-2]) (CHARSET_RANGE_TABLE_EXISTS_P (&p[-2])
......
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