[main]Notes on TeXmacs
By default, the preprocessor directives in
#include "stdio.h"
It is controlled by the following preference:
Scheme] |
(get-preference "syntax:cpp:preprocessor_directive") |
Scheme] |
And the preferences can be changed:
Scheme] | (set-preference "syntax:cpp:preprocessor_directive" "black") |
Scheme] |
(get-preference "syntax:cpp:preprocessor_directive") |
Scheme] |
Preferences are stored when we set it. For GNU TeXmacs v1.99.15, a re-render trigger (eg. Restart) is required for your changes to take effect.
To decolorize all C++ code snippet, we need to know all the preferences for the C++ language. Some of them can be found in $TEXMACS_PATH/progs/prog/cpp-lang.scm. A complete list can be found at texmacs@v1.99.15:src/System/Language.cpp#L259.
Scheme] |
(map (lambda (key) (set-preference key "black")) (list "syntax:cpp:comment" "syntax:cpp:keyword" "syntax:cpp:constant_string" "syntax:cpp:constant_number" "syntax:cpp:constant_type" "syntax:cpp:preprocessor_directive" "syntax:cpp:preprocessor" "syntax:cpp:error")) |
Scheme] |
Restart TeXmacs or type some C++ code below to trigger recoloring:
#include "stdio.h" int main() { return 0; }
To reset the colorizer:
Scheme] |
(map (lambda (key) (reset-preference key)) (list "syntax:cpp:comment" "syntax:cpp:keyword" "syntax:cpp:constant_string" "syntax:cpp:constant_number" "syntax:cpp:constant_type" "syntax:cpp:preprocessor_directive" "syntax:cpp:preprocessor" "syntax:cpp:error")) |
Scheme] |
Restart TeXmacs or type something below to see the effects:
#include "stdio.h" int main() { return 0; }