Linux tip, Fedora tip / howto: Disable underlining of bad syntax in ECB under emacs

 
Note that these tips are mostly outdated


back to notes and tips index

Try my online puzzle page with Calcudoku, Killer Sudoku and online Sudoku.

Disable underlining of bad syntax in ECB under emacs

ECB (Emacs Code Browser) is an editing environment for emacs. It uses the semantic tool for parsing source, which underlines code that doesn't parse.

However, semantic does not have support for PHP (which is hard to begin with, since PHP files are often mixed HTML and PHP), so it tends to disapprove of a lot of syntax, leading to annoying red underlined text in the editor window.

It turns out you can disable this by running:
semantic-show-unmatched-syntax-mode

To disable this by default, load the file semantic-load.el from the semantic source distribution, locate line 266 (approximately, I have version 1.4.4 here), which says:
(global-semantic-show-unmatched-syntax-mode 1)
and change the 1 into a zero. Then recompile by running make in that same directory.

You could add a shortcut key to toggle the feature on and off by adding a line like this to your ~/.emacs file:
(global-set-key [\M-f5] 'semantic-show-unmatched-syntax-mode)
(this will make Alt+F5 the toggle key)

...


← back to notes and tips index
Please do not copy the text of this tip (© Patrick Min) to your web site.