Mercurial > emacs
comparison lisp/progmodes/cperl-mode.el @ 91005:424b655804ca
Merge from emacs--devo--0
Patches applied:
* emacs--devo--0 (patch 846-851)
- Update from CVS
- Merge from emacs--rel--22
* emacs--rel--22 (patch 88-92)
- Update from CVS
- Merge from gnus--rel--5.10
* gnus--rel--5.10 (patch 242-244)
- Update from CVS
Revision: emacs@sv.gnu.org/emacs--unicode--0--patch-246
author | Miles Bader <miles@gnu.org> |
---|---|
date | Mon, 13 Aug 2007 13:48:35 +0000 |
parents | f55f9811f5d7 419c5c316b51 |
children | aaccdab0ee26 |
comparison
equal
deleted
inserted
replaced
91004:f72cf5b2ab11 | 91005:424b655804ca |
---|---|
1495 ;; Fix for msb.el | 1495 ;; Fix for msb.el |
1496 (defvar cperl-msb-fixed nil) | 1496 (defvar cperl-msb-fixed nil) |
1497 (defvar cperl-use-major-mode 'cperl-mode) | 1497 (defvar cperl-use-major-mode 'cperl-mode) |
1498 (defvar cperl-font-lock-multiline-start nil) | 1498 (defvar cperl-font-lock-multiline-start nil) |
1499 (defvar cperl-font-lock-multiline nil) | 1499 (defvar cperl-font-lock-multiline nil) |
1500 (defvar cperl-compilation-error-regexp-alist nil) | |
1501 (defvar cperl-font-locking nil) | 1500 (defvar cperl-font-locking nil) |
1501 | |
1502 ;; NB as it stands the code in cperl-mode assumes this only has one | |
1503 ;; element. If Xemacs 19 support were dropped, this could all be simplified. | |
1504 (defvar cperl-compilation-error-regexp-alist | |
1505 ;; This look like a paranoiac regexp: could anybody find a better one? (which WORKS). | |
1506 '(("^[^\n]* \\(file\\|at\\) \\([^ \t\n]+\\) [^\n]*line \\([0-9]+\\)[\\., \n]" | |
1507 2 3)) | |
1508 "Alist that specifies how to match errors in perl output.") | |
1502 | 1509 |
1503 ;;;###autoload | 1510 ;;;###autoload |
1504 (defun cperl-mode () | 1511 (defun cperl-mode () |
1505 "Major mode for editing Perl code. | 1512 "Major mode for editing Perl code. |
1506 Expression and list commands understand all C brackets. | 1513 Expression and list commands understand all C brackets. |
1784 (` ((SCCS (, (car cperl-vc-sccs-header))) | 1791 (` ((SCCS (, (car cperl-vc-sccs-header))) |
1785 (RCS (, (car cperl-vc-rcs-header))))))) | 1792 (RCS (, (car cperl-vc-rcs-header))))))) |
1786 (cond ((boundp 'compilation-error-regexp-alist-alist);; xemacs 20.x | 1793 (cond ((boundp 'compilation-error-regexp-alist-alist);; xemacs 20.x |
1787 (make-local-variable 'compilation-error-regexp-alist-alist) | 1794 (make-local-variable 'compilation-error-regexp-alist-alist) |
1788 (set 'compilation-error-regexp-alist-alist | 1795 (set 'compilation-error-regexp-alist-alist |
1789 (cons (cons 'cperl cperl-compilation-error-regexp-alist) | 1796 (cons (cons 'cperl (car cperl-compilation-error-regexp-alist)) |
1790 (symbol-value 'compilation-error-regexp-alist-alist))) | 1797 (symbol-value 'compilation-error-regexp-alist-alist))) |
1791 (if (fboundp 'compilation-build-compilation-error-regexp-alist) | 1798 (if (fboundp 'compilation-build-compilation-error-regexp-alist) |
1792 (let ((f 'compilation-build-compilation-error-regexp-alist)) | 1799 (let ((f 'compilation-build-compilation-error-regexp-alist)) |
1793 (funcall f)) | 1800 (funcall f)) |
1794 (make-local-variable 'compilation-error-regexp-alist) | 1801 (make-local-variable 'compilation-error-regexp-alist) |
3549 (if set-st | 3556 (if set-st |
3550 (progn | 3557 (progn |
3551 (modify-syntax-entry starter (if (eq starter ?\\) "\\" ".") st) | 3558 (modify-syntax-entry starter (if (eq starter ?\\) "\\" ".") st) |
3552 (if ender (modify-syntax-entry ender "." st)))) | 3559 (if ender (modify-syntax-entry ender "." st)))) |
3553 ;; i: have 2 args, after end of the first arg | 3560 ;; i: have 2 args, after end of the first arg |
3554 ;; i2: start of the second arg, if any (before delim iff `ender'). | 3561 ;; i2: start of the second arg, if any (before delim if `ender'). |
3555 ;; ender: the last arg bounded by parens-like chars, the second one of them | 3562 ;; ender: the last arg bounded by parens-like chars, the second one of them |
3556 ;; starter: the starting delimiter of the first arg | 3563 ;; starter: the starting delimiter of the first arg |
3557 ;; go-forward: has 2 args, and the second part is empty | 3564 ;; go-forward: has 2 args, and the second part is empty |
3558 (list i i2 ender starter go-forward))) | 3565 (list i i2 ender starter go-forward))) |
3559 | 3566 |
5700 ((match-beginning 16) | 5707 ((match-beginning 16) |
5701 (- (char-after (match-beginning 16)) ?0)) ; headN ==> N | 5708 (- (char-after (match-beginning 16)) ?0)) ; headN ==> N |
5702 (t 5))) ; should not happen | 5709 (t 5))) ; should not happen |
5703 | 5710 |
5704 | 5711 |
5705 (defvar cperl-compilation-error-regexp-alist | |
5706 ;; This look like a paranoiac regexp: could anybody find a better one? (which WORKS). | |
5707 '(("^[^\n]* \\(file\\|at\\) \\([^ \t\n]+\\) [^\n]*line \\([0-9]+\\)[\\., \n]" | |
5708 2 3)) | |
5709 "Alist that specifies how to match errors in perl output.") | |
5710 | |
5711 | |
5712 (defun cperl-windowed-init () | 5712 (defun cperl-windowed-init () |
5713 "Initialization under windowed version." | 5713 "Initialization under windowed version." |
5714 (cond ((featurep 'ps-print) | 5714 (cond ((featurep 'ps-print) |
5715 (unless cperl-faces-init | 5715 (unless cperl-faces-init |
5716 (if (boundp 'font-lock-multiline) | 5716 (if (boundp 'font-lock-multiline) |
8088 (setq buffer-read-only t))))) | 8088 (setq buffer-read-only t))))) |
8089 | 8089 |
8090 (defun cperl-beautify-regexp-piece (b e embed level) | 8090 (defun cperl-beautify-regexp-piece (b e embed level) |
8091 ;; b is before the starting delimiter, e before the ending | 8091 ;; b is before the starting delimiter, e before the ending |
8092 ;; e should be a marker, may be changed, but remains "correct". | 8092 ;; e should be a marker, may be changed, but remains "correct". |
8093 ;; EMBED is nil iff we process the whole REx. | 8093 ;; EMBED is nil if we process the whole REx. |
8094 ;; The REx is guaranteed to have //x | 8094 ;; The REx is guaranteed to have //x |
8095 ;; LEVEL shows how many levels deep to go | 8095 ;; LEVEL shows how many levels deep to go |
8096 ;; position at enter and at leave is not defined | 8096 ;; position at enter and at leave is not defined |
8097 (let (s c tmp (m (make-marker)) (m1 (make-marker)) c1 spaces inline code pos) | 8097 (let (s c tmp (m (make-marker)) (m1 (make-marker)) c1 spaces inline code pos) |
8098 (if (not embed) | 8098 (if (not embed) |