Function: allout-select-safe-coding-system

allout-select-safe-coding-system is a function alias for select-safe-coding-system, defined in mule-cmds.el.gz.

This function is obsolete since 28.1; use select-safe-coding-system instead.

Signature

(allout-select-safe-coding-system FROM TO &optional DEFAULT-CODING-SYSTEM ACCEPT-DEFAULT-P FILE)

Documentation

Ask a user to select a safe coding system from candidates.

The candidates of coding systems which can safely encode a text between FROM and TO are shown in a popup window. Among them, the most proper one is suggested as the default.

The list of buffer-file-coding-system of the current buffer, the default buffer-file-coding-system, and the most preferred coding system (if it corresponds to a MIME charset) is treated as the default coding system list. Among them, the first one that safely encodes the text is normally selected silently and returned without any user interaction. See also the command prefer-coding-system.

However, the user is queried if the chosen coding system is inconsistent with what would be selected by find-auto-coding from coding cookies &c. if the contents of the region were read from a file. (That could lead to data corruption in a file subsequently re-visited and edited.)

Optional 3rd arg DEFAULT-CODING-SYSTEM specifies a coding system or a list of coding systems to be prepended to the default coding system list. However, if DEFAULT-CODING-SYSTEM is a list and the first element is t, the cdr part is used as the default coding system list, i.e. current buffer-file-coding-system, default buffer-file-coding-system, and the most preferred coding system are not used.

Optional 4th arg ACCEPT-DEFAULT-P, if non-nil, is a function to determine the acceptability of the silently selected coding system. It is called with that coding system, and should return nil if it should not be silently selected and thus user interaction is required.

Optional 5th arg FILE is the file name to use for this purpose. That is different from buffer-file-name(var)/buffer-file-name(fun) when handling write-region
(for example).

The variable select-safe-coding-system-accept-default-p, if non-nil, overrides ACCEPT-DEFAULT-P.

Kludgy feature: if FROM is a string, the string is the target text, and TO is ignored.

Aliases

allout-select-safe-coding-system (obsolete since 28.1)