# HG changeset patch # User Richard M. Stallman # Date 873437901 0 # Node ID 49a1662b68dda2ab0069a8b0114fee017100a43a # Parent 328233592e3b251984142fc53daf082ab881ed14 (Fread_coding_system): New optional arg DEFAULT_CODING_SYSTEM. diff -r 328233592e3b -r 49a1662b68dd src/coding.c --- a/src/coding.c Fri Sep 05 05:37:59 1997 +0000 +++ b/src/coding.c Fri Sep 05 05:38:21 1997 +0000 @@ -3112,14 +3112,18 @@ return (Fintern (val, Qnil)); } -DEFUN ("read-coding-system", Fread_coding_system, Sread_coding_system, 1, 1, 0, - "Read a coding system or nil from the minibuffer, prompting with string PROMPT.") - (prompt) - Lisp_Object prompt; +DEFUN ("read-coding-system", Fread_coding_system, Sread_coding_system, 1, 2, 0, + "Read a coding system from the minibuffer, prompting with string PROMPT.\n\ +If the user enters null input, return second argument DEFAULT-CODING-SYSTEM.") + (prompt, default_coding_system) + Lisp_Object prompt, default_coding_system; { Lisp_Object val; + if (SYMBOLP (default_coding_system)) + XSETSTRING (default_coding_system, XSYMBOL (default_coding_system)->name); val = Fcompleting_read (prompt, Vobarray, Qcoding_system_p, - Qt, Qnil, Qcoding_system_history, Qnil, Qnil); + Qt, Qnil, Qcoding_system_history, + default_coding_system, Qnil); return (XSTRING (val)->size == 0 ? Qnil : Fintern (val, Qnil)); }