All Manuals > LispWorks® User Guide and Reference Manual > 47 The SYSTEM Package

find-encoding-option Function

Summary

Examines a buffer for an encoding option.

Package

system

Signature

find-encoding-option pathname ef-spec buffer length => result

Arguments
pathname
Pathname identifying location of buffer.
ef-spec
An external format spec.
buffer
A buffer whose contents are examined.
length
Length (an integer) up to which buffer should be examined.
Values
result
An external format spec.
Description

The function find-encoding-option looks in buffer (bounded by length) for file options (EMACS-style -*- lines) containing an option called encoding or external-format, with value value.

If encoding or external-format is found, it reads value as a Lisp expression in the keyword package. If coding is found, it attempts to translate value from a GNU Emacs coding system name to a LispWorks external-format name.

It then merges ef-spec with the external format spec derived from value, and returns the result as result. Thus it does not override a supplied ef-spec.

pathname is ignored.

See also

*file-encoding-detection-algorithm*


LispWorks® User Guide and Reference Manual - 01 Dec 2021 19:31:02