Next: Semanticdb Search Configuration, Up: SemanticDB

#### 2.2.1 Semanticdb Tag Storage

Each time you exit Emacs, any data cached by SemanticDB is saved in the directory `.emacs.d/semanticdb/`, located in your home directory. Within this directory, the cache data is written into a set of files according to a SemanticDB-specific filename convention. If the SemanticDB directory does not exist, Emacs first asks if you want to create it.

You can change the name of the SemanticDB directory by customizing the variable `semanticdb-default-save-directory`.

— Option: semanticdb-default-save-directory

> The name of the directory where SemanticDB cache files are saved. If the value is `nil`, SemanticDB saves its data into a single file, in the current directory, whose filename is given by `semanticdb-default-file-name`.

— Option: semanticdb-default-file-name

> The name of a cache file in which to save SemanticDB, when `semanticdb-default-save-directory` is `nil`.

You can force SemanticDB to save the data from only certain files, or suppress saving altogether, by customizing `semanticdb-persistent-path`:

— Option: semanticdb-persistent-path

> List of valid paths for SemanticDB to cache. Each element should be a directory name (a string); then the parse data from any file in that directory is saved.

> As a special exception, the value of this variable can be a list containing a single symbol: `never`, `always`, or `project`. The symbol `never` disables saving anywhere; `always` enables saving everywhere; and `project` enables saving directory based on the variable `semanticdb-project-predicate-functions`.

> The default value is `(always)`.

— Variable: semanticdb-project-predicate-functions

> The value of this variable is a list of predicates for indicating that a directory belongs to a project. This list is used when the value of `semanticdb-persistent-path` is `(project)`. If the list is empty, all paths are considered valid.

> Project management packages, such as EDE (see Top), may add their own predicates with add-hook to this variable. This allows SemanticDB to save tag caches in directories controlled by them.

— Option: semanticdb-save-database-hooks

> Abnormal hook run after a database is saved. Each function is called with one argument, the object representing the database recently written.