diff options
Diffstat (limited to 'src/buffer.h')
| -rw-r--r-- | src/buffer.h | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/src/buffer.h b/src/buffer.h index 0975d2e3adc..996e4e59c27 100644 --- a/src/buffer.h +++ b/src/buffer.h | |||
| @@ -1026,4 +1026,47 @@ extern int last_per_buffer_idx; | |||
| 1026 | 1026 | ||
| 1027 | #define PER_BUFFER_VALUE(BUFFER, OFFSET) \ | 1027 | #define PER_BUFFER_VALUE(BUFFER, OFFSET) \ |
| 1028 | (*(Lisp_Object *)((OFFSET) + (char *) (BUFFER))) | 1028 | (*(Lisp_Object *)((OFFSET) + (char *) (BUFFER))) |
| 1029 | |||
| 1030 | /* Current buffer's map from characters to lower-case characters. */ | ||
| 1031 | |||
| 1032 | #define DOWNCASE_TABLE BVAR (current_buffer, downcase_table) | ||
| 1033 | |||
| 1034 | /* Current buffer's map from characters to upper-case characters. */ | ||
| 1035 | |||
| 1036 | #define UPCASE_TABLE BVAR (current_buffer, upcase_table) | ||
| 1037 | |||
| 1038 | /* Downcase a character, or make no change if that cannot be done. */ | ||
| 1039 | |||
| 1040 | static inline EMACS_INT | ||
| 1041 | downcase (int ch) | ||
| 1042 | { | ||
| 1043 | Lisp_Object down = CHAR_TABLE_REF (DOWNCASE_TABLE, ch); | ||
| 1044 | return NATNUMP (down) ? XFASTINT (down) : ch; | ||
| 1045 | } | ||
| 1046 | #define DOWNCASE(CH) downcase (CH) | ||
| 1047 | |||
| 1048 | /* 1 if CH is upper case. */ | ||
| 1049 | |||
| 1050 | #define UPPERCASEP(CH) (DOWNCASE (CH) != (CH)) | ||
| 1029 | 1051 | ||
| 1052 | /* 1 if CH is neither upper nor lower case. */ | ||
| 1053 | |||
| 1054 | #define NOCASEP(CH) (UPCASE1 (CH) == (CH)) | ||
| 1055 | |||
| 1056 | /* 1 if CH is lower case. */ | ||
| 1057 | |||
| 1058 | #define LOWERCASEP(CH) (!UPPERCASEP (CH) && !NOCASEP(CH)) | ||
| 1059 | |||
| 1060 | /* Upcase a character, or make no change if that cannot be done. */ | ||
| 1061 | |||
| 1062 | #define UPCASE(CH) (!UPPERCASEP (CH) ? UPCASE1 (CH) : (CH)) | ||
| 1063 | |||
| 1064 | /* Upcase a character known to be not upper case. */ | ||
| 1065 | |||
| 1066 | static inline EMACS_INT | ||
| 1067 | upcase1 (int ch) | ||
| 1068 | { | ||
| 1069 | Lisp_Object up = CHAR_TABLE_REF (UPCASE_TABLE, ch); | ||
| 1070 | return NATNUMP (up) ? XFASTINT (up) : ch; | ||
| 1071 | } | ||
| 1072 | #define UPCASE1(CH) upcase1 (CH) | ||