aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Monnier2005-03-20 17:06:13 +0000
committerStefan Monnier2005-03-20 17:06:13 +0000
commitca79c816e86ab35ab2edbccce633ffc95437c221 (patch)
tree59f53d952ffc370bf2b008333e07853098c619ac
parente38b967ad745d0d862c0ea8bacc5bc89a19c8272 (diff)
downloademacs-ca79c816e86ab35ab2edbccce633ffc95437c221.tar.gz
emacs-ca79c816e86ab35ab2edbccce633ffc95437c221.zip
(perl-font-lock-syntactic-face-function): Properly handle the case where the
`m' or `s' command's argument is not yet terminated.
-rw-r--r--lisp/progmodes/perl-mode.el52
1 files changed, 28 insertions, 24 deletions
diff --git a/lisp/progmodes/perl-mode.el b/lisp/progmodes/perl-mode.el
index 2bd30da0bfd..3832a65c75c 100644
--- a/lisp/progmodes/perl-mode.el
+++ b/lisp/progmodes/perl-mode.el
@@ -330,30 +330,34 @@ The expansion is entirely correct because it uses the C preprocessor."
330 nil nil state 'syntax-table))) 330 nil nil state 'syntax-table)))
331 ;; The open/close chars are matched like () [] {} and <>. 331 ;; The open/close chars are matched like () [] {} and <>.
332 (let ((parse-sexp-lookup-properties nil)) 332 (let ((parse-sexp-lookup-properties nil))
333 (ignore-errors 333 (condition-case err
334 (with-syntax-table st 334 (progn
335 (goto-char (nth 8 state)) (forward-sexp 1)) 335 (with-syntax-table st
336 (when twoargs 336 (goto-char (nth 8 state)) (forward-sexp 1))
337 (save-excursion 337 (when twoargs
338 ;; Skip whitespace and make sure that font-lock will 338 (save-excursion
339 ;; refontify the second part in the proper context. 339 ;; Skip whitespace and make sure that font-lock will
340 (put-text-property 340 ;; refontify the second part in the proper context.
341 (point) (progn (forward-comment (point-max)) (point)) 341 (put-text-property
342 'font-lock-multiline t) 342 (point) (progn (forward-comment (point-max)) (point))
343 ;; 343 'font-lock-multiline t)
344 (unless 344 ;;
345 (save-excursion 345 (unless
346 (let* ((char2 (char-after)) 346 (save-excursion
347 (st2 (perl-quote-syntax-table char2))) 347 (with-syntax-table
348 (with-syntax-table st2 (forward-sexp 1)) 348 (perl-quote-syntax-table (char-after))
349 (put-text-property pos (line-end-position) 349 (forward-sexp 1))
350 'jit-lock-defer-multiline t) 350 (put-text-property pos (line-end-position)
351 (looking-at "\\s-*\\sw*e"))) 351 'jit-lock-defer-multiline t)
352 (put-text-property (point) (1+ (point)) 352 (looking-at "\\s-*\\sw*e"))
353 'syntax-table 353 (put-text-property (point) (1+ (point))
354 (if (assoc (char-after) 354 'syntax-table
355 perl-quote-like-pairs) 355 (if (assoc (char-after)
356 '(15) '(7))))))))) 356 perl-quote-like-pairs)
357 '(15) '(7)))))))
358 ;; The arg(s) is not terminated, so it extends until EOB.
359 (scan-error (goto-char (point-max))))))
360 ;; Point is now right after the arg(s).
357 ;; Erase any syntactic marks within the quoted text. 361 ;; Erase any syntactic marks within the quoted text.
358 (put-text-property pos (1- (point)) 'syntax-table nil) 362 (put-text-property pos (1- (point)) 'syntax-table nil)
359 (when (eq (char-before (1- (point))) ?$) 363 (when (eq (char-before (1- (point))) ?$)