diff options
| author | Richard M. Stallman | 2006-06-10 10:34:35 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 2006-06-10 10:34:35 +0000 |
| commit | 4c02cf8619e158542d4273bda97231b325c63f19 (patch) | |
| tree | 2b54b51a4fcef920c36df91d6683488a159ea12a | |
| parent | f609f34556668ed412455345354beb4c809901fe (diff) | |
| download | emacs-4c02cf8619e158542d4273bda97231b325c63f19.tar.gz emacs-4c02cf8619e158542d4273bda97231b325c63f19.zip | |
(Coding Conventions): Explain use of coding systems
to ensure one decoding for strings.
| -rw-r--r-- | lispref/tips.texi | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/lispref/tips.texi b/lispref/tips.texi index d2060a942bf..727ae6918de 100644 --- a/lispref/tips.texi +++ b/lispref/tips.texi | |||
| @@ -224,6 +224,31 @@ only for special-purpose buffers.) The users will find Emacs more | |||
| 224 | coherent if all libraries use the same conventions. | 224 | coherent if all libraries use the same conventions. |
| 225 | 225 | ||
| 226 | @item | 226 | @item |
| 227 | If your program contains non-ASCII characters in string or character | ||
| 228 | constants, you should make sure Emacs always decodes these characters | ||
| 229 | the same way, regardless of the user's settings. There are two ways | ||
| 230 | to do that: | ||
| 231 | |||
| 232 | @itemize - | ||
| 233 | @item | ||
| 234 | Use coding system @code{emacs-mule}, and specify that for | ||
| 235 | @code{coding} in the @samp{-*-} line or the local variables list. | ||
| 236 | |||
| 237 | @example | ||
| 238 | ;; XXX.el -*- coding: emacs-mule; -*- | ||
| 239 | @end example | ||
| 240 | |||
| 241 | @item | ||
| 242 | Use one of the coding systems based on ISO 2022 (such as | ||
| 243 | iso-8859-@var{n} and iso-2022-7bit), and specify it with @samp{!} at | ||
| 244 | the end for @code{coding}. (The @samp{!} turns off any possible | ||
| 245 | character translation.) | ||
| 246 | |||
| 247 | @example | ||
| 248 | ;; XXX.el -*- coding: iso-latin-2!; -*- | ||
| 249 | @end example | ||
| 250 | |||
| 251 | @item | ||
| 227 | Indent each function with @kbd{C-M-q} (@code{indent-sexp}) using the | 252 | Indent each function with @kbd{C-M-q} (@code{indent-sexp}) using the |
| 228 | default indentation parameters. | 253 | default indentation parameters. |
| 229 | 254 | ||