;; Fix for msb.el
(defvar cperl-msb-fixed nil)
(defvar cperl-use-major-mode 'cperl-mode)
-(defvar cperl-font-lock-multiline-start nil)
-(defvar cperl-font-lock-multiline nil)
(defvar cperl-font-locking nil)
(defvar cperl-compilation-error-regexp-list
(when (< emacs-major-version 27)
(setq-local open-paren-in-column-0-is-defun-start nil))
;; Until Emacs is multi-threaded, we do not actually need it local:
- (make-local-variable 'cperl-font-lock-multiline-start)
(make-local-variable 'cperl-font-locking)
(setq-local outline-regexp cperl-outline-regexp)
(setq-local outline-level 'cperl-outline-level)
;; to re-apply them.
(setq cperl-syntax-done-to start)
(cperl-fontify-syntactically end))))
- (setq cperl-font-lock-multiline t) ; Not localized...
(setq-local font-lock-multiline t)
(setq-local font-lock-fontify-region-function
#'cperl-font-lock-fontify-region-function)
delim-begin delim-end)
"Process a here-document's delimiters and body.
The parameters MIN, MAX, END, OVERSHOOT, STOP-POINT, ERR-L are
-used for recursive calls to `cperl-find-pods-here' to handle the
+used for recursive calls to `cperl-find-pods-heres' to handle the
rest of the line which contains the delimiter. MATCHED-POS and
TODO-POS are initial values for this function's result.
END-OF-HERE-DOC is the end of a previous here-doc in the same
(cond ((featurep 'ps-print)
(or cperl-faces-init
(progn
- (setq cperl-font-lock-multiline t)
(cperl-init-faces))))
((not cperl-faces-init)
(add-hook 'font-lock-mode-hook
"([^()]*)\\)?" ; prototype
cperl-maybe-white-and-comment-rex ; whitespace/comments?
"[{;]")
- 2 (if cperl-font-lock-multiline
- '(if (eq (char-after (cperl-1- (match-end 0))) ?\{ )
+ 2 '(if (eq (char-after (cperl-1- (match-end 0))) ?\{ )
'font-lock-function-name-face
- 'font-lock-variable-name-face)
- ;; need to manually set 'multiline' for older font-locks
- '(progn
- (if (< 1 (count-lines (match-beginning 0)
- (match-end 0)))
- (put-text-property
- (+ 3 (match-beginning 0)) (match-end 0)
- 'syntax-type 'multiline))
- (if (eq (char-after (cperl-1- (match-end 0))) ?\{ )
- 'font-lock-function-name-face
- 'font-lock-variable-name-face))))
+ 'font-lock-variable-name-face))
`(,(rx (sequence symbol-start
(or "package" "require" "use" "import"
"no" "bootstrap")
;; "\\(("
;; cperl-maybe-white-and-comment-rex
;; "\\)?\\([$@%*]\\([a-zA-Z0-9_:]+\\|[^a-zA-Z0-9_]\\)\\)")
- ;; (5 ,(if cperl-font-lock-multiline
- (1 ,(if cperl-font-lock-multiline
- 'font-lock-variable-name-face
- '(progn (setq cperl-font-lock-multiline-start
- (match-beginning 0))
- 'font-lock-variable-name-face)))
+ (1 font-lock-variable-name-face)
(,(rx (sequence point
(eval cperl--ws*-rx)
","
;; Bug in font-lock: limit is used not only to limit
;; searches, but to set the "extend window for
;; facification" property. Thus we need to minimize.
- ,(if cperl-font-lock-multiline
- '(if (match-beginning 1)
- (save-excursion
- (goto-char (match-beginning 1))
- (condition-case nil
- (forward-sexp 1)
- (error
- (condition-case nil
- (forward-char 200)
- (error nil)))) ; typeahead
- (1- (point))) ; report limit
- (forward-char -2)) ; disable continued expr
- '(if (match-beginning 1)
- (point-max) ; No limit for continuation
- (forward-char -2))) ; disable continued expr
- ,(if cperl-font-lock-multiline
- nil
- '(progn ; Do at end
- ;; "my" may be already fontified (POD),
- ;; so cperl-font-lock-multiline-start is nil
- (if (or (not cperl-font-lock-multiline-start)
- (> 2 (count-lines
- cperl-font-lock-multiline-start
- (point))))
- nil
- (put-text-property
- (1+ cperl-font-lock-multiline-start) (point)
- 'syntax-type 'multiline))
- (setq cperl-font-lock-multiline-start nil)))
+ '(if (match-beginning 1)
+ (save-excursion
+ (goto-char (match-beginning 1))
+ (condition-case nil
+ (forward-sexp 1)
+ (error
+ (condition-case nil
+ (forward-char 200)
+ (error nil)))) ; typeahead
+ (1- (point))) ; report limit
+ (forward-char -2)) ; disable continued expr
+ nil
(1 font-lock-variable-name-face)))
;; foreach my $foo (
`(,(rx symbol-start "for" (opt "each")