aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorKenichi Handa2006-01-19 07:20:52 +0000
committerKenichi Handa2006-01-19 07:20:52 +0000
commit44e8490d9a9bd0ad071509bf3e0e2f34a3e7d315 (patch)
tree9abf98f274c8b92bdcd29e5dcf8d0d9ddc80f192 /src
parente7dd762260933aabdc730c72491145ef9bdf0c27 (diff)
downloademacs-44e8490d9a9bd0ad071509bf3e0e2f34a3e7d315.tar.gz
emacs-44e8490d9a9bd0ad071509bf3e0e2f34a3e7d315.zip
Sync to HEAD for handling autoload-coding-system.
(Qcoding_system_define_form): New variable. (syms_of_coding): Intern and staticpro it. (Fcoding_system_p): Check Qcoding_system_define_form. (Fcheck_coding_system): Try to autoload the definition of CODING-SYSTEM.
Diffstat (limited to 'src')
-rw-r--r--src/coding.c22
1 files changed, 20 insertions, 2 deletions
diff --git a/src/coding.c b/src/coding.c
index d5b9e3875ec..a5625339a29 100644
--- a/src/coding.c
+++ b/src/coding.c
@@ -325,6 +325,10 @@ Lisp_Object Qtarget_idx;
325Lisp_Object Qinsufficient_source, Qinconsistent_eol, Qinvalid_source; 325Lisp_Object Qinsufficient_source, Qinconsistent_eol, Qinvalid_source;
326Lisp_Object Qinterrupted, Qinsufficient_memory; 326Lisp_Object Qinterrupted, Qinsufficient_memory;
327 327
328/* If a symbol has this property, evaluate the value to define the
329 symbol as a coding system. */
330static Lisp_Object Qcoding_system_define_form;
331
328int coding_system_require_warning; 332int coding_system_require_warning;
329 333
330Lisp_Object Vselect_safe_coding_system_function; 334Lisp_Object Vselect_safe_coding_system_function;
@@ -7060,7 +7064,13 @@ about coding-system objects. */)
7060 (obj) 7064 (obj)
7061 Lisp_Object obj; 7065 Lisp_Object obj;
7062{ 7066{
7063 return ((NILP (obj) || CODING_SYSTEM_P (obj)) ? Qt : Qnil); 7067 if (NILP (obj)
7068 || CODING_SYSTEM_ID (obj) >= 0)
7069 return Qt;
7070 if (! SYMBOLP (obj)
7071 || NILP (Fget (obj, Qcoding_system_define_form)))
7072 return Qnil;
7073 return Qt;
7064} 7074}
7065 7075
7066DEFUN ("read-non-nil-coding-system", Fread_non_nil_coding_system, 7076DEFUN ("read-non-nil-coding-system", Fread_non_nil_coding_system,
@@ -7103,7 +7113,14 @@ function `define-coding-system'. */)
7103 (coding_system) 7113 (coding_system)
7104 Lisp_Object coding_system; 7114 Lisp_Object coding_system;
7105{ 7115{
7106 CHECK_SYMBOL (coding_system); 7116 Lisp_Object define_form;
7117
7118 define_form = Fget (coding_system, Qcoding_system_define_form);
7119 if (! NILP (define_form))
7120 {
7121 Fput (coding_system, Qcoding_system_define_form, Qnil);
7122 safe_eval (define_form);
7123 }
7107 if (!NILP (Fcoding_system_p (coding_system))) 7124 if (!NILP (Fcoding_system_p (coding_system)))
7108 return coding_system; 7125 return coding_system;
7109 while (1) 7126 while (1)
@@ -9322,6 +9339,7 @@ syms_of_coding ()
9322 DEFSYM (Qinvalid_source, "invalid-source"); 9339 DEFSYM (Qinvalid_source, "invalid-source");
9323 DEFSYM (Qinterrupted, "interrupted"); 9340 DEFSYM (Qinterrupted, "interrupted");
9324 DEFSYM (Qinsufficient_memory, "insufficient-memory"); 9341 DEFSYM (Qinsufficient_memory, "insufficient-memory");
9342 DEFSYM (Qcoding_system_define_form, "coding-system-define-form");
9325 9343
9326 defsubr (&Scoding_system_p); 9344 defsubr (&Scoding_system_p);
9327 defsubr (&Sread_coding_system); 9345 defsubr (&Sread_coding_system);