diff options
| author | Yuuki Harano | 2021-03-08 21:20:54 +0900 |
|---|---|---|
| committer | Yuuki Harano | 2021-03-08 21:20:54 +0900 |
| commit | 4dda6db3abf4a67455a007d28e14d62a9909f665 (patch) | |
| tree | 88d4e316e81f5bdd8b6801ff89ea68cd164e4055 /src | |
| parent | 565995d408ca65ec9f981f175cca29d2164a5fd0 (diff) | |
| parent | 432c1aaa80ce109250a93f50858a03ce3d01ca34 (diff) | |
| download | emacs-4dda6db3abf4a67455a007d28e14d62a9909f665.tar.gz emacs-4dda6db3abf4a67455a007d28e14d62a9909f665.zip | |
Merge branch 'master' of git.sv.gnu.org:/srv/git/emacs into feature/pgtk
Diffstat (limited to 'src')
| -rw-r--r-- | src/Makefile.in | 38 | ||||
| -rw-r--r-- | src/alloc.c | 33 | ||||
| -rw-r--r-- | src/buffer.c | 4 | ||||
| -rw-r--r-- | src/data.c | 12 | ||||
| -rw-r--r-- | src/editfns.c | 3 | ||||
| -rw-r--r-- | src/eval.c | 2 | ||||
| -rw-r--r-- | src/fns.c | 65 | ||||
| -rw-r--r-- | src/gnutls.c | 2 | ||||
| -rw-r--r-- | src/keymap.c | 25 | ||||
| -rw-r--r-- | src/marker.c | 7 | ||||
| -rw-r--r-- | src/nsterm.m | 22 | ||||
| -rw-r--r-- | src/verbose.mk.in | 42 | ||||
| -rw-r--r-- | src/xdisp.c | 36 | ||||
| -rw-r--r-- | src/xfaces.c | 9 |
14 files changed, 227 insertions, 73 deletions
diff --git a/src/Makefile.in b/src/Makefile.in index 5c6098bfed5..39c077b694b 100644 --- a/src/Makefile.in +++ b/src/Makefile.in | |||
| @@ -29,6 +29,7 @@ SHELL = @SHELL@ | |||
| 29 | # We use $(srcdir) explicitly in dependencies so as not to depend on VPATH. | 29 | # We use $(srcdir) explicitly in dependencies so as not to depend on VPATH. |
| 30 | srcdir = @srcdir@ | 30 | srcdir = @srcdir@ |
| 31 | top_srcdir = @top_srcdir@ | 31 | top_srcdir = @top_srcdir@ |
| 32 | top_builddir = @top_builddir@ | ||
| 32 | # MinGW CPPFLAGS may use this. | 33 | # MinGW CPPFLAGS may use this. |
| 33 | abs_top_srcdir=@abs_top_srcdir@ | 34 | abs_top_srcdir=@abs_top_srcdir@ |
| 34 | VPATH = $(srcdir) | 35 | VPATH = $(srcdir) |
| @@ -343,33 +344,7 @@ HAVE_PDUMPER = @HAVE_PDUMPER@ | |||
| 343 | ## invalidates the signature, we must re-sign to fix it. | 344 | ## invalidates the signature, we must re-sign to fix it. |
| 344 | DO_CODESIGN=$(patsubst aarch64-apple-darwin%,yes,@configuration@) | 345 | DO_CODESIGN=$(patsubst aarch64-apple-darwin%,yes,@configuration@) |
| 345 | 346 | ||
| 346 | # 'make' verbosity. | 347 | -include ${top_builddir}/src/verbose.mk |
| 347 | AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ | ||
| 348 | |||
| 349 | AM_V_CC = $(am__v_CC_@AM_V@) | ||
| 350 | am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) | ||
| 351 | am__v_CC_0 = @echo " CC " $@; | ||
| 352 | am__v_CC_1 = | ||
| 353 | |||
| 354 | AM_V_CCLD = $(am__v_CCLD_@AM_V@) | ||
| 355 | am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) | ||
| 356 | am__v_CCLD_0 = @echo " CCLD " $@; | ||
| 357 | am__v_CCLD_1 = | ||
| 358 | |||
| 359 | AM_V_GEN = $(am__v_GEN_@AM_V@) | ||
| 360 | am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) | ||
| 361 | am__v_GEN_0 = @echo " GEN " $@; | ||
| 362 | am__v_GEN_1 = | ||
| 363 | |||
| 364 | AM_V_at = $(am__v_at_@AM_V@) | ||
| 365 | am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) | ||
| 366 | am__v_at_0 = @ | ||
| 367 | am__v_at_1 = | ||
| 368 | |||
| 369 | AM_V_NO_PD = $(am__v_NO_PD_@AM_V@) | ||
| 370 | am__v_NO_PD_ = $(am__v_NO_PD_@AM_DEFAULT_V@) | ||
| 371 | am__v_NO_PD_0 = --no-print-directory | ||
| 372 | am__v_NO_PD_1 = | ||
| 373 | 348 | ||
| 374 | bootstrap_exe = ../src/bootstrap-emacs$(EXEEXT) | 349 | bootstrap_exe = ../src/bootstrap-emacs$(EXEEXT) |
| 375 | ifeq ($(DUMPING),pdumper) | 350 | ifeq ($(DUMPING),pdumper) |
| @@ -429,7 +404,7 @@ base_obj = dispnew.o frame.o scroll.o xdisp.o menu.o $(XMENU_OBJ) window.o \ | |||
| 429 | thread.o systhread.o \ | 404 | thread.o systhread.o \ |
| 430 | $(if $(HYBRID_MALLOC),sheap.o) \ | 405 | $(if $(HYBRID_MALLOC),sheap.o) \ |
| 431 | $(MSDOS_OBJ) $(MSDOS_X_OBJ) $(NS_OBJ) $(PGTK_OBJ) $(CYGWIN_OBJ) $(FONT_OBJ) \ | 406 | $(MSDOS_OBJ) $(MSDOS_X_OBJ) $(NS_OBJ) $(PGTK_OBJ) $(CYGWIN_OBJ) $(FONT_OBJ) \ |
| 432 | $(W32_OBJ) $(WINDOW_SYSTEM_OBJ) $(XGSELOBJ) $(JSON_OBJ) $(GMP_OBJ) | 407 | $(W32_OBJ) $(WINDOW_SYSTEM_OBJ) $(XGSELOBJ) $(JSON_OBJ) |
| 433 | obj = $(base_obj) $(NS_OBJC_OBJ) | 408 | obj = $(base_obj) $(NS_OBJC_OBJ) |
| 434 | 409 | ||
| 435 | ## Object files used on some machine or other. | 410 | ## Object files used on some machine or other. |
| @@ -624,11 +599,6 @@ buildobj.h: Makefile | |||
| 624 | 599 | ||
| 625 | GLOBAL_SOURCES = $(base_obj:.o=.c) $(NS_OBJC_OBJ:.o=.m) | 600 | GLOBAL_SOURCES = $(base_obj:.o=.c) $(NS_OBJC_OBJ:.o=.m) |
| 626 | 601 | ||
| 627 | AM_V_GLOBALS = $(am__v_GLOBALS_@AM_V@) | ||
| 628 | am__v_GLOBALS_ = $(am__v_GLOBALS_@AM_DEFAULT_V@) | ||
| 629 | am__v_GLOBALS_0 = @echo " GEN " globals.h; | ||
| 630 | am__v_GLOBALS_1 = | ||
| 631 | |||
| 632 | gl-stamp: $(libsrc)/make-docfile$(EXEEXT) $(GLOBAL_SOURCES) | 602 | gl-stamp: $(libsrc)/make-docfile$(EXEEXT) $(GLOBAL_SOURCES) |
| 633 | $(AM_V_GLOBALS)$(libsrc)/make-docfile -d $(srcdir) -g $(obj) > globals.tmp | 603 | $(AM_V_GLOBALS)$(libsrc)/make-docfile -d $(srcdir) -g $(obj) > globals.tmp |
| 634 | $(AM_V_at)$(top_srcdir)/build-aux/move-if-change globals.tmp globals.h | 604 | $(AM_V_at)$(top_srcdir)/build-aux/move-if-change globals.tmp globals.h |
| @@ -727,7 +697,7 @@ bootstrap-clean: clean | |||
| 727 | fi | 697 | fi |
| 728 | 698 | ||
| 729 | distclean: bootstrap-clean | 699 | distclean: bootstrap-clean |
| 730 | rm -f Makefile lisp.mk | 700 | rm -f Makefile lisp.mk verbose.mk |
| 731 | rm -fr $(DEPDIR) | 701 | rm -fr $(DEPDIR) |
| 732 | 702 | ||
| 733 | maintainer-clean: distclean | 703 | maintainer-clean: distclean |
diff --git a/src/alloc.c b/src/alloc.c index 1763a795ab8..ab1e96e0bc6 100644 --- a/src/alloc.c +++ b/src/alloc.c | |||
| @@ -3498,6 +3498,38 @@ usage: (make-byte-code ARGLIST BYTE-CODE CONSTANTS DEPTH &optional DOCSTRING INT | |||
| 3498 | return val; | 3498 | return val; |
| 3499 | } | 3499 | } |
| 3500 | 3500 | ||
| 3501 | DEFUN ("make-closure", Fmake_closure, Smake_closure, 1, MANY, 0, | ||
| 3502 | doc: /* Create a byte-code closure from PROTOTYPE and CLOSURE-VARS. | ||
| 3503 | Return a copy of PROTOTYPE, a byte-code object, with CLOSURE-VARS | ||
| 3504 | replacing the elements in the beginning of the constant-vector. | ||
| 3505 | usage: (make-closure PROTOTYPE &rest CLOSURE-VARS) */) | ||
| 3506 | (ptrdiff_t nargs, Lisp_Object *args) | ||
| 3507 | { | ||
| 3508 | Lisp_Object protofun = args[0]; | ||
| 3509 | CHECK_TYPE (COMPILEDP (protofun), Qbyte_code_function_p, protofun); | ||
| 3510 | |||
| 3511 | /* Create a copy of the constant vector, filling it with the closure | ||
| 3512 | variables in the beginning. (The overwritten part should just | ||
| 3513 | contain placeholder values.) */ | ||
| 3514 | Lisp_Object proto_constvec = AREF (protofun, COMPILED_CONSTANTS); | ||
| 3515 | ptrdiff_t constsize = ASIZE (proto_constvec); | ||
| 3516 | ptrdiff_t nvars = nargs - 1; | ||
| 3517 | if (nvars > constsize) | ||
| 3518 | error ("Closure vars do not fit in constvec"); | ||
| 3519 | Lisp_Object constvec = make_uninit_vector (constsize); | ||
| 3520 | memcpy (XVECTOR (constvec)->contents, args + 1, nvars * word_size); | ||
| 3521 | memcpy (XVECTOR (constvec)->contents + nvars, | ||
| 3522 | XVECTOR (proto_constvec)->contents + nvars, | ||
| 3523 | (constsize - nvars) * word_size); | ||
| 3524 | |||
| 3525 | /* Return a copy of the prototype function with the new constant vector. */ | ||
| 3526 | ptrdiff_t protosize = PVSIZE (protofun); | ||
| 3527 | struct Lisp_Vector *v = allocate_vectorlike (protosize, false); | ||
| 3528 | v->header = XVECTOR (protofun)->header; | ||
| 3529 | memcpy (v->contents, XVECTOR (protofun)->contents, protosize * word_size); | ||
| 3530 | v->contents[COMPILED_CONSTANTS] = constvec; | ||
| 3531 | return make_lisp_ptr (v, Lisp_Vectorlike); | ||
| 3532 | } | ||
| 3501 | 3533 | ||
| 3502 | 3534 | ||
| 3503 | /*********************************************************************** | 3535 | /*********************************************************************** |
| @@ -7576,6 +7608,7 @@ N should be nonnegative. */); | |||
| 7576 | defsubr (&Srecord); | 7608 | defsubr (&Srecord); |
| 7577 | defsubr (&Sbool_vector); | 7609 | defsubr (&Sbool_vector); |
| 7578 | defsubr (&Smake_byte_code); | 7610 | defsubr (&Smake_byte_code); |
| 7611 | defsubr (&Smake_closure); | ||
| 7579 | defsubr (&Smake_list); | 7612 | defsubr (&Smake_list); |
| 7580 | defsubr (&Smake_vector); | 7613 | defsubr (&Smake_vector); |
| 7581 | defsubr (&Smake_record); | 7614 | defsubr (&Smake_record); |
diff --git a/src/buffer.c b/src/buffer.c index 5bd9b37702f..03c10cc7ae5 100644 --- a/src/buffer.c +++ b/src/buffer.c | |||
| @@ -1942,8 +1942,8 @@ cleaning up all windows currently displaying the buffer to be killed. */) | |||
| 1942 | } | 1942 | } |
| 1943 | /* Since we've unlinked the markers, the overlays can't be here any more | 1943 | /* Since we've unlinked the markers, the overlays can't be here any more |
| 1944 | either. */ | 1944 | either. */ |
| 1945 | b->overlays_before = NULL; | 1945 | set_buffer_overlays_before (b, NULL); |
| 1946 | b->overlays_after = NULL; | 1946 | set_buffer_overlays_after (b, NULL); |
| 1947 | 1947 | ||
| 1948 | /* Reset the local variables, so that this buffer's local values | 1948 | /* Reset the local variables, so that this buffer's local values |
| 1949 | won't be protected from GC. They would be protected | 1949 | won't be protected from GC. They would be protected |
diff --git a/src/data.c b/src/data.c index ace859d2d0c..0fa491b17a1 100644 --- a/src/data.c +++ b/src/data.c | |||
| @@ -957,9 +957,17 @@ The value, if non-nil, is a list of mode name symbols. */) | |||
| 957 | if (NILP (fun)) | 957 | if (NILP (fun)) |
| 958 | return Qnil; | 958 | return Qnil; |
| 959 | 959 | ||
| 960 | /* Use a `command-modes' property if present, analogous to the | ||
| 961 | function-documentation property. */ | ||
| 960 | fun = command; | 962 | fun = command; |
| 961 | while (SYMBOLP (fun)) | 963 | while (SYMBOLP (fun)) |
| 962 | fun = Fsymbol_function (fun); | 964 | { |
| 965 | Lisp_Object modes = Fget (fun, Qcommand_modes); | ||
| 966 | if (!NILP (modes)) | ||
| 967 | return modes; | ||
| 968 | else | ||
| 969 | fun = Fsymbol_function (fun); | ||
| 970 | } | ||
| 963 | 971 | ||
| 964 | if (COMPILEDP (fun)) | 972 | if (COMPILEDP (fun)) |
| 965 | { | 973 | { |
| @@ -3981,6 +3989,8 @@ syms_of_data (void) | |||
| 3981 | DEFSYM (Qinteractive_form, "interactive-form"); | 3989 | DEFSYM (Qinteractive_form, "interactive-form"); |
| 3982 | DEFSYM (Qdefalias_fset_function, "defalias-fset-function"); | 3990 | DEFSYM (Qdefalias_fset_function, "defalias-fset-function"); |
| 3983 | 3991 | ||
| 3992 | DEFSYM (Qbyte_code_function_p, "byte-code-function-p"); | ||
| 3993 | |||
| 3984 | defsubr (&Sindirect_variable); | 3994 | defsubr (&Sindirect_variable); |
| 3985 | defsubr (&Sinteractive_form); | 3995 | defsubr (&Sinteractive_form); |
| 3986 | defsubr (&Scommand_modes); | 3996 | defsubr (&Scommand_modes); |
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/eval.c b/src/eval.c index 542d7f686e6..ddaa8edd817 100644 --- a/src/eval.c +++ b/src/eval.c | |||
| @@ -219,7 +219,7 @@ void | |||
| 219 | init_eval_once (void) | 219 | init_eval_once (void) |
| 220 | { | 220 | { |
| 221 | /* Don't forget to update docs (lispref node "Local Variables"). */ | 221 | /* Don't forget to update docs (lispref node "Local Variables"). */ |
| 222 | max_specpdl_size = 1600; /* 1500 is not enough for cl-generic.el. */ | 222 | max_specpdl_size = 1800; /* See bug#46818. */ |
| 223 | max_lisp_eval_depth = 800; | 223 | max_lisp_eval_depth = 800; |
| 224 | Vrun_hooks = Qnil; | 224 | Vrun_hooks = Qnil; |
| 225 | pdumper_do_now_and_after_load (init_eval_once_for_pdumper); | 225 | pdumper_do_now_and_after_load (init_eval_once_for_pdumper); |
| @@ -54,10 +54,55 @@ DEFUN ("identity", Fidentity, Sidentity, 1, 1, 0, | |||
| 54 | return argument; | 54 | return argument; |
| 55 | } | 55 | } |
| 56 | 56 | ||
| 57 | static Lisp_Object | ||
| 58 | ccall2 (Lisp_Object (f) (ptrdiff_t nargs, Lisp_Object *args), | ||
| 59 | Lisp_Object arg1, Lisp_Object arg2) | ||
| 60 | { | ||
| 61 | Lisp_Object args[2] = {arg1, arg2}; | ||
| 62 | return f (2, args); | ||
| 63 | } | ||
| 64 | |||
| 65 | static Lisp_Object | ||
| 66 | get_random_bignum (Lisp_Object limit) | ||
| 67 | { | ||
| 68 | /* This is a naive transcription into bignums of the fixnum algorithm. | ||
| 69 | I'd be quite surprised if that's anywhere near the best algorithm | ||
| 70 | for it. */ | ||
| 71 | while (true) | ||
| 72 | { | ||
| 73 | Lisp_Object val = make_fixnum (0); | ||
| 74 | Lisp_Object lim = limit; | ||
| 75 | int bits = 0; | ||
| 76 | int bitsperiteration = FIXNUM_BITS - 1; | ||
| 77 | do | ||
| 78 | { | ||
| 79 | /* Shift by one so it is a valid positive fixnum. */ | ||
| 80 | EMACS_INT rand = get_random () >> 1; | ||
| 81 | Lisp_Object lrand = make_fixnum (rand); | ||
| 82 | bits += bitsperiteration; | ||
| 83 | val = ccall2 (Flogior, | ||
| 84 | Fash (val, make_fixnum (bitsperiteration)), | ||
| 85 | lrand); | ||
| 86 | lim = Fash (lim, make_fixnum (- bitsperiteration)); | ||
| 87 | } | ||
| 88 | while (!EQ (lim, make_fixnum (0))); | ||
| 89 | /* Return the remainder, except reject the rare case where | ||
| 90 | get_random returns a number so close to INTMASK that the | ||
| 91 | remainder isn't random. */ | ||
| 92 | Lisp_Object remainder = Frem (val, limit); | ||
| 93 | if (!NILP (ccall2 (Fleq, | ||
| 94 | ccall2 (Fminus, val, remainder), | ||
| 95 | ccall2 (Fminus, | ||
| 96 | Fash (make_fixnum (1), make_fixnum (bits)), | ||
| 97 | limit)))) | ||
| 98 | return remainder; | ||
| 99 | } | ||
| 100 | } | ||
| 101 | |||
| 57 | DEFUN ("random", Frandom, Srandom, 0, 1, 0, | 102 | DEFUN ("random", Frandom, Srandom, 0, 1, 0, |
| 58 | doc: /* Return a pseudo-random integer. | 103 | doc: /* Return a pseudo-random integer. |
| 59 | By default, return a fixnum; all fixnums are equally likely. | 104 | By default, return a fixnum; all fixnums are equally likely. |
| 60 | With positive fixnum LIMIT, return random integer in interval [0,LIMIT). | 105 | With positive integer LIMIT, return random integer in interval [0,LIMIT). |
| 61 | With argument t, set the random number seed from the system's entropy | 106 | With argument t, set the random number seed from the system's entropy |
| 62 | pool if available, otherwise from less-random volatile data such as the time. | 107 | pool if available, otherwise from less-random volatile data such as the time. |
| 63 | With a string argument, set the seed based on the string's contents. | 108 | With a string argument, set the seed based on the string's contents. |
| @@ -71,6 +116,12 @@ See Info node `(elisp)Random Numbers' for more details. */) | |||
| 71 | init_random (); | 116 | init_random (); |
| 72 | else if (STRINGP (limit)) | 117 | else if (STRINGP (limit)) |
| 73 | seed_random (SSDATA (limit), SBYTES (limit)); | 118 | seed_random (SSDATA (limit), SBYTES (limit)); |
| 119 | if (BIGNUMP (limit)) | ||
| 120 | { | ||
| 121 | if (0 > mpz_sgn (*xbignum_val (limit))) | ||
| 122 | xsignal2 (Qwrong_type_argument, Qnatnump, limit); | ||
| 123 | return get_random_bignum (limit); | ||
| 124 | } | ||
| 74 | 125 | ||
| 75 | val = get_random (); | 126 | val = get_random (); |
| 76 | if (FIXNUMP (limit) && 0 < XFIXNUM (limit)) | 127 | if (FIXNUMP (limit) && 0 < XFIXNUM (limit)) |
| @@ -2873,6 +2924,9 @@ if `last-nonmenu-event' is nil, and `use-dialog-box' is non-nil. */) | |||
| 2873 | return obj; | 2924 | return obj; |
| 2874 | } | 2925 | } |
| 2875 | 2926 | ||
| 2927 | if (use_short_answers) | ||
| 2928 | return call1 (intern ("y-or-n-p"), prompt); | ||
| 2929 | |||
| 2876 | AUTO_STRING (yes_or_no, "(yes or no) "); | 2930 | AUTO_STRING (yes_or_no, "(yes or no) "); |
| 2877 | prompt = CALLN (Fconcat, prompt, yes_or_no); | 2931 | prompt = CALLN (Fconcat, prompt, yes_or_no); |
| 2878 | 2932 | ||
| @@ -5904,6 +5958,15 @@ that disables the use of a file dialog, regardless of the value of | |||
| 5904 | this variable. */); | 5958 | this variable. */); |
| 5905 | use_file_dialog = true; | 5959 | use_file_dialog = true; |
| 5906 | 5960 | ||
| 5961 | DEFVAR_BOOL ("use-short-answers", use_short_answers, | ||
| 5962 | doc: /* Non-nil means `yes-or-no-p' uses shorter answers "y" or "n". | ||
| 5963 | When non-nil, `yes-or-no-p' will use `y-or-n-p' to read the answer. | ||
| 5964 | We recommend against setting this variable non-nil, because `yes-or-no-p' | ||
| 5965 | is intended to be used when users are expected not to respond too | ||
| 5966 | quickly, but to take their time and perhaps think about the answer. | ||
| 5967 | The same variable also affects the function `read-answer'. */); | ||
| 5968 | use_short_answers = false; | ||
| 5969 | |||
| 5907 | defsubr (&Sidentity); | 5970 | defsubr (&Sidentity); |
| 5908 | defsubr (&Srandom); | 5971 | defsubr (&Srandom); |
| 5909 | defsubr (&Slength); | 5972 | 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/keymap.c b/src/keymap.c index 782931fadff..bb26b6389d4 100644 --- a/src/keymap.c +++ b/src/keymap.c | |||
| @@ -2846,6 +2846,21 @@ DESCRIBER is the output function used; nil means use `princ'. */) | |||
| 2846 | return unbind_to (count, Qnil); | 2846 | return unbind_to (count, Qnil); |
| 2847 | } | 2847 | } |
| 2848 | 2848 | ||
| 2849 | static Lisp_Object fontify_key_properties; | ||
| 2850 | |||
| 2851 | static Lisp_Object | ||
| 2852 | describe_key_maybe_fontify (Lisp_Object str, Lisp_Object prefix, | ||
| 2853 | bool keymap_p) | ||
| 2854 | { | ||
| 2855 | Lisp_Object key_desc = Fkey_description (str, prefix); | ||
| 2856 | if (keymap_p) | ||
| 2857 | Fadd_text_properties (make_fixnum (0), | ||
| 2858 | make_fixnum (SCHARS (key_desc)), | ||
| 2859 | fontify_key_properties, | ||
| 2860 | key_desc); | ||
| 2861 | return key_desc; | ||
| 2862 | } | ||
| 2863 | |||
| 2849 | DEFUN ("help--describe-vector", Fhelp__describe_vector, Shelp__describe_vector, 7, 7, 0, | 2864 | DEFUN ("help--describe-vector", Fhelp__describe_vector, Shelp__describe_vector, 7, 7, 0, |
| 2850 | doc: /* Insert in the current buffer a description of the contents of VECTOR. | 2865 | doc: /* Insert in the current buffer a description of the contents of VECTOR. |
| 2851 | Call DESCRIBER to insert the description of one value found in VECTOR. | 2866 | Call DESCRIBER to insert the description of one value found in VECTOR. |
| @@ -3021,7 +3036,7 @@ describe_vector (Lisp_Object vector, Lisp_Object prefix, Lisp_Object args, | |||
| 3021 | if (!NILP (elt_prefix)) | 3036 | if (!NILP (elt_prefix)) |
| 3022 | insert1 (elt_prefix); | 3037 | insert1 (elt_prefix); |
| 3023 | 3038 | ||
| 3024 | insert1 (Fkey_description (kludge, prefix)); | 3039 | insert1 (describe_key_maybe_fontify (kludge, prefix, keymap_p)); |
| 3025 | 3040 | ||
| 3026 | /* Find all consecutive characters or rows that have the same | 3041 | /* Find all consecutive characters or rows that have the same |
| 3027 | definition. But, if VECTOR is a char-table, we had better | 3042 | definition. But, if VECTOR is a char-table, we had better |
| @@ -3071,7 +3086,7 @@ describe_vector (Lisp_Object vector, Lisp_Object prefix, Lisp_Object args, | |||
| 3071 | if (!NILP (elt_prefix)) | 3086 | if (!NILP (elt_prefix)) |
| 3072 | insert1 (elt_prefix); | 3087 | insert1 (elt_prefix); |
| 3073 | 3088 | ||
| 3074 | insert1 (Fkey_description (kludge, prefix)); | 3089 | insert1 (describe_key_maybe_fontify (kludge, prefix, keymap_p)); |
| 3075 | } | 3090 | } |
| 3076 | 3091 | ||
| 3077 | /* Print a description of the definition of this character. | 3092 | /* Print a description of the definition of this character. |
| @@ -3200,6 +3215,12 @@ be preferred. */); | |||
| 3200 | staticpro (&where_is_cache); | 3215 | staticpro (&where_is_cache); |
| 3201 | staticpro (&where_is_cache_keymaps); | 3216 | staticpro (&where_is_cache_keymaps); |
| 3202 | 3217 | ||
| 3218 | DEFSYM (Qfont_lock_face, "font-lock-face"); | ||
| 3219 | DEFSYM (Qhelp_key_binding, "help-key-binding"); | ||
| 3220 | staticpro (&fontify_key_properties); | ||
| 3221 | fontify_key_properties = Fcons (Qfont_lock_face, | ||
| 3222 | Fcons (Qhelp_key_binding, Qnil)); | ||
| 3223 | |||
| 3203 | defsubr (&Skeymapp); | 3224 | defsubr (&Skeymapp); |
| 3204 | defsubr (&Skeymap_parent); | 3225 | defsubr (&Skeymap_parent); |
| 3205 | defsubr (&Skeymap_prompt); | 3226 | defsubr (&Skeymap_prompt); |
diff --git a/src/marker.c b/src/marker.c index 59791513170..2b137b14c8f 100644 --- a/src/marker.c +++ b/src/marker.c | |||
| @@ -634,16 +634,15 @@ set_marker_restricted_both (Lisp_Object marker, Lisp_Object buffer, | |||
| 634 | /* Detach a marker so that it no longer points anywhere and no longer | 634 | /* Detach a marker so that it no longer points anywhere and no longer |
| 635 | slows down editing. Do not free the marker, though, as a change | 635 | slows down editing. Do not free the marker, though, as a change |
| 636 | function could have inserted it into an undo list (Bug#30931). */ | 636 | function could have inserted it into an undo list (Bug#30931). */ |
| 637 | |||
| 637 | void | 638 | void |
| 638 | detach_marker (Lisp_Object marker) | 639 | detach_marker (Lisp_Object marker) |
| 639 | { | 640 | { |
| 640 | Fset_marker (marker, Qnil, Qnil); | 641 | Fset_marker (marker, Qnil, Qnil); |
| 641 | } | 642 | } |
| 642 | 643 | ||
| 643 | /* Remove MARKER from the chain of whatever buffer it is in, | 644 | /* Remove MARKER from the chain of whatever buffer it is in. Set its |
| 644 | leaving it points to nowhere. This is called during garbage | 645 | buffer NULL. */ |
| 645 | collection, so we must be careful to ignore and preserve | ||
| 646 | mark bits, including those in chain fields of markers. */ | ||
| 647 | 646 | ||
| 648 | void | 647 | void |
| 649 | unchain_marker (register struct Lisp_Marker *marker) | 648 | unchain_marker (register struct Lisp_Marker *marker) |
diff --git a/src/nsterm.m b/src/nsterm.m index 6551694abee..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 |
| @@ -9767,7 +9769,7 @@ nswindow_orderedIndex_sort (id w1, id w2, void *c) | |||
| 9767 | for (id object in cache) | 9769 | for (id object in cache) |
| 9768 | CFRelease ((IOSurfaceRef)object); | 9770 | CFRelease ((IOSurfaceRef)object); |
| 9769 | 9771 | ||
| 9770 | [cache removeAllObjects]; | 9772 | [cache release]; |
| 9771 | 9773 | ||
| 9772 | [super dealloc]; | 9774 | [super dealloc]; |
| 9773 | } | 9775 | } |
diff --git a/src/verbose.mk.in b/src/verbose.mk.in new file mode 100644 index 00000000000..e55fd63fc3c --- /dev/null +++ b/src/verbose.mk.in | |||
| @@ -0,0 +1,42 @@ | |||
| 1 | ### verbose.mk --- Makefile fragment for GNU Emacs | ||
| 2 | |||
| 3 | ## Copyright (C) 2021 Free Software Foundation, Inc. | ||
| 4 | |||
| 5 | ## This file is part of GNU Emacs. | ||
| 6 | |||
| 7 | ## GNU Emacs is free software: you can redistribute it and/or modify | ||
| 8 | ## it under the terms of the GNU General Public License as published by | ||
| 9 | ## the Free Software Foundation, either version 3 of the License, or | ||
| 10 | ## (at your option) any later version. | ||
| 11 | ## | ||
| 12 | ## GNU Emacs is distributed in the hope that it will be useful, | ||
| 13 | ## but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 14 | ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 15 | ## GNU General Public License for more details. | ||
| 16 | ## | ||
| 17 | ## You should have received a copy of the GNU General Public License | ||
| 18 | ## along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>. | ||
| 19 | |||
| 20 | # 'make' verbosity. | ||
| 21 | V = @AM_DEFAULT_VERBOSITY@ | ||
| 22 | ifeq (${V},1) | ||
| 23 | AM_V_AR = | ||
| 24 | AM_V_at = | ||
| 25 | AM_V_CC = | ||
| 26 | AM_V_CCLD = | ||
| 27 | AM_V_ELC = | ||
| 28 | AM_V_GEN = | ||
| 29 | AM_V_GLOBALS = | ||
| 30 | AM_V_NO_PD = | ||
| 31 | AM_V_RC = | ||
| 32 | else | ||
| 33 | AM_V_AR = @echo " AR " $@; | ||
| 34 | AM_V_at = @ | ||
| 35 | AM_V_CC = @echo " CC " $@; | ||
| 36 | AM_V_CCLD = @echo " CCLD " $@; | ||
| 37 | AM_V_ELC = @echo " ELC " $@; | ||
| 38 | AM_V_GEN = @echo " GEN " $@; | ||
| 39 | AM_V_GLOBALS = @echo " GEN " globals.h; | ||
| 40 | AM_V_NO_PD = --no-print-directory | ||
| 41 | AM_V_RC = @echo " RC " $@; | ||
| 42 | endif | ||
diff --git a/src/xdisp.c b/src/xdisp.c index d37a5657b87..dc165c83caf 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 dde611ee6da..c93140828c5 100644 --- a/src/xfaces.c +++ b/src/xfaces.c | |||
| @@ -6058,10 +6058,11 @@ realize_gui_face (struct face_cache *cache, Lisp_Object attrs[LFACE_VECTOR_SIZE] | |||
| 6058 | face->box = FACE_RAISED_BOX; | 6058 | face->box = FACE_RAISED_BOX; |
| 6059 | else if (EQ (value, Qpressed_button)) | 6059 | else if (EQ (value, Qpressed_button)) |
| 6060 | face->box = FACE_SUNKEN_BOX; | 6060 | face->box = FACE_SUNKEN_BOX; |
| 6061 | else if (EQ (value, Qflat_button)) { | 6061 | else if (EQ (value, Qflat_button)) |
| 6062 | face->box = FACE_SIMPLE_BOX; | 6062 | { |
| 6063 | face->box_color = face->background; | 6063 | face->box = FACE_SIMPLE_BOX; |
| 6064 | } | 6064 | face->box_color = face->background; |
| 6065 | } | ||
| 6065 | } | 6066 | } |
| 6066 | } | 6067 | } |
| 6067 | } | 6068 | } |