commit c11cdf1858cc89464cd7118d6109c7472c50e652 (HEAD, refs/remotes/origin/master) Author: Po Lu Date: Mon Jan 15 14:32:26 2024 +0800 ; * src/xterm.c (x_focus_frame): Insert missing unblock_input. diff --git a/src/xterm.c b/src/xterm.c index fe398171754..c8a43785564 100644 --- a/src/xterm.c +++ b/src/xterm.c @@ -28828,7 +28828,10 @@ x_focus_frame (struct frame *f, bool noactivate) window. (bug#65116)*/ if (f == dpyinfo->x_focus_frame && !FRAME_HAS_MINIBUF_P (f)) - return; + { + unblock_input (); + return; + } #endif /* HAVE_GTK3 */ if (FRAME_X_EMBEDDED_P (f)) commit 314c939d1e182b8d015fc9c63d445274e0494748 Author: Stefan Monnier Date: Sun Jan 14 22:17:13 2024 -0500 (js-json-mode): Don't derive from `js-mode` (bug#67463) * lisp/progmodes/js.el (js--mode-setup): New function, extracted from `js-mode`. (js-mode): Use it. (js-json-mode): Use it instead of inheriting from `js-mode`. diff --git a/etc/NEWS b/etc/NEWS index da0253e97dc..03b8c3b517a 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -1002,6 +1002,11 @@ which calls 'xref-find-definitions'. If the previous one worked better for you, use 'define-key' in your init script to bind 'js-find-symbol' to that combination again. +** Json mode +`js-json-mode` does not derive from `js-mode` any more so as not +to confuse tools like Eglot or YASnippet into thinking that those +buffers contain Javascript code. + ** Python mode --- diff --git a/lisp/progmodes/js.el b/lisp/progmodes/js.el index 0115feb0e97..947d91c9b1a 100644 --- a/lisp/progmodes/js.el +++ b/lisp/progmodes/js.el @@ -3702,6 +3702,9 @@ Currently there are `js-mode' and `js-ts-mode'." (define-derived-mode js-mode js-base-mode "JavaScript" "Major mode for editing JavaScript." :group 'js + (js--mode-setup)) + +(defun js--mode-setup () ;; Ensure all CC Mode "lang variables" are set to valid values. (c-init-language-vars js-mode) (setq-local indent-line-function #'js-indent-line) @@ -3924,7 +3927,9 @@ See `treesit-thing-settings' for more information.") (put-text-property (1- ne) ne 'syntax-table syntax))))) ;;;###autoload -(define-derived-mode js-json-mode js-mode "JSON" +(define-derived-mode js-json-mode prog-mode "JSON" + :syntax-table js-mode-syntax-table + (js--mode-setup) ;Reuse most of `js-mode', but not as parent (bug#67463). (setq-local js-enabled-frameworks nil) ;; Speed up `syntax-ppss': JSON files can be big but can't hold ;; regexp matchers nor #! thingies (and `js-enabled-frameworks' is nil). commit 0d336507dfe34a36916c00add3b89abe396fea33 Author: Gregory Heytings Date: Mon Jan 15 00:53:36 2024 +0000 ; * admin/git-bisect-start: Update failing commits diff --git a/admin/git-bisect-start b/admin/git-bisect-start index 069f66515ba..f9933b3ae4d 100755 --- a/admin/git-bisect-start +++ b/admin/git-bisect-start @@ -84,7 +84,7 @@ done # SKIP-BRANCH 58cc931e92ece70c3e64131ee12a799d65409100 ## The list below is the exhaustive list of all commits between Dec 1 -## 2016 and Oct 2 2023 on which building Emacs with the default +## 2016 and Jan 13 2024 on which building Emacs with the default ## options, on a GNU/Linux computer and with GCC, fails. It is ## possible (though unlikely) that building Emacs with non-default ## options, with other compilers, or on other platforms, would succeed @@ -1788,3 +1788,9 @@ $REAL_GIT bisect skip $(cat $0 | grep '^# SKIP-SINGLE ' | sed 's/^# SKIP-SINGLE # SKIP-SINGLE f7fd21b06865d20a16c11e20776e843db24d4b14 # SKIP-SINGLE 35fbf6f15830f576fd1909f4a8d30e7ba1d777bd # SKIP-SINGLE 0e44ab5f061c81874dd8298a0f3318f14ef95a24 +# SKIP-SINGLE 4675aff76828b0747d1ac900d65d4a92a457ebf5 +# SKIP-SINGLE bf4d4ab4ddecffbee6d740f9c271dcca514d6a3d +# SKIP-SINGLE 2a8e6c8c84ed33674e525625644d5ce84ee8c59a +# SKIP-SINGLE fa5f06c1251ff717d661f05fcd240b4792054aae +# SKIP-SINGLE d3cefd3e98354929d96c9396e5920e8a123784dc +# SKIP-SINGLE 486094126ba77e45c50acb87f5ad3e4147608446 commit a83e60eccbc16613fc3da85f46a3fb032c098a82 Author: Mattias Engdegård Date: Sun Jan 14 14:10:17 2024 +0100 Fix recent ses-tests mistakes (bug#5852) * test/lisp/ses-tests.el (ses-set-formula-write-cells-with-changed-references): Quote constant list. Remove unused variable. diff --git a/test/lisp/ses-tests.el b/test/lisp/ses-tests.el index be6784be7a0..a916aed9eb3 100644 --- a/test/lisp/ses-tests.el +++ b/test/lisp/ses-tests.el @@ -246,7 +246,7 @@ to `ses--bar' and inserting a row, makes A2 value empty, and `ses--bar' equal to When setting a formula has some cell with changed references, this cell has to be rewritten to data area." (let ((ses-initial-size '(4 . 3)) - ses-after-entry-functions beg) + (ses-after-entry-functions nil)) (with-temp-buffer (ses-mode) (dolist (c '((0 1 1); B1 @@ -257,7 +257,7 @@ cell has to be rewritten to data area." (apply 'ses-calculate-cell (list (car c) (cadr c) nil))) (ses-cell-set-formula 2 1 '(+ B2 A3)); B3 (ses-command-hook) - (ses-cell-set-formula 3 1 (+ B3 A4)); B4 + (ses-cell-set-formula 3 1 '(+ B3 A4)); B4 (ses-command-hook) (should (equal (ses-cell-references 1 1) '(B3))) (ses-mode) commit d4b1e2c3b630ec3b38fb1e6592ba253452c52052 Author: Mattias Engdegård Date: Sun Jan 14 13:37:44 2024 +0100 Use forward-line instead of next-line in noninteractive test * test/lisp/textmodes/page-tests.el (page-tests-what-page): Silence byte-compiler warning; forward-line works nicely here. diff --git a/test/lisp/textmodes/page-tests.el b/test/lisp/textmodes/page-tests.el index 617b59a54fb..fdefca36c0b 100644 --- a/test/lisp/textmodes/page-tests.el +++ b/test/lisp/textmodes/page-tests.el @@ -110,7 +110,7 @@ (should (equal (page--what-page) '(1 1))) (forward-page) (should (equal (page--what-page) '(2 1))) - (next-line) + (forward-line) (should (equal (page--what-page) '(2 2))) (forward-page) (should (equal (page--what-page) '(3 1))))) commit cd0855cbd81b5fd3866c9a3242f0490c938b6d4d Author: Mattias Engdegård Date: Sun Jan 14 12:50:36 2024 +0100 Make object-intervals linear instead of quadratic * src/fns.c (collect_interval, Fobject_intervals): Build the returned list in reverse instead of appending single elements. diff --git a/src/fns.c b/src/fns.c index 07bb5115b6c..acfedbfa922 100644 --- a/src/fns.c +++ b/src/fns.c @@ -5255,11 +5255,11 @@ static void collect_interval (INTERVAL interval, void *arg) { Lisp_Object *collector = arg; - *collector = - nconc2 (*collector, - list1(list3 (make_fixnum (interval->position), - make_fixnum (interval->position + LENGTH (interval)), - interval->plist))); + *collector = Fcons (list3 (make_fixnum (interval->position), + make_fixnum (interval->position + + LENGTH (interval)), + interval->plist), + *collector); } @@ -6312,7 +6312,6 @@ Altering this copy does not change the layout of the text properties in OBJECT. */) (register Lisp_Object object) { - Lisp_Object collector = Qnil; INTERVAL intervals; if (STRINGP (object)) @@ -6325,8 +6324,9 @@ in OBJECT. */) if (! intervals) return Qnil; + Lisp_Object collector = Qnil; traverse_intervals (intervals, 0, collect_interval, &collector); - return collector; + return Fnreverse (collector); } DEFUN ("line-number-at-pos", Fline_number_at_pos, commit 3869944bb4f9434e0c49063a291ed8a0a33cba50 Author: Mattias Engdegård Date: Sun Jan 14 12:33:12 2024 +0100 Speed up sxhash-equal-including-properties This function now no longer conses at all. Previously, it constructed a list structure of all string intervals for the sole purpose of hashing. * src/fns.c (hash_interval): New. (Fsxhash_equal_including_properties): Use it instead of collect_interval. diff --git a/src/fns.c b/src/fns.c index f7c36aacea6..07bb5115b6c 100644 --- a/src/fns.c +++ b/src/fns.c @@ -5240,6 +5240,17 @@ sxhash_obj (Lisp_Object obj, int depth) } } +static void +hash_interval (INTERVAL interval, void *arg) +{ + EMACS_UINT *phash = arg; + EMACS_UINT hash = *phash; + hash = sxhash_combine (hash, interval->position); + hash = sxhash_combine (hash, LENGTH (interval)); + hash = sxhash_combine (hash, sxhash_obj (interval->plist, 0)); + *phash = hash; +} + static void collect_interval (INTERVAL interval, void *arg) { @@ -5310,14 +5321,9 @@ Hash codes are not guaranteed to be preserved across Emacs sessions. */) { if (STRINGP (obj)) { - /* FIXME: This is very wasteful. We needn't cons at all. */ - Lisp_Object collector = Qnil; - traverse_intervals (string_intervals (obj), 0, collect_interval, - &collector); - return - make_ufixnum ( - SXHASH_REDUCE (sxhash_combine (sxhash (obj), - sxhash (collector)))); + EMACS_UINT hash = 0; + traverse_intervals (string_intervals (obj), 0, hash_interval, &hash); + return make_ufixnum (SXHASH_REDUCE (sxhash_combine (sxhash (obj), hash))); } return hash_hash_to_fixnum (hashfn_equal (obj, NULL)); commit a9cee9c6675a7002441bdd186402f45eb5379172 Author: Mattias Engdegård Date: Sun Jan 14 11:58:33 2024 +0100 Retype traverse_interval arg type from Lisp_Object to void * This is a refactoring. It eliminates a few unnecessary conses and allows for further improvements. * src/intervals.c (traverse_intervals): Change argument type. All callers adapted. * src/fns.c (collect_interval, Fsxhash_equal_including_properties) (Fobject_intervals): * src/print.c (print_check_string_charset_prop) (print_prune_string_charset, print_object, print_interval): Pass a pointer to a Lisp_Object instead of a Lisp_Object. diff --git a/src/fns.c b/src/fns.c index 2905c3f1b86..f7c36aacea6 100644 --- a/src/fns.c +++ b/src/fns.c @@ -5241,12 +5241,14 @@ sxhash_obj (Lisp_Object obj, int depth) } static void -collect_interval (INTERVAL interval, Lisp_Object collector) +collect_interval (INTERVAL interval, void *arg) { - nconc2 (collector, - list1(list3 (make_fixnum (interval->position), - make_fixnum (interval->position + LENGTH (interval)), - interval->plist))); + Lisp_Object *collector = arg; + *collector = + nconc2 (*collector, + list1(list3 (make_fixnum (interval->position), + make_fixnum (interval->position + LENGTH (interval)), + interval->plist))); } @@ -5309,13 +5311,13 @@ Hash codes are not guaranteed to be preserved across Emacs sessions. */) if (STRINGP (obj)) { /* FIXME: This is very wasteful. We needn't cons at all. */ - Lisp_Object collector = Fcons (Qnil, Qnil); + Lisp_Object collector = Qnil; traverse_intervals (string_intervals (obj), 0, collect_interval, - collector); + &collector); return make_ufixnum ( SXHASH_REDUCE (sxhash_combine (sxhash (obj), - sxhash (CDR (collector))))); + sxhash (collector)))); } return hash_hash_to_fixnum (hashfn_equal (obj, NULL)); @@ -6304,7 +6306,7 @@ Altering this copy does not change the layout of the text properties in OBJECT. */) (register Lisp_Object object) { - Lisp_Object collector = Fcons (Qnil, Qnil); + Lisp_Object collector = Qnil; INTERVAL intervals; if (STRINGP (object)) @@ -6317,8 +6319,8 @@ in OBJECT. */) if (! intervals) return Qnil; - traverse_intervals (intervals, 0, collect_interval, collector); - return CDR (collector); + traverse_intervals (intervals, 0, collect_interval, &collector); + return collector; } DEFUN ("line-number-at-pos", Fline_number_at_pos, diff --git a/src/intervals.c b/src/intervals.c index 1b1fb3b8181..2ab19c2cc56 100644 --- a/src/intervals.c +++ b/src/intervals.c @@ -256,7 +256,7 @@ traverse_intervals_noorder (INTERVAL tree, void (*function) (INTERVAL, void *), void traverse_intervals (INTERVAL tree, ptrdiff_t position, - void (*function) (INTERVAL, Lisp_Object), Lisp_Object arg) + void (*function) (INTERVAL, void *), void *arg) { while (tree) { diff --git a/src/intervals.h b/src/intervals.h index aa7502b4f68..610c803cc77 100644 --- a/src/intervals.h +++ b/src/intervals.h @@ -245,8 +245,8 @@ extern INTERVAL create_root_interval (Lisp_Object); extern void copy_properties (INTERVAL, INTERVAL); extern bool intervals_equal (INTERVAL, INTERVAL); extern void traverse_intervals (INTERVAL, ptrdiff_t, - void (*) (INTERVAL, Lisp_Object), - Lisp_Object); + void (*) (INTERVAL, void *), + void *); extern void traverse_intervals_noorder (INTERVAL, void (*) (INTERVAL, void *), void *); extern INTERVAL split_interval_right (INTERVAL, ptrdiff_t) diff --git a/src/print.c b/src/print.c index 58a23b79d5d..0899dcdeb03 100644 --- a/src/print.c +++ b/src/print.c @@ -87,7 +87,7 @@ static struct print_buffer print_buffer; print_number_index holds the largest N already used. N has to be strictly larger than 0 since we need to distinguish -N. */ static ptrdiff_t print_number_index; -static void print_interval (INTERVAL interval, Lisp_Object printcharfun); +static void print_interval (INTERVAL interval, void *pprintcharfun); /* GDB resets this to zero on W32 to disable OutputDebugString calls. */ bool print_output_debug_flag EXTERNALLY_VISIBLE = 1; @@ -1493,8 +1493,6 @@ print_preprocess_string (INTERVAL interval, void *arg) print_preprocess (interval->plist); } -static void print_check_string_charset_prop (INTERVAL interval, Lisp_Object string); - #define PRINT_STRING_NON_CHARSET_FOUND 1 #define PRINT_STRING_UNSAFE_CHARSET_FOUND 2 @@ -1502,7 +1500,7 @@ static void print_check_string_charset_prop (INTERVAL interval, Lisp_Object stri static int print_check_string_result; static void -print_check_string_charset_prop (INTERVAL interval, Lisp_Object string) +print_check_string_charset_prop (INTERVAL interval, void *pstring) { Lisp_Object val; @@ -1526,6 +1524,7 @@ print_check_string_charset_prop (INTERVAL interval, Lisp_Object string) if (! (print_check_string_result & PRINT_STRING_UNSAFE_CHARSET_FOUND)) { ptrdiff_t charpos = interval->position; + Lisp_Object string = *(Lisp_Object *)pstring; ptrdiff_t bytepos = string_char_to_byte (string, charpos); Lisp_Object charset = XCAR (XCDR (val)); @@ -1550,7 +1549,7 @@ print_prune_string_charset (Lisp_Object string) { print_check_string_result = 0; traverse_intervals (string_intervals (string), 0, - print_check_string_charset_prop, string); + print_check_string_charset_prop, &string); if (NILP (Vprint_charset_text_property) || ! (print_check_string_result & PRINT_STRING_UNSAFE_CHARSET_FOUND)) { @@ -2401,8 +2400,9 @@ print_object (Lisp_Object obj, Lisp_Object printcharfun, bool escapeflag) if (string_intervals (obj)) { + Lisp_Object pcf = printcharfun; traverse_intervals (string_intervals (obj), - 0, print_interval, printcharfun); + 0, print_interval, &pcf); printchar (')', printcharfun); } } @@ -2792,10 +2792,11 @@ print_object (Lisp_Object obj, Lisp_Object printcharfun, bool escapeflag) This is part of printing a string that has text properties. */ static void -print_interval (INTERVAL interval, Lisp_Object printcharfun) +print_interval (INTERVAL interval, void *pprintcharfun) { if (NILP (interval->plist)) return; + Lisp_Object printcharfun = *(Lisp_Object *)pprintcharfun; printchar (' ', printcharfun); print_object (make_fixnum (interval->position), printcharfun, 1); printchar (' ', printcharfun); commit dd83db2e23062642ab964bad226146a8bdac1349 Author: Po Lu Date: Sun Jan 14 21:06:10 2024 +0800 Correct implementations of FLIPRGON and FLIPRGOFF * src/sfnt.c (sfnt_interpret_fliprgoff) (sfnt_interpret_fliprgon): Reorder arguments to match the order in which arguments are popped by macro wrappers. Fix sundry typos. diff --git a/src/sfnt.c b/src/sfnt.c index f4c023f35c6..2f0153b9a75 100644 --- a/src/sfnt.c +++ b/src/sfnt.c @@ -8966,7 +8966,7 @@ sfnt_dual_project_vector (struct sfnt_interpreter *interpreter, static void sfnt_interpret_fliprgoff (struct sfnt_interpreter *interpreter, - uint32_t l, uint32_t h) + uint32_t h, uint32_t l) { uint32_t i; @@ -8976,7 +8976,7 @@ sfnt_interpret_fliprgoff (struct sfnt_interpreter *interpreter, if (!interpreter->state.zp0) return; - for (i = l; i < h; ++i) + for (i = l; i <= h; ++i) interpreter->glyph_zone->flags[i] &= ~01; } @@ -8985,7 +8985,7 @@ sfnt_interpret_fliprgoff (struct sfnt_interpreter *interpreter, static void sfnt_interpret_fliprgon (struct sfnt_interpreter *interpreter, - uint32_t l, uint32_t h) + uint32_t h, uint32_t l) { uint32_t i; @@ -8995,8 +8995,8 @@ sfnt_interpret_fliprgon (struct sfnt_interpreter *interpreter, if (!interpreter->state.zp0) return; - for (i = l; i < h; ++i) - interpreter->glyph_zone->flags[i] |= ~01; + for (i = l; i <= h; ++i) + interpreter->glyph_zone->flags[i] |= 01; } /* Interpret a FLIPPT instruction in INTERPRETER. For loop times, pop