Path: utzoo!dciem!nrcaer!sce!cognos!jimp From: jimp@cognos.uucp (Jim Patterson) Newsgroups: comp.editors Subject: Re: Editor extensibility Message-ID: <4694@aldebaran.UUCP> Date: 28 Nov 88 16:16:24 GMT Article-I.D.: aldebara.4694 References: <4100@enea.se> Reply-To: jimp@cognos.UUCP (Jim Patterson) Organization: Cognos Inc., Ottawa, Canada Lines: 32 In article <4100@enea.se> sommar@enea.se (Erland Sommarskog) writes: >And for built-in assumptions here's another of my pet peeves. (And >in this case Emacs and TPU are equally bad.) If I do an case-insentive >search I want the pairs ]} [{ \| to be equivalent just as Aa Bb etc. >Simply because they are letters on my screen. (Mayne I should be too >hard on Emacs here. There may be a funtion that I've missed.) GNU Emacs supports essentially this ability via its syntax table. The syntax table allows the printable characters to be classified on a mode-specific basis into such categories as symbol characters, escape characters and string-quote characters. Because it's mode specific, the syntax table when programming C programs, for example, doesn't need to be the same as that for FORTRAN. The category that describes various sorts of parenthesis is the delimiter class; an open-parenthesis is described as an opening delimiter and a close-parenthesis as a closing delimiter. These categories are accessible from the regular-expression pattern matcher using the \sx sequence where 'x' defines the category. For example, \s(\sw+\s) would match any opening delimiter ('\s(') followed by one or word-constituent characters ('\sw+') followed by a closing delimiter ('\s)'). To do what you want, you simply need to define '[' and '{' as opening delimiters, and ']' and '}' as closing delimiters. (They are already in most modes). You can then use '\s(' to match either [ or { and '\s)' for ] or }. -- Jim Patterson Cognos Incorporated UUCP:decvax!utzoo!dciem!nrcaer!cognos!jimp P.O. BOX 9707 PHONE:(613)738-1440 3755 Riverside Drive Ottawa, Ont K1G 3Z4