[PATCH] Overriding automatic syntax detection
Leonard den Ottolander
leonard at den.ottolander.nl
Wed Jul 6 17:37:28 UTC 2005
Hi,
Today I've been scratching an itch that I had for a while: An option to
override the auto syntax recognition.
Luckily the hooks to provide a syntax type are already available in the
code. In the editors menu I added a menu entry "Syntax &Highlighting".
Assuming syntax highlighting is enabled in the General menu you can
disable automatic syntax detection and enter a type in the quick_input.
These types should equal the second entries in Syntax file file lines,
so use something like "PHP Program" or "C/C++ Program".
If you drop this patch into an existing tree you will have to run
autoreconf to regenerate edit/Makefile.in. It is not provided in this
patch.
This code is (obviously) inspired by editoptions.c. It currently misses
i18n translations and it is probably a good idea to auto fill the syntax
type list (which currently gets saved in ~/.mc/history). It is quite
possible that I should use a different widget instead of quick_input for
this list (it may be static wrt user input and it should be auto
generated or pre filled). Suggestions are welcome.
Leonard.
--
mount -t life -o ro /dev/dna /genetic/research
-------------- next part --------------
A non-text attachment was scrubbed...
Name: MC_4_6_1_PRE.syntax.patch
Type: text/x-patch
Size: 7927 bytes
Desc: not available
URL: <http://lists.midnight-commander.org/pipermail/mc-devel/attachments/20050706/3987daf4/attachment.bin>
More information about the mc-devel
mailing list