aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorGlenn Morris2019-12-30 09:12:25 -0800
committerGlenn Morris2019-12-30 09:12:25 -0800
commit90083b7d78df1b8a054f3028cc9eb8c55a632b1e (patch)
tree458355c729fe23f2f3ca5788fc374e36c9935116 /src
parent00c9308ae86dbc2ace7e0154586be84f17036a2b (diff)
parent59f71d20eade09e6c2ef99fc4d9b99a161bff040 (diff)
downloademacs-90083b7d78df1b8a054f3028cc9eb8c55a632b1e.tar.gz
emacs-90083b7d78df1b8a054f3028cc9eb8c55a632b1e.zip
Merge from origin/emacs-27
59f71d20ea (origin/emacs-27) Fix tar-mode reading the oldgnu Tar format e3ec84fd7d Ensure mini-window is resized to show active minibuffer co... 450633f85a Fix mini-window resizing under resize-mini-windows = t 219d47893a (emacs-27) Fixes for makeinfo 4.13 4bbfd2b42f ; fix previous NEWS entry 81b697d106 Fix crash under -nw on macOS properly this time 9ce4207969 Revert "Check for GUI frame in ns_color_index_to_rgba" 732dcfc850 Ignore all color fonts when using XFT aa0c679f48 Avoid unbounded growth of cl-random-state components (bug#... # Conflicts: # etc/NEWS # src/nsterm.m
Diffstat (limited to 'src')
-rw-r--r--src/dispextern.h4
-rw-r--r--src/ftfont.c17
-rw-r--r--src/keyboard.c15
-rw-r--r--src/nsterm.m25
-rw-r--r--src/window.c7
5 files changed, 50 insertions, 18 deletions
diff --git a/src/dispextern.h b/src/dispextern.h
index 0615b16d712..4bf9f39cd08 100644
--- a/src/dispextern.h
+++ b/src/dispextern.h
@@ -123,7 +123,9 @@ typedef HDC Emacs_Pix_Context;
123 123
124#ifdef HAVE_NS 124#ifdef HAVE_NS
125#include "nsgui.h" 125#include "nsgui.h"
126#define FACE_COLOR_TO_PIXEL(face_color, frame) ns_color_index_to_rgba(face_color, frame) 126#define FACE_COLOR_TO_PIXEL(face_color, frame) (FRAME_NS_P (frame) \
127 ? ns_color_index_to_rgba (face_color, frame) \
128 : face_color)
127/* Following typedef needed to accommodate the MSDOS port, believe it or not. */ 129/* Following typedef needed to accommodate the MSDOS port, believe it or not. */
128typedef struct ns_display_info Display_Info; 130typedef struct ns_display_info Display_Info;
129typedef Emacs_Pixmap Emacs_Pix_Container; 131typedef Emacs_Pixmap Emacs_Pix_Container;
diff --git a/src/ftfont.c b/src/ftfont.c
index b8199dc4ba7..5bc048c3003 100644
--- a/src/ftfont.c
+++ b/src/ftfont.c
@@ -865,6 +865,9 @@ ftfont_list (struct frame *f, Lisp_Object spec)
865#ifdef FC_FONTFORMAT 865#ifdef FC_FONTFORMAT
866 FC_FONTFORMAT, 866 FC_FONTFORMAT,
867#endif 867#endif
868#if defined HAVE_XFT && defined FC_COLOR
869 FC_COLOR,
870#endif
868 NULL); 871 NULL);
869 if (! objset) 872 if (! objset)
870 goto err; 873 goto err;
@@ -904,7 +907,19 @@ ftfont_list (struct frame *f, Lisp_Object spec)
904 for (i = 0; i < fontset->nfont; i++) 907 for (i = 0; i < fontset->nfont; i++)
905 { 908 {
906 Lisp_Object entity; 909 Lisp_Object entity;
907 910#if defined HAVE_XFT && defined FC_COLOR
911 {
912 /* Some fonts, notably NotoColorEmoji, have an FC_COLOR value
913 that's neither FcTrue nor FcFalse, which means FcFontList
914 returns them even when it shouldn't really do so, so we
915 need to manually skip them here (Bug#37786). */
916 FcBool b;
917 if (Vxft_ignore_color_fonts
918 && FcPatternGetBool (fontset->fonts[i], FC_COLOR, 0, &b)
919 == FcResultMatch && b != FcFalse)
920 continue;
921 }
922#endif
908 if (spacing >= 0) 923 if (spacing >= 0)
909 { 924 {
910 int this; 925 int this;
diff --git a/src/keyboard.c b/src/keyboard.c
index 4cf1f64b487..cb311efd7e5 100644
--- a/src/keyboard.c
+++ b/src/keyboard.c
@@ -1318,6 +1318,11 @@ command_loop_1 (void)
1318 message1 (0); 1318 message1 (0);
1319 safe_run_hooks (Qecho_area_clear_hook); 1319 safe_run_hooks (Qecho_area_clear_hook);
1320 1320
1321 /* We cleared the echo area, and the minibuffer will now
1322 show, so resize the mini-window in case the minibuffer
1323 needs more or less space than the echo area. */
1324 resize_mini_window (XWINDOW (minibuf_window), false);
1325
1321 unbind_to (count, Qnil); 1326 unbind_to (count, Qnil);
1322 1327
1323 /* If a C-g came in before, treat it as input now. */ 1328 /* If a C-g came in before, treat it as input now. */
@@ -2989,6 +2994,16 @@ read_char (int commandflag, Lisp_Object map,
2989 { 2994 {
2990 safe_run_hooks (Qecho_area_clear_hook); 2995 safe_run_hooks (Qecho_area_clear_hook);
2991 clear_message (1, 0); 2996 clear_message (1, 0);
2997 /* If we were showing the echo-area message on top of an
2998 active minibuffer, resize the mini-window, since the
2999 minibuffer may need more or less space than the echo area
3000 we've just wiped. */
3001 if (minibuf_level
3002 && EQ (minibuf_window, echo_area_window)
3003 /* The case where minibuffer-message-timeout is a number
3004 was already handled near the beginning of command_loop_1. */
3005 && !NUMBERP (Vminibuffer_message_timeout))
3006 resize_mini_window (XWINDOW (minibuf_window), false);
2992 } 3007 }
2993 else if (FUNCTIONP (Vclear_message_function)) 3008 else if (FUNCTIONP (Vclear_message_function))
2994 clear_message (1, 0); 3009 clear_message (1, 0);
diff --git a/src/nsterm.m b/src/nsterm.m
index c575e6c100c..ab571e4a1a7 100644
--- a/src/nsterm.m
+++ b/src/nsterm.m
@@ -2290,26 +2290,21 @@ ns_lisp_to_color (Lisp_Object color, NSColor **col)
2290 2290
2291/* Convert an index into the color table into an RGBA value. Used in 2291/* Convert an index into the color table into an RGBA value. Used in
2292 xdisp.c:extend_face_to_end_of_line when comparing faces and frame 2292 xdisp.c:extend_face_to_end_of_line when comparing faces and frame
2293 color values. No-op on non-gui frames. */ 2293 color values. */
2294 2294
2295unsigned long 2295unsigned long
2296ns_color_index_to_rgba(int idx, struct frame *f) 2296ns_color_index_to_rgba(int idx, struct frame *f)
2297{ 2297{
2298 if (FRAME_DISPLAY_INFO (f)) 2298 NSColor *col;
2299 { 2299 col = ns_lookup_indexed_color (idx, f);
2300 NSColor *col;
2301 col = ns_lookup_indexed_color (idx, f);
2302 2300
2303 EmacsCGFloat r, g, b, a; 2301 EmacsCGFloat r, g, b, a;
2304 [col getRed: &r green: &g blue: &b alpha: &a]; 2302 [col getRed: &r green: &g blue: &b alpha: &a];
2305 2303
2306 return ARGB_TO_ULONG((unsigned long) (a * 255), 2304 return ARGB_TO_ULONG((unsigned long) (a * 255),
2307 (unsigned long) (r * 255), 2305 (unsigned long) (r * 255),
2308 (unsigned long) (g * 255), 2306 (unsigned long) (g * 255),
2309 (unsigned long) (b * 255)); 2307 (unsigned long) (b * 255));
2310 }
2311 else
2312 return idx;
2313} 2308}
2314 2309
2315void 2310void
@@ -2330,7 +2325,7 @@ ns_query_color(void *col, Emacs_Color *color_def, bool setPixel)
2330 if (setPixel == YES) 2325 if (setPixel == YES)
2331 color_def->pixel 2326 color_def->pixel
2332 = ARGB_TO_ULONG((unsigned long) (a * 255), 2327 = ARGB_TO_ULONG((unsigned long) (a * 255),
2333 (unsigned long) (r * 255), 2328 (unsigned long) (r * 255),
2334 (unsigned long) (g * 255), 2329 (unsigned long) (g * 255),
2335 (unsigned long) (b * 255)); 2330 (unsigned long) (b * 255));
2336} 2331}
diff --git a/src/window.c b/src/window.c
index c52a8ca2855..1962e07f8d0 100644
--- a/src/window.c
+++ b/src/window.c
@@ -5229,10 +5229,15 @@ grow_mini_window (struct window *w, int delta)
5229{ 5229{
5230 struct frame *f = XFRAME (w->frame); 5230 struct frame *f = XFRAME (w->frame);
5231 int old_height = window_body_height (w, true); 5231 int old_height = window_body_height (w, true);
5232 int min_height = FRAME_LINE_HEIGHT (f);
5232 5233
5233 eassert (MINI_WINDOW_P (w)); 5234 eassert (MINI_WINDOW_P (w));
5234 5235
5235 if ((delta != 0) && (old_height + delta >= FRAME_LINE_HEIGHT (f))) 5236 /* Never shrink mini-window to less than its minimum height. */
5237 if (old_height + delta < min_height)
5238 delta = old_height > min_height ? min_height - old_height : 0;
5239
5240 if (delta != 0)
5236 { 5241 {
5237 Lisp_Object root = FRAME_ROOT_WINDOW (f); 5242 Lisp_Object root = FRAME_ROOT_WINDOW (f);
5238 struct window *r = XWINDOW (root); 5243 struct window *r = XWINDOW (root);