Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!uunet!ksr!bill From: bill@ksr.com (Bill Mann) Newsgroups: comp.lang.perl Subject: Re: perl-mode.el Message-ID: <2307@ksr.com> Date: 23 Feb 91 21:09:58 GMT References: <1991Feb23.042100.29594@uvaarpa.Virginia.EDU> Sender: news@ksr.com Organization: Kendall Square Research Corp. Lines: 80 I submitted perl-mode.el to the FSF in the form they requested at least 6 months ago, but it was not included in the latest release (18.57). Perhaps it will make release 19. I second Ted's comments about distributing all four emacs-related files with the perl distribution. Ted's version is the original version I posted March 20, 1990. (I may have sent out revised versions since.) Anyway, to bring everyone up-to-date, here is an 'official' patch to the version he just distributed. *** perl-mode.el.ted Sat Feb 23 15:32:54 1991 --- perl-mode.el Sat Feb 23 15:37:41 1991 *************** *** 578,603 **** "Indent each line of the Perl grouping following point." (interactive) (let* ((case-fold-search nil) - (bof (save-excursion (end-of-line 2) (perl-beginning-of-function))) (oldpnt (point-marker)) ! eol last-point lsexp delta) ! (if (= (char-after bof) ?=) (message "Can't indent a format statement") (message "Indenting Perl expression...") (save-excursion (end-of-line) (setq eol (point))) ! (save-excursion (while (and (not (eobp)) (<= (point) eol)) (parse-partial-sexp (point) (point-max) 0)) ! (setq last-point (point-marker))) ! (setq lsexp bof) (beginning-of-line) ! (while (< (point) (marker-position last-point)) ! (setq delta (perl-indent-line nil bof)) (if (numberp delta) ; unquoted start-of-line? ! (setq lsexp (point))) ! (end-of-line) (setq eol (point)) ! (if (nth 4 (parse-partial-sexp lsexp eol)) (progn ; line ends in a comment (beginning-of-line) (if (or (not (looking-at "\\s-*;?#")) --- 526,557 ---- "Indent each line of the Perl grouping following point." (interactive) (let* ((case-fold-search nil) (oldpnt (point-marker)) ! (bof-mark (save-excursion ! (end-of-line 2) ! (perl-beginning-of-function) ! (point-marker))) ! eol last-mark lsexp-mark delta) ! (if (= (char-after (marker-position bof-mark)) ?=) (message "Can't indent a format statement") (message "Indenting Perl expression...") (save-excursion (end-of-line) (setq eol (point))) ! (save-excursion ; locate matching close paren (while (and (not (eobp)) (<= (point) eol)) (parse-partial-sexp (point) (point-max) 0)) ! (setq last-mark (point-marker))) ! (setq lsexp-mark bof-mark) (beginning-of-line) ! (while (< (point) (marker-position last-mark)) ! (setq delta (perl-indent-line nil (marker-position bof-mark))) (if (numberp delta) ; unquoted start-of-line? ! (progn ! (if (eolp) ! (delete-horizontal-space)) ! (setq lsexp-mark (point-marker)))) ! (end-of-line) (setq eol (point)) ! (if (nth 4 (parse-partial-sexp (marker-position lsexp-mark) eol)) (progn ; line ends in a comment (beginning-of-line) (if (or (not (looking-at "\\s-*;?#")) Bill Mann bill@ksr.com (ksr!bill@uunet.uu.net) -- Bill Mann bill@ksr.com (ksr!bill@uunet.uu.net)