From 01d0dffd5de77f43d078cdc1ac76d111c72f44f647c3d9207b5f555deecc8259 Mon Sep 17 00:00:00 2001 From: "Dr. Werner Fink" Date: Fri, 10 Jan 2025 09:30:48 +0000 Subject: [PATCH 1/4] Avoid that Emacs reompiles some packages on every startup OBS-URL: https://build.opensuse.org/package/show/editors/emacs?expand=0&rev=440 --- emacs-27.1-Xauthority4server.patch | 11 +++++++++-- emacs-29.4-boo1234673.patch | 27 +++++++++++++++++++++++++++ emacs.changes | 5 +++++ emacs.spec | 9 ++++++--- 4 files changed, 47 insertions(+), 5 deletions(-) create mode 100644 emacs-29.4-boo1234673.patch diff --git a/emacs-27.1-Xauthority4server.patch b/emacs-27.1-Xauthority4server.patch index a152ff5..470f3b7 100644 --- a/emacs-27.1-Xauthority4server.patch +++ b/emacs-27.1-Xauthority4server.patch @@ -10,11 +10,12 @@ even if the Xauthority file is not the default expected by XCloseDisplay() 2 files changed, 45 insertions(+), 2 deletions(-) --- etc/emacs.service -+++ etc/emacs.service 2024-04-11 06:46:29.320172754 +0000 -@@ -5,9 +5,11 @@ ++++ etc/emacs.service 2025-01-09 13:32:23.071591602 +0000 +@@ -5,9 +5,12 @@ [Unit] Description=Emacs text editor Documentation=info:emacs man:emacs(1) https://gnu.org/software/emacs/ ++PartOf=graphical-session.target +After=graphical-session.target [Service] @@ -23,6 +24,12 @@ even if the Xauthority file is not the default expected by XCloseDisplay() ExecStart=emacs --fg-daemon # Emacs will exit with status 15 after having received SIGTERM, which +@@ -20,4 +23,4 @@ SuccessExitStatus=15 + Restart=on-failure + + [Install] +-WantedBy=default.target ++WantedBy=graphical-session.target --- lisp/server.el +++ lisp/server.el 2024-04-11 06:17:17.692578500 +0000 @@ -289,6 +289,11 @@ If nil, no instructions are displayed." diff --git a/emacs-29.4-boo1234673.patch b/emacs-29.4-boo1234673.patch new file mode 100644 index 0000000..5a414ad --- /dev/null +++ b/emacs-29.4-boo1234673.patch @@ -0,0 +1,27 @@ +https://emacs.stackexchange.com/questions/82010/why-is-emacs-recompiling-some-packages-on-every-startup + +--- + lisp/emacs-lisp/comp.el | 12 ++++++++++++ + 1 file changed, 12 insertions(+) + +--- lisp/emacs-lisp/comp.el ++++ lisp/emacs-lisp/comp.el 2025-01-09 09:34:45.706219439 +0000 +@@ -4177,6 +4177,18 @@ LOAD and SELECTOR work as described in ` + (cl-some (lambda (re) + (string-match-p re file)) + native-comp-jit-compilation-deny-list)))) ++;; SUSE boo#1234673 -- Emacs freeze for a few seconds when opening any python file, with 100% Xorg usage ++(defun fixed-native-compile-async-skip-p ++ (native-compile-async-skip-p file load selector) ++ (let* ((naive-elc-file (file-name-with-extension file "elc")) ++ (elc-file (replace-regexp-in-string ++ "\\.el\\.elc$" ".elc" naive-elc-file))) ++ (or (gethash elc-file comp--no-native-compile) ++ (funcall native-compile-async-skip-p file load selector)))) ++ ++(advice-add 'native-compile-async-skip-p ++ :around 'fixed-native-compile-async-skip-p) ++;; SUSE boo#1234673 -- end + + (defun native--compile-async (files &optional recursively load selector) + ;; BEWARE, this function is also called directly from C. diff --git a/emacs.changes b/emacs.changes index 7860f2a..f8c4068 100644 --- a/emacs.changes +++ b/emacs.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Thu Jan 9 12:26:03 UTC 2025 - Dr. Werner Fink + +- Avoid that Emacs reompiles some packages on every startup (boo#1234673) + ------------------------------------------------------------------- Fri Dec 13 14:42:16 UTC 2024 - Dr. Werner Fink diff --git a/emacs.spec b/emacs.spec index ef44da9..bbd948e 100644 --- a/emacs.spec +++ b/emacs.spec @@ -1,7 +1,7 @@ # # spec file for package emacs # -# Copyright (c) 2024 SUSE LLC +# Copyright (c) 2025 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -218,6 +218,7 @@ Patch25: emacs-26.1-xft4x11.patch Patch26: emacs-27.1-pdftex.patch Patch29: emacs-27.1-Xauthority4server.patch Patch30: emacs-CVE-2024-53920.patch +Patch31: emacs-29.4-boo1234673.patch BuildRoot: %{_tmppath}/%{name}-%{version}-build %{expand: %%global include_info %(test -s /usr/share/info/info.info* && echo 0 || echo 1)} %{expand: %%global _exec_prefix %(type -p pkg-config &>/dev/null && pkg-config --variable prefix x11 || echo /usr/X11R6)} @@ -325,7 +326,7 @@ Summary: Info files for GNU Emacs Group: Documentation/Other %if 0%{?suse_version} <= 1500 Requires(post): %install_info_prereq -Requires(preun):%install_info_prereq +Requires(preun): %install_info_prereq %endif BuildArch: noarch @@ -353,7 +354,7 @@ group called "games". Summary: Generate Tag Files for Use with Emacs Group: Development/Tools/Navigators Requires(post): coreutils update-alternatives -Requires(preun):coreutils update-alternatives +Requires(preun): coreutils update-alternatives Provides: ctags:/usr/bin/etags %description -n etags @@ -381,6 +382,7 @@ and most assembler-like syntaxes. %patch -P26 -p0 -b .fmt %patch -P29 -p0 -b .xauth %patch -P30 -p0 -b .cve202453920 +%patch -P31 -p0 -b .boo1234673 %patch -P0 -p0 -b .0 %if %{without tex4pdf} pushd etc/refcards/ @@ -755,6 +757,7 @@ rm -vf %{buildroot}%{_datadir}/emacs/%{version}/lisp/server.el.xauth rm -vf %{buildroot}%{_datadir}/emacs/%{version}/lisp/htmlfontify.el.cve202248339 rm -vf %{buildroot}%{_datadir}/emacs/%{version}/lisp/progmodes/elisp-mode.el.el.cve202453920 rm -vf %{buildroot}%{_datadir}/emacs/%{version}/lisp/progmodes/ruby-mode.el.cve202248338 +rm -vf %{buildroot}%{_datadir}/emacs/%{version}/lisp/emacs-lisp/comp.el.boo1234673 rm -vf %{buildroot}%{_datadir}/emacs/%{version}/etc/emacsclient-mail.desktop.cve202327985 rm -vf %{buildroot}%{_datadir}/emacs/%{version}/etc/emacsclient-mail.desktop.cve202327986 rm -vf %{buildroot}%{_datadir}/emacs/%{version}/etc/emacsclient.desktop.cve202327985 From 907f91ab27b6f37eb20638491c79e2a88ee5b6ec358d4c4a0ecb7779b973ad53 Mon Sep 17 00:00:00 2001 From: "Dr. Werner Fink" Date: Fri, 10 Jan 2025 12:55:05 +0000 Subject: [PATCH 2/4] . OBS-URL: https://build.opensuse.org/package/show/editors/emacs?expand=0&rev=441 --- emacs.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/emacs.spec b/emacs.spec index bbd948e..7b58c21 100644 --- a/emacs.spec +++ b/emacs.spec @@ -872,7 +872,10 @@ export AR=gcc-ar-13 export RANLIB=gcc-ranlib-13 %endif %endif -make check +sed -ri '/sleep 2/{ s/sleep 2/sleep 6/ }' test/lisp/eshell/eshell-tests.el +sed -ri '/\(sleep-for/{ s/1/5/ }' test/lisp/net/network-stream-tests.el +export MAKEFLAGS="--jobs=1" +make -k check %endif %if %{with games} && "%{gattr}" == "02755" From bab9566e1ac0f357db7cacef8705dad1737120e864aea76aa2148eda6e12d534 Mon Sep 17 00:00:00 2001 From: "Dr. Werner Fink" Date: Fri, 10 Jan 2025 12:55:49 +0000 Subject: [PATCH 3/4] . OBS-URL: https://build.opensuse.org/package/show/editors/emacs?expand=0&rev=442 --- emacs.changes | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/emacs.changes b/emacs.changes index f8c4068..442ed88 100644 --- a/emacs.changes +++ b/emacs.changes @@ -1,7 +1,7 @@ ------------------------------------------------------------------- Thu Jan 9 12:26:03 UTC 2025 - Dr. Werner Fink -- Avoid that Emacs reompiles some packages on every startup (boo#1234673) +- Avoid that Emacs recompiles some packages on every startup (boo#1234673) ------------------------------------------------------------------- Fri Dec 13 14:42:16 UTC 2024 - Dr. Werner Fink From ea63c8860fb8fc448d0e64c5f3767c681528b6dd00cb4ff5eeed0395bedb3016 Mon Sep 17 00:00:00 2001 From: "Dr. Werner Fink" Date: Fri, 10 Jan 2025 14:29:39 +0000 Subject: [PATCH 4/4] . OBS-URL: https://build.opensuse.org/package/show/editors/emacs?expand=0&rev=443 --- emacs.changes | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/emacs.changes b/emacs.changes index 442ed88..10de654 100644 --- a/emacs.changes +++ b/emacs.changes @@ -1,7 +1,8 @@ ------------------------------------------------------------------- Thu Jan 9 12:26:03 UTC 2025 - Dr. Werner Fink -- Avoid that Emacs recompiles some packages on every startup (boo#1234673) +- Add patch emacs-29.4-boo1234673.patch + * Avoid that Emacs recompiles some packages on every startup (boo#1234673) ------------------------------------------------------------------- Fri Dec 13 14:42:16 UTC 2024 - Dr. Werner Fink