diff options
| author | Kenichi Handa | 2006-01-19 07:17:59 +0000 |
|---|---|---|
| committer | Kenichi Handa | 2006-01-19 07:17:59 +0000 |
| commit | 7c00e33d77b870e62f176163464d729ffffe3df9 (patch) | |
| tree | c2345f36212796adf72dc4dd9a092c03d9900e14 /src/coding.h | |
| parent | 2da14137b65ad7c7fab34dcac8e10e16703c96d1 (diff) | |
| download | emacs-7c00e33d77b870e62f176163464d729ffffe3df9.tar.gz emacs-7c00e33d77b870e62f176163464d729ffffe3df9.zip | |
(CODING_SYSTEM_P): If ID is not available, call
Fcoding_system_p.
(CHECK_CODING_SYSTEM): If ID is not available, call
Fcheck_coding_system.
(CHECK_CODING_SYSTEM_GET_SPEC): Try also Fcheck_coding_system.
(CHECK_CODING_SYSTEM_GET_ID): Likewise.
Diffstat (limited to 'src/coding.h')
| -rw-r--r-- | src/coding.h | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/src/coding.h b/src/coding.h index 834724cf340..89ceb7cad3b 100644 --- a/src/coding.h +++ b/src/coding.h | |||
| @@ -212,14 +212,17 @@ enum coding_attr_index | |||
| 212 | 212 | ||
| 213 | /* Return 1 iff CODING_SYSTEM_SYMBOL is a coding system. */ | 213 | /* Return 1 iff CODING_SYSTEM_SYMBOL is a coding system. */ |
| 214 | 214 | ||
| 215 | #define CODING_SYSTEM_P(coding_system_symbol) \ | 215 | #define CODING_SYSTEM_P(coding_system_symbol) \ |
| 216 | (! NILP (CODING_SYSTEM_SPEC (coding_system_symbol))) | 216 | (CODING_SYSTEM_ID (coding_system_symbol) >= 0 \ |
| 217 | || (! NILP (coding_system_symbol) \ | ||
| 218 | && ! NILP (Fcoding_system_p (coding_system_symbol)))) | ||
| 217 | 219 | ||
| 218 | /* Check if X is a coding system or not. */ | 220 | /* Check if X is a coding system or not. */ |
| 219 | 221 | ||
| 220 | #define CHECK_CODING_SYSTEM(x) \ | 222 | #define CHECK_CODING_SYSTEM(x) \ |
| 221 | do { \ | 223 | do { \ |
| 222 | if (!CODING_SYSTEM_P (x)) \ | 224 | if (CODING_SYSTEM_ID (x) < 0 \ |
| 225 | && NILP (Fcheck_coding_system (x))) \ | ||
| 223 | wrong_type_argument (Qcoding_system_p, (x)); \ | 226 | wrong_type_argument (Qcoding_system_p, (x)); \ |
| 224 | } while (0) | 227 | } while (0) |
| 225 | 228 | ||
| @@ -231,6 +234,11 @@ enum coding_attr_index | |||
| 231 | do { \ | 234 | do { \ |
| 232 | spec = CODING_SYSTEM_SPEC (x); \ | 235 | spec = CODING_SYSTEM_SPEC (x); \ |
| 233 | if (NILP (spec)) \ | 236 | if (NILP (spec)) \ |
| 237 | { \ | ||
| 238 | Fcheck_coding_system (x); \ | ||
| 239 | spec = CODING_SYSTEM_SPEC (x); \ | ||
| 240 | } \ | ||
| 241 | if (NILP (spec)) \ | ||
| 234 | x = wrong_type_argument (Qcoding_system_p, (x)); \ | 242 | x = wrong_type_argument (Qcoding_system_p, (x)); \ |
| 235 | } while (0) | 243 | } while (0) |
| 236 | 244 | ||
| @@ -243,6 +251,11 @@ enum coding_attr_index | |||
| 243 | { \ | 251 | { \ |
| 244 | id = CODING_SYSTEM_ID (x); \ | 252 | id = CODING_SYSTEM_ID (x); \ |
| 245 | if (id < 0) \ | 253 | if (id < 0) \ |
| 254 | { \ | ||
| 255 | Fcheck_coding_system (x); \ | ||
| 256 | id = CODING_SYSTEM_ID (x); \ | ||
| 257 | } \ | ||
| 258 | if (id < 0) \ | ||
| 246 | x = wrong_type_argument (Qcoding_system_p, (x)); \ | 259 | x = wrong_type_argument (Qcoding_system_p, (x)); \ |
| 247 | } while (0) | 260 | } while (0) |
| 248 | 261 | ||