unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Vincent Lefevre <vincent@vinc17.net>
To: 11739@debbugs.gnu.org
Subject: bug#11739: 24.1; font-lock (highlighting) bug with dollar+quote sequence ('...$')
Date: Tue, 19 Jun 2012 15:15:23 +0200	[thread overview]
Message-ID: <20120619131523.GA17701@xvii.vinc17.org> (raw)
In-Reply-To: <87d34vwqfc.fsf@ypig.lip.ens-lyon.fr>

On 2012-06-19 12:23:51 +0200, Vincent Lefevre wrote:
> Open the following file with "emacs -Q <filename>":
> 
> ------------------------------------------------------------
> #!/usr/bin/env perl
> # -*- mode: cperl -*-
> 
> $foo = 'blah $ '
>   and print "$foo\n";  # OK
> 
> $foo = 'blah $'
>   and print "$foo\n";  # Incorrectly highlighted
> ------------------------------------------------------------
> 
> The first "and print ..." line is correctly highlighted, but not the
> second one. It seems that CPerl is confused by a $ at the end of a
> single-quote string literal.

The problem is due to this change in cperl-mode.el:

@@ -1832,7 +1832,13 @@
   (make-local-variable 'cperl-syntax-state)
   (setq cperl-syntax-state nil)                ; reset syntaxification cache
   (if cperl-use-syntax-table-text-property
-      (progn
+      (if (boundp 'syntax-propertize-function)
+          (progn
+            ;; Reset syntaxification cache.
+            (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))))
        (make-local-variable 'parse-sexp-lookup-properties)
        ;; Do not introduce variable if not needed, we check it!
        (set 'parse-sexp-lookup-properties t)

-- 
Vincent Lefèvre <vincent@vinc17.net> - Web: <http://www.vinc17.net/>
100% accessible validated (X)HTML - Blog: <http://www.vinc17.net/blog/>
Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon)





  reply	other threads:[~2012-06-19 13:15 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-06-19 10:23 bug#11739: 24.1; font-lock (highlighting) bug with dollar+quote sequence ('...$') Vincent Lefevre
2012-06-19 13:15 ` Vincent Lefevre [this message]
2012-06-21 16:52 ` Stefan Monnier

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20120619131523.GA17701@xvii.vinc17.org \
    --to=vincent@vinc17.net \
    --cc=11739@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).