aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKenichi Handa1998-02-04 11:25:47 +0000
committerKenichi Handa1998-02-04 11:25:47 +0000
commitd5266ddfc2dd72dc2878305f12a4720e18fe8e26 (patch)
treed4d2a65fcdfe1727d0286e371c80aa7a68b96efb
parentafe7af84d25ead7b3e273ac308378861271212e5 (diff)
downloademacs-d5266ddfc2dd72dc2878305f12a4720e18fe8e26.tar.gz
emacs-d5266ddfc2dd72dc2878305f12a4720e18fe8e26.zip
(find-safe-coding-system): Return
undecided if FROM == TO. (select-safe-coding-system): Doc-string modified.
-rw-r--r--lisp/international/mule-cmds.el17
1 files changed, 8 insertions, 9 deletions
diff --git a/lisp/international/mule-cmds.el b/lisp/international/mule-cmds.el
index eee8031dec5..41f9bd3da35 100644
--- a/lisp/international/mule-cmds.el
+++ b/lisp/international/mule-cmds.el
@@ -247,8 +247,9 @@ Kludgy feature: if FROM is a string, the string is the target text,
247and TO is ignored." 247and TO is ignored."
248 (let ((charset-list (if (stringp from) (find-charset-string from) 248 (let ((charset-list (if (stringp from) (find-charset-string from)
249 (find-charset-region from to)))) 249 (find-charset-region from to))))
250 (if (and (= (length charset-list) 1) 250 (if (or (null charset-list)
251 (eq 'ascii (car charset-list))) 251 (and (= (length charset-list) 1)
252 (eq 'ascii (car charset-list))))
252 '(undecided) 253 '(undecided)
253 (let ((l coding-system-list) 254 (let ((l coding-system-list)
254 (prefered-codings 255 (prefered-codings
@@ -280,18 +281,16 @@ and TO is ignored."
280 )))) 281 ))))
281 282
282(defun select-safe-coding-system (from to &optional default-coding-system) 283(defun select-safe-coding-system (from to &optional default-coding-system)
283 "Return a coding system which can encode a text between FROM and TO. 284 "Ask a user to select a safe coding system from candidates.
285The candidates of coding systems which can safely encode a text
286between FROM and TO are shown in a popup window.
284 287
285Optional arg DEFAULT-CODING-SYSTEM specifies a coding system to be 288Optional arg DEFAULT-CODING-SYSTEM specifies a coding system to be
286checked at first. If omitted, buffer-file-coding-system of the 289checked at first. If omitted, buffer-file-coding-system of the
287current buffer is used. 290current buffer is used.
288 291
289If the text contains some multibyte characters and 292If the text can be encoded safely by DEFAULT-CODING-SYSTEM, it is
290DEFAULT-CODING-SYSTEM can't encode them, ask a user to select one from 293returned without any user interaction.
291a list of coding systems which can encode the text, and return the
292selected one.
293
294In other cases, return DEFAULT-CODING-SYSTEM.
295 294
296Kludgy feature: if FROM is a string, the string is the target text, 295Kludgy feature: if FROM is a string, the string is the target text,
297and TO is ignored." 296and TO is ignored."