[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#10095: 24.0.50; cperl-mode highlight bug
From: |
Stefan Monnier |
Subject: |
bug#10095: 24.0.50; cperl-mode highlight bug |
Date: |
Mon, 06 Aug 2012 13:41:52 -0400 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.1.50 (gnu/linux) |
Version: 24.2
>> It still exists in GNU Emacs 24.1.1. I actually noticed the problem
>> on the following code, and I believe it's the same bug. It seems
>> that CPerl doesn't detect the end of a long qq or qw.
> Thanks for the test case, I can reproduce it here with the trunk, so
> it's not yet fixed.
I've just installed the patch below in the `emacs-24' branch. I believe
it fixes your problem. Thanks for the good test case,
Stefan
=== modified file 'lisp/progmodes/cperl-mode.el'
--- lisp/progmodes/cperl-mode.el 2012-07-18 09:33:09 +0000
+++ lisp/progmodes/cperl-mode.el 2012-08-06 17:20:25 +0000
@@ -1838,7 +1838,13 @@
(set (make-local-variable 'cperl-syntax-done-to) nil)
(set (make-local-variable 'syntax-propertize-function)
(lambda (start end)
- (goto-char start) (cperl-fontify-syntaxically end))))
+ (goto-char start)
+ ;; Even if cperl-fontify-syntaxically has already gone
+ ;; beyond `start', syntax-propertize has just removed
+ ;; syntax-table properties between start and end, so we have
+ ;; to re-apply them.
+ (setq cperl-syntax-done-to start)
+ (cperl-fontify-syntaxically end))))
(make-local-variable 'parse-sexp-lookup-properties)
;; Do not introduce variable if not needed, we check it!
(set 'parse-sexp-lookup-properties t)