commit be527b570465dad453f5aebba3c552f14ec98e2b (HEAD, refs/remotes/origin/master) Author: Protesilaos Stavrou Date: Fri Nov 7 08:00:39 2025 +0200 Update modus-themes to version 5.1.0 * doc/misc/modus-themes.org (Build on top of the Modus themes): Bump the version number. (Acknowledgements): Include more names in the Acknowledgements section. * etc/themes/modus-themes.el (modus-themes--activate) (modus-themes-get-all-known-themes, modus-themes-known-p) (modus-themes--list-enabled-themes) (modus-themes-get-current-theme) (modus-themes--get-theme-palette-subr) (modus-themes-get-theme-palette, modus-themes-faces) (modus-themes-theme) (modus-themes--with-colors-resolve-palette-sort) (modus-themes-with-colors-subr, modus-themes-with-colors): Ensure that the modus-themes-with-colors macro works the way it did before, namely, 'let' binding the current theme's palette. diff --git a/doc/misc/modus-themes.org b/doc/misc/modus-themes.org index d470a9c104b..43983505576 100644 --- a/doc/misc/modus-themes.org +++ b/doc/misc/modus-themes.org @@ -4,9 +4,9 @@ #+language: en #+options: ':t toc:nil author:t email:t num:t #+startup: content -#+macro: stable-version 5.0.0 -#+macro: release-date 2025-11-01 -#+macro: development-version 5.1.0-dev +#+macro: stable-version 5.1.0 +#+macro: release-date 2025-11-07 +#+macro: development-version 5.2.0-dev #+macro: file @@texinfo:@file{@@$1@@texinfo:}@@ #+macro: space @@texinfo:@: @@ #+macro: kbd @@texinfo:@kbd{@@$1@@texinfo:}@@ @@ -4169,11 +4169,13 @@ core Emacs. #+findex: modus-themes-theme #+vindex: modus-themes-registered-items -A new theme can be instantiated with the function ~modus-themes-theme~. -It takes care to (i) declare the theme, (ii) add to it relevant -~theme-properties~, (iii) register it in the ~modus-themes-registered-items~, -(iv) make it work with all the faces and customizations documented -in this manual, and (v) ~provide-theme~ the theme. +A new theme exists in a file whose directory is in the ~custom-theme-load-path~. +The theme file is named =NAME-theme.el=. For example, the ~modus-operandi~ +theme is in the file =modus-operandi-theme.el=. A theme object can be +instantiated with the function ~modus-themes-theme~. This function takes care to +(i) declare the theme, (ii) add to it relevant ~theme-properties~, (iii) register +it in the ~modus-themes-registered-items~, (iv) make it work with all the faces +and customizations documented in this manual, and (v) ~provide-theme~ the theme. Concretely, ~modus-themes-theme~ expects the following mandatory arguments: @@ -5963,39 +5965,40 @@ The Modus themes are a collective effort. Every bit of work matters. Adrian Manea, Aleksei Pirogov, Alex Griffin, Alex Koen, Alex Peitsinis, Alexandr Semenov, Alexey Shmalko, Alok Singh, Anders Johansson, André Alexandre Gomes, Andrew Tropin, Antonio Hernández - Blas, Arif Rezai, Augusto Stoffel, Basil L.{{{space()}}} - Contovounesios, Bernd Rellermeyer, Burgess Chang, Charlotte Van - Petegem, Christian Tietze, Christopher Dimech, Christopher League, - Damien Cassou, Daniel Mendler, Dario Gjorgjevski, David Edmondson, - Davor Rotim, Divan Santana, Eliraz Kedmi, Emanuele Michele Alberto - Monterosso, Eshel Yaron, Farasha Euker, Feng Shu, Filippo Argiolas, - Gautier Ponsinet, Gerry Agbobada, Gianluca Recchia, Gonçalo Marrafa, - Guilherme Semente, Gustavo Barros, Hörmetjan Yiltiz, Ilja Kocken, - Imran Khan, Iris Garcia, Ivan Popovych, Jabir Ali Ouassou, James - Ferguson, Jeremy Friesen, Jerry Zhang, Johannes Grødem, John Haman, - John Sullivan, John Wick, Jonas Collberg, Jorge Morais, Joshua - O'Connor, Julio C. Villasante, Kenta Usami, Kevin Fleming, Kévin Le - Gouguec, Kevin Kainan Li, Kostadin Ninev, Laith Bahodi, Lasse - Lindner, Len Trigg, Lennart C.{{{space()}}} Karssen, Luis Miguel - Castañeda, Magne Hov, Manuel Giraud, Manuel Uberti, Mark Bestley, - Mark Burton, Mark Simpson, Marko Kocic, Markus Beppler, Matt - Armstrong, Matthias Fuchs, Mattias Engdegård, Mauro Aranda, Maxime - Tréca, Michael Goldenberg, Morgan Smith, Morgan Willcock, Murilo - Pereira, Nicky van Foreest, Nicolas De Jaeghere, Nicolas Semrau, - Olaf Meeuwissen, Oliver Epper, Pablo Stafforini, Paul Poloskov, - Pengji Zhang, Pete Kazmier, Peter Wu, Philip Kaludercic, Pierre - Téchoueyres, Przemysław Kryger, Robert Hepple, Roman Rudakov, - Russell Sim, Ryan Phillips, Rytis Paškauskas, Rudolf Adamkovič, Sam - Kleinman, Samuel Culpepper, Saša Janiška, Shreyas Ragavan, Simon - Pugnet, Steve Downey, Tassilo Horn, Thanos Apollo, Thibaut Verron, - Thomas Heartman, Togan Muftuoglu, Tony Zorman, Trey Merkley, Tomasz - Hołubowicz, Toon Claes, Uri Sharf, Utkarsh Singh, Vincent Foley, - Zoltan Kiraly. As well as users: Ben, CsBigDataHub1, Emacs Contrib, - Eugene, Fourchaux, Fredrik, Moesasji, Nick, Summer Emacs, TheBlob42, - TitusMu, Trey, bepolymathe, bit9tream, bangedorrunt, case-lambda, - chainedghost, derek-upham, doolio, fleimgruber, gitrj95, iSeeU, - jixiuf, ltmsyvag, okamsn, pedro-nonfree, pRot0ta1p, shimeike, - shipmints, soaringbird, tumashu, wakamenod. + Blas, Arif Rezai, Ashton Wiersdorf, Augusto Stoffel, Basil + L.{{{space()}}} Contovounesios, Bernd Rellermeyer, Burgess Chang, + Charlotte Van Petegem, Christian Tietze, Christopher Dimech, + Christopher League, Damien Cassou, Daniel Mendler, Dario + Gjorgjevski, David Edmondson, Davor Rotim, Divan Santana, Eliraz + Kedmi, Emanuele Michele Alberto Monterosso, Eshel Yaron, Farasha + Euker, Feng Shu, Filippo Argiolas, Gautier Ponsinet, Gerry Agbobada, + Gianluca Recchia, Gonçalo Marrafa, Guilherme Semente, Gustavo + Barros, Hörmetjan Yiltiz, Ilja Kocken, Imran Khan, Iris Garcia, Ivan + Popovych, Jabir Ali Ouassou, James Ferguson, Jeremy Friesen, Jerry + Zhang, Johannes Grødem, John Haman, John Sullivan, John Wick, Jonas + Collberg, Jorge Morais, Joshua O'Connor, Julio C. Villasante, Kenta + Usami, Kevin Fleming, Kévin Le Gouguec, Kevin Kainan Li, Kostadin + Ninev, Laith Bahodi, Lasse Lindner, Len Trigg, Lennart + C.{{{space()}}} Karssen, Luis Miguel Castañeda, Magne Hov, Manuel + Giraud, Manuel Uberti, Mark Bestley, Mark Burton, Mark Simpson, + Marko Kocic, Markus Beppler, Matt Armstrong, Matthias Fuchs, Mattias + Engdegård, Mauro Aranda, Maxime Tréca, Michael Goldenberg, Morgan + Smith, Morgan Willcock, Murilo Pereira, Nicky van Foreest, Nicolas + De Jaeghere, Nicolas Semrau, Olaf Meeuwissen, Oliver Epper, Pablo + Stafforini, Paul Poloskov, Pengji Zhang, Pete Kazmier, Peter Wu, + Philip Kaludercic, Pierre Téchoueyres, Przemysław Kryger, Robert + Hepple, Roman Rudakov, Russell Sim, Ryan Phillips, Rytis Paškauskas, + Rudolf Adamkovič, Sam Kleinman, Samuel Culpepper, Saša Janiška, + Shreyas Ragavan, Simon Pugnet, Stéphane Marks, Steve Downey, Tassilo + Horn, Thanos Apollo, Thibaut Verron, Thomas Heartman, Togan + Muftuoglu, Tony Zorman, Trey Merkley, Tomasz Hołubowicz, Toon Claes, + Uri Sharf, Utkarsh Singh, Vincent Foley, Zoltan Kiraly. As well as + users: Ben, CsBigDataHub1, Emacs Contrib, Eugene, Fourchaux, + Fredrik, Moesasji, Nick, Summer Emacs, TheBlob42, TitusMu, Trey, + bepolymathe, bit9tream, bangedorrunt, case-lambda, chainedghost, + derek-upham, doolio, fleimgruber, gitrj95, iSeeU, jixiuf, ltmsyvag, + okamsn, pedro-nonfree, pRot0ta1p, shimeike, shipmints, soaringbird, + tumashu, wakamenod. + Packaging :: Basil L.{{{space()}}} Contovounesios, Eli Zaretskii, Glenn Morris, Mauro Aranda, Richard Stallman, Stefan Kangas (core diff --git a/etc/themes/modus-themes.el b/etc/themes/modus-themes.el index 4a57941d238..3bcc190b174 100644 --- a/etc/themes/modus-themes.el +++ b/etc/themes/modus-themes.el @@ -5,7 +5,7 @@ ;; Author: Protesilaos Stavrou ;; Maintainer: Protesilaos Stavrou ;; URL: https://github.com/protesilaos/modus-themes -;; Version: 5.0.0 +;; Version: 5.1.0 ;; Package-Requires: ((emacs "28.1")) ;; Keywords: faces, theme, accessibility @@ -3779,7 +3779,7 @@ Also see `modus-themes-get-themes'.") ;; `custom-known-themes' because loading the theme has the desired ;; side effect of adding the relevant `theme-properties' to it. (unless (and (memq theme modus-themes--activated-themes) - (custom-theme-p theme)) + (custom-theme-p theme)) (load-theme theme t t) (add-to-list 'modus-themes--activated-themes theme))) @@ -3789,18 +3789,21 @@ Also see `modus-themes-get-themes'.") (theme-family (plist-get properties :family))) (eq theme-family family))) -(defun modus-themes-get-all-known-themes (&optional theme-family) +(defun modus-themes-get-all-known-themes (&optional theme-family no-enable) "Return all known Modus themes or derivatives, enabling them if needed. With optional THEME-FAMILY, operate only on the themes whose :family property is that. Else consider the Modus themes as well as all their derivatives. +With optional NO-ENABLE, do not try to enable the themes. + Also see `modus-themes-sort'." (let ((themes (pcase theme-family ('modus-themes modus-themes-items) ((pred (not null)) modus-themes-registered-items) (_ (seq-union modus-themes-items modus-themes-registered-items))))) - (mapc #'modus-themes--activate themes) + (unless no-enable + (mapc #'modus-themes--activate themes)) (if theme-family (seq-filter (lambda (theme) @@ -3833,54 +3836,55 @@ Use `modus-themes-sort' to sort by light and then dark background." sorted-themes modus-themes-items)) -(defun modus-themes-known-p (themes &optional show-error) +(defun modus-themes-known-p (themes) "Return THEMES if they are among `modus-themes-get-themes' else nil. THEMES is either a list of symbols, like `modus-themes-items' or a symbol. With optional SHOW-ERROR, throw an error instead of returning nil." - (condition-case data - (let ((themes (if (listp themes) themes (list themes))) - (known-themes (modus-themes-get-themes))) - (dolist (theme themes) - (or (memq theme known-themes) - (error "`%s' is not part of whant `modus-themes-get-themes' returns" theme)))) - (:success - themes) - (error - (when show-error - (signal (car data) (list (apply #'format-message (cdr data)))))))) - -(defun modus-themes--list-enabled-themes () - "Return list of known `custom-enabled-themes'." - (seq-intersection (modus-themes-get-themes) custom-enabled-themes)) - -(defun modus-themes-get-current-theme () - "Return first enabled Modus theme." - (car (modus-themes--list-enabled-themes))) + (let ((known-themes (modus-themes-get-all-known-themes))) + (cond + ((symbolp themes) + (memq themes known-themes)) + ((listp themes) + (when (seq-every-p (lambda (theme) (memq theme known-themes)) themes) + themes)) + (t + (error "Themes `%S' is not a symbol or a list of symbols" themes))))) + +(defun modus-themes-get-current-theme (&optional no-enable) + "Return current enabled Modus theme. +With optional NO-ENABLE, do not try to enable any themes." + (let ((current (car custom-enabled-themes))) + (when (memq current (modus-themes-get-all-known-themes nil no-enable)) + current))) (defun modus-themes--get-theme-palette-subr (theme with-overrides with-user-palette) "Get THEME palette without `modus-themes-known-p'. WITH-OVERRIDES and WITH-USER-PALETTE are described in -`modus-themes-get-theme-palette'." - (if-let* ((properties (get theme 'theme-properties)) - (core-palette (symbol-value (plist-get properties :modus-core-palette)))) - (let* ((user-palette (when with-user-palette (symbol-value (plist-get properties :modus-user-palette)))) - (overrides-palette (when with-overrides (symbol-value (plist-get properties :modus-overrides-palette)))) - (all-overrides (when with-overrides - (append overrides-palette modus-themes-common-palette-overrides)))) - (append all-overrides user-palette core-palette)) - (error "The theme must have at least a `:modus-core-palette' property"))) +`modus-themes-get-theme-palette'. + +If THEME does not have at least a `:modus-core-palette' among its +`theme-properties', return nil." + (when-let* ((properties (get theme 'theme-properties)) + (core-palette (symbol-value (plist-get properties :modus-core-palette)))) + (let* ((user-palette (when with-user-palette (symbol-value (plist-get properties :modus-user-palette)))) + (overrides-palette (when with-overrides (symbol-value (plist-get properties :modus-overrides-palette)))) + (all-overrides (when with-overrides (append overrides-palette modus-themes-common-palette-overrides)))) + (append all-overrides user-palette core-palette)))) (defun modus-themes-get-theme-palette (&optional theme with-overrides with-user-palette) "Return palette value of active `modus-themes-get-themes' THEME. If THEME is nil, use the return value of `modus-themes-get-current-theme'. With WITH-OVERRIDES, include all overrides in the combined palette. With WITH-USER-PALETTE do the same for the user-defined palette -extension." - (let ((theme (or theme (modus-themes-get-current-theme)))) - (when (modus-themes-known-p theme :err-if-needed) - (modus-themes--get-theme-palette-subr theme with-overrides with-user-palette)))) +extension. + +If THEME is unknown, return nil." + (modus-themes--get-theme-palette-subr + (or theme (modus-themes-get-current-theme)) + with-overrides + with-user-palette)) (defun modus-themes--disable-themes () "Disable themes per `modus-themes-disable-other-themes'." @@ -5709,7 +5713,7 @@ FG and BG are the main colors." `(jabber-roster-user-dnd ((,c :foreground ,warning))) `(jabber-roster-user-chatty ((,c :foreground ,warning))) `(jabber-roster-user-error ((,c :foreground ,err))) - `(jabber-roster-user-offline ((,c :foreground ,fg-dim :strike-through t))) + `(jabber-roster-user-offline ((,c :foreground ,fg-dim))) `(jabber-roster-user-online ((,c :inherit modus-themes-bold :foreground ,info))) `(jabber-chat-prompt-foreign ((,c :inherit modus-themes-bold :foreground ,err))) `(jabber-chat-prompt-system ((,c :foreground ,warning))) @@ -5967,7 +5971,7 @@ FG and BG are the main colors." `(markdown-header-face-6 ((,c :inherit modus-themes-heading-6))) `(markdown-highlighting-face ((,c :background ,bg-hover-secondary :foreground ,fg-main))) `(markdown-inline-code-face ((,c :inherit modus-themes-fixed-pitch :background ,bg-prose-code :foreground ,fg-prose-code))) - `(markdown-italic-face ((,c :inherit modus-themes-slant))) + `(markdown-italic-face ((,c :inherit italic))) `(markdown-language-keyword-face ((,c :inherit modus-themes-fixed-pitch :background ,bg-prose-block-delimiter :foreground ,fg-prose-block-delimiter))) `(markdown-line-break-face ((,c :foreground ,err :underline t))) `(markdown-link-face ((,c :background ,bg-link :foreground ,fg-link :underline ,underline-link))) @@ -7291,31 +7295,47 @@ Consult the manual for details on how to build a theme on top of the ,@faces) (custom-theme-set-variables ',name - ,@variables)))) + ,@variables)) + :lexical)) (unless theme-exists-p (provide-theme name)))) ;;;; Use theme colors +(defun modus-themes--with-colors-resolve-palette-sort (colors) + "Sort all COLORS in the theme's palette. +Put all named colors before semantic color mappings. A named color is a +symbol whose value is a string. A semantic color mapping is a symbol +whose value is another symbol, which ultimately resolves to a string or +`unspecified'." + (let ((named nil) + (semantic nil)) + (dolist (color colors) + (if (stringp (cadr color)) + (push color named) + (push color semantic))) + (seq-uniq + (nconc (nreverse named) (nreverse semantic)) + (lambda (elt1 elt2) + (eq (car elt1) (car elt2)))))) + +(defun modus-themes-with-colors-subr (expressions) + "Do the work of `modus-themes-with-colors' for EXPRESSIONS." + (condition-case data + (when-let* ((theme (modus-themes-get-current-theme :no-enable))) + (eval + `(let* ((c '((class color) (min-colors 256))) + (unspecified 'unspecified) + ,@(modus-themes--with-colors-resolve-palette-sort + (modus-themes--get-theme-palette-subr theme :with-overrides :with-user-palette))) + ,@expressions) + :lexical)) + (error (message "Error in `modus-themes-with-colors': %s" data)))) + (defmacro modus-themes-with-colors (&rest body) "Evaluate BODY with colors from current palette bound." (declare (indent 0)) - (let* ((sym (gensym)) - (palette (modus-themes-get-theme-palette nil :with-overrides :with-user-palette)) - ;; NOTE 2022-08-23: We just give it a sample palette at this - ;; stage. It only needs to collect each car. Then we - ;; instantiate the actual theme's palette. We have to do this - ;; otherwise the macro does not work properly when called from - ;; inside a function. - (colors (mapcar #'car palette))) - `(let* ((c '((class color) (min-colors 256))) - (,sym (modus-themes-get-theme-palette nil :with-overrides :with-user-palette)) - ,@(mapcar (lambda (color) - (list color - `(modus-themes--retrieve-palette-value ',color ,sym))) - colors)) - (ignore c ,@colors) ; Silence unused variable warnings - ,@body))) + `(modus-themes-with-colors-subr ',body)) ;;;; Declare all the Modus themes commit aba79746072e38fdadddd7dc1609f3defdcaa6d9 Author: Po Lu Date: Fri Nov 7 09:36:08 2025 +0800 * configure.ac Remove patch for bugs in nproc that have been remediated. diff --git a/configure.ac b/configure.ac index ccc8719c091..44d9cae1e7e 100644 --- a/configure.ac +++ b/configure.ac @@ -1599,12 +1599,6 @@ AC_DEFUN([gl_CRYPTO_CHECK]) # Avoid gnulib's tests for HAVE_WORKING_O_NOATIME and HAVE_WORKING_O_NOFOLLOW, # as we don't use them. AC_DEFUN([gl_FCNTL_O_FLAGS]) -# Disable nproc.c's usage of mntent.h if setmntent is undefined, as on -# Android SDK <= 20. -AC_DEFUN([gl_PREREQ_NPROC], - [AS_IF([test "$opsys" = "android"], - [AC_CHECK_DECL([setmntent], [], [ac_cv_header_mntent_h=no], - [[#include ]])])]m4_defn([gl_PREREQ_NPROC])) # Avoid gnulib's test for pthread_sigmask. funcs= for func in $ac_func_list; do commit eb69aca76074ef71d6d7bb4e98f3c44fe36f64e6 Author: Paul Eggert Date: Thu Nov 6 14:34:59 2025 -0800 Update from Gnulib by running admin/merge-gnulib diff --git a/lib/stdio-consolesafe.c b/lib/stdio-consolesafe.c index b5ca8cc0125..80561a6da4e 100644 --- a/lib/stdio-consolesafe.c +++ b/lib/stdio-consolesafe.c @@ -74,11 +74,11 @@ gl_consolesafe_fwrite (const void *ptr, size_t size, size_t nmemb, FILE *fp) #if defined __MINGW32__ && __USE_MINGW_ANSI_STDIO # include "fseterr.h" +# include # if !HAVE_VASPRINTF # include -# include /* The old mingw (before mingw-w64) does not have the vasprintf function. Define a suitable replacement here, that supports the same format commit 50a1929f6c0a8509b0b695b3aac25fbf70b8ffd6 Author: Paul Eggert Date: Thu Nov 6 12:11:48 2025 -0800 Update from Gnulib by running admin/merge-gnulib diff --git a/lib/stdio-consolesafe.c b/lib/stdio-consolesafe.c index fbea20be224..b5ca8cc0125 100644 --- a/lib/stdio-consolesafe.c +++ b/lib/stdio-consolesafe.c @@ -75,6 +75,56 @@ gl_consolesafe_fwrite (const void *ptr, size_t size, size_t nmemb, FILE *fp) # include "fseterr.h" +# if !HAVE_VASPRINTF + +# include +# include + +/* The old mingw (before mingw-w64) does not have the vasprintf function. + Define a suitable replacement here, that supports the same format + specifiers as the mingw *printf functions. */ + +static int +vasprintf (char **resultp, const char *format, va_list args) +{ + /* First try: Use a stack-allocated buffer. */ + char buf[2048]; + size_t bufsize = sizeof (buf); + int ret = __mingw_vsnprintf (buf, bufsize, format, args); + if (ret < 0) + return -1; + size_t nbytes = ret; + char *mem = (char *) malloc (nbytes + 1); + if (mem == NULL) + { + errno = ENOMEM; + return -1; + } + if (ret < bufsize) + { + /* The buffer was sufficiently large. */ + memcpy (mem, buf, nbytes + 1); + } + else + { + /* Second try: Use the heap-allocated memory. */ + ret = __mingw_vsnprintf (mem, nbytes + 1, format, args); + if (ret < 0) + { + int saved_errno = errno; + free (mem); + errno = saved_errno; + return -1; + } + if (ret != nbytes) + abort (); + } + *resultp = mem; + return nbytes; +} + +# endif + /* Bypass the functions __mingw_[v][f]printf, that trigger a bug in msvcrt, but without losing the support for modern format specifiers added by __mingw_*printf. */ diff --git a/m4/gnulib-comp.m4 b/m4/gnulib-comp.m4 index fea8b7d684b..3199de24209 100644 --- a/m4/gnulib-comp.m4 +++ b/m4/gnulib-comp.m4 @@ -608,6 +608,7 @@ AC_DEFUN([gl_INIT], ;; esac gl_CONDITIONAL([GL_COND_OBJ_STDIO_CONSOLESAFE], [test $USES_MSVCRT = 1]) + AC_CHECK_FUNCS([vasprintf]) gl_STDLIB_H gl_STDLIB_H_REQUIRE_DEFAULTS AC_PROG_MKDIR_P commit 7654ec5e953f25499cfabe7da08e10d94379781f Author: Paul Eggert Date: Thu Nov 6 10:58:30 2025 -0800 Update from Gnulib by running admin/merge-gnulib * admin/merge-gnulib (GNULIB_MODULES): Add stdio-windows. Also, sort and remove duplicates. diff --git a/admin/merge-gnulib b/admin/merge-gnulib index 61c386c3e35..7474a0a4a57 100755 --- a/admin/merge-gnulib +++ b/admin/merge-gnulib @@ -48,10 +48,10 @@ GNULIB_MODULES=' qcopy-acl readlink readlinkat realloc-posix regex sig2str sigdescr_np socklen stat-time std-gnu11 stdc_bit_width stdc_count_ones stdc_trailing_zeros - stdckdint-h stddef-h stdio-h - stpcpy stringeq strnlen strnlen strtoimax symlink sys_stat-h sys_time-h + stdckdint-h stddef-h stdio-h stdio-windows + stpcpy stringeq strnlen strtoimax symlink sys_stat-h sys_time-h tempname time-h time_r time_rz timegm timer-time timespec-add timespec-sub - update-copyright unlocked-io utimensat + unlocked-io update-copyright utimensat vla warnings year2038 ' diff --git a/lib/acl_entries.c b/lib/acl_entries.c index b78ba18a656..7b44e694896 100644 --- a/lib/acl_entries.c +++ b/lib/acl_entries.c @@ -22,7 +22,10 @@ #include "acl-internal.h" /* This file assumes POSIX-draft like ACLs - (Linux, FreeBSD, NetBSD >= 10, Mac OS X, Cygwin >= 2.5). */ + (Linux, FreeBSD, NetBSD >= 10, Mac OS X, Cygwin >= 2.5). + + It is compiled only on systems that do not have the acl_entries() function + (in libc or libacl). */ /* Return the number of entries in ACL. Return -1 and set errno upon failure to determine it. */ @@ -34,7 +37,8 @@ acl_entries (acl_t acl) if (acl != NULL) { -#if HAVE_ACL_TYPE_EXTENDED /* Mac OS X */ +#if HAVE_ACL_FIRST_ENTRY /* Linux, FreeBSD, NetBSD >= 10, Mac OS X, Cygwin >= 2.5 */ +# if HAVE_ACL_TYPE_EXTENDED /* Mac OS X */ /* acl_get_entry returns 0 when it successfully fetches an entry, and -1/EINVAL at the end. */ acl_entry_t ace; @@ -44,7 +48,7 @@ acl_entries (acl_t acl) got_one >= 0; got_one = acl_get_entry (acl, ACL_NEXT_ENTRY, &ace)) count++; -#else /* Linux, FreeBSD, NetBSD >= 10, Cygwin >= 2.5 */ +# else /* Linux, FreeBSD, NetBSD >= 10, Cygwin >= 2.5 */ /* acl_get_entry returns 1 when it successfully fetches an entry, and 0 at the end. */ acl_entry_t ace; @@ -56,6 +60,7 @@ acl_entries (acl_t acl) count++; if (got_one < 0) return -1; +# endif #endif } diff --git a/lib/gnulib.mk.in b/lib/gnulib.mk.in index f158acef91f..e655023878e 100644 --- a/lib/gnulib.mk.in +++ b/lib/gnulib.mk.in @@ -166,7 +166,9 @@ # stdckdint-h \ # stddef-h \ # stdio-h \ +# stdio-windows \ # stpcpy \ +# stringeq \ # strnlen \ # strtoimax \ # symlink \ @@ -295,6 +297,7 @@ GIF_CFLAGS = @GIF_CFLAGS@ GL_CFLAG_ALLOW_WARNINGS = @GL_CFLAG_ALLOW_WARNINGS@ GL_CFLAG_GNULIB_WARNINGS = @GL_CFLAG_GNULIB_WARNINGS@ GL_COND_LIBTOOL_CONDITION = @GL_COND_LIBTOOL_CONDITION@ +GL_COND_OBJ_ACL_ENTRIES_CONDITION = @GL_COND_OBJ_ACL_ENTRIES_CONDITION@ GL_COND_OBJ_CANONICALIZE_LGPL_CONDITION = @GL_COND_OBJ_CANONICALIZE_LGPL_CONDITION@ GL_COND_OBJ_COPY_FILE_RANGE_CONDITION = @GL_COND_OBJ_COPY_FILE_RANGE_CONDITION@ GL_COND_OBJ_DIRFD_CONDITION = @GL_COND_OBJ_DIRFD_CONDITION@ @@ -1588,10 +1591,11 @@ endif ifeq (,$(OMIT_GNULIB_MODULE_acl-permissions)) libgnu_a_SOURCES += acl-errno-valid.c acl-internal.c get-permissions.c set-permissions.c +ifneq (,$(GL_COND_OBJ_ACL_ENTRIES_CONDITION)) +libgnu_a_SOURCES += acl_entries.c +endif -EXTRA_DIST += acl-internal.h acl.h acl_entries.c - -EXTRA_libgnu_a_SOURCES += acl_entries.c +EXTRA_DIST += acl-internal.h acl.h endif ## end gnulib module acl-permissions @@ -3502,9 +3506,6 @@ stdio.h: stdio.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H) $(AM_V_at)mv $@-t3 $@ MOSTLYCLEANFILES += stdio.h stdio.h-t1 stdio.h-t2 stdio.h-t3 -ifneq (,$(GL_COND_OBJ_STDIO_CONSOLESAFE_CONDITION)) -libgnu_a_SOURCES += stdio-consolesafe.c -endif ifneq (,$(GL_COND_OBJ_STDIO_READ_CONDITION)) libgnu_a_SOURCES += stdio-read.c endif @@ -3517,6 +3518,16 @@ EXTRA_DIST += stdio.in.h endif ## end gnulib module stdio-h +## begin gnulib module stdio-windows +ifeq (,$(OMIT_GNULIB_MODULE_stdio-windows)) + +ifneq (,$(GL_COND_OBJ_STDIO_CONSOLESAFE_CONDITION)) +libgnu_a_SOURCES += stdio-consolesafe.c +endif + +endif +## end gnulib module stdio-windows + ## begin gnulib module stdlib-h ifeq (,$(OMIT_GNULIB_MODULE_stdlib-h)) diff --git a/lib/nproc.c b/lib/nproc.c index e899ff17620..9404be1d384 100644 --- a/lib/nproc.c +++ b/lib/nproc.c @@ -22,7 +22,7 @@ #include #include -#if HAVE_MNTENT_H +#if HAVE_SETMNTENT # include #endif #include @@ -385,7 +385,7 @@ cgroup2_mount (void) if (access ("/sys/fs/cgroup/cgroup.controllers", F_OK) == 0) return strdup ("/sys/fs/cgroup"); -#if HAVE_MNTENT_H +#if HAVE_SETMNTENT /* Otherwise look for the mount point. */ struct mntent *mnt; if (! (fp = setmntent ("/proc/mounts", "r"))) diff --git a/m4/acl.m4 b/m4/acl.m4 index 0ab7d34e2d2..e68ed377ba9 100644 --- a/m4/acl.m4 +++ b/m4/acl.m4 @@ -1,5 +1,5 @@ # acl.m4 -# serial 39 +# serial 40 dnl Copyright (C) 2002, 2004-2025 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -28,6 +28,7 @@ AC_DEFUN_ONCE([gl_FUNC_ACL], AC_CHECK_FUNCS_ONCE([fchmod]) LIB_ACL= use_acl=0 + NEED_ACL_ENTRIES=0 if test "$enable_acl" != no; then dnl On all platforms, the ACL related API is declared in . AC_CHECK_HEADERS([sys/acl.h]) @@ -55,7 +56,10 @@ AC_DEFUN_ONCE([gl_FUNC_ACL], if test $use_acl = 1; then dnl On GNU/Linux, an additional API is declared in . AC_CHECK_HEADERS([acl/libacl.h]) - AC_REPLACE_FUNCS([acl_entries]) + AC_CHECK_FUNC([acl_entries], + [AC_DEFINE([HAVE_ACL_ENTRIES], [1], + [Define to 1 if libc or libacl defines the function acl_entries.])], + [NEED_ACL_ENTRIES=1]) AC_CACHE_CHECK([for ACL_FIRST_ENTRY], [gl_cv_acl_ACL_FIRST_ENTRY], [AC_COMPILE_IFELSE([AC_LANG_PROGRAM( diff --git a/m4/gnulib-comp.m4 b/m4/gnulib-comp.m4 index b80c5c84a0b..fea8b7d684b 100644 --- a/m4/gnulib-comp.m4 +++ b/m4/gnulib-comp.m4 @@ -192,6 +192,7 @@ AC_DEFUN([gl_EARLY], # Code from module stdint-h: # Code from module stdio-h: gl_STDIO_H_EARLY + # Code from module stdio-windows: # Code from module stdlib-h: # Code from module stpcpy: # Code from module string-h: @@ -250,6 +251,7 @@ AC_DEFUN([gl_INIT], gl_source_base='lib' gl_source_base_prefix= gl_FUNC_ACL + gl_CONDITIONAL([GL_COND_OBJ_ACL_ENTRIES], [test $NEED_ACL_ENTRIES = 1]) gl_ALIGNASOF gl_FUNC_ALLOCA gl_CONDITIONAL_HEADER([alloca.h]) @@ -568,18 +570,6 @@ AC_DEFUN([gl_INIT], gl_STDIO_H gl_STDIO_H_REQUIRE_DEFAULTS AC_PROG_MKDIR_P - USES_MSVCRT=0 - case "$host_os" in - mingw* | windows*) - AC_EGREP_CPP([Special], [ - #ifndef _UCRT - Special - #endif - ], - [USES_MSVCRT=1]) - ;; - esac - gl_CONDITIONAL([GL_COND_OBJ_STDIO_CONSOLESAFE], [test $USES_MSVCRT = 1]) gl_CONDITIONAL([GL_COND_OBJ_STDIO_READ], [test $REPLACE_STDIO_READ_FUNCS = 1]) gl_CONDITIONAL([GL_COND_OBJ_STDIO_WRITE], [test $REPLACE_STDIO_WRITE_FUNCS = 1]) dnl No need to create extra modules for these functions. Everyone who uses @@ -605,6 +595,19 @@ AC_DEFUN([gl_INIT], gl_STDIO_MODULE_INDICATOR([fputs]) gl_STDIO_MODULE_INDICATOR([puts]) gl_STDIO_MODULE_INDICATOR([fwrite]) + AC_REQUIRE([AC_CANONICAL_HOST]) + USES_MSVCRT=0 + case "$host_os" in + mingw* | windows*) + AC_EGREP_CPP([Special], [ + #ifndef _UCRT + Special + #endif + ], + [USES_MSVCRT=1]) + ;; + esac + gl_CONDITIONAL([GL_COND_OBJ_STDIO_CONSOLESAFE], [test $USES_MSVCRT = 1]) gl_STDLIB_H gl_STDLIB_H_REQUIRE_DEFAULTS AC_PROG_MKDIR_P diff --git a/m4/nproc.m4 b/m4/nproc.m4 index 9225779585a..e9fba1533ca 100644 --- a/m4/nproc.m4 +++ b/m4/nproc.m4 @@ -1,5 +1,5 @@ # nproc.m4 -# serial 7 +# serial 8 dnl Copyright (C) 2009-2025 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -19,6 +19,10 @@ AC_DEFUN([gl_PREREQ_NPROC], AC_CHECK_HEADERS([mntent.h sys/pstat.h sys/param.h],,, [AC_INCLUDES_DEFAULT]) + gl_CHECK_FUNCS_ANDROID([setmntent], + [[#include + #include + ]]) dnl requires on OpenBSD 4.0. AC_CHECK_HEADERS([sys/sysctl.h],,, [AC_INCLUDES_DEFAULT commit 0c694624c3b2aec6a8d036bbbb8c30b83437631b Author: Mattias Engdegård Date: Thu Nov 6 16:22:13 2025 +0100 * test/src/comp-tests.el (setcarcdr): Don't mutate literals. diff --git a/test/src/comp-tests.el b/test/src/comp-tests.el index 879fda6f9c1..e9f4b1ad508 100644 --- a/test/src/comp-tests.el +++ b/test/src/comp-tests.el @@ -146,7 +146,7 @@ Check that the resulting binaries do not differ." (should (= (comp-tests-aref-aset-f) 100))) (comp-deftest symbol-value () - "Testing aref and aset." + "Testing `symbol-value'." (should (= (comp-tests-symbol-value-f) 3))) (comp-deftest concat () @@ -260,8 +260,8 @@ Check that the resulting binaries do not differ." (comp-deftest setcarcdr () "Testing setcar setcdr." - (should (equal (comp-tests-setcar-f '(10 . 10) 3) '(3 . 10))) - (should (equal (comp-tests-setcdr-f '(10 . 10) 3) '(10 . 3))) + (should (equal (comp-tests-setcar-f (cons 10 10) 3) '(3 . 10))) + (should (equal (comp-tests-setcdr-f (cons 10 10) 3) '(10 . 3))) (should-error (comp-tests-setcar-f 3 10) :type 'wrong-type-argument) (should-error (comp-tests-setcdr-f 3 10) commit bd4ac3b23b1b890831d8cfc080b015bc5988c063 Author: Sean Whitton Date: Thu Nov 6 14:34:24 2025 +0000 Fixes to echo area messages when creating Log Edit mode buffers * lisp/vc/log-edit.el (log-edit): Don't emit a message when MODE. * lisp/vc/vc-dispatcher.el (vc-start-logentry): Use '\\<>' to simplify the code slightly. diff --git a/lisp/vc/log-edit.el b/lisp/vc/log-edit.el index 19f5b7f2296..c095c7ab67d 100644 --- a/lisp/vc/log-edit.el +++ b/lisp/vc/log-edit.el @@ -560,8 +560,12 @@ done. Otherwise, this function will use the current buffer." (erase-buffer) (run-hooks 'log-edit-hook)) (push-mark (point-max)) - (message "%s" (substitute-command-keys - "Press \\[log-edit-done] when you are done editing.")))) + ;; `vc-start-logentry' already emits a message; avoid a duplicate, + ;; and ensure we don't emit one at all in the case of doing the + ;; action immediately. + (unless mode + (message "%s" (substitute-command-keys + "Press \\[log-edit-done] when you are done editing."))))) (define-derived-mode log-edit-mode text-mode "Log-Edit" "Major mode for editing version-control (VC) commit log messages. diff --git a/lisp/vc/vc-dispatcher.el b/lisp/vc/vc-dispatcher.el index 153c0985119..dbf5b28fc04 100644 --- a/lisp/vc/vc-dispatcher.el +++ b/lisp/vc/vc-dispatcher.el @@ -871,9 +871,7 @@ DIFF-FUNCTION is `log-edit-diff-function' for the Log Edit buffer." (when (stringp comment) (insert comment))) (if (or (not comment) initial-contents) (message (substitute-command-keys - (if (eq major-mode 'log-edit-mode) - "%s Type \\[log-edit-done] when done" - "%s Type \\`C-c C-c' when done")) + "%s Type \\\\[log-edit-done] when done") msg) (vc-finish-logentry (eq comment t))))) commit 3035e44b9ae2b662a17e687f6d4546f0d4bae7d8 Author: Robert Pluim Date: Thu Nov 6 14:23:42 2025 +0100 Improve error message for invalid key syntax * lisp/keymap.el: (keymap--compile-check, define-keymap--compile): Mention 'key-valid-p' rather than 'kbd'. diff --git a/lisp/keymap.el b/lisp/keymap.el index b418d157619..95e1ebc48fb 100644 --- a/lisp/keymap.el +++ b/lisp/keymap.el @@ -39,7 +39,7 @@ (dolist (key keys) (when (or (vectorp key) (and (stringp key) (not (key-valid-p key)))) - (byte-compile-warn "Invalid `kbd' syntax: %S" key)))) + (byte-compile-warn "Invalid `key-valid-p' syntax: %S" key)))) (defun keymap-set (keymap key definition) "Set KEY to DEFINITION in KEYMAP. @@ -585,7 +585,7 @@ If MESSAGE (and interactively), message the result." (let* ((wargs args) (key (pop args))) (when (and (stringp key) (not (key-valid-p key))) - (byte-compile-warn-x wargs "Invalid `kbd' syntax: %S" key))) + (byte-compile-warn-x wargs "Invalid `key-valid-p' syntax: %S" key))) (when (null args) (byte-compile-warn-x form "Uneven number of key bindings in %S" form)) (setq args (cdr args))) commit 8b241f93b7de0a8baac40d346b95cbb0777f99b3 Author: Sean Whitton Date: Sun Oct 19 15:57:16 2025 +0100 project-compile: Ignore compile-command from vc-compilation-mode * lisp/progmodes/project.el (project-compile): Ignore compile-command from vc-compilation-mode (bug#79658). * lisp/vc/vc-dispatcher.el (vc-compilation-mode-hook): New variable. (vc-compilation-mode): Promote to its own derived mode. Don't use define-derived-mode in order to preserve the BACKEND argument to this function. Don't give it its own major mode map, et cetera, for now. diff --git a/lisp/progmodes/project.el b/lisp/progmodes/project.el index 43274e01845..1c510f34b40 100644 --- a/lisp/progmodes/project.el +++ b/lisp/progmodes/project.el @@ -1642,7 +1642,14 @@ If non-nil, it overrides `compilation-buffer-name-function' for (let ((default-directory (project-root (project-current t))) (compilation-buffer-name-function (or project-compilation-buffer-name-function - compilation-buffer-name-function))) + compilation-buffer-name-function)) + ;; Specifically ignore the value of `compile-command' if we were + ;; invoked from a `vc-compilation-mode' buffer because for + ;; `project-compile' we know the user wants to build the + ;; project, not re-run a VC pull or push operation (bug#79658). + (compile-command (if (derived-mode-p 'vc-compilation-mode) + (with-temp-buffer compile-command) + compile-command))) (call-interactively #'compile))) ;;;###autoload diff --git a/lisp/vc/vc-dispatcher.el b/lisp/vc/vc-dispatcher.el index 54154190dad..153c0985119 100644 --- a/lisp/vc/vc-dispatcher.el +++ b/lisp/vc/vc-dispatcher.el @@ -548,17 +548,28 @@ Display the buffer in some window, but don't select it." (defvar compilation-error-regexp-alist) +(defvar vc-compilation-mode-hook nil + "Hook run after entering `vc-compilation-mode'. +No problems result if this variable is not bound. +`add-hook' automatically binds it. (This is true for all hook variables.)") + +(derived-mode-set-parent 'vc-compilation-mode 'compilation-mode) + (defun vc-compilation-mode (backend) - "Setup `compilation-mode' with the appropriate `compilation-error-regexp-alist'." - (require 'compile) - (let* ((error-regexp-alist - (vc-make-backend-sym backend 'error-regexp-alist)) - (error-regexp-alist (and (boundp error-regexp-alist) - (symbol-value error-regexp-alist)))) - (let ((compilation-error-regexp-alist error-regexp-alist)) - (compilation-mode)) - (setq-local compilation-error-regexp-alist - error-regexp-alist))) + "Compilation mode for buffers with output from VC commands. +Sets `compilation-error-regexp-alist' in accordance with the VC backend." + (delay-mode-hooks + (let* ((error-regexp-alist + (vc-make-backend-sym backend 'error-regexp-alist)) + (error-regexp-alist (and (boundp error-regexp-alist) + (symbol-value error-regexp-alist)))) + (let ((compilation-error-regexp-alist error-regexp-alist)) + (compilation-mode) + (setq mode-name "VC-Compilation" + major-mode 'vc-compilation-mode)) + (setq-local compilation-error-regexp-alist + error-regexp-alist))) + (run-mode-hooks 'vc-compilation-mode-hook)) (declare-function vc-dir-refresh "vc-dir" ()) commit fba8b3dfb09293bd1571ff025a6c46471cfb79f5 Author: Sean Whitton Date: Thu Nov 6 12:56:50 2025 +0000 ; * lisp/subr.el: Fix comment level. diff --git a/lisp/subr.el b/lisp/subr.el index 1ed57765b12..fcf931b64e9 100644 --- a/lisp/subr.el +++ b/lisp/subr.el @@ -2757,33 +2757,33 @@ Affects only hooks run in the current buffer." ,@body))) ;;; `if-let*' and friends. -;;; -;;; We considered adding a `cond-let*' in late 2025: -;;; . -;;; We decided to add the `bind-and*' clause type to `cond*' instead. -;;; At first it seems simple to extend `if-let*'/`when-let*'/`and-let*' -;;; to `cond', but the extension is not unambiguous: there are multiple -;;; useful, incompatible ways to do it. -;;; In particular, it quickly becomes clear that one wants clauses that -;;; only establish bindings for proceeding clauses, instead of exiting -;;; the `cond-let*'. But then -;;; - Should these bindings be just like in `let*', or like in -;;; `if-let*'? In other words, should it be that if a binding -;;; evaluates to nil we skip the remaining bindings (bind them all to -;;; nil)? Both ways of doing it seem useful. -;;; - The parentheses quickly pile up. How can we avoid the programmer -;;; having to count parentheses? Some propose using square brackets -;;; (i.e., vectors) for the binding-only clauses, but Emacs Lisp is a -;;; traditional Lisp which uses exclusively parentheses for control -;;; constructs. Therefore, introducing square brackets here would be -;;; jarring to read. Another option would be to use symbols at the -;;; beginning of clauses, like `cond*' does. -;;; Whichever way one goes, the resulting macro ends up complicated, -;;; with a substantial learning burden. Adding `bind-and*' clauses to -;;; `cond*' gives us the desired functionality, and does not make -;;; `cond*' much more complicated. In other words, `cond*' is already -;;; complicated, and one complicated `cond'-extending macro is better -;;; than two. --spwhitton +;; +;; We considered adding a `cond-let*' in late 2025: +;; . +;; We decided to add the `bind-and*' clause type to `cond*' instead. +;; At first it seems simple to extend `if-let*'/`when-let*'/`and-let*' +;; to `cond', but the extension is not unambiguous: there are multiple +;; useful, incompatible ways to do it. +;; In particular, it quickly becomes clear that one wants clauses that +;; only establish bindings for proceeding clauses, instead of exiting +;; the `cond-let*'. But then +;; - Should these bindings be just like in `let*', or like in +;; `if-let*'? In other words, should it be that if a binding +;; evaluates to nil we skip the remaining bindings (bind them all to +;; nil)? Both ways of doing it seem useful. +;; - The parentheses quickly pile up. How can we avoid the programmer +;; having to count parentheses? Some propose using square brackets +;; (i.e., vectors) for the binding-only clauses, but Emacs Lisp is a +;; traditional Lisp which uses exclusively parentheses for control +;; constructs. Therefore, introducing square brackets here would be +;; jarring to read. Another option would be to use symbols at the +;; beginning of clauses, like `cond*' does. +;; Whichever way one goes, the resulting macro ends up complicated, +;; with a substantial learning burden. Adding `bind-and*' clauses to +;; `cond*' gives us the desired functionality, and does not make +;; `cond*' much more complicated. In other words, `cond*' is already +;; complicated, and one complicated `cond'-extending macro is better +;; than two. --spwhitton (defun internal--build-binding (binding prev-var) "Check and build a single BINDING with PREV-VAR." commit 55d41f5d2bdd95871b9966c9c6492bd7521430a4 Author: Andrea Corallo Date: Wed Nov 5 10:14:11 2025 +0100 * Fix native compiler for circular objects (bug#75135) * lisp/emacs-lisp/comp.el (comp--ssa-rename-insn): Fix circular objects. diff --git a/lisp/emacs-lisp/comp.el b/lisp/emacs-lisp/comp.el index 9784f0b1255..cf8bd19580d 100644 --- a/lisp/emacs-lisp/comp.el +++ b/lisp/emacs-lisp/comp.el @@ -2478,8 +2478,9 @@ PRE-LAMBDA and POST-LAMBDA are called in pre or post-order if non-nil." (setf (comp-vec-aref frame slot-n) mvar (cadr insn) mvar)))) (pcase insn - (`(setimm ,(pred targetp) ,_imm) - (new-lvalue)) + (`(setimm ,lval ,_imm) + (when (targetp lval) + (new-lvalue))) (`(,(pred comp--assign-op-p) ,(pred targetp) . ,_) (let ((mvar (comp-vec-aref frame slot-n))) (setf (cddr insn) (cl-nsubst-if mvar #'targetp (cddr insn))))