[main]Notes on TeXmacs
By default, the preprocessor directives in
#include "stdio.h"
It is controlled by the following preference:
(get-preference "syntax:cpp:preprocessor_directive")
Scheme]
Scheme]
And the preferences can be changed:
(set-preference "syntax:cpp:preprocessor_directive"
"black")
Scheme]
(get-preference "syntax:cpp:preprocessor_directive")
Scheme]
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.
(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]
Scheme]
Restart TeXmacs or type some C++ code below to trigger recoloring:
#include "stdio.h" int main() { return 0; }
To reset the colorizer:
(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]
Scheme]
Restart TeXmacs or type something below to see the effects:
#include "stdio.h" int main() { return 0; }