From 557fe365687322c5f0b2d6464173d29c245136d8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dan=20=C4=8Cerm=C3=A1k?= Date: Mon, 26 Apr 2021 15:12:23 +0200 Subject: [PATCH] Add fix for rhbz#1950158: freeze in modula2 mode --- emacs-modula2.patch | 30 ++++++++++++++++++++++++++++++ emacs.spec | 8 +++++++- 2 files changed, 37 insertions(+), 1 deletion(-) create mode 100644 emacs-modula2.patch diff --git a/emacs-modula2.patch b/emacs-modula2.patch new file mode 100644 index 0000000..2d0fde8 --- /dev/null +++ b/emacs-modula2.patch @@ -0,0 +1,30 @@ +From 462ca0654d2aa2a2b6506f2e9a1a9ceb8e683cad Mon Sep 17 00:00:00 2001 +From: Gregory Heytings +Date: Sun, 25 Apr 2021 10:33:48 +0000 +Subject: [PATCH] Fix infloop in Modula-2 mode + +* lisp/progmodes/modula2.el (m2-smie-refine-colon): Stop looping when +point does not move with forward-sexp (Bug#48011) +--- + lisp/progmodes/modula2.el | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +diff --git a/lisp/progmodes/modula2.el b/lisp/progmodes/modula2.el +index 2a0374aa81..5756d91831 100644 +--- a/lisp/progmodes/modula2.el ++++ b/lisp/progmodes/modula2.el +@@ -201,7 +201,10 @@ m2-smie-refine-colon + ((zerop (length tok)) + (let ((forward-sexp-function nil)) + (condition-case nil +- (forward-sexp -1) ++ (let ((p (point))) ++ (forward-sexp -1) ++ (if (= p (point)) ++ (setq res ":"))) + (scan-error (setq res ":"))))) + ((member tok '("|" "OF" "..")) (setq res ":-case")) + ((member tok '(":" "END" ";" "BEGIN" "VAR" "RECORD" "PROCEDURE")) +-- +2.30.2 + diff --git a/emacs.spec b/emacs.spec index b28f4bc..3780bb0 100644 --- a/emacs.spec +++ b/emacs.spec @@ -5,7 +5,7 @@ Summary: GNU Emacs text editor Name: emacs Epoch: 1 Version: 27.2 -Release: 1%{?dist} +Release: 2%{?dist} License: GPLv3+ and CC0-1.0 URL: http://www.gnu.org/software/emacs/ Source0: https://ftp.gnu.org/gnu/emacs/emacs-%{version}.tar.xz @@ -26,6 +26,7 @@ Source10: %{name}.appdata.xml # rhbz#713600 Patch1: emacs-spellchecker.patch Patch2: emacs-system-crypto-policies.patch +Patch3: https://lists.gnu.org/archive/html/bug-gnu-emacs/2021-04/txt0tY7uKvJKS.txt#./emacs-modula2.patch BuildRequires: gcc BuildRequires: atk-devel @@ -188,6 +189,7 @@ Development header files for Emacs. %patch1 -p1 -b .spellchecker %patch2 -p1 -b .system-crypto-policies +%patch3 -p1 autoconf # We prefer our emacs.desktop file @@ -482,6 +484,10 @@ rm %{buildroot}%{_datadir}/icons/hicolor/scalable/mimetypes/emacs-document23.svg %{_includedir}/emacs-module.h %changelog +* Mon Apr 26 2021 Dan Čermák - 1:27.2-2 +- Add emacs-modula2.patch +- Fixes rhbz#1950158 + * Thu Mar 27 2021 Bhavin Gandhi - 1:27.2-1 - emacs-27.2 is available