Next: , Previous: , Up: Files   [Contents][Index]


13.3 File Groups

File groups provide a simple way of collecting the files that compose a system and naming that collection. Hemlock supports commands for searching, replacing, and compiling groups.

Variable: *active-file-group*

This is the list of files that constitute the currently selected file group. If this is nil, then there is no current group.

Hemlock Variable: Group Find File (initial value nil)
Hemlock Variable: Group Save File Confirm (initial value t)
Macro: do-active-group {form}*

do-active-group iterates over active-file-group executing the forms once for each file. While the forms are executing, the file is in the current buffer, and the point is at the beginning. If there is no active group, this signals an editor-error.

This reads each file into its own buffer using find-file-buffer. Since unwanted buffers may consume large amounts of memory, Group Find File controls whether to delete the buffer after executing the forms. When the variable is false, this deletes the buffer if it did not previously exist; however, regardless of this variable, if the user leaves the buffer modified, the buffer persists after the forms have completed. Whenever this processes a buffer that already existed, it saves the location of the buffer’s point before and restores it afterwards.

After processing a buffer, if it is modified, do-active-group tries to save it. If Group Save File Confirm is non-nil, it asks for confirmation.


Next: File Reading and Writing, Previous: Pathnames and Buffers, Up: Files   [Contents][Index]