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.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 17116 in the body.
You can then email your comments to 17116 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#17116; Package emacs. (Thu, 27 Mar 2014 08:26:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to 積丹尼 Dan Jacobson <jidanni <at> jidanni.org>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Thu, 27 Mar 2014 08:26:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

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




Reply sent to Stefan Monnier <monnier <at> iro.umontreal.ca>:
You have taken responsibility. (Wed, 02 Apr 2014 19:52:02 GMT) Full text and rfc822 format available.

Notification sent to 積丹尼 Dan Jacobson <jidanni <at> jidanni.org>:
bug acknowledged by developer. (Wed, 02 Apr 2014 19:52:02 GMT) Full text and rfc822 format available.

Message #10 received at 17116-done <at> debbugs.gnu.org (full text, mbox):

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.





bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Thu, 01 May 2014 11:24:03 GMT) Full text and rfc822 format available.

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

Previous Next


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