aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGlenn Morris2019-12-30 09:12:25 -0800
committerGlenn Morris2019-12-30 09:12:25 -0800
commit90083b7d78df1b8a054f3028cc9eb8c55a632b1e (patch)
tree458355c729fe23f2f3ca5788fc374e36c9935116
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
-rw-r--r--doc/lispref/customize.texi3
-rw-r--r--doc/lispref/internals.texi4
-rw-r--r--etc/NEWS.278
-rw-r--r--lisp/emacs-lisp/cl-extra.el2
-rw-r--r--lisp/tar-mode.el31
-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
10 files changed, 87 insertions, 29 deletions
diff --git a/doc/lispref/customize.texi b/doc/lispref/customize.texi
index b19feaf977f..a44446b1319 100644
--- a/doc/lispref/customize.texi
+++ b/doc/lispref/customize.texi
@@ -431,8 +431,7 @@ the build-time context. This also has the side-effect that the
431@kindex local@r{, @code{defcustom} keyword} 431@kindex local@r{, @code{defcustom} keyword}
432If the @var{value} is @code{t}, mark @var{option} as automatically 432If the @var{value} is @code{t}, mark @var{option} as automatically
433buffer-local; if the value is @code{permanent}, also set @var{option}s 433buffer-local; if the value is @code{permanent}, also set @var{option}s
434@code{permanent-local} property to @code{t}. @xref {Creating 434@code{permanent-local} property to @code{t}. @xref{Creating Buffer-Local}.
435Buffer-Local}.
436 435
437@item :risky @var{value} 436@item :risky @var{value}
438@kindex risky@r{, @code{defcustom} keyword} 437@kindex risky@r{, @code{defcustom} keyword}
diff --git a/doc/lispref/internals.texi b/doc/lispref/internals.texi
index 75e8345e969..2c47d67e3fb 100644
--- a/doc/lispref/internals.texi
+++ b/doc/lispref/internals.texi
@@ -972,7 +972,7 @@ The name of the variable to be used by Lisp programs.
972The name of the variable in the C sources. 972The name of the variable in the C sources.
973@item doc 973@item doc
974The documentation for the variable, as a C 974The documentation for the variable, as a C
975comment. @xref{Documentation Basics} for more details. 975comment. @xref{Documentation Basics}, for more details.
976@end table 976@end table
977 977
978 By convention, when defining variables of a ``native'' type 978 By convention, when defining variables of a ``native'' type
@@ -1651,7 +1651,7 @@ little-endian magnitude of the return value.
1651 1651
1652The following example uses the GNU Multiprecision Library (GMP) to 1652The following example uses the GNU Multiprecision Library (GMP) to
1653calculate the next probable prime after a given integer. 1653calculate the next probable prime after a given integer.
1654@xref{Top,,,gmp} for a general overview of GMP, and @pxref{Integer 1654@xref{Top,,,gmp}, for a general overview of GMP, and @pxref{Integer
1655Import and Export,,,gmp} for how to convert the @code{magnitude} array 1655Import and Export,,,gmp} for how to convert the @code{magnitude} array
1656to and from GMP @code{mpz_t} values. 1656to and from GMP @code{mpz_t} values.
1657 1657
diff --git a/etc/NEWS.27 b/etc/NEWS.27
index e630bb71fec..0c055ca682b 100644
--- a/etc/NEWS.27
+++ b/etc/NEWS.27
@@ -296,6 +296,14 @@ To get the old, less-secure behavior, you can set the
296*** When run by root, emacsclient no longer connects to non-root sockets. 296*** When run by root, emacsclient no longer connects to non-root sockets.
297(Instead you can use Tramp methods to run root commands in a non-root Emacs.) 297(Instead you can use Tramp methods to run root commands in a non-root Emacs.)
298 298
299---
300** 'xft-ignore-color-fonts' now ignores even more color fonts.
301There are color fonts that managed to bypass the existing checks,
302causing XFT crashes, they are now filtered out. Setting
303'xft-ignore-color-fonts' to nil removes those checks, which might
304require setting 'face-ignored-fonts' to filter out problematic fonts.
305Known problematic fonts are "Noto Color Emoji" and "Emoji One".
306
299+++ 307+++
300** New user option 'what-cursor-show-names'. 308** New user option 'what-cursor-show-names'.
301When non-nil, 'what-cursor-position' will show the name of the character 309When non-nil, 'what-cursor-position' will show the name of the character
diff --git a/lisp/emacs-lisp/cl-extra.el b/lisp/emacs-lisp/cl-extra.el
index 7e9d8fe870b..2e0b37c14de 100644
--- a/lisp/emacs-lisp/cl-extra.el
+++ b/lisp/emacs-lisp/cl-extra.el
@@ -469,7 +469,7 @@ Optional second arg STATE is a random-state object."
469 (while (< (setq i (1+ i)) 200) (cl-random 2 state)))) 469 (while (< (setq i (1+ i)) 200) (cl-random 2 state))))
470 (let* ((i (cl-callf (lambda (x) (% (1+ x) 55)) (cl--random-state-i state))) 470 (let* ((i (cl-callf (lambda (x) (% (1+ x) 55)) (cl--random-state-i state)))
471 (j (cl-callf (lambda (x) (% (1+ x) 55)) (cl--random-state-j state))) 471 (j (cl-callf (lambda (x) (% (1+ x) 55)) (cl--random-state-j state)))
472 (n (logand 8388607 (aset vec i (- (aref vec i) (aref vec j)))))) 472 (n (aset vec i (logand 8388607 (- (aref vec i) (aref vec j))))))
473 (if (integerp lim) 473 (if (integerp lim)
474 (if (<= lim 512) (% n lim) 474 (if (<= lim 512) (% n lim)
475 (if (> lim 8388607) (setq n (+ (ash n 9) (cl-random 512 state)))) 475 (if (> lim 8388607) (setq n (+ (ash n 9) (cl-random 512 state))))
diff --git a/lisp/tar-mode.el b/lisp/tar-mode.el
index 569b01f978b..d3ad5830cf5 100644
--- a/lisp/tar-mode.el
+++ b/lisp/tar-mode.el
@@ -223,10 +223,14 @@ Preserve the modified states of the buffers and set `buffer-swapped-with'."
223 "Round S up to the next multiple of 512." 223 "Round S up to the next multiple of 512."
224 (ash (ash (+ s 511) -9) 9)) 224 (ash (ash (+ s 511) -9) 9))
225 225
226(defun tar-header-block-tokenize (pos coding) 226(defun tar-header-block-tokenize (pos coding &optional disable-slash)
227 "Return a `tar-header' structure. 227 "Return a `tar-header' structure.
228This is a list of name, mode, uid, gid, size, 228This is a list of name, mode, uid, gid, size,
229write-date, checksum, link-type, and link-name." 229write-date, checksum, link-type, and link-name.
230CODING is our best guess for decoding non-ASCII file names.
231DISABLE-SLASH, if non-nil, means don't decide an entry is a directory
232based on the trailing slash, only based on the \"link-type\" field
233of the file header. This is used for \"old GNU\" Tar format."
230 (if (> (+ pos 512) (point-max)) (error "Malformed Tar header")) 234 (if (> (+ pos 512) (point-max)) (error "Malformed Tar header"))
231 (cl-assert (zerop (mod (- pos (point-min)) 512))) 235 (cl-assert (zerop (mod (- pos (point-min)) 512)))
232 (cl-assert (not enable-multibyte-characters)) 236 (cl-assert (not enable-multibyte-characters))
@@ -272,7 +276,7 @@ write-date, checksum, link-type, and link-name."
272 (decode-coding-string name coding) 276 (decode-coding-string name coding)
273 linkname 277 linkname
274 (decode-coding-string linkname coding)) 278 (decode-coding-string linkname coding))
275 (if (and (null link-p) (string-match "/\\'" name)) 279 (if (and (null link-p) (null disable-slash) (string-match "/\\'" name))
276 (setq link-p 5)) ; directory 280 (setq link-p 5)) ; directory
277 281
278 (if (and (equal name "././@LongLink") 282 (if (and (equal name "././@LongLink")
@@ -283,12 +287,23 @@ write-date, checksum, link-type, and link-name."
283 ;; This is a GNU Tar long-file-name header. 287 ;; This is a GNU Tar long-file-name header.
284 (let* ((size (tar-parse-octal-integer 288 (let* ((size (tar-parse-octal-integer
285 string tar-size-offset tar-time-offset)) 289 string tar-size-offset tar-time-offset))
286 ;; -1 so as to strip the terminating 0 byte. 290 ;; The long name is in the next 512-byte block.
291 ;; We've already moved POS there, when we computed
292 ;; STRING above.
287 (name (decode-coding-string 293 (name (decode-coding-string
294 ;; -1 so as to strip the terminating 0 byte.
288 (buffer-substring pos (+ pos size -1)) coding)) 295 (buffer-substring pos (+ pos size -1)) coding))
296 ;; Tokenize the header of the _real_ file entry,
297 ;; which is further 512 bytes into the archive.
289 (descriptor (tar-header-block-tokenize 298 (descriptor (tar-header-block-tokenize
290 (+ pos (tar-roundup-512 size)) 299 (+ pos (tar-roundup-512 size)) coding
291 coding))) 300 ;; Don't intuit directories from
301 ;; the trailing slash, because the
302 ;; truncated name might by chance end
303 ;; in a slash.
304 'ignore-trailing-slash)))
305 ;; Fix the descriptor of the real file entry by using
306 ;; the information from the long name entry.
292 (cond 307 (cond
293 ((eq link-p (- ?L ?0)) ;GNUTYPE_LONGNAME. 308 ((eq link-p (- ?L ?0)) ;GNUTYPE_LONGNAME.
294 (setf (tar-header-name descriptor) name)) 309 (setf (tar-header-name descriptor) name))
@@ -296,6 +311,10 @@ write-date, checksum, link-type, and link-name."
296 (setf (tar-header-link-name descriptor) name)) 311 (setf (tar-header-link-name descriptor) name))
297 (t 312 (t
298 (message "Unrecognized GNU Tar @LongLink format"))) 313 (message "Unrecognized GNU Tar @LongLink format")))
314 ;; Fix the "link-type" attribute, based on the long name.
315 (if (and (null (tar-header-link-type descriptor))
316 (string-match "/\\'" name))
317 (setf (tar-header-link-type descriptor) 5)) ; directory
299 (setf (tar-header-header-start descriptor) 318 (setf (tar-header-header-start descriptor)
300 (copy-marker (- pos 512) t)) 319 (copy-marker (- pos 512) t))
301 descriptor) 320 descriptor)
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);