diff options
author | Richard M. Stallman <rms@gnu.org> | 1997-09-05 05:38:21 +0000 |
---|---|---|
committer | Richard M. Stallman <rms@gnu.org> | 1997-09-05 05:38:21 +0000 |
commit | c5ce38f8099d253638d051b269ab5edc967387cf (patch) | |
tree | 0563b38eaea05ddba3bcdb11d206860e01320e9f | |
parent | 6b47026e2d159a174a714b130dd9392701c567cd (diff) | |
download | emacs-c5ce38f8099d253638d051b269ab5edc967387cf.tar.gz |
(Fread_coding_system): New optional arg DEFAULT_CODING_SYSTEM.
-rw-r--r-- | src/coding.c | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/src/coding.c b/src/coding.c index 4fae220750a..2b46877055d 100644 --- a/src/coding.c +++ b/src/coding.c @@ -3112,14 +3112,18 @@ DEFUN ("read-non-nil-coding-system", Fread_non_nil_coding_system, 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)); } |