Mercurial > hg > xemacs-beta
comparison lisp/coding.el @ 398:74fd4e045ea6 r21-2-29
Import from CVS: tag r21-2-29
author | cvs |
---|---|
date | Mon, 13 Aug 2007 11:13:30 +0200 |
parents | cc15677e0335 |
children | 2f8bb876ab1d |
comparison
equal
deleted
inserted
replaced
397:f4aeb21a5bad | 398:74fd4e045ea6 |
---|---|
19 ;; WITHOUT ANY WARRANTY; without even the implied warranty of | 19 ;; WITHOUT ANY WARRANTY; without even the implied warranty of |
20 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 20 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
21 ;; General Public License for more details. | 21 ;; General Public License for more details. |
22 | 22 |
23 ;; You should have received a copy of the GNU General Public License | 23 ;; You should have received a copy of the GNU General Public License |
24 ;; along with XEmacs; see the file COPYING. If not, write to the | 24 ;; along with XEmacs; see the file COPYING. If not, write to the |
25 ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330, | 25 ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330, |
26 ;; Boston, MA 02111-1307, USA. | 26 ;; Boston, MA 02111-1307, USA. |
27 | 27 |
28 ;;; Commentary: | 28 ;;; Commentary: |
29 | 29 |
113 (defun set-terminal-coding-system (coding-system) | 113 (defun set-terminal-coding-system (coding-system) |
114 "Set the coding system used for TTY display output. Currently broken." | 114 "Set the coding system used for TTY display output. Currently broken." |
115 (interactive "zterminal-coding-system: ") | 115 (interactive "zterminal-coding-system: ") |
116 (get-coding-system coding-system) ; correctness check | 116 (get-coding-system coding-system) ; correctness check |
117 (setq terminal-coding-system coding-system) | 117 (setq terminal-coding-system coding-system) |
118 (set-console-tty-coding-system (device-console) terminal-coding-system) | 118 ; #### should this affect all current tty consoles ? |
119 (if (eq (device-type) 'tty) | |
120 (set-console-tty-coding-system (device-console) terminal-coding-system)) | |
119 (redraw-modeline t)) | 121 (redraw-modeline t)) |
120 | 122 |
121 (defun set-pathname-coding-system (coding-system) | 123 (defun set-pathname-coding-system (coding-system) |
122 "Set the coding system used for file system path names." | 124 "Set the coding system used for file system path names." |
123 (interactive "zPathname-coding-system: ") | 125 (interactive "zPathname-coding-system: ") |
178 | 180 |
179 (defun coding-system-base (coding-system) | 181 (defun coding-system-base (coding-system) |
180 "Return the base coding system of CODING-SYSTEM." | 182 "Return the base coding system of CODING-SYSTEM." |
181 (if (not (coding-system-eol-type coding-system)) | 183 (if (not (coding-system-eol-type coding-system)) |
182 coding-system | 184 coding-system |
183 (find-coding-system | 185 (find-coding-system |
184 (intern | 186 (intern |
185 (substring | 187 (substring |
186 (symbol-name (coding-system-name coding-system)) | 188 (symbol-name (coding-system-name coding-system)) |
187 0 | 189 0 |
188 (string-match "-unix$\\|-dos$\\|-mac$" | 190 (string-match "-unix$\\|-dos$\\|-mac$" |
189 (symbol-name (coding-system-name coding-system)))))))) | 191 (symbol-name (coding-system-name coding-system)))))))) |
190 | 192 |
193 (make-coding-system | 195 (make-coding-system |
194 'undecided 'undecided | 196 'undecided 'undecided |
195 "Automatic conversion." | 197 "Automatic conversion." |
196 '(mnemonic "Auto")) | 198 '(mnemonic "Auto")) |
197 | 199 |
198 ;; these are so that gnus and friends work when not mule | 200 ;;; Make certain variables equivalent to coding-system aliases |
199 (or (featurep 'mule) | 201 (defun dontusethis-set-value-file-name-coding-system-handler (sym args fun harg handlers) |
200 (progn | 202 (define-coding-system-alias 'file-name (or (car args) 'binary))) |
201 (copy-coding-system 'undecided 'iso-8859-1) | 203 |
202 (copy-coding-system 'undecided 'iso-8859-2))) | 204 (dontusethis-set-symbol-value-handler |
205 'file-name-coding-system | |
206 'set-value | |
207 'dontusethis-set-value-file-name-coding-system-handler) | |
208 | |
209 (defun dontusethis-set-value-terminal-coding-system-handler (sym args fun harg handlers) | |
210 (define-coding-system-alias 'terminal (or (car args) 'binary))) | |
211 | |
212 (dontusethis-set-symbol-value-handler | |
213 'terminal-coding-system | |
214 'set-value | |
215 'dontusethis-set-value-terminal-coding-system-handler) | |
216 | |
217 (defun dontusethis-set-value-keyboard-coding-system-handler (sym args fun harg handlers) | |
218 (define-coding-system-alias 'keyboard (or (car args) 'binary))) | |
219 | |
220 (dontusethis-set-symbol-value-handler | |
221 'keyboard-coding-system | |
222 'set-value | |
223 'dontusethis-set-value-keyboard-coding-system-handler) | |
224 | |
225 (unless (boundp 'file-name-coding-system) | |
226 (setq file-name-coding-system nil)) | |
227 | |
228 (when (not (featurep 'mule)) | |
229 ;; these are so that gnus and friends work when not mule | |
230 (copy-coding-system 'undecided 'iso-8859-1) | |
231 (copy-coding-system 'undecided 'iso-8859-2) | |
232 | |
233 (define-coding-system-alias 'ctext 'binary)) | |
234 | |
203 | 235 |
204 ;; compatibility for old XEmacsen (don't use it) | 236 ;; compatibility for old XEmacsen (don't use it) |
205 (copy-coding-system 'undecided 'automatic-conversion) | 237 (copy-coding-system 'undecided 'automatic-conversion) |
206 | 238 |
207 (copy-coding-system 'no-conversion 'raw-text) | |
208 | |
209 (make-compatible-variable 'enable-multibyte-characters "Unimplemented") | 239 (make-compatible-variable 'enable-multibyte-characters "Unimplemented") |
210 | 240 |
211 (define-obsolete-variable-alias | 241 (define-obsolete-variable-alias |
212 'pathname-coding-system 'file-name-coding-system) | 242 'pathname-coding-system 'file-name-coding-system) |
213 | 243 |