diff options
| author | Kenichi Handa | 1998-02-04 11:25:47 +0000 |
|---|---|---|
| committer | Kenichi Handa | 1998-02-04 11:25:47 +0000 |
| commit | d5266ddfc2dd72dc2878305f12a4720e18fe8e26 (patch) | |
| tree | d4d2a65fcdfe1727d0286e371c80aa7a68b96efb | |
| parent | afe7af84d25ead7b3e273ac308378861271212e5 (diff) | |
| download | emacs-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.el | 17 |
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, | |||
| 247 | and TO is ignored." | 247 | and 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. |
| 285 | The candidates of coding systems which can safely encode a text | ||
| 286 | between FROM and TO are shown in a popup window. | ||
| 284 | 287 | ||
| 285 | Optional arg DEFAULT-CODING-SYSTEM specifies a coding system to be | 288 | Optional arg DEFAULT-CODING-SYSTEM specifies a coding system to be |
| 286 | checked at first. If omitted, buffer-file-coding-system of the | 289 | checked at first. If omitted, buffer-file-coding-system of the |
| 287 | current buffer is used. | 290 | current buffer is used. |
| 288 | 291 | ||
| 289 | If the text contains some multibyte characters and | 292 | If the text can be encoded safely by DEFAULT-CODING-SYSTEM, it is |
| 290 | DEFAULT-CODING-SYSTEM can't encode them, ask a user to select one from | 293 | returned without any user interaction. |
| 291 | a list of coding systems which can encode the text, and return the | ||
| 292 | selected one. | ||
| 293 | |||
| 294 | In other cases, return DEFAULT-CODING-SYSTEM. | ||
| 295 | 294 | ||
| 296 | Kludgy feature: if FROM is a string, the string is the target text, | 295 | Kludgy feature: if FROM is a string, the string is the target text, |
| 297 | and TO is ignored." | 296 | and TO is ignored." |