aboutsummaryrefslogtreecommitdiffstats
path: root/src/buffer.h
diff options
context:
space:
mode:
authorJoakim Verona2014-06-04 23:50:06 +0200
committerJoakim Verona2014-06-04 23:50:06 +0200
commitce8171797dafbde765170b79e5f154afc4872e86 (patch)
tree264b357b484de24929a3f2d20a34e0e43c006a15 /src/buffer.h
parentc1c9aa247cab9148916b367e719219ea0f055adb (diff)
parentb5d6fe3bf6e728c82a3ff63723d75519f7853716 (diff)
downloademacs-ce8171797dafbde765170b79e5f154afc4872e86.tar.gz
emacs-ce8171797dafbde765170b79e5f154afc4872e86.zip
upstream
Diffstat (limited to 'src/buffer.h')
-rw-r--r--src/buffer.h126
1 files changed, 66 insertions, 60 deletions
diff --git a/src/buffer.h b/src/buffer.h
index 169a15c7d0f..5c1e1bb278c 100644
--- a/src/buffer.h
+++ b/src/buffer.h
@@ -1,6 +1,6 @@
1/* Header file for the buffer manipulation primitives. 1/* Header file for the buffer manipulation primitives.
2 2
3Copyright (C) 1985-1986, 1993-1995, 1997-2013 Free Software Foundation, 3Copyright (C) 1985-1986, 1993-1995, 1997-2014 Free Software Foundation,
4Inc. 4Inc.
5 5
6This file is part of GNU Emacs. 6This file is part of GNU Emacs.
@@ -22,9 +22,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
22#include <time.h> 22#include <time.h>
23 23
24INLINE_HEADER_BEGIN 24INLINE_HEADER_BEGIN
25#ifndef BUFFER_INLINE
26# define BUFFER_INLINE INLINE
27#endif
28 25
29/* Accessing the parameters of the current buffer. */ 26/* Accessing the parameters of the current buffer. */
30 27
@@ -229,7 +226,7 @@ INLINE_HEADER_BEGIN
229 BUF_BEG_UNCHANGED (buf) = (start) - BUF_BEG (buf); \ 226 BUF_BEG_UNCHANGED (buf) = (start) - BUF_BEG (buf); \
230 } \ 227 } \
231 } \ 228 } \
232 while (0) 229 while (false)
233 230
234 231
235/* Macros to set PT in the current buffer, or another buffer. */ 232/* Macros to set PT in the current buffer, or another buffer. */
@@ -305,7 +302,7 @@ extern void enlarge_buffer_text (struct buffer *, ptrdiff_t);
305 else \ 302 else \
306 wrong_type_argument (Qinteger_or_marker_p, __pos); \ 303 wrong_type_argument (Qinteger_or_marker_p, __pos); \
307 } \ 304 } \
308 while (0) 305 while (false)
309 306
310/* Maximum number of bytes in a buffer. 307/* Maximum number of bytes in a buffer.
311 A buffer cannot contain more bytes than a 1-origin fixnum can represent, 308 A buffer cannot contain more bytes than a 1-origin fixnum can represent,
@@ -475,10 +472,13 @@ struct buffer_text
475 to move a marker within a buffer. */ 472 to move a marker within a buffer. */
476 struct Lisp_Marker *markers; 473 struct Lisp_Marker *markers;
477 474
478 /* Usually 0. Temporarily set to 1 in decode_coding_gap to 475 /* Usually false. Temporarily true in decode_coding_gap to
479 prevent Fgarbage_collect from shrinking the gap and losing 476 prevent Fgarbage_collect from shrinking the gap and losing
480 not-yet-decoded bytes. */ 477 not-yet-decoded bytes. */
481 bool inhibit_shrinking; 478 bool_bf inhibit_shrinking : 1;
479
480 /* True if it needs to be redisplayed. */
481 bool_bf redisplay : 1;
482 }; 482 };
483 483
484/* Most code should use this macro to access Lisp fields in struct buffer. */ 484/* Most code should use this macro to access Lisp fields in struct buffer. */
@@ -741,7 +741,7 @@ struct buffer
741 Lisp_Object INTERNAL_FIELD (cursor_in_non_selected_windows); 741 Lisp_Object INTERNAL_FIELD (cursor_in_non_selected_windows);
742 742
743 /* No more Lisp_Object beyond this point. Except undo_list, 743 /* No more Lisp_Object beyond this point. Except undo_list,
744 which is handled specially in Fgarbage_collect . */ 744 which is handled specially in Fgarbage_collect. */
745 745
746 /* This structure holds the coordinates of the buffer contents 746 /* This structure holds the coordinates of the buffer contents
747 in ordinary buffers. In indirect buffers, this is not used. */ 747 in ordinary buffers. In indirect buffers, this is not used. */
@@ -847,12 +847,12 @@ struct buffer
847 struct region_cache *width_run_cache; 847 struct region_cache *width_run_cache;
848 struct region_cache *bidi_paragraph_cache; 848 struct region_cache *bidi_paragraph_cache;
849 849
850 /* Non-zero means don't use redisplay optimizations for 850 /* Non-zero means disable redisplay optimizations when rebuilding the glyph
851 displaying this buffer. */ 851 matrices (but not when redrawing). */
852 unsigned prevent_redisplay_optimizations_p : 1; 852 bool_bf prevent_redisplay_optimizations_p : 1;
853 853
854 /* Non-zero whenever the narrowing is changed in this buffer. */ 854 /* Non-zero whenever the narrowing is changed in this buffer. */
855 unsigned clip_changed : 1; 855 bool_bf clip_changed : 1;
856 856
857 /* List of overlays that end at or before the current center, 857 /* List of overlays that end at or before the current center,
858 in order of end-position. */ 858 in order of end-position. */
@@ -874,98 +874,104 @@ struct buffer
874}; 874};
875 875
876/* Most code should use these functions to set Lisp fields in struct 876/* Most code should use these functions to set Lisp fields in struct
877 buffer. */ 877 buffer. (Some setters that are private to a single .c file are
878BUFFER_INLINE void 878 defined as static in those files.) */
879INLINE void
879bset_bidi_paragraph_direction (struct buffer *b, Lisp_Object val) 880bset_bidi_paragraph_direction (struct buffer *b, Lisp_Object val)
880{ 881{
881 b->INTERNAL_FIELD (bidi_paragraph_direction) = val; 882 b->INTERNAL_FIELD (bidi_paragraph_direction) = val;
882} 883}
883BUFFER_INLINE void 884INLINE void
885bset_cache_long_scans (struct buffer *b, Lisp_Object val)
886{
887 b->INTERNAL_FIELD (cache_long_scans) = val;
888}
889INLINE void
884bset_case_canon_table (struct buffer *b, Lisp_Object val) 890bset_case_canon_table (struct buffer *b, Lisp_Object val)
885{ 891{
886 b->INTERNAL_FIELD (case_canon_table) = val; 892 b->INTERNAL_FIELD (case_canon_table) = val;
887} 893}
888BUFFER_INLINE void 894INLINE void
889bset_case_eqv_table (struct buffer *b, Lisp_Object val) 895bset_case_eqv_table (struct buffer *b, Lisp_Object val)
890{ 896{
891 b->INTERNAL_FIELD (case_eqv_table) = val; 897 b->INTERNAL_FIELD (case_eqv_table) = val;
892} 898}
893BUFFER_INLINE void 899INLINE void
894bset_directory (struct buffer *b, Lisp_Object val) 900bset_directory (struct buffer *b, Lisp_Object val)
895{ 901{
896 b->INTERNAL_FIELD (directory) = val; 902 b->INTERNAL_FIELD (directory) = val;
897} 903}
898BUFFER_INLINE void 904INLINE void
899bset_display_count (struct buffer *b, Lisp_Object val) 905bset_display_count (struct buffer *b, Lisp_Object val)
900{ 906{
901 b->INTERNAL_FIELD (display_count) = val; 907 b->INTERNAL_FIELD (display_count) = val;
902} 908}
903BUFFER_INLINE void 909INLINE void
904bset_display_time (struct buffer *b, Lisp_Object val) 910bset_display_time (struct buffer *b, Lisp_Object val)
905{ 911{
906 b->INTERNAL_FIELD (display_time) = val; 912 b->INTERNAL_FIELD (display_time) = val;
907} 913}
908BUFFER_INLINE void 914INLINE void
909bset_downcase_table (struct buffer *b, Lisp_Object val) 915bset_downcase_table (struct buffer *b, Lisp_Object val)
910{ 916{
911 b->INTERNAL_FIELD (downcase_table) = val; 917 b->INTERNAL_FIELD (downcase_table) = val;
912} 918}
913BUFFER_INLINE void 919INLINE void
914bset_enable_multibyte_characters (struct buffer *b, Lisp_Object val) 920bset_enable_multibyte_characters (struct buffer *b, Lisp_Object val)
915{ 921{
916 b->INTERNAL_FIELD (enable_multibyte_characters) = val; 922 b->INTERNAL_FIELD (enable_multibyte_characters) = val;
917} 923}
918BUFFER_INLINE void 924INLINE void
919bset_filename (struct buffer *b, Lisp_Object val) 925bset_filename (struct buffer *b, Lisp_Object val)
920{ 926{
921 b->INTERNAL_FIELD (filename) = val; 927 b->INTERNAL_FIELD (filename) = val;
922} 928}
923BUFFER_INLINE void 929INLINE void
924bset_keymap (struct buffer *b, Lisp_Object val) 930bset_keymap (struct buffer *b, Lisp_Object val)
925{ 931{
926 b->INTERNAL_FIELD (keymap) = val; 932 b->INTERNAL_FIELD (keymap) = val;
927} 933}
928BUFFER_INLINE void 934INLINE void
929bset_last_selected_window (struct buffer *b, Lisp_Object val) 935bset_last_selected_window (struct buffer *b, Lisp_Object val)
930{ 936{
931 b->INTERNAL_FIELD (last_selected_window) = val; 937 b->INTERNAL_FIELD (last_selected_window) = val;
932} 938}
933BUFFER_INLINE void 939INLINE void
934bset_local_var_alist (struct buffer *b, Lisp_Object val) 940bset_local_var_alist (struct buffer *b, Lisp_Object val)
935{ 941{
936 b->INTERNAL_FIELD (local_var_alist) = val; 942 b->INTERNAL_FIELD (local_var_alist) = val;
937} 943}
938BUFFER_INLINE void 944INLINE void
939bset_mark_active (struct buffer *b, Lisp_Object val) 945bset_mark_active (struct buffer *b, Lisp_Object val)
940{ 946{
941 b->INTERNAL_FIELD (mark_active) = val; 947 b->INTERNAL_FIELD (mark_active) = val;
942} 948}
943BUFFER_INLINE void 949INLINE void
944bset_point_before_scroll (struct buffer *b, Lisp_Object val) 950bset_point_before_scroll (struct buffer *b, Lisp_Object val)
945{ 951{
946 b->INTERNAL_FIELD (point_before_scroll) = val; 952 b->INTERNAL_FIELD (point_before_scroll) = val;
947} 953}
948BUFFER_INLINE void 954INLINE void
949bset_read_only (struct buffer *b, Lisp_Object val) 955bset_read_only (struct buffer *b, Lisp_Object val)
950{ 956{
951 b->INTERNAL_FIELD (read_only) = val; 957 b->INTERNAL_FIELD (read_only) = val;
952} 958}
953BUFFER_INLINE void 959INLINE void
954bset_truncate_lines (struct buffer *b, Lisp_Object val) 960bset_truncate_lines (struct buffer *b, Lisp_Object val)
955{ 961{
956 b->INTERNAL_FIELD (truncate_lines) = val; 962 b->INTERNAL_FIELD (truncate_lines) = val;
957} 963}
958BUFFER_INLINE void 964INLINE void
959bset_undo_list (struct buffer *b, Lisp_Object val) 965bset_undo_list (struct buffer *b, Lisp_Object val)
960{ 966{
961 b->INTERNAL_FIELD (undo_list) = val; 967 b->INTERNAL_FIELD (undo_list) = val;
962} 968}
963BUFFER_INLINE void 969INLINE void
964bset_upcase_table (struct buffer *b, Lisp_Object val) 970bset_upcase_table (struct buffer *b, Lisp_Object val)
965{ 971{
966 b->INTERNAL_FIELD (upcase_table) = val; 972 b->INTERNAL_FIELD (upcase_table) = val;
967} 973}
968BUFFER_INLINE void 974INLINE void
969bset_width_table (struct buffer *b, Lisp_Object val) 975bset_width_table (struct buffer *b, Lisp_Object val)
970{ 976{
971 b->INTERNAL_FIELD (width_table) = val; 977 b->INTERNAL_FIELD (width_table) = val;
@@ -1015,7 +1021,7 @@ bset_width_table (struct buffer *b, Lisp_Object val)
1015 else \ 1021 else \
1016 eassert (b->indirections >= 0); \ 1022 eassert (b->indirections >= 0); \
1017 } \ 1023 } \
1018 } while (0) 1024 } while (false)
1019 1025
1020/* Chain of all buffers, including killed ones. */ 1026/* Chain of all buffers, including killed ones. */
1021 1027
@@ -1073,7 +1079,7 @@ extern ptrdiff_t overlay_strings (ptrdiff_t, struct window *, unsigned char **);
1073extern void validate_region (Lisp_Object *, Lisp_Object *); 1079extern void validate_region (Lisp_Object *, Lisp_Object *);
1074extern void set_buffer_internal_1 (struct buffer *); 1080extern void set_buffer_internal_1 (struct buffer *);
1075extern void set_buffer_temp (struct buffer *); 1081extern void set_buffer_temp (struct buffer *);
1076extern Lisp_Object buffer_local_value_1 (Lisp_Object, Lisp_Object); 1082extern Lisp_Object buffer_local_value (Lisp_Object, Lisp_Object);
1077extern void record_buffer (Lisp_Object); 1083extern void record_buffer (Lisp_Object);
1078extern void fix_overlays_before (struct buffer *, ptrdiff_t, ptrdiff_t); 1084extern void fix_overlays_before (struct buffer *, ptrdiff_t, ptrdiff_t);
1079extern void mmap_set_vars (bool); 1085extern void mmap_set_vars (bool);
@@ -1089,7 +1095,7 @@ extern void set_buffer_if_live (Lisp_Object);
1089 windows than the selected one requires a select_window at some 1095 windows than the selected one requires a select_window at some
1090 time, and that increments windows_or_buffers_changed. */ 1096 time, and that increments windows_or_buffers_changed. */
1091 1097
1092BUFFER_INLINE void 1098INLINE void
1093set_buffer_internal (struct buffer *b) 1099set_buffer_internal (struct buffer *b)
1094{ 1100{
1095 if (current_buffer != b) 1101 if (current_buffer != b)
@@ -1099,7 +1105,7 @@ set_buffer_internal (struct buffer *b)
1099/* Arrange to go back to the original buffer after the next 1105/* Arrange to go back to the original buffer after the next
1100 call to unbind_to if the original buffer is still alive. */ 1106 call to unbind_to if the original buffer is still alive. */
1101 1107
1102BUFFER_INLINE void 1108INLINE void
1103record_unwind_current_buffer (void) 1109record_unwind_current_buffer (void)
1104{ 1110{
1105 record_unwind_protect (set_buffer_if_live, Fcurrent_buffer ()); 1111 record_unwind_protect (set_buffer_if_live, Fcurrent_buffer ());
@@ -1113,16 +1119,16 @@ record_unwind_current_buffer (void)
1113 do { \ 1119 do { \
1114 ptrdiff_t maxlen = 40; \ 1120 ptrdiff_t maxlen = 40; \
1115 overlays = alloca (maxlen * sizeof *overlays); \ 1121 overlays = alloca (maxlen * sizeof *overlays); \
1116 noverlays = overlays_at (posn, 0, &overlays, &maxlen, \ 1122 noverlays = overlays_at (posn, false, &overlays, &maxlen, \
1117 nextp, NULL, chrq); \ 1123 nextp, NULL, chrq); \
1118 if (noverlays > maxlen) \ 1124 if (noverlays > maxlen) \
1119 { \ 1125 { \
1120 maxlen = noverlays; \ 1126 maxlen = noverlays; \
1121 overlays = alloca (maxlen * sizeof *overlays); \ 1127 overlays = alloca (maxlen * sizeof *overlays); \
1122 noverlays = overlays_at (posn, 0, &overlays, &maxlen, \ 1128 noverlays = overlays_at (posn, false, &overlays, &maxlen, \
1123 nextp, NULL, chrq); \ 1129 nextp, NULL, chrq); \
1124 } \ 1130 } \
1125 } while (0) 1131 } while (false)
1126 1132
1127extern Lisp_Object Vbuffer_alist; 1133extern Lisp_Object Vbuffer_alist;
1128extern Lisp_Object Qbefore_change_functions; 1134extern Lisp_Object Qbefore_change_functions;
@@ -1138,7 +1144,7 @@ extern Lisp_Object Qpriority, Qbefore_string, Qafter_string;
1138 1144
1139/* Get text properties of B. */ 1145/* Get text properties of B. */
1140 1146
1141BUFFER_INLINE INTERVAL 1147INLINE INTERVAL
1142buffer_intervals (struct buffer *b) 1148buffer_intervals (struct buffer *b)
1143{ 1149{
1144 eassert (b->text != NULL); 1150 eassert (b->text != NULL);
@@ -1147,7 +1153,7 @@ buffer_intervals (struct buffer *b)
1147 1153
1148/* Set text properties of B to I. */ 1154/* Set text properties of B to I. */
1149 1155
1150BUFFER_INLINE void 1156INLINE void
1151set_buffer_intervals (struct buffer *b, INTERVAL i) 1157set_buffer_intervals (struct buffer *b, INTERVAL i)
1152{ 1158{
1153 eassert (b->text != NULL); 1159 eassert (b->text != NULL);
@@ -1156,7 +1162,7 @@ set_buffer_intervals (struct buffer *b, INTERVAL i)
1156 1162
1157/* Non-zero if current buffer has overlays. */ 1163/* Non-zero if current buffer has overlays. */
1158 1164
1159BUFFER_INLINE bool 1165INLINE bool
1160buffer_has_overlays (void) 1166buffer_has_overlays (void)
1161{ 1167{
1162 return current_buffer->overlays_before || current_buffer->overlays_after; 1168 return current_buffer->overlays_before || current_buffer->overlays_after;
@@ -1176,7 +1182,7 @@ buffer_has_overlays (void)
1176 the buffer to the next character after fetching this one. Instead, 1182 the buffer to the next character after fetching this one. Instead,
1177 use either FETCH_CHAR_ADVANCE or STRING_CHAR_AND_LENGTH. */ 1183 use either FETCH_CHAR_ADVANCE or STRING_CHAR_AND_LENGTH. */
1178 1184
1179BUFFER_INLINE int 1185INLINE int
1180FETCH_MULTIBYTE_CHAR (ptrdiff_t pos) 1186FETCH_MULTIBYTE_CHAR (ptrdiff_t pos)
1181{ 1187{
1182 unsigned char *p = ((pos >= GPT_BYTE ? GAP_SIZE : 0) 1188 unsigned char *p = ((pos >= GPT_BYTE ? GAP_SIZE : 0)
@@ -1188,7 +1194,7 @@ FETCH_MULTIBYTE_CHAR (ptrdiff_t pos)
1188 If POS doesn't point the head of valid multi-byte form, only the byte at 1194 If POS doesn't point the head of valid multi-byte form, only the byte at
1189 POS is returned. No range checking. */ 1195 POS is returned. No range checking. */
1190 1196
1191BUFFER_INLINE int 1197INLINE int
1192BUF_FETCH_MULTIBYTE_CHAR (struct buffer *buf, ptrdiff_t pos) 1198BUF_FETCH_MULTIBYTE_CHAR (struct buffer *buf, ptrdiff_t pos)
1193{ 1199{
1194 unsigned char *p 1200 unsigned char *p
@@ -1199,7 +1205,7 @@ BUF_FETCH_MULTIBYTE_CHAR (struct buffer *buf, ptrdiff_t pos)
1199 1205
1200/* Return number of windows showing B. */ 1206/* Return number of windows showing B. */
1201 1207
1202BUFFER_INLINE int 1208INLINE int
1203buffer_window_count (struct buffer *b) 1209buffer_window_count (struct buffer *b)
1204{ 1210{
1205 if (b->base_buffer) 1211 if (b->base_buffer)
@@ -1261,12 +1267,12 @@ extern int last_per_buffer_idx;
1261#define PER_BUFFER_VAR_IDX(VAR) \ 1267#define PER_BUFFER_VAR_IDX(VAR) \
1262 PER_BUFFER_IDX (PER_BUFFER_VAR_OFFSET (VAR)) 1268 PER_BUFFER_IDX (PER_BUFFER_VAR_OFFSET (VAR))
1263 1269
1264/* Value is non-zero if the variable with index IDX has a local value 1270/* Value is true if the variable with index IDX has a local value
1265 in buffer B. */ 1271 in buffer B. */
1266 1272
1267#define PER_BUFFER_VALUE_P(B, IDX) \ 1273#define PER_BUFFER_VALUE_P(B, IDX) \
1268 (((IDX) < 0 || IDX >= last_per_buffer_idx) \ 1274 (((IDX) < 0 || IDX >= last_per_buffer_idx) \
1269 ? (emacs_abort (), 0) \ 1275 ? (emacs_abort (), false) \
1270 : ((B)->local_flags[IDX] != 0)) 1276 : ((B)->local_flags[IDX] != 0))
1271 1277
1272/* Set whether per-buffer variable with index IDX has a buffer-local 1278/* Set whether per-buffer variable with index IDX has a buffer-local
@@ -1277,7 +1283,7 @@ extern int last_per_buffer_idx;
1277 if ((IDX) < 0 || (IDX) >= last_per_buffer_idx) \ 1283 if ((IDX) < 0 || (IDX) >= last_per_buffer_idx) \
1278 emacs_abort (); \ 1284 emacs_abort (); \
1279 (B)->local_flags[IDX] = (VAL); \ 1285 (B)->local_flags[IDX] = (VAL); \
1280 } while (0) 1286 } while (false)
1281 1287
1282/* Return the index value of the per-buffer variable at offset OFFSET 1288/* Return the index value of the per-buffer variable at offset OFFSET
1283 in the buffer structure. 1289 in the buffer structure.
@@ -1306,13 +1312,13 @@ extern int last_per_buffer_idx;
1306/* Functions to get and set default value of the per-buffer 1312/* Functions to get and set default value of the per-buffer
1307 variable at offset OFFSET in the buffer structure. */ 1313 variable at offset OFFSET in the buffer structure. */
1308 1314
1309BUFFER_INLINE Lisp_Object 1315INLINE Lisp_Object
1310per_buffer_default (int offset) 1316per_buffer_default (int offset)
1311{ 1317{
1312 return *(Lisp_Object *)(offset + (char *) &buffer_defaults); 1318 return *(Lisp_Object *)(offset + (char *) &buffer_defaults);
1313} 1319}
1314 1320
1315BUFFER_INLINE void 1321INLINE void
1316set_per_buffer_default (int offset, Lisp_Object value) 1322set_per_buffer_default (int offset, Lisp_Object value)
1317{ 1323{
1318 *(Lisp_Object *)(offset + (char *) &buffer_defaults) = value; 1324 *(Lisp_Object *)(offset + (char *) &buffer_defaults) = value;
@@ -1321,20 +1327,20 @@ set_per_buffer_default (int offset, Lisp_Object value)
1321/* Functions to get and set buffer-local value of the per-buffer 1327/* Functions to get and set buffer-local value of the per-buffer
1322 variable at offset OFFSET in the buffer structure. */ 1328 variable at offset OFFSET in the buffer structure. */
1323 1329
1324BUFFER_INLINE Lisp_Object 1330INLINE Lisp_Object
1325per_buffer_value (struct buffer *b, int offset) 1331per_buffer_value (struct buffer *b, int offset)
1326{ 1332{
1327 return *(Lisp_Object *)(offset + (char *) b); 1333 return *(Lisp_Object *)(offset + (char *) b);
1328} 1334}
1329 1335
1330BUFFER_INLINE void 1336INLINE void
1331set_per_buffer_value (struct buffer *b, int offset, Lisp_Object value) 1337set_per_buffer_value (struct buffer *b, int offset, Lisp_Object value)
1332{ 1338{
1333 *(Lisp_Object *)(offset + (char *) b) = value; 1339 *(Lisp_Object *)(offset + (char *) b) = value;
1334} 1340}
1335 1341
1336/* Downcase a character C, or make no change if that cannot be done. */ 1342/* Downcase a character C, or make no change if that cannot be done. */
1337BUFFER_INLINE int 1343INLINE int
1338downcase (int c) 1344downcase (int c)
1339{ 1345{
1340 Lisp_Object downcase_table = BVAR (current_buffer, downcase_table); 1346 Lisp_Object downcase_table = BVAR (current_buffer, downcase_table);
@@ -1342,11 +1348,11 @@ downcase (int c)
1342 return NATNUMP (down) ? XFASTINT (down) : c; 1348 return NATNUMP (down) ? XFASTINT (down) : c;
1343} 1349}
1344 1350
1345/* 1 if C is upper case. */ 1351/* True if C is upper case. */
1346BUFFER_INLINE bool uppercasep (int c) { return downcase (c) != c; } 1352INLINE bool uppercasep (int c) { return downcase (c) != c; }
1347 1353
1348/* Upcase a character C known to be not upper case. */ 1354/* Upcase a character C known to be not upper case. */
1349BUFFER_INLINE int 1355INLINE int
1350upcase1 (int c) 1356upcase1 (int c)
1351{ 1357{
1352 Lisp_Object upcase_table = BVAR (current_buffer, upcase_table); 1358 Lisp_Object upcase_table = BVAR (current_buffer, upcase_table);
@@ -1354,14 +1360,14 @@ upcase1 (int c)
1354 return NATNUMP (up) ? XFASTINT (up) : c; 1360 return NATNUMP (up) ? XFASTINT (up) : c;
1355} 1361}
1356 1362
1357/* 1 if C is lower case. */ 1363/* True if C is lower case. */
1358BUFFER_INLINE bool 1364INLINE bool
1359lowercasep (int c) 1365lowercasep (int c)
1360{ 1366{
1361 return !uppercasep (c) && upcase1 (c) != c; 1367 return !uppercasep (c) && upcase1 (c) != c;
1362} 1368}
1363 1369
1364/* Upcase a character C, or make no change if that cannot be done. */ 1370/* Upcase a character C, or make no change if that cannot be done. */
1365BUFFER_INLINE int upcase (int c) { return uppercasep (c) ? c : upcase1 (c); } 1371INLINE int upcase (int c) { return uppercasep (c) ? c : upcase1 (c); }
1366 1372
1367INLINE_HEADER_END 1373INLINE_HEADER_END