]> git.eshelyaron.com Git - emacs.git/commitdiff
(Coding Conventions): Explain use of coding systems
authorRichard M. Stallman <rms@gnu.org>
Sat, 10 Jun 2006 10:34:35 +0000 (10:34 +0000)
committerRichard M. Stallman <rms@gnu.org>
Sat, 10 Jun 2006 10:34:35 +0000 (10:34 +0000)
to ensure one decoding for strings.

lispref/tips.texi

index d2060a942bfeb11b1a6b4c1f2a933fae6622f4d9..727ae6918de397e678ffcf236481a093be7f47b3 100644 (file)
@@ -223,6 +223,31 @@ Lisp, so please don't use it in your programs.  (Emacs uses such names
 only for special-purpose buffers.)  The users will find Emacs more
 coherent if all libraries use the same conventions.
 
+@item
+If your program contains non-ASCII characters in string or character
+constants, you should make sure Emacs always decodes these characters
+the same way, regardless of the user's settings.  There are two ways
+to do that:
+
+@itemize -
+@item
+Use coding system @code{emacs-mule}, and specify that for
+@code{coding} in the @samp{-*-} line or the local variables list.
+
+@example
+;; XXX.el  -*- coding: emacs-mule; -*-
+@end example
+
+@item
+Use one of the coding systems based on ISO 2022 (such as
+iso-8859-@var{n} and iso-2022-7bit), and specify it with @samp{!} at
+the end for @code{coding}.  (The @samp{!} turns off any possible
+character translation.)
+
+@example
+;; XXX.el -*- coding: iso-latin-2!; -*-
+@end example
+
 @item
 Indent each function with @kbd{C-M-q} (@code{indent-sexp}) using the
 default indentation parameters.