| | 1 | [[PageOutline]] |
| | 2 | |
| | 3 | = 5 Managing Large Systems = |
| | 4 | |
| | 5 | Hemlock provides three tools which help to manage large systems: |
| | 6 | |
| | 7 | 1. File groups, which provide several commands that operate on all |
| | 8 | the files in a possibly large collection, instead of merely on a |
| | 9 | single buffer. |
| | 10 | |
| | 11 | 2. A source comparison facility with semi-automatic merging, which |
| | 12 | can be used to compare and merge divergent versions of a source |
| | 13 | file. |
| | 14 | |
| | 15 | 3. A change log facility, which maintains a single file containing a |
| | 16 | record of the edits done on a system. |
| | 17 | |
| | 18 | == 5.1 File Groups == |
| | 19 | |
| | 20 | A file group is a set of files, upon which various editing operations |
| | 21 | can be performed. The files in a group are specified by a file in the |
| | 22 | following format: |
| | 23 | |
| | 24 | * Any line which begins with one "@" is ignored. |
| | 25 | |
| | 26 | * Any line which does not begin with an "@" is the name of a file in |
| | 27 | the group. |
| | 28 | |
| | 29 | * A line which begins with "@@" specifies another file having this |
| | 30 | syntax, which is recursively examined to find more files in the |
| | 31 | group. |
| | 32 | |
| | 33 | This syntax is used for historical reasons. Although any number of |
| | 34 | file groups may be read into Hemlock, there is only one active group, |
| | 35 | which is the file group implicitly used by all of the file group |
| | 36 | commands. Page 9.5 describes the Compile Group command. |
| | 37 | |
| | 38 | Select Group [Command] |
| | 39 | |
| | 40 | This command prompts for the name of a file group to make the active |
| | 41 | group. If the name entered is not the name of a group whose definition |
| | 42 | has been read, then the user is prompted for the name of a file to |
| | 43 | read the group definition from. The name of the default pathname is |
| | 44 | the name of the group, and the type is "upd". |
| | 45 | |
| | 46 | |
| | 47 | |
| | 48 | Group Query Replace [Command] |
| | 49 | |
| | 50 | This command prompts for target and replacement strings and then |
| | 51 | executes an interactive string replace on each file in the active |
| | 52 | group. This reads in each file as if Find File were used and processes |
| | 53 | it as if Query Replace were executing. |
| | 54 | |
| | 55 | |
| | 56 | |
| | 57 | Group Replace [Command] |
| | 58 | |
| | 59 | This is like Group Query Replace except that it executes a |
| | 60 | non-interactive replacement, similar to Replace String. |
| | 61 | |
| | 62 | |
| | 63 | |
| | 64 | Group Search [Command] |
| | 65 | |
| | 66 | This command prompts for a string and then searches for it in each |
| | 67 | file in the active group. This reads in each file as if Find File were |
| | 68 | used. When it finds an occurrence, it prompts the user for a key-event |
| | 69 | indicating what action to take. The following commands are defined: |
| | 70 | |
| | 71 | Escape, Space, y:: |
| | 72 | Exit Group Search. |
| | 73 | |
| | 74 | Delete, Backspace, n:: |
| | 75 | Continue searching for the next occurrence of the string. |
| | 76 | |
| | 77 | !:: |
| | 78 | Continue the search at the beginning of the next file, skipping the |
| | 79 | remainder of the current file. |
| | 80 | |
| | 81 | C-r:: |
| | 82 | Go into a recursive edit at the current location, and continue the |
| | 83 | search when it is exited. |
| | 84 | |
| | 85 | |
| | 86 | Group Find File (initial value nil) [Variable] |
| | 87 | |
| | 88 | The group searching and replacing commands read each file into its own |
| | 89 | buffer using Find File. Since this may result in large amounts of |
| | 90 | memory being consumed by unwanted buffers, this variable controls |
| | 91 | whether to delete the buffer after processing it. When this variable |
| | 92 | is false, the default, the commands delete the buffer if it did not |
| | 93 | previously exist; however, regardless of this variable, if the user |
| | 94 | leaves the buffer modified, the commands will not delete it. |
| | 95 | |
| | 96 | |
| | 97 | Group Save File Confirm (initial value t) [Variable] |
| | 98 | |
| | 99 | If this variable is true, the group searching and replacing commands |
| | 100 | ask for confirmation before saving any modified file. The commands |
| | 101 | attempt to save each file processed before going on to the next one in |
| | 102 | the group. |
| | 103 | |
| | 104 | |
| | 105 | == 5.2 Source Comparison == |
| | 106 | |
| | 107 | These commands can be used to find exactly how the text in two buffers |
| | 108 | differs, and to generate a new version that combines features of both |
| | 109 | versions. |
| | 110 | |
| | 111 | Source Compare Default Destination (initial value "Differences") [Variable] |
| | 112 | |
| | 113 | This is a sticky default buffer name to offer when comparison commands |
| | 114 | prompt for a buffer in which to insert the results. |
| | 115 | |
| | 116 | |
| | 117 | |
| | 118 | Compare Buffers [Command] |
| | 119 | |
| | 120 | This command prompts for three buffers and then does a buffer |
| | 121 | comparison. The first two buffers must exist, as they are the buffers |
| | 122 | to be compared. The last buffer, which is created if it does not |
| | 123 | exist, is the buffer to which output is directed. The output buffer is |
| | 124 | selected during the comparison so that its progress can be |
| | 125 | monitored. There are various variables that control exactly how the |
| | 126 | comparison is done. |
| | 127 | |
| | 128 | If a prefix argument is specified, then only only the lines in the the |
| | 129 | regions of the two buffers are compared. |
| | 130 | |
| | 131 | |
| | 132 | Buffer Changes [Command] |
| | 133 | |
| | 134 | This command compares the contents of the current buffer with the disk |
| | 135 | version of the associated file. It reads the file into the buffer |
| | 136 | Buffer Changes File, and generates the comparison in the buffer Buffer |
| | 137 | Changes Result. As with Compare Buffers, the output buffer is |
| | 138 | displayed in the current window. |
| | 139 | |
| | 140 | |
| | 141 | Merge Buffers [Command] |
| | 142 | |
| | 143 | This command functions in a very similar fashion to Compare Buffers, |
| | 144 | the difference being that a version which is a combination of the two |
| | 145 | buffers being compared is generated in the output buffer. This copies |
| | 146 | text that is identical in the two comparison buffers to the output |
| | 147 | buffer. When it encounters a difference, it displays the two differing |
| | 148 | sections in the output buffer and prompts the user for a key-event |
| | 149 | indicating what action to take. The following commands are defined: |
| | 150 | |
| | 151 | |
| | 152 | 1:: |
| | 153 | Use the first version of the text. |
| | 154 | |
| | 155 | 2:: |
| | 156 | Use the second version. |
| | 157 | |
| | 158 | b:: |
| | 159 | Insert the string "**** MERGE LOSSAGE ****" followed by both |
| | 160 | versions. This is useful if the differing sections are too complex, |
| | 161 | or it is unclear which is the correct version. If you cannot make |
| | 162 | the decision conveniently at this point, you can later search for |
| | 163 | the marking string above. |
| | 164 | |
| | 165 | C-r:: |
| | 166 | Do a recursive edit and ask again when the edit is exited. |
| | 167 | |
| | 168 | |
| | 169 | Source Compare Ignore Case (initial value nil) [Variable] |
| | 170 | |
| | 171 | If this variable is non-nil, Compare Buffers and Merge Buffers will do |
| | 172 | comparisons case-insensitively. |
| | 173 | |
| | 174 | |
| | 175 | |
| | 176 | Source Compare Ignore Indentation (initial value nil) [Variable] |
| | 177 | |
| | 178 | If this variable is non-nil, Compare Buffers and Merge Buffers ignore |
| | 179 | initial whitespace when comparing lines. |
| | 180 | |
| | 181 | |
| | 182 | |
| | 183 | Source Compare Ignore Extra Newlines (initial value t) [Variable] |
| | 184 | |
| | 185 | If this variable is true, Compare Buffers and Merge Buffers will treat |
| | 186 | all groups of newlines as if they were a single newline. |
| | 187 | |
| | 188 | |
| | 189 | |
| | 190 | Source Compare Number of Lines (initial value 3) [Variable] |
| | 191 | |
| | 192 | This variable controls the number of lines Compare Buffers and Merge |
| | 193 | Buffers will compare when resynchronizing after a difference has been |
| | 194 | encountered. |
| | 195 | |
| | 196 | == 5.3 Change Logs == |
| | 197 | |
| | 198 | The Hemlock change log facility encourages the recording of changes to |
| | 199 | a system by making it easy to do so. The change log is kept in a |
| | 200 | separate file so that it doesn't clutter up the source code. The name |
| | 201 | of the log for a file is specified by the Log file option (see page |
| | 202 | 3.3.3.) |
| | 203 | |
| | 204 | Log Change [Command] |
| | 205 | |
| | 206 | Log Entry Template (initial value ) [Variable] |
| | 207 | |
| | 208 | Log Change makes a new entry in the change log associated with the |
| | 209 | file. Any changes in the current buffer are saved, and the associated |
| | 210 | log file is read into its own buffer. The name of the log file is |
| | 211 | determined by merging the name specified in the Log option with the |
| | 212 | current buffer's file name, so it is not usually necessary to put the |
| | 213 | full name there. After inserting a template for the log entry at the |
| | 214 | beginning of the buffer, the command enters a recursive edit (see |
| | 215 | section 1.13) so that the text of the entry may be filled in. When the |
| | 216 | user exits the recursive edit, the log file is saved. |
| | 217 | |
| | 218 | The variable Log Entry Template determines the format of the change |
| | 219 | log entry. Its value is a Common Lisp format control string. The |
| | 220 | format string is passed three string arguments: the full name of the |
| | 221 | file, the creation date for the file and the name of the file |
| | 222 | author. If the creation date is not available, the current date is |
| | 223 | used. If the author is not available then nil is passed. If there is |
| | 224 | an @ in the template, then it is deleted and the point is left at that |
| | 225 | position. |
| | 226 | |