comparison src/coding.c @ 19758:49a1662b68dd

(Fread_coding_system): New optional arg DEFAULT_CODING_SYSTEM.
author Richard M. Stallman <rms@gnu.org>
date Fri, 05 Sep 1997 05:38:21 +0000
parents 95e4e1cba6ac
children ab2fd2c85986
comparison
equal deleted inserted replaced
19757:328233592e3b 19758:49a1662b68dd
3110 } 3110 }
3111 while (XSTRING (val)->size == 0); 3111 while (XSTRING (val)->size == 0);
3112 return (Fintern (val, Qnil)); 3112 return (Fintern (val, Qnil));
3113 } 3113 }
3114 3114
3115 DEFUN ("read-coding-system", Fread_coding_system, Sread_coding_system, 1, 1, 0, 3115 DEFUN ("read-coding-system", Fread_coding_system, Sread_coding_system, 1, 2, 0,
3116 "Read a coding system or nil from the minibuffer, prompting with string PROMPT.") 3116 "Read a coding system from the minibuffer, prompting with string PROMPT.\n\
3117 (prompt) 3117 If the user enters null input, return second argument DEFAULT-CODING-SYSTEM.")
3118 Lisp_Object prompt; 3118 (prompt, default_coding_system)
3119 Lisp_Object prompt, default_coding_system;
3119 { 3120 {
3120 Lisp_Object val; 3121 Lisp_Object val;
3122 if (SYMBOLP (default_coding_system))
3123 XSETSTRING (default_coding_system, XSYMBOL (default_coding_system)->name);
3121 val = Fcompleting_read (prompt, Vobarray, Qcoding_system_p, 3124 val = Fcompleting_read (prompt, Vobarray, Qcoding_system_p,
3122 Qt, Qnil, Qcoding_system_history, Qnil, Qnil); 3125 Qt, Qnil, Qcoding_system_history,
3126 default_coding_system, Qnil);
3123 return (XSTRING (val)->size == 0 ? Qnil : Fintern (val, Qnil)); 3127 return (XSTRING (val)->size == 0 ? Qnil : Fintern (val, Qnil));
3124 } 3128 }
3125 3129
3126 DEFUN ("check-coding-system", Fcheck_coding_system, Scheck_coding_system, 3130 DEFUN ("check-coding-system", Fcheck_coding_system, Scheck_coding_system,
3127 1, 1, 0, 3131 1, 1, 0,