🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.emacs.help
Article #188935

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

#188935
From: Lars Svensson
Date: Tue, 04 Jun 1991 08:04
21 lines
1666 bytes
In article <9106031813.AA00868@emu> mernst@THEORY.LCS.MIT.EDU (Michael Ernst) writes:

   2) How can I make a buffer's display different than the buffer itself?

You might try to use a find-file-hook that extracts the data from the
file, inserts it in the desired format at the beginning of the buffer,
and either erases the rest of the buffer or hides it by narrowing. A
corresponding write-file-hook would reverse the process. Check out
tar-mode by Jamie Zawinski (jwz@lucid.com), posted to the net not long
ago; it uses narrowing.

Whether to use narrowing or erasure depends on how much of your data
that is to be hidden from the user, and how hard it is to recreate
that data. For example, if the hidden data is only intra-file cross
references, it might be better to recompute those in the
write-file-hook; if it's contents of hidden text fields, you cannot
erase it. 

If you use narrowing, you will of course have to disable 'widen. 

	J
Technical Details
Message-ID: <SVENSSON.91Jun4100409@imec.imec.be>
Path: arc1-ca.pugleaf.net!gmdzi!unido!mcsun!ub4b!kulcs!kulesat!imec!svensson
References: <9106031813.AA00868@emu>

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-04 21:59:24 PST
Path: arc1-ca.pugleaf.net!gmdzi!unido!mcsun!ub4b!kulcs!kulesat!imec!svensson
From: svensson@imec.imec.be (Lars Svensson)
Newsgroups: gnu.emacs.help
Subject: Re: Elisp challenges:  narrowing without hiding, display unlike buffer
Message-ID: <SVENSSON.91Jun4100409@imec.imec.be>
Date: 4 Jun 91 08:04:09 GMT
References: <9106031813.AA00868@emu>
Sender: svensson@imec.be
Followup-To: gnu.emacs.help
Distribution: gnu
Organization: IMEC vzw, Leuven, Belgium
Lines: 21
In-reply-to: mernst@THEORY.LCS.MIT.EDU's message of 3 Jun 91 18:13:49 GMT