diff options
author | Kenichi Handa <handa@m17n.org> | 2006-01-19 07:17:59 +0000 |
---|---|---|
committer | Kenichi Handa <handa@m17n.org> | 2006-01-19 07:17:59 +0000 |
commit | 7c00e33d77b870e62f176163464d729ffffe3df9 (patch) | |
tree | c2345f36212796adf72dc4dd9a092c03d9900e14 /src/coding.h | |
parent | 2da14137b65ad7c7fab34dcac8e10e16703c96d1 (diff) | |
download | emacs-7c00e33d77b870e62f176163464d729ffffe3df9.tar.gz |
(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 /* Return 1 iff CODING_SYSTEM_SYMBOL is a coding system. */ -#define CODING_SYSTEM_P(coding_system_symbol) \ - (! NILP (CODING_SYSTEM_SPEC (coding_system_symbol))) +#define CODING_SYSTEM_P(coding_system_symbol) \ + (CODING_SYSTEM_ID (coding_system_symbol) >= 0 \ + || (! NILP (coding_system_symbol) \ + && ! NILP (Fcoding_system_p (coding_system_symbol)))) /* Check if X is a coding system or not. */ #define CHECK_CODING_SYSTEM(x) \ do { \ - if (!CODING_SYSTEM_P (x)) \ + if (CODING_SYSTEM_ID (x) < 0 \ + && NILP (Fcheck_coding_system (x))) \ wrong_type_argument (Qcoding_system_p, (x)); \ } while (0) @@ -231,6 +234,11 @@ enum coding_attr_index do { \ spec = CODING_SYSTEM_SPEC (x); \ if (NILP (spec)) \ + { \ + Fcheck_coding_system (x); \ + spec = CODING_SYSTEM_SPEC (x); \ + } \ + if (NILP (spec)) \ x = wrong_type_argument (Qcoding_system_p, (x)); \ } while (0) @@ -243,6 +251,11 @@ enum coding_attr_index { \ id = CODING_SYSTEM_ID (x); \ if (id < 0) \ + { \ + Fcheck_coding_system (x); \ + id = CODING_SYSTEM_ID (x); \ + } \ + if (id < 0) \ x = wrong_type_argument (Qcoding_system_p, (x)); \ } while (0) |