]> code.delx.au - gnu-emacs/blobdiff - lispref/nonascii.texi
(Coding Conventions): Better explain reasons not to
[gnu-emacs] / lispref / nonascii.texi
index 73632e36514bf566448a08a253053ce63f55bf80..0f4a70404af2be86dd6a9174c070b211cab34afe 100644 (file)
@@ -1,7 +1,7 @@
 @c -*-texinfo-*-
 @c This is part of the GNU Emacs Lisp Reference Manual.
 @c Copyright (C) 1998, 1999, 2002, 2003, 2004,
-@c   2005 Free Software Foundation, Inc.
+@c   2005, 2006 Free Software Foundation, Inc.
 @c See the file elisp.texi for copying conditions.
 @setfilename ../info/characters
 @node Non-ASCII Characters, Searching and Matching, Text, Top
@@ -484,7 +484,7 @@ of the text in question.
 @defun charset-after &optional pos
 This function return the charset of a character in the current buffer
 at position @var{pos}.  If @var{pos} is omitted or @code{nil}, it
-defauls to the current value of point.  If @var{pos} is out of range,
+defaults to the current value of point.  If @var{pos} is out of range,
 the value is @code{nil}.
 @end defun
 
@@ -578,12 +578,14 @@ coding systems that don't specify any other translation table.
 
 @defvar translation-table-for-input
 Self-inserting characters are translated through this translation
-table before they are inserted.  This variable automatically becomes
-buffer-local when set.
+table before they are inserted.  Search commands also translate their
+input through this table, so they can compare more reliably with
+what's in the buffer.
 
 @code{set-buffer-file-coding-system} sets this variable so that your
 keyboard input gets translated into the character sets that the buffer
-is likely to contain.
+is likely to contain.  This variable automatically becomes
+buffer-local when set.
 @end defvar
 
 @node Coding Systems
@@ -803,6 +805,35 @@ If that is valid, it returns @var{coding-system}.
 Otherwise it signals an error with condition @code{coding-system-error}.
 @end defun
 
+@cindex EOL conversion
+@cindex end-of-line conversion
+@cindex line end conversion
+@defun coding-system-eol-type coding-system
+This function returns the type of end-of-line (a.k.a.@: @dfn{eol})
+conversion used by @var{coding-system}.  If @var{coding-system}
+specifies a certain eol conversion, the return value is an integer 0,
+1, or 2, standing for @code{unix}, @code{dos}, and @code{mac},
+respectively.  If @var{coding-system} doesn't specify eol conversion
+explicitly, the return value is a vector of coding systems, each one
+with one of the possible eol conversion types, like this:
+
+@lisp
+(coding-system-eol-type 'latin-1)
+     @result{} [latin-1-unix latin-1-dos latin-1-mac]
+@end lisp
+
+@noindent
+If this function returns a vector, Emacs will decide, as part of the
+text encoding or decoding process, what eol conversion to use.  For
+decoding, the end-of-line format of the text is auto-detected, and the
+eol conversion is set to match it (e.g., DOS-style CRLF format will
+imply @code{dos} eol conversion).  For encoding, the eol conversion is
+taken from the appropriate default coding system (e.g.,
+@code{default-buffer-file-coding-system} for
+@code{buffer-file-coding-system}), or from the default eol conversion
+appropriate for the underlying platform.
+@end defun
+
 @defun coding-system-change-eol-conversion coding-system eol-type
 This function returns a coding system which is like @var{coding-system}
 except for its eol conversion, which is specified by @code{eol-type}.
@@ -1172,7 +1203,7 @@ encoding by binding @code{coding-system-for-write} to
 @code{no-conversion}.
 
   Here are the functions to perform explicit encoding or decoding.  The
-decoding functions produce sequences of bytes; the encoding functions
+encoding functions produce sequences of bytes; the decoding functions
 are meant to operate on sequences of bytes.  All of these functions
 discard text properties.