From 49615aad35630082e1b0d37a8b99717a12ec4f06 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 eb1fb93..ff059f1 100644 --- a/emacs.spec +++ b/emacs.spec @@ -5,7 +5,7 @@ Summary: GNU Emacs text editor Name: emacs Epoch: 1 Version: 27.2 -Release: 2%{?dist} +Release: 3%{?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 @@ -27,6 +27,7 @@ Patch1: emacs-spellchecker.patch Patch2: emacs-system-crypto-policies.patch Patch3: emacs-glibc-2.34.patch Patch4: emacs-libdir-vs-systemd.patch +Patch5: https://lists.gnu.org/archive/html/bug-gnu-emacs/2021-04/txt0tY7uKvJKS.txt#./emacs-modula2.patch BuildRequires: gcc BuildRequires: atk-devel @@ -192,6 +193,7 @@ Development header files for Emacs. %patch2 -p1 -b .system-crypto-policies %patch3 -p1 -b .glibc2.34 %patch4 -p1 -b .libdir-vs-systemd +%patch5 -p1 autoconf # We prefer our emacs.desktop file @@ -483,6 +485,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-3 +- Add emacs-modula2.patch +- Fixes rhbz#1950158 + * Sat Mar 27 2021 Peter Oliver - 1:27.2-2 - Prefer upstream systemd service definition.