annotate lisp/code-init.el @ 5160:ab9ee10a53e4

fix various problems with allocation statistics, track overhead properly -------------------- ChangeLog entries follow: -------------------- lisp/ChangeLog addition: 2010-03-20 Ben Wing <ben@xemacs.org> * diagnose.el (show-memory-usage): * diagnose.el (show-object-memory-usage-stats): Further changes to correspond with changes in the C code; add an additional column showing the overhead used with each type, and add it into the grand total memory usage. src/ChangeLog addition: 2010-03-20 Ben Wing <ben@xemacs.org> * alloc.c: * alloc.c (init_lrecord_stats): * alloc.c (free_normal_lisp_object): * alloc.c (struct): * alloc.c (clear_lrecord_stats): * alloc.c (tick_lrecord_stats): * alloc.c (COUNT_FROB_BLOCK_USAGE): * alloc.c (COPY_INTO_LRECORD_STATS): * alloc.c (sweep_strings): * alloc.c (UNMARK_string): * alloc.c (gc_sweep_1): * alloc.c (finish_object_memory_usage_stats): * alloc.c (object_memory_usage_stats): * alloc.c (object_dead_p): * alloc.c (fixed_type_block_overhead): * alloc.c (lisp_object_storage_size): * emacs.c (main_1): * lisp.h: * lrecord.h: Export lisp_object_storage_size() and malloced_storage_size() even when not MEMORY_USAGE_STATS, to get the non-MEMORY_USAGE_STATS build to compile. Don't export fixed_type_block_overhead() any more. Some code cleanup, rearrangement, add some section headers. Clean up various bugs especially involving computation of overhead and double-counting certain usage in total_gc_usage. Add statistics computing the overhead used by all types. Don't add a special entry for string headers in the object-memory-usage-stats because it's already present as just "string". But do count the overhead used by long strings. Don't try to call the memory_usage() methods when NEW_GC because there's nowhere obvious in the sweep stage to make the calls. * marker.c (compute_buffer_marker_usage): Just use lisp_object_storage_size() rather than trying to reimplement it.
author Ben Wing <ben@xemacs.org>
date Sat, 20 Mar 2010 20:20:30 -0500
parents d2ec55325515
children 308d34e9f07d
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
771
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents:
diff changeset
1 ;;; code-init.el --- Handle coding system default values
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents:
diff changeset
2
4989
d2ec55325515 make utf-8 default for Cygwin 1.7, rewrite init code determining default coding systems
Ben Wing <ben@xemacs.org>
parents: 4568
diff changeset
3 ;; Copyright (C) 2001, 2002, 2003, 2010 Ben Wing.
771
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents:
diff changeset
4
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents:
diff changeset
5 ;; This file is part of XEmacs.
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents:
diff changeset
6
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents:
diff changeset
7 ;; XEmacs is free software; you can redistribute it and/or modify it
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents:
diff changeset
8 ;; under the terms of the GNU General Public License as published by
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents:
diff changeset
9 ;; the Free Software Foundation; either version 2, or (at your option)
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents:
diff changeset
10 ;; any later version.
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents:
diff changeset
11
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents:
diff changeset
12 ;; XEmacs is distributed in the hope that it will be useful, but
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents:
diff changeset
13 ;; WITHOUT ANY WARRANTY; without even the implied warranty of
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents:
diff changeset
14 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents:
diff changeset
15 ;; General Public License for more details.
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents:
diff changeset
16
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents:
diff changeset
17 ;; You should have received a copy of the GNU General Public License
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents:
diff changeset
18 ;; along with XEmacs; see the file COPYING. If not, write to the
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents:
diff changeset
19 ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents:
diff changeset
20 ;; Boston, MA 02111-1307, USA.
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents:
diff changeset
21
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents:
diff changeset
22 ;;; Commentary:
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents:
diff changeset
23
4989
d2ec55325515 make utf-8 default for Cygwin 1.7, rewrite init code determining default coding systems
Ben Wing <ben@xemacs.org>
parents: 4568
diff changeset
24 ;; Author: Ben wing, 2001?
d2ec55325515 make utf-8 default for Cygwin 1.7, rewrite init code determining default coding systems
Ben Wing <ben@xemacs.org>
parents: 4568
diff changeset
25
771
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents:
diff changeset
26 ;; Placed in a separate file so it can be loaded after the various
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents:
diff changeset
27 ;; coding systems have been created, because we'll be using them at
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents:
diff changeset
28 ;; load time.
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents:
diff changeset
29
2297
13a418960a88 [xemacs-hg @ 2004-09-22 02:05:42 by stephent]
stephent
parents: 2071
diff changeset
30 ;; #### Issues (this discussion probably belongs elsewhere)
13a418960a88 [xemacs-hg @ 2004-09-22 02:05:42 by stephent]
stephent
parents: 2071
diff changeset
31 ;; 1. "Big" characters are unrepresentable. Should give error, warning,
13a418960a88 [xemacs-hg @ 2004-09-22 02:05:42 by stephent]
stephent
parents: 2071
diff changeset
32 ;; not just substitute "~".
13a418960a88 [xemacs-hg @ 2004-09-22 02:05:42 by stephent]
stephent
parents: 2071
diff changeset
33 ;; 2. 21.4 compatibility?
13a418960a88 [xemacs-hg @ 2004-09-22 02:05:42 by stephent]
stephent
parents: 2071
diff changeset
34 ;; 3. make-char: non-mule barfs on non-iso8859-1.
13a418960a88 [xemacs-hg @ 2004-09-22 02:05:42 by stephent]
stephent
parents: 2071
diff changeset
35
771
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents:
diff changeset
36 ;;; Code:
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents:
diff changeset
37
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents:
diff changeset
38 (defcustom eol-detection-enabled-p (or (featurep 'mule)
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents:
diff changeset
39 (memq system-type '(windows-nt
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents:
diff changeset
40 cygwin32))
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents:
diff changeset
41 (featurep 'unix-default-eol-detection))
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents:
diff changeset
42 "True if XEmacs automatically detects the EOL type when reading files.
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents:
diff changeset
43 Normally, this is always the case on Windows or when international (Mule)
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents:
diff changeset
44 support is compiled into this XEmacs. Otherwise, it is currently off by
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents:
diff changeset
45 default, but this may change. Don't set this; nothing will happen. Instead,
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents:
diff changeset
46 use the Options menu or `set-eol-detection'."
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents:
diff changeset
47 :group 'encoding
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents:
diff changeset
48 :type 'boolean
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents:
diff changeset
49 ;; upon initialization, we don't want the whole business of
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents:
diff changeset
50 ;; set-eol-detection to be called. We will init everything appropriately
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents:
diff changeset
51 ;; later in the same file, when reset-language-environment is called.
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents:
diff changeset
52 :initialize #'(lambda (var val)
1698
4b7295e5a412 [xemacs-hg @ 2003-09-19 16:32:56 by youngs]
youngs
parents: 1471
diff changeset
53 (setq eol-detection-enabled-p (eval val)))
771
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents:
diff changeset
54 :set #'(lambda (var val)
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents:
diff changeset
55 (set-eol-detection val)
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents:
diff changeset
56 (setq eol-detection-enabled-p val)))
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents:
diff changeset
57
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents:
diff changeset
58 (defun set-eol-detection (flag)
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents:
diff changeset
59 "Enable (if FLAG is non-nil) or disable automatic EOL detection of files.
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents:
diff changeset
60 EOL detection is enabled by default on Windows or when international (Mule)
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents:
diff changeset
61 support is compiled into this XEmacs. Otherwise, it is currently off by
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents:
diff changeset
62 default, but this may change. NOTE: You *REALLY* should not turn off EOL
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents:
diff changeset
63 detection on Windows! Your files will have lots of annoying ^M's in them
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents:
diff changeset
64 if you do this."
4989
d2ec55325515 make utf-8 default for Cygwin 1.7, rewrite init code determining default coding systems
Ben Wing <ben@xemacs.org>
parents: 4568
diff changeset
65 (dolist (x '(bfcs-for-read
771
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents:
diff changeset
66 keyboard
4989
d2ec55325515 make utf-8 default for Cygwin 1.7, rewrite init code determining default coding systems
Ben Wing <ben@xemacs.org>
parents: 4568
diff changeset
67 process-read
d2ec55325515 make utf-8 default for Cygwin 1.7, rewrite init code determining default coding systems
Ben Wing <ben@xemacs.org>
parents: 4568
diff changeset
68 no-conv-cs))
771
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents:
diff changeset
69 (set-coding-system-variable
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents:
diff changeset
70 x (coding-system-change-eol-conversion (get-coding-system-variable x)
2508
14f65fa1e69e [xemacs-hg @ 2005-01-26 09:51:22 by ben]
ben
parents: 2297
diff changeset
71 (if flag nil 'lf)))))
771
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents:
diff changeset
72
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents:
diff changeset
73 (defun coding-system-current-system-configuration ()
4989
d2ec55325515 make utf-8 default for Cygwin 1.7, rewrite init code determining default coding systems
Ben Wing <ben@xemacs.org>
parents: 4568
diff changeset
74 "Function to decide which default coding system configuration applies."
d2ec55325515 make utf-8 default for Cygwin 1.7, rewrite init code determining default coding systems
Ben Wing <ben@xemacs.org>
parents: 4568
diff changeset
75 (cond ((featurep 'cygwin-use-utf-8) 'cygwin-utf-8)
d2ec55325515 make utf-8 default for Cygwin 1.7, rewrite init code determining default coding systems
Ben Wing <ben@xemacs.org>
parents: 4568
diff changeset
76 ((memq system-type '(windows-nt cygwin32))
771
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents:
diff changeset
77 (if (featurep 'mule) 'windows-mule 'windows-no-mule))
4989
d2ec55325515 make utf-8 default for Cygwin 1.7, rewrite init code determining default coding systems
Ben Wing <ben@xemacs.org>
parents: 4568
diff changeset
78 ((featurep 'mule) 'mule)
d2ec55325515 make utf-8 default for Cygwin 1.7, rewrite init code determining default coding systems
Ben Wing <ben@xemacs.org>
parents: 4568
diff changeset
79 (eol-detection-enabled-p 'no-mule-eol-detection)
d2ec55325515 make utf-8 default for Cygwin 1.7, rewrite init code determining default coding systems
Ben Wing <ben@xemacs.org>
parents: 4568
diff changeset
80 (t 'no-mule-no-eol-detection)))
d2ec55325515 make utf-8 default for Cygwin 1.7, rewrite init code determining default coding systems
Ben Wing <ben@xemacs.org>
parents: 4568
diff changeset
81
d2ec55325515 make utf-8 default for Cygwin 1.7, rewrite init code determining default coding systems
Ben Wing <ben@xemacs.org>
parents: 4568
diff changeset
82 (defvar coding-system-default-configuration-table (make-hash-table))
d2ec55325515 make utf-8 default for Cygwin 1.7, rewrite init code determining default coding systems
Ben Wing <ben@xemacs.org>
parents: 4568
diff changeset
83
d2ec55325515 make utf-8 default for Cygwin 1.7, rewrite init code determining default coding systems
Ben Wing <ben@xemacs.org>
parents: 4568
diff changeset
84 (defun define-coding-system-default-configuration (name doc props)
d2ec55325515 make utf-8 default for Cygwin 1.7, rewrite init code determining default coding systems
Ben Wing <ben@xemacs.org>
parents: 4568
diff changeset
85 (puthash name (nconc `(doc ,doc) props)
d2ec55325515 make utf-8 default for Cygwin 1.7, rewrite init code determining default coding systems
Ben Wing <ben@xemacs.org>
parents: 4568
diff changeset
86 coding-system-default-configuration-table))
771
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents:
diff changeset
87
1318
b531bf8658e9 [xemacs-hg @ 2003-02-21 06:56:46 by ben]
ben
parents: 985
diff changeset
88 ;; NOTE NOTE NOTE: These values may get overridden when the language
b531bf8658e9 [xemacs-hg @ 2003-02-21 06:56:46 by ben]
ben
parents: 985
diff changeset
89 ;; environment is initialized (set-language-environment-coding-systems).
4989
d2ec55325515 make utf-8 default for Cygwin 1.7, rewrite init code determining default coding systems
Ben Wing <ben@xemacs.org>
parents: 4568
diff changeset
90 (define-coding-system-default-configuration
d2ec55325515 make utf-8 default for Cygwin 1.7, rewrite init code determining default coding systems
Ben Wing <ben@xemacs.org>
parents: 4568
diff changeset
91 'no-mule-no-eol-detection
d2ec55325515 make utf-8 default for Cygwin 1.7, rewrite init code determining default coding systems
Ben Wing <ben@xemacs.org>
parents: 4568
diff changeset
92 "No Mule support, EOL detection not enabled."
d2ec55325515 make utf-8 default for Cygwin 1.7, rewrite init code determining default coding systems
Ben Wing <ben@xemacs.org>
parents: 4568
diff changeset
93 '(bfcs-for-read binary
d2ec55325515 make utf-8 default for Cygwin 1.7, rewrite init code determining default coding systems
Ben Wing <ben@xemacs.org>
parents: 4568
diff changeset
94 default-bfcs binary
d2ec55325515 make utf-8 default for Cygwin 1.7, rewrite init code determining default coding systems
Ben Wing <ben@xemacs.org>
parents: 4568
diff changeset
95 process-read binary
d2ec55325515 make utf-8 default for Cygwin 1.7, rewrite init code determining default coding systems
Ben Wing <ben@xemacs.org>
parents: 4568
diff changeset
96 process-write binary
d2ec55325515 make utf-8 default for Cygwin 1.7, rewrite init code determining default coding systems
Ben Wing <ben@xemacs.org>
parents: 4568
diff changeset
97 keyboard binary
d2ec55325515 make utf-8 default for Cygwin 1.7, rewrite init code determining default coding systems
Ben Wing <ben@xemacs.org>
parents: 4568
diff changeset
98 native binary
d2ec55325515 make utf-8 default for Cygwin 1.7, rewrite init code determining default coding systems
Ben Wing <ben@xemacs.org>
parents: 4568
diff changeset
99 no-conv-cs binary
d2ec55325515 make utf-8 default for Cygwin 1.7, rewrite init code determining default coding systems
Ben Wing <ben@xemacs.org>
parents: 4568
diff changeset
100 terminal binary))
d2ec55325515 make utf-8 default for Cygwin 1.7, rewrite init code determining default coding systems
Ben Wing <ben@xemacs.org>
parents: 4568
diff changeset
101
d2ec55325515 make utf-8 default for Cygwin 1.7, rewrite init code determining default coding systems
Ben Wing <ben@xemacs.org>
parents: 4568
diff changeset
102 (define-coding-system-default-configuration
d2ec55325515 make utf-8 default for Cygwin 1.7, rewrite init code determining default coding systems
Ben Wing <ben@xemacs.org>
parents: 4568
diff changeset
103 'no-mule-eol-detection
d2ec55325515 make utf-8 default for Cygwin 1.7, rewrite init code determining default coding systems
Ben Wing <ben@xemacs.org>
parents: 4568
diff changeset
104 "No Mule support, EOL detection enabled."
d2ec55325515 make utf-8 default for Cygwin 1.7, rewrite init code determining default coding systems
Ben Wing <ben@xemacs.org>
parents: 4568
diff changeset
105 '(bfcs-for-read raw-text
d2ec55325515 make utf-8 default for Cygwin 1.7, rewrite init code determining default coding systems
Ben Wing <ben@xemacs.org>
parents: 4568
diff changeset
106 default-bfcs binary
d2ec55325515 make utf-8 default for Cygwin 1.7, rewrite init code determining default coding systems
Ben Wing <ben@xemacs.org>
parents: 4568
diff changeset
107 process-read raw-text
d2ec55325515 make utf-8 default for Cygwin 1.7, rewrite init code determining default coding systems
Ben Wing <ben@xemacs.org>
parents: 4568
diff changeset
108 process-write binary
d2ec55325515 make utf-8 default for Cygwin 1.7, rewrite init code determining default coding systems
Ben Wing <ben@xemacs.org>
parents: 4568
diff changeset
109 keyboard raw-text
d2ec55325515 make utf-8 default for Cygwin 1.7, rewrite init code determining default coding systems
Ben Wing <ben@xemacs.org>
parents: 4568
diff changeset
110 native binary
d2ec55325515 make utf-8 default for Cygwin 1.7, rewrite init code determining default coding systems
Ben Wing <ben@xemacs.org>
parents: 4568
diff changeset
111 no-conv-cs raw-text
d2ec55325515 make utf-8 default for Cygwin 1.7, rewrite init code determining default coding systems
Ben Wing <ben@xemacs.org>
parents: 4568
diff changeset
112 terminal binary))
d2ec55325515 make utf-8 default for Cygwin 1.7, rewrite init code determining default coding systems
Ben Wing <ben@xemacs.org>
parents: 4568
diff changeset
113
d2ec55325515 make utf-8 default for Cygwin 1.7, rewrite init code determining default coding systems
Ben Wing <ben@xemacs.org>
parents: 4568
diff changeset
114 (define-coding-system-default-configuration
d2ec55325515 make utf-8 default for Cygwin 1.7, rewrite init code determining default coding systems
Ben Wing <ben@xemacs.org>
parents: 4568
diff changeset
115 'mule
d2ec55325515 make utf-8 default for Cygwin 1.7, rewrite init code determining default coding systems
Ben Wing <ben@xemacs.org>
parents: 4568
diff changeset
116 "Mule support enabled."
d2ec55325515 make utf-8 default for Cygwin 1.7, rewrite init code determining default coding systems
Ben Wing <ben@xemacs.org>
parents: 4568
diff changeset
117 '(bfcs-for-read undecided
d2ec55325515 make utf-8 default for Cygwin 1.7, rewrite init code determining default coding systems
Ben Wing <ben@xemacs.org>
parents: 4568
diff changeset
118 default-bfcs iso-2022-8
d2ec55325515 make utf-8 default for Cygwin 1.7, rewrite init code determining default coding systems
Ben Wing <ben@xemacs.org>
parents: 4568
diff changeset
119 process-read undecided
d2ec55325515 make utf-8 default for Cygwin 1.7, rewrite init code determining default coding systems
Ben Wing <ben@xemacs.org>
parents: 4568
diff changeset
120 process-write binary
d2ec55325515 make utf-8 default for Cygwin 1.7, rewrite init code determining default coding systems
Ben Wing <ben@xemacs.org>
parents: 4568
diff changeset
121 keyboard undecided-unix
d2ec55325515 make utf-8 default for Cygwin 1.7, rewrite init code determining default coding systems
Ben Wing <ben@xemacs.org>
parents: 4568
diff changeset
122 native binary
d2ec55325515 make utf-8 default for Cygwin 1.7, rewrite init code determining default coding systems
Ben Wing <ben@xemacs.org>
parents: 4568
diff changeset
123 no-conv-cs raw-text
d2ec55325515 make utf-8 default for Cygwin 1.7, rewrite init code determining default coding systems
Ben Wing <ben@xemacs.org>
parents: 4568
diff changeset
124 terminal binary))
771
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents:
diff changeset
125
4989
d2ec55325515 make utf-8 default for Cygwin 1.7, rewrite init code determining default coding systems
Ben Wing <ben@xemacs.org>
parents: 4568
diff changeset
126 (define-coding-system-default-configuration
d2ec55325515 make utf-8 default for Cygwin 1.7, rewrite init code determining default coding systems
Ben Wing <ben@xemacs.org>
parents: 4568
diff changeset
127 'windows-no-mule
d2ec55325515 make utf-8 default for Cygwin 1.7, rewrite init code determining default coding systems
Ben Wing <ben@xemacs.org>
parents: 4568
diff changeset
128 "Microsoft Windows, no Mule support."
d2ec55325515 make utf-8 default for Cygwin 1.7, rewrite init code determining default coding systems
Ben Wing <ben@xemacs.org>
parents: 4568
diff changeset
129 '(bfcs-for-read raw-text
d2ec55325515 make utf-8 default for Cygwin 1.7, rewrite init code determining default coding systems
Ben Wing <ben@xemacs.org>
parents: 4568
diff changeset
130 default-bfcs raw-text-dos
d2ec55325515 make utf-8 default for Cygwin 1.7, rewrite init code determining default coding systems
Ben Wing <ben@xemacs.org>
parents: 4568
diff changeset
131 process-read raw-text
d2ec55325515 make utf-8 default for Cygwin 1.7, rewrite init code determining default coding systems
Ben Wing <ben@xemacs.org>
parents: 4568
diff changeset
132 process-write raw-text
d2ec55325515 make utf-8 default for Cygwin 1.7, rewrite init code determining default coding systems
Ben Wing <ben@xemacs.org>
parents: 4568
diff changeset
133 keyboard raw-text
d2ec55325515 make utf-8 default for Cygwin 1.7, rewrite init code determining default coding systems
Ben Wing <ben@xemacs.org>
parents: 4568
diff changeset
134 native raw-text-dos
d2ec55325515 make utf-8 default for Cygwin 1.7, rewrite init code determining default coding systems
Ben Wing <ben@xemacs.org>
parents: 4568
diff changeset
135 no-conv-cs raw-text
d2ec55325515 make utf-8 default for Cygwin 1.7, rewrite init code determining default coding systems
Ben Wing <ben@xemacs.org>
parents: 4568
diff changeset
136 terminal binary))
d2ec55325515 make utf-8 default for Cygwin 1.7, rewrite init code determining default coding systems
Ben Wing <ben@xemacs.org>
parents: 4568
diff changeset
137
d2ec55325515 make utf-8 default for Cygwin 1.7, rewrite init code determining default coding systems
Ben Wing <ben@xemacs.org>
parents: 4568
diff changeset
138 (define-coding-system-default-configuration
d2ec55325515 make utf-8 default for Cygwin 1.7, rewrite init code determining default coding systems
Ben Wing <ben@xemacs.org>
parents: 4568
diff changeset
139 'windows-mule
d2ec55325515 make utf-8 default for Cygwin 1.7, rewrite init code determining default coding systems
Ben Wing <ben@xemacs.org>
parents: 4568
diff changeset
140 "Microsoft Windows, Mule support enabled."
d2ec55325515 make utf-8 default for Cygwin 1.7, rewrite init code determining default coding systems
Ben Wing <ben@xemacs.org>
parents: 4568
diff changeset
141 '(bfcs-for-read undecided
d2ec55325515 make utf-8 default for Cygwin 1.7, rewrite init code determining default coding systems
Ben Wing <ben@xemacs.org>
parents: 4568
diff changeset
142 default-bfcs mswindows-multibyte-dos
d2ec55325515 make utf-8 default for Cygwin 1.7, rewrite init code determining default coding systems
Ben Wing <ben@xemacs.org>
parents: 4568
diff changeset
143 process-read undecided
d2ec55325515 make utf-8 default for Cygwin 1.7, rewrite init code determining default coding systems
Ben Wing <ben@xemacs.org>
parents: 4568
diff changeset
144 process-write mswindows-multibyte-system-default
d2ec55325515 make utf-8 default for Cygwin 1.7, rewrite init code determining default coding systems
Ben Wing <ben@xemacs.org>
parents: 4568
diff changeset
145 keyboard undecided-unix
d2ec55325515 make utf-8 default for Cygwin 1.7, rewrite init code determining default coding systems
Ben Wing <ben@xemacs.org>
parents: 4568
diff changeset
146 native mswindows-multibyte-system-default-dos
d2ec55325515 make utf-8 default for Cygwin 1.7, rewrite init code determining default coding systems
Ben Wing <ben@xemacs.org>
parents: 4568
diff changeset
147 no-conv-cs mswindows-multibyte
d2ec55325515 make utf-8 default for Cygwin 1.7, rewrite init code determining default coding systems
Ben Wing <ben@xemacs.org>
parents: 4568
diff changeset
148 terminal mswindows-multibyte-unix))
d2ec55325515 make utf-8 default for Cygwin 1.7, rewrite init code determining default coding systems
Ben Wing <ben@xemacs.org>
parents: 4568
diff changeset
149
d2ec55325515 make utf-8 default for Cygwin 1.7, rewrite init code determining default coding systems
Ben Wing <ben@xemacs.org>
parents: 4568
diff changeset
150 (define-coding-system-default-configuration
d2ec55325515 make utf-8 default for Cygwin 1.7, rewrite init code determining default coding systems
Ben Wing <ben@xemacs.org>
parents: 4568
diff changeset
151 'cygwin-utf-8
d2ec55325515 make utf-8 default for Cygwin 1.7, rewrite init code determining default coding systems
Ben Wing <ben@xemacs.org>
parents: 4568
diff changeset
152 "Mule support enabled."
d2ec55325515 make utf-8 default for Cygwin 1.7, rewrite init code determining default coding systems
Ben Wing <ben@xemacs.org>
parents: 4568
diff changeset
153 '(bfcs-for-read undecided
d2ec55325515 make utf-8 default for Cygwin 1.7, rewrite init code determining default coding systems
Ben Wing <ben@xemacs.org>
parents: 4568
diff changeset
154 default-bfcs utf-8
d2ec55325515 make utf-8 default for Cygwin 1.7, rewrite init code determining default coding systems
Ben Wing <ben@xemacs.org>
parents: 4568
diff changeset
155 process-read utf-8
d2ec55325515 make utf-8 default for Cygwin 1.7, rewrite init code determining default coding systems
Ben Wing <ben@xemacs.org>
parents: 4568
diff changeset
156 process-write utf-8
d2ec55325515 make utf-8 default for Cygwin 1.7, rewrite init code determining default coding systems
Ben Wing <ben@xemacs.org>
parents: 4568
diff changeset
157 keyboard utf-8
d2ec55325515 make utf-8 default for Cygwin 1.7, rewrite init code determining default coding systems
Ben Wing <ben@xemacs.org>
parents: 4568
diff changeset
158 native utf-8
d2ec55325515 make utf-8 default for Cygwin 1.7, rewrite init code determining default coding systems
Ben Wing <ben@xemacs.org>
parents: 4568
diff changeset
159 no-conv-cs utf-8
d2ec55325515 make utf-8 default for Cygwin 1.7, rewrite init code determining default coding systems
Ben Wing <ben@xemacs.org>
parents: 4568
diff changeset
160 terminal utf-8))
771
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents:
diff changeset
161
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents:
diff changeset
162 (defvar coding-system-default-variable-list
4989
d2ec55325515 make utf-8 default for Cygwin 1.7, rewrite init code determining default coding systems
Ben Wing <ben@xemacs.org>
parents: 4568
diff changeset
163 '(bfcs-for-read
d2ec55325515 make utf-8 default for Cygwin 1.7, rewrite init code determining default coding systems
Ben Wing <ben@xemacs.org>
parents: 4568
diff changeset
164 default-bfcs
771
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents:
diff changeset
165 native
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents:
diff changeset
166 keyboard
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents:
diff changeset
167 terminal
4989
d2ec55325515 make utf-8 default for Cygwin 1.7, rewrite init code determining default coding systems
Ben Wing <ben@xemacs.org>
parents: 4568
diff changeset
168 process-read
d2ec55325515 make utf-8 default for Cygwin 1.7, rewrite init code determining default coding systems
Ben Wing <ben@xemacs.org>
parents: 4568
diff changeset
169 process-write
d2ec55325515 make utf-8 default for Cygwin 1.7, rewrite init code determining default coding systems
Ben Wing <ben@xemacs.org>
parents: 4568
diff changeset
170 no-conv-cs))
771
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents:
diff changeset
171
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents:
diff changeset
172 (defun get-coding-system-variable (var)
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents:
diff changeset
173 "Return the value of a basic coding system variable.
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents:
diff changeset
174 This is intended as a uniform interface onto the coding system settings that
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents:
diff changeset
175 control how encoding detection and conversion works. See
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents:
diff changeset
176 `coding-system-variable-default-value' for a list of the possible values of
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents:
diff changeset
177 VAR."
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents:
diff changeset
178 (case var
4989
d2ec55325515 make utf-8 default for Cygwin 1.7, rewrite init code determining default coding systems
Ben Wing <ben@xemacs.org>
parents: 4568
diff changeset
179 (bfcs-for-read buffer-file-coding-system-for-read)
d2ec55325515 make utf-8 default for Cygwin 1.7, rewrite init code determining default coding systems
Ben Wing <ben@xemacs.org>
parents: 4568
diff changeset
180 (default-bfcs
771
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents:
diff changeset
181 (default-value 'buffer-file-coding-system))
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents:
diff changeset
182 (native (coding-system-aliasee 'native))
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents:
diff changeset
183 (keyboard (coding-system-aliasee 'keyboard))
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents:
diff changeset
184 (terminal (coding-system-aliasee 'terminal))
4989
d2ec55325515 make utf-8 default for Cygwin 1.7, rewrite init code determining default coding systems
Ben Wing <ben@xemacs.org>
parents: 4568
diff changeset
185 (process-read (car default-process-coding-system))
d2ec55325515 make utf-8 default for Cygwin 1.7, rewrite init code determining default coding systems
Ben Wing <ben@xemacs.org>
parents: 4568
diff changeset
186 (process-write (cdr default-process-coding-system))
d2ec55325515 make utf-8 default for Cygwin 1.7, rewrite init code determining default coding systems
Ben Wing <ben@xemacs.org>
parents: 4568
diff changeset
187 (no-conv-cs
2508
14f65fa1e69e [xemacs-hg @ 2005-01-26 09:51:22 by ben]
ben
parents: 2297
diff changeset
188 (coding-category-system 'no-conversion))
771
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents:
diff changeset
189 (t (error 'invalid-constant "Invalid coding system variable" var))))
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents:
diff changeset
190
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents:
diff changeset
191 (defun set-coding-system-variable (var value)
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents:
diff changeset
192 "Set a basic coding system variable to VALUE.
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents:
diff changeset
193 This is intended as a uniform interface onto the coding system settings that
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents:
diff changeset
194 control how encoding detection and conversion works. See
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents:
diff changeset
195 `coding-system-variable-default-value' for a list of the possible values of
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents:
diff changeset
196 VAR."
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents:
diff changeset
197 (case var
4989
d2ec55325515 make utf-8 default for Cygwin 1.7, rewrite init code determining default coding systems
Ben Wing <ben@xemacs.org>
parents: 4568
diff changeset
198 (bfcs-for-read
771
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents:
diff changeset
199 (set-buffer-file-coding-system-for-read value))
4989
d2ec55325515 make utf-8 default for Cygwin 1.7, rewrite init code determining default coding systems
Ben Wing <ben@xemacs.org>
parents: 4568
diff changeset
200 (default-bfcs
771
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents:
diff changeset
201 (set-default-buffer-file-coding-system value))
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents:
diff changeset
202 (native (define-coding-system-alias 'native value))
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents:
diff changeset
203 (keyboard (set-keyboard-coding-system value))
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents:
diff changeset
204 (terminal (set-terminal-coding-system value))
4989
d2ec55325515 make utf-8 default for Cygwin 1.7, rewrite init code determining default coding systems
Ben Wing <ben@xemacs.org>
parents: 4568
diff changeset
205 (process-read
771
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents:
diff changeset
206 (setq default-process-coding-system
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents:
diff changeset
207 (cons value (cdr default-process-coding-system))))
4989
d2ec55325515 make utf-8 default for Cygwin 1.7, rewrite init code determining default coding systems
Ben Wing <ben@xemacs.org>
parents: 4568
diff changeset
208 (process-write
771
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents:
diff changeset
209 (setq default-process-coding-system
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents:
diff changeset
210 (cons (car default-process-coding-system) value)))
4989
d2ec55325515 make utf-8 default for Cygwin 1.7, rewrite init code determining default coding systems
Ben Wing <ben@xemacs.org>
parents: 4568
diff changeset
211 (no-conv-cs
2508
14f65fa1e69e [xemacs-hg @ 2005-01-26 09:51:22 by ben]
ben
parents: 2297
diff changeset
212 (set-coding-category-system 'no-conversion value))
771
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents:
diff changeset
213 (t (error 'invalid-constant "Invalid coding system variable" var))))
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents:
diff changeset
214
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents:
diff changeset
215 (defun coding-system-variable-default-value (var &optional config)
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents:
diff changeset
216 "Return the appropriate default value for a coding system variable.
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents:
diff changeset
217
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents:
diff changeset
218 VAR specifies the variable, and CONFIG the configuration, defaulting
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents:
diff changeset
219 to the current system configuration (as returned by
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents:
diff changeset
220 `coding-system-current-system-configuration').
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents:
diff changeset
221
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents:
diff changeset
222 The table of default values looks like this: (see below for abbreviations)
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents:
diff changeset
223
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents:
diff changeset
224
4989
d2ec55325515 make utf-8 default for Cygwin 1.7, rewrite init code determining default coding systems
Ben Wing <ben@xemacs.org>
parents: 4568
diff changeset
225 NoMule NoMuleEOL Mule MSW MSWMule CygUTF
d2ec55325515 make utf-8 default for Cygwin 1.7, rewrite init code determining default coding systems
Ben Wing <ben@xemacs.org>
parents: 4568
diff changeset
226 ------------------------------------------------------------------------------
d2ec55325515 make utf-8 default for Cygwin 1.7, rewrite init code determining default coding systems
Ben Wing <ben@xemacs.org>
parents: 4568
diff changeset
227 bfcs-for-read binary raw-text undecided raw-text undecided undecided
d2ec55325515 make utf-8 default for Cygwin 1.7, rewrite init code determining default coding systems
Ben Wing <ben@xemacs.org>
parents: 4568
diff changeset
228 default-bfcs binary binary iso-2022-8 raw-text-dos MSW-MB-dos utf-8
d2ec55325515 make utf-8 default for Cygwin 1.7, rewrite init code determining default coding systems
Ben Wing <ben@xemacs.org>
parents: 4568
diff changeset
229 native binary binary binary raw-text-dos MSW-MB-SD-dos utf-8
d2ec55325515 make utf-8 default for Cygwin 1.7, rewrite init code determining default coding systems
Ben Wing <ben@xemacs.org>
parents: 4568
diff changeset
230 keyboard binary raw-text undecided- raw-text undecided- utf-8
d2ec55325515 make utf-8 default for Cygwin 1.7, rewrite init code determining default coding systems
Ben Wing <ben@xemacs.org>
parents: 4568
diff changeset
231 unix unix
d2ec55325515 make utf-8 default for Cygwin 1.7, rewrite init code determining default coding systems
Ben Wing <ben@xemacs.org>
parents: 4568
diff changeset
232 terminal binary binary binary binary MSW-MB-unix utf-8
d2ec55325515 make utf-8 default for Cygwin 1.7, rewrite init code determining default coding systems
Ben Wing <ben@xemacs.org>
parents: 4568
diff changeset
233 process-read binary raw-text undecided raw-text undecided utf-8
d2ec55325515 make utf-8 default for Cygwin 1.7, rewrite init code determining default coding systems
Ben Wing <ben@xemacs.org>
parents: 4568
diff changeset
234 process-write binary binary binary raw-text MSW-MB-SD utf-8
d2ec55325515 make utf-8 default for Cygwin 1.7, rewrite init code determining default coding systems
Ben Wing <ben@xemacs.org>
parents: 4568
diff changeset
235 no-conv-cs binary raw-text raw-text raw-text MSW-MB utf-8
771
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents:
diff changeset
236
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents:
diff changeset
237
4989
d2ec55325515 make utf-8 default for Cygwin 1.7, rewrite init code determining default coding systems
Ben Wing <ben@xemacs.org>
parents: 4568
diff changeset
238 VAR can be one of:
771
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents:
diff changeset
239
4989
d2ec55325515 make utf-8 default for Cygwin 1.7, rewrite init code determining default coding systems
Ben Wing <ben@xemacs.org>
parents: 4568
diff changeset
240 `bfcs-for-read'
771
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents:
diff changeset
241
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents:
diff changeset
242 Lisp variable of the same name; the default coding system used when
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents:
diff changeset
243 reading in a file, in the absence of more specific settings. (See
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents:
diff changeset
244 `insert-file-contents' for a description of exactly how a file's
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents:
diff changeset
245 coding system is determined when it's read in.)
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents:
diff changeset
246
4989
d2ec55325515 make utf-8 default for Cygwin 1.7, rewrite init code determining default coding systems
Ben Wing <ben@xemacs.org>
parents: 4568
diff changeset
247 `default-bfcs'
771
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents:
diff changeset
248
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents:
diff changeset
249 Default value of `buffer-file-coding-system', the buffer-local
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents:
diff changeset
250 variable specifying a file's coding system to be used when it is
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents:
diff changeset
251 written out. Set using `set-default-buffer-file-coding-system' (or
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents:
diff changeset
252 the primitive `setq-default'). When a file is read in,
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents:
diff changeset
253 `buffer-file-coding-system' for that file is set from the coding
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents:
diff changeset
254 system used to read the file in; the default value applies to newly
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents:
diff changeset
255 created files.
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents:
diff changeset
256
4989
d2ec55325515 make utf-8 default for Cygwin 1.7, rewrite init code determining default coding systems
Ben Wing <ben@xemacs.org>
parents: 4568
diff changeset
257 `native'
771
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents:
diff changeset
258
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents:
diff changeset
259 The coding system named `native'. Changed using
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents:
diff changeset
260 `define-coding-system-alias'. Used internally when passing
1318
b531bf8658e9 [xemacs-hg @ 2003-02-21 06:56:46 by ben]
ben
parents: 985
diff changeset
261 text to or from system API's, unless the particular
771
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents:
diff changeset
262 API specifies another coding system.
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents:
diff changeset
263
4989
d2ec55325515 make utf-8 default for Cygwin 1.7, rewrite init code determining default coding systems
Ben Wing <ben@xemacs.org>
parents: 4568
diff changeset
264 `keyboard'
771
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents:
diff changeset
265
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents:
diff changeset
266 #### fill in
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents:
diff changeset
267
4989
d2ec55325515 make utf-8 default for Cygwin 1.7, rewrite init code determining default coding systems
Ben Wing <ben@xemacs.org>
parents: 4568
diff changeset
268 `terminal'
771
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents:
diff changeset
269
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents:
diff changeset
270 #### fill in
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents:
diff changeset
271
4989
d2ec55325515 make utf-8 default for Cygwin 1.7, rewrite init code determining default coding systems
Ben Wing <ben@xemacs.org>
parents: 4568
diff changeset
272 `process-read'
771
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents:
diff changeset
273
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents:
diff changeset
274 #### fill in
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents:
diff changeset
275
4989
d2ec55325515 make utf-8 default for Cygwin 1.7, rewrite init code determining default coding systems
Ben Wing <ben@xemacs.org>
parents: 4568
diff changeset
276 `process-write'
771
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents:
diff changeset
277
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents:
diff changeset
278 #### fill in
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents:
diff changeset
279
4989
d2ec55325515 make utf-8 default for Cygwin 1.7, rewrite init code determining default coding systems
Ben Wing <ben@xemacs.org>
parents: 4568
diff changeset
280 `no-conv-cs'
771
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents:
diff changeset
281
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents:
diff changeset
282 Coding system used when category `no-conversion' is detected.
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents:
diff changeset
283
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents:
diff changeset
284
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents:
diff changeset
285 CONFIG is one of: (abbreviations in parens)
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents:
diff changeset
286
4989
d2ec55325515 make utf-8 default for Cygwin 1.7, rewrite init code determining default coding systems
Ben Wing <ben@xemacs.org>
parents: 4568
diff changeset
287 `no-mule-no-eol-detection' (NoMule)
771
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents:
diff changeset
288
4989
d2ec55325515 make utf-8 default for Cygwin 1.7, rewrite init code determining default coding systems
Ben Wing <ben@xemacs.org>
parents: 4568
diff changeset
289 Non-Windows, no Mule support, no automatic EOL detection. (Controlled by
771
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents:
diff changeset
290 `eol-detection-enabled-p', which is set by the command-line flag
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents:
diff changeset
291 -enable-eol-detection or the configure flag --with-default-eol-detection.)
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents:
diff changeset
292
4989
d2ec55325515 make utf-8 default for Cygwin 1.7, rewrite init code determining default coding systems
Ben Wing <ben@xemacs.org>
parents: 4568
diff changeset
293 `unix-no-mule-eol-detection' (NoMuleEOL)
771
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents:
diff changeset
294
4989
d2ec55325515 make utf-8 default for Cygwin 1.7, rewrite init code determining default coding systems
Ben Wing <ben@xemacs.org>
parents: 4568
diff changeset
295 Non-Windows, no Mule support, automatic EOL detection.
771
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents:
diff changeset
296
4989
d2ec55325515 make utf-8 default for Cygwin 1.7, rewrite init code determining default coding systems
Ben Wing <ben@xemacs.org>
parents: 4568
diff changeset
297 `unix-mule' (Mule)
771
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents:
diff changeset
298
4989
d2ec55325515 make utf-8 default for Cygwin 1.7, rewrite init code determining default coding systems
Ben Wing <ben@xemacs.org>
parents: 4568
diff changeset
299 Non-Windows, Mule support.
771
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents:
diff changeset
300
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents:
diff changeset
301 `windows-no-mule' (MSW)
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents:
diff changeset
302
4989
d2ec55325515 make utf-8 default for Cygwin 1.7, rewrite init code determining default coding systems
Ben Wing <ben@xemacs.org>
parents: 4568
diff changeset
303 MS Windows or old Cygwin, no Mule support.
d2ec55325515 make utf-8 default for Cygwin 1.7, rewrite init code determining default coding systems
Ben Wing <ben@xemacs.org>
parents: 4568
diff changeset
304
d2ec55325515 make utf-8 default for Cygwin 1.7, rewrite init code determining default coding systems
Ben Wing <ben@xemacs.org>
parents: 4568
diff changeset
305 `windows-mule' (MSWMule)
771
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents:
diff changeset
306
4989
d2ec55325515 make utf-8 default for Cygwin 1.7, rewrite init code determining default coding systems
Ben Wing <ben@xemacs.org>
parents: 4568
diff changeset
307 MS Windows or old Cygwin, Mule support.
771
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents:
diff changeset
308
4989
d2ec55325515 make utf-8 default for Cygwin 1.7, rewrite init code determining default coding systems
Ben Wing <ben@xemacs.org>
parents: 4568
diff changeset
309 `cygwin-utf-8' (CygUTF)
771
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents:
diff changeset
310
4989
d2ec55325515 make utf-8 default for Cygwin 1.7, rewrite init code determining default coding systems
Ben Wing <ben@xemacs.org>
parents: 4568
diff changeset
311 Cygwin 1.7 or later, which uses UTF-8 consistently.
771
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents:
diff changeset
312
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents:
diff changeset
313 The following coding system abbreviations are also used in the table:
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents:
diff changeset
314
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents:
diff changeset
315 MSW-MB = mswindows-multibyte
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents:
diff changeset
316 MSW-MB = mswindows-multibyte-system-default
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents:
diff changeset
317 "
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents:
diff changeset
318 (setq config (or config (coding-system-current-system-configuration)))
4989
d2ec55325515 make utf-8 default for Cygwin 1.7, rewrite init code determining default coding systems
Ben Wing <ben@xemacs.org>
parents: 4568
diff changeset
319 (or (memq var coding-system-default-variable-list)
d2ec55325515 make utf-8 default for Cygwin 1.7, rewrite init code determining default coding systems
Ben Wing <ben@xemacs.org>
parents: 4568
diff changeset
320 (error 'invalid-constant "Invalid coding system variable" var))
d2ec55325515 make utf-8 default for Cygwin 1.7, rewrite init code determining default coding systems
Ben Wing <ben@xemacs.org>
parents: 4568
diff changeset
321 (let ((props (gethash config coding-system-default-configuration-table)))
d2ec55325515 make utf-8 default for Cygwin 1.7, rewrite init code determining default coding systems
Ben Wing <ben@xemacs.org>
parents: 4568
diff changeset
322 (or props (error 'invalid-constant "Invalid coding system configuration"
771
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents:
diff changeset
323 config))
4989
d2ec55325515 make utf-8 default for Cygwin 1.7, rewrite init code determining default coding systems
Ben Wing <ben@xemacs.org>
parents: 4568
diff changeset
324 (getf props var)))
771
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents:
diff changeset
325
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents:
diff changeset
326 (defun reset-coding-system-defaults (&optional config)
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents:
diff changeset
327 "Reset all basic coding system variables are set to their default values.
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents:
diff changeset
328 See `coding-system-variable-default-value'."
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents:
diff changeset
329 (setq config (or config (coding-system-current-system-configuration)))
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents:
diff changeset
330 (mapcar #'(lambda (var)
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents:
diff changeset
331 (set-coding-system-variable
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents:
diff changeset
332 var (coding-system-variable-default-value var config)))
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents:
diff changeset
333 coding-system-default-variable-list))
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents:
diff changeset
334
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents:
diff changeset
335 (defun reset-coding-categories-to-default ()
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents:
diff changeset
336 "Reset all coding categories (used for automatic detection) to their defaults.
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents:
diff changeset
337
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents:
diff changeset
338 The order of priorities of coding categories and the coding system
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents:
diff changeset
339 bound to each category are as follows:
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents:
diff changeset
340
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents:
diff changeset
341 coding category coding system
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents:
diff changeset
342 --------------------------------------------------
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents:
diff changeset
343 utf-16-little-endian-bom utf-16-little-endian
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents:
diff changeset
344 utf-16-bom utf-16-bom
985
7f62a956b825 [xemacs-hg @ 2002-09-01 06:41:40 by youngs]
youngs
parents: 853
diff changeset
345 utf-8-bom utf-8-bom
771
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents:
diff changeset
346 iso-7 iso-2022-7bit
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents:
diff changeset
347 no-conversion raw-text
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents:
diff changeset
348 utf-8 utf-8
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents:
diff changeset
349 iso-8-1 iso-8859-1
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents:
diff changeset
350 iso-8-2 ctext (iso-8859-1 alias)
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents:
diff changeset
351 iso-8-designate ctext (iso-8859-1 alias)
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents:
diff changeset
352 iso-lock-shift iso-2022-lock
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents:
diff changeset
353 shift-jis shift-jis
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents:
diff changeset
354 big5 big5
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents:
diff changeset
355 utf-16-little-endian utf-16-little-endian
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents:
diff changeset
356 utf-16 utf-16
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents:
diff changeset
357 ucs-4 ucs-4
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents:
diff changeset
358 "
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents:
diff changeset
359 ;; #### What a mess! This needs to be overhauled.
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents:
diff changeset
360
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents:
diff changeset
361 ;; The old table (from FSF synch?) was not what we use (cf mule-coding.el),
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents:
diff changeset
362 ;; and as documented iso-8-designate is inconsistent with iso-2022-8bit-ss2.
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents:
diff changeset
363 ;; The order of priorities of coding categories and the coding system
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents:
diff changeset
364 ;; bound to each category are as follows:
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents:
diff changeset
365 ;;
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents:
diff changeset
366 ;; coding category coding system
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents:
diff changeset
367 ;; --------------------------------------------------
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents:
diff changeset
368 ;; iso-8-2 iso-8859-1
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents:
diff changeset
369 ;; iso-8-1 iso-8859-1
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents:
diff changeset
370 ;; iso-7 iso-2022-7bit
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents:
diff changeset
371 ;; iso-lock-shift iso-2022-lock
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents:
diff changeset
372 ;; iso-8-designate iso-2022-8bit-ss2
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents:
diff changeset
373 ;; no-conversion raw-text
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents:
diff changeset
374 ;; shift-jis shift_jis
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents:
diff changeset
375 ;; big5 big5
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents:
diff changeset
376 ;; ucs-4 ----
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents:
diff changeset
377 ;; utf-8 ----
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents:
diff changeset
378 (when (featurep 'mule)
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents:
diff changeset
379 (set-coding-category-system 'iso-7 'iso-2022-7)
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents:
diff changeset
380 (set-coding-category-system 'iso-8-1 'iso-8859-1)
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents:
diff changeset
381 (set-coding-category-system 'iso-8-2 'ctext)
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents:
diff changeset
382 (set-coding-category-system 'iso-lock-shift 'iso-2022-lock)
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents:
diff changeset
383 (set-coding-category-system 'iso-8-designate 'ctext)
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents:
diff changeset
384 (if (find-coding-system 'shift-jis)
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents:
diff changeset
385 (set-coding-category-system 'shift-jis 'shift-jis))
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents:
diff changeset
386 (if (find-coding-system 'big5)
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents:
diff changeset
387 (set-coding-category-system 'big5 'big5))
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents:
diff changeset
388 )
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents:
diff changeset
389 (set-coding-category-system
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents:
diff changeset
390 'no-conversion
4989
d2ec55325515 make utf-8 default for Cygwin 1.7, rewrite init code determining default coding systems
Ben Wing <ben@xemacs.org>
parents: 4568
diff changeset
391 (coding-system-variable-default-value 'no-conv-cs))
771
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents:
diff changeset
392 (set-coding-category-system 'ucs-4 'ucs-4)
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents:
diff changeset
393 (set-coding-category-system 'utf-8 'utf-8)
985
7f62a956b825 [xemacs-hg @ 2002-09-01 06:41:40 by youngs]
youngs
parents: 853
diff changeset
394 (set-coding-category-system 'utf-8-bom 'utf-8-bom)
771
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents:
diff changeset
395 (set-coding-category-system 'utf-16-little-endian 'utf-16-little-endian)
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents:
diff changeset
396 (set-coding-category-system 'utf-16 'utf-16)
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents:
diff changeset
397 (set-coding-category-system 'utf-16-little-endian-bom
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents:
diff changeset
398 'utf-16-little-endian-bom)
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents:
diff changeset
399 (set-coding-category-system 'utf-16-bom 'utf-16-bom)
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents:
diff changeset
400 (set-coding-priority-list
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents:
diff changeset
401 (if (featurep 'mule)
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents:
diff changeset
402 '(utf-16-little-endian-bom
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents:
diff changeset
403 utf-16-bom
985
7f62a956b825 [xemacs-hg @ 2002-09-01 06:41:40 by youngs]
youngs
parents: 853
diff changeset
404 utf-8-bom
771
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents:
diff changeset
405 iso-7
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents:
diff changeset
406 no-conversion
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents:
diff changeset
407 utf-8
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents:
diff changeset
408 iso-8-1
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents:
diff changeset
409 iso-8-2
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents:
diff changeset
410 iso-8-designate
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents:
diff changeset
411 iso-lock-shift
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents:
diff changeset
412 shift-jis
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents:
diff changeset
413 big5
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents:
diff changeset
414 utf-16-little-endian
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents:
diff changeset
415 utf-16
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents:
diff changeset
416 ucs-4)
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents:
diff changeset
417 '(utf-16-little-endian-bom
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents:
diff changeset
418 utf-16-bom
985
7f62a956b825 [xemacs-hg @ 2002-09-01 06:41:40 by youngs]
youngs
parents: 853
diff changeset
419 utf-8-bom
771
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents:
diff changeset
420 no-conversion
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents:
diff changeset
421 utf-8
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents:
diff changeset
422 utf-16-little-endian
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents:
diff changeset
423 utf-16
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents:
diff changeset
424 ucs-4))))
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents:
diff changeset
425
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents:
diff changeset
426 (defun reset-language-environment ()
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents:
diff changeset
427 "Reset coding system environment of XEmacs to the default status.
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents:
diff changeset
428 All basic coding system variables are set to their default values, as
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents:
diff changeset
429 are the coding categories used for automatic detection and their
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents:
diff changeset
430 priority.
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents:
diff changeset
431
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents:
diff changeset
432 BE VERY CERTAIN YOU WANT TO DO THIS BEFORE DOING IT!
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents:
diff changeset
433
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents:
diff changeset
434 For more information, see `reset-coding-system-defaults' and
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents:
diff changeset
435 `reset-coding-categories-to-default'."
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents:
diff changeset
436 (reset-coding-system-defaults)
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents:
diff changeset
437 (reset-coding-categories-to-default))
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents:
diff changeset
438
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents:
diff changeset
439 ;; Initialize everything so that the remaining Lisp files can contain
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents:
diff changeset
440 ;; extended characters. (They will be in ISO-7 format)
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents:
diff changeset
441
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents:
diff changeset
442 ;; !!####!! The Lisp files should all be in UTF-8!!! That way, all
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents:
diff changeset
443 ;; special characters appear as high bits and there's no problem with
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents:
diff changeset
444 ;; the Lisp parser trying to read a Mule file and getting all screwed
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents:
diff changeset
445 ;; up. The only other thing then would be characters; we just need to
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents:
diff changeset
446 ;; modify the Lisp parser to read the stuff directly after a ? as
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents:
diff changeset
447 ;; UTF-8 and return a 30-bit value directly, and modify the character
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents:
diff changeset
448 ;; routines a bit to allow such a beast to exist. MAKE IT A POINT TO
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents:
diff changeset
449 ;; IMPLEMENT THIS AS ONE OF MY FUTURE PROJECTS. --ben
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents:
diff changeset
450
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents:
diff changeset
451 (reset-language-environment)
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents:
diff changeset
452
4568
1d74a1d115ee Add #'query-coding-region tests; do the work necessary to get them running.
Aidan Kehoe <kehoea@parhasard.net>
parents: 2508
diff changeset
453 (coding-system-put 'raw-text 'safe-charsets '(ascii control-1 latin-iso8859-1))
1d74a1d115ee Add #'query-coding-region tests; do the work necessary to get them running.
Aidan Kehoe <kehoea@parhasard.net>
parents: 2508
diff changeset
454
771
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents:
diff changeset
455 ;;; code-init.el ends here