Fork me on GitHub

graphviz-dot-mode - "0.3.7"

what is it? download graphviz-dot-mode

Mode for the dot-language used by graphviz (att).

by Pieter Pareit <>

how to install

M-x package-install [RET] graphviz-dot-mode [RET]


Use this mode for editing files in the dot-language ( and

To use graphviz-dot-mode, add 
(load-file "PATH_TO_FILE/graphviz-dot-mode.el") 
to your ~/.emacs(.el) or ~/.xemacs/init.el

The graphviz-dot-mode will do font locking, indentation, preview of graphs
and eases compilation/error location. There is support for both GNU Emacs
and XEmacs.

Font locking is automatic, indentation uses the same commands as
other modes, tab, M-j and C-M-q.  Insertion of comments uses the
same commands as other modes, M-; .  You can compile a file using
M-x compile or C-c c, after that M-x next-error will also work.
There is support for viewing an generated image with C-c p.

* cleanup the mess of graphviz-dot-compilation-parse-errors.
* electric indentation is fundamentally broken, because 
{...} are also used for record nodes. You could argue, I suppose, that 
many diagrams don't need those, but it would be worth having a note (and 
it makes sense that the default is now for electric indentation to be 
* lines that start with # are comments, lines that start with one or more
whitespaces and then a # should give an error.


Version 0.3.7 Tim Allen
09/03/2011: * fix spaces in file names when compiling
Version 0.3.6 maintenance
19/02/2011: * .gv is the new extension  (Pander)
* comments can start with # (Pander)
* highlight of new keywords (Pander)
Version 0.3.5 bug (or at least feature I dislike) fix             
11/11/2010:  Eric Anderson
* Preserve indentation across blank (whitespace-only) lines
Version 0.3.4 bug fixes
24/02/2005: * fixed a bug in graphviz-dot-preview
Version 0.3.3 bug fixes
13/02/2005: Reuben Thomas &lt;rrt AT;
* add graphviz-dot-indent-width
Version 0.3.2 bug fixes
25/03/2004: Rubens Ramos &lt;rubensr AT;
* semi-colons and brackets are added when electric
behaviour is disabled.
* electric characters do not behave electrically inside
comments or strings.
* default for electric-braces is disabled now (makes more
sense I guess).
* using read-from-minibuffer instead of read-shell-command
for emacs.
* Fixed test for easymenu, so that it works on older
versions of XEmacs.
* Fixed indentation error when trying to indent last brace
of an empty graph.
* region-active-p does not exist in emacs (21.2 at least),
so removed from code
* Added uncomment menu option
Version 0.3.1 bug fixes
03/03/2004: * backward-word needs argument for older emacs
Version 0.3 added features and fixed bugs
10/01/2004: fixed a bug in graphviz-dot-indent-graph
08/01/2004: Rubens Ramos &lt;rubensr AT;
* added customization support
* Now it works on XEmacs and Emacs
* Added support to use an external Viewer
* Now things do not break when dot mode is entered
when there is no buffer name, but the side effect is
that in this case, the compilation command is not
* Preview works on XEmacs and emacs.
* Electric indentation on newline
* Minor changes to indentation
* Added keyword completion (but could be A LOT better)
* There are still a couple of ugly hacks. Look for 'RR'.
Version 0.2 added features
11/11/2002: added preview support.
10/11/2002: indent a graph or subgraph at once with C-M-q.
08/11/2002: relaxed rules for indentation, the may now be extra chars
after beginning of graph (comment's for example).
Version 0.1.2 bug fixes and naming issues
06/11/2002: renamed dot-font-lock-defaults to dot-font-lock-keywords.
added some documentation to dot-colors.
provided a much better way to handle my max-specpdl-size
added an extra autoload cookie (hope this helps, as I don't
yet use autoload myself)
Version 0.1.1 bug fixes
06/11/2002: added an missing attribute, for font-locking to work.
fixed the regex generating, so that it only recognizes
whole words
05/11/2002: there can now be extra white space chars after an '{'.
04/11/2002: Why I use max-specpdl-size is now documented, and old value
gets restored.
Version 0.1 initial release
02/11/2002: implemented parser for *compilation* of a .dot file.
01/11/2002: implemented compilation of an .dot file.
31/10/2002: added syntax-table to the mode.
30/10/2002: implemented indentation code.
29/10/2002: implemented all of font-lock.
28/10/2002: derived graphviz-dot-mode from fundamental-mode, started 
implementing font-lock.