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 | a79cb1ef3ca9a656cfc570269a2441f58a6e7f1a (patch) | |
tree | 97998b79e84f6671d70bb480b8969afccf8f3998 /src/coding.h | |
parent | b12db95863de514e887538e8220ebd35dd1df93e (diff) | |
download | emacs-a79cb1ef3ca9a656cfc570269a2441f58a6e7f1a.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) |