aboutsummaryrefslogtreecommitdiffstats
path: root/src/term.c
diff options
context:
space:
mode:
authorStefan Monnier2010-09-13 16:40:48 +0200
committerStefan Monnier2010-09-13 16:40:48 +0200
commitcc390e46c7ba95b76ea133d98fd386214cd01709 (patch)
treeead4400d22bd07214b782ff7e46e79d473fac419 /src/term.c
parentc566235d981eba73c88bbff00b6a1d88360b6e9f (diff)
parentc5fe4acb5fb456d6e8e147d8bc7981ce56c5c03d (diff)
downloademacs-cc390e46c7ba95b76ea133d98fd386214cd01709.tar.gz
emacs-cc390e46c7ba95b76ea133d98fd386214cd01709.zip
Merge from trunk
Diffstat (limited to 'src/term.c')
-rw-r--r--src/term.c48
1 files changed, 15 insertions, 33 deletions
diff --git a/src/term.c b/src/term.c
index 4f326234956..f090cdd2792 100644
--- a/src/term.c
+++ b/src/term.c
@@ -31,9 +31,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
31#include <unistd.h> 31#include <unistd.h>
32#endif 32#endif
33 33
34#if HAVE_TERMIOS_H
35#include <termios.h> /* For TIOCNOTTY. */
36#endif
37#ifdef HAVE_SYS_IOCTL_H 34#ifdef HAVE_SYS_IOCTL_H
38#include <sys/ioctl.h> 35#include <sys/ioctl.h>
39#endif 36#endif
@@ -692,7 +689,8 @@ encode_terminal_code (struct glyph *src, int src_len, struct coding_system *codi
692 encode_terminal_src_size); 689 encode_terminal_src_size);
693 buf = encode_terminal_src + nbytes; 690 buf = encode_terminal_src + nbytes;
694 } 691 }
695 if (char_charset (c, charset_list, NULL)) 692 if (CHAR_BYTE8_P (c)
693 || char_charset (c, charset_list, NULL))
696 { 694 {
697 /* Store the multibyte form of C at BUF. */ 695 /* Store the multibyte form of C at BUF. */
698 buf += CHAR_STRING (c, buf); 696 buf += CHAR_STRING (c, buf);
@@ -1617,18 +1615,15 @@ produce_glyphs (struct it *it)
1617 goto done; 1615 goto done;
1618 } 1616 }
1619 1617
1620 /* Maybe translate single-byte characters to multibyte. */ 1618 if (it->char_to_display >= 040 && it->char_to_display < 0177)
1621 it->char_to_display = it->c;
1622
1623 if (it->c >= 040 && it->c < 0177)
1624 { 1619 {
1625 it->pixel_width = it->nglyphs = 1; 1620 it->pixel_width = it->nglyphs = 1;
1626 if (it->glyph_row) 1621 if (it->glyph_row)
1627 append_glyph (it); 1622 append_glyph (it);
1628 } 1623 }
1629 else if (it->c == '\n') 1624 else if (it->char_to_display == '\n')
1630 it->pixel_width = it->nglyphs = 0; 1625 it->pixel_width = it->nglyphs = 0;
1631 else if (it->c == '\t') 1626 else if (it->char_to_display == '\t')
1632 { 1627 {
1633 int absolute_x = (it->current_x 1628 int absolute_x = (it->current_x
1634 + it->continuation_lines_width); 1629 + it->continuation_lines_width);
@@ -1659,32 +1654,19 @@ produce_glyphs (struct it *it)
1659 it->pixel_width = nspaces; 1654 it->pixel_width = nspaces;
1660 it->nglyphs = nspaces; 1655 it->nglyphs = nspaces;
1661 } 1656 }
1662 else if (CHAR_BYTE8_P (it->c)) 1657 else if (CHAR_BYTE8_P (it->char_to_display))
1663 { 1658 {
1664 if (unibyte_display_via_language_environment 1659 /* Coming here means that we must send the raw 8-bit byte as is
1665 && (it->c >= 0240)) 1660 to the terminal. Although there's no way to know how many
1666 { 1661 columns it occupies on a screen, it is a good assumption that
1667 it->char_to_display = BYTE8_TO_CHAR (it->c); 1662 a single byte code has 1-column width. */
1668 it->pixel_width = CHAR_WIDTH (it->char_to_display); 1663 it->pixel_width = it->nglyphs = 1;
1669 it->nglyphs = it->pixel_width; 1664 if (it->glyph_row)
1670 if (it->glyph_row) 1665 append_glyph (it);
1671 append_glyph (it);
1672 }
1673 else
1674 {
1675 /* Coming here means that it->c is from display table, thus
1676 we must send the raw 8-bit byte as is to the terminal.
1677 Although there's no way to know how many columns it
1678 occupies on a screen, it is a good assumption that a
1679 single byte code has 1-column width. */
1680 it->pixel_width = it->nglyphs = 1;
1681 if (it->glyph_row)
1682 append_glyph (it);
1683 }
1684 } 1666 }
1685 else 1667 else
1686 { 1668 {
1687 it->pixel_width = CHAR_WIDTH (it->c); 1669 it->pixel_width = CHAR_WIDTH (it->char_to_display);
1688 it->nglyphs = it->pixel_width; 1670 it->nglyphs = it->pixel_width;
1689 1671
1690 if (it->glyph_row) 1672 if (it->glyph_row)
@@ -1920,7 +1902,7 @@ produce_special_glyphs (struct it *it, enum display_element_type what)
1920 else 1902 else
1921 abort (); 1903 abort ();
1922 1904
1923 temp_it.c = GLYPH_CHAR (glyph); 1905 temp_it.c = temp_it.char_to_display = GLYPH_CHAR (glyph);
1924 temp_it.face_id = GLYPH_FACE (glyph); 1906 temp_it.face_id = GLYPH_FACE (glyph);
1925 temp_it.len = CHAR_BYTES (temp_it.c); 1907 temp_it.len = CHAR_BYTES (temp_it.c);
1926 1908