cvs.gedasymbols.org/archives/browse.cgi   search  
Mail Archives: djgpp/1997/10/31/03:46:45

From: ao950 AT FreeNet DOT Carleton DOT CA (Paul Derbyshire)
Newsgroups: comp.os.msdos.djgpp
Subject: Re: EMACS problem
Date: 31 Oct 1997 06:38:45 GMT
Organization: The National Capital FreeNet
Lines: 25
Message-ID: <63budl$31e@freenet-news.carleton.ca>
References: <Pine DOT SUN DOT 3 DOT 91 DOT 971026171450 DOT 17911X-100000 AT is>
Reply-To: ao950 AT FreeNet DOT Carleton DOT CA (Paul Derbyshire)
NNTP-Posting-Host: freenet3.carleton.ca
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

> This is a known problem.  Emacs does almost a complete parsing of the 
> buffer part that preceeds current location, so it could indent it when 
> you press ENTER.  This might be quite slow in ELisp in pathological cases 
> such as yours.


Two things that together may ensure a fix in a future EMACS: One, be sure
to use STL ropes or something similar for buffer contents representation.
Two, use an indent logic that is "local", i.e. only needs to look at the
immediate neighborhood of the insertion point to know what to do. I.e.
indent same as line above, unless it ends with a hanging {, then indent by
two more, or if it has a } with no matching {, indent two less (with two a
user-configirable parameter)... that's a simple algorithm for indenting a
newly-created line in a C file. One can embellish it till the cows come
home, and if parts of the file get out of sync, then you just have a
recursive reindent_whole_buffer command that exdents the top line to the
left margin then applies the rules to each line in sequence (that could be
slow on bi files though.)

--
    .*.  Where feelings are concerned, answers are rarely simple [GeneDeWeese]
 -()  <  When I go to the theater, I always go straight to the "bag and mix"
    `*'  bulk candy section...because variety is the spice of life... [me]
Paul Derbyshire ao950 AT freenet DOT carleton DOT ca, http://chat.carleton.ca/~pderbysh

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019