GNU bug report logs - #17116
perl mode vs. /./

Previous Next

Package: emacs;

Reported by: 積丹尼 Dan Jacobson <jidanni <at> jidanni.org>

Date: Thu, 27 Mar 2014 08:26:01 UTC

Severity: minor

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: help-debbugs <at> gnu.org (GNU bug Tracking System)
To: 積丹尼 Dan Jacobson <jidanni <at> jidanni.org>
Subject: bug#17116: closed (Re: bug#17116: perl mode vs. /./)
Date: Wed, 02 Apr 2014 19:52:02 +0000
[Message part 1 (text/plain, inline)]
Your bug report

#17116: perl mode vs. /./

which was filed against the emacs package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to 17116 <at> debbugs.gnu.org.

-- 
17116: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=17116
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: 積丹尼 Dan Jacobson <jidanni <at> jidanni.org>
Cc: 17116-done <at> debbugs.gnu.org
Subject: Re: bug#17116: perl mode vs. /./
Date: Wed, 02 Apr 2014 15:51:00 -0400
> $ 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.


[Message part 3 (message/rfc822, inline)]
From: 積丹尼 Dan Jacobson <jidanni <at> jidanni.org>
To: bug-gnu-emacs <at> gnu.org
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



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

Previous Next


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