summaryrefslogtreecommitdiff
path: root/src/coding.c
diff options
context:
space:
mode:
authorKenichi Handa <handa@m17n.org>2003-10-07 01:29:12 +0000
committerKenichi Handa <handa@m17n.org>2003-10-07 01:29:12 +0000
commita362520d437614d9c4937d6f89c0b0997f00cf90 (patch)
treeb363383652530fef73f2bcdf54f6790333065df1 /src/coding.c
parenta7803391c2504af0b5eba72fc5a492811b24ce78 (diff)
downloademacs-a362520d437614d9c4937d6f89c0b0997f00cf90.tar.gz
(Qcoding_system_define_form): New variable.
(syms_of_coding): Intern and staticpro it. (Fcheck_coding_system): Try to autoload the definition of CODING-SYSTEM.
Diffstat (limited to 'src/coding.c')
-rw-r--r--src/coding.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/src/coding.c b/src/coding.c
index 6d36cc397c6..47bfbf5cacb 100644
--- a/src/coding.c
+++ b/src/coding.c
@@ -366,6 +366,10 @@ Lisp_Object Qcall_process, Qcall_process_region, Qprocess_argument;
Lisp_Object Qstart_process, Qopen_network_stream;
Lisp_Object Qtarget_idx;
+/* If a symbol has this property, evaluate the value to define the
+ symbol as a coding system. */
+Lisp_Object Qcoding_system_define_form;
+
Lisp_Object Vselect_safe_coding_system_function;
int coding_system_require_warning;
@@ -6375,7 +6379,14 @@ The value of property should be a vector of length 5. */)
(coding_system)
Lisp_Object coding_system;
{
- CHECK_SYMBOL (coding_system);
+ Lisp_Object define_form;
+
+ define_form = Fget (coding_system, Qcoding_system_define_form);
+ if (! NILP (define_form))
+ {
+ Fput (coding_system, Qcoding_system_define_form, Qnil);
+ safe_eval (define_form);
+ }
if (!NILP (Fcoding_system_p (coding_system)))
return coding_system;
while (1)
@@ -7595,6 +7606,9 @@ syms_of_coding ()
Qutf_8 = intern ("utf-8");
staticpro (&Qutf_8);
+ Qcoding_system_define_form = intern ("coding-system-define-form");
+ staticpro (&Qcoding_system_define_form);
+
defsubr (&Scoding_system_p);
defsubr (&Sread_coding_system);
defsubr (&Sread_non_nil_coding_system);