Add fix for rhbz#1950158: freeze in modula2 mode

This commit is contained in:
Dan Čermák 2021-04-26 15:12:23 +02:00
parent 3bd96ee697
commit 557fe36568
No known key found for this signature in database
GPG Key ID: 8F8C178E966641D3
2 changed files with 37 additions and 1 deletions

30
emacs-modula2.patch Normal file
View File

@ -0,0 +1,30 @@
From 462ca0654d2aa2a2b6506f2e9a1a9ceb8e683cad Mon Sep 17 00:00:00 2001
From: Gregory Heytings <gregory@heytings.org>
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

View File

@ -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 <dan.cermak@cgc-instruments.com> - 1:27.2-2
- Add emacs-modula2.patch
- Fixes rhbz#1950158
* Thu Mar 27 2021 Bhavin Gandhi <bhavin7392@gmail.com> - 1:27.2-1
- emacs-27.2 is available