From mboxrd@z Thu Jan 1 00:00:00 1970 To: 9fans@cse.psu.edu Subject: Re: [9fans] page as a presentation tool In-Reply-To: Your message of "Wed, 05 Nov 2003 11:25:47 EST." <200311051625.hA5GPmoY019949@localhost.localdomain> From: "Russ Cox" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <36086.1068028114.1@t40.swtch.com> Message-Id: Date: Wed, 5 Nov 2003 05:28:34 -0500 Topicbox-Message-UUID: 7fff30bc-eacc-11e9-9e20-41e7f4b1d025 > I should say I am using whatever version is in the ports tree > on FreeBSD. Maybe there is a better version. I have noticed > two ways in which it differs. One is that undo doesn't > restore the dot. This is pretty annoying since I like to > use succesive refinement to select text and I make a lot of > mistakes. The other is the 'x' doesn't work quite as > advertised in the paper. The relevant passage is > > Sam uses a two-pass algorithm for making changes, > and treats each file as a database against which > transactions are registered. Changes are not made > directly to the contents. Instead, when a command > is started, a `mark' containing a sequence number > is placed in the transcript Buffer, and each change > made to the file, either an insertion or deletion or > a change to the file name, is appended to the end of > the transcript. When the command is complete, the > transcript is rewound to the mark and applied to > the contents. > > One reason for separating evaluation from application > in this way is to simplify tracking the addresses of > changes made in the middle of a long sequence. The > two-pass algorithm also allows all changes to apply > to the original data: no change can affect another > change made in the same command. This is particularly > important when evaluating an x command because it > prevents regular expression matches from stumbling > over changes made earlier in the execution. > > I haven't looked at the source to see whether UNIX sam also uses > the two pass algorithm, but it is certainly stumbling over changes > made earlier in the execution. The one at http://pdos.lcs.mit.edu/~rsc/software/plan9 builds from the current Plan 9 sources, which are really not very far from the Unix ones. Undo definitely does restore dot, though I wish samterm scrolled so you could see it. And x seems to work, though I can't imagine why it would be too different from the Unix one. Russ