[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] master a184a7e: Propertize only perl prototype chars `][$%
From: |
Noam Postavsky |
Subject: |
[Emacs-diffs] master a184a7e: Propertize only perl prototype chars `][$%&*; address@hidden' as punctuation |
Date: |
Sat, 1 Apr 2017 17:36:21 -0400 (EDT) |
branch: master
commit a184a7edc58e1e053aa317a0f162df7e225597e1
Author: Evgeni Kolev <address@hidden>
Commit: Noam Postavsky <address@hidden>
Propertize only perl prototype chars `][$%&*;address@hidden' as punctuation
This prevents variables in signatures such as `sub add ($a, $b)' from
being 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 | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/lisp/progmodes/perl-mode.el b/lisp/progmodes/perl-mode.el
index a516f07..b75f32e 100644
--- a/lisp/progmodes/perl-mode.el
+++ b/lisp/progmodes/perl-mode.el
@@ -255,9 +255,11 @@
;; 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 `$%&*;address@hidden' as punctuation
+ ;; in `sub' arg-specs like `sub myfun ($)' and `sub ($)'. But
+ ;; don't match subroutine signatures like `sub add ($a, $b)', or
+ ;; anonymous subs like "sub { (...) ... }".
+
("\\<sub\\(?:[\s\t\n]+\\(?:\\sw\\|\\s_\\)+\\)?[\s\t\n]*(\\([][$%&*;address@hidden))"
(1 "."))
;; Turn __DATA__ trailer into a comment.
("^\\(_\\)_\\(?:DATA\\|END\\)__[
\t]*\\(?:\\(\n\\)#.-\\*-.*perl.*-\\*-\\|\n.*\\)"
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Emacs-diffs] master a184a7e: Propertize only perl prototype chars `][$%&*; address@hidden' as punctuation,
Noam Postavsky <=