Prevent CEDET semantic from parsing certain file types

76 Views Asked by At

I have to work with a C/C++ build environment that drops intermediate files all over the place:

  • .i files containing the output of the C-preprocessor (roughly raw C)
  • .s files containing the input of the C-assembler

CEDET (I assume the semantic analyzer) eventually finds these files and attempts to index them. This results in jumping to .i files containing raw C for definitions and generally slowing down parsing and loading of the .semanticdb.

I never open these files in emacs, so they must be being loaded by the background analyser.

Is it possible to prevent the analyser from loading these files? I can't find any configuration options that define the file-types that are parsed by the background analyser.

2

There are 2 best solutions below

6
On BEST ANSWER

If you never need C mode for these files, here's a quick fix:

(add-to-list 'auto-mode-alist '("\\.i\\'" . fundamental-mode))
(add-to-list 'auto-mode-alist '("\\.s\\'" . fundamental-mode))
0
On

The answer from abo-abo gave me the clues I needed. The grep implementation (used by EDE) of semantic-symref-perform-search uses auto-mode-alist to find matching files for a given semantic mode (based on the current buffer's mode - eg `c-mode) when trying to resolve symbols.

The final fix I used is to specifically eliminate the default entries in the auto-mode-alist using:

(delete '("\\.i\\'" . c-mode) auto-mode-alist) (delete '("\\.ii\\'" . c++-mode) auto-mode-alist)

Adding fundamental-mode entries as suggested by abo-abo seems to work also, however I was concerned that since the c-mode entries were still in the list a change in implementation could result in them being reactivated.