GNU bug report logs - #26037
25.1; perl-mode add syntax support for subroutine signatures

Previous Next

Package: emacs;

Reported by: Evgeni Kolev <evgeni.d.kolev <at> gmail.com>

Date: Thu, 9 Mar 2017 17:25:02 UTC

Severity: wishlist

Tags: fixed, patch

Found in version 25.1

Fixed in version 26.1

Done: npostavs <at> users.sourceforge.net

Bug is archived. No further changes may be made.

Full log


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

From: npostavs <at> users.sourceforge.net
To: 26037 <at> debbugs.gnu.org
Cc: Евгени Колев <evgenysw <at> gmail.com>
Subject: [Евгени Колев] Re: bug#26037:
 25.1; perl-mode add syntax support for subroutine signatures
Date: Mon, 27 Mar 2017 23:34:42 -0400
[Message part 1 (text/plain, inline)]
[Please use Reply All to keep 26037 <at> debbugs.gnu.org on Cc]

[Message part 2 (message/rfc822, inline)]
From: Евгени Колев <evgenysw <at> gmail.com>
To: npostavs <at> users.sourceforge.net
Subject: Re: bug#26037: 25.1; perl-mode add syntax support for subroutine signatures
Date: Mon, 27 Mar 2017 09:55:55 +0300
[Message part 3 (text/plain, inline)]
Sure! Here's output of format-patch, with `+' added to the regex and
updated comment, and again, please let me know if it can be improved:

From 250e022caf3889a1778820bac1ad072240fa93d4 Mon Sep 17 00:00:00 2001
From: Evgeni Kolev <evgenysw <at> gmail.com>
Date: Mon, 27 Mar 2017 09:30:10 +0300
Subject: [PATCH] Propertize only perl prototype chars `][$%&*;+@\' as
 punctuation

As a result, variables in signatures such as `sub add ($a, $b) are not
treated as punctuation.
* lisp/progmodes/perl-mode.el (perl-syntax-propertize-function):
Strictly match only prototype characters as punctuation. (Bug#26037)

Copyright-paperwork-exempt: yes
---
 lisp/progmodes/perl-mode.el | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/lisp/progmodes/perl-mode.el b/lisp/progmodes/perl-mode.el
index a516f07..1bcc743 100644
--- a/lisp/progmodes/perl-mode.el
+++ b/lisp/progmodes/perl-mode.el
@@ -255,9 +255,10 @@
       ;; format statements
       ("^[ \t]*format.*=[ \t]*\\(\n\\)"
        (1 (prog1 "\"" (perl-syntax-propertize-special-constructs end))))
-      ;; Funny things in `sub' arg-specs like `sub myfun ($)' or `sub ($)'.
-      ;; Be careful not to match "sub { (...) ... }".
-      ("\\<sub\\(?:[\s\t\n]+\\(?:\\sw\\|\\s_\\)+\\)?[\s\t\n]*(\\([^)]+\\))"
+      ;; Propertize perl prototype chars `][$%&*;+@\' as punctioation
+      ;; in `sub' arg-specs like `sub myfun ($)' or `sub ($)'. Be
+      ;; careful not to match "sub { (...) ... }".
+
 ("\\<sub\\(?:[\s\t\n]+\\(?:\\sw\\|\\s_\\)+\\)?[\s\t\n]*(\\([][$%&*;+@\\]+\\))"
        (1 "."))
       ;; Turn __DATA__ trailer into a comment.
       ("^\\(_\\)_\\(?:DATA\\|END\\)__[
\t]*\\(?:\\(\n\\)#.-\\*-.*perl.*-\\*-\\|\n.*\\)"
-- 
2.10.0


This bug report was last modified 8 years and 51 days ago.

Previous Next


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