🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.emacs.help
Article #188938

Re: Elisp challenges: narrowing without hiding, display unlike buffer

#188938
From: Michael Ernst
Date: Wed, 05 Jun 1991 12:33
38 lines
2167 bytes
> Why is this ugly?  Each key can be rebound to a common function which
> checks the location of the cursor, and if in an editable field, does
> "self-insert-character", otherwise does nothing or an error.

Jamie and Barry have mentioned some problems with this approach (inelegant,
undo boundaries not maintained, region commands need special care); there
are a number of others.  For example, consider the following form:

Item:  Door     Quantity:   22
Item:  Jamb     Quantity:  220
Item:  Hnge     Quantity: 2200
Item:  Knob     Quantity: 2222

After inserting an "i" in "Hnge", one would want to end up with

Item:  Door     Quantity:   22
Item:  Jamb     Quantity:  220
Item:  Hinge    Quantity: 2200
Item:  Knob     Quantity: 2222

and not

Item:  Door     Quantity:   22
Item:  Jamb     Quantity:  220
Item:  Hinge     Quantity: 2200
Item:  Knob     Quantity: 2222

Every command (for instance, deletion and insertion) which moves text in
the buffer must also be modified or redefined not to do so.

Multiline rectangular fields that aren't flush left also present a special
problem that I don't know how to deal with.

Unfortunately, though this approach may have flaws, it seems like the best
one nevertheless.  I appreciate the comments so far; are there other
suggestions?
					-Michael Ernst
					 mernst@theory.lcs.mit.edu
Technical Details
Message-ID: <MERNST.91Jun5083335@emu.lcs.mit.edu>
Path: arc1-ca.pugleaf.net!gmdzi!unido!mcsun!uunet!zaphod.mps.ohio-state.edu!uakari.primate.wisc.edu!dali.cs.montana.edu!mintaka!mintaka!mernst
References: <9106031813.AA00868@emu> <9106041751.AA21076@anywhere>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 103b8b,3e38738b0012435
X-Google-Attributes: gid103b8b,public
X-Google-ArrivalTime: 1991-06-05 08:13:43 PST
Path: arc1-ca.pugleaf.net!gmdzi!unido!mcsun!uunet!zaphod.mps.ohio-state.edu!uakari.primate.wisc.edu!dali.cs.montana.edu!mintaka!mintaka!mernst
From: mernst@theory.lcs.mit.edu (Michael Ernst)
Newsgroups: gnu.emacs.help
Subject: Re: Elisp challenges: narrowing without hiding, display unlike buffer
Message-ID: <MERNST.91Jun5083335@emu.lcs.mit.edu>
Date: 5 Jun 91 12:33:35 GMT
References: <9106031813.AA00868@emu> <9106041751.AA21076@anywhere>
Sender: news@mintaka.lcs.mit.edu
Followup-To: gnu.emacs.help
Organization: MIT Lab for Computer Science
Lines: 38
In-Reply-To: aks%anywhere@hub.ucsb.edu's message of 4 Jun 91 17:51:35 GMT