aboutsummaryrefslogtreecommitdiffstats
path: root/lisp/term
diff options
context:
space:
mode:
authorEli Zaretskii1999-03-16 14:14:55 +0000
committerEli Zaretskii1999-03-16 14:14:55 +0000
commite1b674a1383adfb093d02c19554a3c7b7a35c9fe (patch)
tree1b29a4bd0c8d2bb59bc63f738ea9d724b997b2f3 /lisp/term
parentbf1b7b30dad9e42abca8f64ab14080124b641b48 (diff)
downloademacs-e1b674a1383adfb093d02c19554a3c7b7a35c9fe.tar.gz
emacs-e1b674a1383adfb093d02c19554a3c7b7a35c9fe.zip
(dos-codepage-setup): Compute the unibyte
syntax table and bind unibyte-display-via-language-environment here, rather than at top level, so that resetting to unibyte in .emacs works as expected.
Diffstat (limited to 'lisp/term')
-rw-r--r--lisp/term/internal.el103
1 files changed, 52 insertions, 51 deletions
diff --git a/lisp/term/internal.el b/lisp/term/internal.el
index c1be9aed3c4..30b0d3d0b7f 100644
--- a/lisp/term/internal.el
+++ b/lisp/term/internal.el
@@ -274,6 +274,58 @@ list. You can (and should) also run it whenever the value of
274 "-unix")))) 274 "-unix"))))
275 (IT-display-table-setup cp) 275 (IT-display-table-setup cp)
276 (prefer-coding-system (intern (concat cp "-dos"))) 276 (prefer-coding-system (intern (concat cp "-dos")))
277 (if default-enable-multibyte-characters
278 ;; We want this in multibyte version only, since unibyte version
279 ;; should not convert non-ASCII characters at all.
280 (setq unibyte-display-via-language-environment t)
281 ;; Let the unibyte version behave as Emacs 19 did. In particular,
282 ;; let it use and display native codepage-specific glyphs for
283 ;; non-ASCII characters. For this to work correctly, we need to
284 ;; establish the correspondence between lower-case letters and their
285 ;; upper-case brethren, as appropriate for the codepage in use. The
286 ;; code below makes this happen.
287 ;; (In the multibyte mode, the appropriate tables are prepared
288 ;; elsewhere, since multibyte Emacs uses normal MULE character sets,
289 ;; which are supported on all platforms.)
290 (let* ((i 128)
291 (modify (function
292 (lambda (ch sy)
293 (modify-syntax-entry ch sy text-mode-syntax-table)
294 (if (boundp 'tex-mode-syntax-table)
295 (modify-syntax-entry ch sy tex-mode-syntax-table))
296 (modify-syntax-entry ch sy (standard-syntax-table))
297 )))
298 (table (standard-case-table))
299 ;; The following are strings of letters, first lower then
300 ;; upper case. This will look funny on terminals which
301 ;; display other code pages. In particular, what is
302 ;; displayed as blanks or triangles are not what they
303 ;; look lile at all! (Use `C-x =' to see what they
304 ;; really are.)
305 (chars
306 (cond
307 ((= dos-codepage 850)
308 "‡€š‚ƒķ„Ž…·†ÆĮ ĩˆŌ‰ÓŠÔ‹ØŒŨÞĄÖ‘’“â”™•ãĒā›–ęĢé—ë˜YėíĄIĢéĪĨÐŅįč")
309 ((= dos-codepage 865)
310 "‡€š‚ƒA„Ž…A†ˆE‰EŠE‹IŒII‘’“O”™•O–UĢU˜Y› AĄIĒOĢUĪĨ")
311 ;; default is 437
312 (t "‡€š‚ƒA„Ž…A†ˆE‰EŠE‹IŒII‘’“O”™•O–UĢU˜Y AĄIĒOĢUĪĨ"))))
313
314 (while (< i 256)
315 (funcall modify i "_")
316 (setq i (1+ i)))
317
318 (setq i 0)
319 (while (< i (length chars))
320 (let ((ch1 (aref chars i))
321 (ch2 (aref chars (1+ i))))
322 (if (> ch2 127)
323 (set-case-syntax-pair ch2 ch1 table))
324 (setq i (+ i 2))))
325 (save-excursion
326 (mapcar (lambda (b) (set-buffer b) (set-case-table table))
327 (buffer-list)))
328 (set-standard-case-table table)))
277 ;; Some codepages have sporadic support for Latin-1, Greek, and 329 ;; Some codepages have sporadic support for Latin-1, Greek, and
278 ;; symbol glyphs, which don't belong to their native character 330 ;; symbol glyphs, which don't belong to their native character
279 ;; set. It's a nuisance to have all those glyphs here, for all 331 ;; set. It's a nuisance to have all those glyphs here, for all
@@ -295,56 +347,5 @@ list. You can (and should) also run it whenever the value of
295;; characters to arrive at our display code verbatim. 347;; characters to arrive at our display code verbatim.
296(standard-display-8bit 127 255) 348(standard-display-8bit 127 255)
297 349
298(if default-enable-multibyte-characters
299 ;; We want this in multibyte version only, since unibyte version
300 ;; should not convert non-ASCII characters at all.
301 (setq unibyte-display-via-language-environment t)
302 ;; Let the unibyte version behave as Emacs 19 did. In particular,
303 ;; let it use and display native codepage-specific glyphs for
304 ;; non-ASCII characters. For this to work correctly, we need to
305 ;; establish the correspondence between lower-case letters and their
306 ;; upper-case brethren, as appropriate for the codepage in use. The
307 ;; code below makes this happen.
308 ;; (In the multibyte mode, the appropriate tables are prepared
309 ;; elsewhere, since multibyte Emacs uses normal MULE character sets,
310 ;; which are supported on all platforms.)
311 (let* ((i 128)
312 (modify (function
313 (lambda (ch sy)
314 (modify-syntax-entry ch sy text-mode-syntax-table)
315 (if (boundp 'tex-mode-syntax-table)
316 (modify-syntax-entry ch sy tex-mode-syntax-table))
317 (modify-syntax-entry ch sy (standard-syntax-table))
318 )))
319 (table (standard-case-table))
320 ;; The following are strings of letters, first lower then upper case.
321 ;; This will look funny on terminals which display other code pages.
322 ;; In particular, what is displayed as blanks are not blanks
323 ;; at all! (Use `C-x =' to see what they really are.)
324 (chars
325 (cond
326 ((= dos-codepage 850)
327 "‡€š‚ƒķ„Ž…·†ÆĮ ĩˆŌ‰ÓŠÔ‹ØŒŨÞĄÖ‘’“â”™•ãĒā›–ęĢé—ë˜YėíĄIĢéĪĨÐŅįč")
328 ((= dos-codepage 865)
329 "‡€š‚ƒA„Ž…A†ˆE‰EŠE‹IŒII‘’“O”™•O–UĢU˜Y› AĄIĒOĢUĪĨ")
330 ;; default is 437
331 (t "‡€š‚ƒA„Ž…A†ˆE‰EŠE‹IŒII‘’“O”™•O–UĢU˜Y AĄIĒOĢUĪĨ"))))
332
333 (while (< i 256)
334 (funcall modify i "_")
335 (setq i (1+ i)))
336
337 (setq i 0)
338 (while (< i (length chars))
339 (let ((ch1 (aref chars i))
340 (ch2 (aref chars (1+ i))))
341 (if (> ch2 127)
342 (set-case-syntax-pair ch2 ch1 table))
343 (setq i (+ i 2))))
344 (save-excursion
345 (mapcar (lambda (b) (set-buffer b) (set-case-table table))
346 (buffer-list)))
347 (set-standard-case-table table)))
348
349;;; internal.el ends here 350;;; internal.el ends here
350 351