comparison lisp/term/internal.el @ 24490:7a5f7af21c27

(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.
author Eli Zaretskii <eliz@gnu.org>
date Tue, 16 Mar 1999 14:14:55 +0000
parents 54fa245dc776
children c2f09365ec12
comparison
equal deleted inserted replaced
24489:abf5b4802f9b 24490:7a5f7af21c27
272 (set-terminal-coding-system 272 (set-terminal-coding-system
273 (setq default-terminal-coding-system (intern (concat cp 273 (setq default-terminal-coding-system (intern (concat cp
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
280 ;; the codepages (for starters, I don't even have references for 332 ;; the codepages (for starters, I don't even have references for
281 ;; all the codepages). So I provide a hook for those who want to 333 ;; all the codepages). So I provide a hook for those who want to
293 ;; DOS terminal; in unibyte mode we want to see all 8-bit characters 345 ;; DOS terminal; in unibyte mode we want to see all 8-bit characters
294 ;; verbatim. In both cases, we want the entire range of 8-bit 346 ;; verbatim. In both cases, we want the entire range of 8-bit
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