Xref: utzoo comp.emacs:4404 gnu.emacs:70 Path: utzoo!utgpu!water!watmath!uunet!tektronix!sequent!mntgfx!mosurm From: mosurm@mntgfx.mentor.com (Mosur Mohan) Newsgroups: comp.emacs,gnu.emacs Subject: Re: Wanted: Pascal Minor mode for Gnu Emacs Summary: I have a Pascal mode with a different emphasis Message-ID: <1988Oct11.110614.1154@mntgfx.mentor.com> Date: 11 Oct 88 18:06:12 GMT References: <23772@tut.cis.ohio-state.edu> Distribution: comp Organization: Mentor Graphics Corporation, Beaverton Oregon Lines: 65 In article <23772@tut.cis.ohio-state.edu>, bob@banjo.cis.ohio-state.edu (Bob Sutterfield) writes: > In article lazlor@ucscb.UCSC.EDU > (Allen) writes: > >I am looking for a Pascal Minor mode for Gnu Emacs. > "This is a mode intended to support program development in Pascal. > Most control constructs of Pascal can be created by typing > Control-C followed by the first character of the construct. > > C-c p program C-c b begin-end > C-c C-c const C-c c case-do > C-c C-t type C-c t toggle between .p-.h > C-c C-v var C-c { enter matched braces > C-c C-r record C-c r repeat-until > C-c C-w with-do C-c w while-do > C-c C-i #include C-c i if-then > C-c C-p procedure C-c e else > C-c C-f function C-c f for-do > Well, I had looked at the Modula mode (which looks very similar to this Pascal mode), and then hacked up my own version of Pascal mode with an emphasis on indentation and scanning begin-end blocks rather than on producing templates for the various Pascal structured statements (which to me seemed rather less useful). Here's the describe-mode output on my pas-mode; if folks are interested, I can post my version (although it ain't quite as well finished as I might have hoped for the purposes of distribution). (I had mailed it out once to someone who had requested it, but got no response nor ack.) ====================================================================== Pascal Mode: Mode to support program development in Pascal. The prefix-key for pas-mode is Ctrl-C. TAB pas-indent-line | Ctrl-c TAB pas-tab-to-tab-col Ctrl-j pas-newline | Ctrl-c b pas-begin Ctrl-c Ctrl-f forward-block | Ctrl-c Ctrl-b backward-block Ctrl-c Ctrl-d down-block | Ctrl-c Ctrl-u back-up-block Ctrl-c Ctrl-e up-block | Ctrl-c Ctrl-@ mark-block Ctrl-c Ctrl-n narrow-to-block | Ctrl-c ~ self-assign-stmt Ctrl-c Ctrl-[ open-comment-box | Ctrl-c Ctrl-m continue-comment-box Ctrl-c } pas-end-comment | Ctrl-c > set-end-comment-column Variables: pas-indent controls the number of spaces for each indentation pas-tab-col controls the column to tab to using \C-c end-comment-column controls the column on which comments will be closed ============================================================================== Notes: * the "blocks" referred to are begin-end, case-end, record-end and repeat-until blocks; block-functions mirror lisp-mode functions * the self-assign-stmt is a simple hack to get the oft-used "x := x + 1" without having to retype the " := x " part of it; real useful when x is a long identifier or sequence of pointer-references. * pas-newline and pas-indent-line compute the correct indentation by referring to the indentation of the enclosing block. Enjoy! -- Mohan. {Mosur Mohan, Mentor Graphics, Beaverton, OR} {uunet!mntgfx!mosurm} "Do not meddle in the affairs of wizards, for they are subtle, and quick to anger." -- Gildor Inglorion in _The Fellowship of the Ring_