Xref: utzoo gnu.emacs.help:2221 comp.emacs:10846 Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!cis.ohio-state.edu!tut.cis.ohio-state.edu!unreplyable!garbage From: aks%anywhere@hub.ucsb.edu (Alan Stebbens) Newsgroups: gnu.emacs.help,comp.emacs Subject: Re: Elisp challenges: narrowing without hiding, display unlike buffer Message-ID: <9106041751.AA21076@anywhere> Date: 4 Jun 91 17:51:35 GMT References: <9106031813.AA00868@emu> Sender: daemon@tut.cis.ohio-state.edu Followup-To: gnu.emacs.help Distribution: world Organization: Gatewayed from the GNU Project mailing list help-gnu-emacs@prep.ai.mit.edu Lines: 30 > I am toying with the idea of writing a simple database [...] The most > challenging part of such a project seems to be the front end. > > 1) How can I restrict changes to a certain rectangle or region of the > window? > An ugly solution would involve remembering the modifiable region or > rectangle and rebinding every key so that its behavior did not extend > outside that area. 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. > 2) How can I make a buffer's display different than the buffer itself? What's wrong with another buffer, which is marked readonly (thereby avoiding accidental "munging", as you say), which contains the "display", which is the buffer being viewed. The characters you type cause the hidden, associated buffer containing the raw data to be modified, as well as updates to the "display" buffer, which are the results you see. When you "save" the display buffer, it would be the associated raw data buffer which would actually be saved. The "forms" mode is not a bad start; it just needs more work to be a "real" database GUI. Perhaps, the fable "Version 19" will have features to help with this. Alan