GNU bug report logs - #15778
24.3; cperl-mode causes emacs to lock up

Previous Next

Package: emacs;

Reported by: Nathan Trapuzzano <nbtrap <at> nbtrap.com>

Date: Fri, 1 Nov 2013 11:21:02 UTC

Severity: normal

Found in version 24.3

Done: Stefan Monnier <monnier <at> iro.umontreal.ca>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Nathan Trapuzzano <nbtrap <at> nbtrap.com>
To: Stephen Berman <stephen.berman <at> gmx.net>
Cc: 15778 <at> debbugs.gnu.org
Subject: bug#15778: 24.3; cperl-mode causes emacs to lock up
Date: Sun, 03 Nov 2013 08:59:02 -0500
[Message part 1 (text/plain, inline)]
Stephen Berman <stephen.berman <at> gmx.net> writes:

> I also tried and failed to get Edebug to kick in here, but I did make an
> observation that surprised me but I assume is somehow relevant: if I
> start Emacs with -Q, insert your sample perl code in a new buffer,
> invoke cperl-mode, go to line 44 and type C-k, Emacs hangs, as you
> discovered -- but if, after starting with -Q and inserting the sample
> code I first invoke perl-mode and after the buffer fontifies invoke
> cperl-mode, now when I go to line 44, C-k kills the line as it should
> and there is no other problem, even if I then change the buffer to some
> other mode and then back to cperl-mode again.

Since there seems to be inconsistend behavior, would you mind trying my
patch and making sure none of the scenarios you've tried so far causes
Emacs to hang?

[cperl-mode.patch (text/x-diff, inline)]
From 0b73932e90496e0477eddce6ba7e87d2137cb730 Mon Sep 17 00:00:00 2001
From: Nathan Trapuzzano <nbtrap <at> nbtrap.com>
Date: Sun, 3 Nov 2013 08:44:36 -0500
Subject: [PATCH] * progmodes/cperl-mode.el
 (cperl-font-lock-fontify-region-function): Don't infloop when expanding
 region over `multiline' syntax-type that begins a line. (Bug#15778)

---
 lisp/ChangeLog               | 7 +++++++
 lisp/progmodes/cperl-mode.el | 5 +++--
 2 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 6a91465..b047b57 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,10 @@
+2013-11-03  Nathan Trapuzzano  <nbtrap <at> nbtrap.com>
+
+	* progmodes/cperl-mode.el
+	(cperl-font-lock-fontify-region-function): Don't infloop when
+	expanding region over `multiline' syntax-type that begins a line.
+	(Bug#15778)
+
 2013-11-02  Glenn Morris  <rgm <at> gnu.org>
 
 	* Makefile.in (EMACS): Use a relative filename.
diff --git a/lisp/progmodes/cperl-mode.el b/lisp/progmodes/cperl-mode.el
index 8a7d1e7..36b05c8 100644
--- a/lisp/progmodes/cperl-mode.el
+++ b/lisp/progmodes/cperl-mode.el
@@ -8900,8 +8900,9 @@ do extra unwind via `cperl-unwind-to-safe'."
 		  (beginning-of-line)
 		  (eq (get-text-property (setq beg (point)) 'syntax-type)
 		      'multiline)))
-      (if (setq beg (cperl-beginning-of-property beg 'syntax-type))
-	  (goto-char beg)))
+      (let ((new-beg (cperl-beginning-of-property beg 'syntax-type)))
+	(setq beg (if (= new-beg beg) nil new-beg))
+	(goto-char new-beg)))
     (setq beg (point))
     (goto-char end)
     (while (and end
-- 
1.8.4.2


This bug report was last modified 11 years and 202 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.