aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorPaul Eggert2017-04-17 10:19:39 -0700
committerPaul Eggert2017-04-17 10:20:39 -0700
commit932698b7891668318ba9ca93375d8d27d52a07f5 (patch)
treed70172f4f246978a31460b68a95f1ac69bb1ebc5 /src
parent09eaf661eb6ea49c6324d8819a872c523133dc2b (diff)
downloademacs-932698b7891668318ba9ca93375d8d27d52a07f5.tar.gz
emacs-932698b7891668318ba9ca93375d8d27d52a07f5.zip
Tighten recently-added UTF-8 check
* src/coding.c (encode_coding_utf_8): Now extern. * src/terminal.c (terminal_glyph_code) [HAVE_STRUCT_UNIPAIR_UNICODE]: Check for UTF-8, not just for multibyte.
Diffstat (limited to 'src')
-rw-r--r--src/coding.c2
-rw-r--r--src/coding.h1
-rw-r--r--src/terminal.c5
3 files changed, 5 insertions, 3 deletions
diff --git a/src/coding.c b/src/coding.c
index e341a71f576..367a9759848 100644
--- a/src/coding.c
+++ b/src/coding.c
@@ -1449,7 +1449,7 @@ decode_coding_utf_8 (struct coding_system *coding)
1449} 1449}
1450 1450
1451 1451
1452static bool 1452bool
1453encode_coding_utf_8 (struct coding_system *coding) 1453encode_coding_utf_8 (struct coding_system *coding)
1454{ 1454{
1455 bool multibytep = coding->dst_multibyte; 1455 bool multibytep = coding->dst_multibyte;
diff --git a/src/coding.h b/src/coding.h
index 77f90ec9c15..8ed851d99ff 100644
--- a/src/coding.h
+++ b/src/coding.h
@@ -664,6 +664,7 @@ struct coding_system
664 664
665/* Extern declarations. */ 665/* Extern declarations. */
666extern Lisp_Object code_conversion_save (bool, bool); 666extern Lisp_Object code_conversion_save (bool, bool);
667extern bool encode_coding_utf_8 (struct coding_system *);
667extern void setup_coding_system (Lisp_Object, struct coding_system *); 668extern void setup_coding_system (Lisp_Object, struct coding_system *);
668extern Lisp_Object coding_charset_list (struct coding_system *); 669extern Lisp_Object coding_charset_list (struct coding_system *);
669extern Lisp_Object coding_system_charset_list (Lisp_Object); 670extern Lisp_Object coding_system_charset_list (Lisp_Object);
diff --git a/src/terminal.c b/src/terminal.c
index 3d25b36fa56..367f2ac7192 100644
--- a/src/terminal.c
+++ b/src/terminal.c
@@ -576,8 +576,9 @@ terminal_glyph_code (struct terminal *t, int ch)
576{ 576{
577#if HAVE_STRUCT_UNIPAIR_UNICODE 577#if HAVE_STRUCT_UNIPAIR_UNICODE
578 /* Heuristically assume that a terminal supporting glyph codes is in 578 /* Heuristically assume that a terminal supporting glyph codes is in
579 UTF-8 mode if and only if its coding system is multibyte (Bug#26396). */ 579 UTF-8 mode if and only if its coding system is UTF-8 (Bug#26396). */
580 if (t->type == output_termcap && t->terminal_coding->src_multibyte) 580 if (t->type == output_termcap
581 && t->terminal_coding->encoder == encode_coding_utf_8)
581 { 582 {
582 /* As a hack, recompute the table when CH is the maximum 583 /* As a hack, recompute the table when CH is the maximum
583 character. */ 584 character. */