Control: tags -1 patch

On 2018-10-22 03:18:36 +0200, Vincent Lefevre wrote:
> Package: emacs25-common
> Version: 25.2+1-6
> Severity: important
> Tags: upstream
> Forwarded: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=33114
> 
> Consider the following file:
> 
> # -*- mode: cperl -*-
> s/./(/e;
> 
> 1. Open it with "emacs -Q".
> 2. Put the cursor just after the opening parenthesis.
> 3. Type ')' (closing parenthesis).
> 
> This makes Emacs hang. A C-g alone has no effect. Several C-g in a row
> may give the control back to the user.

I've attached the upstream patch that fixes this bug.

Note that one gets an error

  End of ‘s/ ... // ... /’ string/RE not found: (scan-error Unbalanced 
parentheses 26 29)

but that's another (rather minor) issue, which was already present
under different conditions, e.g. with just

  s/./(/;

(i.e. without the 'e').

-- 
Vincent Lefèvre <vinc...@vinc17.net> - Web: <https://www.vinc17.net/>
100% accessible validated (X)HTML - Blog: <https://www.vinc17.net/blog/>
Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon)
--- a/lisp/progmodes/cperl-mode.el
+++ b/lisp/progmodes/cperl-mode.el
@@ -8905,7 +8905,7 @@ do extra unwind via `cperl-unwind-to-saf
        (goto-char new-beg)))
     (setq beg (point))
     (goto-char end)
-    (while (and end
+    (while (and end (< end (point-max))
                (progn
                  (or (bolp) (condition-case nil
                                 (forward-line 1)

Reply via email to