diff options
| author | Stefan Monnier | 2001-05-04 20:16:56 +0000 |
|---|---|---|
| committer | Stefan Monnier | 2001-05-04 20:16:56 +0000 |
| commit | 5efe6a5673aeff53203ac65b7131b47f5859345b (patch) | |
| tree | 1e540ea4fe311af1191fe07fb62c1a29ea72b9a7 | |
| parent | 7dfb000f42294f329cf85be99b9420f68ab0f6d9 (diff) | |
| download | emacs-5efe6a5673aeff53203ac65b7131b47f5859345b.tar.gz emacs-5efe6a5673aeff53203ac65b7131b47f5859345b.zip | |
(cperl-font-lock-keywords)
(cperl-font-lock-keywords-1, cperl-font-lock-keywords-2):
Renamed from perl-font-lock-keywords to avoid clashes.
(cperl-mode, cperl-load-font-lock-keywords, cperl-init-faces)
(cperl-load-font-lock-keywords-1, cperl-load-font-lock-keywords-2):
Updated correspondingly.
| -rw-r--r-- | lisp/ChangeLog | 7 | ||||
| -rw-r--r-- | lisp/progmodes/cperl-mode.el | 103 |
2 files changed, 61 insertions, 49 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index dae87dbd851..2c6b82876e0 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,5 +1,12 @@ | |||
| 1 | 2001-05-04 Stefan Monnier <monnier@cs.yale.edu> | 1 | 2001-05-04 Stefan Monnier <monnier@cs.yale.edu> |
| 2 | 2 | ||
| 3 | * progmodes/cperl-mode.el (cperl-font-lock-keywords) | ||
| 4 | (cperl-font-lock-keywords-1, cperl-font-lock-keywords-2): | ||
| 5 | Renamed from perl-font-lock-keywords to avoid clashes. | ||
| 6 | (cperl-mode, cperl-load-font-lock-keywords, cperl-init-faces) | ||
| 7 | (cperl-load-font-lock-keywords-1, cperl-load-font-lock-keywords-2): | ||
| 8 | Updated correspondingly. | ||
| 9 | |||
| 3 | * diff-mode.el (diff-nonexistent-face, diff-font-lock-keywords): | 10 | * diff-mode.el (diff-nonexistent-face, diff-font-lock-keywords): |
| 4 | Typo `nonexistant' -> `nonexistent'. | 11 | Typo `nonexistant' -> `nonexistent'. |
| 5 | 12 | ||
diff --git a/lisp/progmodes/cperl-mode.el b/lisp/progmodes/cperl-mode.el index 5b5400a81ce..395d3011c42 100644 --- a/lisp/progmodes/cperl-mode.el +++ b/lisp/progmodes/cperl-mode.el | |||
| @@ -590,7 +590,12 @@ later you should use choose-color.el *instead* of font-lock-extra.el | |||
| 590 | Note that to enable Compile choices in the menu you need to install | 590 | Note that to enable Compile choices in the menu you need to install |
| 591 | mode-compile.el. | 591 | mode-compile.el. |
| 592 | 592 | ||
| 593 | Get perl5-info from | 593 | If your Emacs does not default to `cperl-mode' on Perl files, and you |
| 594 | want it to: put the following into your .emacs file: | ||
| 595 | |||
| 596 | (defalias 'perl-mode 'cperl-mode) | ||
| 597 | |||
| 598 | Get perl5-info from | ||
| 594 | $CPAN/doc/manual/info/perl-info.tar.gz | 599 | $CPAN/doc/manual/info/perl-info.tar.gz |
| 595 | older version was on | 600 | older version was on |
| 596 | http://www.metronet.com:70/9/perlinfo/perl5/manual/perl5-info.tar.gz | 601 | http://www.metronet.com:70/9/perlinfo/perl5/manual/perl5-info.tar.gz |
| @@ -1480,11 +1485,11 @@ or as help on variables `cperl-tips', `cperl-problems', | |||
| 1480 | (setq font-lock-defaults | 1485 | (setq font-lock-defaults |
| 1481 | (cond | 1486 | (cond |
| 1482 | ((string< emacs-version "19.30") | 1487 | ((string< emacs-version "19.30") |
| 1483 | '(perl-font-lock-keywords-2)) | 1488 | '(cperl-font-lock-keywords-2)) |
| 1484 | ((string< emacs-version "19.33") ; Which one to use? | 1489 | ((string< emacs-version "19.33") ; Which one to use? |
| 1485 | '((perl-font-lock-keywords | 1490 | '((cperl-font-lock-keywords |
| 1486 | perl-font-lock-keywords-1 | 1491 | cperl-font-lock-keywords-1 |
| 1487 | perl-font-lock-keywords-2))) | 1492 | cperl-font-lock-keywords-2))) |
| 1488 | (t | 1493 | (t |
| 1489 | '((cperl-load-font-lock-keywords | 1494 | '((cperl-load-font-lock-keywords |
| 1490 | cperl-load-font-lock-keywords-1 | 1495 | cperl-load-font-lock-keywords-1 |
| @@ -2994,7 +2999,7 @@ Returns true if comment is found." | |||
| 2994 | ;; i2: start of the second arg, if any (before delim iff `ender'). | 2999 | ;; i2: start of the second arg, if any (before delim iff `ender'). |
| 2995 | ;; ender: the last arg bounded by parens-like chars, the second one of them | 3000 | ;; ender: the last arg bounded by parens-like chars, the second one of them |
| 2996 | ;; starter: the starting delimiter of the first arg | 3001 | ;; starter: the starting delimiter of the first arg |
| 2997 | ;; go-forward: has 2 args, and the second part is empth | 3002 | ;; go-forward: has 2 args, and the second part is empty |
| 2998 | (list i i2 ender starter go-forward))) | 3003 | (list i i2 ender starter go-forward))) |
| 2999 | 3004 | ||
| 3000 | (defsubst cperl-postpone-fontification (b e type val &optional now) | 3005 | (defsubst cperl-postpone-fontification (b e type val &optional now) |
| @@ -3188,25 +3193,25 @@ the sections using `cperl-pod-head-face', `cperl-pod-face', | |||
| 3188 | ;; We start 'pod 1 char earlier to include the preceding line | 3193 | ;; We start 'pod 1 char earlier to include the preceding line |
| 3189 | (beginning-of-line) | 3194 | (beginning-of-line) |
| 3190 | (put-text-property (cperl-1- b) (point) 'syntax-type 'pod) | 3195 | (put-text-property (cperl-1- b) (point) 'syntax-type 'pod) |
| 3191 | (cperl-put-do-not-fontify b (point) t) | 3196 | (cperl-put-do-not-fontify b (point) t) |
| 3192 | ;; mark the non-literal parts as PODs | 3197 | ;; mark the non-literal parts as PODs |
| 3193 | (if cperl-pod-here-fontify | 3198 | (if cperl-pod-here-fontify |
| 3194 | (cperl-postpone-fontification b (point) 'face face t)) | 3199 | (cperl-postpone-fontification b (point) 'face face t)) |
| 3195 | (re-search-forward "\n\n[^ \t\f\n]" e 'toend) | 3200 | (re-search-forward "\n\n[^ \t\f\n]" e 'toend) |
| 3196 | (beginning-of-line) | 3201 | (beginning-of-line) |
| 3197 | (setq b (point))) | 3202 | (setq b (point))) |
| 3198 | (put-text-property (cperl-1- (point)) e 'syntax-type 'pod) | 3203 | (put-text-property (cperl-1- (point)) e 'syntax-type 'pod) |
| 3199 | (cperl-put-do-not-fontify (point) e t) | 3204 | (cperl-put-do-not-fontify (point) e t) |
| 3200 | (if cperl-pod-here-fontify | 3205 | (if cperl-pod-here-fontify |
| 3201 | (progn | 3206 | (progn |
| 3202 | ;; mark the non-literal parts as PODs | 3207 | ;; mark the non-literal parts as PODs |
| 3203 | (cperl-postpone-fontification (point) e 'face face t) | 3208 | (cperl-postpone-fontification (point) e 'face face t) |
| 3204 | (goto-char bb) | 3209 | (goto-char bb) |
| 3205 | (if (looking-at | 3210 | (if (looking-at |
| 3206 | "=[a-zA-Z0-9_]+\\>[ \t]*\\(\\(\n?[^\n]\\)+\\)$") | 3211 | "=[a-zA-Z0-9_]+\\>[ \t]*\\(\\(\n?[^\n]\\)+\\)$") |
| 3207 | ;; mark the headers | 3212 | ;; mark the headers |
| 3208 | (cperl-postpone-fontification | 3213 | (cperl-postpone-fontification |
| 3209 | (match-beginning 1) (match-end 1) | 3214 | (match-beginning 1) (match-end 1) |
| 3210 | 'face head-face)) | 3215 | 'face head-face)) |
| 3211 | (while (re-search-forward | 3216 | (while (re-search-forward |
| 3212 | ;; One paragraph | 3217 | ;; One paragraph |
| @@ -3214,8 +3219,8 @@ the sections using `cperl-pod-head-face', `cperl-pod-face', | |||
| 3214 | e 'toend) | 3219 | e 'toend) |
| 3215 | ;; mark the headers | 3220 | ;; mark the headers |
| 3216 | (cperl-postpone-fontification | 3221 | (cperl-postpone-fontification |
| 3217 | (match-beginning 1) (match-end 1) | 3222 | (match-beginning 1) (match-end 1) |
| 3218 | 'face head-face)))) | 3223 | 'face head-face)))) |
| 3219 | (cperl-commentify bb e nil) | 3224 | (cperl-commentify bb e nil) |
| 3220 | (goto-char e) | 3225 | (goto-char e) |
| 3221 | (or (eq e (point-max)) | 3226 | (or (eq e (point-max)) |
| @@ -4307,24 +4312,24 @@ indentation and initial hashes. Behaves usually outside of comment." | |||
| 4307 | "ps-print" | 4312 | "ps-print" |
| 4308 | '(or cperl-faces-init (cperl-init-faces)))))) | 4313 | '(or cperl-faces-init (cperl-init-faces)))))) |
| 4309 | 4314 | ||
| 4310 | (defvar perl-font-lock-keywords-1 nil | 4315 | (defvar cperl-font-lock-keywords-1 nil |
| 4311 | "Additional expressions to highlight in Perl mode. Minimal set.") | 4316 | "Additional expressions to highlight in Perl mode. Minimal set.") |
| 4312 | (defvar perl-font-lock-keywords nil | 4317 | (defvar cperl-font-lock-keywords nil |
| 4313 | "Additional expressions to highlight in Perl mode. Default set.") | 4318 | "Additional expressions to highlight in Perl mode. Default set.") |
| 4314 | (defvar perl-font-lock-keywords-2 nil | 4319 | (defvar cperl-font-lock-keywords-2 nil |
| 4315 | "Additional expressions to highlight in Perl mode. Maximal set") | 4320 | "Additional expressions to highlight in Perl mode. Maximal set") |
| 4316 | 4321 | ||
| 4317 | (defun cperl-load-font-lock-keywords () | 4322 | (defun cperl-load-font-lock-keywords () |
| 4318 | (or cperl-faces-init (cperl-init-faces)) | 4323 | (or cperl-faces-init (cperl-init-faces)) |
| 4319 | perl-font-lock-keywords) | 4324 | cperl-font-lock-keywords) |
| 4320 | 4325 | ||
| 4321 | (defun cperl-load-font-lock-keywords-1 () | 4326 | (defun cperl-load-font-lock-keywords-1 () |
| 4322 | (or cperl-faces-init (cperl-init-faces)) | 4327 | (or cperl-faces-init (cperl-init-faces)) |
| 4323 | perl-font-lock-keywords-1) | 4328 | cperl-font-lock-keywords-1) |
| 4324 | 4329 | ||
| 4325 | (defun cperl-load-font-lock-keywords-2 () | 4330 | (defun cperl-load-font-lock-keywords-2 () |
| 4326 | (or cperl-faces-init (cperl-init-faces)) | 4331 | (or cperl-faces-init (cperl-init-faces)) |
| 4327 | perl-font-lock-keywords-2) | 4332 | cperl-font-lock-keywords-2) |
| 4328 | 4333 | ||
| 4329 | (defun cperl-init-faces-weak () | 4334 | (defun cperl-init-faces-weak () |
| 4330 | ;; Allow `cperl-find-pods-heres' to run. | 4335 | ;; Allow `cperl-find-pods-heres' to run. |
| @@ -4529,15 +4534,15 @@ indentation and initial hashes. Behaves usually outside of comment." | |||
| 4529 | ;; (if (cperl-slash-is-regexp) | 4534 | ;; (if (cperl-slash-is-regexp) |
| 4530 | ;; font-lock-function-name-face 'default) nil t)) | 4535 | ;; font-lock-function-name-face 'default) nil t)) |
| 4531 | ))) | 4536 | ))) |
| 4532 | (setq perl-font-lock-keywords-1 | 4537 | (setq cperl-font-lock-keywords-1 |
| 4533 | (if cperl-syntaxify-by-font-lock | 4538 | (if cperl-syntaxify-by-font-lock |
| 4534 | (cons 'cperl-fontify-update | 4539 | (cons 'cperl-fontify-update |
| 4535 | t-font-lock-keywords) | 4540 | t-font-lock-keywords) |
| 4536 | t-font-lock-keywords) | 4541 | t-font-lock-keywords) |
| 4537 | perl-font-lock-keywords perl-font-lock-keywords-1 | 4542 | cperl-font-lock-keywords cperl-font-lock-keywords-1 |
| 4538 | perl-font-lock-keywords-2 (append | 4543 | cperl-font-lock-keywords-2 (append |
| 4539 | perl-font-lock-keywords-1 | 4544 | cperl-font-lock-keywords-1 |
| 4540 | t-font-lock-keywords-1))) | 4545 | t-font-lock-keywords-1))) |
| 4541 | (if (fboundp 'ps-print-buffer) (cperl-ps-print-init)) | 4546 | (if (fboundp 'ps-print-buffer) (cperl-ps-print-init)) |
| 4542 | (if (or (featurep 'choose-color) (featurep 'font-lock-extra)) | 4547 | (if (or (featurep 'choose-color) (featurep 'font-lock-extra)) |
| 4543 | (eval ; Avoid a warning | 4548 | (eval ; Avoid a warning |
| @@ -6622,14 +6627,14 @@ We suppose that the regexp is scanned already." | |||
| 6622 | (cond | 6627 | (cond |
| 6623 | ((match-beginning 1) ; #-comment | 6628 | ((match-beginning 1) ; #-comment |
| 6624 | (or c (setq c (current-indentation))) | 6629 | (or c (setq c (current-indentation))) |
| 6625 | (beginning-of-line 2) ; Skip | 6630 | (beginning-of-line 2) ; Skip |
| 6626 | (setq s (point)) | 6631 | (setq s (point)) |
| 6627 | (skip-chars-forward " \t") | 6632 | (skip-chars-forward " \t") |
| 6628 | (delete-region s (point)) | 6633 | (delete-region s (point)) |
| 6629 | (indent-to-column c)) | 6634 | (indent-to-column c)) |
| 6630 | (t | 6635 | (t |
| 6631 | (delete-char -1) | 6636 | (delete-char -1) |
| 6632 | (just-one-space)))))) | 6637 | (just-one-space)))))) |
| 6633 | 6638 | ||
| 6634 | (defun cperl-contract-levels () | 6639 | (defun cperl-contract-levels () |
| 6635 | "Find an enclosing group in regexp and contract all the kids. | 6640 | "Find an enclosing group in regexp and contract all the kids. |
| @@ -6639,13 +6644,13 @@ We suppose that the regexp is scanned already." | |||
| 6639 | (condition-case nil | 6644 | (condition-case nil |
| 6640 | (cperl-regext-to-level-start) | 6645 | (cperl-regext-to-level-start) |
| 6641 | (error ; We are outside outermost group | 6646 | (error ; We are outside outermost group |
| 6642 | (goto-char (cperl-make-regexp-x)))) | 6647 | (goto-char (cperl-make-regexp-x)))) |
| 6643 | (let ((b (point)) (e (make-marker)) s c) | 6648 | (let ((b (point)) (e (make-marker)) s c) |
| 6644 | (forward-sexp 1) | 6649 | (forward-sexp 1) |
| 6645 | (set-marker e (1- (point))) | 6650 | (set-marker e (1- (point))) |
| 6646 | (goto-char (1+ b)) | 6651 | (goto-char (1+ b)) |
| 6647 | (while (re-search-forward "\\(\\\\\\\\\\)\\|(" e t) | 6652 | (while (re-search-forward "\\(\\\\\\\\\\)\\|(" e t) |
| 6648 | (cond | 6653 | (cond |
| 6649 | ((match-beginning 1) ; Skip | 6654 | ((match-beginning 1) ; Skip |
| 6650 | nil) | 6655 | nil) |
| 6651 | (t ; Group | 6656 | (t ; Group |