guix_mirror_bot pushed a commit to branch emacs-team
in repository guix.

commit 4adc7bd1737e524f4fd47a5bc583f6029e480c25
Author: Liliana Marie Prikler <[email protected]>
AuthorDate: Tue Aug 25 20:22:43 2026 +0200

    gnu: Update emacs to 31.1.
    
    * gnu/packages/patches/emacs-next-disable-jit-compilation.patch: Delete 
file,
    moving implementation…
    * gnu/packages/patches/emacs-disable-jit-compilation.patch: … here.
    * gnu/packages/patches/emacs-next-native-comp-fix-filenames.patch: Delete 
file,
    moving implementation…
    * gnu/packages/patches/emacs-native-comp-fix-filenames.patch: … here.
    * gnu/packages/patches/emacs-zoom-image-test-fix.patch: Delete file.
    * gnu/local.mk (dist_patch_DATA): Unregister deleted files.
    * gnu/packages/emacs.scm (%emacs-selector): Update for emacs-31.1.
    (%emacs-next-selector): Inherit from %emacs-selector.
    (emacs-minimal): Update to 31.1.
    [#:make-flags]: Update release-date.
---
 gnu/local.mk                                       |   3 -
 gnu/packages/emacs.scm                             |  27 +-
 .../patches/emacs-disable-jit-compilation.patch    |   6 +-
 .../patches/emacs-native-comp-fix-filenames.patch  |  92 +++---
 .../emacs-next-disable-jit-compilation.patch       |  19 --
 .../emacs-next-native-comp-fix-filenames.patch     | 355 ---------------------
 .../patches/emacs-zoom-image-test-fix.patch        |  25 --
 7 files changed, 62 insertions(+), 465 deletions(-)

diff --git a/gnu/local.mk b/gnu/local.mk
index 14a7854ed5..52093ec2c1 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1267,13 +1267,10 @@ dist_patch_DATA =                                       
        \
   %D%/packages/patches/emacs-native-comp-driver-options.patch   \
   %D%/packages/patches/emacs-native-comp-fix-filenames.patch   \
   %D%/packages/patches/emacs-native-comp-pin-packages.patch   \
-  %D%/packages/patches/emacs-next-disable-jit-compilation.patch                
        \
-  %D%/packages/patches/emacs-next-native-comp-fix-filenames.patch   \
   %D%/packages/patches/emacs-pasp-mode-quote-file-names.patch  \
   %D%/packages/patches/emacs-polymode-fix-lexical-variable-error.patch  \
   %D%/packages/patches/emacs-telega-test-env.patch             \
   %D%/packages/patches/emacs-wordnut-require-adaptive-wrap.patch       \
-  %D%/packages/patches/emacs-zoom-image-test-fix.patch \
   %D%/packages/patches/enblend-enfuse-reproducible.patch       \
   %D%/packages/patches/enjarify-setup-py.patch                 \
   %D%/packages/patches/enlightenment-fix-setuid-path.patch     \
diff --git a/gnu/packages/emacs.scm b/gnu/packages/emacs.scm
index 559dd92646..e98a9648c0 100644
--- a/gnu/packages/emacs.scm
+++ b/gnu/packages/emacs.scm
@@ -127,18 +127,6 @@
    "))"))
 
 (define %emacs-selector
-  (emacs-ert-selector
-   '("benchmark-tests"
-     "esh-util-test/path/get-remote"
-     "esh-var-test/path-var/preserve-across-hosts"
-     "grep-tests--rgrep-abbreviate-properties-darwin"
-     "grep-tests--rgrep-abbreviate-properties-gnu-linux"
-     "grep-tests--rgrep-abbreviate-properties-windows-nt-dos-semantics"
-     "grep-tests--rgrep-abbreviate-properties-windows-nt-sh-semantics"
-     "info-xref-test-makeinfo"
-     "tramp-test48-remote-load-path")))
-
-(define %emacs-next-selector
   (emacs-ert-selector
    '("benchmark-tests"
      "esh-util-test/path/get-remote"
@@ -205,10 +193,12 @@
      "package-vc-tests-upgrade-after-require/test-package-three"
      "package-vc-tests-upgrade-after-require/test-package-two")))
 
+(define %emacs-next-selector %emacs-selector)
+
 (define-public emacs-minimal
   (package
     (name "emacs-minimal")
-    (version "30.2")
+    (version "31.1")
     ;; Note: When using (replacement …), ensure that comp-native-version-dir
     ;; stays the same across grafts.
     ;; Run `make check-system TESTS=emacs-native-comp' to ensure that grafts
@@ -219,13 +209,12 @@
                                   version ".tar.xz"))
               (sha256
                (base32
-                "1nggbgnns7lvxn68gzlcsgwh3bigvrbn45kh6dqia9yxlqc6zwxk"))
+                "11j59ybvzbkxfsm9zmhj6ixxls2424rhcw5znlr1kj40jl6pk98x"))
               (patches (search-patches "emacs-disable-jit-compilation.patch"
                                        "emacs-fix-scheme-indent-function.patch"
                                        "emacs-native-comp-driver-options.patch"
                                        "emacs-native-comp-fix-filenames.patch"
-                                       "emacs-native-comp-pin-packages.patch"
-                                       "emacs-zoom-image-test-fix.patch"))
+                                       "emacs-native-comp-pin-packages.patch"))
               (modules '((guix build utils)))
               (snippet
                '(with-directory-excursion "lisp"
@@ -244,7 +233,7 @@
       #:configure-flags #~(list "--with-gnutls=no" "--disable-build-details")
       #:make-flags
       #~(list (string-append "SELECTOR=" #$%emacs-selector)
-              (let ((release-date "2025-08-14 05:04:03"))
+              (let ((release-date "2026-08-24 10:35:47"))
                 (string-append "RUN_TEMACS= "
                                #$(this-package-native-input "libfaketime")
                                "/bin/faketime -m -f '" release-date "'"
@@ -743,10 +732,10 @@ editor (with wide ints)" )
        (sha256
         (base32 "111cxlhdpxyvyj2mhqcx0s5s2nkdr3q2vhly1csq5d44p24c4yyy"))
        (patches
-        (search-patches "emacs-next-disable-jit-compilation.patch"
+        (search-patches "emacs-disable-jit-compilation.patch"
                         "emacs-fix-scheme-indent-function.patch"
                         "emacs-native-comp-driver-options.patch"
-                        "emacs-next-native-comp-fix-filenames.patch"
+                        "emacs-native-comp-fix-filenames.patch"
                         "emacs-native-comp-pin-packages.patch"))))
     (arguments
      (substitute-keyword-arguments arguments
diff --git a/gnu/packages/patches/emacs-disable-jit-compilation.patch 
b/gnu/packages/patches/emacs-disable-jit-compilation.patch
index 8b1ac5a9df..0bac7a25fb 100644
--- a/gnu/packages/patches/emacs-disable-jit-compilation.patch
+++ b/gnu/packages/patches/emacs-disable-jit-compilation.patch
@@ -6,12 +6,12 @@ Index: emacs-29.2/src/comp.c
      doc: /* If non-nil, compile loaded .elc files asynchronously.
  
  After compilation, each function definition is updated to use the
--natively-compiled one.  */);
+-natively compiled one.  */);
 -  native_comp_jit_compilation = true;
-+natively-compiled one.  This variable is enabled by default upstream,
++natively compiled one.  This variable is enabled by default upstream,
 +but disabled in Guix to better make use of precompiled packages.
 +Notably, Guix removes the hashes that prevent inadvertent shadowing
-+frm the file names of compiled libraries in order to facilitate grafts.
++from the file names of compiled libraries in order to facilitate grafts.
 +Enable at your own risk!  */);
 +  native_comp_jit_compilation = false;
  
diff --git a/gnu/packages/patches/emacs-native-comp-fix-filenames.patch 
b/gnu/packages/patches/emacs-native-comp-fix-filenames.patch
index a7c0825b24..ae16fc260c 100644
--- a/gnu/packages/patches/emacs-native-comp-fix-filenames.patch
+++ b/gnu/packages/patches/emacs-native-comp-fix-filenames.patch
@@ -12,11 +12,11 @@ way into the actual variable despite attempts to remove it 
by calling
 The user-visible procedure ‘startup-redirect-eln-cache’ is kept, as
 packages may require it, but only pushes the new value now.
 
-Index: emacs-next/src/comp.c
+Index: emacs/src/comp.c
 ===================================================================
---- emacs-next.orig/src/comp.c
-+++ emacs-next/src/comp.c
-@@ -4403,26 +4403,17 @@ DEFUN ("comp-el-to-eln-rel-filename", Fc
+--- emacs.orig/src/comp.c
++++ emacs/src/comp.c
+@@ -4279,26 +4279,17 @@ DEFUN ("comp-el-to-eln-rel-filename", Fc
         Scomp_el_to_eln_rel_filename, 1, 1, 0,
         doc: /* Return the relative name of the .eln file for FILENAME.
  FILENAME must exist, and if it's a symlink, the target must exist.
@@ -32,7 +32,7 @@ Index: emacs-next/src/comp.c
    (Lisp_Object filename)
  {
    CHECK_STRING (filename);
- 
+
 -  /* Resolve possible symlinks in FILENAME, so that path_hash below
 -     always compares equal. (Bug#44701).  */
 -  filename = Fexpand_file_name (filename, Qnil);
@@ -44,15 +44,15 @@ Index: emacs-next/src/comp.c
 -      xfree (file_normalized);
 -    }
 +  Lisp_Object rel_name = filename;
- 
+
 +  filename = Fexpand_file_name (filename, Qnil);
    if (NILP (Ffile_exists_p (filename)))
      xsignal1 (Qfile_missing, filename);
- 
-@@ -4430,64 +4421,55 @@ one for the file name and another for it
+
+@@ -4306,64 +4297,55 @@ one for the file name and another for it
    filename = Fw32_long_file_name (filename);
  #endif
- 
+
 -  Lisp_Object content_hash = comp_hash_source_file (filename);
 -
 -  if (suffix_p (filename, ".gz"))
@@ -93,7 +93,7 @@ Index: emacs-next/src/comp.c
 -    }
 +  Lisp_Object tail = Vload_path;
 +  Lisp_Object name_len = Flength (filename);
- 
+
 -  Lisp_Object lds_re_tail = loadsearch_re_list;
 -  FOR_EACH_TAIL (lds_re_tail)
 +  FOR_EACH_TAIL_SAFE (tail)
@@ -131,7 +131,7 @@ Index: emacs-next/src/comp.c
 +
 +  if (!NILP (bogus_dirs))
 +  {
-+    tail = CALL2I (split-string, bogus_dirs, build_string (":"));
++    tail = CALLNI (split-string, bogus_dirs, build_string (":"));
 +
 +    FOR_EACH_TAIL_SAFE (tail)
 +      {
@@ -155,9 +155,9 @@ Index: emacs-next/src/comp.c
 +  return concat2(Fsubstring (filename, Qnil, make_fixnum (-3)),
 +               build_string (NATIVE_ELISP_SUFFIX));
  }
- 
+
  DEFUN ("comp-el-to-eln-filename", Fcomp_el_to_eln_filename,
-@@ -4501,13 +4483,7 @@ If BASE-DIR is non-nil, use it as the di
+@@ -4377,13 +4359,7 @@ If BASE-DIR is non-nil, use it as the di
  non-absolute BASE-DIR is interpreted as relative to `invocation-directory'.
  If BASE-DIR is omitted or nil, look for the first writable directory
  in `native-comp-eln-load-path', and use as BASE-DIR its subdirectory
@@ -172,47 +172,47 @@ Index: emacs-next/src/comp.c
    (Lisp_Object filename, Lisp_Object base_dir)
  {
    Lisp_Object source_filename = filename;
-@@ -4555,10 +4531,11 @@ the latter is supposed to be used by the
+@@ -4431,10 +4407,11 @@ the latter is supposed to be used by the
    Lisp_Object lisp_preloaded =
      Fgetenv_internal (build_string ("LISP_PRELOADED"), Qnil);
    base_dir = Fexpand_file_name (Vcomp_native_version_dir, base_dir);
 +  bool preloaded = comp_file_preloaded_p;
    if (comp_file_preloaded_p
        || (!NILP (lisp_preloaded)
--        && !NILP (Fmember (CALL1I (file-name-base, source_filename),
+-        && !NILP (Fmember (CALLNI (file-name-base, source_filename),
 -                           Fmapcar (intern_c_string ("file-name-base"),
-+        && !NILP (Fmember (CALL1I (file-name-sans-extension, source_filename),
++        && !NILP (Fmember (CALLNI (file-name-sans-extension, source_filename),
 +                           Fmapcar (intern_c_string 
("file-name-sans-extension"),
-                                     CALL1I (split-string, lisp_preloaded))))))
+                                     CALLNI (split-string, lisp_preloaded))))))
      base_dir = Fexpand_file_name (build_string ("preloaded"), base_dir);
- 
-@@ -5875,10 +5852,7 @@ The last directory of this list is assum
+
+@@ -5741,10 +5718,7 @@ The last directory of this list is assum
  the system *.eln files, which are the files produced when building
  Emacs.  */);
- 
+
 -  /* Temporary value in use for bootstrap.  We can't do better as
 -     `invocation-directory' is still unset, will be fixed up during
 -     dump reload.  */
 -  Vnative_comp_eln_load_path = Fcons (build_string ("../native-lisp/"), Qnil);
 +  Vnative_comp_eln_load_path = Qnil;
- 
+
    DEFVAR_LISP ("native-comp-enable-subr-trampolines",
               Vnative_comp_enable_subr_trampolines,
-Index: emacs-next/lisp/startup.el
+Index: emacs/lisp/startup.el
 ===================================================================
---- emacs-next.orig/lisp/startup.el
-+++ emacs-next/lisp/startup.el
-@@ -527,9 +527,6 @@ DIRS are relative."
+--- emacs.orig/lisp/startup.el
++++ emacs/lisp/startup.el
+@@ -520,9 +520,6 @@ DIRS are relative."
  (defvar native-comp-jit-compilation)
  (defvar native-comp-enable-subr-trampolines)
- 
+
 -(defvar startup--original-eln-load-path nil
 -  "Original value of `native-comp-eln-load-path'.")
 -
  (defun startup-redirect-eln-cache (cache-directory)
    "Redirect the user's eln-cache directory to CACHE-DIRECTORY.
  CACHE-DIRECTORY must be a single directory, a string.
-@@ -540,22 +537,10 @@ to `user-emacs-directory'.
+@@ -533,22 +530,10 @@ to `user-emacs-directory'.
  For best results, call this function in your early-init file,
  so that the rest of initialization and package loading uses
  the updated value."
@@ -222,7 +222,7 @@ Index: emacs-next/lisp/startup.el
    (push (expand-file-name (file-name-as-directory cache-directory)
                            user-emacs-directory)
          native-comp-eln-load-path))
- 
+
 -(defun startup--update-eln-cache ()
 -  "Update the user eln-cache directory due to user customizations."
 -  ;; Don't override user customizations!
@@ -235,10 +235,20 @@ Index: emacs-next/lisp/startup.el
  (defun startup--rescale-elt-match-p (font-pattern font-object)
    "Test whether FONT-OBJECT matches an element of `face-font-rescale-alist'.
  FONT-OBJECT is a font-object that specifies a font to test.
-@@ -1383,12 +1368,6 @@ please check its value")
+@@ -771,9 +756,6 @@ It is the default value of the variable
+       (unwind-protect
+         (command-line)
+
+-        (when (featurep 'native-compile)
+-          (startup--update-eln-cache))
+-
+       ;; Do this again, in case .emacs defined more abbreviations.
+       (if default-directory
+           (setq default-directory (abbreviate-file-name default-directory)))
+@@ -1385,12 +1367,6 @@ please check its value")
        startup-init-directory)))
    (setq early-init-file user-init-file)
- 
+
 -  ;; Amend `native-comp-eln-load-path', since the early-init file may
 -  ;; have altered `user-emacs-directory' and/or changed the eln-cache
 -  ;; directory.
@@ -248,10 +258,10 @@ Index: emacs-next/lisp/startup.el
    ;; If any package directory exists, initialize the package system.
    (and user-init-file
         package-enable-at-startup
-@@ -1523,12 +1502,6 @@ please check its value")
+@@ -1525,12 +1501,6 @@ please check its value")
          startup-init-directory))
       t)
- 
+
 -    ;; Amend `native-comp-eln-load-path' again, since the early-init
 -    ;; file may have altered `user-emacs-directory' and/or changed the
 -    ;; eln-cache directory.
@@ -261,10 +271,10 @@ Index: emacs-next/lisp/startup.el
      (when (and deactivate-mark transient-mark-mode)
        (with-current-buffer (window-buffer)
          (deactivate-mark)))
-Index: emacs-next/lisp/loadup.el
+Index: emacs/lisp/loadup.el
 ===================================================================
---- emacs-next.orig/lisp/loadup.el
-+++ emacs-next/lisp/loadup.el
+--- emacs.orig/lisp/loadup.el
++++ emacs/lisp/loadup.el
 @@ -53,6 +53,14 @@
  (setq redisplay--inhibit-bidi t)
  
@@ -280,7 +290,7 @@ Index: emacs-next/lisp/loadup.el
  
  ;; Add subdirectories to the load-path for files that might get
  ;; autoloaded when bootstrapping or running Emacs normally.
-@@ -538,27 +546,25 @@ This to have it working when installed o
+@@ -522,27 +530,25 @@ This to have it working when installed o
  directory got moved.  This is set to be a pair in the form of:
  \(rel-filename-from-install-bin . rel-filename-from-local-bin)."
    (when (and load--bin-dest-dir load--eln-dest-dir)
@@ -320,7 +330,7 @@ Index: emacs-next/lisp/loadup.el
                       ;; Relative filename from the built uninstalled binary.
                       (file-relative-name file invocation-directory))))))
             comp-loaded-comp-units-h)))
-@@ -644,7 +650,9 @@ directory got moved.  This is set to be
+@@ -609,7 +615,9 @@ directory got moved.  This is set to be
                     (equal dump-mode "pdump"))
            ;; Don't enable this before bootstrap is completed, as the
            ;; compiler infrastructure may not be usable yet.
@@ -331,11 +341,11 @@ Index: emacs-next/lisp/loadup.el
          (message "Dumping under the name %s" output)
          (condition-case ()
              (delete-file output)
-Index: emacs-next/src/Makefile.in
+Index: emacs/src/Makefile.in
 ===================================================================
---- emacs-next.orig/src/Makefile.in
-+++ emacs-next/src/Makefile.in
-@@ -591,6 +591,7 @@ shortlisp := $(filter-out ${shortlisp_fi
+--- emacs.orig/src/Makefile.in
++++ emacs/src/Makefile.in
+@@ -567,6 +567,7 @@ shortlisp := $(filter-out ${shortlisp_fi
  ## We don't really need to sort, but may as well use it to remove duplicates.
  shortlisp := loaddefs.el loadup.el $(sort ${shortlisp})
  export LISP_PRELOADED = ${shortlisp}
diff --git a/gnu/packages/patches/emacs-next-disable-jit-compilation.patch 
b/gnu/packages/patches/emacs-next-disable-jit-compilation.patch
deleted file mode 100644
index 0bac7a25fb..0000000000
--- a/gnu/packages/patches/emacs-next-disable-jit-compilation.patch
+++ /dev/null
@@ -1,19 +0,0 @@
-Index: emacs-29.2/src/comp.c
-===================================================================
---- emacs-29.2.orig/src/comp.c
-+++ emacs-29.2/src/comp.c
-@@ -5648,8 +5648,12 @@ For internal use. */);
-     doc: /* If non-nil, compile loaded .elc files asynchronously.
- 
- After compilation, each function definition is updated to use the
--natively compiled one.  */);
--  native_comp_jit_compilation = true;
-+natively compiled one.  This variable is enabled by default upstream,
-+but disabled in Guix to better make use of precompiled packages.
-+Notably, Guix removes the hashes that prevent inadvertent shadowing
-+from the file names of compiled libraries in order to facilitate grafts.
-+Enable at your own risk!  */);
-+  native_comp_jit_compilation = false;
- 
-   DEFSYM (Qnative_comp_speed, "native-comp-speed");
-   DEFSYM (Qnative_comp_debug, "native-comp-debug");
diff --git a/gnu/packages/patches/emacs-next-native-comp-fix-filenames.patch 
b/gnu/packages/patches/emacs-next-native-comp-fix-filenames.patch
deleted file mode 100644
index ae16fc260c..0000000000
--- a/gnu/packages/patches/emacs-next-native-comp-fix-filenames.patch
+++ /dev/null
@@ -1,355 +0,0 @@
-Upstream hashes both the absolute file name and the content of a file
-to derive the name for the natively compiled files.  This breaks the
-staged install used in guix, as any $GUIX_PROFILE is distinct from
-the build directory.  It also breaks grafts, as hardcoded store file
-names get rewritten; thus changing the file hash.
-
-In addition, this patch changes how native-comp-eln-load-path is
-constructed.  Upstream, an entry of the directory “../lisp” is added
-supposedly for bootstrap only, but this directory appears to find its
-way into the actual variable despite attempts to remove it by calling
-‘startup--update-eln-cache’.
-The user-visible procedure ‘startup-redirect-eln-cache’ is kept, as
-packages may require it, but only pushes the new value now.
-
-Index: emacs/src/comp.c
-===================================================================
---- emacs.orig/src/comp.c
-+++ emacs/src/comp.c
-@@ -4279,26 +4279,17 @@ DEFUN ("comp-el-to-eln-rel-filename", Fc
-        Scomp_el_to_eln_rel_filename, 1, 1, 0,
-        doc: /* Return the relative name of the .eln file for FILENAME.
- FILENAME must exist, and if it's a symlink, the target must exist.
--If FILENAME is compressed, it must have the \".gz\" extension,
--and Emacs must have been compiled with zlib; the file will be
--uncompressed on the fly to hash its contents.
--Value includes the original base name, followed by 2 hash values,
--one for the file name and another for its contents, followed by .eln.  */)
-+FILENAME is resolved relative to `load-path' and only the suffix of
-+the first matching path is kept.  If FILENAME is not found to be relative
-+to any directory `load-path', it is used as-is to construct the return
-+value.  */)
-   (Lisp_Object filename)
- {
-   CHECK_STRING (filename);
-
--  /* Resolve possible symlinks in FILENAME, so that path_hash below
--     always compares equal. (Bug#44701).  */
--  filename = Fexpand_file_name (filename, Qnil);
--  char *file_normalized = realpath (SSDATA (ENCODE_FILE (filename)), NULL);
--  if (file_normalized)
--    {
--      filename = DECODE_FILE (make_unibyte_string (file_normalized,
--                                                 strlen (file_normalized)));
--      xfree (file_normalized);
--    }
-+  Lisp_Object rel_name = filename;
-
-+  filename = Fexpand_file_name (filename, Qnil);
-   if (NILP (Ffile_exists_p (filename)))
-     xsignal1 (Qfile_missing, filename);
-
-@@ -4306,64 +4297,55 @@ one for the file name and another for it
-   filename = Fw32_long_file_name (filename);
- #endif
-
--  Lisp_Object content_hash = comp_hash_source_file (filename);
--
--  if (suffix_p (filename, ".gz"))
--    filename = Fsubstring (filename, Qnil, make_fixnum (-3));
--
--  /* We create eln filenames with an hash in order to look-up these
--     starting from the source filename, IOW have a relation
--
--     /absolute/path/filename.el + content ->
--     eln-cache/filename-path_hash-content_hash.eln.
--
--     'dlopen' can return the same handle if two shared with the same
--     filename are loaded in two different times (even if the first was
--     deleted!).  To prevent this scenario the source file content is
--     included in the hashing algorithm.
--
--     As at any point in time no more then one file can exist with the
--     same filename, should be possible to clean up all
--     filename-path_hash-* except the most recent one (or the new one
--     being recompiled).
--
--     As installing .eln files compiled during the build changes their
--     absolute path we need an hashing mechanism that is not sensitive
--     to that.  For this we replace if match PATH_DUMPLOADSEARCH or
--     *PATH_REL_LOADSEARCH with '//' before computing the hash.  */
--
--  if (NILP (loadsearch_re_list))
--    {
--      Lisp_Object sys_re =
--      concat2 (build_string ("\\`[[:ascii:]]+"),
--               Fregexp_quote (build_string ("/" PATH_REL_LOADSEARCH "/")));
--      Lisp_Object dump_load_search =
--      Fexpand_file_name (build_string (PATH_DUMPLOADSEARCH "/"), Qnil);
--#ifdef WINDOWSNT
--      dump_load_search = Fw32_long_file_name (dump_load_search);
--#endif
--      loadsearch_re_list = list2 (sys_re, Fregexp_quote (dump_load_search));
--    }
-+  Lisp_Object tail = Vload_path;
-+  Lisp_Object name_len = Flength (filename);
-
--  Lisp_Object lds_re_tail = loadsearch_re_list;
--  FOR_EACH_TAIL (lds_re_tail)
-+  FOR_EACH_TAIL_SAFE (tail)
-     {
--      Lisp_Object match_idx =
--      Fstring_match (XCAR (lds_re_tail), filename, Qnil, Qnil);
--      if (BASE_EQ (match_idx, make_fixnum (0)))
-+      Lisp_Object directory = Ffile_name_as_directory (XCAR (tail));
-+      Lisp_Object len = Flength (directory);
-+      if (XFIXNUM (name_len) < XFIXNUM (len))
-+      continue;
-+      else if (EQ (Qt, Fcompare_strings (filename, make_fixnum (0), len,
-+                                       directory, make_fixnum (0), len,
-+                                       Qnil)))
-       {
--        filename =
--          Freplace_match (build_string ("//"), Qt, Qt, filename, Qnil);
-+        filename = Fsubstring (filename, len, Qnil);
-         break;
-       }
-     }
--  Lisp_Object separator = build_string ("-");
--  Lisp_Object path_hash = comp_hash_string (filename);
--  filename = concat2 (Ffile_name_nondirectory (Fsubstring (filename, Qnil,
--                                                         make_fixnum (-3))),
--                    separator);
--  Lisp_Object hash = concat3 (path_hash, separator, content_hash);
--  return concat3 (filename, hash, build_string (NATIVE_ELISP_SUFFIX));
-+
-+  if (Ffile_name_absolute_p (filename)) /* no match in load-path */
-+    filename = rel_name;
-+
-+  Lisp_Object bogus_dirs =
-+    Fgetenv_internal (build_string ("NATIVE_COMP_BOGUS_DIRS"), Qnil);
-+
-+  if (!NILP (bogus_dirs))
-+  {
-+    tail = CALLNI (split-string, bogus_dirs, build_string (":"));
-+
-+    FOR_EACH_TAIL_SAFE (tail)
-+      {
-+      Lisp_Object directory = Ffile_name_as_directory (XCAR (tail));
-+      Lisp_Object len = Flength (directory);
-+      if (XFIXNUM (name_len) < XFIXNUM (len))
-+        continue;
-+      else if (EQ (Qt, Fcompare_strings (filename, make_fixnum (0), len,
-+                                         directory, make_fixnum (0), len,
-+                                         Qnil)))
-+        {
-+          filename = Fsubstring (filename, len, Qnil);
-+          break;
-+        }
-+      }
-+  }
-+
-+  if (suffix_p (filename, ".gz"))
-+    filename = Fsubstring (filename, Qnil, make_fixnum (-3));
-+
-+  return concat2(Fsubstring (filename, Qnil, make_fixnum (-3)),
-+               build_string (NATIVE_ELISP_SUFFIX));
- }
-
- DEFUN ("comp-el-to-eln-filename", Fcomp_el_to_eln_filename,
-@@ -4377,13 +4359,7 @@ If BASE-DIR is non-nil, use it as the di
- non-absolute BASE-DIR is interpreted as relative to `invocation-directory'.
- If BASE-DIR is omitted or nil, look for the first writable directory
- in `native-comp-eln-load-path', and use as BASE-DIR its subdirectory
--whose name is given by `comp-native-version-dir'.
--If FILENAME specifies a preloaded file, the directory for the .eln
--file is the \"preloaded/\" subdirectory of the directory determined
--as described above.  FILENAME is considered to be a preloaded file if
--the value of `comp-file-preloaded-p' is non-nil, or if FILENAME
--appears in the value of the environment variable LISP_PRELOADED;
--the latter is supposed to be used by the Emacs build procedure.  */)
-+whose name is given by `comp-native-version-dir'. */)
-   (Lisp_Object filename, Lisp_Object base_dir)
- {
-   Lisp_Object source_filename = filename;
-@@ -4431,10 +4407,11 @@ the latter is supposed to be used by the
-   Lisp_Object lisp_preloaded =
-     Fgetenv_internal (build_string ("LISP_PRELOADED"), Qnil);
-   base_dir = Fexpand_file_name (Vcomp_native_version_dir, base_dir);
-+  bool preloaded = comp_file_preloaded_p;
-   if (comp_file_preloaded_p
-       || (!NILP (lisp_preloaded)
--        && !NILP (Fmember (CALLNI (file-name-base, source_filename),
--                           Fmapcar (intern_c_string ("file-name-base"),
-+        && !NILP (Fmember (CALLNI (file-name-sans-extension, source_filename),
-+                           Fmapcar (intern_c_string 
("file-name-sans-extension"),
-                                     CALLNI (split-string, lisp_preloaded))))))
-     base_dir = Fexpand_file_name (build_string ("preloaded"), base_dir);
-
-@@ -5741,10 +5718,7 @@ The last directory of this list is assum
- the system *.eln files, which are the files produced when building
- Emacs.  */);
-
--  /* Temporary value in use for bootstrap.  We can't do better as
--     `invocation-directory' is still unset, will be fixed up during
--     dump reload.  */
--  Vnative_comp_eln_load_path = Fcons (build_string ("../native-lisp/"), Qnil);
-+  Vnative_comp_eln_load_path = Qnil;
-
-   DEFVAR_LISP ("native-comp-enable-subr-trampolines",
-              Vnative_comp_enable_subr_trampolines,
-Index: emacs/lisp/startup.el
-===================================================================
---- emacs.orig/lisp/startup.el
-+++ emacs/lisp/startup.el
-@@ -520,9 +520,6 @@ DIRS are relative."
- (defvar native-comp-jit-compilation)
- (defvar native-comp-enable-subr-trampolines)
-
--(defvar startup--original-eln-load-path nil
--  "Original value of `native-comp-eln-load-path'.")
--
- (defun startup-redirect-eln-cache (cache-directory)
-   "Redirect the user's eln-cache directory to CACHE-DIRECTORY.
- CACHE-DIRECTORY must be a single directory, a string.
-@@ -533,22 +530,10 @@ to `user-emacs-directory'.
- For best results, call this function in your early-init file,
- so that the rest of initialization and package loading uses
- the updated value."
--  ;; Remove the original eln-cache.
--  (setq native-comp-eln-load-path (cdr native-comp-eln-load-path))
--  ;; Add the new eln-cache.
-   (push (expand-file-name (file-name-as-directory cache-directory)
-                           user-emacs-directory)
-         native-comp-eln-load-path))
-
--(defun startup--update-eln-cache ()
--  "Update the user eln-cache directory due to user customizations."
--  ;; Don't override user customizations!
--  (when (equal native-comp-eln-load-path
--               startup--original-eln-load-path)
--    (startup-redirect-eln-cache "eln-cache")
--    (setq startup--original-eln-load-path
--          (copy-sequence native-comp-eln-load-path))))
--
- (defun startup--rescale-elt-match-p (font-pattern font-object)
-   "Test whether FONT-OBJECT matches an element of `face-font-rescale-alist'.
- FONT-OBJECT is a font-object that specifies a font to test.
-@@ -771,9 +756,6 @@ It is the default value of the variable
-       (unwind-protect
-         (command-line)
-
--        (when (featurep 'native-compile)
--          (startup--update-eln-cache))
--
-       ;; Do this again, in case .emacs defined more abbreviations.
-       (if default-directory
-           (setq default-directory (abbreviate-file-name default-directory)))
-@@ -1385,12 +1367,6 @@ please check its value")
-       startup-init-directory)))
-   (setq early-init-file user-init-file)
-
--  ;; Amend `native-comp-eln-load-path', since the early-init file may
--  ;; have altered `user-emacs-directory' and/or changed the eln-cache
--  ;; directory.
--  (when (featurep 'native-compile)
--    (startup--update-eln-cache))
--
-   ;; If any package directory exists, initialize the package system.
-   (and user-init-file
-        package-enable-at-startup
-@@ -1525,12 +1501,6 @@ please check its value")
-         startup-init-directory))
-      t)
-
--    ;; Amend `native-comp-eln-load-path' again, since the early-init
--    ;; file may have altered `user-emacs-directory' and/or changed the
--    ;; eln-cache directory.
--    (when (featurep 'native-compile)
--      (startup--update-eln-cache))
--
-     (when (and deactivate-mark transient-mark-mode)
-       (with-current-buffer (window-buffer)
-         (deactivate-mark)))
-Index: emacs/lisp/loadup.el
-===================================================================
---- emacs.orig/lisp/loadup.el
-+++ emacs/lisp/loadup.el
-@@ -53,6 +53,14 @@
- (setq redisplay--inhibit-bidi t)
- 
- (message "Dump mode: %s" dump-mode)
-+;; Compensate for native-comp-eln-load-path being empty by Guix' default.
-+(and (featurep 'native-compile)
-+     dump-mode
-+     (setq
-+      native-comp-eln-load-path
-+      (cons (expand-file-name "../native-lisp" invocation-directory)
-+            native-comp-eln-load-path)
-+      comp-file-preloaded-p t))
- 
- ;; Add subdirectories to the load-path for files that might get
- ;; autoloaded when bootstrapping or running Emacs normally.
-@@ -522,27 +530,25 @@ This to have it working when installed o
- directory got moved.  This is set to be a pair in the form of:
- \(rel-filename-from-install-bin . rel-filename-from-local-bin)."
-   (when (and load--bin-dest-dir load--eln-dest-dir)
--      (setq eln-dest-dir
--          (concat load--eln-dest-dir "native-lisp/" comp-native-version-dir 
"/"))
-+      (setq load--eln-versioned-dest-dir
-+            (concat load--eln-dest-dir "native-lisp/" comp-native-version-dir 
"/"))
-       (maphash (lambda (_ cu)
-                (when (stringp (native-comp-unit-file cu))
-                  (let* ((file (native-comp-unit-file cu))
--                        (preloaded (equal (substring (file-name-directory 
file)
--                                                     -10 -1)
--                                          "preloaded"))
--                        (eln-dest-dir-eff (if preloaded
--                                              (expand-file-name "preloaded"
--                                                                eln-dest-dir)
--                                            eln-dest-dir)))
-+                        (native-lisp-needle
-+                         (regexp-quote (concat "native-lisp/"
-+                                               comp-native-version-dir "/"))))
-                    (native-comp-unit-set-file
-                     cu
-                   (cons
-                      ;; Relative filename from the installed binary.
--                     (file-relative-name (expand-file-name
--                                          (file-name-nondirectory
--                                           file)
--                                          eln-dest-dir-eff)
--                                         load--bin-dest-dir)
-+                     (file-relative-name
-+                      (expand-file-name
-+                       (save-match-data
-+                         (string-match native-lisp-needle file)
-+                         (substring file (match-end 0)))
-+                       load--eln-versioned-dest-dir)
-+                      load--bin-dest-dir)
-                      ;; Relative filename from the built uninstalled binary.
-                      (file-relative-name file invocation-directory))))))
-            comp-loaded-comp-units-h)))
-@@ -609,7 +615,9 @@ directory got moved.  This is set to be
-                    (equal dump-mode "pdump"))
-           ;; Don't enable this before bootstrap is completed, as the
-           ;; compiler infrastructure may not be usable yet.
--          (setq native-comp-enable-subr-trampolines t))
-+          (setq native-comp-enable-subr-trampolines t
-+                ;; We loaded everything we could.
-+                comp-file-preloaded-p nil))
-         (message "Dumping under the name %s" output)
-         (condition-case ()
-             (delete-file output)
-Index: emacs/src/Makefile.in
-===================================================================
---- emacs.orig/src/Makefile.in
-+++ emacs/src/Makefile.in
-@@ -567,6 +567,7 @@ shortlisp := $(filter-out ${shortlisp_fi
- ## We don't really need to sort, but may as well use it to remove duplicates.
- shortlisp := loaddefs.el loadup.el $(sort ${shortlisp})
- export LISP_PRELOADED = ${shortlisp}
-+export NATIVE_COMP_BOGUS_DIRS =
- lisp = $(addprefix ${lispsource}/,${shortlisp})
- 
- ## Construct full set of libraries to be linked.
diff --git a/gnu/packages/patches/emacs-zoom-image-test-fix.patch 
b/gnu/packages/patches/emacs-zoom-image-test-fix.patch
deleted file mode 100644
index b47cc4f800..0000000000
--- a/gnu/packages/patches/emacs-zoom-image-test-fix.patch
+++ /dev/null
@@ -1,25 +0,0 @@
-From 462a541db904405ede8446c48ba0c71ad41c544d Mon Sep 17 00:00:00 2001
-From: Eli Zaretskii <[email protected]>
-Date: Thu, 17 Jul 2025 19:34:50 +0300
-Subject: [PATCH] ; * test/lisp/net/shr-tests.el (shr-test/zoom-image): Fix
- <img> (bug#79041).
-
----
- test/lisp/net/shr-tests.el | 4 ++--
- 1 file changed, 2 insertions(+), 2 deletions(-)
-
-diff --git a/test/lisp/net/shr-tests.el b/test/lisp/net/shr-tests.el
-index 363cd144e8f3..a931d07a1631 100644
---- a/test/lisp/net/shr-tests.el
-+++ b/test/lisp/net/shr-tests.el
-@@ -145,8 +145,8 @@ settings, then once more for each (OPTION . VALUE) pair.")
-     (dolist (alt '(nil "" "nothing to see here"))
-       (with-temp-buffer
-         (ert-info ((format "image with alt=%S" alt))
--          (let ((attrs (if alt (format " alt=\"%s\"" alt) "")))
--            (insert (format "<img src=\"%s\" %s" image-url attrs)))
-+          (let ((attrs (if alt (format " alt=\"%s\">" alt) ">")))
-+            (insert (format "<img src=\"%s\"%s" image-url attrs)))
-           (cl-letf* (;; Pretend we're a graphical display.
-                      ((symbol-function 'display-graphic-p) #'always)
-                      ((symbol-function 'url-queue-retrieve)

Reply via email to