aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJuanma Barranquero2010-06-05 02:41:32 +0200
committerJuanma Barranquero2010-06-05 02:41:32 +0200
commit409f29191382c875a05516cc69bf3cc4e3cd4592 (patch)
treee95e30a281267b22136c827ebcfc59f9d3994517
parent0665f66133e1991559c58ab57112becf1c9fb70e (diff)
downloademacs-409f29191382c875a05516cc69bf3cc4e3cd4592.tar.gz
emacs-409f29191382c875a05516cc69bf3cc4e3cd4592.zip
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.
-rw-r--r--src/ChangeLog10
-rw-r--r--src/buffer.c6
-rw-r--r--src/character.h6
-rw-r--r--src/indent.c10
-rw-r--r--src/insdel.c8
-rw-r--r--src/regex.c5
6 files changed, 25 insertions, 20 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index d938bd57fd7..e7ac2d066b0 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,13 @@
12010-06-05 Juanma Barranquero <lekktu@gmail.com>
2
3 Remove obsolete macro BASE_LEADING_CODE_P.
4 * character.h (BASE_LEADING_CODE_P): Remove.
5 * regex.c [!emacs] (BASE_LEADING_CODE_P): Remove.
6 * buffer.c (Fset_buffer_multibyte):
7 * indent.c (scan_for_column, compute_motion):
8 * insdel.c (count_combining_before, count_combining_after):
9 Use LEADING_CODE_P instead of BASE_LEADING_CODE_P.
10
12010-06-04 Juanma Barranquero <lekktu@gmail.com> 112010-06-04 Juanma Barranquero <lekktu@gmail.com>
2 12
3 Turn `directory-sep-char' into a noop. 13 Turn `directory-sep-char' into a noop.
diff --git a/src/buffer.c b/src/buffer.c
index 3762b33bdaf..589266f40e5 100644
--- a/src/buffer.c
+++ b/src/buffer.c
@@ -2189,7 +2189,7 @@ DEFUN ("buffer-swap-text", Fbuffer_swap_text, Sbuffer_swap_text,
2189 other_buffer = XBUFFER (buffer); 2189 other_buffer = XBUFFER (buffer);
2190 2190
2191 if (NILP (other_buffer->name)) 2191 if (NILP (other_buffer->name))
2192 error ("Cannot swap a dead buffer's text"); 2192 error ("Cannot swap a dead buffer's text");
2193 2193
2194 /* Actually, it probably works just fine. 2194 /* Actually, it probably works just fine.
2195 * if (other_buffer == current_buffer) 2195 * if (other_buffer == current_buffer)
@@ -2436,7 +2436,7 @@ current buffer is cleared. */)
2436 unsigned char *p = GPT_ADDR - 1; 2436 unsigned char *p = GPT_ADDR - 1;
2437 2437
2438 while (! CHAR_HEAD_P (*p) && p > BEG_ADDR) p--; 2438 while (! CHAR_HEAD_P (*p) && p > BEG_ADDR) p--;
2439 if (BASE_LEADING_CODE_P (*p)) 2439 if (LEADING_CODE_P (*p))
2440 { 2440 {
2441 int new_gpt = GPT_BYTE - (GPT_ADDR - p); 2441 int new_gpt = GPT_BYTE - (GPT_ADDR - p);
2442 2442
@@ -4339,7 +4339,7 @@ add_overlay_mod_hooklist (functionlist, overlay)
4339 int oldsize = XVECTOR (last_overlay_modification_hooks)->size; 4339 int oldsize = XVECTOR (last_overlay_modification_hooks)->size;
4340 4340
4341 if (last_overlay_modification_hooks_used == oldsize) 4341 if (last_overlay_modification_hooks_used == oldsize)
4342 last_overlay_modification_hooks = larger_vector 4342 last_overlay_modification_hooks = larger_vector
4343 (last_overlay_modification_hooks, oldsize * 2, Qnil); 4343 (last_overlay_modification_hooks, oldsize * 2, Qnil);
4344 ASET (last_overlay_modification_hooks, last_overlay_modification_hooks_used, 4344 ASET (last_overlay_modification_hooks, last_overlay_modification_hooks_used,
4345 functionlist); last_overlay_modification_hooks_used++; 4345 functionlist); last_overlay_modification_hooks_used++;
diff --git a/src/character.h b/src/character.h
index d5404a576ad..c2942954351 100644
--- a/src/character.h
+++ b/src/character.h
@@ -221,10 +221,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
221 (ASCII_BYTE_P (byte) || LEADING_CODE_P (byte)) */ 221 (ASCII_BYTE_P (byte) || LEADING_CODE_P (byte)) */
222#define CHAR_HEAD_P(byte) (((byte) & 0xC0) != 0x80) 222#define CHAR_HEAD_P(byte) (((byte) & 0xC0) != 0x80)
223 223
224/* Kept for backward compatibility. This macro will be removed in the
225 future. */
226#define BASE_LEADING_CODE_P LEADING_CODE_P
227
228/* How many bytes a character that starts with BYTE occupies in a 224/* How many bytes a character that starts with BYTE occupies in a
229 multibyte form. */ 225 multibyte form. */
230#define BYTES_BY_CHAR_HEAD(byte) \ 226#define BYTES_BY_CHAR_HEAD(byte) \
@@ -591,7 +587,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
591 : 0) 587 : 0)
592 588
593/* If C is a high surrogate, return 1. If C is a low surrogate, 589/* If C is a high surrogate, return 1. If C is a low surrogate,
594 return 0. Otherwise, return 0. */ 590 return 0. Otherwise, return 0. */
595 591
596#define CHAR_SURROGATE_PAIR_P(c) \ 592#define CHAR_SURROGATE_PAIR_P(c) \
597 ((c) < 0xD800 ? 0 \ 593 ((c) < 0xD800 ? 0 \
diff --git a/src/indent.c b/src/indent.c
index a7f41f7e8e4..b64eae1c429 100644
--- a/src/indent.c
+++ b/src/indent.c
@@ -506,7 +506,7 @@ check_display_width (EMACS_INT pos, EMACS_INT col, EMACS_INT *endpos)
506 width = XINT (prop) - col; 506 width = XINT (prop) - col;
507 else if (FLOATP (prop)) 507 else if (FLOATP (prop))
508 width = (int)(XFLOAT_DATA (prop) + 0.5) - col; 508 width = (int)(XFLOAT_DATA (prop) + 0.5) - col;
509 509
510 if (width >= 0) 510 if (width >= 0)
511 { 511 {
512 EMACS_INT start; 512 EMACS_INT start;
@@ -628,7 +628,7 @@ scan_for_column (EMACS_INT *endpos, EMACS_INT *goalcol, EMACS_INT *prevcol)
628 to this character. */ 628 to this character. */
629 629
630 if (dp != 0 630 if (dp != 0
631 && ! (multibyte && BASE_LEADING_CODE_P (c)) 631 && ! (multibyte && LEADING_CODE_P (c))
632 && VECTORP (DISP_CHAR_VECTOR (dp, c))) 632 && VECTORP (DISP_CHAR_VECTOR (dp, c)))
633 { 633 {
634 Lisp_Object charvec; 634 Lisp_Object charvec;
@@ -679,7 +679,7 @@ scan_for_column (EMACS_INT *endpos, EMACS_INT *goalcol, EMACS_INT *prevcol)
679 col += tab_width; 679 col += tab_width;
680 col = col / tab_width * tab_width; 680 col = col / tab_width * tab_width;
681 } 681 }
682 else if (multibyte && BASE_LEADING_CODE_P (c)) 682 else if (multibyte && LEADING_CODE_P (c))
683 { 683 {
684 /* Start of multi-byte form. */ 684 /* Start of multi-byte form. */
685 unsigned char *ptr; 685 unsigned char *ptr;
@@ -1577,7 +1577,7 @@ compute_motion (from, fromvpos, fromhpos, did_motion, to, tovpos, tohpos, width,
1577 } 1577 }
1578 1578
1579 if (dp != 0 1579 if (dp != 0
1580 && ! (multibyte && BASE_LEADING_CODE_P (c)) 1580 && ! (multibyte && LEADING_CODE_P (c))
1581 && VECTORP (DISP_CHAR_VECTOR (dp, c))) 1581 && VECTORP (DISP_CHAR_VECTOR (dp, c)))
1582 { 1582 {
1583 charvec = DISP_CHAR_VECTOR (dp, c); 1583 charvec = DISP_CHAR_VECTOR (dp, c);
@@ -1683,7 +1683,7 @@ compute_motion (from, fromvpos, fromhpos, did_motion, to, tovpos, tohpos, width,
1683 hpos = width; 1683 hpos = width;
1684 } 1684 }
1685 } 1685 }
1686 else if (multibyte && BASE_LEADING_CODE_P (c)) 1686 else if (multibyte && LEADING_CODE_P (c))
1687 { 1687 {
1688 /* Start of multi-byte form. */ 1688 /* Start of multi-byte form. */
1689 unsigned char *ptr; 1689 unsigned char *ptr;
diff --git a/src/insdel.c b/src/insdel.c
index 6cc797a12ff..2b00de88711 100644
--- a/src/insdel.c
+++ b/src/insdel.c
@@ -437,7 +437,7 @@ adjust_markers_for_insert (EMACS_INT from, EMACS_INT from_byte,
437 } 437 }
438 438
439 /* Adjusting only markers whose insertion-type is t may result in 439 /* Adjusting only markers whose insertion-type is t may result in
440 - disordered start and end in overlays, and 440 - disordered start and end in overlays, and
441 - disordered overlays in the slot `overlays_before' of current_buffer. */ 441 - disordered overlays in the slot `overlays_before' of current_buffer. */
442 if (adjusted) 442 if (adjusted)
443 { 443 {
@@ -843,7 +843,7 @@ count_combining_before (const unsigned char *string, EMACS_INT length,
843 len = 1; 843 len = 1;
844 p = BYTE_POS_ADDR (pos_byte - 1); 844 p = BYTE_POS_ADDR (pos_byte - 1);
845 while (! CHAR_HEAD_P (*p)) p--, len++; 845 while (! CHAR_HEAD_P (*p)) p--, len++;
846 if (! BASE_LEADING_CODE_P (*p)) /* case (3) */ 846 if (! LEADING_CODE_P (*p)) /* case (3) */
847 return 0; 847 return 0;
848 848
849 combining_bytes = BYTES_BY_CHAR_HEAD (*p) - len; 849 combining_bytes = BYTES_BY_CHAR_HEAD (*p) - len;
@@ -906,7 +906,7 @@ count_combining_after (const unsigned char *string,
906 i = pos_byte - 2; 906 i = pos_byte - 2;
907 while (i >= 0 && ! CHAR_HEAD_P (p[i])) 907 while (i >= 0 && ! CHAR_HEAD_P (p[i]))
908 i--; 908 i--;
909 if (i < 0 || !BASE_LEADING_CODE_P (p[i])) 909 if (i < 0 || !LEADING_CODE_P (p[i]))
910 return 0; 910 return 0;
911 911
912 bytes = BYTES_BY_CHAR_HEAD (p[i]); 912 bytes = BYTES_BY_CHAR_HEAD (p[i]);
@@ -914,7 +914,7 @@ count_combining_after (const unsigned char *string,
914 ? 0 914 ? 0
915 : bytes - (pos_byte - 1 - i + length)); 915 : bytes - (pos_byte - 1 - i + length));
916 } 916 }
917 if (!BASE_LEADING_CODE_P (string[i])) 917 if (!LEADING_CODE_P (string[i]))
918 return 0; 918 return 0;
919 919
920 bytes = BYTES_BY_CHAR_HEAD (string[i]) - (length - i); 920 bytes = BYTES_BY_CHAR_HEAD (string[i]) - (length - i);
diff --git a/src/regex.c b/src/regex.c
index 5981d5b3de4..c8b6958acdc 100644
--- a/src/regex.c
+++ b/src/regex.c
@@ -290,7 +290,6 @@ enum syntaxcode { Swhitespace = 0, Sword = 1, Ssymbol = 2 };
290# define SWITCH_ENUM_CAST(x) (x) 290# define SWITCH_ENUM_CAST(x) (x)
291 291
292/* Dummy macros for non-Emacs environments. */ 292/* Dummy macros for non-Emacs environments. */
293# define BASE_LEADING_CODE_P(c) (0)
294# define CHAR_CHARSET(c) 0 293# define CHAR_CHARSET(c) 0
295# define CHARSET_LEADING_CODE_BASE(c) 0 294# define CHARSET_LEADING_CODE_BASE(c) 0
296# define MAX_MULTIBYTE_LENGTH 1 295# define MAX_MULTIBYTE_LENGTH 1
@@ -3805,7 +3804,7 @@ regex_compile (pattern, size, syntax, bufp)
3805 3804
3806 if (c1 != c2 && (c1 = RE_CHAR_TO_UNIBYTE (c2)) >= 0) 3805 if (c1 != c2 && (c1 = RE_CHAR_TO_UNIBYTE (c2)) >= 0)
3807 c = c1; 3806 c = c1;
3808 } 3807 }
3809 *b++ = c; 3808 *b++ = c;
3810 len = 1; 3809 len = 1;
3811 } 3810 }
@@ -4125,7 +4124,7 @@ analyse_first (p, pend, fastmap, multibyte)
4125 if (/* Any leading code can possibly start a character 4124 if (/* Any leading code can possibly start a character
4126 which doesn't match the specified set of characters. */ 4125 which doesn't match the specified set of characters. */
4127 not 4126 not
4128 || 4127 ||
4129 /* If we can match a character class, we can match any 4128 /* If we can match a character class, we can match any
4130 multibyte characters. */ 4129 multibyte characters. */
4131 (CHARSET_RANGE_TABLE_EXISTS_P (&p[-2]) 4130 (CHARSET_RANGE_TABLE_EXISTS_P (&p[-2])