mirror of
git://git.sv.gnu.org/emacs.git
synced 2026-02-07 08:00:48 -08:00
(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.
This commit is contained in:
parent
bf1b7b30da
commit
e1b674a138
1 changed files with 52 additions and 51 deletions
|
|
@ -274,6 +274,58 @@ list. You can (and should) also run it whenever the value of
|
|||
"-unix"))))
|
||||
(IT-display-table-setup cp)
|
||||
(prefer-coding-system (intern (concat cp "-dos")))
|
||||
(if default-enable-multibyte-characters
|
||||
;; We want this in multibyte version only, since unibyte version
|
||||
;; should not convert non-ASCII characters at all.
|
||||
(setq unibyte-display-via-language-environment t)
|
||||
;; Let the unibyte version behave as Emacs 19 did. In particular,
|
||||
;; let it use and display native codepage-specific glyphs for
|
||||
;; non-ASCII characters. For this to work correctly, we need to
|
||||
;; establish the correspondence between lower-case letters and their
|
||||
;; upper-case brethren, as appropriate for the codepage in use. The
|
||||
;; code below makes this happen.
|
||||
;; (In the multibyte mode, the appropriate tables are prepared
|
||||
;; elsewhere, since multibyte Emacs uses normal MULE character sets,
|
||||
;; which are supported on all platforms.)
|
||||
(let* ((i 128)
|
||||
(modify (function
|
||||
(lambda (ch sy)
|
||||
(modify-syntax-entry ch sy text-mode-syntax-table)
|
||||
(if (boundp 'tex-mode-syntax-table)
|
||||
(modify-syntax-entry ch sy tex-mode-syntax-table))
|
||||
(modify-syntax-entry ch sy (standard-syntax-table))
|
||||
)))
|
||||
(table (standard-case-table))
|
||||
;; The following are strings of letters, first lower then
|
||||
;; upper case. This will look funny on terminals which
|
||||
;; display other code pages. In particular, what is
|
||||
;; displayed as blanks or triangles are not what they
|
||||
;; look lile at all! (Use `C-x =' to see what they
|
||||
;; really are.)
|
||||
(chars
|
||||
(cond
|
||||
((= dos-codepage 850)
|
||||
"<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>匸聣<EFBFBD>仫𥹉礻龭渕><EFBFBD>𣏾<EFBFBD>𨰻R<EFBFBD>佲<EFBFBD>𤩱暚擨!<EFBFBD>丰倳賥")
|
||||
((= dos-codepage 865)
|
||||
"<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>𠄌<EFBFBD>𥄫𡃇䬠𪆵<EFBFBD>幈<EFBFBD>笧𨯅Σ暚<EFBFBD>鼦!㏕Σ丰")
|
||||
;; default is 437
|
||||
(t "<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>𠄌<EFBFBD>𥄫𡃇䬠𪆵<EFBFBD>幈<EFBFBD>笧𨯅Σ暚鼦!㏕Σ丰"))))
|
||||
|
||||
(while (< i 256)
|
||||
(funcall modify i "_")
|
||||
(setq i (1+ i)))
|
||||
|
||||
(setq i 0)
|
||||
(while (< i (length chars))
|
||||
(let ((ch1 (aref chars i))
|
||||
(ch2 (aref chars (1+ i))))
|
||||
(if (> ch2 127)
|
||||
(set-case-syntax-pair ch2 ch1 table))
|
||||
(setq i (+ i 2))))
|
||||
(save-excursion
|
||||
(mapcar (lambda (b) (set-buffer b) (set-case-table table))
|
||||
(buffer-list)))
|
||||
(set-standard-case-table table)))
|
||||
;; Some codepages have sporadic support for Latin-1, Greek, and
|
||||
;; symbol glyphs, which don't belong to their native character
|
||||
;; 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
|
|||
;; characters to arrive at our display code verbatim.
|
||||
(standard-display-8bit 127 255)
|
||||
|
||||
(if default-enable-multibyte-characters
|
||||
;; We want this in multibyte version only, since unibyte version
|
||||
;; should not convert non-ASCII characters at all.
|
||||
(setq unibyte-display-via-language-environment t)
|
||||
;; Let the unibyte version behave as Emacs 19 did. In particular,
|
||||
;; let it use and display native codepage-specific glyphs for
|
||||
;; non-ASCII characters. For this to work correctly, we need to
|
||||
;; establish the correspondence between lower-case letters and their
|
||||
;; upper-case brethren, as appropriate for the codepage in use. The
|
||||
;; code below makes this happen.
|
||||
;; (In the multibyte mode, the appropriate tables are prepared
|
||||
;; elsewhere, since multibyte Emacs uses normal MULE character sets,
|
||||
;; which are supported on all platforms.)
|
||||
(let* ((i 128)
|
||||
(modify (function
|
||||
(lambda (ch sy)
|
||||
(modify-syntax-entry ch sy text-mode-syntax-table)
|
||||
(if (boundp 'tex-mode-syntax-table)
|
||||
(modify-syntax-entry ch sy tex-mode-syntax-table))
|
||||
(modify-syntax-entry ch sy (standard-syntax-table))
|
||||
)))
|
||||
(table (standard-case-table))
|
||||
;; The following are strings of letters, first lower then upper case.
|
||||
;; This will look funny on terminals which display other code pages.
|
||||
;; In particular, what is displayed as blanks are not blanks
|
||||
;; at all! (Use `C-x =' to see what they really are.)
|
||||
(chars
|
||||
(cond
|
||||
((= dos-codepage 850)
|
||||
"<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>匸聣<EFBFBD>仫𥹉礻龭渕><EFBFBD>𣏾<EFBFBD>𨰻R<EFBFBD>佲<EFBFBD>𤩱暚擨!<EFBFBD>丰倳賥")
|
||||
((= dos-codepage 865)
|
||||
"<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>𠄌<EFBFBD>𥄫𡃇䬠𪆵<EFBFBD>幈<EFBFBD>笧𨯅Σ暚<EFBFBD>鼦!㏕Σ丰")
|
||||
;; default is 437
|
||||
(t "<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>𠄌<EFBFBD>𥄫𡃇䬠𪆵<EFBFBD>幈<EFBFBD>笧𨯅Σ暚鼦!㏕Σ丰"))))
|
||||
|
||||
(while (< i 256)
|
||||
(funcall modify i "_")
|
||||
(setq i (1+ i)))
|
||||
|
||||
(setq i 0)
|
||||
(while (< i (length chars))
|
||||
(let ((ch1 (aref chars i))
|
||||
(ch2 (aref chars (1+ i))))
|
||||
(if (> ch2 127)
|
||||
(set-case-syntax-pair ch2 ch1 table))
|
||||
(setq i (+ i 2))))
|
||||
(save-excursion
|
||||
(mapcar (lambda (b) (set-buffer b) (set-case-table table))
|
||||
(buffer-list)))
|
||||
(set-standard-case-table table)))
|
||||
|
||||
;;; internal.el ends here
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue