[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: reproducible but very odd make-mode crash
From: |
Joshua Varner |
Subject: |
Re: reproducible but very odd make-mode crash |
Date: |
Wed, 25 May 2005 16:32:08 -0500 |
The following patch resolves the problem i was having (I could only
reproduce this on my machine at work with RH9.0, but it was consistent
on that machine). By restricting the regexp to the current line (sort
of) i was able to avoid whatever strange thing was causing the regexp
to loop infinitely. I tried to use string-match but received some out
of range errors, I don't know what caused those, but that may be
faster than the narrowing. I, however, didn't notice any speed issue.
Josh
P.S. I don't know if this counts as trivial or not, but if you need
papers from me just let me know what I should do.
emacs]$ cvs diff -u lisp/progmodes/make-mode.el
Index: lisp/progmodes/make-mode.el
===================================================================
RCS file: /cvsroot/emacs/emacs/lisp/progmodes/make-mode.el,v
retrieving revision 1.97
diff -u -r1.97 make-mode.el
--- lisp/progmodes/make-mode.el 21 May 2005 02:45:27 -0000 1.97
+++ lisp/progmodes/make-mode.el 25 May 2005 21:23:43 -0000
@@ -1687,8 +1687,10 @@
(or (eq (char-after) ?=)
(get-text-property (1- (point)) 'face)
(when (save-excursion
- (beginning-of-line)
- (looking-at makefile-dependency-regex))
+ (save-restriction
+ (narrow-to-region pt (point))
+ (beginning-of-line)
+ (looking-at makefile-dependency-regex)))
(end-of-line)
(throw 'found (point)))))
(goto-char pt))