commit 92ea393a16e5c99a8860dab368c6ca3ca6abc3c5 (HEAD, refs/remotes/origin/master) Author: Juri Linkov Date: Sun Sep 1 20:05:02 2024 +0300 ; * lisp/menu-bar.el (menu-bar-showhide-menu): Small optimization. Use 'bound-and-true-p' to check for non-nil 'outline-minor-mode'. diff --git a/lisp/menu-bar.el b/lisp/menu-bar.el index efce55032c8..b85cc834588 100644 --- a/lisp/menu-bar.el +++ b/lisp/menu-bar.el @@ -1359,8 +1359,7 @@ mail status in mode line")) :visible (seq-some #'local-variable-p '(outline-search-function outline-regexp outline-level)) - :button (:toggle . (and (boundp 'outline-minor-mode) - outline-minor-mode)))) + :button (:toggle . (bound-and-true-p outline-minor-mode)))) (bindings--define-key menu [showhide-tab-line-mode] '(menu-item "Window Tab Line" global-tab-line-mode commit 0155f2ae2c84c649452b0eaac3fd247a37e4eaff Author: Juri Linkov Date: Sun Sep 1 20:02:12 2024 +0300 * lisp/progmodes/js.el: Improve sexp navigation in js-ts-mode (bug#72573) (js--treesit-sexp-nodes): Add "template_string", "template_substitution", "property_identifier". (js-ts-mode): Replace "template_string" with "string_fragment" in 'text' part of 'treesit-thing-settings'. diff --git a/lisp/progmodes/js.el b/lisp/progmodes/js.el index 75c8111035c..14ae4068263 100644 --- a/lisp/progmodes/js.el +++ b/lisp/progmodes/js.el @@ -3861,11 +3861,14 @@ See `treesit-thing-settings' for more information.") "array" "function" "string" + "template_string" + "template_substitution" "escape" "template" "regex" "number" "identifier" + "property_identifier" "this" "super" "true" @@ -3929,7 +3932,7 @@ See `treesit-thing-settings' for more information.") (sexp ,(js--regexp-opt-symbol js--treesit-sexp-nodes)) (sentence ,(js--regexp-opt-symbol js--treesit-sentence-nodes)) (text ,(js--regexp-opt-symbol '("comment" - "template_string")))))) + "string_fragment")))))) ;; Fontification. (setq-local treesit-font-lock-settings js--treesit-font-lock-settings) commit dc2cdd36835cdce9426d0f822590a0d2f47d0bcc Author: Pip Cet Date: Sun Sep 1 15:37:02 2024 +0000 Explicitly include stdlib.h in src/image.c (Bug#72929) * src/image.c: Add include. diff --git a/src/image.c b/src/image.c index 41eeebff36e..34936977a40 100644 --- a/src/image.c +++ b/src/image.c @@ -23,6 +23,7 @@ along with GNU Emacs. If not, see . */ #include #include #include +#include /* Include this before including to work around bugs with older libpng; see Bug#17429. */ commit 99a03ddb2d43d67577814b96e40ec069739b6421 Author: Stefan Kangas Date: Sun Sep 1 15:20:49 2024 +0200 Delete cc-compat.el from Makefile.in * lisp/Makefile.in: Delete obsolete file cc-compat.el. It has been moved to obsolete/ and is compiled separately. diff --git a/lisp/Makefile.in b/lisp/Makefile.in index 95cb6a97213..dc25645f5a3 100644 --- a/lisp/Makefile.in +++ b/lisp/Makefile.in @@ -540,20 +540,15 @@ check-defun-dups: # dependency in cc-*.elc files on the macros in other cc-*.el and the # version string in cc-defs.el. $(lisp)/progmodes/cc-align.elc\ - $(lisp)/progmodes/cc-cmds.elc $(lisp)/progmodes/cc-compat.elc\ - $(lisp)/progmodes/cc-engine.elc $(lisp)/progmodes/cc-fonts.elc\ - $(lisp)/progmodes/cc-langs.elc $(lisp)/progmodes/cc-menus.elc\ - $(lisp)/progmodes/cc-mode.elc $(lisp)/progmodes/cc-styles.elc\ - $(lisp)/progmodes/cc-vars.elc: \ + $(lisp)/progmodes/cc-cmds.elc $(lisp)/progmodes/cc-engine.elc \ + $(lisp)/progmodes/cc-fonts.elc $(lisp)/progmodes/cc-langs.elc \ + $(lisp)/progmodes/cc-menus.elc $(lisp)/progmodes/cc-mode.elc \ + $(lisp)/progmodes/cc-styles.elc $(lisp)/progmodes/cc-vars.elc: \ $(lisp)/progmodes/cc-bytecomp.elc $(lisp)/progmodes/cc-defs.elc $(lisp)/progmodes/cc-align.elc $(lisp)/progmodes/cc-cmds.elc: \ $(lisp)/progmodes/cc-vars.elc $(lisp)/progmodes/cc-engine.elc -$(lisp)/progmodes/cc-compat.elc: \ - $(lisp)/progmodes/cc-vars.elc $(lisp)/progmodes/cc-styles.elc \ - $(lisp)/progmodes/cc-engine.elc - $(lisp)/progmodes/cc-defs.elc: $(lisp)/progmodes/cc-bytecomp.elc $(lisp)/progmodes/cc-engine.elc: $(lisp)/progmodes/cc-langs.elc \ commit 73277a4097bb6c0d7c9ec1042f053584b28af1dd Author: Stefan Kangas Date: Mon Jul 22 18:23:01 2024 +0200 Fix integer overflow when reading XPM * src/image.c (xpm_str_to_int): New function. (xpm_load_image): Replace sscanf with strtol, to correctly handle integer overflow when reading a malformed XPM file. (Bug#72245) diff --git a/src/image.c b/src/image.c index 48694a13341..41eeebff36e 100644 --- a/src/image.c +++ b/src/image.c @@ -19,6 +19,7 @@ along with GNU Emacs. If not, see . */ #include +#include #include #include #include @@ -6244,6 +6245,26 @@ xpm_str_to_color_key (const char *s) return -1; } +static int +xpm_str_to_int (char **buf) +{ + char *p; + + errno = 0; + long result = strtol (*buf, &p, 10); + if (errno || p == *buf || result < INT_MIN || result > INT_MAX) + return -1; + + /* Error out if we see something like "12x3xyz". */ + if (!c_isspace (*p) && *p != '\0') + return -1; + + /* Update position to read next integer. */ + *buf = p; + + return result; +} + static bool xpm_load_image (struct frame *f, struct image *img, @@ -6301,10 +6322,14 @@ xpm_load_image (struct frame *f, goto failure; memcpy (buffer, beg, len); buffer[len] = '\0'; - if (sscanf (buffer, "%d %d %d %d", &width, &height, - &num_colors, &chars_per_pixel) != 4 - || width <= 0 || height <= 0 - || num_colors <= 0 || chars_per_pixel <= 0) + char *next_int = buffer; + if ((width = xpm_str_to_int (&next_int)) <= 0) + goto failure; + if ((height = xpm_str_to_int (&next_int)) <= 0) + goto failure; + if ((num_colors = xpm_str_to_int (&next_int)) <= 0) + goto failure; + if ((chars_per_pixel = xpm_str_to_int (&next_int)) <= 0) goto failure; if (!check_image_size (f, width, height)) commit bca315aa4c44f4dc0feb0324e5e8c2f7b599fec8 Author: Stefan Kangas Date: Sun Sep 1 11:29:36 2024 +0200 Fix broken use-package tests * lisp/use-package/use-package-core.el (use-package-keywords): Change keyword order to match the one before adding :pin, :ensure, :delight, and :diminish directly to this list. This fixes some broken unit tests. diff --git a/lisp/use-package/use-package-core.el b/lisp/use-package/use-package-core.el index 4df7fee3bdd..85091b8338b 100644 --- a/lisp/use-package/use-package-core.el +++ b/lisp/use-package/use-package-core.el @@ -69,17 +69,15 @@ "This version of `use-package'.") (defcustom use-package-keywords - '(:disabled + '(:pin + :ensure + :disabled :load-path :requires :defines :functions :preface :if :when :unless - :ensure - :pin - :delight - :diminish :vc :no-require :catch @@ -105,7 +103,9 @@ :load ;; This must occur almost last; the only forms which should appear after ;; are those that must happen directly after the config forms. - :config) + :config + :diminish + :delight) "The set of valid keywords, in the order they are processed in. The order of this list is *very important*, so it is only advisable to insert new keywords, never to delete or reorder