wordBreak hook in Text Edit

Info-Mac discussion from 1984 - 2002.
Locked
User avatar
Info-Mac
Administrator
Posts:13716
Joined:December 21st, 1988, 11:00 am
wordBreak hook in Text Edit

Post by Info-Mac » August 28th, 1984, 3:41 am

Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Posting-Version: version B 2.10 UW 5/3/83; site uw-beaver
Path: utzoo!watmath!clyde!burl!ulysses!mhuxl!houxm!houxz!vax135!cornell!uw-beaver!info-mac
From: info-mac@uw-beaver (info-mac)
Newsgroups: fa.info-mac
Subject: wordBreak hook in Text Edit
Message-ID:
Date: Fri, 13-Jul-84 13:51:30 EDT
Article-I.D.: uw-beaver>.1212
Posted: Fri Jul 13 13:51:30 1984
Date-Received: Sat, 14-Jul-84 02:42:09 EDT
Sender: daemon@uw-beave
Organization: U of Washington Computer Science
Lines: 25

From: Mike Schuster
You can change the set of word delimiting characters used by the Text
Edit routines for word wrap calculations and double click selections
by installing a non-zero address of a routine in the field 'wordBreak'
of a TERecord. The default set of delimiting characters is /00 thru
/20, inclusive. The routine is passed the address of the first
character of the text in a0, and an offset to the character in
question in d0. The routine returns with d0 nonzero if the character
is a delimiter. Also, the status register should be set reflecting
the value in d0. As a sample, this routine defines delimiters to be
/00 thru /2f, inclusive.

.text
.globl wdbreak
wdbreak:
cmpb #/2f,a0@(0,d0:w)
sls d0
tstb d0
rts

One thing to remember: defining a period '.' to be a delimiter might
be great for editing C programs, but lousy when word wrapping causes a
period at the end of a sentence to appear on the next line all by
itself.
-------
Locked