commit 661e5dec570b7724309e7ec943711cb029193aa0 (HEAD, refs/remotes/origin/master) Merge: 982a7e8ce30 5c9de704cc8 Author: Eli Zaretskii Date: Sat Aug 17 02:47:38 2024 -0400 Merge from origin/emacs-30 5c9de704cc8 ; * admin/make-tarball.txt: Minor copyedits. 3fc16357832 ; * doc/lispref/strings.texi (Text Comparison): Improve i... 45a78ec6c57 * lisp/files.el (require-with-check): Improve error messa... 9a04b99b3d3 ; * src/data.c (Fsubrp): Improve docstring. 4f3e8c3b4ed Improve documentation of ERT ed8904937ec Disambiguate minor-mode variable in its function docstring 505139e0bad Fix project-dired keybinding in manual 9bedb957beb Improve documentation of time-parsing functions # Conflicts: # doc/lispref/os.texi # lisp/calendar/iso8601.el # lisp/calendar/parse-time.el commit 982a7e8ce30a5a7331a07cbfdcdf14284060cfea Merge: 346a47f1511 7c588a00655 Author: Eli Zaretskii Date: Sat Aug 17 02:40:33 2024 -0400 ; Merge from origin/emacs-30 The following commit was skipped: 7c588a00655 ; Backport gitlab-ci.yml from master (don't merge) commit 346a47f15115812ed4259acdead02420c12f6656 Merge: 2c505c68b28 4589f51c21d Author: Eli Zaretskii Date: Sat Aug 17 02:40:32 2024 -0400 Merge from origin/emacs-30 4589f51c21d (project-find-regexp): Fix the temporary value of DEFAULT... 616a93d185a Tag test in typescript-ts-mode-tests.el as unstable e9e7e3908ab ; * lisp/files.el (require-with-check): Fix last change. commit 2c505c68b28f76c90f4daa2b9fdbf70a8785a225 Author: Eli Zaretskii Date: Sat Aug 17 09:29:32 2024 +0300 Add CJK Compatibility character to Han representative chars * lisp/international/fontset.el (script-representative-chars): Add U+3410 to Han characters, to represent the 3400..4DBF block. diff --git a/lisp/international/fontset.el b/lisp/international/fontset.el index 1d5931ac761..02d60a88aa3 100644 --- a/lisp/international/fontset.el +++ b/lisp/international/fontset.el @@ -209,7 +209,7 @@ (kana #x304B) (bopomofo #x3105) (kanbun #x319D) - (han #x4e10 #x5B57 #xfe30 #xf900) + (han #x3410 #x4e10 #x5B57 #xfe30 #xf900) (yi #xA288) (syloti-nagri #xA807 #xA823 #xA82C) (rejang #xA930 #xA947 #xA95F) commit ed305c4b98cda5c6d479310e4ba350a17d901e75 Author: Paul Eggert Date: Fri Aug 16 20:49:18 2024 -0700 Fix x_construct_mouse_click || vs | typo * src/xterm.c (x_construct_mouse_click): ‘||’ → ‘|’. Typo found by clang 18.1.6 -Wbool-operation. diff --git a/src/xterm.c b/src/xterm.c index 45814e9ecc9..8a7971fb25f 100644 --- a/src/xterm.c +++ b/src/xterm.c @@ -14691,7 +14691,7 @@ x_construct_mouse_click (struct input_event *result, result->kind = (event->type != ButtonRelease ? NO_EVENT : wheel & 2 ? HORIZ_WHEEL_EVENT : WHEEL_EVENT); result->code = 0; /* Not used. */ - result->modifiers &= ~(up_modifier || down_modifier); + result->modifiers &= ~(up_modifier | down_modifier); result->modifiers |= wheel & 1 ? up_modifier : down_modifier; } } commit 8c81818673ae9ff788c6e65fb90984f327b27964 Author: Paul Eggert Date: Fri Aug 16 19:02:55 2024 -0700 Tune volatile in read_char * src/keyboard.c (read_char): Optimize access to a local volatile. diff --git a/src/keyboard.c b/src/keyboard.c index b519ccdf9f0..0d3506bc59b 100644 --- a/src/keyboard.c +++ b/src/keyboard.c @@ -2517,7 +2517,7 @@ read_char (int commandflag, Lisp_Object map, Lisp_Object prev_event, bool *used_mouse_menu, struct timespec *end_time) { - Lisp_Object volatile c; + Lisp_Object c; sys_jmp_buf local_getcjmp; sys_jmp_buf save_jump; Lisp_Object tem, save; @@ -2752,8 +2752,10 @@ read_char (int commandflag, Lisp_Object map, it *must not* be in effect when we call redisplay. */ specpdl_ref jmpcount = SPECPDL_INDEX (); + Lisp_Object volatile c_volatile; if (sys_setjmp (local_getcjmp)) { + c = c_volatile; /* Handle quits while reading the keyboard. */ /* We must have saved the outer value of getcjmp here, so restore it now. */ @@ -2798,6 +2800,13 @@ read_char (int commandflag, Lisp_Object map, goto non_reread; } + c_volatile = c; +#if GCC_LINT && __GNUC__ && !__clang__ + /* This useless assignment pacifies GCC 14.2.1 x86-64 + . */ + c = c_volatile; +#endif + /* Start idle timers if no time limit is supplied. We don't do it if a time limit is supplied to avoid an infinite recursion in the situation where an idle timer calls `sit-for'. */ @@ -2959,6 +2968,8 @@ read_char (int commandflag, Lisp_Object map, } reread = true; } + + c_volatile = c; } /* Read something from current KBOARD's side queue, if possible. */ @@ -2970,6 +2981,7 @@ read_char (int commandflag, Lisp_Object map, if (!CONSP (KVAR (current_kboard, kbd_queue))) emacs_abort (); c = XCAR (KVAR (current_kboard, kbd_queue)); + c_volatile = c; kset_kbd_queue (current_kboard, XCDR (KVAR (current_kboard, kbd_queue))); if (NILP (KVAR (current_kboard, kbd_queue))) @@ -3025,6 +3037,8 @@ read_char (int commandflag, Lisp_Object map, c = XCDR (c); recorded = true; } + + c_volatile = c; } non_reread: @@ -3108,7 +3122,7 @@ read_char (int commandflag, Lisp_Object map, d = Faref (KVAR (current_kboard, Vkeyboard_translate_table), c); /* nil in keyboard-translate-table means no translation. */ if (!NILP (d)) - c = d; + c_volatile = c = d; } } @@ -3148,6 +3162,7 @@ read_char (int commandflag, Lisp_Object map, Vunread_command_events = Fcons (c, Vunread_command_events); } c = posn; + c_volatile = c; } } @@ -3273,6 +3288,7 @@ read_char (int commandflag, Lisp_Object map, } /* It returned one event or more. */ c = XCAR (tem); + c_volatile = c; Vunread_post_input_method_events = nconc2 (XCDR (tem), Vunread_post_input_method_events); } @@ -3347,6 +3363,7 @@ read_char (int commandflag, Lisp_Object map, do { c = read_char (0, Qnil, Qnil, 0, NULL); + c_volatile = c; if (EVENT_HAS_PARAMETERS (c) && EQ (EVENT_HEAD_KIND (EVENT_HEAD (c)), Qmouse_click)) XSETCAR (help_form_saved_window_configs, Qnil); @@ -3360,7 +3377,7 @@ read_char (int commandflag, Lisp_Object map, { cancel_echoing (); do - c = read_char (0, Qnil, Qnil, 0, NULL); + c_volatile = c = read_char (0, Qnil, Qnil, 0, NULL); while (BUFFERP (c)); } } commit a967efdd2a5b77e35657f9bdd7098b79241e3aa5 Author: Paul Eggert Date: Fri Aug 16 17:20:58 2024 -0700 Don’t ignore -Wclobbered in keyboard.c This fixes Emacs bug#71744. * src/keyboard.c: Do not ignore -Wclobbered. (read_char): Fix violation of the C standard, where setjmp clobbered c. Fix suggested by Pip Cet in diff --git a/src/keyboard.c b/src/keyboard.c index b312d529e59..b519ccdf9f0 100644 --- a/src/keyboard.c +++ b/src/keyboard.c @@ -88,11 +88,6 @@ along with GNU Emacs. If not, see . */ #include TERM_HEADER #endif /* HAVE_WINDOW_SYSTEM */ -/* Work around GCC bug 54561. */ -#if GNUC_PREREQ (4, 3, 0) -# pragma GCC diagnostic ignored "-Wclobbered" -#endif - #ifdef WINDOWSNT char const DEV_TTY[] = "CONOUT$"; #else @@ -2522,7 +2517,7 @@ read_char (int commandflag, Lisp_Object map, Lisp_Object prev_event, bool *used_mouse_menu, struct timespec *end_time) { - Lisp_Object c; + Lisp_Object volatile c; sys_jmp_buf local_getcjmp; sys_jmp_buf save_jump; Lisp_Object tem, save; commit 3b24ac538858d994a74826361a1af3f802dd065a Author: Paul Eggert Date: Fri Aug 16 17:19:12 2024 -0700 Don’t ignore -Wclobbered in image.c This fix is also prompted by Emacs bug#71744. * src/image.c: Do not ignore -Wclobbered. (png_load_body): Fix violations of the C standard, where setjmp clobbered c. Move mask_img decl to pacify GCC. (jpeg_load_body): Don’t make fp volatile; solve that problem in a better way, via a new fp_volatile local. Fix violations of the C standard, where setjmp clobbered mgr, img, and ximg. If __GNUC__ && !__clang__, add useless assignments to pacify GCC. diff --git a/src/image.c b/src/image.c index 3965a6ce6f8..48694a13341 100644 --- a/src/image.c +++ b/src/image.c @@ -63,11 +63,6 @@ along with GNU Emacs. If not, see . */ #include TERM_HEADER #endif /* HAVE_WINDOW_SYSTEM */ -/* Work around GCC bug 54561. */ -#if GNUC_PREREQ (4, 3, 0) -# pragma GCC diagnostic ignored "-Wclobbered" -#endif - #ifdef HAVE_X_WINDOWS typedef struct x_bitmap_record Bitmap_Record; #ifndef USE_CAIRO @@ -8188,7 +8183,7 @@ png_load_body (struct frame *f, struct image *img, struct png_load_context *c) bool transparent_p; struct png_memory_storage tbr; /* Data to be read */ ptrdiff_t nbytes; - Emacs_Pix_Container ximg, mask_img = NULL; + Emacs_Pix_Container ximg; /* Find out what file to load. */ specified_file = image_spec_value (img->spec, QCfile, NULL); @@ -8279,9 +8274,12 @@ png_load_body (struct frame *f, struct image *img, struct png_load_context *c) /* Set error jump-back. We come back here when the PNG library detects an error. */ + + struct png_load_context *volatile c_volatile = c; if (FAST_SETJMP (PNG_JMPBUF (png_ptr))) { error: + c = c_volatile; if (c->png_ptr) png_destroy_read_struct (&c->png_ptr, &c->info_ptr, &c->end_info); xfree (c->pixels); @@ -8291,6 +8289,13 @@ png_load_body (struct frame *f, struct image *img, struct png_load_context *c) return 0; } +#if GCC_LINT && __GNUC__ && !__clang__ + /* These useless assignments pacify GCC 14.2.1 x86-64 + . */ + c = c_volatile; + fp = c->fp; +#endif + /* Read image info. */ if (!NILP (specified_data)) png_set_read_fn (png_ptr, &tbr, png_read_from_memory); @@ -8417,6 +8422,7 @@ png_load_body (struct frame *f, struct image *img, struct png_load_context *c) /* Create an image and pixmap serving as mask if the PNG image contains an alpha channel. */ + Emacs_Pix_Container mask_img = NULL; if (channels == 4 && transparent_p && !image_create_x_image_and_pixmap (f, img, width, height, 1, @@ -8912,13 +8918,13 @@ jpeg_load_body (struct frame *f, struct image *img, struct my_jpeg_error_mgr *mgr) { Lisp_Object specified_file, specified_data; - FILE *volatile fp = NULL; + FILE *fp = NULL; JSAMPARRAY buffer; int row_stride, x, y; int width, height; int i, ir, ig, ib; unsigned long *colors; - Emacs_Pix_Container ximg = NULL; + Emacs_Pix_Container volatile ximg_volatile = NULL; /* Open the JPEG file. */ specified_file = image_spec_value (img->spec, QCfile, NULL); @@ -8953,8 +8959,15 @@ jpeg_load_body (struct frame *f, struct image *img, error is detected. This function will perform a longjmp. */ mgr->cinfo.err = jpeg_std_error (&mgr->pub); mgr->pub.error_exit = my_error_exit; + struct my_jpeg_error_mgr *volatile mgr_volatile = mgr; + struct image *volatile img_volatile = img; + FILE *volatile fp_volatile = fp; if (sys_setjmp (mgr->setjmp_buffer)) { + mgr = mgr_volatile; + img = img_volatile; + fp = fp_volatile; + switch (mgr->failure_code) { case MY_JPEG_ERROR_EXIT: @@ -8980,6 +8993,7 @@ jpeg_load_body (struct frame *f, struct image *img, jpeg_destroy_decompress (&mgr->cinfo); /* If we already have an XImage, free that. */ + Emacs_Pix_Container ximg = ximg_volatile; if (ximg) image_destroy_x_image (ximg); /* Free pixmap and colors. */ @@ -8987,6 +9001,14 @@ jpeg_load_body (struct frame *f, struct image *img, return 0; } +#if GCC_LINT && __GNUC__ && !__clang__ + /* These useless assignments pacify GCC 14.2.1 x86-64 + . */ + mgr = mgr_volatile; + img = img_volatile; + fp = fp_volatile; +#endif + /* Create the JPEG decompression object. Let it read from fp. Read the JPEG image header. */ jpeg_CreateDecompress (&mgr->cinfo, JPEG_LIB_VERSION, sizeof *&mgr->cinfo); @@ -9013,7 +9035,11 @@ jpeg_load_body (struct frame *f, struct image *img, } /* Create X image and pixmap. */ - if (!image_create_x_image_and_pixmap (f, img, width, height, 0, &ximg, 0)) + Emacs_Pix_Container ximg; + bool ximg_ok = image_create_x_image_and_pixmap (f, img, width, height, 0, + &ximg, 0); + ximg_volatile = ximg; + if (!ximg_ok) { mgr->failure_code = MY_JPEG_CANNOT_CREATE_X; sys_longjmp (mgr->setjmp_buffer, 1); commit 1282714da55cd4bbc1c7f2e49edeb43503427e5e Author: Paul Eggert Date: Fri Aug 16 17:08:36 2024 -0700 Don’t ignore -Wclobbered in eval.c This fix is also prompted by Emacs bug#71744. * src/eval.c (CACHEABLE): Remove. All uses removed. Do not ignore -Wclobbered. (internal_lisp_condition_case): Fix violations of the C standard, where setjmp clobbered oldhandlerlist, var, and clauses. Rewrite to pacify GCC, by using a sentinel rather than a count, which GCC incorrectly complained about, and by coalescing some duplicate code. If GCC_LINT && __GNUC__ && !__clang__ add a useless assignment to pacify GCC. diff --git a/src/eval.c b/src/eval.c index b4103acd28f..ce7b08e894a 100644 --- a/src/eval.c +++ b/src/eval.c @@ -31,15 +31,6 @@ along with GNU Emacs. If not, see . */ #include "pdumper.h" #include "atimer.h" -/* CACHEABLE is ordinarily nothing, except it is 'volatile' if - necessary to cajole GCC into not warning incorrectly that a - variable should be volatile. */ -#if defined GCC_LINT || defined lint -# define CACHEABLE volatile -#else -# define CACHEABLE /* empty */ -#endif - /* Non-nil means record all fset's and provide's, to be undone if the file being autoloaded is not fully loaded. They are recorded by being consed onto the front of Vautoload_queue: @@ -430,7 +421,7 @@ DEFUN ("progn", Fprogn, Sprogn, 0, UNEVALLED, 0, usage: (progn BODY...) */) (Lisp_Object body) { - Lisp_Object CACHEABLE val = Qnil; + Lisp_Object val = Qnil; while (CONSP (body)) { @@ -1257,12 +1248,6 @@ usage: (catch TAG BODY...) */) return internal_catch (tag, Fprogn, XCDR (args)); } -/* Work around GCC bug 61118 - . */ -#if GNUC_PREREQ (4, 9, 0) -# pragma GCC diagnostic ignored "-Wclobbered" -#endif - /* Assert that E is true, but do not evaluate E. Use this instead of eassert (E) when E contains variables that might be clobbered by a longjmp. */ @@ -1488,8 +1473,10 @@ Lisp_Object internal_lisp_condition_case (Lisp_Object var, Lisp_Object bodyform, Lisp_Object handlers) { - struct handler *oldhandlerlist = handlerlist; - ptrdiff_t CACHEABLE clausenb = 0; + struct handler *volatile oldhandlerlist = handlerlist; + + /* The number of non-success handlers, plus 1 for a sentinel. */ + ptrdiff_t clausenb = 1; var = maybe_remove_pos_from_symbol (var); CHECK_TYPE (BARE_SYMBOL_P (var), Qsymbolp, var); @@ -1521,69 +1508,67 @@ internal_lisp_condition_case (Lisp_Object var, Lisp_Object bodyform, memory_full (SIZE_MAX); Lisp_Object volatile *clauses = alloca (clausenb * sizeof *clauses); clauses += clausenb; + *--clauses = make_fixnum (0); for (Lisp_Object tail = handlers; CONSP (tail); tail = XCDR (tail)) { Lisp_Object tem = XCAR (tail); if (!(CONSP (tem) && EQ (XCAR (tem), QCsuccess))) *--clauses = tem; } - for (ptrdiff_t i = 0; i < clausenb; i++) + Lisp_Object volatile var_volatile = var; + Lisp_Object val, handler_body; + for (Lisp_Object volatile *pcl = clauses; ; pcl++) { - Lisp_Object clause = clauses[i]; + if (BASE_EQ (*pcl, make_fixnum (0))) + { + val = eval_sub (bodyform); + handlerlist = oldhandlerlist; + if (NILP (success_handler)) + return val; +#if GCC_LINT && __GNUC__ && !__clang__ + /* This useless assignment pacifies GCC 14.2.1 x86-64 + . */ + var = var_volatile; +#endif + handler_body = XCDR (success_handler); + break; + } + Lisp_Object clause = *pcl; Lisp_Object condition = CONSP (clause) ? XCAR (clause) : Qnil; if (!CONSP (condition)) condition = list1 (condition); struct handler *c = push_handler (condition, CONDITION_CASE); + Lisp_Object volatile *clauses_volatile = clauses; if (sys_setjmp (c->jmp)) { - Lisp_Object val = handlerlist->val; - Lisp_Object volatile *chosen_clause = clauses; - for (struct handler *h = handlerlist->next; h != oldhandlerlist; - h = h->next) + var = var_volatile; + val = handlerlist->val; + Lisp_Object volatile *chosen_clause = clauses_volatile; + struct handler *oldh = oldhandlerlist; + for (struct handler *h = handlerlist->next; h != oldh; h = h->next) chosen_clause++; - Lisp_Object handler_body = XCDR (*chosen_clause); - handlerlist = oldhandlerlist; - - if (NILP (var)) - return Fprogn (handler_body); + handler_body = XCDR (*chosen_clause); + handlerlist = oldh; - Lisp_Object handler_var = var; - if (!NILP (Vinternal_interpreter_environment)) - { - val = Fcons (Fcons (var, val), - Vinternal_interpreter_environment); - handler_var = Qinternal_interpreter_environment; - } - - /* Bind HANDLER_VAR to VAL while evaluating HANDLER_BODY. - The unbind_to undoes just this binding; whoever longjumped - to us unwound the stack to C->pdlcount before throwing. */ - specpdl_ref count = SPECPDL_INDEX (); - specbind (handler_var, val); - return unbind_to (count, Fprogn (handler_body)); + /* Whoever longjumped to us unwound the stack to C->pdlcount before + throwing, so the unbind_to will undo just this binding. */ + break; } } - Lisp_Object CACHEABLE result = eval_sub (bodyform); - handlerlist = oldhandlerlist; - if (!NILP (success_handler)) - { - if (NILP (var)) - return Fprogn (XCDR (success_handler)); + if (NILP (var)) + return Fprogn (handler_body); - Lisp_Object handler_var = var; - if (!NILP (Vinternal_interpreter_environment)) - { - result = Fcons (Fcons (var, result), - Vinternal_interpreter_environment); - handler_var = Qinternal_interpreter_environment; - } - - specpdl_ref count = SPECPDL_INDEX (); - specbind (handler_var, result); - return unbind_to (count, Fprogn (XCDR (success_handler))); + if (!NILP (Vinternal_interpreter_environment)) + { + val = Fcons (Fcons (var, val), + Vinternal_interpreter_environment); + var = Qinternal_interpreter_environment; } - return result; + + specpdl_ref count = SPECPDL_INDEX (); + specbind (var, val); + return unbind_to (count, Fprogn (handler_body)); } /* Call the function BFUN with no arguments, catching errors within it @@ -1740,7 +1725,7 @@ push_handler (Lisp_Object tag_ch_val, enum handlertype handlertype) struct handler * push_handler_nosignal (Lisp_Object tag_ch_val, enum handlertype handlertype) { - struct handler *CACHEABLE c = handlerlist->nextfree; + struct handler *c = handlerlist->nextfree; if (!c) { c = malloc (sizeof *c); commit cfa5a634e91f5c232a71ec212679165074dc480b Author: Paul Eggert Date: Fri Aug 16 16:59:08 2024 -0700 Don’t ignore -Wclobbered in emacs-module.c This fix is also prompted by Emacs bug#71744. * src/emacs-module.c: Do not ignore -Wclobbered. (MODULE_HANDLE_NONLOCAL_EXIT): Fix violations of the C standard, where setjmp clobbered env and internal_cleanup. (module_extract_big_integer) [GCC_LINT && __GNUC__ && !__clang__]: Work around GCC -Wclobbered false positive for ‘sign’. diff --git a/src/emacs-module.c b/src/emacs-module.c index 05aa0baef74..5aa4cfa0ae8 100644 --- a/src/emacs-module.c +++ b/src/emacs-module.c @@ -96,11 +96,6 @@ To add a new module function, proceed as follows: #include #include -/* Work around GCC bug 83162. */ -#if GNUC_PREREQ (4, 3, 0) -# pragma GCC diagnostic ignored "-Wclobbered" -#endif - /* We use different strategies for allocating the user-visible objects (struct emacs_runtime, emacs_env, emacs_value), depending on whether the user supplied the -module-assertions flag. If @@ -273,14 +268,17 @@ module_decode_utf_8 (const char *str, ptrdiff_t len) module_out_of_memory (env); \ return retval; \ } \ - struct handler *internal_cleanup \ + emacs_env *env_volatile = env; \ + struct handler *volatile internal_cleanup \ = internal_handler; \ - if (sys_setjmp (internal_cleanup->jmp)) \ + if (sys_setjmp (internal_handler->jmp)) \ { \ + emacs_env *env = env_volatile; \ + struct handler *internal_handler = internal_cleanup; \ module_handle_nonlocal_exit (env, \ - internal_cleanup->nonlocal_exit, \ - internal_cleanup->val); \ - module_reset_handlerlist (internal_cleanup); \ + internal_handler->nonlocal_exit, \ + internal_handler->val); \ + module_reset_handlerlist (internal_handler); \ return retval; \ } \ do { } while (false) @@ -1045,6 +1043,15 @@ static bool module_extract_big_integer (emacs_env *env, emacs_value arg, int *sign, ptrdiff_t *count, emacs_limb_t *magnitude) { +#if GCC_LINT && __GNUC__ && !__clang__ + /* These useless assignments pacify GCC 14.2.1 x86-64 + . */ + { + int *volatile sign_volatile = sign; + sign = sign_volatile; + } +#endif + MODULE_FUNCTION_BEGIN (false); Lisp_Object o = value_to_lisp (arg); CHECK_INTEGER (o); commit 2169a9387a5ac22b969d37ece4ec1aaa0fd830d9 Author: Paul Eggert Date: Fri Aug 16 16:29:51 2024 -0700 Don’t ignore -Wclobbered in bytecode.c This fix is prompted by Emacs bug#71744. The working hypothesis is that there are some bugs in Emacs, and some in GCC’s diagnostics, and that this patch fixes the Emacs bugs and works around the GCC diagnostic bugs. The hypothesis is that GCC diagnostic bugs occur when GCC coalesces variables or temporaries and some variables are clobbered by setjmp and some vars/temps are not. Part of this hypothesis involves GCC diagnosing the wrong variables. Instead of ignoring the diagnostics, which the hypothesis suggests indicate either problems in Emacs or in GCC, fix the Emacs bugs and pacify the GCC false positives, with comments about the GCC bugs. GCC’s true positives are helpful enough in squashing obscure bugs like Emacs bug#71744, that it’s worth going to some effort to pacify -Wclobbered instead of ignoring it. * src/bytecode.c: Do not ignore -Wclobbered. (exec_byte_code): Fix violations of the C standard, where setjmp clobbered quitcounter and bc. If GCC_LINT && __GNUC__ && !__clang__, work around GCC -Wclobbered warnings for bytestr_data and vectorp. diff --git a/src/bytecode.c b/src/bytecode.c index ce075c86afd..48a29c22d55 100644 --- a/src/bytecode.c +++ b/src/bytecode.c @@ -29,11 +29,6 @@ along with GNU Emacs. If not, see . */ #include "window.h" #include "puresize.h" -/* Work around GCC bug 54561. */ -#if GNUC_PREREQ (4, 3, 0) -# pragma GCC diagnostic ignored "-Wclobbered" -#endif - /* Define BYTE_CODE_SAFE true to enable some minor sanity checking, useful for debugging the byte compiler. It defaults to false. */ @@ -536,6 +531,12 @@ exec_byte_code (Lisp_Object fun, ptrdiff_t args_template, for (ptrdiff_t i = nargs - rest; i < nonrest; i++) PUSH (Qnil); + unsigned char volatile saved_quitcounter; +#if GCC_LINT && __GNUC__ && !__clang__ + Lisp_Object *volatile saved_vectorp; + unsigned char const *volatile saved_bytestr_data; +#endif + while (true) { int op; @@ -967,15 +968,23 @@ exec_byte_code (Lisp_Object fun, ptrdiff_t args_template, if (sys_setjmp (c->jmp)) { + quitcounter = saved_quitcounter; struct handler *c = handlerlist; handlerlist = c->next; top = c->bytecode_top; op = c->bytecode_dest; + bc = ¤t_thread->bc; struct bc_frame *fp = bc->fp; Lisp_Object fun = fp->fun; Lisp_Object bytestr = AREF (fun, CLOSURE_CODE); Lisp_Object vector = AREF (fun, CLOSURE_CONSTANTS); +#if GCC_LINT && __GNUC__ && !__clang__ + /* These useless assignments pacify GCC 14.2.1 x86-64 + . */ + bytestr_data = saved_bytestr_data; + vectorp = saved_vectorp; +#endif bytestr_data = SDATA (bytestr); vectorp = XVECTOR (vector)->contents; if (BYTE_CODE_SAFE) @@ -989,6 +998,11 @@ exec_byte_code (Lisp_Object fun, ptrdiff_t args_template, goto op_branch; } + saved_quitcounter = quitcounter; +#if GCC_LINT && __GNUC__ && !__clang__ + saved_vectorp = vectorp; + saved_bytestr_data = bytestr_data; +#endif NEXT; } commit 5c9de704cc8cff861a37158229e0b393598798a4 (refs/remotes/origin/emacs-30) Author: Eli Zaretskii Date: Fri Aug 16 21:55:37 2024 +0300 ; * admin/make-tarball.txt: Minor copyedits. diff --git a/admin/make-tarball.txt b/admin/make-tarball.txt index 9d3de2fa201..15342319829 100644 --- a/admin/make-tarball.txt +++ b/admin/make-tarball.txt @@ -137,38 +137,40 @@ General steps (for each step, check for possible errors): of the format "Bump Emacs version to ...", so that the commit can be skipped when merging branches (see admin/gitmerge.el). - The final pretest should be a release candidate. - Before a release candidate is made, the tasks listed in - admin/release-process must be completed. - - Set the version number to that of the actual release (commit in - one, as described above). Pick a date about a week from now when - you intend to make the release. Use M-x add-release-logs from - admin/admin.el to add entries to etc/HISTORY and the ChangeLog - file. It's best not to commit these files until the release is - actually made. Merge the entries from (unversioned) ChangeLog - into the top of the current versioned ChangeLog.N and commit that - along with etc/HISTORY. Then you can tag that commit as the - release. - - Alternatively, you can commit and tag with the RC tag right away, - and delay the final tagging until you actually decide to make a - release and announce it. The "git tag" command can tag a specific - commit if you give it the SHA1 of that commit, even if additional - commits have been pushed in the meantime. - - Name the tar file as emacs-XX.Y-rc1.tar. If all goes well in the - following week, you can simply rename the file and use it for the - actual release. If you need another release candidate, remember - to adjust the ChangeLog and etc/HISTORY entries. - - If you need to change only a file(s) that cannot possibly affect - the build (README, ChangeLog, NEWS, etc.) then rather than doing - an entirely new build, it is better to unpack the existing - tarfile, modify the file(s), and tar it back up again. - - Never replace an existing tarfile! If you need to fix something, - always upload it with a different name. + If this is a final pretest before the release: + + The final pretest should be a release candidate. + Before a release candidate is made, the tasks listed in + admin/release-process must be completed. + + Set the version number to that of the actual release (commit in + one, as described above). Pick a date about a week from now when + you intend to make the release. Use M-x add-release-logs from + admin/admin.el to add entries to etc/HISTORY and the ChangeLog + file. It's best not to commit these files until the release is + actually made. Merge the entries from (unversioned) ChangeLog + into the top of the current versioned ChangeLog.N and commit that + along with etc/HISTORY. Then you can tag that commit as the + release. + + Alternatively, you can commit and tag with the RC tag right away, + and delay the final tagging until you actually decide to make a + release and announce it. The "git tag" command can tag a specific + commit if you give it the SHA1 of that commit, even if additional + commits have been pushed in the meantime. + + Name the tar file as emacs-XX.Y-rc1.tar. If all goes well in the + following week, you can simply rename the file and use it for the + actual release. If you need another release candidate, remember + to adjust the ChangeLog and etc/HISTORY entries. + + If you need to change only a file(s) that cannot possibly affect + the build (README, ChangeLog, NEWS, etc.) then rather than doing + an entirely new build, it is better to unpack the existing + tarfile, modify the file(s), and tar it back up again. + + Never replace an existing tarfile! If you need to fix something, + always upload it with a different name. 4. autoreconf -i -I m4 --force make bootstrap commit 909d1d02db1c11e1309316cba2a392e1456e6053 Author: Po Lu Date: Fri Aug 16 21:01:22 2024 +0800 Remove Hangul character from `han' representative character list * lisp/international/fontset.el (script-representative-chars): U+3200 is a Hangul character that is predictably absent from CJK fonts, such as are provided by Xiaomi devices. diff --git a/lisp/international/fontset.el b/lisp/international/fontset.el index f0f6c8070ac..1d5931ac761 100644 --- a/lisp/international/fontset.el +++ b/lisp/international/fontset.el @@ -209,7 +209,7 @@ (kana #x304B) (bopomofo #x3105) (kanbun #x319D) - (han #x3200 #x4e10 #x5B57 #xfe30 #xf900) + (han #x4e10 #x5B57 #xfe30 #xf900) (yi #xA288) (syloti-nagri #xA807 #xA823 #xA82C) (rejang #xA930 #xA947 #xA95F) commit 3fc16357832130a6ab8e6016b05ed60f4763e0c7 Author: Eli Zaretskii Date: Fri Aug 16 14:05:20 2024 +0300 ; * doc/lispref/strings.texi (Text Comparison): Improve indexing. diff --git a/doc/lispref/strings.texi b/doc/lispref/strings.texi index 7f1214cabb5..c459c719d7a 100644 --- a/doc/lispref/strings.texi +++ b/doc/lispref/strings.texi @@ -487,7 +487,9 @@ null characters. It may also change @var{string}'s length. @section Comparison of Characters and Strings @cindex string equality @cindex text comparison +@cindex string comparison +@cindex compare characters @defun char-equal character1 character2 This function returns @code{t} if the arguments represent the same character, @code{nil} otherwise. This function ignores differences @@ -502,6 +504,7 @@ in case if @code{case-fold-search} is non-@code{nil}. @end example @end defun +@cindex compare strings @defun string-equal string1 string2 This function returns @code{t} if the characters of the two strings match exactly. Symbols are also allowed as arguments, in which case @@ -534,6 +537,7 @@ character codes all being in the range 0--127 (@acronym{ASCII}). @code{string=} is another name for @code{string-equal}. @end defun +@cindex case-insensitive string comparison @defun string-equal-ignore-case string1 string2 @code{string-equal-ignore-case} compares strings ignoring case differences, like @code{char-equal} when @code{case-fold-search} is @@ -665,6 +669,7 @@ This function returns the result of comparing @var{string1} and @end defun @cindex locale-dependent string comparison +@cindex string collation @defun string-collate-lessp string1 string2 &optional locale ignore-case This function returns @code{t} if @var{string1} is less than @var{string2} in collation order of the specified @var{locale}, which @@ -719,6 +724,8 @@ If your system does not support a locale environment, this function behaves like @code{string-lessp}. @end defun +@cindex version comparison +@cindex comparing version strings @defun string-version-lessp string1 string2 This function compares strings lexicographically, except it treats sequences of numerical characters as if they comprised a base-ten @@ -727,6 +734,7 @@ number, and then compares the numbers. So @samp{foo2.png} is @samp{12} is lexicographically ``smaller'' than @samp{2}. @end defun +@cindex string starts with prefix @defun string-prefix-p string1 string2 &optional ignore-case This function returns non-@code{nil} if @var{string1} is a prefix of @var{string2}; i.e., if @var{string2} starts with @var{string1}. If @@ -734,6 +742,7 @@ the optional argument @var{ignore-case} is non-@code{nil}, the comparison ignores case differences. @end defun +@cindex string ends with suffix @defun string-suffix-p suffix string &optional ignore-case This function returns non-@code{nil} if @var{suffix} is a suffix of @var{string}; i.e., if @var{string} ends with @var{suffix}. If the commit 40eecd594ac60f38b6729fd9cf3474a8b9d133b9 Author: Paul Eggert Date: Thu Aug 15 20:10:53 2024 -0700 Port better to NFS unlink I found this problem while looking into Bug#72641. * lib-src/etags.c (do_move_file): * lib-src/update-game-score.c (unlock_file): * src/androidvfs.c (android_hack_asset_fd_fallback): * src/filelock.c (current_lock_owner): Treat unlink as successful if it fails because the file wasn’t there. This can happen with some NFS implementations, due to its retrying over the network to get at-least-once semantics. Although most of Emacs’s calls to unlink were already doing this, a few instances were not. diff --git a/lib-src/etags.c b/lib-src/etags.c index 03bc55de03d..edadbc25901 100644 --- a/lib-src/etags.c +++ b/lib-src/etags.c @@ -7812,7 +7812,7 @@ do_move_file (const char *src_file, const char *dst_file) if (fclose (dst_f) == EOF) pfatal (dst_file); - if (unlink (src_file) == -1) + if (unlink (src_file) < 0 && errno != ENOENT) pfatal ("unlink error"); return; diff --git a/lib-src/update-game-score.c b/lib-src/update-game-score.c index 4139073bcd7..e3b24ad7717 100644 --- a/lib-src/update-game-score.c +++ b/lib-src/update-game-score.c @@ -497,7 +497,7 @@ unlock_file (const char *filename, void *state) char *lockpath = (char *) state; int saved_errno = errno; int ret = unlink (lockpath); - if (0 <= ret) + if (! (ret < 0 && errno != ENOENT)) errno = saved_errno; free (lockpath); return ret; diff --git a/src/androidvfs.c b/src/androidvfs.c index 14da8eed37e..ff81ef288f5 100644 --- a/src/androidvfs.c +++ b/src/androidvfs.c @@ -1323,7 +1323,7 @@ android_hack_asset_fd_fallback (AAsset *asset) if (fd < 0) return -1; - if (unlink (filename)) + if (unlink (filename) && errno != ENOENT) goto fail; if (ftruncate (fd, size)) diff --git a/src/filelock.c b/src/filelock.c index 1ae57dc7344..bc09fce69f8 100644 --- a/src/filelock.c +++ b/src/filelock.c @@ -501,7 +501,7 @@ current_lock_owner (lock_info_type *owner, Lisp_Object lfname) the file system is buggy, e.g., . Emacs never creates empty lock files even temporarily, so removing an empty lock file should be harmless. */ - return emacs_unlink (SSDATA (lfname)) < 0 ? errno : 0; + return emacs_unlink (SSDATA (lfname)) < 0 && errno != ENOENT ? errno : 0; } commit 8b36bfc553b97cf435bdfe1b84abe21c3a605b9f Author: Paul Eggert Date: Thu Aug 15 13:30:23 2024 -0700 Remove empty (& invalid) lock files * src/filelock.c (current_lock_owner): Remove empty lock files, as they are necessarily invalid and can be caused by buggy file systems. Problem reported by Michal Nazarewicz (bug#72641). diff --git a/src/filelock.c b/src/filelock.c index c68aacc46fb..1ae57dc7344 100644 --- a/src/filelock.c +++ b/src/filelock.c @@ -397,8 +397,8 @@ current_lock_owner (lock_info_type *owner, Lisp_Object lfname) if (lfinfolen < 0) return errno == ENOENT || errno == ENOTDIR ? 0 : errno; - /* Examine lock file contents. */ - if (true) + /* If the lock file seems valid, return a value based on its contents. */ + if (lfinfolen) { if (MAX_LFINFO < lfinfolen) return ENAMETOOLONG; @@ -496,8 +496,11 @@ current_lock_owner (lock_info_type *owner, Lisp_Object lfname) return ANOTHER_OWNS_IT; } - /* The owner process is dead or has a strange pid. - Try to zap the lockfile. */ + /* The owner process is dead or has a strange pid, or the lock file is empty. + Try to zap the lockfile. If the lock file is empty, this assumes + the file system is buggy, e.g., . + Emacs never creates empty lock files even temporarily, so removing + an empty lock file should be harmless. */ return emacs_unlink (SSDATA (lfname)) < 0 ? errno : 0; } commit 775fa8443faa3d7f5ce7f7d0aa6e6fb53321715a Author: Paul Eggert Date: Thu Aug 15 13:17:24 2024 -0700 Refactor current_lock_owner * src/filelock.c (current_lock_owner): Refactor to make further changes easier. This should not affect behavior. diff --git a/src/filelock.c b/src/filelock.c index cdf9e6f0ffc..c68aacc46fb 100644 --- a/src/filelock.c +++ b/src/filelock.c @@ -386,9 +386,6 @@ static int current_lock_owner (lock_info_type *owner, Lisp_Object lfname) { lock_info_type local_owner; - ptrdiff_t lfinfolen; - intmax_t pid, boot_time; - char *at, *dot, *lfinfo_end; /* Even if the caller doesn't want the owner info, we still have to read it to determine return value. */ @@ -396,104 +393,112 @@ current_lock_owner (lock_info_type *owner, Lisp_Object lfname) owner = &local_owner; /* If nonexistent lock file, all is well; otherwise, got strange error. */ - lfinfolen = read_lock_data (SSDATA (lfname), owner->user); + ptrdiff_t lfinfolen = read_lock_data (SSDATA (lfname), owner->user); if (lfinfolen < 0) return errno == ENOENT || errno == ENOTDIR ? 0 : errno; - if (MAX_LFINFO < lfinfolen) - return ENAMETOOLONG; - owner->user[lfinfolen] = 0; - - /* Parse USER@HOST.PID:BOOT_TIME. If can't parse, return EINVAL. */ - /* The USER is everything before the last @. */ - owner->at = at = memrchr (owner->user, '@', lfinfolen); - if (!at) - return EINVAL; - owner->dot = dot = strrchr (at, '.'); - if (!dot) - return EINVAL; - - /* The PID is everything from the last '.' to the ':' or equivalent. */ - if (! integer_prefixed (dot + 1)) - return EINVAL; - errno = 0; - pid = strtoimax (dot + 1, &owner->colon, 10); - if (errno == ERANGE) - pid = -1; - - /* After the ':' or equivalent, if there is one, comes the boot time. */ - char *boot = owner->colon + 1; - switch (owner->colon[0]) + + /* Examine lock file contents. */ + if (true) { - case 0: - boot_time = 0; - lfinfo_end = owner->colon; - break; + if (MAX_LFINFO < lfinfolen) + return ENAMETOOLONG; + owner->user[lfinfolen] = 0; - case '\357': - /* Treat "\357\200\242" (U+F022 in UTF-8) as if it were ":" (Bug#24656). - This works around a bug in the Linux CIFS kernel client, which can - mistakenly transliterate ':' to U+F022 in symlink contents. - See . */ - if (! (boot[0] == '\200' && boot[1] == '\242')) + /* Parse USER@HOST.PID:BOOT_TIME. If can't parse, return EINVAL. */ + /* The USER is everything before the last @. */ + char *at = memrchr (owner->user, '@', lfinfolen); + if (!at) return EINVAL; - boot += 2; - FALLTHROUGH; - case ':': - if (! integer_prefixed (boot)) + owner->at = at; + char *dot = strrchr (at, '.'); + if (!dot) return EINVAL; - boot_time = strtoimax (boot, &lfinfo_end, 10); - break; + owner->dot = dot; - default: - return EINVAL; - } - if (lfinfo_end != owner->user + lfinfolen) - return EINVAL; - - char *linkhost = at + 1; - ptrdiff_t linkhostlen = dot - linkhost; - Lisp_Object system_name = Fsystem_name (); - /* If `system-name' returns nil, that means we're in a - --no-build-details Emacs, and the name part of the link (e.g., - .#test.txt -> larsi@.118961:1646577954) is an empty string. */ - bool on_current_host; - if (NILP (system_name)) - on_current_host = linkhostlen == 0; - else - { - on_current_host = linkhostlen == SBYTES (system_name); - if (on_current_host) + /* The PID is everything from the last '.' to the ':' or equivalent. */ + if (! integer_prefixed (dot + 1)) + return EINVAL; + errno = 0; + intmax_t pid = strtoimax (dot + 1, &owner->colon, 10); + if (errno == ERANGE) + pid = -1; + + /* After the ':' or equivalent, if there is one, comes the boot time. */ + intmax_t boot_time; + char *boot = owner->colon + 1, *lfinfo_end; + switch (owner->colon[0]) { - /* Protect against the extremely unlikely case of the host - name containing '@'. */ - char *sysname = SSDATA (system_name); - for (ptrdiff_t i = 0; i < linkhostlen; i++) - if (linkhost[i] != (sysname[i] == '@' ? '-' : sysname[i])) - { - on_current_host = false; - break; - } + case 0: + boot_time = 0; + lfinfo_end = owner->colon; + break; + + case '\357': + /* Treat "\357\200\242" (U+F022 in UTF-8) like ":" (Bug#24656). + This works around a bug in the Linux CIFS kernel client, which can + mistakenly transliterate ':' to U+F022 in symlink contents. + See . */ + if (! (boot[0] == '\200' && boot[1] == '\242')) + return EINVAL; + boot += 2; + FALLTHROUGH; + case ':': + if (! integer_prefixed (boot)) + return EINVAL; + boot_time = strtoimax (boot, &lfinfo_end, 10); + break; + + default: + return EINVAL; } - } - if (on_current_host) - { - if (pid == getpid ()) - return I_OWN_IT; - else if (VALID_PROCESS_ID (pid) - && (kill (pid, 0) >= 0 || errno == EPERM) - && (boot_time == 0 - || within_one_second (boot_time, get_boot_sec ()))) - return ANOTHER_OWNS_IT; - /* The owner process is dead or has a strange pid, so try to - zap the lockfile. */ + if (lfinfo_end != owner->user + lfinfolen) + return EINVAL; + + char *linkhost = at + 1; + ptrdiff_t linkhostlen = dot - linkhost; + Lisp_Object system_name = Fsystem_name (); + /* If `system-name' returns nil, that means we're in a + --no-build-details Emacs, and the name part of the link (e.g., + .#test.txt -> larsi@.118961:1646577954) is an empty string. */ + bool on_current_host; + if (NILP (system_name)) + on_current_host = linkhostlen == 0; else - return emacs_unlink (SSDATA (lfname)) < 0 ? errno : 0; - } - else - { /* If we wanted to support the check for stale locks on remote machines, - here's where we'd do it. */ - return ANOTHER_OWNS_IT; + { + on_current_host = linkhostlen == SBYTES (system_name); + if (on_current_host) + { + /* Protect against the extremely unlikely case of the host + name containing '@'. */ + char *sysname = SSDATA (system_name); + for (ptrdiff_t i = 0; i < linkhostlen; i++) + if (linkhost[i] != (sysname[i] == '@' ? '-' : sysname[i])) + { + on_current_host = false; + break; + } + } + } + if (!on_current_host) + { + /* Not on current host. If we wanted to support the check for + stale locks on remote machines, here's where we'd do it. */ + return ANOTHER_OWNS_IT; + } + + if (pid == getpid ()) + return I_OWN_IT; + + if (VALID_PROCESS_ID (pid) + && ! (kill (pid, 0) < 0 && errno != EPERM) + && (boot_time == 0 + || within_one_second (boot_time, get_boot_sec ()))) + return ANOTHER_OWNS_IT; } + + /* The owner process is dead or has a strange pid. + Try to zap the lockfile. */ + return emacs_unlink (SSDATA (lfname)) < 0 ? errno : 0; } commit 4b6b9a7acdc4f7d0594caaaa382e2e633f8f1225 Author: Paul Eggert Date: Thu Aug 15 12:58:19 2024 -0700 Avoid some GC when locking/unlocking files * src/filelock.c (lock_file_1, current_lock_owner): Don’t possibly invoke the garbage collector when comparing lock file contents to host names. diff --git a/src/filelock.c b/src/filelock.c index 55ab15feb8d..cdf9e6f0ffc 100644 --- a/src/filelock.c +++ b/src/filelock.c @@ -271,27 +271,29 @@ lock_file_1 (Lisp_Object lfname, bool force) intmax_t boot = get_boot_sec (); Lisp_Object luser_name = Fuser_login_name (Qnil); Lisp_Object lhost_name = Fsystem_name (); - - /* Protect against the extremely unlikely case of the host name - containing an @ character. */ - if (!NILP (lhost_name) && strchr (SSDATA (lhost_name), '@')) - lhost_name = CALLN (Ffuncall, Qstring_replace, - build_string ("@"), build_string ("-"), - lhost_name); - char const *user_name = STRINGP (luser_name) ? SSDATA (luser_name) : ""; char const *host_name = STRINGP (lhost_name) ? SSDATA (lhost_name) : ""; char lock_info_str[MAX_LFINFO + 1]; intmax_t pid = getpid (); - char const *lock_info_fmt = (boot - ? "%s@%s.%"PRIdMAX":%"PRIdMAX - : "%s@%s.%"PRIdMAX); - int len = snprintf (lock_info_str, sizeof lock_info_str, - lock_info_fmt, user_name, host_name, pid, boot); + int room = sizeof lock_info_str; + int len = snprintf (lock_info_str, room, "%s@", user_name); if (! (0 <= len && len < sizeof lock_info_str)) return ENAMETOOLONG; - + /* Protect against the extremely unlikely case of the host name + containing an @ character. */ + for (; *host_name; len++, host_name++) + { + if (! (len < sizeof lock_info_str - 1)) + return ENAMETOOLONG; + lock_info_str[len] = *host_name == '@' ? '-' : *host_name; + } + char const *lock_info_fmt = boot ? ".%"PRIdMAX":%"PRIdMAX : ".%"PRIdMAX; + room = sizeof lock_info_str - len; + int suffixlen = snprintf (lock_info_str + len, room, + lock_info_fmt, pid, boot); + if (! (0 <= suffixlen && suffixlen < room)) + return ENAMETOOLONG; return create_lock_file (SSDATA (lfname), lock_info_str, force); } @@ -448,22 +450,32 @@ current_lock_owner (lock_info_type *owner, Lisp_Object lfname) if (lfinfo_end != owner->user + lfinfolen) return EINVAL; + char *linkhost = at + 1; + ptrdiff_t linkhostlen = dot - linkhost; Lisp_Object system_name = Fsystem_name (); /* If `system-name' returns nil, that means we're in a --no-build-details Emacs, and the name part of the link (e.g., .#test.txt -> larsi@.118961:1646577954) is an empty string. */ + bool on_current_host; if (NILP (system_name)) - system_name = build_string (""); - /* Protect against the extremely unlikely case of the host name - containing an @ character. */ - else if (strchr (SSDATA (system_name), '@')) - system_name = CALLN (Ffuncall, intern ("string-replace"), - build_string ("@"), build_string ("-"), - system_name); - /* On current host? */ - if (STRINGP (system_name) - && dot - (at + 1) == SBYTES (system_name) - && memcmp (at + 1, SSDATA (system_name), SBYTES (system_name)) == 0) + on_current_host = linkhostlen == 0; + else + { + on_current_host = linkhostlen == SBYTES (system_name); + if (on_current_host) + { + /* Protect against the extremely unlikely case of the host + name containing '@'. */ + char *sysname = SSDATA (system_name); + for (ptrdiff_t i = 0; i < linkhostlen; i++) + if (linkhost[i] != (sysname[i] == '@' ? '-' : sysname[i])) + { + on_current_host = false; + break; + } + } + } + if (on_current_host) { if (pid == getpid ()) return I_OWN_IT; commit cbacdca9e3f6dcf9b88704391f06daf7301608b0 Author: Paul Eggert Date: Thu Aug 15 11:29:16 2024 -0700 Fix unlikely lock file integer overflow * src/filelock.c (within_one_second): Accept intmax_t first arg. Avoid undefined behavior on integer overflow. (current_lock_owner): Simplify based on within_one_second change. diff --git a/src/filelock.c b/src/filelock.c index 69bd0322d4c..55ab15feb8d 100644 --- a/src/filelock.c +++ b/src/filelock.c @@ -298,9 +298,10 @@ lock_file_1 (Lisp_Object lfname, bool force) /* Return true if times A and B are no more than one second apart. */ static bool -within_one_second (time_t a, time_t b) +within_one_second (intmax_t a, time_t b) { - return (a - b >= -1 && a - b <= 1); + intmax_t diff; + return !ckd_sub (&diff, a, b) && -1 <= diff && diff <= 1; } /* On systems lacking ELOOP, test for an errno value that shouldn't occur. */ @@ -469,8 +470,7 @@ current_lock_owner (lock_info_type *owner, Lisp_Object lfname) else if (VALID_PROCESS_ID (pid) && (kill (pid, 0) >= 0 || errno == EPERM) && (boot_time == 0 - || (boot_time <= TYPE_MAXIMUM (time_t) - && within_one_second (boot_time, get_boot_sec ())))) + || within_one_second (boot_time, get_boot_sec ()))) return ANOTHER_OWNS_IT; /* The owner process is dead or has a strange pid, so try to zap the lockfile. */ commit 45a78ec6c57ab7d88846a143f81087d5575d0422 Author: Pip Cet Date: Thu Aug 15 16:28:07 2024 +0000 * lisp/files.el (require-with-check): Improve error messages. diff --git a/lisp/files.el b/lisp/files.el index eadb4a9d0b1..6cbb1b5c632 100644 --- a/lisp/files.el +++ b/lisp/files.el @@ -1274,9 +1274,17 @@ NOERROR is equal to `reload'), or otherwise emit a warning." (cond ((assoc fn load-history) nil) ;We loaded the right file. ((eq noerror 'reload) (load fn nil 'nomessage)) - (t (funcall (if noerror #'warn #'error) - "Feature `%S' is now provided by a different file %s" - feature fn))))) + ((and fn (memq feature features)) + (funcall (if noerror #'warn #'error) + "Feature `%S' is now provided by a different file %s" + feature fn)) + (fn + (funcall (if noerror #'warn #'error) + "Could not load file %s" fn)) + (t + (funcall (if noerror #'warn #'error) + "Could not locate file %s in load path" + (or filename (symbol-name feature))))))) res)) (defun file-remote-p (file &optional identification connected) commit 8db72a8d4b77ccdbb68f7361a52d7f2ebe78b656 Author: Mattias Engdegård Date: Thu Aug 15 16:00:47 2024 +0200 Replace some EQ with BASE_EQ * src/eval.c (FletX, Flet, funcall_lambda) (let_shadows_buffer_binding_p): * src/data.c (set_blv_found, set_internal, default_value) (set_default_internal, Flocal_variable_p): * src/buffer.c (Fkill_buffer): (mouse_face_overlay_overlaps, compare_overlays) (report_overlay_modification): BASE_EQ is safe because we don't actually compare symbols here. diff --git a/src/buffer.c b/src/buffer.c index 6ec40aff646..78f1d977221 100644 --- a/src/buffer.c +++ b/src/buffer.c @@ -2036,7 +2036,7 @@ cleaning up all windows currently displaying the buffer to be killed. */) /* If the buffer now current is shown in the minibuffer and our buffer is the sole other buffer give up. */ XSETBUFFER (tem, current_buffer); - if (EQ (tem, XWINDOW (minibuf_window)->contents) + if (BASE_EQ (tem, XWINDOW (minibuf_window)->contents) && BASE_EQ (buffer, Fother_buffer (buffer, Qnil, Qnil))) return Qnil; @@ -3175,7 +3175,7 @@ mouse_face_overlay_overlaps (Lisp_Object overlay) { if (node->begin < end && node->end > start && node->begin < node->end - && !EQ (node->data, overlay) + && !BASE_EQ (node->data, overlay) && (tem = Foverlay_get (overlay, Qmouse_face), !NILP (tem))) return true; @@ -3238,7 +3238,7 @@ compare_overlays (const void *v1, const void *v2) return s2->end < s1->end ? -1 : 1; else if (s1->spriority != s2->spriority) return (s1->spriority < s2->spriority ? -1 : 1); - else if (EQ (s1->overlay, s2->overlay)) + else if (BASE_EQ (s1->overlay, s2->overlay)) return 0; else /* Avoid the non-determinism of qsort by choosing an arbitrary ordering @@ -4090,7 +4090,7 @@ report_overlay_modification (Lisp_Object start, Lisp_Object end, bool after, Lisp_Object arg1, Lisp_Object arg2, Lisp_Object arg3) { /* True if this change is an insertion. */ - bool insertion = (after ? XFIXNAT (arg3) == 0 : EQ (start, end)); + bool insertion = (after ? XFIXNAT (arg3) == 0 : BASE_EQ (start, end)); /* We used to run the functions as soon as we found them and only register them in last_overlay_modification_hooks for the purpose of the `after' diff --git a/src/data.c b/src/data.c index d947d200870..6fa543c97cf 100644 --- a/src/data.c +++ b/src/data.c @@ -82,7 +82,7 @@ XOBJFWD (lispfwd a) static void set_blv_found (struct Lisp_Buffer_Local_Value *blv, int found) { - eassert (found == !EQ (blv->defcell, blv->valcell)); + eassert (found == !BASE_EQ (blv->defcell, blv->valcell)); blv->found = found; } @@ -1697,9 +1697,9 @@ set_internal (Lisp_Object symbol, Lisp_Object newval, Lisp_Object where, loaded, or if it's a Lisp_Buffer_Local_Value and the default binding is loaded, the loaded binding may be the wrong one. */ - if (!EQ (blv->where, where) + if (!BASE_EQ (blv->where, where) /* Also unload a global binding (if the var is local_if_set). */ - || (EQ (blv->valcell, blv->defcell))) + || (BASE_EQ (blv->valcell, blv->defcell))) { /* The currently loaded binding is not necessarily valid. We need to unload it, and choose a new binding. */ @@ -1940,7 +1940,7 @@ default_value (Lisp_Object symbol) But the `realvalue' slot may be more up to date, since ordinary setq stores just that slot. So use that. */ struct Lisp_Buffer_Local_Value *blv = SYMBOL_BLV (sym); - if (blv->fwd.fwdptr && EQ (blv->valcell, blv->defcell)) + if (blv->fwd.fwdptr && BASE_EQ (blv->valcell, blv->defcell)) return do_symval_forwarding (blv->fwd); else return XCDR (blv->defcell); @@ -2035,7 +2035,7 @@ set_default_internal (Lisp_Object symbol, Lisp_Object value, XSETCDR (blv->defcell, value); /* If the default binding is now loaded, set the REALVALUE slot too. */ - if (blv->fwd.fwdptr && EQ (blv->defcell, blv->valcell)) + if (blv->fwd.fwdptr && BASE_EQ (blv->defcell, blv->valcell)) store_symval_forwarding (blv->fwd, value, NULL); return; } @@ -2401,7 +2401,7 @@ Also see `buffer-local-boundp'.*/) XSETBUFFER (tmp, buf); XSETSYMBOL (variable, sym); /* Update in case of aliasing. */ - if (EQ (blv->where, tmp)) /* The binding is already loaded. */ + if (BASE_EQ (blv->where, tmp)) /* The binding is already loaded. */ return blv_found (blv) ? Qt : Qnil; else return NILP (assq_no_quit (variable, BVAR (buf, local_var_alist))) diff --git a/src/eval.c b/src/eval.c index 16ece744f42..b4103acd28f 100644 --- a/src/eval.c +++ b/src/eval.c @@ -1026,7 +1026,7 @@ usage: (let* VARLIST BODY...) */) { Lisp_Object newenv = Fcons (Fcons (var, val), Vinternal_interpreter_environment); - if (EQ (Vinternal_interpreter_environment, lexenv)) + if (BASE_EQ (Vinternal_interpreter_environment, lexenv)) /* Save the old lexical environment on the specpdl stack, but only for the first lexical binding, since we'll never need to revert to one of the intermediate ones. */ @@ -1102,7 +1102,7 @@ usage: (let VARLIST BODY...) */) specbind (var, tem); } - if (!EQ (lexenv, Vinternal_interpreter_environment)) + if (!BASE_EQ (lexenv, Vinternal_interpreter_environment)) /* Instantiate a new lexical environment. */ specbind (Qinternal_interpreter_environment, lexenv); @@ -3320,7 +3320,7 @@ funcall_lambda (Lisp_Object fun, ptrdiff_t nargs, Lisp_Object *arg_vector) else if (i < nargs) xsignal2 (Qwrong_number_of_arguments, fun, make_fixnum (nargs)); - if (!EQ (lexenv, Vinternal_interpreter_environment)) + if (!BASE_EQ (lexenv, Vinternal_interpreter_environment)) /* Instantiate a new lexical environment. */ specbind (Qinternal_interpreter_environment, lexenv); @@ -3471,7 +3471,7 @@ let_shadows_buffer_binding_p (struct Lisp_Symbol *symbol) eassert (let_bound_symbol->u.s.redirect != SYMBOL_VARALIAS); if (symbol == let_bound_symbol && p->kind != SPECPDL_LET_LOCAL /* bug#62419 */ - && EQ (specpdl_where (p), buf)) + && BASE_EQ (specpdl_where (p), buf)) return 1; } commit 03a791556af3b3683921799cce6df2f5ec81c1e7 Author: Po Lu Date: Thu Aug 15 19:59:43 2024 +0800 ; * etc/NEWS: Restore reference to Linux kernel. diff --git a/etc/NEWS b/etc/NEWS index 3bc3d5df34a..8cd21f5fb74 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -274,7 +274,7 @@ specify "+0000" or "Z" as the time zone in the argument. ** Process execution has been optimized on Android. The run-time performance of subprocesses on recent Android releases, where a userspace executable loader is required, has been optimized on -systems featuring GNU/Linux 3.5.0 and above. +systems featuring Linux 3.5.0 and above. ---------------------------------------------------------------------- commit dcd5b80b09c4679d7cceecc852725dba6a75b5f0 Author: Ulrich Müller Date: Thu Aug 15 11:13:38 2024 +0200 ; * etc/NEWS: Fix typo. diff --git a/etc/NEWS b/etc/NEWS index 400d28c9b7c..3bc3d5df34a 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -258,7 +258,7 @@ If supplied, 'string-pixel-width' will use any face remappings from BUFFER when computing the string's width. +++ -** 'date-to-time' now defaults to local time +** 'date-to-time' now defaults to local time. The function now assumes local time instead of Universal Time when its argument lacks explicit time zone information. This has been the de-facto behavior since Emacs 24 although documentation said otherwise. commit 9a04b99b3d39d8f5aa965ad486e26012b686c7a0 Author: Andrea Corallo Date: Thu Aug 15 10:47:00 2024 +0200 ; * src/data.c (Fsubrp): Improve docstring. diff --git a/src/data.c b/src/data.c index 3490d4985c9..13b4593e005 100644 --- a/src/data.c +++ b/src/data.c @@ -505,7 +505,9 @@ DEFUN ("user-ptrp", Fuser_ptrp, Suser_ptrp, 1, 1, 0, #endif DEFUN ("subrp", Fsubrp, Ssubrp, 1, 1, 0, - doc: /* Return t if OBJECT is a built-in function. */) + doc: /* Return t if OBJECT is a built-in or native compiled Lisp function. + +See also `primitive-function-p' and `native-comp-function-p'. */) (Lisp_Object object) { if (SUBRP (object)) commit 4f3e8c3b4ed7b4d12fca9370e84e91b4b3379c7c Author: Eli Zaretskii Date: Thu Aug 15 11:30:48 2024 +0300 Improve documentation of ERT * doc/misc/ert.texi (Running Tests Interactively) (Test Selectors): * lisp/emacs-lisp/ert.el (ert-select-tests) (ert-run-tests-interactively, ert-run-tests-batch): Improve and clarify the documentation of the main ERT functions. diff --git a/doc/misc/ert.texi b/doc/misc/ert.texi index 109dbd0f0ce..1ac0378148b 100644 --- a/doc/misc/ert.texi +++ b/doc/misc/ert.texi @@ -203,9 +203,12 @@ different Emacs versions. @cindex interactive testing @findex ert +@findex ert-run-tests-interactively You can run the tests that are currently defined in your Emacs with the -command @kbd{M-x ert @key{RET} t @key{RET}}. (For an explanation of the -@code{t} argument, @pxref{Test Selectors}.) ERT will pop up a new +command @kbd{M-x ert @key{RET} t @key{RET}} (which is an alias of +@code{ert-run-tests-interactively}). The @code{t} argument means to run +all the defined tests, see @ref{Test Selectors}, which also explains how +to run only some specific part of the tests. ERT will pop up a new buffer, the ERT results buffer, showing the results of the tests run. It looks like this: @@ -474,7 +477,7 @@ to Common Lisp's type specifier syntax: @item @code{:failed} and @code{:passed} select tests according to their most recent result. @item @code{:expected}, @code{:unexpected} select tests according to their most recent result. @item A string is a regular expression that selects all tests with matching names. -@item A test (i.e., an object of @code{ert-test} data type) selects that test. +@item A test (i.e., an object of @code{ert-test} data type, see its doc string for details) selects that test. @item A symbol selects the test that the symbol names. @item @code{(member @var{tests}...)} selects the elements of @var{tests}, a list of tests or symbols naming tests. diff --git a/lisp/emacs-lisp/ert.el b/lisp/emacs-lisp/ert.el index 6a665c8181d..2d96e5ce5a9 100644 --- a/lisp/emacs-lisp/ert.el +++ b/lisp/emacs-lisp/ert.el @@ -932,14 +932,14 @@ of tests, or t, which refers to all tests named by symbols in `obarray'. Valid SELECTORs: nil -- Selects the empty set. -t -- Selects UNIVERSE. +t -- Selects all of UNIVERSE. If UNIVERSE is t, selects all tests. :new -- Selects all tests that have not been run yet. :failed, :passed -- Select tests according to their most recent result. :expected, :unexpected -- Select tests according to their most recent result. a string -- A regular expression selecting all tests with matching names. -a test -- (i.e., an object of the ert-test data-type) Selects that test. -a symbol -- Selects the test that the symbol names, signals an - `ert-test-unbound' error if none. +a test -- (i.e., an object of the `ert-test' data-type) Selects that test. +a symbol -- Selects the test named by the symbol, signals an + `ert-test-unbound' error if no such test. \(member TESTS...) -- Selects the elements of TESTS, a list of tests or symbols naming tests. \(eql TEST) -- Selects TEST, a test or a symbol naming a test. @@ -1375,10 +1375,10 @@ RESULT must be an `ert-test-result-with-condition'." (defun ert-run-tests-batch (&optional selector) "Run the tests specified by SELECTOR, printing results to the terminal. -SELECTOR works as described in `ert-select-tests', except if -SELECTOR is nil, in which case all tests rather than none will be -run; this makes the command line \"emacs -batch -l my-tests.el -f -ert-run-tests-batch-and-exit\" useful. +SELECTOR selects which tests to run as described in `ert-select-tests' when +called with its second argument t, except if SELECTOR is nil, in which case +all tests rather than none will be run; this makes the command line + \"emacs -batch -l my-tests.el -f ert-run-tests-batch-and-exit\" useful. Returns the stats object." (unless selector (setq selector 't)) @@ -2240,7 +2240,9 @@ STATS is the stats object; LISTENER is the results listener." (defun ert-run-tests-interactively (selector) "Run the tests specified by SELECTOR and display the results in a buffer. -SELECTOR works as described in `ert-select-tests'." +SELECTOR selects which tests to run as described in `ert-select-tests' +when called with its second argument t. Interactively, prompt for +SELECTOR; the default t means run all the defined tests." (interactive (list (let ((default (if ert--selector-history ;; Can't use `first' here as this form is commit 7b60a2532895ebda2db2798767cbaff049032edb Author: Spencer Baugh Date: Fri Aug 2 12:15:58 2024 -0400 Fix 'partial-completion' for candidates containing newlines 'partial-completion' tries to match a pattern containing wildcards (such as `any' or `prefix') against completion candidates. Wildcards are supposed to match any sequence of characters, but 'completion-pcm--pattern->regex' transformed the wildcards into ".*", which won't match sequences containing newlines. Fix this to properly match anything by using "[^z-a]*" instead. (That's (rx (* anything)).) * lisp/minibuffer.el (completion-pcm--pattern->regex): Fix regex. (Bug#72425) diff --git a/lisp/minibuffer.el b/lisp/minibuffer.el index bef565378ea..3beb3c06a18 100644 --- a/lisp/minibuffer.el +++ b/lisp/minibuffer.el @@ -3948,7 +3948,7 @@ or a symbol, see `completion-pcm--merge-completions'." (t (let ((re (if (eq x 'any-delim) (concat completion-pcm--delim-wild-regex "*?") - ".*?"))) + "[^z-a]*?"))) (if (if (consp group) (memq x group) group) (concat "\\(" re "\\)") re))))) commit ed8904937ece766da57777f8a8435f5b0c95270c Author: Visuwesh Date: Wed Aug 14 08:07:15 2024 +0530 Disambiguate minor-mode variable in its function docstring * lisp/emacs-lisp/easy-mmode.el (easy-mmode--arg-docstring) (easy-mmode--mode-docstring): Add "the variable" before the GETTER if it is a symbol to properly link to minor-mode variable in the *Help* buffer in the common case. (bug#72405) diff --git a/lisp/emacs-lisp/easy-mmode.el b/lisp/emacs-lisp/easy-mmode.el index 944a74a91ee..a140027839e 100644 --- a/lisp/emacs-lisp/easy-mmode.el +++ b/lisp/emacs-lisp/easy-mmode.el @@ -91,7 +91,7 @@ Enable the mode if ARG is nil, omitted, or is a positive number. Disable the mode if ARG is a negative number. To check whether the minor mode is enabled in the current buffer, -evaluate `%s'. +evaluate %s. The mode's hook is called both when the mode is enabled and when it is disabled.") @@ -128,8 +128,11 @@ it is disabled.") easy-mmode--arg-docstring (if global "global " "") mode-pretty-name - ;; Avoid having quotes turn into pretty quotes. - (string-replace "'" "\\='" (format "%S" getter))))) + (concat + (if (symbolp getter) "the variable ") + (format "`%s'" + ;; Avoid having quotes turn into pretty quotes. + (string-replace "'" "\\='" (format "%S" getter))))))) (let ((start (point))) (insert argdoc) (when (fboundp 'fill-region) ;Don't break bootstrap! commit 62067d2ae7563352cae4eedd4b784fc0ffcd78a3 Author: Ulrich Müller Date: Thu Aug 15 09:28:48 2024 +0200 ; * etc/NEWS: Update wording of last change diff --git a/etc/NEWS b/etc/NEWS index 0db5c74956d..400d28c9b7c 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -264,7 +264,8 @@ its argument lacks explicit time zone information. This has been the de-facto behavior since Emacs 24 although documentation said otherwise. Also, the fallback on 'timezone-make-date-arpa-standard' has been removed because its supported date styles can be handled by -'parse-time-string'. +'parse-time-string'. To restore the previously documented behavior, +specify "+0000" or "Z" as the time zone in the argument. * Changes in Emacs 31.1 on Non-Free Operating Systems commit 49e7f1b92daaaa12e42de93d1f7604ae0a1bbeaa Author: Ulrich Müller Date: Wed Aug 14 13:57:16 2024 +0200 Drop fallback code in date-to-time, update documentation * lisp/calendar/time-date.el (date-to-time): Drop fallback code. Document that the default timezone is local time, rather than GMT. * test/lisp/calendar/time-date-tests.el (test-date-to-time): Add more test cases. * doc/lispref/os.texi (Time Parsing): Document that 'date-to-time' defaults to local time. * etc/NEWS: Announce the change. (Bug#72570) diff --git a/doc/lispref/os.texi b/doc/lispref/os.texi index 5839de4a650..ddaa1de221c 100644 --- a/doc/lispref/os.texi +++ b/doc/lispref/os.texi @@ -1788,8 +1788,8 @@ Conversion}). This function parses the time-string @var{string} and returns the corresponding Lisp timestamp. The argument @var{string} should represent a date-time, and should be in one of the forms recognized by -@code{parse-time-string} (see below). This function assumes Universal -Time if @var{string} lacks explicit time zone information, +@code{parse-time-string} (see below). This function assumes local time +if @var{string} lacks explicit time zone information, and assumes earliest values if @var{string} lacks month, day, or time. The operating system limits the range of time and zone values. @end defun diff --git a/etc/NEWS b/etc/NEWS index b89a80aa14d..0db5c74956d 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -257,6 +257,15 @@ language A. If supplied, 'string-pixel-width' will use any face remappings from BUFFER when computing the string's width. ++++ +** 'date-to-time' now defaults to local time +The function now assumes local time instead of Universal Time when +its argument lacks explicit time zone information. This has been the +de-facto behavior since Emacs 24 although documentation said otherwise. +Also, the fallback on 'timezone-make-date-arpa-standard' has been +removed because its supported date styles can be handled by +'parse-time-string'. + * Changes in Emacs 31.1 on Non-Free Operating Systems diff --git a/lisp/calendar/time-date.el b/lisp/calendar/time-date.el index b441974b943..9a2fb45e3bc 100644 --- a/lisp/calendar/time-date.el +++ b/lisp/calendar/time-date.el @@ -145,14 +145,10 @@ it is assumed that PICO was omitted and should be treated as zero." (autoload 'timezone-make-date-arpa-standard "timezone") ;;;###autoload -;; `parse-time-string' isn't sufficiently general or robust. It fails -;; to grok some of the formats that timezone does (e.g. dodgy -;; post-2000 stuff from some Elms) and either fails or returns bogus -;; values. timezone-make-date-arpa-standard should help. (defun date-to-time (date) "Parse a string DATE that represents a date-time and return a time value. DATE should be in one of the forms recognized by `parse-time-string'. -If DATE lacks timezone information, GMT is assumed." +If DATE lacks time zone information, local time is assumed." (condition-case err ;; Parse DATE. If it contains a year, use defaults for other components. ;; Then encode the result; this signals an error if the year is missing, @@ -164,16 +160,9 @@ If DATE lacks timezone information, GMT is assumed." (decoded-time-set-defaults parsed)) (encode-time parsed)) (error - (let ((overflow-error '(error "Specified time is not representable"))) - (if (equal err overflow-error) - (signal (car err) (cdr err)) - (condition-case err - (encode-time (parse-time-string - (timezone-make-date-arpa-standard date))) - (error - (if (equal err overflow-error) - (signal (car err) (cdr err)) - (error "Invalid date: %s" date))))))))) + (if (equal err '(error "Specified time is not representable")) + (signal (car err) (cdr err)) + (error "Invalid date: %s" date))))) ;;;###autoload (defalias 'time-to-seconds #'float-time) diff --git a/test/lisp/calendar/time-date-tests.el b/test/lisp/calendar/time-date-tests.el index 6512dd0bd07..f8e434e17b1 100644 --- a/test/lisp/calendar/time-date-tests.el +++ b/test/lisp/calendar/time-date-tests.el @@ -42,8 +42,28 @@ '(1 2 3 4)))) (ert-deftest test-date-to-time () - (should (equal (format-time-string "%F %T" (date-to-time "2021-12-04")) - "2021-12-04 00:00:00"))) + (let ((date-list + '(("2021-12-04" (00 00 00 04 12 2021 nil -1 nil)) + ("2006-05-04T03:02:01Z" (01 02 03 04 05 2006 nil nil 0)) + ;; Test cases from timezone-parse-date docstring + ("14 Apr 89 03:20" (00 20 03 14 04 1989 nil -1 nil)) + ("14 Apr 89 03:20:12 GMT" (12 20 03 14 04 1989 nil nil 0)) + ("Fri, 17 Mar 89 4:01" (00 01 04 17 03 1989 nil -1 nil)) + ("Fri, 17 Mar 89 4:01:33 GMT" (33 01 04 17 03 1989 nil nil 0)) + ("Mon Jan 16 16:12 1989" (00 12 16 16 01 1989 nil -1 nil)) + ("Mon Jan 16 16:12:37 GMT 1989" (37 12 16 16 01 1989 nil nil 0)) + ("Thu, 11 Apr 16:17:12 91" (12 17 16 11 04 1991 nil -1 nil)) + ("Mon, 6 Jul 16:47:20 T 1992" (20 47 16 06 07 1992 nil -1 nil)) + ("1996-06-24 21:13:12" (12 13 21 24 06 1996 nil -1 nil)) + ("19960624t211312" (12 13 21 24 06 1996 nil -1 nil)) + ;; These are parsed incorrectly: + ;; "6 May 1992 1641-JST (Wednesday)" + ;; "22-AUG-1993 10:59:12.82" + ;; "1996-06-24 21:13-ZONE" + ))) + (dolist (date date-list) + (should (equal (date-to-time (car date)) + (encode-time (cadr date))))))) (ert-deftest test-days-between () (should (equal (days-between "2021-10-22" "2020-09-29") 388))) commit 2533a60e4256336eb30786a555a8922326c49a8a Author: Paul Eggert Date: Wed Aug 14 20:37:12 2024 -0700 * lisp/calendar/time-date.el: Add comment. diff --git a/lisp/calendar/time-date.el b/lisp/calendar/time-date.el index eca80f1e8b6..b441974b943 100644 --- a/lisp/calendar/time-date.el +++ b/lisp/calendar/time-date.el @@ -154,6 +154,11 @@ it is assumed that PICO was omitted and should be treated as zero." DATE should be in one of the forms recognized by `parse-time-string'. If DATE lacks timezone information, GMT is assumed." (condition-case err + ;; Parse DATE. If it contains a year, use defaults for other components. + ;; Then encode the result; this signals an error if the year is missing, + ;; because encode-time signals if crucial time components are nil. + ;; This heuristic uses local time if the string lacks time zone info, + ;; because encode-time treats a nil time zone as local time. (let ((parsed (parse-time-string date))) (when (decoded-time-year parsed) (decoded-time-set-defaults parsed)) commit 505139e0bad92cd44774b0002585ae1212df11a6 Author: Arash Esbati Date: Sun Aug 11 21:28:43 2024 +0200 Fix project-dired keybinding in manual * doc/emacs/maintaining.texi (Project File Commands): Fix the keybinding for `project-dired'. (Bug#72581) diff --git a/doc/emacs/maintaining.texi b/doc/emacs/maintaining.texi index f4752fa2b29..3c34afbaa20 100644 --- a/doc/emacs/maintaining.texi +++ b/doc/emacs/maintaining.texi @@ -1829,7 +1829,7 @@ the current project. @item C-x p r Perform query-replace for a regexp in all files that belong to the current project (@code{project-query-replace-regexp}). -@item C-x p d +@item C-x p D Run Dired in the current project's root directory (@code{project-dired}). @item C-x p v commit 9bedb957bebdca99b1bb96f58ea790e20ed48dee Author: Eli Zaretskii Date: Wed Aug 14 11:35:48 2024 +0300 Improve documentation of time-parsing functions * doc/lispref/os.texi (Time Parsing): * lisp/calendar/iso8601.el (iso8601-parse): * lisp/calendar/parse-time.el (parse-time-string): Document that these functions don't care about the distinction between local time and UTC. (Bug#72570) diff --git a/doc/lispref/os.texi b/doc/lispref/os.texi index 3ba3da459bf..3ab4b66ba30 100644 --- a/doc/lispref/os.texi +++ b/doc/lispref/os.texi @@ -1800,19 +1800,51 @@ structure (@pxref{Time Conversion}). The argument @var{string} should resemble an RFC 822 (or later) or ISO 8601 string, like ``Fri, 25 Mar 2016 16:24:56 +0100'' or ``1998-09-12T12:21:54-0200'', but this function will attempt to parse less well-formed time strings as well. + +Note that, unlike @code{decode-time} (@pxref{Time Conversion}), this +function does not interpret the time string, and in particular the +values of daylight-saving and timezone or UTC offset parts of the +@var{string} argument do not affect the returned value of date and time, +they only affect the last two members of the returned decoded time +structure. For example, if the time-zone information is present in +@var{string}, the decoded time structure will include it; otherwise the +time-zone member of the returned value will be @code{nil}. In other +words, this function simply parses the textual representation of date +and time into separate numerical values, and doesn't care whether the +input time is local or UTC. + +If a Lisp program passes the return value of this function to some other +time-related API, it should make sure the @code{nil} members of the +decoded time structure are interpreted correctly, and in particular the +lack of time-zone information is interpreted as UTC or local time, +according to the needs of the calling program. @end defun @vindex ISO 8601 date/time strings @defun iso8601-parse string For a more strict function (that will error out upon invalid input), -this function can be used instead. It can parse all variants of -the ISO 8601 standard, so in addition to the formats mentioned above, -it also parses things like ``1998W45-3'' (week number) and -``1998-245'' (ordinal day number). To parse durations, there's +Lisp programs can use this function instead. It can parse all variants +of the ISO 8601 standard, so in addition to the formats mentioned above, +it also parses things like ``1998W45-3'' (week number) and ``1998-245'' +(ordinal day number). To parse durations, there's @code{iso8601-parse-duration}, and to parse intervals, there's -@code{iso8601-parse-interval}. All these functions return decoded -time structures, except the final one, which returns three of them -(the start, the end, and the duration). +@code{iso8601-parse-interval}. All these functions return decoded time +structures, except the final one, which returns three of them (the +start, the end, and the duration). + +Like @code{parse-time-string}, this function does not interpret the time +string, and in particular the time-zone designator or UTC offset that is +part of the @var{string} argument does not affect the returned value of +date and time, it only affects the last two members of the returned +decoded time structure. The ISO 8601 standard specifies that date/time +strings that do not include information about UTC relation are assumed +to be in local time, but this function does not do that, because it +doesn't interpret the time values. For example, if the time-zone +information is present in @var{string}, the decoded time structure will +include it; otherwise the time-zone member of the returned value will be +@code{nil}. In other words, this function simply parses the textual +representation of date and time into separate numerical values, and +doesn't care whether the input time is local or UTC. @end defun @defun format-time-string format-string &optional time zone diff --git a/lisp/calendar/iso8601.el b/lisp/calendar/iso8601.el index a32b52564c9..bb319d54c8c 100644 --- a/lisp/calendar/iso8601.el +++ b/lisp/calendar/iso8601.el @@ -122,10 +122,18 @@ (defun iso8601-parse (string &optional form) "Parse an ISO 8601 date/time string and return a `decode-time' structure. -The ISO 8601 date/time strings look like \"2008-03-02T13:47:30\", +The ISO 8601 date/time strings look like \"2008-03-02T13:47:30\" +or \"2024-04-05T14:30Z\" or \"2024-04-05T12:30−02:00\", but shorter, incomplete strings like \"2008-03-02\" are valid, as well as variants like \"2008W32\" (week number) and \"2008-234\" (ordinal day number). +Note that, unlike `decode-time', this function does not interpret +the time string, and in particular the time-zone designator or UTC +offset that is part of STRING does not affect the returned value of +date and time, it only affects the last two members of the returned +value. This function simply parses the textual representation of +date and time into separate numerical values, and doesn't care +whether the time is local or UTC. See `decode-time' for the meaning of FORM." (if (not (iso8601-valid-p string)) diff --git a/lisp/calendar/parse-time.el b/lisp/calendar/parse-time.el index c34329a4002..f6fc7a8c162 100644 --- a/lisp/calendar/parse-time.el +++ b/lisp/calendar/parse-time.el @@ -157,6 +157,12 @@ return a \"likely\" value even for somewhat malformed strings. The values returned are identical to those of `decode-time', but any unknown values other than DST are returned as nil, and an unknown DST value is returned as -1. +Note that, unlike `decode-time', this function does not interpret +the time string, and in particular the values of DST and TZ do not +affect the returned value of date and time, they only affect the +last two members of the returned value. This function simply +parses the textual representation of date and time into separate +numerical values, and doesn't care whether the time is local or UTC. See `decode-time' for the meaning of FORM." (condition-case () commit 7c588a00655f70d4a6405642a384f34a6478628d Author: Michael Albinus Date: Wed Aug 14 09:47:59 2024 +0200 ; Backport gitlab-ci.yml from master (don't merge) * test/infra/gitlab-ci.yml (.job-template): Remove cache:policy. (.build-template, .test-template): Add job specific cache:policy. (.tree-sitter-template): Adapt changes. diff --git a/test/infra/gitlab-ci.yml b/test/infra/gitlab-ci.yml index e5e48b76ec2..24bb179af54 100644 --- a/test/infra/gitlab-ci.yml +++ b/test/infra/gitlab-ci.yml @@ -75,7 +75,6 @@ default: cache: key: ${CI_COMMIT_SHA} paths: [] - policy: pull-push # These will be saved for followup builds. artifacts: expire_in: 24 hrs @@ -83,8 +82,6 @@ default: # Using the variables for each job. script: - docker pull ${CI_REGISTRY_IMAGE}:${target}-${BUILD_TAG} - # TODO: with make -j4 several of the tests were failing, for - # example shadowfile-tests, but passed without it. - 'export PWD=$(pwd)' - 'docker run -i -e EMACS_EMBA_CI=${EMACS_EMBA_CI} -e EMACS_TEST_JUNIT_REPORT=${EMACS_TEST_JUNIT_REPORT} -e EMACS_TEST_TIMEOUT=${EMACS_TEST_TIMEOUT} -e EMACS_TEST_VERBOSE=${EMACS_TEST_VERBOSE} -e NPROC=`nproc` --volumes-from $(docker ps -q -f "label=com.gitlab.gitlab-runner.job.id=${CI_JOB_ID}"):ro --name ${test_name} ${CI_REGISTRY_IMAGE}:${target}-${BUILD_TAG} /bin/bash -xvc "git fetch ${PWD} HEAD && echo checking out these updated files && git diff --name-only FETCH_HEAD && ( git diff --name-only FETCH_HEAD | xargs git checkout -f FETCH_HEAD ) && make -j \$NPROC && make -k -j \$NPROC ${make_params}"' after_script: @@ -101,6 +98,8 @@ default: .build-template: needs: [] + cache: + policy: push rules: - if: '$CI_PIPELINE_SOURCE == "web"' when: always @@ -131,6 +130,8 @@ default: - docker push ${CI_REGISTRY_IMAGE}:${target}-${BUILD_TAG} .test-template: + cache: + policy: pull artifacts: name: ${test_name} public: true @@ -183,14 +184,18 @@ default: - if: '$CI_PIPELINE_SOURCE == "schedule"' changes: - "**.in" + - lisp/align.el - lisp/progmodes/*-ts-mode.el + - lisp/progmodes/csharp-mode.el - lisp/progmodes/js.el - lisp/progmodes/python.el - lisp/textmodes/*-ts-mode.el - src/treesit.{h,c} - test/infra/* + - test/lisp/align-tests.el - test/lisp/progmodes/*-ts-mode-resources/** - test/lisp/progmodes/*-ts-mode-tests.el + - test/lisp/progmodes/csharp-mode-tests.el - test/lisp/progmodes/js-tests.el - test/lisp/progmodes/python-tests.el - test/lisp/textmodes/*-ts-mode-resources/** commit c0ccb18d258c3134ac46125b676b676704a3dd00 Author: Michael Albinus Date: Wed Aug 14 09:34:52 2024 +0200 Tag treesit-indirect-buffer as :unstable * test/src/treesit-tests.el (treesit-indirect-buffer): Tag it as :unstable on emba. diff --git a/test/src/treesit-tests.el b/test/src/treesit-tests.el index 3431ba5f4dd..30b15a3c0ce 100644 --- a/test/src/treesit-tests.el +++ b/test/src/treesit-tests.el @@ -190,6 +190,7 @@ (ert-deftest treesit-indirect-buffer () "Tests for indirect buffers." + :tags (if (getenv "EMACS_EMBA_CI") '(:unstable)) (skip-unless (treesit-language-available-p 'json)) (let ((base (get-buffer-create "*treesit test*")) parser indirect) commit 4589f51c21df3a07e1c5b46897608c344df73e68 Author: Dmitry Gutov Date: Tue Aug 13 15:14:18 2024 +0300 (project-find-regexp): Fix the temporary value of DEFAULT-DIRECTORY * lisp/progmodes/project.el (project-find-regexp): Make sure the assigned value of DEFAULT-DIRECTORY ends with a slash. read-directory-name returns the name without it in certain cases. diff --git a/lisp/progmodes/project.el b/lisp/progmodes/project.el index b7c1698f50b..c38d3f0048a 100644 --- a/lisp/progmodes/project.el +++ b/lisp/progmodes/project.el @@ -1001,7 +1001,7 @@ requires quoting, e.g. `\\[quoted-insert]'." (project-files pr) (let* ((dir (read-directory-name "Base directory: " caller-dir nil t))) - (setq default-directory dir) + (setq default-directory (file-name-as-directory dir)) (project--files-in-directory dir nil (grep-read-files regexp)))))) commit 632e6c27a89da9a2386ce1b29e433fe29a16e710 Author: Michael Albinus Date: Tue Aug 13 11:08:39 2024 +0200 * test/infra/gitlab-ci.yml (.tree-sitter-template): Adapt changes. diff --git a/test/infra/gitlab-ci.yml b/test/infra/gitlab-ci.yml index e750e3a9ba7..24bb179af54 100644 --- a/test/infra/gitlab-ci.yml +++ b/test/infra/gitlab-ci.yml @@ -82,8 +82,6 @@ default: # Using the variables for each job. script: - docker pull ${CI_REGISTRY_IMAGE}:${target}-${BUILD_TAG} - # TODO: with make -j4 several of the tests were failing, for - # example shadowfile-tests, but passed without it. - 'export PWD=$(pwd)' - 'docker run -i -e EMACS_EMBA_CI=${EMACS_EMBA_CI} -e EMACS_TEST_JUNIT_REPORT=${EMACS_TEST_JUNIT_REPORT} -e EMACS_TEST_TIMEOUT=${EMACS_TEST_TIMEOUT} -e EMACS_TEST_VERBOSE=${EMACS_TEST_VERBOSE} -e NPROC=`nproc` --volumes-from $(docker ps -q -f "label=com.gitlab.gitlab-runner.job.id=${CI_JOB_ID}"):ro --name ${test_name} ${CI_REGISTRY_IMAGE}:${target}-${BUILD_TAG} /bin/bash -xvc "git fetch ${PWD} HEAD && echo checking out these updated files && git diff --name-only FETCH_HEAD && ( git diff --name-only FETCH_HEAD | xargs git checkout -f FETCH_HEAD ) && make -j \$NPROC && make -k -j \$NPROC ${make_params}"' after_script: @@ -186,14 +184,18 @@ default: - if: '$CI_PIPELINE_SOURCE == "schedule"' changes: - "**.in" + - lisp/align.el - lisp/progmodes/*-ts-mode.el + - lisp/progmodes/csharp-mode.el - lisp/progmodes/js.el - lisp/progmodes/python.el - lisp/textmodes/*-ts-mode.el - src/treesit.{h,c} - test/infra/* + - test/lisp/align-tests.el - test/lisp/progmodes/*-ts-mode-resources/** - test/lisp/progmodes/*-ts-mode-tests.el + - test/lisp/progmodes/csharp-mode-tests.el - test/lisp/progmodes/js-tests.el - test/lisp/progmodes/python-tests.el - test/lisp/textmodes/*-ts-mode-resources/** commit 616a93d185a9dc394ac9dcea2556060258c4276a Author: Michael Albinus Date: Tue Aug 13 09:19:00 2024 +0200 Tag test in typescript-ts-mode-tests.el as unstable * test/lisp/progmodes/typescript-ts-mode-tests.el (typescript-ts-mode-test-indentation): Tag it as :unstable on emba. diff --git a/test/lisp/progmodes/typescript-ts-mode-tests.el b/test/lisp/progmodes/typescript-ts-mode-tests.el index effd9551fb0..4771bee5f27 100644 --- a/test/lisp/progmodes/typescript-ts-mode-tests.el +++ b/test/lisp/progmodes/typescript-ts-mode-tests.el @@ -24,6 +24,7 @@ (require 'treesit) (ert-deftest typescript-ts-mode-test-indentation () + :tags (if (getenv "EMACS_EMBA_CI") '(:unstable)) (skip-unless (and (treesit-ready-p 'typescript) (treesit-ready-p 'tsx))) (ert-test-erts-file (ert-resource-file "indent.erts"))) commit e9e7e3908ab5db1b8f097d47f763309cc3814e91 Author: Eli Zaretskii Date: Tue Aug 13 05:27:08 2024 +0300 ; * lisp/files.el (require-with-check): Fix last change. diff --git a/lisp/files.el b/lisp/files.el index dc796fffaa1..eadb4a9d0b1 100644 --- a/lisp/files.el +++ b/lisp/files.el @@ -1275,7 +1275,8 @@ NOERROR is equal to `reload'), or otherwise emit a warning." ((assoc fn load-history) nil) ;We loaded the right file. ((eq noerror 'reload) (load fn nil 'nomessage)) (t (funcall (if noerror #'warn #'error) - "Feature `%S' is now provided by a different file %s" fn))))) + "Feature `%S' is now provided by a different file %s" + feature fn))))) res)) (defun file-remote-p (file &optional identification connected) commit 6533fd65b6f187af5fe7202fc4ab344cc3df4cb1 Merge: cd66b848128 b585826a65e Author: Po Lu Date: Tue Aug 13 09:12:30 2024 +0800 Merge from savannah/emacs-30 b585826a65e ; * lisp/files.el (require-with-check): Fix doc string an... 6d55e94996e macOS: Wrong frame rectangle after wake (bug#71912) c49724b9649 ; Grammar fixes 5c3d340e001 Fix format 2 cmap handling in sfnt.c commit cd66b848128a4cc4dbb1958d23ed023c9fad69ef Merge: 7a828c938ca 8e925d582ad Author: Po Lu Date: Tue Aug 13 09:12:30 2024 +0800 ; Merge from savannah/emacs-30 The following commit was skipped: 8e925d582ad Fix coordinate transformations in sfnt.c commit 7a828c938ca9daf37baa02a50bb6463e2b7c0b85 Author: Paul Eggert Date: Mon Aug 12 14:31:19 2024 -0700 Document time-parsing functions a bit better See diff --git a/doc/lispref/os.texi b/doc/lispref/os.texi index 3ba3da459bf..5839de4a650 100644 --- a/doc/lispref/os.texi +++ b/doc/lispref/os.texi @@ -1800,19 +1800,31 @@ structure (@pxref{Time Conversion}). The argument @var{string} should resemble an RFC 822 (or later) or ISO 8601 string, like ``Fri, 25 Mar 2016 16:24:56 +0100'' or ``1998-09-12T12:21:54-0200'', but this function will attempt to parse less well-formed time strings as well. +It parses an incomplete string like ``2024-08-13'' to an incomplete +structure like @samp{(nil nil nil 13 8 2024 nil -1 nil)}, in which +an unknown DST value is @minus{}1 and other unknown values are @code{nil}. @end defun @vindex ISO 8601 date/time strings @defun iso8601-parse string -For a more strict function (that will error out upon invalid input), -this function can be used instead. It can parse all variants of +This function acts like @code{parse-time-string} except it is stricter +and errors out upon invalid input. It can parse all variants of the ISO 8601 standard, so in addition to the formats mentioned above, it also parses things like ``1998W45-3'' (week number) and -``1998-245'' (ordinal day number). To parse durations, there's -@code{iso8601-parse-duration}, and to parse intervals, there's -@code{iso8601-parse-interval}. All these functions return decoded -time structures, except the final one, which returns three of them -(the start, the end, and the duration). +``1998-245'' (ordinal day number). +@end defun + +@defun iso8601-parse-duration string +This function parses an ISO 8601 time duration @var{string} +and returns a decoded time structure. +@c FIXME: example? behavior on incomplete input? +@end defun + +@defun iso8601-parse-interval string +This function parses an ISO 8601 time interval @var{string} +and returns three decoded time structures +representing the start, the end, and the duration. +@c FIXME: example? behavior on incomplete input? @end defun @defun format-time-string format-string &optional time zone diff --git a/lisp/calendar/iso8601.el b/lisp/calendar/iso8601.el index a32b52564c9..a31b60eaec2 100644 --- a/lisp/calendar/iso8601.el +++ b/lisp/calendar/iso8601.el @@ -121,11 +121,11 @@ (defun iso8601-parse (string &optional form) "Parse an ISO 8601 date/time string and return a `decode-time' structure. - -The ISO 8601 date/time strings look like \"2008-03-02T13:47:30\", -but shorter, incomplete strings like \"2008-03-02\" are valid, as -well as variants like \"2008W32\" (week number) and -\"2008-234\" (ordinal day number). +ISO 8601 date/time strings look like \"2008-03-02T13:47:30+05:30\", +or like shorter, incomplete strings like date \"2008-03-02\", +week number \"2008W32\", and ordinal day number \"2008-234\". +Values returned are identical to those of `decode-time', except +that an unknown DST value is -1 and other unknown values are nil. See `decode-time' for the meaning of FORM." (if (not (iso8601-valid-p string)) diff --git a/lisp/calendar/parse-time.el b/lisp/calendar/parse-time.el index c34329a4002..9538ea92ee5 100644 --- a/lisp/calendar/parse-time.el +++ b/lisp/calendar/parse-time.el @@ -154,9 +154,8 @@ or something resembling an RFC 822 (or later) date-time, e.g., \"Wed, 15 Jan 2020 16:12:21 -0800\". This function is somewhat liberal in what format it accepts, and will attempt to return a \"likely\" value even for somewhat malformed strings. -The values returned are identical to those of `decode-time', but -any unknown values other than DST are returned as nil, and an -unknown DST value is returned as -1. +Values returned are identical to those of `decode-time', except +that an unknown DST value is -1 and other unknown values are nil. See `decode-time' for the meaning of FORM." (condition-case () commit b585826a65ebfb58d3fe4744f0f8f9b5f3fc08cc Author: Eli Zaretskii Date: Mon Aug 12 21:38:46 2024 +0300 ; * lisp/files.el (require-with-check): Fix doc string and error text. diff --git a/lisp/files.el b/lisp/files.el index 73ad85ce854..dc796fffaa1 100644 --- a/lisp/files.el +++ b/lisp/files.el @@ -1258,11 +1258,11 @@ See `load-file' for a different interface to `load'." (defun require-with-check (feature &optional filename noerror) "If FEATURE is not already loaded, load it from FILENAME. This is like `require' except if FEATURE is already a member of the list -`features’, then we check if this was provided by a different file than the -one that we would load now (presumably because `load-path' has been -changed since the file was loaded). -If it's the case, we either signal an error (the default), or forcibly reload -the new file (if NOERROR is equal to `reload'), or otherwise emit a warning." +`features’, then check if it was provided by a different file than the +one that is about to be loaded now (presumably because `load-path' has +been changed since FILENAME was loaded). If that is the case, either +signal an error (the default), or forcibly reload the new file (if +NOERROR is equal to `reload'), or otherwise emit a warning." (let ((lh load-history) (res (require feature filename (if (eq noerror 'reload) nil noerror)))) ;; If the `feature' was not yet provided, `require' just loaded the right @@ -1275,7 +1275,7 @@ the new file (if NOERROR is equal to `reload'), or otherwise emit a warning." ((assoc fn load-history) nil) ;We loaded the right file. ((eq noerror 'reload) (load fn nil 'nomessage)) (t (funcall (if noerror #'warn #'error) - "Feature provided by other file: %S" feature))))) + "Feature `%S' is now provided by a different file %s" fn))))) res)) (defun file-remote-p (file &optional identification connected) commit 5d69e2916458148159d7f21257f3c4863b868690 Author: Po Lu Date: Mon Aug 12 20:44:27 2024 +0800 Remove extraneous entries for `han' from script-representative-chars * lisp/international/fontset.el (script-representative-chars): Remove characters that are either Kana, obsolete, or radicals, which interferes with the discovery of real Chinese fonts, and does not impact font resolution on free systems with Fontconfig. diff --git a/lisp/international/fontset.el b/lisp/international/fontset.el index a4456d31cf9..f0f6c8070ac 100644 --- a/lisp/international/fontset.el +++ b/lisp/international/fontset.el @@ -209,7 +209,7 @@ (kana #x304B) (bopomofo #x3105) (kanbun #x319D) - (han #x2e90 #x2f00 #x3200 #x3300 #x3400 #x4e10 #x5B57 #xfe30 #xf900) + (han #x3200 #x4e10 #x5B57 #xfe30 #xf900) (yi #xA288) (syloti-nagri #xA807 #xA823 #xA82C) (rejang #xA930 #xA947 #xA95F) commit 02c5ce7c92f327d2dfb6117cd6788b53106a25e0 Author: Michael Albinus Date: Mon Aug 12 09:51:50 2024 +0200 Adapt cache settings on emba. * test/infra/gitlab-ci.yml (.job-template): Remove cache:policy. (.gnustep-template, .filenotify-gio-template, .eglot-template) (.tree-sitter-template, .native-comp-template): Remove cache. diff --git a/test/infra/gitlab-ci.yml b/test/infra/gitlab-ci.yml index 8c0cf706a77..e750e3a9ba7 100644 --- a/test/infra/gitlab-ci.yml +++ b/test/infra/gitlab-ci.yml @@ -75,7 +75,6 @@ default: cache: key: ${CI_COMMIT_SHA} paths: [] - policy: pull-push # These will be saved for followup builds. artifacts: expire_in: 24 hrs @@ -146,8 +145,6 @@ default: junit: ${test_name}/${EMACS_TEST_JUNIT_REPORT} .gnustep-template: - cache: - key: gnustep-${CI_COMMIT_SHA} rules: - if: '$CI_PIPELINE_SOURCE == "web"' - if: '$CI_PIPELINE_SOURCE == "schedule"' @@ -160,8 +157,6 @@ default: - test/infra/* .filenotify-gio-template: - cache: - key: filenotify-gio-${CI_COMMIT_SHA} rules: - if: '$CI_PIPELINE_SOURCE == "web"' # - if: '$CI_PIPELINE_SOURCE == "schedule"' @@ -176,8 +171,6 @@ default: - test/lisp/filenotify-tests.el .eglot-template: - cache: - key: eglot-${CI_COMMIT_SHA} rules: - if: '$CI_PIPELINE_SOURCE == "web"' - if: '$CI_PIPELINE_SOURCE == "schedule"' @@ -188,8 +181,6 @@ default: - test/lisp/progmodes/eglot-tests.el .tree-sitter-template: - cache: - key: tree-sitter-${CI_COMMIT_SHA} rules: - if: '$CI_PIPELINE_SOURCE == "web"' - if: '$CI_PIPELINE_SOURCE == "schedule"' @@ -210,8 +201,6 @@ default: - test/src/treesit-tests.el .native-comp-template: - cache: - key: native-comp-${CI_COMMIT_SHA} rules: - if: '$CI_PIPELINE_SOURCE == "web"' - if: '$CI_PIPELINE_SOURCE == "schedule"' commit 6d55e94996ef2603a2c1cc2e956ac36bdbb69ba6 Author: Gerd Möllmann Date: Sun Aug 11 13:22:45 2024 +0200 macOS: Wrong frame rectangle after wake (bug#71912) * src/nsterm.m ([EmacsView windowDidBecomeKey]): Call adjustEmacsFrameRect. diff --git a/src/nsterm.m b/src/nsterm.m index 905707dace4..97b829d0e4c 100644 --- a/src/nsterm.m +++ b/src/nsterm.m @@ -7968,6 +7968,7 @@ - (void)windowDidBecomeKey /* for direct calls */ dpyinfo->ns_focus_frame = emacsframe; ns_frame_rehighlight (emacsframe); + [self adjustEmacsFrameRect]; event.kind = FOCUS_IN_EVENT; XSETFRAME (event.frame_or_window, emacsframe); commit c49724b96493dc557abcc9014165364d2d624222 Author: Po Lu Date: Mon Aug 12 08:10:36 2024 +0800 ; Grammar fixes * doc/misc/erc.texi (Connecting): * lisp/erc/erc.el (erc-compute-server, erc-compute-nick) (erc-compute-full-name, erc-compute-port): Replace "a number of increasingly more" with an alternative more grammatical. diff --git a/doc/misc/erc.texi b/doc/misc/erc.texi index 33f35d9b5c6..1e973d9c434 100644 --- a/doc/misc/erc.texi +++ b/doc/misc/erc.texi @@ -867,8 +867,8 @@ ERC's auth-source integration}. @defun erc-compute-server &optional server Return an IRC server name. -This tries a number of increasingly more default methods until a non-@code{nil} -value is found. +This tries a progressively greater number of default methods until a +non-@code{nil} value is found. @itemize @bullet @item @var{server} (the argument passed to this function) @@ -888,8 +888,8 @@ IRC server to use if one is not provided. @defun erc-compute-port &optional port Return a port for an IRC server. -This tries a number of increasingly more default methods until a non-@code{nil} -value is found. +This tries a progressively greater number of default methods until a +non-@code{nil} value is found. @itemize @bullet @item @var{port} (the argument passed to this function) @@ -910,7 +910,7 @@ This can be either a string or a number. @defun erc-compute-nick &optional nick Return user's IRC nick. -This tries a number of increasingly more default methods until a +This tries a progressively greater number of default methods until a non-@code{nil} value is found. @itemize @@ -1010,7 +1010,7 @@ auth-source facility to retrieve a server password, although hitting @defun erc-compute-full-name &optional full-name Return user's full name. -This tries a number of increasingly more default methods until a +This tries a progressively greater number of default methods until a non-@code{nil} value is found. @itemize @bullet diff --git a/lisp/erc/erc.el b/lisp/erc/erc.el index fd2a49c2504..30641c2bd88 100644 --- a/lisp/erc/erc.el +++ b/lisp/erc/erc.el @@ -8794,7 +8794,7 @@ Sets the buffer local variables: (defun erc-compute-server (&optional server) "Return an IRC server name. -This tries a number of increasingly more default methods until a +This tries a progressively greater number of default methods until a non-nil value is found. - SERVER (the argument passed to this function) @@ -8813,7 +8813,7 @@ non-nil value is found. (defun erc-compute-nick (&optional nick) "Return user's IRC nick. -This tries a number of increasingly more default methods until a +This tries a progressively greater number of default methods until a non-nil value is found. - NICK (the argument passed to this function) @@ -8837,7 +8837,7 @@ the user field and use whatever it returns as the server password." (defun erc-compute-full-name (&optional full-name) "Return user's full name. -This tries a number of increasingly more default methods until a +This tries a progressively greater number of default methods until a non-nil value is found. - FULL-NAME (the argument passed to this function) @@ -8853,7 +8853,7 @@ non-nil value is found. (defun erc-compute-port (&optional port) "Return a port for an IRC server. -This tries a number of increasingly more default methods until a +This tries a progressively greater number of default methods until a non-nil value is found. - PORT (the argument passed to this function) commit 643b564bd38cf037c55dba1a160b7d0c4c8355a9 Author: Pip Cet Date: Sun Aug 11 15:53:39 2024 +0000 ; * lisp/emacs-lisp/cond-star.el: Fix whitespace. diff --git a/lisp/emacs-lisp/cond-star.el b/lisp/emacs-lisp/cond-star.el index d8108d1c985..5ff921bb35e 100644 --- a/lisp/emacs-lisp/cond-star.el +++ b/lisp/emacs-lisp/cond-star.el @@ -379,7 +379,7 @@ as in `cond*-condition'." (defun cond*-bind-pattern-syms (bindings expr) "Wrap EXPR in code to bind the BINDINGS. This is used for the bindings specified explicitly in match* patterns." - ;; They can't have side effects. Skip them + ;; They can't have side effects. Skip them ;; if we don't actually need them. (if (equal expr '(progn)) nil @@ -708,6 +708,3 @@ That is safe for the purpose this is used for." (cons (car args) (cond*-un-backquote-list* (cdr args))) (mapcar (lambda (x) (list 'quote x)) (cadr (car args))))) - - - commit ad9743b436dc026167c7f122e3fb9ae9b47c90f9 Author: Eli Zaretskii Date: Sun Aug 11 18:47:36 2024 +0300 ; * lisp/emacs-lisp/cond-star.el: Fix typos and whitespace. diff --git a/lisp/emacs-lisp/cond-star.el b/lisp/emacs-lisp/cond-star.el index b1a7391a5b0..d8108d1c985 100644 --- a/lisp/emacs-lisp/cond-star.el +++ b/lisp/emacs-lisp/cond-star.el @@ -23,13 +23,13 @@ ;; Here is the list of functions the generated code is known to call: ;; car, cdr, car-safe, cdr-safe, nth, nthcdr, null, eq, equal, eql, =, ;; vectorp, length. -;; It also uses these control and binding promitives: +;; It also uses these control and binding primitives: ;; and, or, if, progn, let, let*, setq. ;; For regexp matching only, it can call string-match and match-string. ;;; ??? If a clause starts with a keyword, -;;; should the element after the kwyword be treated in the usual way -;;; as a pattern? Curently `cond*-non-exit-clause-substance' explicitly +;;; should the element after the keyword be treated in the usual way +;;; as a pattern? Currently `cond*-non-exit-clause-substance' explicitly ;;; prevents that by adding t at the front of its value. (defmacro cond* (&rest clauses) @@ -66,7 +66,7 @@ are passed along to the rest of the clauses in this `cond*' construct. (defmacro match* (pattern datum) "This specifies matching DATUM against PATTERN. -It is not really a LIsp function, and it is meaningful +It is not really a Lisp function, and it is meaningful only in the CONDITION of a `cond*' clause. `_' matches any value. @@ -106,7 +106,7 @@ ATOM (meaning any other kind of non-list not described above) (and CONJUNCTS...) matches each of the CONJUNCTS against the same data. If all of them match, this pattern succeeds. If one CONJUNCT fails, this pattern fails and does not try more CONJUNCTS. -(or DISJUNCTS...) matches each of te DISJUNCTS against the same data. +(or DISJUNCTS...) matches each of the DISJUNCTS against the same data. If one DISJUNCT succeeds, this pattern succeeds and does not try more DISJUNCTs. If all of them fail, this pattern fails. @@ -116,7 +116,7 @@ ATOM (meaning any other kind of non-list not described above) is a function. Trying to match such a pattern calls that function with one argument, the pattern in question (including its car). The function should return an equivalent pattern - to be matched inetead. + to be matched instead. (PREDICATE SYMBOL) matches datum if (PREDICATE DATUM) is true, then binds SYMBOL to DATUM. @@ -147,7 +147,7 @@ This removes a final keyword if that's what makes CLAUSE non-exit." (cond ((null (cdr-safe clause)) ;; clause has only one element. clause) ;; Starts with t or a keyword. - ;; Include t as the first element of the substancea + ;; Include t as the first element of the substance ;; so that the following element is not treated as a pattern. ((and (cdr-safe clause) (or (eq (car clause) t) @@ -186,7 +186,7 @@ REST is the rest of the clauses of this cond* expression." ;; run unconditionally and handled as a cond* body. rest nil nil)) - ;; Handle a normal (conditional exit) clauss. + ;; Handle a normal (conditional exit) clause. (cond*-convert-condition (car-safe clause) (cdr-safe clause) nil rest (cond*-convert rest)))) @@ -259,7 +259,7 @@ This is used for conditional exit clauses." ((eq pat-type 'match*) (cond*-match condition true-exps uncondit-clauses iffalse)) (t - ;; Ordinary Lixp expression is the condition + ;; Ordinary Lisp expression is the condition. (if rest ;; A nonfinal exiting clause. ;; If condition succeeds, run the TRUE-EXPS. @@ -310,8 +310,8 @@ as in `cond*-condition'." ;; unconditional clauses to follow, ;; and the pattern bound some variables, ;; copy their values into special aliases - ;; to be copied back at the start of the unonditional clauses. - (when (and uncondit-clauses true-exps + ;; to be copied back at the start of the unconditional clauses. + (when (and uncondit-clauses true-exps (car raw-result)) (dolist (bound-var (car raw-result)) (push `(setq ,(gensym "ua") ,(car bound-var)) store-value-swap-outs) @@ -320,7 +320,7 @@ as in `cond*-condition'." ;; Make an expression to run the TRUE-EXPS inside our bindings. (if store-value-swap-outs ;; If we have to store those bindings' values in aliases - ;; for the UNCONDIT-CLAUSES, ;; do so inside these bindigs. + ;; for the UNCONDIT-CLAUSES, do so inside these bindings. (setq run-true-exps (cond*-bind-pattern-syms (car raw-result) @@ -346,7 +346,7 @@ as in `cond*-condition'." ;; always run the UNCONDIT-CLAUSES. (if uncondit-clauses (setq expression - `(progn ,expression + `(progn ,expression ,(cond*-bind-pattern-syms (if retrieve-value-swap-outs ;; If we saved the bindings' values after the @@ -437,12 +437,12 @@ whether SUBPAT (as well as the subpatterns that contain/precede it) matches," (if inside-or (let (alias-gensym) (if this-alias - ;; Inside `or' subpattern, if this symbol already + ;; Inside `or' subpattern, if this symbol already ;; has an alias for backtracking, just use that. ;; This means the symbol was matched ;; in a previous arm of the `or'. (setq alias-gensym (cdr this-alias)) - ;; Inside `or' subpattern but this symbol has no alias, + ;; Inside `or' subpattern, but this symbol has no alias, ;; make an alias for it. (setq alias-gensym (gensym "ba")) (push (cons subpat alias-gensym) (cdr backtrack-aliases))) @@ -512,8 +512,9 @@ whether SUBPAT (as well as the subpatterns that contain/precede it) matches," (let ((i 0) expressions) ;; Check for bad structure of SUBPAT here? (dolist (this-elt (cdr subpat)) - (let ((result - (cond*-subpat this-elt cdr-ignore bindings inside-or backtrack-aliases `(nth ,i ,data)))) + (let ((result + (cond*-subpat this-elt cdr-ignore bindings inside-or + backtrack-aliases `(nth ,i ,data)))) (setq bindings (car result)) (push `(consp ,(if (zerop i) data `(nthcdr ,i ,data))) expressions) @@ -538,19 +539,19 @@ whether SUBPAT (as well as the subpatterns that contain/precede it) matches," (length (length elts)) expressions (i 0)) (dolist (elt elts) - (let* ((result - (cond*-subpat elt cdr-ignore - bindings inside-or backtrack-aliases `(aref ,i ,data)))) + (let* ((result + (cond*-subpat elt cdr-ignore bindings inside-or + backtrack-aliases `(aref ,i ,data)))) (setq i (1+ i)) (setq bindings (car result)) (push (cdr result) expressions))) (cons bindings (cond*-and `((vectorp ,data) (= (length ,data) ,length) . ,(nreverse expressions)))))) - ;; Subpattern to set the cdr-ignore flag + ;; Subpattern to set the cdr-ignore flag. ((eq (car subpat) 'cdr-ignore) (cond*-subpat (cadr subpat) t bindings inside-or backtrack-aliases data)) - ;; Subpattern to clear the cdr-ignore flag + ;; Subpattern to clear the cdr-ignore flag. ((eq (car subpat) 'cdr) (cond*-subpat (cadr subpat) nil bindings inside-or backtrack-aliases data)) ;; Handle conjunction subpatterns. @@ -558,15 +559,16 @@ whether SUBPAT (as well as the subpatterns that contain/precede it) matches," (let (expressions) ;; Check for bad structure of SUBPAT here? (dolist (this-elt (cdr subpat)) - (let ((result - (cond*-subpat this-elt cdr-ignore bindings inside-or backtrack-aliases data))) + (let ((result + (cond*-subpat this-elt cdr-ignore bindings inside-or + backtrack-aliases data))) (setq bindings (car result)) (push (cdr result) expressions))) (cons bindings (cond*-and (nreverse expressions))))) ;; Handle disjunction subpatterns. ((eq (car subpat) 'or) ;; The main complexity is unsetting the pattern variables - ;; that tentatively matche in an or-branch that later failed. + ;; that tentatively match in an or-branch that later failed. (let (expressions (bindings-before-or bindings) (aliases-before-or (cdr backtrack-aliases))) @@ -575,8 +577,9 @@ whether SUBPAT (as well as the subpatterns that contain/precede it) matches," (let* ((bindings bindings-before-or) bindings-to-clear expression result) - (setq result - (cond*-subpat this-elt cdr-ignore bindings t backtrack-aliases data)) + (setq result + (cond*-subpat this-elt cdr-ignore bindings t + backtrack-aliases data)) (setq bindings (car result)) (setq expression (cdr result)) ;; Were any bindings made by this arm of the disjunction? @@ -585,9 +588,9 @@ whether SUBPAT (as well as the subpatterns that contain/precede it) matches," ;; if this arm does not match. (setq bindings-to-clear bindings) (let (clearing) - ;; For each of those bindings, + ;; For each of those bindings, ... (while (not (eq bindings-to-clear bindings-before-or)) - ;; Make an expression to set it to nil, in CLEARING. + ;; ... make an expression to set it to nil, in CLEARING. (let* ((this-variable (caar bindings-to-clear)) (this-backtrack (assq this-variable (cdr backtrack-aliases)))) @@ -618,7 +621,8 @@ whether SUBPAT (as well as the subpatterns that contain/precede it) matches," (cond*-subpat (funcall (get (car subpat) 'cond*-expander) subpat) cdr-ignore bindings inside-or backtrack-aliases data)) ((macrop (car subpat)) - (cond*-subpat (macroexpand subpat) cdr-ignore bindings inside-or backtrack-aliases data)) + (cond*-subpat (macroexpand subpat) cdr-ignore bindings inside-or + backtrack-aliases data)) ;; Simple constrained variable, as in (symbolp x). ((functionp (car subpat)) ;; Without this, nested constrained variables just work. @@ -640,11 +644,13 @@ whether SUBPAT (as well as the subpatterns that contain/precede it) matches," (unless (symbolp (cadr subpat)) (byte-compile-warn-x subpat "Complex pattern nested in constrained variable pattern")) ;; Process VAR to get a binding for it. - (let ((result (cond*-subpat (cadr subpat) cdr-ignore bindings inside-or backtrack-aliases data))) + (let ((result + (cond*-subpat (cadr subpat) cdr-ignore bindings inside-or + backtrack-aliases data))) (cons (car result) ;; This is the test condition. (cond*-bind-around (car result) (nth 2 subpat))))) - (t + (t (byte-compile-warn-x subpat "Undefined pattern type `%s' in `cond*'" (car subpat))))) ;;; Subroutines of cond*-subpat. @@ -661,7 +667,7 @@ whether SUBPAT (as well as the subpatterns that contain/precede it) matches," This operates naively and errs on the side of overinclusion, and does not distinguish function names from variable names. That is safe for the purpose this is used for." - (cond ((symbolp exp) + (cond ((symbolp exp) (let ((which (assq exp bindings))) (if which (list which)))) ((listp exp) commit c42311e65d5456998590fba25f3166fdc0cc7a29 Merge: d60f3d5dd4b a9336d6996b Author: Eli Zaretskii Date: Sun Aug 11 17:18:24 2024 +0300 Merge branch 'master' of git.savannah.gnu.org:/srv/git/emacs commit d60f3d5dd4b753f23f99d862b0a051af9a8ca930 Author: Gautier Ponsinet Date: Sun Aug 11 14:52:11 2024 +0200 ; Fix a typo in the doc-strings of cond* * lisp/emacs-lisp/cond-star.el (cond*): Fix a typo in the doc-string. (Bug#72576) diff --git a/lisp/emacs-lisp/cond-star.el b/lisp/emacs-lisp/cond-star.el index 5e8564c29c2..b1a7391a5b0 100644 --- a/lisp/emacs-lisp/cond-star.el +++ b/lisp/emacs-lisp/cond-star.el @@ -35,7 +35,7 @@ (defmacro cond* (&rest clauses) "Extended form of traditional Lisp `cond' construct. A `cond*' construct is a series of clauses, and a clause -normally has the form (CONDITION BDOY...). +normally has the form (CONDITION BODY...). CONDITION can be a Lisp expression, as in `cond'. Or it can be `(bind* BINDINGS...)' or `(match* PATTERN DATUM)'. commit a9336d6996b0942dccbf143442ac80d4b0e2bbfa Author: Michael Albinus Date: Sun Aug 11 16:05:00 2024 +0200 Adapt emba cache settings * test/infra/gitlab-ci.yml (.build-template, .test-template) (.gnustep-template, .filenotify-gio-template, .eglot-template) (.tree-sitter-template, .native-comp-template): Add job specific cache settings. diff --git a/test/infra/gitlab-ci.yml b/test/infra/gitlab-ci.yml index e5e48b76ec2..8c0cf706a77 100644 --- a/test/infra/gitlab-ci.yml +++ b/test/infra/gitlab-ci.yml @@ -101,6 +101,8 @@ default: .build-template: needs: [] + cache: + policy: push rules: - if: '$CI_PIPELINE_SOURCE == "web"' when: always @@ -131,6 +133,8 @@ default: - docker push ${CI_REGISTRY_IMAGE}:${target}-${BUILD_TAG} .test-template: + cache: + policy: pull artifacts: name: ${test_name} public: true @@ -142,6 +146,8 @@ default: junit: ${test_name}/${EMACS_TEST_JUNIT_REPORT} .gnustep-template: + cache: + key: gnustep-${CI_COMMIT_SHA} rules: - if: '$CI_PIPELINE_SOURCE == "web"' - if: '$CI_PIPELINE_SOURCE == "schedule"' @@ -154,6 +160,8 @@ default: - test/infra/* .filenotify-gio-template: + cache: + key: filenotify-gio-${CI_COMMIT_SHA} rules: - if: '$CI_PIPELINE_SOURCE == "web"' # - if: '$CI_PIPELINE_SOURCE == "schedule"' @@ -168,6 +176,8 @@ default: - test/lisp/filenotify-tests.el .eglot-template: + cache: + key: eglot-${CI_COMMIT_SHA} rules: - if: '$CI_PIPELINE_SOURCE == "web"' - if: '$CI_PIPELINE_SOURCE == "schedule"' @@ -178,6 +188,8 @@ default: - test/lisp/progmodes/eglot-tests.el .tree-sitter-template: + cache: + key: tree-sitter-${CI_COMMIT_SHA} rules: - if: '$CI_PIPELINE_SOURCE == "web"' - if: '$CI_PIPELINE_SOURCE == "schedule"' @@ -198,6 +210,8 @@ default: - test/src/treesit-tests.el .native-comp-template: + cache: + key: native-comp-${CI_COMMIT_SHA} rules: - if: '$CI_PIPELINE_SOURCE == "web"' - if: '$CI_PIPELINE_SOURCE == "schedule"' commit 5c3d340e001187ad027bc0328f738938a2bc32c5 Author: Pip Cet Date: Sun Aug 11 10:07:12 2024 +0000 Fix format 2 cmap handling in sfnt.c This code is untested as no font with a format 2 cmap could be found. * src/sfnt.c (sfnt_lookup_glyph_2): Fix typos. Assume single-byte encodings use character codes 0, 1, ..., 255 rather than 0, 256, ..., 65280. diff --git a/src/sfnt.c b/src/sfnt.c index b235c795ef7..1ed492b7506 100644 --- a/src/sfnt.c +++ b/src/sfnt.c @@ -1093,10 +1093,10 @@ sfnt_lookup_glyph_2 (sfnt_char character, unsigned char *slice; uint16_t glyph; - if (character > 65335) + if (character > 65535) return 0; - i = character >> 16; + i = character >> 8; j = character & 0xff; k = format2->sub_header_keys[i] / 8; @@ -1129,9 +1129,9 @@ sfnt_lookup_glyph_2 (sfnt_char character, return 0; } - /* k is 0, so glyph_index_array[i] is the glyph. */ - return (i < format2->num_glyphs - ? format2->glyph_index_array[i] + /* k is 0, so glyph_index_array[j] is the glyph. */ + return (j < format2->num_glyphs + ? format2->glyph_index_array[j] : 0); } commit 8e925d582adba5619ab6f8d2bc7cd6a3a522a28b Author: Pip Cet Date: Sat Aug 10 17:01:44 2024 +0000 Fix coordinate transformations in sfnt.c Backport. * src/sfnt.c (sfnt_transform_coordinates): (sfnt_transform_f26dot6): Fix calculation of transformed coordinates in the very rare case of arbitrary transformation matrices. diff --git a/src/sfnt.c b/src/sfnt.c index 34ff6964c31..b235c795ef7 100644 --- a/src/sfnt.c +++ b/src/sfnt.c @@ -2578,8 +2578,10 @@ sfnt_transform_coordinates (struct sfnt_compound_glyph_component *component, for (i = 0; i < num_coordinates; ++i) { - x[i] = m1 * x[i] + m2 * y[i] + m3 * 1; - y[i] = m4 * x[i] + m5 * y[i] + m6 * 1; + sfnt_fixed xi = m1 * x[i] + m2 * y[i] + m3 * 1; + sfnt_fixed yi = m4 * x[i] + m5 * y[i] + m6 * 1; + x[i] = xi; + y[i] = yi; } } @@ -12822,8 +12824,10 @@ sfnt_transform_f26dot6 (struct sfnt_compound_glyph_component *component, for (i = 0; i < num_coordinates; ++i) { - x[i] = m1 * x[i] + m2 * y[i] + m3 * 1; - y[i] = m4 * x[i] + m5 * y[i] + m6 * 1; + sfnt_f26dot6 xi = m1 * x[i] + m2 * y[i] + m3 * 1; + sfnt_f26dot6 yi = m4 * x[i] + m5 * y[i] + m6 * 1; + x[i] = xi; + y[i] = yi; } }