aboutsummaryrefslogtreecommitdiffstats
path: root/lisp
diff options
context:
space:
mode:
authorKenichi Handa2010-08-31 16:49:21 +0900
committerKenichi Handa2010-08-31 16:49:21 +0900
commitd419e1d94e885388b86f8753d741befa1855d333 (patch)
treed907b7c8e384e459dbf027179d7710fba43837d0 /lisp
parentb295da470123c7beea983f9b500db5286fd12996 (diff)
downloademacs-d419e1d94e885388b86f8753d741befa1855d333.tar.gz
emacs-d419e1d94e885388b86f8753d741befa1855d333.zip
Fix handling of 8-bit characters in a display table.
Diffstat (limited to 'lisp')
-rw-r--r--lisp/ChangeLog11
-rw-r--r--lisp/disp-table.el27
-rw-r--r--lisp/international/mule-cmds.el4
3 files changed, 36 insertions, 6 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index b48b39d7657..d61a8c565a8 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,14 @@
12010-08-31 Kenichi Handa <handa@m17n.org>
2
3 * international/mule-cmds.el (standard-display-european-internal):
4 Setup standard-display-table for 8-bit characters by storing 8-bit
5 characters in the element vector.
6
7 * disp-table.el (standard-display-8bit): Setup
8 standard-display-table for 8-bit characters by storing 8-bit
9 characters in the element vector.
10 (standard-display-european): Likewise.
11
12010-08-26 Michael Albinus <michael.albinus@gmx.de> 122010-08-26 Michael Albinus <michael.albinus@gmx.de>
2 13
3 Sync with Tramp 2.1.19. 14 Sync with Tramp 2.1.19.
diff --git a/lisp/disp-table.el b/lisp/disp-table.el
index 286c8f319ff..86aed277765 100644
--- a/lisp/disp-table.el
+++ b/lisp/disp-table.el
@@ -109,11 +109,27 @@ Valid symbols are `truncation', `wrap', `escape', `control',
109 109
110;;;###autoload 110;;;###autoload
111(defun standard-display-8bit (l h) 111(defun standard-display-8bit (l h)
112 "Display characters in the range L to H literally." 112 "Display characters representing raw bytes in the range L to H literally.
113
114On a terminal display, each character in the range is displayed
115by sending the corresponding byte directly to the terminal.
116
117On a graphic display, each character in the range is displayed
118using the default font by a glyph whose code is the corresponding
119byte.
120
121Note that ASCII printable characters (SPC to TILDA) are displayed
122in the default way after this call."
113 (or standard-display-table 123 (or standard-display-table
114 (setq standard-display-table (make-display-table))) 124 (setq standard-display-table (make-display-table)))
125 (if (> h 255)
126 (setq h 255))
115 (while (<= l h) 127 (while (<= l h)
116 (aset standard-display-table l (if (or (< l ?\s) (>= l 127)) (vector l))) 128 (if (< l 128)
129 (aset standard-display-table l
130 (if (or (< l ?\s) (= l 127)) (vector l)))
131 (let ((c (unibyte-char-to-multibyte l)))
132 (aset standard-display-table c (vector c))))
117 (setq l (1+ l)))) 133 (setq l (1+ l))))
118 134
119;;;###autoload 135;;;###autoload
@@ -235,9 +251,12 @@ in `.emacs'."
235 (and (null arg) 251 (and (null arg)
236 (char-table-p standard-display-table) 252 (char-table-p standard-display-table)
237 ;; Test 161, because 160 displays as a space. 253 ;; Test 161, because 160 displays as a space.
238 (equal (aref standard-display-table 161) [161]))) 254 (equal (aref standard-display-table
255 (unibyte-char-to-multibyte 161))
256 (vector (unibyte-char-to-multibyte 161)))))
239 (progn 257 (progn
240 (standard-display-default 160 255) 258 (standard-display-default
259 (unibyte-char-to-multibyte 160) (unibyte-char-to-multibyte 255))
241 (unless (or (memq window-system '(x w32 ns))) 260 (unless (or (memq window-system '(x w32 ns)))
242 (and (terminal-coding-system) 261 (and (terminal-coding-system)
243 (set-terminal-coding-system nil)))) 262 (set-terminal-coding-system nil))))
diff --git a/lisp/international/mule-cmds.el b/lisp/international/mule-cmds.el
index 008a59531fc..871bab20013 100644
--- a/lisp/international/mule-cmds.el
+++ b/lisp/international/mule-cmds.el
@@ -1953,7 +1953,7 @@ See `set-language-info-alist' for use in programs."
1953 (> (aref (number-to-string (nth 2 (x-server-version))) 0) 1953 (> (aref (number-to-string (nth 2 (x-server-version))) 0)
1954 ?3)) 1954 ?3))
1955 ;; Make non-line-break space display as a plain space. 1955 ;; Make non-line-break space display as a plain space.
1956 (aset standard-display-table 160 [32])) 1956 (aset standard-display-table (unibyte-char-to-multibyte 160) [32]))
1957 ;; Most Windows programs send out apostrophes as \222. Most X fonts 1957 ;; Most Windows programs send out apostrophes as \222. Most X fonts
1958 ;; don't contain a character at that position. Map it to the ASCII 1958 ;; don't contain a character at that position. Map it to the ASCII
1959 ;; apostrophe. [This is actually RIGHT SINGLE QUOTATION MARK, 1959 ;; apostrophe. [This is actually RIGHT SINGLE QUOTATION MARK,
@@ -1961,7 +1961,7 @@ See `set-language-info-alist' for use in programs."
1961 ;; fonts probably have the appropriate glyph at this position, 1961 ;; fonts probably have the appropriate glyph at this position,
1962 ;; so they could use standard-display-8bit. It's better to use a 1962 ;; so they could use standard-display-8bit. It's better to use a
1963 ;; proper windows-1252 coding system. --fx] 1963 ;; proper windows-1252 coding system. --fx]
1964 (aset standard-display-table 146 [39])))) 1964 (aset standard-display-table (unibyte-char-to-multibyte 146) [39]))))
1965 1965
1966(defun set-language-environment-coding-systems (language-name) 1966(defun set-language-environment-coding-systems (language-name)
1967 "Do various coding system setups for language environment LANGUAGE-NAME." 1967 "Do various coding system setups for language environment LANGUAGE-NAME."