Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sdd.hp.com!spool.mu.edu!uunet!mcsun!hp4nl!alchemy!piet From: piet@cs.ruu.nl (Piet van Oostrum) Newsgroups: comp.lang.perl Subject: Re: perl-mode in gemacs: "In format statement" Message-ID: <1991Mar01.085229.5858@cs.ruu.nl> Date: 1 Mar 91 08:52:29 GMT References: <16955@venera.isi.edu> Sender: piet@cs.ruu.nl (Piet van Oostrum) Reply-To: piet@cs.ruu.nl (Piet van Oostrum) Distribution: comp Organization: Dept of Computer Science, Utrecht University, The Netherlands Lines: 57 In-Reply-To: jas@ISI.EDU (Jeff Sullivan) This is the reply I got when I complained about this. It solves the problem: From: bill@ksr.com (Bill Mann) To: piet@cs.ruu.nl Subject: Re: perl-mode.el Date: Sun, 24 Feb 91 18:55:37 EST In article <4920@ruuinf.cs.ruu.nl> you write: >I have been using this perl-mode.el for a time, and occasionally I couldn't >get the indentation right. This happens if you have statements after a >format statement. perl-mode thinks that it is in a format statement and >refuses to indent the code, e.g. > >format stdout = >This is a format statement >. > >if ($x==1) { >-- >Piet* van Oostrum, Dept of Computer Science, Utrecht University, >Padualaan 14, P.O. Box 80.089, 3508 TB Utrecht, The Netherlands. >Telephone: +31 30 531806 Uucp: uunet!mcsun!ruuinf!piet >Telefax: +31 30 513791 Internet: piet@cs.ruu.nl (*`Pete') Thanks for your report. I rarely use formats, so I'd like you to evaluate the enclosed patch, and let me know whether it solves your problem. FYI, I treat formats almost like subroutines. *** 1.3 1991/02/23 20:44:38 --- perl-mode.el 1991/02/24 23:39:49 *************** *** 572,578 **** (or arg (setq arg 1)) (if (< arg 0) (forward-char 1)) (and (/= arg 0) ! (re-search-backward "^\\s(\\|^\\s-*sub\\b[^{]+{\\|^\\s-*format\\b[^=]*=" nil 'move arg) (goto-char (1- (match-end 0)))) (point)) --- 572,578 ---- (or arg (setq arg 1)) (if (< arg 0) (forward-char 1)) (and (/= arg 0) ! (re-search-backward "^\\s(\\|^\\s-*sub\\b[^{]+{\\|^\\s-*format\\b[^=]*=\\|^\\." nil 'move arg) (goto-char (1- (match-end 0)))) (point)) -bill -- Piet* van Oostrum, Dept of Computer Science, Utrecht University, Padualaan 14, P.O. Box 80.089, 3508 TB Utrecht, The Netherlands. Telephone: +31 30 531806 Uucp: uunet!mcsun!ruuinf!piet Telefax: +31 30 513791 Internet: piet@cs.ruu.nl (*`Pete')