emacs-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[debbugs-tracker] bug#17116: closed (perl mode vs. /./)


From: GNU bug Tracking System
Subject: [debbugs-tracker] bug#17116: closed (perl mode vs. /./)
Date: Wed, 02 Apr 2014 19:52:02 +0000

Your message dated Wed, 02 Apr 2014 15:51:00 -0400
with message-id <address@hidden>
and subject line Re: bug#17116: perl mode vs. /./
has caused the debbugs.gnu.org bug report #17116,
regarding perl mode vs. /./
to be marked as done.

(If you believe you have received this mail in error, please contact
address@hidden)


-- 
17116: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=17116
GNU Bug Tracking System
Contact address@hidden with problems
--- Begin Message --- Subject: perl mode vs. /./ Date: Thu, 27 Mar 2014 16:25:26 +0800
$ cat o.pl
print for /./; #why is the rest of this line in this color?
$ emacs o.pl



--- End Message ---
--- Begin Message --- Subject: Re: bug#17116: perl mode vs. /./ Date: Wed, 02 Apr 2014 15:51:00 -0400 User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux)
> $ cat o.pl
> print for /./; #why is the rest of this line in this color?
> $ emacs o.pl

Thanks for the clear test case.

Because perl-mode doesn't understand this code.  It considers the first
slash as a "plain slash" (e.g. the one used for division), whereas the
second, being right after a punctuation (and hence can's be a division),
is assumed to start a regexp.

I installed the patch below which should fix those problems.


        Stefan


=== modified file 'lisp/progmodes/perl-mode.el'
--- lisp/progmodes/perl-mode.el 2014-04-02 19:47:50 +0000
+++ lisp/progmodes/perl-mode.el 2014-04-02 19:48:21 +0000
@@ -276,7 +276,7 @@
       ;; perl-font-lock-special-syntactic-constructs.
       ((concat "\\(?:\\(?:^\\|[^$@&%[:word:]]\\)"
                (regexp-opt '("split" "if" "unless" "until" "while" "split"
-                             "grep" "map" "not" "or" "and"))
+                             "grep" "map" "not" "or" "and" "for" "foreach"))
                "\\|[?:.,;=!~({[]\\|\\(^\\)\\)[ \t\n]*\\(/\\)")
        (2 (ignore
            (if (and (match-end 1)       ; / at BOL.



--- End Message ---

reply via email to

[Prev in Thread] Current Thread [Next in Thread]