aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAndrea Corallo2021-02-26 19:54:59 +0100
committerAndrea Corallo2021-02-26 19:54:59 +0100
commit5c922cc3a4b0677805a678267df2b7598e92bb83 (patch)
treef7680e085436621332230c7a46df36ad4048310b /src
parentcedc55041ea5179dcb389845d2d0e3562060cab9 (diff)
parent496fa1c03b1b3ce4aa9872751e9fac45167766c2 (diff)
downloademacs-5c922cc3a4b0677805a678267df2b7598e92bb83.tar.gz
emacs-5c922cc3a4b0677805a678267df2b7598e92bb83.zip
Merge remote-tracking branch 'savannah/master' into native-comp
Diffstat (limited to 'src')
-rw-r--r--src/editfns.c3
-rw-r--r--src/fns.c12
-rw-r--r--src/gnutls.c2
-rw-r--r--src/nsterm.m20
-rw-r--r--src/xdisp.c36
-rw-r--r--src/xfaces.c9
6 files changed, 55 insertions, 27 deletions
diff --git a/src/editfns.c b/src/editfns.c
index 991f79abac7..fb20fc96550 100644
--- a/src/editfns.c
+++ b/src/editfns.c
@@ -2945,7 +2945,7 @@ usage: (propertize STRING &rest PROPERTIES) */)
2945 2945
2946 /* Number of args must be odd. */ 2946 /* Number of args must be odd. */
2947 if ((nargs & 1) == 0) 2947 if ((nargs & 1) == 0)
2948 error ("Wrong number of arguments"); 2948 xsignal2 (Qwrong_number_of_arguments, Qpropertize, make_fixnum (nargs));
2949 2949
2950 properties = string = Qnil; 2950 properties = string = Qnil;
2951 2951
@@ -4448,6 +4448,7 @@ syms_of_editfns (void)
4448{ 4448{
4449 DEFSYM (Qbuffer_access_fontify_functions, "buffer-access-fontify-functions"); 4449 DEFSYM (Qbuffer_access_fontify_functions, "buffer-access-fontify-functions");
4450 DEFSYM (Qwall, "wall"); 4450 DEFSYM (Qwall, "wall");
4451 DEFSYM (Qpropertize, "propertize");
4451 4452
4452 DEFVAR_LISP ("inhibit-field-text-motion", Vinhibit_field_text_motion, 4453 DEFVAR_LISP ("inhibit-field-text-motion", Vinhibit_field_text_motion,
4453 doc: /* Non-nil means text motion commands don't notice fields. */); 4454 doc: /* Non-nil means text motion commands don't notice fields. */);
diff --git a/src/fns.c b/src/fns.c
index c16f9c63998..7914bd47790 100644
--- a/src/fns.c
+++ b/src/fns.c
@@ -2873,6 +2873,9 @@ if `last-nonmenu-event' is nil, and `use-dialog-box' is non-nil. */)
2873 return obj; 2873 return obj;
2874 } 2874 }
2875 2875
2876 if (use_short_answers)
2877 return call1 (intern ("y-or-n-p"), prompt);
2878
2876 AUTO_STRING (yes_or_no, "(yes or no) "); 2879 AUTO_STRING (yes_or_no, "(yes or no) ");
2877 prompt = CALLN (Fconcat, prompt, yes_or_no); 2880 prompt = CALLN (Fconcat, prompt, yes_or_no);
2878 2881
@@ -5904,6 +5907,15 @@ that disables the use of a file dialog, regardless of the value of
5904this variable. */); 5907this variable. */);
5905 use_file_dialog = true; 5908 use_file_dialog = true;
5906 5909
5910 DEFVAR_BOOL ("use-short-answers", use_short_answers,
5911 doc: /* Non-nil means `yes-or-no-p' uses shorter answers "y" or "n".
5912When non-nil, `yes-or-no-p' will use `y-or-n-p' to read the answer.
5913We recommend against setting this variable non-nil, because `yes-or-no-p'
5914is intended to be used when users are expected not to respond too
5915quickly, but to take their time and perhaps think about the answer.
5916The same variable also affects the function `read-answer'. */);
5917 use_short_answers = false;
5918
5907 defsubr (&Sidentity); 5919 defsubr (&Sidentity);
5908 defsubr (&Srandom); 5920 defsubr (&Srandom);
5909 defsubr (&Slength); 5921 defsubr (&Slength);
diff --git a/src/gnutls.c b/src/gnutls.c
index aa245ee5c39..4d5a909db0d 100644
--- a/src/gnutls.c
+++ b/src/gnutls.c
@@ -625,6 +625,8 @@ gnutls_try_handshake (struct Lisp_Process *proc)
625 625
626 while ((ret = gnutls_handshake (state)) < 0) 626 while ((ret = gnutls_handshake (state)) < 0)
627 { 627 {
628 if (gnutls_error_is_fatal (ret))
629 return emacs_gnutls_handle_error (state, ret);
628 do 630 do
629 ret = gnutls_handshake (state); 631 ret = gnutls_handshake (state);
630 while (ret == GNUTLS_E_INTERRUPTED); 632 while (ret == GNUTLS_E_INTERRUPTED);
diff --git a/src/nsterm.m b/src/nsterm.m
index 88317f88393..bf175bbd188 100644
--- a/src/nsterm.m
+++ b/src/nsterm.m
@@ -8411,13 +8411,16 @@ not_in_argv (NSString *arg)
8411{ 8411{
8412 NSTRACE ("EmacsView windowDidChangeBackingProperties:]"); 8412 NSTRACE ("EmacsView windowDidChangeBackingProperties:]");
8413 8413
8414 NSRect frame = [self frame]; 8414 if ([self wantsUpdateLayer])
8415 {
8416 NSRect frame = [self frame];
8415 8417
8416 [surface release]; 8418 [surface release];
8417 surface = nil; 8419 surface = nil;
8418 8420
8419 ns_clear_frame (emacsframe); 8421 ns_clear_frame (emacsframe);
8420 expose_frame (emacsframe, 0, 0, NSWidth (frame), NSHeight (frame)); 8422 expose_frame (emacsframe, 0, 0, NSWidth (frame), NSHeight (frame));
8423 }
8421} 8424}
8422#endif /* NS_DRAW_TO_BUFFER */ 8425#endif /* NS_DRAW_TO_BUFFER */
8423 8426
@@ -8480,7 +8483,7 @@ not_in_argv (NSString *arg)
8480} 8483}
8481 8484
8482 8485
8483#ifdef NS_IMPL_COCOA 8486#ifdef NS_DRAW_TO_BUFFER
8484/* If the frame has been garbaged but the toolkit wants to draw, for 8487/* If the frame has been garbaged but the toolkit wants to draw, for
8485 example when resizing the frame, we end up with a blank screen. 8488 example when resizing the frame, we end up with a blank screen.
8486 Sometimes this results in an unpleasant flicker, so try to 8489 Sometimes this results in an unpleasant flicker, so try to
@@ -8488,7 +8491,8 @@ not_in_argv (NSString *arg)
8488- (void)viewWillDraw 8491- (void)viewWillDraw
8489{ 8492{
8490 if (FRAME_GARBAGED_P (emacsframe) 8493 if (FRAME_GARBAGED_P (emacsframe)
8491 && !redisplaying_p) 8494 && !redisplaying_p
8495 && [self wantsUpdateLayer])
8492 { 8496 {
8493 /* If there is IO going on when redisplay is run here Emacs 8497 /* If there is IO going on when redisplay is run here Emacs
8494 crashes. I think it's because this code will always be run 8498 crashes. I think it's because this code will always be run
@@ -8505,10 +8509,8 @@ not_in_argv (NSString *arg)
8505 waiting_for_input = owfi; 8509 waiting_for_input = owfi;
8506 } 8510 }
8507} 8511}
8508#endif
8509 8512
8510 8513
8511#ifdef NS_DRAW_TO_BUFFER
8512- (BOOL)wantsUpdateLayer 8514- (BOOL)wantsUpdateLayer
8513{ 8515{
8514#if MAC_OS_X_VERSION_MIN_REQUIRED < 101400 8516#if MAC_OS_X_VERSION_MIN_REQUIRED < 101400
diff --git a/src/xdisp.c b/src/xdisp.c
index f86d3527b3d..cc0a689ba32 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -10052,7 +10052,7 @@ move_it_to (struct it *it, ptrdiff_t to_charpos, int to_x, int to_y, int to_vpos
10052 && (IT_CHARPOS (*it) > to_charpos 10052 && (IT_CHARPOS (*it) > to_charpos
10053 || (IT_CHARPOS (*it) == to_charpos 10053 || (IT_CHARPOS (*it) == to_charpos
10054 && to_charpos == ZV 10054 && to_charpos == ZV
10055 && FETCH_BYTE (ZV_BYTE - 1) != '\n'))) 10055 && (ZV_BYTE <= 1 || FETCH_BYTE (ZV_BYTE - 1) != '\n'))))
10056 { 10056 {
10057 reached = 9; 10057 reached = 9;
10058 goto out; 10058 goto out;
@@ -11857,18 +11857,27 @@ resize_mini_window (struct window *w, bool exact_p)
11857 max_height = clip_to_bounds (unit, max_height, windows_height); 11857 max_height = clip_to_bounds (unit, max_height, windows_height);
11858 11858
11859 /* Find out the height of the text in the window. */ 11859 /* Find out the height of the text in the window. */
11860 if (it.line_wrap == TRUNCATE) 11860 last_height = 0;
11861 height = unit; 11861 move_it_to (&it, ZV, -1, -1, -1, MOVE_TO_POS);
11862 else 11862 /* If move_it_to moved to the next visible line after EOB,
11863 { 11863 account for the height of the last full line. */
11864 last_height = 0; 11864 if (it.max_ascent == 0 && it.max_descent == 0)
11865 move_it_to (&it, ZV, -1, -1, -1, MOVE_TO_POS); 11865 {
11866 if (it.max_ascent == 0 && it.max_descent == 0) 11866 height = it.current_y;
11867 height = it.current_y + last_height; 11867 /* Don't add the last line's height if lines are truncated
11868 else 11868 and the text doesn't end in a newline.
11869 height = it.current_y + it.max_ascent + it.max_descent; 11869 FIXME: if the text ends in a newline from a display
11870 height -= min (it.extra_line_spacing, it.max_extra_line_spacing); 11870 property or an overlay string, they lose: the mini-window
11871 might not show the last empty line. */
11872 if (!(it.line_wrap == TRUNCATE
11873 && it.current_x <= it.first_visible_x
11874 && ZV_BYTE > 1
11875 && FETCH_BYTE (ZV_BYTE - 1) != '\n'))
11876 height += last_height;
11871 } 11877 }
11878 else
11879 height = it.current_y + it.max_ascent + it.max_descent;
11880 height -= min (it.extra_line_spacing, it.max_extra_line_spacing);
11872 11881
11873 /* Compute a suitable window start. */ 11882 /* Compute a suitable window start. */
11874 if (height > max_height) 11883 if (height > max_height)
@@ -24109,7 +24118,8 @@ display_line (struct it *it, int cursor_vpos)
24109 the logical order. */ 24118 the logical order. */
24110 if (IT_BYTEPOS (*it) > BEG_BYTE) 24119 if (IT_BYTEPOS (*it) > BEG_BYTE)
24111 row->ends_at_zv_p = 24120 row->ends_at_zv_p =
24112 IT_BYTEPOS (*it) >= ZV_BYTE && FETCH_BYTE (ZV_BYTE - 1) != '\n'; 24121 IT_BYTEPOS (*it) >= ZV_BYTE
24122 && (ZV_BYTE <= 1 || FETCH_BYTE (ZV_BYTE - 1) != '\n');
24113 else 24123 else
24114 row->ends_at_zv_p = false; 24124 row->ends_at_zv_p = false;
24115 break; 24125 break;
diff --git a/src/xfaces.c b/src/xfaces.c
index 4b020001c31..ab4440f46ad 100644
--- a/src/xfaces.c
+++ b/src/xfaces.c
@@ -6034,10 +6034,11 @@ realize_gui_face (struct face_cache *cache, Lisp_Object attrs[LFACE_VECTOR_SIZE]
6034 face->box = FACE_RAISED_BOX; 6034 face->box = FACE_RAISED_BOX;
6035 else if (EQ (value, Qpressed_button)) 6035 else if (EQ (value, Qpressed_button))
6036 face->box = FACE_SUNKEN_BOX; 6036 face->box = FACE_SUNKEN_BOX;
6037 else if (EQ (value, Qflat_button)) { 6037 else if (EQ (value, Qflat_button))
6038 face->box = FACE_SIMPLE_BOX; 6038 {
6039 face->box_color = face->background; 6039 face->box = FACE_SIMPLE_BOX;
6040 } 6040 face->box_color = face->background;
6041 }
6041 } 6042 }
6042 } 6043 }
6043 } 6044 }