aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorGlenn Morris2020-03-04 13:57:58 -0800
committerGlenn Morris2020-03-04 13:57:58 -0800
commit6a0e1c41040059d1a463fbf69be52e898b30691a (patch)
treea230d2d3d62c8b9124da17e9f55d21d6fcc1ccbb /src
parentb6c39214065272e33a544d09b9a341bbe17ed47b (diff)
parenta4e4510ccd92da8ca17743c7dab9b32fc9d850e7 (diff)
downloademacs-6a0e1c41040059d1a463fbf69be52e898b30691a.tar.gz
emacs-6a0e1c41040059d1a463fbf69be52e898b30691a.zip
Merge from origin/emacs-27
a4e4510ccd Fix handling MS-Windows keyboard input above the BMP a38bebb0c1 * etc/NEWS: More complete description of rx 'not' changes. d373647e8f ; * doc/emacs/mini.texi (Yes or No Prompts): Fix last change. 1ca6d15656 * doc/emacs/mini.texi (Yes or No Prompts): 'y-or-n-p' now ... fe1a447d52 Don't attempt to cache glyph metrics for FONT_INVALID_CODE b42b894d1d Fix fit-frame-to-buffer for multi-monitor setup 366fd4fd07 (emacs-27) ; * etc/NEWS: Fix typo. 49d3cd90bd rx: Improve 'or' compositionality (bug#37659) 6b48aedb6b * lisp/tab-line.el: Fix auto-hscrolling (bug#39649) c5f255d681 (tag: emacs-27.0.90) ; Update lisp/ldefs-boot.el 60c84ad992 ; * etc/TODO: Fix last change. 5af9e5baad ; Add an entry to TODO d424195905 Fix rx charset generation 9908b5a614 Merge branch 'emacs-27' of git.savannah.gnu.org:/srv/git/e... 6dc2ebe00e Fix overquoting in mule.el 5cca73dd82 * src/timefns.c (time_arith): Omit incorrect comment. d767c357ca Merge branch 'emacs-27' of git.savannah.gnu.org:/srv/git/e... 4dec693f70 * lisp/vc/vc-cvs.el (vc-cvs-ignore): Copy-edit doc string ff729e3f97 ; bug#39779: Fix some typos in documentation. 696ee02c3a checkdoc: Don't mistake "cf." for sentence end # Conflicts: # etc/NEWS
Diffstat (limited to 'src')
-rw-r--r--src/composite.c18
-rw-r--r--src/font.c4
-rw-r--r--src/font.h2
-rw-r--r--src/timefns.c4
-rw-r--r--src/w32term.c42
5 files changed, 58 insertions, 12 deletions
diff --git a/src/composite.c b/src/composite.c
index 05365cfb65e..84de334ce0d 100644
--- a/src/composite.c
+++ b/src/composite.c
@@ -818,6 +818,11 @@ fill_gstring_body (Lisp_Object gstring)
818 Lisp_Object header = AREF (gstring, 0); 818 Lisp_Object header = AREF (gstring, 0);
819 ptrdiff_t len = LGSTRING_CHAR_LEN (gstring); 819 ptrdiff_t len = LGSTRING_CHAR_LEN (gstring);
820 ptrdiff_t i; 820 ptrdiff_t i;
821 struct font *font = NULL;
822 unsigned int code;
823
824 if (FONT_OBJECT_P (font_object))
825 font = XFONT_OBJECT (font_object);
821 826
822 for (i = 0; i < len; i++) 827 for (i = 0; i < len; i++)
823 { 828 {
@@ -832,10 +837,15 @@ fill_gstring_body (Lisp_Object gstring)
832 LGLYPH_SET_FROM (g, i); 837 LGLYPH_SET_FROM (g, i);
833 LGLYPH_SET_TO (g, i); 838 LGLYPH_SET_TO (g, i);
834 LGLYPH_SET_CHAR (g, c); 839 LGLYPH_SET_CHAR (g, c);
835 if (FONT_OBJECT_P (font_object)) 840
836 { 841 if (font != NULL)
837 font_fill_lglyph_metrics (g, font_object); 842 code = font->driver->encode_char (font, LGLYPH_CHAR (g));
838 } 843 else
844 code = FONT_INVALID_CODE;
845 if (code != FONT_INVALID_CODE)
846 {
847 font_fill_lglyph_metrics (g, font, code);
848 }
839 else 849 else
840 { 850 {
841 int width = XFIXNAT (CHAR_TABLE_REF (Vchar_width_table, c)); 851 int width = XFIXNAT (CHAR_TABLE_REF (Vchar_width_table, c));
diff --git a/src/font.c b/src/font.c
index bb39aef92d5..2a456300619 100644
--- a/src/font.c
+++ b/src/font.c
@@ -4416,10 +4416,8 @@ DEFUN ("clear-font-cache", Fclear_font_cache, Sclear_font_cache, 0, 0, 0,
4416 4416
4417 4417
4418void 4418void
4419font_fill_lglyph_metrics (Lisp_Object glyph, Lisp_Object font_object) 4419font_fill_lglyph_metrics (Lisp_Object glyph, struct font *font, unsigned int code)
4420{ 4420{
4421 struct font *font = XFONT_OBJECT (font_object);
4422 unsigned code = font->driver->encode_char (font, LGLYPH_CHAR (glyph));
4423 struct font_metrics metrics; 4421 struct font_metrics metrics;
4424 4422
4425 LGLYPH_SET_CODE (glyph, code); 4423 LGLYPH_SET_CODE (glyph, code);
diff --git a/src/font.h b/src/font.h
index 0561e3c83f5..8614e7fa10a 100644
--- a/src/font.h
+++ b/src/font.h
@@ -886,7 +886,7 @@ extern Lisp_Object font_update_drivers (struct frame *f, Lisp_Object list);
886extern Lisp_Object font_range (ptrdiff_t, ptrdiff_t, ptrdiff_t *, 886extern Lisp_Object font_range (ptrdiff_t, ptrdiff_t, ptrdiff_t *,
887 struct window *, struct face *, 887 struct window *, struct face *,
888 Lisp_Object); 888 Lisp_Object);
889extern void font_fill_lglyph_metrics (Lisp_Object, Lisp_Object); 889extern void font_fill_lglyph_metrics (Lisp_Object, struct font *, unsigned int);
890 890
891extern Lisp_Object font_put_extra (Lisp_Object font, Lisp_Object prop, 891extern Lisp_Object font_put_extra (Lisp_Object font, Lisp_Object prop,
892 Lisp_Object val); 892 Lisp_Object val);
diff --git a/src/timefns.c b/src/timefns.c
index 0aa8775f9ff..41db1e68759 100644
--- a/src/timefns.c
+++ b/src/timefns.c
@@ -1039,9 +1039,7 @@ lispint_arith (Lisp_Object a, Lisp_Object b, bool subtract)
1039} 1039}
1040 1040
1041/* Given Lisp operands A and B, add their values, and return the 1041/* Given Lisp operands A and B, add their values, and return the
1042 result as a Lisp timestamp that is in (TICKS . HZ) form if either A 1042 result as a Lisp timestamp. Subtract instead of adding if SUBTRACT. */
1043 or B are in that form or are floats, (HI LO US PS) form otherwise.
1044 Subtract instead of adding if SUBTRACT. */
1045static Lisp_Object 1043static Lisp_Object
1046time_arith (Lisp_Object a, Lisp_Object b, bool subtract) 1044time_arith (Lisp_Object a, Lisp_Object b, bool subtract)
1047{ 1045{
diff --git a/src/w32term.c b/src/w32term.c
index 4eb5045fc5b..f515f5604d6 100644
--- a/src/w32term.c
+++ b/src/w32term.c
@@ -4701,6 +4701,10 @@ static short temp_buffer[100];
4701/* Temporarily store lead byte of DBCS input sequences. */ 4701/* Temporarily store lead byte of DBCS input sequences. */
4702static char dbcs_lead = 0; 4702static char dbcs_lead = 0;
4703 4703
4704/* Temporarily store pending UTF-16 high surrogate unit and the modifiers. */
4705static unsigned short utf16_high;
4706static DWORD utf16_high_modifiers;
4707
4704/** 4708/**
4705 mouse_or_wdesc_frame: When not dropping and the mouse was grabbed 4709 mouse_or_wdesc_frame: When not dropping and the mouse was grabbed
4706 for DPYINFO, return the frame where the mouse was seen last. If 4710 for DPYINFO, return the frame where the mouse was seen last. If
@@ -4912,9 +4916,45 @@ w32_read_socket (struct terminal *terminal,
4912 XSETFRAME (inev.frame_or_window, f); 4916 XSETFRAME (inev.frame_or_window, f);
4913 inev.timestamp = msg.msg.time; 4917 inev.timestamp = msg.msg.time;
4914 4918
4919 if (utf16_high
4920 && (msg.msg.message != WM_UNICHAR
4921 || UTF_16_HIGH_SURROGATE_P (msg.msg.wParam)))
4922 {
4923 /* Flush the pending high surrogate if the low one
4924 isn't coming. (This should never happen, but I
4925 have paranoia about this stuff.) */
4926 struct input_event inev1;
4927 inev1.modifiers = utf16_high_modifiers;
4928 inev1.code = utf16_high;
4929 inev1.timestamp = inev.timestamp;
4930 inev1.arg = Qnil;
4931 kbd_buffer_store_event_hold (&inev1, hold_quit);
4932 utf16_high = 0;
4933 utf16_high_modifiers = 0;
4934 }
4935
4915 if (msg.msg.message == WM_UNICHAR) 4936 if (msg.msg.message == WM_UNICHAR)
4916 { 4937 {
4917 inev.code = msg.msg.wParam; 4938 /* Handle UTF-16 encoded codepoint above the BMP.
4939 This is needed to support Emoji input from input
4940 panel popped up by "Win+." shortcut. */
4941 if (UTF_16_HIGH_SURROGATE_P (msg.msg.wParam))
4942 {
4943 utf16_high = msg.msg.wParam;
4944 utf16_high_modifiers = inev.modifiers;
4945 inev.kind = NO_EVENT;
4946 break;
4947 }
4948 else if (UTF_16_LOW_SURROGATE_P (msg.msg.wParam)
4949 && utf16_high)
4950 {
4951 inev.code = surrogates_to_codepoint (msg.msg.wParam,
4952 utf16_high);
4953 utf16_high = 0;
4954 utf16_high_modifiers = 0;
4955 }
4956 else
4957 inev.code = msg.msg.wParam;
4918 } 4958 }
4919 else if (msg.msg.wParam < 256) 4959 else if (msg.msg.wParam < 256)
4920 { 4960 {