diff options
| author | Richard M. Stallman | 1996-10-26 18:14:31 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1996-10-26 18:14:31 +0000 |
| commit | 5b1bdb5f749369e487f668cbf4872632e5d44c60 (patch) | |
| tree | 335ac43585607a711a572910bdf98c9062143e8a | |
| parent | 0a6231f5fcbe2915a0458dade891c71c249dd016 (diff) | |
| download | emacs-5b1bdb5f749369e487f668cbf4872632e5d44c60.tar.gz emacs-5b1bdb5f749369e487f668cbf4872632e5d44c60.zip | |
(electric-perl-terminator, perl-indent-command):
(perl-backward-to-noncomment, indent-perl-exp): Avoid error if
comment-start-skip is nil.
| -rw-r--r-- | lisp/progmodes/perl-mode.el | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/lisp/progmodes/perl-mode.el b/lisp/progmodes/perl-mode.el index e800b86058a..ed4eb1e369c 100644 --- a/lisp/progmodes/perl-mode.el +++ b/lisp/progmodes/perl-mode.el | |||
| @@ -357,7 +357,8 @@ If at end-of-line, and not in a comment or a quote, correct the's indentation." | |||
| 357 | (save-excursion | 357 | (save-excursion |
| 358 | (beginning-of-line) | 358 | (beginning-of-line) |
| 359 | (and (not ; eliminate comments quickly | 359 | (and (not ; eliminate comments quickly |
| 360 | (re-search-forward comment-start-skip insertpos t)) | 360 | (and comment-start-skip |
| 361 | (re-search-forward comment-start-skip insertpos t)) ) | ||
| 361 | (or (/= last-command-char ?:) | 362 | (or (/= last-command-char ?:) |
| 362 | ;; Colon is special only after a label .... | 363 | ;; Colon is special only after a label .... |
| 363 | (looking-at "\\s-*\\(\\w\\|\\s_\\)+$")) | 364 | (looking-at "\\s-*\\(\\w\\|\\s_\\)+$")) |
| @@ -432,7 +433,8 @@ possible action from the following list: | |||
| 432 | (if (= oldpnt eol) ; no comment, create one? | 433 | (if (= oldpnt eol) ; no comment, create one? |
| 433 | (indent-for-comment)) | 434 | (indent-for-comment)) |
| 434 | (beginning-of-line) | 435 | (beginning-of-line) |
| 435 | (if (re-search-forward comment-start-skip eol 'move) | 436 | (if (and comment-start-skip |
| 437 | (re-search-forward comment-start-skip eol 'move)) | ||
| 436 | (if (eolp) | 438 | (if (eolp) |
| 437 | (progn ; kill existing comment | 439 | (progn ; kill existing comment |
| 438 | (goto-char (match-beginning 0)) | 440 | (goto-char (match-beginning 0)) |
| @@ -600,7 +602,8 @@ Returns (parse-state) if line starts inside a string." | |||
| 600 | (while (not stop) | 602 | (while (not stop) |
| 601 | (setq opoint (point)) | 603 | (setq opoint (point)) |
| 602 | (beginning-of-line) | 604 | (beginning-of-line) |
| 603 | (if (re-search-forward comment-start-skip opoint 'move 1) | 605 | (if (and comment-start-skip |
| 606 | (re-search-forward comment-start-skip opoint 'move 1)) | ||
| 604 | (progn (goto-char (match-end 1)) | 607 | (progn (goto-char (match-end 1)) |
| 605 | (skip-chars-forward ";"))) | 608 | (skip-chars-forward ";"))) |
| 606 | (skip-chars-backward " \t\f") | 609 | (skip-chars-backward " \t\f") |
| @@ -653,7 +656,8 @@ Returns (parse-state) if line starts inside a string." | |||
| 653 | (listp delta) | 656 | (listp delta) |
| 654 | (and (/= 0 delta) | 657 | (and (/= 0 delta) |
| 655 | (= (- (current-indentation) delta) comment-column))) | 658 | (= (- (current-indentation) delta) comment-column))) |
| 656 | (if (re-search-forward comment-start-skip eol t) | 659 | (if (and comment-start-skip |
| 660 | (re-search-forward comment-start-skip eol t)) | ||
| 657 | (indent-for-comment))))) ; indent existing comment | 661 | (indent-for-comment))))) ; indent existing comment |
| 658 | (forward-line 1)) | 662 | (forward-line 1)) |
| 659 | (goto-char (marker-position oldpnt)) | 663 | (goto-char (marker-position oldpnt)) |