diff --git a/admin/notes/unicode b/admin/notes/unicode index 3502731efbe..81f17edeae2 100644 --- a/admin/notes/unicode +++ b/admin/notes/unicode @@ -103,13 +103,19 @@ Specifically, the values of 'ucs-normalize-composition-exclusions' and verified against the latest Unicode data files. Next, test normalization functions against NormalizationTests.txt, -in the test/ directory run: +in the top-level directory run: - make lisp/international/ucs-normalize-tests + make -C test lisp/international/ucs-normalize-tests See commentary in test/lisp/international/ucs-normalize-tests.el regarding failing lines. +Changes in UTS#46 and other relevant Unicode data might break our +features that detect confusable and suspicious text, so run +test/lisp-international/textsec-tests to check that: + + make -C test lisp/international/textsec-tests + The file BidiCharacterTest.txt should be copied to the test suite, and if its format has changed, the file biditest.el there should be modified to follow suit. If there's trailing whitespace in diff --git a/configure.ac b/configure.ac index e79a822fcae..bb478888ead 100644 --- a/configure.ac +++ b/configure.ac @@ -782,6 +782,17 @@ AS_IF([test "$with_android" = no || test -n "$XCONFIGURE"],[ [android_enable_checking=yes export android_enable_checking])]) +AC_ARG_ENABLE([gc-mark-trace], + [AS_HELP_STRING([--disable-gc-mark-trace], + [disable the mark trace buffer used for debugging the Emacs + garbage collector])], + [ac_enable_gc_mark_trace="${enableval}"], + [ac_enable_gc_mark_trace=yes]) +if test "x$ac_enable_gc_mark_trace" = xyes ; then + AC_DEFINE([GC_REMEMBER_LAST_MARKED], [1], + [Define to 1 to enable GC mark trace buffer.]) +fi + dnl The name of this option is unfortunate. It predates, and has no dnl relation to, the "sampling-based elisp profiler" added in 24.3. dnl Actually, it stops it working. diff --git a/etc/NEWS b/etc/NEWS index bbdc21e9762..6c97ffacd15 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -31,6 +31,13 @@ host system supports SSE2) or '-fno-tree-sra' (if not). These GCC options work around GCC bug 58416, which can cause Emacs to behave incorrectly in rare cases. +--- +** New configuration option '--disable-gc-mark-trace'. +This disables the GC mark trace buffer for about 5 % better garbage +collection performance. Doing so may make it more difficult for Emacs +developers to help finding GC-related bugs that you run into, which is +why it the mark trace buffer is enabled by default. + * Startup Changes in Emacs 31.1 diff --git a/etc/PROBLEMS b/etc/PROBLEMS index 841294ec7f1..d13d0d34128 100644 --- a/etc/PROBLEMS +++ b/etc/PROBLEMS @@ -3583,6 +3583,18 @@ GTK_IM_MODULE. GTK does not allow programs to warp the pointer anymore. There is nothing that can be done about this problem. +** 'frame-edges' and 'frame-geometry' return incorrect information + +The information returned by these and similar functions on Wayland about +frame position is incorrect. For example, 'frame-edges' can return zero +in the first 2 elements although the top-left corner of the frame is not +at pixel coordinates (0,0). This happens because the Wayland protocol +is specifically engineered not to reveal this information to clients. +For similar reasons, 'frame-monitor-workarea', +'frame-monitor-attributes', and related geometry-querying functions +cannot establish the size of the workarea, and return placeholder +results instead. + ** Certain keys such as 'C-S-u' are not reported correctly. Some keys with modifiers such as Shift and Control might not be diff --git a/lisp/files.el b/lisp/files.el index 6cbb1b5c632..a81f742bbb4 100644 --- a/lisp/files.el +++ b/lisp/files.el @@ -299,12 +299,12 @@ See also `backup-by-copying' and `backup-by-copying-when-linked'." :version "23.1") (defcustom version-control nil - "Control use of version numbers for backup files. -When t, make numeric backup versions unconditionally. -When nil, make them for files that have some already. -The value `never' means do not make them." + "Control use of version-numbered backup files. +When t, make numbered backup files unconditionally. +When nil, make them for files that already have numbered backups. +The value `never' means never make numbered backups." :type '(choice (const :tag "Never" never) - (const :tag "If existing" nil) + (const :tag "If numbered backups exist" nil) (other :tag "Always" t)) :safe #'version-control-safe-local-p :group 'backup) @@ -314,28 +314,36 @@ The value `never' means do not make them." (or (booleanp x) (equal x 'never))) (defcustom dired-kept-versions 2 - "When cleaning directory, number of versions to keep." + "When cleaning directory, number of versions of numbered backups to keep. +See `version-control', `kept-old-versions' and `kept-new-versions' for +more about keeping and deleting old versioned (a.k.a. \"numbered\") +backup files." :type 'natnum :group 'backup :group 'dired) (defcustom delete-old-versions nil - "If t, delete excess backup versions silently. -If nil, ask confirmation. Any other value prevents any trimming." + "If t, delete excess numbered backup files silently. +If nil, ask confirmation. Any other value prevents any trimming. +See `version-control', `kept-old-versions', `kept-new-versions' +and `dired-kept-versions' for more about keeping and deleting old +versioned (a.k.a. \"numbered\") backup files." :type '(choice (const :tag "Delete" t) (const :tag "Ask" nil) (other :tag "Leave" other)) :group 'backup) (defcustom kept-old-versions 2 - "Number of oldest versions to keep when a new numbered backup is made." + "Number of oldest versions to keep when a new numbered backup is made. +See `version-control' for how Emacs decides when to make numbered backups." :type 'natnum :safe #'natnump :group 'backup) (defcustom kept-new-versions 2 "Number of newest versions to keep when a new numbered backup is made. -Includes the new backup. Must be greater than 0." +Includes the new backup. Must be greater than 0. +See `version-control' for how Emacs decides when to make numbered backups." :type 'natnum :safe #'natnump :group 'backup) diff --git a/lisp/progmodes/etags-regen.el b/lisp/progmodes/etags-regen.el index 21ea9bfb8b3..a8e67197070 100644 --- a/lisp/progmodes/etags-regen.el +++ b/lisp/progmodes/etags-regen.el @@ -118,7 +118,7 @@ We currently support only Emacs's etags program with this option." ;; when it cannot determine the type of the file. ;; http://lists.gnu.org/archive/html/emacs-devel/2018-01/msg00323.html (defcustom etags-regen-file-extensions - '("rb" "js" "py" "pl" "el" "c" "cpp" "cc" "h" "hh" "hpp" + '("rb" "js" "py" "pl" "pm" "el" "c" "cpp" "cc" "h" "hh" "hpp" "java" "go" "cl" "lisp" "prolog" "php" "erl" "hrl" "F" "f" "f90" "for" "cs" "a" "asm" "ads" "adb" "ada") "Code file extensions for `etags-regen-mode'. diff --git a/src/alloc.c b/src/alloc.c index 066ec9fefe5..4fab0d54248 100644 --- a/src/alloc.c +++ b/src/alloc.c @@ -6860,11 +6860,10 @@ mark_glyph_matrix (struct glyph_matrix *matrix) } } -/* Whether to remember a few of the last marked values for debugging. */ -#define GC_REMEMBER_LAST_MARKED 0 - #if GC_REMEMBER_LAST_MARKED +/* Remember a few of the last marked values for debugging purposes. */ enum { LAST_MARKED_SIZE = 1 << 9 }; /* Must be a power of 2. */ +extern Lisp_Object last_marked[LAST_MARKED_SIZE]; Lisp_Object last_marked[LAST_MARKED_SIZE] EXTERNALLY_VISIBLE; static int last_marked_index; #endif diff --git a/src/haiku_support.cc b/src/haiku_support.cc index 4ea5e0884b9..a16b9bc10b0 100644 --- a/src/haiku_support.cc +++ b/src/haiku_support.cc @@ -340,18 +340,18 @@ keysym_from_raw_char (int32 raw, int32 key, unsigned *code) break; -#if B_HAIKU_VERSION >= B_HAIKU_VERSION_1_BETA_5 +#if B_HAIKU_VERSION >= B_HAIKU_VERSION_1_PRE_BETA_6 case B_HANGUL_KEY: -#else /* B_HAIKU_VERSION < B_HAIKU_VERSION_1_BETA_5 */ +#else /* B_HAIKU_VERSION < B_HAIKU_VERSION_1_PRE_BETA_6 */ case B_HANGUL: -#endif /* B_HAIKU_VERSION >= B_HAIKU_VERSION_1_BETA_5 */ +#endif /* B_HAIKU_VERSION >= B_HAIKU_VERSION_1_PRE_BETA_6 */ *code = KEY_HANGUL; break; -#if B_HAIKU_VERSION >= B_HAIKU_VERSION_1_BETA_5 +#if B_HAIKU_VERSION >= B_HAIKU_VERSION_1_PRE_BETA_6 case B_HANGUL_HANJA_KEY: -#else /* B_HAIKU_VERSION < B_HAIKU_VERSION_1_BETA_5 */ +#else /* B_HAIKU_VERSION < B_HAIKU_VERSION_1_PRE_BETA_6 */ case B_HANGUL: -#endif /* B_HAIKU_VERSION >= B_HAIKU_VERSION_1_BETA_5 */ +#endif /* B_HAIKU_VERSION >= B_HAIKU_VERSION_1_PRE_BETA_6 */ *code = KEY_HANGUL_HANJA; break; case B_KATAKANA_HIRAGANA: diff --git a/src/process.c b/src/process.c index 557bdfc918c..b71ba3daf2d 100644 --- a/src/process.c +++ b/src/process.c @@ -4710,6 +4710,9 @@ network_lookup_address_info_1 (Lisp_Object host, const char *service, DEFUN ("network-lookup-address-info", Fnetwork_lookup_address_info, Snetwork_lookup_address_info, 1, 3, 0, doc: /* Look up Internet Protocol (IP) address info of NAME. +NAME must be an ASCII-only string. For looking up internationalized +hostnames, use `puny-encode-domain' on the string first. + Optional argument FAMILY controls whether to look up IPv4 or IPv6 addresses. The default of nil means both, symbol `ipv4' means IPv4 only, symbol `ipv6' means IPv6 only. @@ -4729,6 +4732,8 @@ returned from the lookup. */) struct addrinfo *res, *lres; struct addrinfo hints; + CHECK_STRING (name); + memset (&hints, 0, sizeof hints); if (NILP (family)) hints.ai_family = AF_UNSPEC; diff --git a/src/treesit.c b/src/treesit.c index 3790f5046c1..6677158b9de 100644 --- a/src/treesit.c +++ b/src/treesit.c @@ -499,7 +499,7 @@ treesit_debug_print_parser_list (char *msg, Lisp_Object parser) { struct buffer *buf = XBUFFER (XTS_PARSER (parser)->buffer); char *buf_name = SSDATA (BVAR (buf, name)); - printf ("%s (%s) [%s] <%s>: %ld(%ld)-(%ld)%ld {\n", + printf ("%s (%s) [%s] <%s>: %td(%td)-(%td)%td {\n", msg == NULL ? "" : msg, SSDATA (SYMBOL_NAME (Vthis_command)), SSDATA (SYMBOL_NAME (XTS_PARSER (parser)->language_symbol)), @@ -510,7 +510,7 @@ treesit_debug_print_parser_list (char *msg, Lisp_Object parser) FOR_EACH_TAIL (tail) { struct Lisp_TS_Parser *parser = XTS_PARSER (XCAR (tail)); - printf ("[%s %s %s %ld-%ld T:%ld]\n", SSDATA (SYMBOL_NAME (parser->language_symbol)), + printf ("[%s %s %s %td-%td T:%td]\n", SSDATA (SYMBOL_NAME (parser->language_symbol)), SSDATA (SYMBOL_NAME (parser->tag)), parser->need_reparse ? "NEED-R" : "NONEED", parser->visible_beg, parser->visible_end, @@ -1110,6 +1110,7 @@ treesit_sync_visible_region (Lisp_Object parser) if (NILP (lisp_ranges)) return; Lisp_Object new_ranges_head = lisp_ranges; + Lisp_Object prev_cons = Qnil; FOR_EACH_TAIL_SAFE (lisp_ranges) { @@ -1122,9 +1123,12 @@ treesit_sync_visible_region (Lisp_Object parser) new_ranges_head = XCDR (new_ranges_head); else if (beg >= visible_end) { - /* Even the beg is after visible_end, dicard this range and all + /* Even the beg is after visible_end, discard this range and all the ranges after it. */ - XSETCDR (range, Qnil); + if (NILP (prev_cons)) + new_ranges_head = Qnil; + else + XSETCDR (prev_cons, Qnil); break; } else @@ -1137,28 +1141,29 @@ treesit_sync_visible_region (Lisp_Object parser) if (end > visible_end) XSETCDR (range, make_fixnum (visible_end)); } + prev_cons = lisp_ranges; } + /* We are in a weird situation here: none of the previous ranges + overlaps with the new visible region. We don't have any good + options, so just throw the towel: just give the parser a zero + range. (Perfect filling!!) */ + if (NILP (new_ranges_head)) + new_ranges_head = Fcons (Fcons (make_fixnum (visible_beg), + make_fixnum (visible_beg)), + Qnil); + XTS_PARSER (parser)->last_set_ranges = new_ranges_head; - if (NILP (new_ranges_head)) - { - bool success; - success = ts_parser_set_included_ranges (XTS_PARSER (parser)->parser, - NULL, 0); - eassert (success); - } - else - { - uint32_t len = 0; - TSRange *ts_ranges = treesit_make_ts_ranges (new_ranges_head, parser, - &len); - bool success; - success = ts_parser_set_included_ranges (XTS_PARSER (parser)->parser, - ts_ranges, len); - xfree (ts_ranges); - eassert (success); - } + uint32_t len = 0; + TSRange *ts_ranges = NULL; + ts_ranges = treesit_make_ts_ranges (new_ranges_head, parser, + &len); + bool success; + success = ts_parser_set_included_ranges (XTS_PARSER (parser)->parser, + ts_ranges, len); + xfree (ts_ranges); + eassert (success); } /* (ref:bytepos-range-pitfall) Suppose we have the following buffer diff --git a/test/src/treesit-tests.el b/test/src/treesit-tests.el index 1d18cc16532..7eecbdcfa94 100644 --- a/test/src/treesit-tests.el +++ b/test/src/treesit-tests.el @@ -711,7 +711,39 @@ visible_end.)" '((1 . 7) (10 . 15)))) (narrow-to-region 5 13) (should (equal (treesit-parser-included-ranges parser) - '((5 . 7) (10 . 13))))))) + '((5 . 7) (10 . 13)))) + + ;; Narrow in front, and discard the last one. + (widen) + (treesit-parser-set-included-ranges + parser '((4 . 10) (12 . 14) (16 . 20))) + ;; 11111111111111111111 + ;; [ ] [ ] [ ] + ;; { } narrow + (narrow-to-region 1 8) + (should (equal (treesit-parser-included-ranges parser) + '((4 . 8)))) + + ;; Narrow in back, and discard the first one. + (widen) + (treesit-parser-set-included-ranges + parser '((1 . 5) (7 . 9) (11 . 17))) + ;; 11111111111111111111 + ;; [ ] [ ] [ ] + ;; { } narrow + (narrow-to-region 15 20) + (should (equal (treesit-parser-included-ranges parser) + '((15 . 17)))) + + ;; No overlap + (widen) + (treesit-parser-set-included-ranges parser '((15 . 20))) + ;; 11111111111111111111 + ;; [ ] + ;; { } narrow + (narrow-to-region 1 10) + (should (equal (treesit-parser-included-ranges parser) + '((1 . 1))))))) ;;; Multiple language