diff options
| author | Joakim Verona | 2014-06-04 23:50:06 +0200 |
|---|---|---|
| committer | Joakim Verona | 2014-06-04 23:50:06 +0200 |
| commit | ce8171797dafbde765170b79e5f154afc4872e86 (patch) | |
| tree | 264b357b484de24929a3f2d20a34e0e43c006a15 /src/buffer.h | |
| parent | c1c9aa247cab9148916b367e719219ea0f055adb (diff) | |
| parent | b5d6fe3bf6e728c82a3ff63723d75519f7853716 (diff) | |
| download | emacs-ce8171797dafbde765170b79e5f154afc4872e86.tar.gz emacs-ce8171797dafbde765170b79e5f154afc4872e86.zip | |
upstream
Diffstat (limited to 'src/buffer.h')
| -rw-r--r-- | src/buffer.h | 126 |
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 | ||
| 3 | Copyright (C) 1985-1986, 1993-1995, 1997-2013 Free Software Foundation, | 3 | Copyright (C) 1985-1986, 1993-1995, 1997-2014 Free Software Foundation, |
| 4 | Inc. | 4 | Inc. |
| 5 | 5 | ||
| 6 | This file is part of GNU Emacs. | 6 | This 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 | ||
| 24 | INLINE_HEADER_BEGIN | 24 | INLINE_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 |
| 878 | BUFFER_INLINE void | 878 | defined as static in those files.) */ |
| 879 | INLINE void | ||
| 879 | bset_bidi_paragraph_direction (struct buffer *b, Lisp_Object val) | 880 | bset_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 | } |
| 883 | BUFFER_INLINE void | 884 | INLINE void |
| 885 | bset_cache_long_scans (struct buffer *b, Lisp_Object val) | ||
| 886 | { | ||
| 887 | b->INTERNAL_FIELD (cache_long_scans) = val; | ||
| 888 | } | ||
| 889 | INLINE void | ||
| 884 | bset_case_canon_table (struct buffer *b, Lisp_Object val) | 890 | bset_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 | } |
| 888 | BUFFER_INLINE void | 894 | INLINE void |
| 889 | bset_case_eqv_table (struct buffer *b, Lisp_Object val) | 895 | bset_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 | } |
| 893 | BUFFER_INLINE void | 899 | INLINE void |
| 894 | bset_directory (struct buffer *b, Lisp_Object val) | 900 | bset_directory (struct buffer *b, Lisp_Object val) |
| 895 | { | 901 | { |
| 896 | b->INTERNAL_FIELD (directory) = val; | 902 | b->INTERNAL_FIELD (directory) = val; |
| 897 | } | 903 | } |
| 898 | BUFFER_INLINE void | 904 | INLINE void |
| 899 | bset_display_count (struct buffer *b, Lisp_Object val) | 905 | bset_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 | } |
| 903 | BUFFER_INLINE void | 909 | INLINE void |
| 904 | bset_display_time (struct buffer *b, Lisp_Object val) | 910 | bset_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 | } |
| 908 | BUFFER_INLINE void | 914 | INLINE void |
| 909 | bset_downcase_table (struct buffer *b, Lisp_Object val) | 915 | bset_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 | } |
| 913 | BUFFER_INLINE void | 919 | INLINE void |
| 914 | bset_enable_multibyte_characters (struct buffer *b, Lisp_Object val) | 920 | bset_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 | } |
| 918 | BUFFER_INLINE void | 924 | INLINE void |
| 919 | bset_filename (struct buffer *b, Lisp_Object val) | 925 | bset_filename (struct buffer *b, Lisp_Object val) |
| 920 | { | 926 | { |
| 921 | b->INTERNAL_FIELD (filename) = val; | 927 | b->INTERNAL_FIELD (filename) = val; |
| 922 | } | 928 | } |
| 923 | BUFFER_INLINE void | 929 | INLINE void |
| 924 | bset_keymap (struct buffer *b, Lisp_Object val) | 930 | bset_keymap (struct buffer *b, Lisp_Object val) |
| 925 | { | 931 | { |
| 926 | b->INTERNAL_FIELD (keymap) = val; | 932 | b->INTERNAL_FIELD (keymap) = val; |
| 927 | } | 933 | } |
| 928 | BUFFER_INLINE void | 934 | INLINE void |
| 929 | bset_last_selected_window (struct buffer *b, Lisp_Object val) | 935 | bset_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 | } |
| 933 | BUFFER_INLINE void | 939 | INLINE void |
| 934 | bset_local_var_alist (struct buffer *b, Lisp_Object val) | 940 | bset_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 | } |
| 938 | BUFFER_INLINE void | 944 | INLINE void |
| 939 | bset_mark_active (struct buffer *b, Lisp_Object val) | 945 | bset_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 | } |
| 943 | BUFFER_INLINE void | 949 | INLINE void |
| 944 | bset_point_before_scroll (struct buffer *b, Lisp_Object val) | 950 | bset_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 | } |
| 948 | BUFFER_INLINE void | 954 | INLINE void |
| 949 | bset_read_only (struct buffer *b, Lisp_Object val) | 955 | bset_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 | } |
| 953 | BUFFER_INLINE void | 959 | INLINE void |
| 954 | bset_truncate_lines (struct buffer *b, Lisp_Object val) | 960 | bset_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 | } |
| 958 | BUFFER_INLINE void | 964 | INLINE void |
| 959 | bset_undo_list (struct buffer *b, Lisp_Object val) | 965 | bset_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 | } |
| 963 | BUFFER_INLINE void | 969 | INLINE void |
| 964 | bset_upcase_table (struct buffer *b, Lisp_Object val) | 970 | bset_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 | } |
| 968 | BUFFER_INLINE void | 974 | INLINE void |
| 969 | bset_width_table (struct buffer *b, Lisp_Object val) | 975 | bset_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 **); | |||
| 1073 | extern void validate_region (Lisp_Object *, Lisp_Object *); | 1079 | extern void validate_region (Lisp_Object *, Lisp_Object *); |
| 1074 | extern void set_buffer_internal_1 (struct buffer *); | 1080 | extern void set_buffer_internal_1 (struct buffer *); |
| 1075 | extern void set_buffer_temp (struct buffer *); | 1081 | extern void set_buffer_temp (struct buffer *); |
| 1076 | extern Lisp_Object buffer_local_value_1 (Lisp_Object, Lisp_Object); | 1082 | extern Lisp_Object buffer_local_value (Lisp_Object, Lisp_Object); |
| 1077 | extern void record_buffer (Lisp_Object); | 1083 | extern void record_buffer (Lisp_Object); |
| 1078 | extern void fix_overlays_before (struct buffer *, ptrdiff_t, ptrdiff_t); | 1084 | extern void fix_overlays_before (struct buffer *, ptrdiff_t, ptrdiff_t); |
| 1079 | extern void mmap_set_vars (bool); | 1085 | extern 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 | ||
| 1092 | BUFFER_INLINE void | 1098 | INLINE void |
| 1093 | set_buffer_internal (struct buffer *b) | 1099 | set_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 | ||
| 1102 | BUFFER_INLINE void | 1108 | INLINE void |
| 1103 | record_unwind_current_buffer (void) | 1109 | record_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 | ||
| 1127 | extern Lisp_Object Vbuffer_alist; | 1133 | extern Lisp_Object Vbuffer_alist; |
| 1128 | extern Lisp_Object Qbefore_change_functions; | 1134 | extern 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 | ||
| 1141 | BUFFER_INLINE INTERVAL | 1147 | INLINE INTERVAL |
| 1142 | buffer_intervals (struct buffer *b) | 1148 | buffer_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 | ||
| 1150 | BUFFER_INLINE void | 1156 | INLINE void |
| 1151 | set_buffer_intervals (struct buffer *b, INTERVAL i) | 1157 | set_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 | ||
| 1159 | BUFFER_INLINE bool | 1165 | INLINE bool |
| 1160 | buffer_has_overlays (void) | 1166 | buffer_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 | ||
| 1179 | BUFFER_INLINE int | 1185 | INLINE int |
| 1180 | FETCH_MULTIBYTE_CHAR (ptrdiff_t pos) | 1186 | FETCH_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 | ||
| 1191 | BUFFER_INLINE int | 1197 | INLINE int |
| 1192 | BUF_FETCH_MULTIBYTE_CHAR (struct buffer *buf, ptrdiff_t pos) | 1198 | BUF_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 | ||
| 1202 | BUFFER_INLINE int | 1208 | INLINE int |
| 1203 | buffer_window_count (struct buffer *b) | 1209 | buffer_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 | ||
| 1309 | BUFFER_INLINE Lisp_Object | 1315 | INLINE Lisp_Object |
| 1310 | per_buffer_default (int offset) | 1316 | per_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 | ||
| 1315 | BUFFER_INLINE void | 1321 | INLINE void |
| 1316 | set_per_buffer_default (int offset, Lisp_Object value) | 1322 | set_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 | ||
| 1324 | BUFFER_INLINE Lisp_Object | 1330 | INLINE Lisp_Object |
| 1325 | per_buffer_value (struct buffer *b, int offset) | 1331 | per_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 | ||
| 1330 | BUFFER_INLINE void | 1336 | INLINE void |
| 1331 | set_per_buffer_value (struct buffer *b, int offset, Lisp_Object value) | 1337 | set_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. */ |
| 1337 | BUFFER_INLINE int | 1343 | INLINE int |
| 1338 | downcase (int c) | 1344 | downcase (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. */ |
| 1346 | BUFFER_INLINE bool uppercasep (int c) { return downcase (c) != c; } | 1352 | INLINE 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. */ |
| 1349 | BUFFER_INLINE int | 1355 | INLINE int |
| 1350 | upcase1 (int c) | 1356 | upcase1 (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. */ |
| 1358 | BUFFER_INLINE bool | 1364 | INLINE bool |
| 1359 | lowercasep (int c) | 1365 | lowercasep (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. */ |
| 1365 | BUFFER_INLINE int upcase (int c) { return uppercasep (c) ? c : upcase1 (c); } | 1371 | INLINE int upcase (int c) { return uppercasep (c) ? c : upcase1 (c); } |
| 1366 | 1372 | ||
| 1367 | INLINE_HEADER_END | 1373 | INLINE_HEADER_END |