#27 Fix python loop error
Merged a year ago by fed500. Opened a year ago by fed500.
Unknown source f38  into  f38

file modified
+20 -4
@@ -5,8 +5,8 @@

  Name:          emacs

  Epoch:         1

  Version:       28.2

- Release:       4%{?dist}

- License:       GPLv3+ and CC0

+ Release:       7%{?dist}

+ License:       GPL-3.0-or-later AND CC0-1.0

  URL:           http://www.gnu.org/software/emacs/

  Source0:       https://ftp.gnu.org/gnu/emacs/emacs-%{version}.tar.xz

  Source1:       https://ftp.gnu.org/gnu/emacs/emacs-%{version}.tar.xz.sig
@@ -33,6 +33,10 @@

  # https://debbugs.gnu.org/cgi/bugreport.cgi?bug=60208

  # backport of https://git.savannah.gnu.org/cgit/emacs.git/patch/?id=e59216d3be86918b995bd63273c851ebc6176a83

  Patch8:        native-compile-with_-Q.patch

+ Patch9:        webkit2gtk-4.1.patch

+ # Fix infinite loop error https://debbugs.gnu.org/cgi/bugreport.cgi?bug=58780

+ # Can be removed on next release of Emacs rhbz#2187041

+ Patch10:       fix-searching-for-end-of-string-in-python-nav-end-of.patch

  

  BuildRequires: gcc

  BuildRequires: atk-devel
@@ -78,7 +82,7 @@

  BuildRequires: libgccjit-devel

  

  BuildRequires: gtk3-devel

- BuildRequires: webkit2gtk3-devel

+ BuildRequires: webkit2gtk4.1-devel

  

  BuildRequires: gnupg2

  
@@ -157,7 +161,7 @@

  Summary:       Emacs common files

  # The entire source code is GPLv3+ except lib-src/etags.c which is

  # also BSD.  Manual (info) is GFDL.

- License:       GPLv3+ and GFDL and BSD

+ License:       GPL-3.0-or-later AND GFDL-1.3-no-invariants-or-later AND BSD-3-Clause

  Requires(preun): %{_sbindir}/alternatives

  Requires(posttrans): %{_sbindir}/alternatives

  Requires:      %{name}-filesystem = %{epoch}:%{version}-%{release}
@@ -220,6 +224,8 @@

  %patch6 -p1

  %patch7 -p1 -b .ctags-local-execution-cve

  %patch8 -p1 -b .native-compile-Q

+ %patch9 -p1 -b .webkit2gtk-4.1

+ %patch10 -p1

  autoconf

  

  grep -v "tetris.elc" lisp/Makefile.in > lisp/Makefile.in.new \
@@ -544,6 +550,16 @@

  %{_includedir}/emacs-module.h

  

  %changelog

+ * Wed May 31 2023 Benson Muite <benson_muite@emailplus.org> 1:28.2-7

+ - Apply patch to prevent infinite loops when editing python files

+   fixes rhbz#2187041

+ 

+ * Mon Apr 24 2023 Lukáš Zaoral <lzaoral@redhat.com> - 1:28.2-6

+ - migrate to SPDX license format

+ 

+ * Fri Feb 10 2023 Michael Catanzaro <mcatanzaro@redhat.com> - 1:28.2-5

+ - Use webkit2gtk-4.1

+ 

  * Fri Jan 27 2023 Dan Čermák <dan.cermak@cgc-instruments.com> - 1:28.2-4

  - Ensure that emacs-nox loads the correct eln files

  

@@ -0,0 +1,106 @@

+ From 62cfa24a89fdbf90cbe866ad88ca635327eb1f49 Mon Sep 17 00:00:00 2001

+ From: kobarity <kobarity@gmail.com>

+ Date: Sun, 5 Mar 2023 17:06:26 +0900

+ Subject: [PATCH 1/2] Fix searching for end of string in

+  python-nav-end-of-statement

+ 

+ * lisp/progmodes/python.el (python-nav-end-of-statement): Add

+ searching for corresponding string-quote.

+ * test/lisp/progmodes/python-tests.el (python-nav-end-of-statement-3)

+ (python-nav-end-of-statement-4, python-info-current-defun-4): New

+ tests. (Bug#58780)

+ ---

+  lisp/progmodes/python.el            | 14 ++++++---

+  test/lisp/progmodes/python-tests.el | 44 +++++++++++++++++++++++++++++

+  2 files changed, 54 insertions(+), 4 deletions(-)

+ 

+ diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el

+ index 1f970633bfc..cc4ece1669c 100644

+ --- a/lisp/progmodes/python.el

+ +++ b/lisp/progmodes/python.el

+ @@ -2076,10 +2076,16 @@ python-nav-end-of-statement

+                             (goto-char (+ (point)

+                                           (python-syntax-count-quotes

+                                            (char-after (point)) (point))))

+ -                           (setq last-string-end

+ -                                 (or (re-search-forward

+ -                                      (rx (syntax string-delimiter)) nil t)

+ -                                     (goto-char (point-max)))))))

+ +                           (setq

+ +                            last-string-end

+ +                            (or (if (eq t (nth 3 (syntax-ppss)))

+ +                                    (re-search-forward

+ +                                     (rx (syntax string-delimiter)) nil t)

+ +                                  (ignore-error scan-error

+ +                                    (goto-char string-start)

+ +                                    (python-nav--lisp-forward-sexp)

+ +                                    (point)))

+ +                                (goto-char (point-max)))))))

+                        ((python-syntax-context 'paren)

+                         ;; The statement won't end before we've escaped

+                         ;; at least one level of parenthesis.

+ diff --git a/test/lisp/progmodes/python-tests.el b/test/lisp/progmodes/python-tests.el

+ index 4f24c042c6a..e9df4a2c843 100644

+ --- a/test/lisp/progmodes/python-tests.el

+ +++ b/test/lisp/progmodes/python-tests.el

+ @@ -2943,6 +2943,36 @@ python-nav-end-of-statement-2

+     "'\n''\n"

+     (python-nav-end-of-statement)))

+  

+ +(ert-deftest python-nav-end-of-statement-3 ()

+ +  "Test unmatched quotes (Bug#58780)."

+ +  (python-tests-with-temp-buffer

+ +   "

+ +' \"\"\"

+ +v = 1

+ +"

+ +   (python-tests-look-at "v =")

+ +   (should (= (save-excursion

+ +                (python-nav-end-of-statement)

+ +                (point))

+ +              (save-excursion

+ +                (point-max))))))

+ +

+ +(ert-deftest python-nav-end-of-statement-4 ()

+ +  (python-tests-with-temp-buffer

+ +   "

+ +abc = 'a\\

+ +b\\

+ +c'

+ +d = '''d'''

+ +"

+ +   (python-tests-look-at "b\\")

+ +   (should (= (save-excursion

+ +                (python-nav-end-of-statement)

+ +                (point))

+ +              (save-excursion

+ +                (python-tests-look-at "c'")

+ +                (pos-eol))))))

+ +

+  (ert-deftest python-nav-forward-statement-1 ()

+    (python-tests-with-temp-buffer

+     "

+ @@ -5209,6 +5239,20 @@ python-info-current-defun-3

+     (should (string= (python-info-current-defun t)

+                      "def decoratorFunctionWithArguments"))))

+  

+ +(ert-deftest python-info-current-defun-4 ()

+ +  "Ensure unmatched quotes do not cause hang (Bug#58780)."

+ +  (python-tests-with-temp-buffer

+ +   "

+ +def func():

+ +    ' \"\"\"

+ +    v = 1

+ +"

+ +   (python-tests-look-at "v = 1")

+ +   (should (string= (python-info-current-defun)

+ +                    "func"))

+ +   (should (string= (python-info-current-defun t)

+ +                    "def func"))))

+ +

+  (ert-deftest python-info-current-symbol-1 ()

+    (python-tests-with-temp-buffer

+     "

+ -- 

+ 2.34.1

+ 

file added
+14
@@ -0,0 +1,14 @@

+ diff --git a/configure.ac b/configure.ac

+ index 0b3a1bc..79c88a1 100644

+ --- a/configure.ac

+ +++ b/configure.ac

+ @@ -2750,8 +2750,7 @@ HAVE_XWIDGETS=no

+  XWIDGETS_OBJ=

+  if test "$with_xwidgets" != "no"; then

+    if test "$USE_GTK_TOOLKIT" = "GTK3" && test "$window_system" != "none"; then

+ -    WEBKIT_REQUIRED=2.12

+ -    WEBKIT_MODULES="webkit2gtk-4.0 >= $WEBKIT_REQUIRED"

+ +    WEBKIT_MODULES="webkit2gtk-4.1"

+      EMACS_CHECK_MODULES([WEBKIT], [$WEBKIT_MODULES])

+      HAVE_XWIDGETS=$HAVE_WEBKIT

+      XWIDGETS_OBJ="xwidget.o"

no initial comment

Pull-Request has been merged by fed500

a year ago