/* Run a formatter for the given syntax.
* Expects the formatter to be non-interactive and
* operate on a file in-place, which we'll pass it
- * on the command line. Another mashuhp of the speller
+ * on the command line. Another mashup of the speller
* and alt_speller routines.
*/
void do_formatter(void)
char *finalstatus = NULL;
/* Check whether we're using syntax highlighting
- * and formatter option it set
- */
+ * and the formatter option is set. */
if (openfile->syntax == NULL || openfile->syntax->formatter == NULL) {
- statusbar(_("Error: no linter defined"));
+ statusbar(_("Error: no formatter defined"));
return;
}
return;
}
- /* we're not supporting partial formatting, oi vey */
+ /* We're not supporting partial formatting, oi vey. */
openfile->mark_set = FALSE;
status = write_file(temp, temp_file, TRUE, OVERWRITE, FALSE);
/* Start a new process for the formatter. */
if ((pid_format = fork()) == 0) {
- /* Start alternate format program; we are using $PATH. */
+ /* Start the formatting program; we are using $PATH. */
execvp(formatargs[0], formatargs);
- /* Should not be reached, if alternate formatter is found!!! */
+ /* Should not be reached, if the formatter is found! */
exit(1);
}
sprintf(format_error, invoke_error, openfile->syntax->formatter);
finalstatus = format_error;
} else {
-
- /* Replace the text of the current buffer with the format-checked
- * text. */
+ /* Replace the text of the current buffer with the formatted text. */
replace_buffer(temp);
/* Go back to the old position, and mark the file as modified. */
currmenu = MMAIN;
- /* If the spell-checker printed any error messages onscreen, make
+ /* If the formatter printed any error messages onscreen, make
* sure that they're cleared off. */
total_refresh();