Abstract:
A system for creating and modifying strings of symbols in a computer storage apparatus includes a two-part cursor for guiding the operator. One cursor part indicates the exact location where entered symbols will be inserted. A second cursor part highlights a selected substring which is the object of certain commands, such as the delete command. Internally, the system provides memory management techniques for inserting and deleting symbols in response to operator commands. The display, including the two-part cursor, is derived from the memory contents with the aid of pointers, tables, and state variables.

Description:
CROSS-REFERENCE TO RELATED APPLICATION 
     This is a continuation-in-part of U.S. patent application No. 902,339, filed Aug. 29, 1986, now abandoned. 
    
    
     NOTICE REGARDING COPYRIGHTED MATERIAL 
     A portion of the disclosure of this patent document contains material which is subject to copyright protection. The copyright owner has no objection to the facsimile reproduction by anyone of the patent document or the patent disclosure as it appears in the Patent and Trademark Office patent file or records, but otherwise reserves all copyright rights whatsoever. 
     BACKGROUND OF THE INVENTION 
     This invention relates generally to a method and apparatus for creating and modifying a string of symbols in computer storage apparatus and, in particular, it relates to a method and apparatus which utilizes a two-part cursor for constantly indicating the effect of certain operations on a string of symbols stored in a computer. 
     In certain computer applications, such as word processing, an operator enters selected symbols, such as, for example, alphanumeric characters, via a keyboard (or other entry means). The entered symbols are stored in the storage apparatus of the computer system where they become part of a string of symbols. The stored string of symbols defines a document which, through the inclusion of special page break and carriage return symbols, may be subdivided into pages and lines of text. All or part of the stored string of symbols is displayed on a display device as additional symbols are entered and stored. To aid the operator, a cursor is usually displayed to indicate the position in the string where the next entered symbol will be inserted. 
     In prior art systems the cursor sits on a particular character (typically as: (i) a flashing block surrounding or, (ii) an underline beneath or, (iii) a vertical bar to the right or left of the character being pointed to.). The function of the cursor is to indicate a locus or site where a user action, such as inserting or deleting characters, will take place. However, in certain computer applications, such as word processing, there are usually two such loci, namely (i) that character that will be replaced or displaced when a new character is typed and (ii) that character that will be erased when the backspace or delete key is typed. They are not, in general, the same character. This is based on mimicking the operation of a typewriter. 
     In prior art systems the user has had to remember a rule such as: the insertion will be to the right of the cursor and deleting will be to the left. Neophytes find having to learn such a rule confusing. Even experienced user have trouble remembering to whence the cursor should be moved in order to insert or delete a character into the midst of text. For example, to remove the letter &#34;x&#34; from &#34;anxd&#34; in most examples of prior art systems, the user has to remember to move the cursor not to the &#34;x&#34;, but to the &#34;d;&#34; but on some systems the user would have to remember to move the cursor to the &#34;n&#34;. On a very few systems the user would be able to do the obvious and move the cursor to the &#34;x&#34; but on those systems the user has to aim &#34;one off&#34; for insertion rather than deletion so there is no overall benefit. 
     SUMMARY OF THE INVENTION 
     The method and apparatus of this invention provide a two-part cursor display which aids an operator in the creation and modification of a string of symbols. The two-part cursor serves to make explicit the exact loci of action of insert and delete operations. A first cursor part (herein called the &#34;blinker,&#34; which is differentiated from the highlight by flashing or through some other visual distinction) marks that position in the string where a newly typed or inserted symbol (or symbols in the case of the insertion of a number of symbols simultaneously) will appear. A second cursor part (herein called the &#34;highlight&#34;) marks a symbol (or symbols) that will be the object of certain operations, and particularly of the delete operation. 
     This relieves the operator from having to remember the confusing rules normally associated with the loci of action for cursor operation. 
     In a preferred embodiment, when the two-part cursor is moved to a particular character, either by a command, or via some device such as a joystick or mouse, or by some other method, the two parts both visually and functionally can &#34;coalesce&#34; onto a single character which then can either be deleted or can indicate the site where further characters will be inserted. Thus, to use our former example, to delete the &#34;x&#34; from &#34;anxd&#34; with the two-part cursor the user has to move the cursor to the obvious position, namely the &#34;x&#34;. But because both parts of the two-part cursor coalesced when the cursor was moved, the user can also insert a character at that location. That is, on neither insertion nor deletion does the user have to move the cursor to a character that is &#34;one off&#34; from the desired location. The operator is able to concentrate on entering and deleting the desired symbols to create a stored string of symbols. 
    
    
     BRIEF DESCRIPTION OF THE FIGURES 
     FIG. 1 is a block diagram of an embodiment of a computing system for practicing the invention. 
     FIG. 2 is a block diagram illustrating the contents of the storage apparatus of the embodiment of FIG. 1. 
     FIG. 3 is composite of FIGS. 3a and 3b which show a flow chart of the method of the preferred embodiment. 
     FIGS. 4(a)-4(m) illustrate the contents of the text buffer of FIG. 2 during the operations shown in FIG. 3. 
    
    
     DESCRIPTION OF THE PREFERRED EMBODIMENT 
     FIG. 1 is a block diagram illustrating one embodiment of a computer system for practicing the invention. The system 10 includes a central processing unit (CPU) 12 coupled to a keyboard 14, a display unit 16, and storage apparatus 18. Storage apparatus 18 may include external memory (such as a disk subsystem) as well as internal memory. Keyboard 14 is adapted for transmitting various distinguishable types of signals to CPU 12 by means well-known in the art. For example, keyboard 14 includes standard alphanumeric symbol keys for normal typing. Activation of one of these keys causes the transmission to CPU 12 of signals coded by standard means (such as ASCII) to unambiguously identify a particular symbol. Keyboard 14 also includes two special &#34;leap&#34; keys at opposite ends of the space bar. One leap key is designated the leap backward key; the other is designated the leap forward key. These keys are connected to the CPU in such a way that the states in which either may be at any time (up or down) may be detected independently of the states of the other keys on the keyboard. The signls transmitted by activation (depression) of the leap keys can be differentiated to determine whether either key or both keys are activated, and for how long. 
     FIG. 2 is a block diagram illustrating the general organization of the internal memory 20 of storage apparatus 18. It will be understood that the precise storage location of the contents of the illustrated memory contents may vary over time, depending on the operation of the particular computer. Some or all of the contents may be &#34;swapped&#34; to and from an external storage device and/or may occupy different locations in internal memory at different times. For purposes of the invention, it is only important that the memory locations of the contents of these blocks are addressable by CPU 12 at any particular time. 
     Referring now to FIG. 2, the contents of memory 20 include a text buffer 24 for storing a string of encoded symbols, a screen buffer 26 for storing encoded symbols for display on the display device, and program area 28 for storing all or part of an applications program. In this embodiment, the method of the invention is implemented by the execution (by the CPU) of application program instructions which control the contents of text buffer 24 and screen buffer 26. The application program uses certain other addressable memory locations, including at least five pointers 30, 32, 34, 36, 38, two state variables 40, 42, and two tables 44, 46, the function and contents of each of which will be described below. 
     The preferred embodiment of the method of this invention will now be described in terms of the operation of the application program on text buffer 24 and screen buffer 26, in response to signals from keyboard 14. The contents of screen buffer 26 are displayed on the display device in a manner directly corresponding to the organization of the screen buffer. References to the displaying of symbols will therefore be understood to mean moving symbols to appropriate locations in the screen buffer. 
     FIGS. 3a and 3b show a flow chart illustrating a preferred embodiment of the method of this invention. FIGS. 4a-4f conceptually illustrate the contents of text buffer 24 after the operations shown in FIGS. 3a and 3b. 
     Referring to FIG. 3a, the method begins at block 102 by initializing the system. As shown in FIG. 4a, the text buffer is initialized by inserting a one byte initial page break indicator 202 at the beginning (low-address) part of the text buffer and a one byte final page break indicator 204 at the end of the text buffer. Page breaks serve to divide the text buffer into pages of symbols; no symbols are stored before the initial page break or after the final page break. 
     Five pointers are shown conceptually in FIGS. 4a-4m. These pointers are implemented by storing text buffer addresses in pointer storage locations 30, 32, 34, 36, 38 (FIG. 2) in memory 20. Referring to FIG. 4(a), the pointers are shown after initialization. A BOS (beginning of selection) pointer 206 points to BOS location 208, and an OEOS (old end of selection) pointer 210 points to OEOS location 212. BOS pointer 206 and OEOS pointer 210 are both initialized to point to initial page break 202. An EOS (end-of-selection) pointer 214 points to EOS location 216 and an EBOT (end of beginning of text) pointer 218 points to EBOT location 220. EOS pointer 214 and EBOT pointer 218 are initialized to point to the first storage location after initial page break 202. A BEOT (beginning of end of text) pointer 222 points to BEOT location 224 and is initialized to point to the final page break 204. 
     The region 226 of the text buffer beginning at EOS 216 and ending at the last symbol storage location before BEOT 222 is called the Gap. No active text is stored in the Gap; that is, the symbols which are stored in the Gap are not considered part of the string of symbols being constructed. The region from BOS 208 to EOS 216 is called the Selection. The Selection identifies a substring of symbol which, as will be seen, is used as the object to be operated on by certain commands. 
     At block 104 of FIG. 3a, a test is performed to determine whether the signals received from the keyboard represent normal typing. In this embodiment, normal typing means the activation of one of the alpha-numeric keys. If the signals from the keyboard indicate normal typing, the signals identify a specific symbol (for example, in ASCII) and the identified symbol is stored (block 106) in the text buffer. FIG. 4(b) shows the text buffer after several symbols have been stored. Each symbol is inserted in the text buffer at EOS 216, the first location in the Gap. After each symbol is stored at EOS, EOS pointer 214 is incremented by one symbol length to point to the next symbol storage location. In this embodiment, the symbol length is one byte, which is one addressable storage location; adjacent storage locations therefore have consecutive addresses. 
     In response to normal typing, EBOT pointer 218 is also incremented by one to point to the new first storage location in the Gap. After incrementing EOS pointer 214, BOS pointer 206 is assigned the address of the symbol storage location 208 preceding EOS. 
     When normal typing begins after initialization, OEOS pointer 210 is assigned the first value of BOS 208, and keeps this value as long as normal typing continues. This is the location of the first symbol entered. 
     The Selection is defined by the region from BOS 208 to EOS 216. During normal typing, the Selection therefore consists of the last symbol typed (no active symbol being stored at EOS). 
     On the display device of this embodiment, the symbols are displayed as they are entered from the keyboard and inserted in the text buffer. According to the invention, a two-part cursor is also displayed (block 108). The two parts of the cursor will be referred to as the blinker and the highlight. 
     The blinker indicates the position in the substring (corresponding to EOS) where the next typed symbol will be inserted. In some displays (e.g. bit-mapped) the blinker may appear between two symbols to indicate precisely where the insertion will take place; in other displays (e.g. character oriented) the blinker appears over a character (or page break symbol) and the left edge of the blinker indicates the insertion location. The embodiment described herein uses a character-oriented display. 
     The highlight indicates the Selection. The Selection is made obvious (and distinguished from the blinker) by reverse video, color, or other conventional techniques. During normal typing, the last symbol entered is highlighted and the blinker is on the next character or page break symbol. 
     At block 110 of the flow chart of FIG. 3a, the signals from the keyboard are tested to determine whether both leap keys are depressed. In this embodiment, the system responds to this action by extending the Selection (block 112). The Selection is considered to be extended when it consists of more than one character. FIG. 4c illustrates the selection extension operation when it is performed after initialization and normal typing. BOS pointer 206 is moved to OEOS location 212, by copying the address in OEOS pointer 210 to BOS pointer 206. OEOS pointer 210 becomes undefined. The Selection is thereby extended to the entire region from BOS 208 to EOS 216, to include all symbols entered since initialization. On the display, the part of the Selection which displayed is highlighted. (As will be seen below, the Selection extension operation always results in the selection of a well-defined, predictable substring; the selection of all symbols entered since initialization is limited to the present example, where only normal typing has been performed since initialization.) When the Selection is extended, one of the aforementioned state variables, Selection state varible 40, is set to indicate this fact. 
     Returning to the flow chart of FIG. 3, at block 114, the signals from the keyboard are tested to determine whether the leap forward key is tapped. The system responds to this signal in different ways, depending on the state of the two-part cursor. At block 116, the system tests the Selection state variable 40 to determine whether the Selection is presently extended. If it is, then at block 118 the Selection is &#34;collapsed&#34;, i.e., restored to an unextended condition, wherein the Selection is one symbol. In this case, the Selection is collapsed (FIG. 4d) to the right end of the Selection by moving BOS pointer 206 to the last location before the Gap (by assigning the address EOS-1 to BOS pointer 206). OEOS pointer 210 saves the old value of BOS. 
     If the Selection is not extended when the leap forward key is tapped, then, at block 120, a test is made to determine whether the cursor is &#34;wide.&#34; The two-part cursor of this invention is referred to as wide when the blinker follows the highlight by one character or symbol on the display (i.e., when the insertion location indicated by the left edge of the blinker immediately follows the highlighted character). The cursor is referred to as narrow when the blinker and the highlight are on the same character or symbol on the display (i.e., when the insertion location indicated by the left edge of the blinker immediately precedes the highlight). The second state variable, cursor state variable 42, is maintained to indicate a wide or narrow cursor. 
     If the Selection is not extended, and the cursor is wide when the leap forward key is tapped, then the cursor is made narrow (block 122) by moving the Selection and highlight forward one character and modifying cursor state variable 42. In the text buffer, if there is a symbol stored at BEOT 224 (other than the final page break symbol), this symbol is moved to EOS 216, and EOS pointer 214, EBOT pointer 218, BOS pointer 206, and BEOT pointer 222 are all incremented by one. 
     When the cursor is narrow, the blinker is displayed over the symbol stored at BOS to indicate that insertions will be made before this symbol. When the cursor is not narrow, the blinker is displayed over the symbol, if any, stored at BEOT. 
     The effect of normal typing when the cursor is narrow is shown in FIG. 4(e). BEOT pointer 222 is decremented by one, the symbol stored at BOS 208 is moved to new BEOT 224, and the typed symbol is inserted at BOS 208. OEOS pointer 210 saves the value of BOS location 208. The cursor is changed to wide and the cursor state variable is updated. 
     If the leap forward key is tapped and the Selection is not extended and the cursor is already narrow, than, at block 124, the narrow cursor is moved forward one symbol (unless it is already on the final page break). In the text buffer, if there is a symbol stored at BEOT 224, it is moved to EOS 216, and EOS pointer 218, BOS pointer 206, and BEOT pointer 222 are all incremented by one. 
     Referring to FIG. 3b, if the signals from the keyboard indicate that the leap backward key is tapped (tested at block 130), the Selection state variable is tested (at block 132) to determine whether the Selection is extended. If it is, then at block 134 the Selection is collapsed to the beginning of the Selection. In the text buffer, all symbols stored from BOS+1 to EOS are moved to the new BEOT, effectively moving the Gap. The new BEOT address is calculated as: BEOT=old BEOT-(EBOT-EOS). EOS pointer 214 and EBOT pointer 218 are then modified to point to the location BOS+1, making it the first location of the Gap. The cursor is made narrow and the blinker is at the symbol stored on BOS. 
     If the Selection is not extended when the leap backward key is tapped, the cursor state variable is tested at block 136 to determine whether the cursor is wide. If the cursor is wide, it is made narrow at block 138 by modifying the second state variable, causing the blinker to be moved to the symbol stored at BOS, effectively moving the blinker over the highlighted Selection. 
     If the leap backward key is tapped and the Selection is not extended and the cursor is narrow, then, at block 140, the narrow cursor is moved back one character (unless it is already on the initial page break). Any symbol stored at BOS is moved to after the Gap, and BOS pointer 206, EOS pointer 214, EBOT pointer 218 and BEOT pointer 222 are all decremented by one. 
     If the narrow cursor is on the initial page break after it is collapsed to the beginning of the Selection, it is changed to a wide cursor, because no symbols can be inserted before the initial page break. 
     If the signals from the keyboard indicate that either leap key is pressed and held (block 150), this is interpreted as a request to move the two-part cursor to a specific location. The move may be a content-based move in which the user specifies a substring in the text buffer (and possibly not on the display). The substring is located and displayed with a narrow cursor on the first symbol of the substring. A content-based cursor moving function (&#34;leaping&#34;) is explained in detail in co-pending U.S. patent application serial No. 605,448, assigned to the assignee of the present application, the disclosure of which is hereby incorporated by reference. While the method of moving the cursor described therein is used in the preferred embodiment of the present invention, it will be understood that other conventional methods, such as cursor control keys, joy sticks, or &#34;find&#34; commands could be used with the present invention. 
     FIG. 4(f) shows the text buffer during a leap backwards, where the text buffer before the leap is as shown in FIG. 4(d). BOS pointer 206 points to the location leaped to, EOS pointer 214 points to the next location, and EBOT pointer 218 temporarily stays at the previous EOS location at the beginning of the Gap. The other pointers are not moved. FIG. 4(g) shows the text buffer and pointers after the leap operation is completed. All active text from new EOS 216 to old EBOT 220 is moved to new BEOT 224, effectively moving the Gap up to the new EOS. EBOT pointer 218 is then set to the new EOS address 216, OEOS pointer 210 is set to the old value of BEOT, and BEOT pointer 222 is set to the new start of text after the Gap. The new BEOT address is calculated as BEOT=old BEOT-(old EBOT-new EOS). After leaping, the cursor state variable is set to narrow and the blinker is on the symbol stored at BOS. 
     In an alternative embodiment, a &#34;dragging&#34; feature is provided. If the Selection is extended when the cursor movement (leap) function is invoked, the Selection is &#34;dragged&#34; to the target location and inserted there. 
     A second example of extending the Selection will now illustrate the effect of this operation when it is invoked immediately after a leap. The extension operation will result in the Selection being extended to the region bounded by the highlight before the leap and the highlight after the leap. FIG. 4(h) shows the effect of the extension operation when it is performed after the backward leap which results in the text buffer of 4(g). The symbols from BEOT to OEOS-1 are moved to EOS 216, effectively moving the Gap to where it was in FIG. 4(f). EOS pointer 214 and EBOT pointer 218 are updated to point to the start of the new Gap. BEOT pointer 224 is assigned the value of OEOS. The Selection extends from BOS to EOS and the blinker is at the character stored at BEOT. 
     FIG. 4(i) shows the text buffer during the leap forward operation. BOS pointer 206 points to the target location of the leap and EOS pointer 214 points to the next location. EBOT pointer 218 temporarily saves the old value of EOS. FIG. 4(j) shows the text buffer after completion of the leap forward. The symbols from old BEOT 224 to new BOS 206 are moved to the Gap at old EBOT 220; new EBOT pointer 218 and EOS pointer 214 are then set to: old EBOT+(new EOS-old BEOT). BOS pointer 206 is set to EOS minus 1 and OEOS pointer 210 is set to the old value of EBOT minus 1. It is seen that OEOS pointer 210 maintains the address of the location which was highlighted before the leap. The cursor is narrow and the blinker is at BOS. 
     If the Selection is now extended after the leap forward, the text buffer is as shown in 4(k). BOS pointer 206 is assigned the value of OEOS. The Selection extends from BOS 208 to EOS 216. 
     As illustrated in these examples of selection extension, if OEOS is greater than BOS, then the BEOT pointer is moved to OEOS, and the EOS pointer is moved to the beginning of the new Gap (after accounting for text moves). If OEOS is less than BOS, then the BOS pointer is moved to OEOS. Extending the Selection immediately after a leap results in the Selection being bounded by the Selection before the leap and the Selection after the leap. Extending the Selection after normal typing results in a Selection consisting of all symbols typed since the last leap. 
     FIG. 4(l) shows the text buffer and pointers when normal typing follows the leap operation shown in FIG. 4(j). The cursor is always narrow after a leap. When typing begins, the first symbol is entered at BOS 208 (because the cursor is narrow) and OEOS pointer 210 saves the value of BOS 208. If both leap keys are pressed, the Selection is extended by assigning the value of OEOS to BOS pointer 206, resulting in the extended Selection shown in FIG. 4(m), wherein all symbols entered since the last leap are selected. 
     The Selection may advantageously be used as the object for certain commands, such as print requests and delete requests. Referring to FIG. 3b, if the signals from the keyboard indicate a delete request (block 155) then the Selection is deleted. The delete operation (block 156) works as follows: When the cursor is wide, and the Selection is not extended, BOS pointer 206, EBOT pointer 218, and EOS pointer 214 are all decremented by one, effectively deleting the highlighted symbol by moving the Gap. If the Selection is extended, EOS pointer 214 and EBOT pointer 218 are assigned the address of BOS 208 and BOS pointer 206 is assigned the address of EOS-1. When the cursor is narrow, the symbol stored at BEOT 224 is moved to BOS 208, and BEOT pointer 222 is incremented by one. It will be noted that, when the cursor is wide (as it is during normal typing), successive deletions work to the left; when the cursor is narrow (as it is after it is moved, or leaped), successive deletions proceed to the right. This is consistent with the usual intentions of the operator. 
     Other commands that can operate on the Selection include &#34;CALC&#34; and &#34;SEND.&#34; The &#34;CALC&#34; command takes the Selection and executes it as a program. It may, for example, send the Selection to the system&#39;s BASIC interpreter, where the program is interpreted and executed. The output of the program is then inserted at the gap and the Selection is deleted. The &#34;SEND&#34; command invokes telecommunications features and transmits the Selection to a remote location, such as another computer. A &#34;RECEIVE&#34; function may also be provided, with a message being received via telecommunications and inserted either at EOS (if there has not been any typing since the last leap) or OEOS (if there has been typing since the last leap). 
     In the preferred embodiment, certain commands which operate on the Selection (block 158) will automatically extend the Selection (block 160) if they are invoked when the Selection is not extended. For example, if the print command is received and the Selection is unextended, the system assumes that the user does not intend to print only one symbol. The system therefore extends the Selection in the same manner it would if both leap keys were pressed, and then it prints the extended Selection. Other commands, such as delete, do not cause automatic extension. 
     The tables 44 and 46 (FIG. 2) will now be explained so that the display operation may be fully understood. Page table 42 contains one entry for each page of text. Each entry on page table 44 contains a pointer and a line number. The pointer contains an address in the text buffer of the start of each page of text. The line number is the line number of the start of that page, counting from the beginning of the text. Pages can start either because there are enough symbols to fill a page or because the user entered a page break signal. After a leap operation, the page table is recalculated from the text buffer so that all of the pointers refer to the start of each page. This is necessary because the Gap may have been moved by the leap operation. It is not necessary to actually recalculate all page table entries, but only to adjust the pointer values based on how far the Gap has moved. Normal typing can also require updating of the page table from the cursor&#39;s page to the final page. 
     Window table 46 consists of one entry for each line on the display. Each entry contains: a pointer to the text buffer at the location of the beginning of the line; the line number on the page; and the page number in the text. 
     The content-based leap operation can result in the blinker being moved to a part of text buffer which is not yet displayed on the display. To display the leaped-to text, the page table is searched to find which page contains the EOS. The address value EOS is compared to the page pointers in the page table until a page pointer having an address greater than EOS is found, identifying the previous page as the page containing EOS. The end of the Selection (EOS) is to be displayed in the middle of the display. Assuming an embodiment with 24 lines per display screen, the page table is traversed backward until a page is located which at least 12 lines before EOS. The start of the 11 lines preceding the line with EOS, the start of the line with EOS, and the 12 lines after EOS are then located. The line start pointers, line numbers, and page numbers of these 24 lines are stored in the window table. The display routine then moves these 24 lines of text to the screen buffer for display on the display screen. When BOS is encountered, all symbols from BOS to EOS are hightlighted. 
     In the preferred embodiment, the method of this invention is performed on an Apple IIe computer operating under control of the FORTH program attached as Appendix 1 to this application. 
     The foregoing explanation of the preferred embodiment is intended to illustrate the invention rather than limit it. The scope of the invention may be ascertained from the appended claims. ##SPC1## ##SPC2## ##SPC3## ##SPC4## ##SPC5## ##SPC6## ##SPC7## ##SPC8## ##SPC9## ##SPC10## ##SPC11## ##SPC12## ##SPC13## ##SPC14##