# HG changeset patch # User Richard M. Stallman # Date 846353671 0 # Node ID dbfab9e8b6d8d1ec796f4d141d804df0f85569e7 # Parent 51916440738f89a03576cbb0c428fc54bbd3c25c (electric-perl-terminator, perl-indent-command): (perl-backward-to-noncomment, indent-perl-exp): Avoid error if comment-start-skip is nil. diff -r 51916440738f -r dbfab9e8b6d8 lisp/progmodes/perl-mode.el --- a/lisp/progmodes/perl-mode.el Sat Oct 26 18:13:52 1996 +0000 +++ b/lisp/progmodes/perl-mode.el Sat Oct 26 18:14:31 1996 +0000 @@ -357,7 +357,8 @@ (save-excursion (beginning-of-line) (and (not ; eliminate comments quickly - (re-search-forward comment-start-skip insertpos t)) + (and comment-start-skip + (re-search-forward comment-start-skip insertpos t)) ) (or (/= last-command-char ?:) ;; Colon is special only after a label .... (looking-at "\\s-*\\(\\w\\|\\s_\\)+$")) @@ -432,7 +433,8 @@ (if (= oldpnt eol) ; no comment, create one? (indent-for-comment)) (beginning-of-line) - (if (re-search-forward comment-start-skip eol 'move) + (if (and comment-start-skip + (re-search-forward comment-start-skip eol 'move)) (if (eolp) (progn ; kill existing comment (goto-char (match-beginning 0)) @@ -600,7 +602,8 @@ (while (not stop) (setq opoint (point)) (beginning-of-line) - (if (re-search-forward comment-start-skip opoint 'move 1) + (if (and comment-start-skip + (re-search-forward comment-start-skip opoint 'move 1)) (progn (goto-char (match-end 1)) (skip-chars-forward ";"))) (skip-chars-backward " \t\f") @@ -653,7 +656,8 @@ (listp delta) (and (/= 0 delta) (= (- (current-indentation) delta) comment-column))) - (if (re-search-forward comment-start-skip eol t) + (if (and comment-start-skip + (re-search-forward comment-start-skip eol t)) (indent-for-comment))))) ; indent existing comment (forward-line 1)) (goto-char (marker-position oldpnt))