tspew
addresses the “template spew” problem for C++ coders.
This minor mode runs during compilation of C++ code and reformats long error messages to be easier to read.
It indents template type names according to their hierarchy, adding newlines as required
to eliminate run-on lines.
It also provides functions to “fold” expressions to hide or reveal lower level details, for readability.
(require 'tspew)
or otherwise specify it should be loaded (e.g. withuse-package
)- Ensure it runs during compilation with
(add-hook 'compilation-mode-hook 'tspew-mode)
- Formatting occurs as compilation results arrive and are complete when the compile finishes
- To remove all formatting, exit the minor mode with
M-x tspew-mode
- The command
tspew-fold
, when run with a numeric argument, will replace text around point that is at or below that depth in parentheses (or brackets) with ellipses...
Anil
argument will restore everything.- The text within quotes at that point will be reformatted
- You can incrementally increase or decrease the detail shown using
tspew-increase-detail
(bound toC-c +
) andtspew-decrease-detail
(bound toC-c -
)
Becomes:
Template Spew Mode for C++ adds features for friendlier error viewing to compilation-mode
Copyright (C) 2023 Jeff Trull <edaskel@att.net> and contributors
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program. If not, see https://www.gnu.org/licenses/.