summaryrefslogtreecommitdiff
path: root/lisp/progmodes
diff options
context:
space:
mode:
authorStefan Monnier <monnier@iro.umontreal.ca>2010-11-02 22:30:12 -0400
committerStefan Monnier <monnier@iro.umontreal.ca>2010-11-02 22:30:12 -0400
commit3225dcaadb08bd53744fb3e34cbf692e4cb22e62 (patch)
tree57fa8e552969565077fde16c1aa05cf9046d3745 /lisp/progmodes
parent6ec9acb3b41c7e6358c3b733828339930d0be9f0 (diff)
downloademacs-3225dcaadb08bd53744fb3e34cbf692e4cb22e62.tar.gz
* lisp/progmodes/perl-mode.el (perl-syntax-propertize-function):
Handle __DATA__ and __END__.
Diffstat (limited to 'lisp/progmodes')
-rw-r--r--lisp/progmodes/perl-mode.el5
1 files changed, 5 insertions, 0 deletions
diff --git a/lisp/progmodes/perl-mode.el b/lisp/progmodes/perl-mode.el
index ae3acc3cda3..1bc9a397bc7 100644
--- a/lisp/progmodes/perl-mode.el
+++ b/lisp/progmodes/perl-mode.el
@@ -274,6 +274,11 @@ The expansion is entirely correct because it uses the C preprocessor."
;; Be careful not to match "sub { (...) ... }".
("\\<sub\\(?:[[:space:]]+[^{}[:punct:][:space:]]+\\)?[[:space:]]*(\\([^)]+\\))"
(1 "."))
+ ;; Turn __DATA__ trailer into a comment.
+ ("^\\(_\\)_\\(?:DATA\\|END\\)__[ \t]*\\(?:\\(\n\\)#.-\\*-.*perl.*-\\*-\\|\n.*\\)"
+ (1 "< c") (2 "> c")
+ (0 (ignore (put-text-property (match-beginning 0) (match-end 0)
+ 'syntax-multiline t))))
;; Regexp and funny quotes. Distinguishing a / that starts a regexp
;; match from the division operator is ...interesting.
;; Basically, / is a regexp match if it's preceded by an infix operator