├── .gitattributes
├── .gitignore
├── LICENSE.md
├── README.md
├── graphviz-dot-mode.el
└── texinfo
├── .gitignore
├── Makefile
├── fdl.texi
├── gpl-2.0.texi
├── gpl.texi
├── graphviz-dot-mode.html
├── graphviz-dot-mode.pdf
└── graphviz-dot-mode.texi
/.gitattributes:
--------------------------------------------------------------------------------
1 | *.html linguist-detectable=false
2 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | *.elc
2 |
--------------------------------------------------------------------------------
/LICENSE.md:
--------------------------------------------------------------------------------
1 | ### GNU GENERAL PUBLIC LICENSE
2 |
3 | Version 2, June 1991
4 |
5 | Copyright (C) 1989, 1991 Free Software Foundation, Inc.
6 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
7 |
8 | Everyone is permitted to copy and distribute verbatim copies
9 | of this license document, but changing it is not allowed.
10 |
11 | ### Preamble
12 |
13 | The licenses for most software are designed to take away your freedom
14 | to share and change it. By contrast, the GNU General Public License is
15 | intended to guarantee your freedom to share and change free
16 | software--to make sure the software is free for all its users. This
17 | General Public License applies to most of the Free Software
18 | Foundation's software and to any other program whose authors commit to
19 | using it. (Some other Free Software Foundation software is covered by
20 | the GNU Lesser General Public License instead.) You can apply it to
21 | your programs, too.
22 |
23 | When we speak of free software, we are referring to freedom, not
24 | price. Our General Public Licenses are designed to make sure that you
25 | have the freedom to distribute copies of free software (and charge for
26 | this service if you wish), that you receive source code or can get it
27 | if you want it, that you can change the software or use pieces of it
28 | in new free programs; and that you know you can do these things.
29 |
30 | To protect your rights, we need to make restrictions that forbid
31 | anyone to deny you these rights or to ask you to surrender the rights.
32 | These restrictions translate to certain responsibilities for you if
33 | you distribute copies of the software, or if you modify it.
34 |
35 | For example, if you distribute copies of such a program, whether
36 | gratis or for a fee, you must give the recipients all the rights that
37 | you have. You must make sure that they, too, receive or can get the
38 | source code. And you must show them these terms so they know their
39 | rights.
40 |
41 | We protect your rights with two steps: (1) copyright the software, and
42 | (2) offer you this license which gives you legal permission to copy,
43 | distribute and/or modify the software.
44 |
45 | Also, for each author's protection and ours, we want to make certain
46 | that everyone understands that there is no warranty for this free
47 | software. If the software is modified by someone else and passed on,
48 | we want its recipients to know that what they have is not the
49 | original, so that any problems introduced by others will not reflect
50 | on the original authors' reputations.
51 |
52 | Finally, any free program is threatened constantly by software
53 | patents. We wish to avoid the danger that redistributors of a free
54 | program will individually obtain patent licenses, in effect making the
55 | program proprietary. To prevent this, we have made it clear that any
56 | patent must be licensed for everyone's free use or not licensed at
57 | all.
58 |
59 | The precise terms and conditions for copying, distribution and
60 | modification follow.
61 |
62 | ### TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
63 |
64 | **0.** This License applies to any program or other work which
65 | contains a notice placed by the copyright holder saying it may be
66 | distributed under the terms of this General Public License. The
67 | "Program", below, refers to any such program or work, and a "work
68 | based on the Program" means either the Program or any derivative work
69 | under copyright law: that is to say, a work containing the Program or
70 | a portion of it, either verbatim or with modifications and/or
71 | translated into another language. (Hereinafter, translation is
72 | included without limitation in the term "modification".) Each licensee
73 | is addressed as "you".
74 |
75 | Activities other than copying, distribution and modification are not
76 | covered by this License; they are outside its scope. The act of
77 | running the Program is not restricted, and the output from the Program
78 | is covered only if its contents constitute a work based on the Program
79 | (independent of having been made by running the Program). Whether that
80 | is true depends on what the Program does.
81 |
82 | **1.** You may copy and distribute verbatim copies of the Program's
83 | source code as you receive it, in any medium, provided that you
84 | conspicuously and appropriately publish on each copy an appropriate
85 | copyright notice and disclaimer of warranty; keep intact all the
86 | notices that refer to this License and to the absence of any warranty;
87 | and give any other recipients of the Program a copy of this License
88 | along with the Program.
89 |
90 | You may charge a fee for the physical act of transferring a copy, and
91 | you may at your option offer warranty protection in exchange for a
92 | fee.
93 |
94 | **2.** You may modify your copy or copies of the Program or any
95 | portion of it, thus forming a work based on the Program, and copy and
96 | distribute such modifications or work under the terms of Section 1
97 | above, provided that you also meet all of these conditions:
98 |
99 |
100 | **a)** You must cause the modified files to carry prominent notices
101 | stating that you changed the files and the date of any change.
102 |
103 |
104 | **b)** You must cause any work that you distribute or publish, that in
105 | whole or in part contains or is derived from the Program or any part
106 | thereof, to be licensed as a whole at no charge to all third parties
107 | under the terms of this License.
108 |
109 |
110 | **c)** If the modified program normally reads commands interactively
111 | when run, you must cause it, when started running for such interactive
112 | use in the most ordinary way, to print or display an announcement
113 | including an appropriate copyright notice and a notice that there is
114 | no warranty (or else, saying that you provide a warranty) and that
115 | users may redistribute the program under these conditions, and telling
116 | the user how to view a copy of this License. (Exception: if the
117 | Program itself is interactive but does not normally print such an
118 | announcement, your work based on the Program is not required to print
119 | an announcement.)
120 |
121 | These requirements apply to the modified work as a whole. If
122 | identifiable sections of that work are not derived from the Program,
123 | and can be reasonably considered independent and separate works in
124 | themselves, then this License, and its terms, do not apply to those
125 | sections when you distribute them as separate works. But when you
126 | distribute the same sections as part of a whole which is a work based
127 | on the Program, the distribution of the whole must be on the terms of
128 | this License, whose permissions for other licensees extend to the
129 | entire whole, and thus to each and every part regardless of who wrote
130 | it.
131 |
132 | Thus, it is not the intent of this section to claim rights or contest
133 | your rights to work written entirely by you; rather, the intent is to
134 | exercise the right to control the distribution of derivative or
135 | collective works based on the Program.
136 |
137 | In addition, mere aggregation of another work not based on the Program
138 | with the Program (or with a work based on the Program) on a volume of
139 | a storage or distribution medium does not bring the other work under
140 | the scope of this License.
141 |
142 | **3.** You may copy and distribute the Program (or a work based on it,
143 | under Section 2) in object code or executable form under the terms of
144 | Sections 1 and 2 above provided that you also do one of the following:
145 |
146 |
147 | **a)** Accompany it with the complete corresponding machine-readable
148 | source code, which must be distributed under the terms of Sections 1
149 | and 2 above on a medium customarily used for software interchange; or,
150 |
151 |
152 | **b)** Accompany it with a written offer, valid for at least three
153 | years, to give any third party, for a charge no more than your cost of
154 | physically performing source distribution, a complete machine-readable
155 | copy of the corresponding source code, to be distributed under the
156 | terms of Sections 1 and 2 above on a medium customarily used for
157 | software interchange; or,
158 |
159 |
160 | **c)** Accompany it with the information you received as to the offer
161 | to distribute corresponding source code. (This alternative is allowed
162 | only for noncommercial distribution and only if you received the
163 | program in object code or executable form with such an offer, in
164 | accord with Subsection b above.)
165 |
166 | The source code for a work means the preferred form of the work for
167 | making modifications to it. For an executable work, complete source
168 | code means all the source code for all modules it contains, plus any
169 | associated interface definition files, plus the scripts used to
170 | control compilation and installation of the executable. However, as a
171 | special exception, the source code distributed need not include
172 | anything that is normally distributed (in either source or binary
173 | form) with the major components (compiler, kernel, and so on) of the
174 | operating system on which the executable runs, unless that component
175 | itself accompanies the executable.
176 |
177 | If distribution of executable or object code is made by offering
178 | access to copy from a designated place, then offering equivalent
179 | access to copy the source code from the same place counts as
180 | distribution of the source code, even though third parties are not
181 | compelled to copy the source along with the object code.
182 |
183 | **4.** You may not copy, modify, sublicense, or distribute the Program
184 | except as expressly provided under this License. Any attempt otherwise
185 | to copy, modify, sublicense or distribute the Program is void, and
186 | will automatically terminate your rights under this License. However,
187 | parties who have received copies, or rights, from you under this
188 | License will not have their licenses terminated so long as such
189 | parties remain in full compliance.
190 |
191 | **5.** You are not required to accept this License, since you have not
192 | signed it. However, nothing else grants you permission to modify or
193 | distribute the Program or its derivative works. These actions are
194 | prohibited by law if you do not accept this License. Therefore, by
195 | modifying or distributing the Program (or any work based on the
196 | Program), you indicate your acceptance of this License to do so, and
197 | all its terms and conditions for copying, distributing or modifying
198 | the Program or works based on it.
199 |
200 | **6.** Each time you redistribute the Program (or any work based on
201 | the Program), the recipient automatically receives a license from the
202 | original licensor to copy, distribute or modify the Program subject to
203 | these terms and conditions. You may not impose any further
204 | restrictions on the recipients' exercise of the rights granted herein.
205 | You are not responsible for enforcing compliance by third parties to
206 | this License.
207 |
208 | **7.** If, as a consequence of a court judgment or allegation of
209 | patent infringement or for any other reason (not limited to patent
210 | issues), conditions are imposed on you (whether by court order,
211 | agreement or otherwise) that contradict the conditions of this
212 | License, they do not excuse you from the conditions of this License.
213 | If you cannot distribute so as to satisfy simultaneously your
214 | obligations under this License and any other pertinent obligations,
215 | then as a consequence you may not distribute the Program at all. For
216 | example, if a patent license would not permit royalty-free
217 | redistribution of the Program by all those who receive copies directly
218 | or indirectly through you, then the only way you could satisfy both it
219 | and this License would be to refrain entirely from distribution of the
220 | Program.
221 |
222 | If any portion of this section is held invalid or unenforceable under
223 | any particular circumstance, the balance of the section is intended to
224 | apply and the section as a whole is intended to apply in other
225 | circumstances.
226 |
227 | It is not the purpose of this section to induce you to infringe any
228 | patents or other property right claims or to contest validity of any
229 | such claims; this section has the sole purpose of protecting the
230 | integrity of the free software distribution system, which is
231 | implemented by public license practices. Many people have made
232 | generous contributions to the wide range of software distributed
233 | through that system in reliance on consistent application of that
234 | system; it is up to the author/donor to decide if he or she is willing
235 | to distribute software through any other system and a licensee cannot
236 | impose that choice.
237 |
238 | This section is intended to make thoroughly clear what is believed to
239 | be a consequence of the rest of this License.
240 |
241 | **8.** If the distribution and/or use of the Program is restricted in
242 | certain countries either by patents or by copyrighted interfaces, the
243 | original copyright holder who places the Program under this License
244 | may add an explicit geographical distribution limitation excluding
245 | those countries, so that distribution is permitted only in or among
246 | countries not thus excluded. In such case, this License incorporates
247 | the limitation as if written in the body of this License.
248 |
249 | **9.** The Free Software Foundation may publish revised and/or new
250 | versions of the General Public License from time to time. Such new
251 | versions will be similar in spirit to the present version, but may
252 | differ in detail to address new problems or concerns.
253 |
254 | Each version is given a distinguishing version number. If the Program
255 | specifies a version number of this License which applies to it and
256 | "any later version", you have the option of following the terms and
257 | conditions either of that version or of any later version published by
258 | the Free Software Foundation. If the Program does not specify a
259 | version number of this License, you may choose any version ever
260 | published by the Free Software Foundation.
261 |
262 | **10.** If you wish to incorporate parts of the Program into other
263 | free programs whose distribution conditions are different, write to
264 | the author to ask for permission. For software which is copyrighted by
265 | the Free Software Foundation, write to the Free Software Foundation;
266 | we sometimes make exceptions for this. Our decision will be guided by
267 | the two goals of preserving the free status of all derivatives of our
268 | free software and of promoting the sharing and reuse of software
269 | generally.
270 |
271 | **NO WARRANTY**
272 |
273 | **11.** BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO
274 | WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
275 | EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
276 | OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY
277 | KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
278 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
279 | PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
280 | PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME
281 | THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
282 |
283 | **12.** IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
284 | WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
285 | AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU
286 | FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
287 | CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
288 | PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
289 | RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
290 | FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF
291 | SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
292 | DAMAGES.
293 |
294 | ### END OF TERMS AND CONDITIONS
295 |
296 | ### How to Apply These Terms to Your New Programs
297 |
298 | If you develop a new program, and you want it to be of the greatest
299 | possible use to the public, the best way to achieve this is to make it
300 | free software which everyone can redistribute and change under these
301 | terms.
302 |
303 | To do so, attach the following notices to the program. It is safest to
304 | attach them to the start of each source file to most effectively
305 | convey the exclusion of warranty; and each file should have at least
306 | the "copyright" line and a pointer to where the full notice is found.
307 |
308 | one line to give the program's name and an idea of what it does.
309 | Copyright (C) yyyy name of author
310 |
311 | This program is free software; you can redistribute it and/or
312 | modify it under the terms of the GNU General Public License
313 | as published by the Free Software Foundation; either version 2
314 | of the License, or (at your option) any later version.
315 |
316 | This program is distributed in the hope that it will be useful,
317 | but WITHOUT ANY WARRANTY; without even the implied warranty of
318 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
319 | GNU General Public License for more details.
320 |
321 | You should have received a copy of the GNU General Public License
322 | along with this program; if not, write to the Free Software
323 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
324 |
325 | Also add information on how to contact you by electronic and paper
326 | mail.
327 |
328 | If the program is interactive, make it output a short notice like this
329 | when it starts in an interactive mode:
330 |
331 | Gnomovision version 69, Copyright (C) year name of author
332 | Gnomovision comes with ABSOLUTELY NO WARRANTY; for details
333 | type `show w'. This is free software, and you are welcome
334 | to redistribute it under certain conditions; type `show c'
335 | for details.
336 |
337 | The hypothetical commands \`show w' and \`show c' should show the
338 | appropriate parts of the General Public License. Of course, the
339 | commands you use may be called something other than \`show w' and
340 | \`show c'; they could even be mouse-clicks or menu items--whatever
341 | suits your program.
342 |
343 | You should also get your employer (if you work as a programmer) or
344 | your school, if any, to sign a "copyright disclaimer" for the program,
345 | if necessary. Here is a sample; alter the names:
346 |
347 | Yoyodyne, Inc., hereby disclaims all copyright
348 | interest in the program `Gnomovision'
349 | (which makes passes at compilers) written
350 | by James Hacker.
351 |
352 | signature of Ty Coon, 1 April 1989
353 | Ty Coon, President of Vice
354 |
355 | This General Public License does not permit incorporating your program
356 | into proprietary programs. If your program is a subroutine library,
357 | you may consider it more useful to permit linking proprietary
358 | applications with the library. If this is what you want to do, use the
359 | [GNU Lesser General Public
360 | License](http://www.gnu.org/licenses/lgpl.html) instead of this
361 | License.
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | graphviz-dot-mode
2 | =====================
3 |
4 | [Emacs](https://www.gnu.org/software/emacs/) package for working with
5 | [Graphviz](https://graphviz.org) DOT-format files.
6 |
7 | The features of this package help you to create `.dot` or `.gv` files
8 | containing syntax compatible with Graphviz and use Graphviz to convert
9 | these files to diagrams. [Graphviz](https://graphviz.org) is a set of
10 | open source graph visualization tools created by AT&T Labs Research. A
11 | graph is a way of representing information as a network of connected
12 | nodes (shapes) and edges (lines).
13 |
14 | Installing
15 | ============
16 |
17 | Dependencies
18 | --------------
19 |
20 | This of course depends on Emacs and Graphviz. Installation from the
21 | command prompt should be something like
22 |
23 | ``` shell
24 | $ sudo dnf install emacs graphviz
25 | ```
26 |
27 | Setting up MELPA
28 | -------------------
29 |
30 | Add the [MELPA](https://melpa.org/) archive to the list of archives
31 | used by the Emacs package manager by adding the following lines to
32 | your `.emacs` or other Emacs start-up file.
33 |
34 | ``` emacs-lisp
35 | (require 'package)
36 | (add-to-list 'package-archives
37 | '("melpa" . "https://melpa.org/packages/"))
38 | (package-initialize)
39 | ```
40 | Evaluate above code or restart Emacs.
41 |
42 | Setting up use-package
43 | ---------------------------
44 |
45 | Add the [`use-package`](https://jwiegley.github.io/use-package/)
46 | package to your Emacs by adding the following lines to your start-up
47 | file.
48 |
49 | ``` emacs-lisp
50 | (unless (package-installed-p 'use-package)
51 | (package-refresh-contents)
52 | (package-install 'use-package))
53 | ```
54 | Evaluate above code or restart Emacs.
55 |
56 | Setting up graphviz-dot-mode
57 | ----------------------------------
58 |
59 | Now you can finally add Graphviz support to your Emacs by adding the
60 | following lines to your startup file.
61 |
62 | ``` emacs-lisp
63 | (use-package graphviz-dot-mode
64 | :ensure t
65 | :config
66 | (setq graphviz-dot-indent-width 4))
67 | ```
68 |
69 | Evaluate above code or restart Emacs.
70 |
71 | Using `graphviz-dot-mode`
72 | ==============================
73 |
74 | Once installation and setup is completed, usage is as simple as
75 | creating or opening a `.dot` file with `C-x C-f` (`find-file`). The
76 | file will open in dot mode. Syntax should be highlighted, completion
77 | should work and viewing your work is only one keystroke away with `C-c
78 | C-p`. Some useful commands are described below.
79 |
80 | ### Indenting
81 |
82 | * `C-M-q` (`graphviz-dot-indent-graph`)
83 |
84 | This command will indent the graph, digraph, or subgraph at point
85 | and any subgraph within it.
86 |
87 | * `TAB`
88 |
89 | This key will automatically indent the line.
90 |
91 | ### Completion
92 |
93 | Is available and makes use of the facilities provided by Emacs. Your
94 | preferred completion framework should plug into this.
95 |
96 | For instance, if you use company, it can be configured by adding the
97 | following line to your startup file.
98 |
99 | ``` emacs-lisp
100 | (add-hook 'graphviz-dot-mode-hook 'company-mode)
101 | ```
102 |
103 | ### Commenting
104 |
105 | * `M-;` (`comment-dwim`)
106 |
107 | This command will perform the comment command you want (Do What I
108 | Mean). If the region is active and `transient-mark-mode` is on, it
109 | will comment the region, unless it only consists of comments, in which
110 | case it will un-comment the region. Else, if the current line is
111 | empty, it will insert a blank comment line, otherwise it will append a
112 | comment to the line and indent it.
113 |
114 | Use `C-u M-;` to kill the comment on the current line.
115 |
116 | * `C-x C-;` (`comment-line`)
117 |
118 | This command will comment or un-comment the current line.
119 |
120 | * `M-j` (`comment-indent-newline`)
121 |
122 | This command will break line the at point and indent, continuing a
123 | comment if within one. This indents the body of the continued comment
124 | under the previous comment line.
125 |
126 | ### Choosing layout
127 |
128 | * `M-x graphviz-dot-set-layout`
129 |
130 | This command lets you choose the layout program for your graphs.
131 | The default is `dot`. The list of layout programs is in
132 | `C-h v graphviz-dot-layout-programs` and can be customized.
133 |
134 | ### Compiling
135 |
136 | * `C-c C-c` (`compile`)
137 |
138 | This command compiles the current dot file visited by the Emacs
139 | buffer. The output file is in the same directory and has the
140 | extension determined by the variable `graphviz-dot-preview-extension`.
141 |
142 | * `` C-x ` `` (`next-error`)
143 |
144 | This command will jump to the location in the source file of the
145 | next error from the most recent compile. Use `C-c C-c` to compile first.
146 |
147 | ### Viewing
148 |
149 | * `C-c C-p` (`graphviz-dot-preview`)
150 |
151 | This command compiles and then (if it compiled successfully) shows
152 | the output of the current dot file visited by the Emacs buffer,
153 | provided that Emacs is running on a graphical display capable of
154 | displaying the graphic file output by `dot`.
155 |
156 | See `image-file-name-extensions` to customize the graphic files that
157 | can be displayed.
158 |
159 | * `C-c C-v` (`graphviz-dot-view`)
160 |
161 | This command invokes an external viewer specified by the variable
162 | `graphviz-dot-view-command`. If `graphviz-dot-view-edit-command` is
163 | `t`, you will be prompted to enter a new
164 | `graphviz-dot-view-command`. If `graphviz-dot-save-before-view` is
165 | `t`, the buffer is saved before the external viewer command is
166 | invoked.
167 |
168 | See for a list of Graphviz
169 | viewers.
170 |
171 |
172 | Customizing
173 | =============
174 |
175 | You may customize variables by typing
176 |
177 | `M-x graphviz-dot-customize RET`
178 |
179 | or by setting them to different values in your startup file.
180 |
181 | * `graphviz-dot-dot-program` string, default: “dot”
182 |
183 | This variable determines the command name (and path, if necessary)
184 | used to invoke the Graphviz `dot` program. The `C-c C-c` (`compile`)
185 | function invokes this command.
186 |
187 | * `graphviz-dot-preview-extension` string, default “png”
188 |
189 | This variable determines the file extension used for the `C-c C-c`
190 | (`compile`) and `C-c C-p` (`graphviz-dot-preview`) functions. The
191 | format for the compile command is
192 |
193 | `dot -T .dot > .`
194 |
195 | * `graphviz-dot-save-before-view` boolean, default `t`
196 |
197 | This variable controls whether the buffer will be saved to the
198 | visited file before the `C-c C-v` (`graphviz-dot-view`) function
199 | invokes the external dot-file viewer command. Set this boolean
200 | variable to `t` (true) or `nil` (false).
201 |
202 | * `graphviz-dot-view-command` string, default: “dotty %s”
203 |
204 | This variable determines the command name (and path, if necessary)
205 | used to invoke an external dot-file viewer program. The `C-c C-v`
206 | (`graphviz-dot-view`) function invokes this command. The name of the
207 | file visited by the buffer will be substituted for `%s` in this
208 | string.
209 |
210 | See for a list of Graphviz
211 | viewers.
212 |
213 | * `graphviz-dot-view-edit-command` boolean, default: `nil`
214 |
215 | This variable controls whether you will be prompted for the external
216 | dot-file viewer command name when you use `C-c C-v`
217 | `graphviz-dot-view`. Set this to `t` (true) to be prompted to edit
218 | the viewer command variable `graphviz-dot-view-command` every time you
219 | use `C-c C-v` or `nil` to avoid the prompt.
220 |
221 | * `graphviz-dot-indent-width` integer, default: `standard-indent`
222 |
223 | This variable determines the indentation used in `graphviz-dot-mode`
224 | buffers.
225 |
226 | * `graphviz-dot-mode-hook` list of functions, default: `nil`
227 |
228 | This variable determines which functions are called when
229 | `graphviz-dot-mode` starts. To use it, add a line like below to your
230 | `.emacs` or other startup file.
231 |
232 | ``` emacs-lisp
233 | (add-hook 'graphviz-dot-mode-hook 'my-hook)
234 | ```
235 |
236 | Support
237 | ========
238 |
239 | * Issues, requests and questions can go on its issue tracker:
240 |
241 | * This mode is maintained at its github page:
242 |
243 | * You can support the maintainer through a [paypal donation](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=ZBVLYKWYMXQ3G)
244 |
245 | Credits
246 | ========
247 |
248 | `graphviz-dot-mode` was written by:
249 |
250 | * Pieter Pareit
251 | * Rubens Ramos
252 | * Eric Anderson
253 | * Daniel Birket
254 |
255 | Other contributors are noted in the version history in the
256 | `graphviz-dot-mode.el` file and the commit history on GitHub.
257 |
258 | The source code is maintained on GitHub at
259 | by Pieter Pareit
260 | ().
261 |
--------------------------------------------------------------------------------
/graphviz-dot-mode.el:
--------------------------------------------------------------------------------
1 | ;;; graphviz-dot-mode.el --- Mode for the dot-language used by graphviz (att). -*- lexical-binding: t; -*-
2 |
3 | ;; Copyright (C) 2002 - 2020, 2022 Pieter Pareit
4 |
5 | ;; This program is free software; you can redistribute it and/or
6 | ;; modify it under the terms of the GNU General Public License as
7 | ;; published by the Free Software Foundation; either version 2 of
8 | ;; the License, or (at your option) any later version.
9 |
10 | ;; This program is distributed in the hope that it will be
11 | ;; useful, but WITHOUT ANY WARRANTY; without even the implied
12 | ;; warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
13 | ;; PURPOSE. See the GNU General Public License for more details.
14 |
15 | ;; You should have received a copy of the GNU General Public
16 | ;; License along with this program; if not, write to the Free
17 | ;; Software Foundation, Inc., 59 Temple Place, Suite 330, Boston,
18 | ;; MA 02111-1307 USA
19 |
20 | ;; Authors: Pieter Pareit
21 | ;; Rubens Ramos
22 | ;; Eric Anderson http://www.ece.cmu.edu/~andersoe/
23 | ;; Maintainer: Pieter Pareit
24 | ;; Homepage: https://ppareit.github.io/graphviz-dot-mode/
25 | ;; Created: 28 Oct 2002
26 | ;; Last modified: 25 Januari 2020
27 | ;; Version: 0.4.2
28 | ;; Package-Requires: ((emacs "25.0"))
29 | ;; Keywords: mode dot dot-language dotlanguage graphviz graphs att
30 |
31 | ;;; Commentary:
32 | ;; Use this mode for editing files in the dot-language, see
33 | ;; https://www.graphviz.org.
34 | ;;
35 | ;; To use graphviz-dot-mode, add
36 | ;; (use-package graphviz-dot-mode
37 | ;; :ensure t)
38 | ;; to your ~/.emacs.el file.
39 | ;;
40 | ;; The graphviz-dot-mode will do font locking, indentation, preview of
41 | ;; graphs and eases compilation/error location. Font locking is
42 | ;; automatic, indentation uses the same commands as other modes, tab,
43 | ;; M-j and C-M-q. Insertion of comments uses the same commands as
44 | ;; other modes, M-; . You can compile a file using M-x compile or C-c
45 | ;; C- c, after that M-x next-error will also work. There is support
46 | ;; for viewing an generated image with C-c C-p.
47 | ;;
48 | ;;; Todo:
49 | ;;
50 | ;;; History:
51 | ;; Version 0.4.2 Pieter Pareit
52 | ;; 25/01/2020: * Fix issues
53 | ;; * Improve font-locking
54 | ;; * Improve completion by implementing company mode
55 | ;; * Rewrote basic documentation
56 | ;; Version 0.4.1 Pieter Pareit
57 | ;; 28/09/2019: * Maintenance, checking documentation, fixing flycheck errors.
58 | ;; * Solve next-error for gaphviz
59 | ;; * Tag new version
60 | ;; Version 0.3.11 Olli Piepponen
61 | ;; 29/01/2016: * use define-derived-mode for the mode-definition
62 | ;; * add support for a auto-loading live preview work flow
63 | ;; Version 0.3.10 Kevin Ryde
64 | ;; 25/05/2015: * shell-quote-argument for safety
65 | ;; * use read-shell-command whenever available, don't set novaproc
66 | ;; Version 0.3.9 Titus Barik
67 | ;; 28/08/2012: * compile-command uses -ofile instead of >
68 | ;; Version 0.3.8 new home
69 | ;; 27/06/2012: * put graphviz-dot-mode into git, updated links
70 | ;; Version 0.3.7 Tim Allen
71 | ;; 09/03/2011: * fix spaces in file names when compiling
72 | ;; Version 0.3.6 maintenance
73 | ;; 19/02/2011: * .gv is the new extension (Pander)
74 | ;; * comments can start with # (Pander)
75 | ;; * highlight of new keywords (Pander)
76 | ;; Version 0.3.5 bug (or at least feature I dislike) fix
77 | ;; 11/11/2010: Eric Anderson http://www.ece.cmu.edu/~andersoe/
78 | ;; * Preserve indentation across blank (whitespace-only) lines
79 | ;; Version 0.3.4 bug fixes
80 | ;; 24/02/2005: * fixed a bug in graphviz-dot-preview
81 | ;; Version 0.3.3 bug fixes
82 | ;; 13/02/2005: Reuben Thomas
83 | ;; * add graphviz-dot-indent-width
84 | ;; Version 0.3.2 bug fixes
85 | ;; 25/03/2004: Rubens Ramos
86 | ;; * semi-colons and brackets are added when electric
87 | ;; behaviour is disabled.
88 | ;; * electric characters do not behave electrically inside
89 | ;; comments or strings.
90 | ;; * default for electric-braces is disabled now (makes more
91 | ;; sense I guess).
92 | ;; * using read-from-minibuffer instead of read-shell-command
93 | ;; for emacs.
94 | ;; * Fixed test for easymenu, so that it works on older
95 | ;; versions of XEmacs.
96 | ;; * Fixed indentation error when trying to indent last brace
97 | ;; of an empty graph.
98 | ;; * region-active-p does not exist in emacs (21.2 at least),
99 | ;; so removed from code
100 | ;; * Added uncomment menu option
101 | ;; Version 0.3.1 bug fixes
102 | ;; 03/03/2004: * backward-word needs argument for older emacs
103 | ;; Version 0.3 added features and fixed bugs
104 | ;; 10/01/2004: fixed a bug in graphviz-dot-indent-graph
105 | ;; 08/01/2004: Rubens Ramos
106 | ;; * added customization support
107 | ;; * Now it works on XEmacs and Emacs
108 | ;; * Added support to use an external Viewer
109 | ;; * Now things do not break when dot mode is entered
110 | ;; when there is no buffer name, but the side effect is
111 | ;; that in this case, the compilation command is not
112 | ;; correct.
113 | ;; * Preview works on XEmacs and emacs.
114 | ;; * Electric indentation on newline
115 | ;; * Minor changes to indentation
116 | ;; * Added keyword completion (but could be A LOT better)
117 | ;; * There are still a couple of ugly hacks. Look for 'RR'.
118 | ;; Version 0.2 added features
119 | ;; 11/11/2002: added preview support.
120 | ;; 10/11/2002: indent a graph or subgraph at once with C-M-q.
121 | ;; 08/11/2002: relaxed rules for indentation, the may now be extra chars
122 | ;; after beginning of graph (comment's for example).
123 | ;; Version 0.1.2 bug fixes and naming issues
124 | ;; 06/11/2002: renamed dot-font-lock-defaults to dot-font-lock-keywords.
125 | ;; added some documentation to dot-colors.
126 | ;; provided a much better way to handle my max-specpdl-size
127 | ;; problem.
128 | ;; added an extra autoload cookie (hope this helps, as I don't
129 | ;; yet use autoload myself)
130 | ;; Version 0.1.1 bug fixes
131 | ;; 06/11/2002: added an missing attribute, for font-locking to work.
132 | ;; fixed the regex generating, so that it only recognizes
133 | ;; whole words
134 | ;; 05/11/2002: there can now be extra whitespace chars after an '{'.
135 | ;; 04/11/2002: Why I use max-specpdl-size is now documented, and old value
136 | ;; gets restored.
137 | ;; Version 0.1 initial release
138 | ;; 02/11/2002: implemented parser for *compilation* of a .dot file.
139 | ;; 01/11/2002: implemented compilation of an .dot file.
140 | ;; 31/10/2002: added syntax-table to the mode.
141 | ;; 30/10/2002: implemented indentation code.
142 | ;; 29/10/2002: implemented all of font-lock.
143 | ;; 28/10/2002: derived graphviz-dot-mode from fundamental-mode, started
144 | ;; implementing font-lock.
145 |
146 | ;;; Code:
147 |
148 | (require 'compile)
149 | (require 'subr-x)
150 | (require 'thingatpt)
151 |
152 | (defconst graphviz-dot-mode-version "0.4.2"
153 | "Version of `graphviz-dot-mode.el'.")
154 |
155 | (defgroup graphviz nil
156 | "Major mode for editing Graphviz Dot files."
157 | :group 'tools)
158 |
159 | (defun graphviz-dot-customize ()
160 | "Run \\[customize-group] for the `graphviz' group."
161 | (interactive)
162 | (customize-group 'graphviz))
163 |
164 | (defvar graphviz-dot-mode-abbrev-table nil
165 | "Abbrev table in use in Graphviz Dot mode buffers.")
166 | (define-abbrev-table 'graphviz-dot-mode-abbrev-table ())
167 |
168 | (defcustom graphviz-dot-dot-program "dot"
169 | "*Location of the dot program. This is used by `compile'."
170 | :type 'string
171 | :group 'graphviz)
172 |
173 | (defcustom graphviz-dot-layout-programs
174 | '("dot" "neato" "fdp" "sfdp" "twopi" "twopi" "circo")
175 | "*List of layout programs for the user to choose from."
176 | :type 'list
177 | :group 'graphviz)
178 |
179 | (defcustom graphviz-dot-view-command "dotty %s"
180 | "*External program to run on the buffer.
181 | You can use `%s' in this string, and it will be substituted by the buffer name."
182 | :type 'string
183 | :group 'graphviz)
184 |
185 | (defcustom graphviz-dot-view-edit-command nil
186 | "*Whether to allow the user to edit the command to run an external viewer."
187 | :type 'boolean
188 | :group 'graphviz)
189 |
190 | (defcustom graphviz-dot-save-before-view t
191 | "*If not nil, \\[graphviz-dot-view] saves the current buffer before running the command."
192 | :type 'boolean
193 | :group 'graphviz)
194 |
195 | (defcustom graphviz-dot-indent-width standard-indent
196 | "*Indentation width in Graphviz Dot mode buffers."
197 | :type 'integer
198 | :group 'graphviz)
199 |
200 | (defcustom graphviz-dot-preview-extension "png"
201 | "*The extension to use for the compilation and preview commands.
202 | The default format for the compilation command is `dot -T png
203 | file.dot -o file.png'."
204 | :type 'string
205 | :group 'graphviz)
206 |
207 | (defcustom graphviz-dot-auto-preview-on-save nil
208 | "*Determines if saving the buffer should automatically trigger preview."
209 | :type 'boolean
210 | :group 'graphviz)
211 |
212 | (defcustom graphviz-dot-revert-delay 300
213 | "*Amount of time to sleep before attempting to display the rendered image."
214 | :type 'number
215 | :group 'graphviz)
216 |
217 | (defcustom graphviz-dot-attr-keywords
218 | '("graph" "digraph" "subgraph" "node" "edge" "strict" "rankdir"
219 | "size" "page" "Damping" "Epsilon" "URL" "arrowhead" "arrowsize"
220 | "arrowtail" "bb" "bgcolor" "bottomlabel" "center" "clusterrank"
221 | "color" "colorscheme" "comment" "compound"
222 | "concentrate" "constraint" "decorate"
223 | "dim" "dir" "distortion" "fillcolor" "fixedsize" "fontcolor"
224 | "fontname" "fontpath" "fontsize" "group" "headURL" "headlabel"
225 | "headport" "height" "label" "labelangle" "labeldistance" "labelfloat"
226 | "labelfontcolor" "labelfontname" "labelfontsize" "labeljust"
227 | "labelloc" "layer" "layers" "len" "lhead" "lp" "ltail" "margin"
228 | "maxiter" "mclimit" "minlen" "model" "nodesep" "normalize" "nslimit"
229 | "nslimit1" "ordering" "orientation" "overlap" "pack" "pagedir"
230 | "pencolor" "peripheries" "pin" "pos" "quantum" "rank" "ranksep"
231 | "ratio" "rects" "regular" "remincross" "rotate" "samehead" "sametail"
232 | "samplepoint" "searchsize" "sep" "shape" "shapefile" "showboxes"
233 | "sides" "skew" "splines" "start" "style" "stylesheet" "tailURL"
234 | "taillabel" "tailport" "toplabel" "vertices" "voro_margin" "weight"
235 | "z" "width" "penwidth" "mindist" "scale" "patch" "root")
236 | "*Keywords for attribute names in a graph.
237 | This is used by the auto completion code. The actual completion
238 | tables are built when the mode is loaded, so changes to this are
239 | not immediately visible."
240 | :type '(repeat (string :tag "Keyword"))
241 | :group 'graphviz)
242 |
243 | (defvar graphviz-attributes-type-arrow
244 | '("arrowhead" "arrowtail")
245 | "The attributes that are of type `arrowType'.
246 | See URL `https://graphviz.org/docs/attr-types/arrowType/'.")
247 |
248 | (defvar graphviz-values-type-arrow
249 | '("box" "lbox" "rbox" "obox" "olbox" "orbox"
250 | "crow" "lcrow" "rcrow"
251 | "diamond" "ldiamond" "rdiamond" "odiamond" "oldiamond" "ordiamond"
252 | "dot" "odot"
253 | "inv" "linv" "rinv" "oinv" "olinv" "orinv"
254 | "none"
255 | "normal" "lnormal" "rnormal" "onormal" "olnormal" "ornormal"
256 | "tee" "ltee" "rtee"
257 | "vee" "lvee" "rvee"
258 | "curve" "lcurve" "rcurve" "ocurve" "olcurve" "orcurve")
259 | "The possible values that an attribute of type `arrowType' can have.
260 | See URL 'https://graphviz.org/doc/info/arrows.html.'")
261 |
262 | (defvar graphviz-attributes-type-shape
263 | '("shape")
264 | "The attributes that are of type `shape'.
265 | See URL `https://graphviz.org/docs/attr-types/shape/'.")
266 |
267 | (defvar graphviz-values-type-shape
268 | '("box" "polygon" "ellipse" "oval" "circle" "point" "egg" "triangle" "plaintext"
269 | "plain" "diamond" "trapezium" "parallelogram" "house" "pentagon" "hexagon"
270 | "septagon" "octagon" "doublecircle" "doubleoctagon" "tripleoctagon"
271 | "invtriangle" "invtrapezium" "invhouse" "Mdiamond" "Msquare" "Mcircle" "rect"
272 | "rectangle" "square" "star" "none" "underline" "cylinder" "note" "tab" "folder"
273 | "box3d" "component" "promoter" "cds" "terminator" "utr" "primersite"
274 | "restrictionsite" "fivepoverhang" "threepoverhang" "noverhang" "assembly"
275 | "signature" "insulator" "ribosite" "rnastab" "proteasesite" "proteinstab"
276 | "rpromoter" "rarrow" "larrow" "lpromoter"
277 | "record")
278 | "The possible values that an attribute of type `shape' can have.
279 | See URL `https://graphviz.org/doc/info/shapes.html'.")
280 |
281 | (defvar graphviz-attributes-type-style
282 | '("style")
283 | "The attributes that are of type `style'.
284 | See URL `https://graphviz.org/docs/attrs/style/'.")
285 |
286 | (defvar graphviz-values-type-style
287 | '("dashed" "dotted" "solid" "invis" "bold"
288 | "tapered"
289 | "filled" "striped" "wedged" "diagonals" "rounded"
290 | "filled" "striped" "rounded"
291 | "radial")
292 | "The possible values that an attribute of type `style' can have.
293 | See URL `https://graphviz.org/docs/attr-types/style/'.")
294 |
295 | (defvar graphviz-attributes-type-dir
296 | '("dir")
297 | "The attributes that are of type `dirType'.
298 | See URL `https://graphviz.org/docs/attrs/dir/'.")
299 |
300 | (defvar graphviz-values-type-dir
301 | '("forward" "back" "both" "none")
302 | "The possible values that an attribute of type `dirType' can have.
303 | See URL `https://graphviz.org/docs/attr-types/dirType/'.")
304 |
305 | (defvar graphviz-attributes-type-outputmode
306 | '("outputorder")
307 | "The attributes that are of type `outputMode'.
308 | See URL `https://graphviz.org/docs/attrs/outputorder/'.")
309 |
310 | (defvar graphviz-values-type-outputmode
311 | '("breadthfirst" "nodesfirst" "edgesfirst")
312 | "The possible values that an attribute of type `outputMode' can have.
313 | See URL `https://graphviz.org/docs/attr-types/outputMode/'.")
314 |
315 | (defvar graphviz-attributes-type-packmode
316 | '("packmode")
317 | "The attributes that are of type `packMode'.
318 | See URL `https://graphviz.org/docs/attrs/packmode/'.")
319 |
320 | (defvar graphviz-values-type-packmode
321 | '("node" "clust" "array")
322 | "The possible values that an attribute of type `packMode' can have.
323 | See URL `https://graphviz.org/docs/attr-types/packMode/'.")
324 |
325 | (defvar graphviz-attributes-type-pagedir
326 | '("pagedir")
327 | "The attributes that are of type `pagedir'.
328 | See URL `https://graphviz.org/docs/attrs/pagedir/'.")
329 |
330 | (defvar graphviz-values-type-pagedir
331 | '("BL" "BR" "TL" "TR" "RB" "RT" "LB" "LT")
332 | "The possible values that an attribute of type `pagedir' can have.
333 | See URL `https://graphviz.org/docs/attr-types/pagedir/'.")
334 |
335 | (defvar graphviz-attributes-splines
336 | '("splines")
337 | "The attributes that are `splines'.
338 | See URL `https://graphviz.org/docs/attrs/splines/'.")
339 |
340 | (defvar graphviz-attributes-splines-values
341 | '("true" "false" "none" "line" "spline" "polyline" "ortho" "curved")
342 | "The possible values that an attribute `splines' can have.
343 | See URL `https://graphviz.org/docs/attrs/splines/'.")
344 |
345 | (defvar graphviz-attributes-type-bool
346 | '("beautify" "center" "cluster" "compound" "concentrate" "constraint"
347 | "decorate" "diredgeconstraints" "fixedsize" "forcelabels" "headclip"
348 | "imagescale" "labelfloat" "landscape" "newrank" "nojustify" "normalize"
349 | "notranslate" "oneblock" "overlap" "overlap_shrink" "pack" "pin" "quadtree"
350 | "regular" "remincross" "root" "splines" "tailclip" "truecolor")
351 | "The attributes that are of type `bool'.
352 | Some atributes like `splines' are more specific then bool. So during switching
353 | one type, checking for `bool' must come last.
354 | See URL `https://graphviz.org/docs/attr-types/bool/'.")
355 |
356 | (defvar graphviz-values-type-bool
357 | '("true" "false" "yes" "no" "1" "0")
358 | "The possible values that an attribute of type `bool' can have.")
359 |
360 | (defvar graphviz-attributes-type-portpos
361 | '("headport" "tailport")
362 | "The attributes that are of type `portPos'.
363 | See URL `https://graphviz.org/docs/attr-types/portPos/'.")
364 |
365 | (defvar graphviz-values-type-portpos
366 | '("n" "ne" "e" "se" "s" "sw" "w" "nw" "c" "_")
367 | "The possible values that an attribute of type `portPos' can have.
368 | They can also be used on the edge as a compass point.
369 | See URL `https://graphviz.org/docs/attr-types/portPos/'.")
370 |
371 | (defcustom graphviz-dot-value-keywords
372 | '("true" "false" "normal" "inv" "dot" "invdot" "odot" "invodot"
373 | "none" "tee" "empty" "invempty" "diamond" "odiamond" "box" "obox"
374 | "open" "crow" "halfopen" "local" "global" "none" "forward" "back"
375 | "both" "none" "BL" "BR" "TL" "TR" "RB" "RT" "LB" "LT" ":n" ":ne" ":e"
376 | ":se" ":s" ":sw" ":w" ":nw" "same" "min" "source" "max" "sink" "LR"
377 | "box" "polygon" "ellipse" "circle" "point" "egg" "triangle"
378 | "plaintext" "diamond" "trapezium" "parallelogram" "house" "hexagon"
379 | "octagon" "doublecircle" "doubleoctagon" "tripleoctagon" "invtriangle"
380 | "invtrapezium" "invhouse" "Mdiamond" "Msquare" "Mcircle" "record"
381 | "Mrecord" "dashed" "dotted" "solid" "invis" "bold" "filled"
382 | "diagonals" "rounded" )
383 | "*Keywords for attribute values.
384 | This is used by the auto completion code. The actual completion
385 | tables are built when the mode is loaded, so changes to this are
386 | not immediately visible."
387 | :type '(repeat (string :tag "Keyword"))
388 | :group 'graphviz)
389 |
390 | ;;; Font-locking:
391 | (defvar graphviz-dot-color-keywords
392 | '("aliceblue" "antiquewhite" "antiquewhite1" "antiquewhite2"
393 | "antiquewhite3" "antiquewhite4" "aquamarine" "aquamarine1"
394 | "aquamarine2" "aquamarine3" "aquamarine4" "azure" "azure1"
395 | "azure2" "azure3" "azure4" "beige" "bisque" "bisque1" "bisque2"
396 | "bisque3" "bisque4" "black" "blanchedalmond" "blue" "blue1"
397 | "blue2" "blue3" "blue4" "blueviolet" "brown" "brown1" "brown2"
398 | "brown3" "brown4" "burlywood" "burlywood1" "burlywood2"
399 | "burlywood3" "burlywood4" "cadetblue" "cadetblue1"
400 | "cadetblue2" "cadetblue3" "cadetblue4" "chartreuse"
401 | "chartreuse1" "chartreuse2" "chartreuse3" "chartreuse4"
402 | "chocolate" "chocolate1" "chocolate2" "chocolate3" "chocolate4"
403 | "coral" "coral1" "coral2" "coral3" "coral4" "cornflowerblue"
404 | "cornsilk" "cornsilk1" "cornsilk2" "cornsilk3" "cornsilk4"
405 | "crimson" "cyan" "cyan1" "cyan2" "cyan3" "cyan4" "darkgoldenrod"
406 | "darkgoldenrod1" "darkgoldenrod2" "darkgoldenrod3"
407 | "darkgoldenrod4" "darkgreen" "darkkhaki" "darkolivegreen"
408 | "darkolivegreen1" "darkolivegreen2" "darkolivegreen3"
409 | "darkolivegreen4" "darkorange" "darkorange1" "darkorange2"
410 | "darkorange3" "darkorange4" "darkorchid" "darkorchid1"
411 | "darkorchid2" "darkorchid3" "darkorchid4" "darksalmon"
412 | "darkseagreen" "darkseagreen1" "darkseagreen2"
413 | "darkseagreen3" "darkseagreen4" "darkslateblue"
414 | "darkslategray" "darkslategray1" "darkslategray2"
415 | "darkslategray3" "darkslategray4" "darkslategrey"
416 | "darkturquoise" "darkviolet" "deeppink" "deeppink1"
417 | "deeppink2" "deeppink3" "deeppink4" "deepskyblue"
418 | "deepskyblue1" "deepskyblue2" "deepskyblue3" "deepskyblue4"
419 | "dimgray" "dimgrey" "dodgerblue" "dodgerblue1" "dodgerblue2"
420 | "dodgerblue3" "dodgerblue4" "firebrick" "firebrick1"
421 | "firebrick2" "firebrick3" "firebrick4" "floralwhite"
422 | "forestgreen" "gainsboro" "ghostwhite" "gold" "gold1" "gold2"
423 | "gold3" "gold4" "goldenrod" "goldenrod1" "goldenrod2"
424 | "goldenrod3" "goldenrod4" "gray" "gray0" "gray1" "gray10" "gray100"
425 | "gray11" "gray12" "gray13" "gray14" "gray15" "gray16" "gray17"
426 | "gray18" "gray19" "gray2" "gray20" "gray21" "gray22" "gray23"
427 | "gray24" "gray25" "gray26" "gray27" "gray28" "gray29" "gray3"
428 | "gray30" "gray31" "gray32" "gray33" "gray34" "gray35" "gray36"
429 | "gray37" "gray38" "gray39" "gray4" "gray40" "gray41" "gray42"
430 | "gray43" "gray44" "gray45" "gray46" "gray47" "gray48" "gray49"
431 | "gray5" "gray50" "gray51" "gray52" "gray53" "gray54" "gray55"
432 | "gray56" "gray57" "gray58" "gray59" "gray6" "gray60" "gray61"
433 | "gray62" "gray63" "gray64" "gray65" "gray66" "gray67" "gray68"
434 | "gray69" "gray7" "gray70" "gray71" "gray72" "gray73" "gray74"
435 | "gray75" "gray76" "gray77" "gray78" "gray79" "gray8" "gray80"
436 | "gray81" "gray82" "gray83" "gray84" "gray85" "gray86" "gray87"
437 | "gray88" "gray89" "gray9" "gray90" "gray91" "gray92" "gray93"
438 | "gray94" "gray95" "gray96" "gray97" "gray98" "gray99" "green"
439 | "green1" "green2" "green3" "green4" "greenyellow" "grey" "grey0"
440 | "grey1" "grey10" "grey100" "grey11" "grey12" "grey13" "grey14"
441 | "grey15" "grey16" "grey17" "grey18" "grey19" "grey2" "grey20"
442 | "grey21" "grey22" "grey23" "grey24" "grey25" "grey26" "grey27"
443 | "grey28" "grey29" "grey3" "grey30" "grey31" "grey32" "grey33"
444 | "grey34" "grey35" "grey36" "grey37" "grey38" "grey39" "grey4"
445 | "grey40" "grey41" "grey42" "grey43" "grey44" "grey45" "grey46"
446 | "grey47" "grey48" "grey49" "grey5" "grey50" "grey51" "grey52"
447 | "grey53" "grey54" "grey55" "grey56" "grey57" "grey58" "grey59"
448 | "grey6" "grey60" "grey61" "grey62" "grey63" "grey64" "grey65"
449 | "grey66" "grey67" "grey68" "grey69" "grey7" "grey70" "grey71"
450 | "grey72" "grey73" "grey74" "grey75" "grey76" "grey77" "grey78"
451 | "grey79" "grey8" "grey80" "grey81" "grey82" "grey83" "grey84"
452 | "grey85" "grey86" "grey87" "grey88" "grey89" "grey9" "grey90"
453 | "grey91" "grey92" "grey93" "grey94" "grey95" "grey96" "grey97"
454 | "grey98" "grey99" "honeydew" "honeydew1" "honeydew2" "honeydew3"
455 | "honeydew4" "hotpink" "hotpink1" "hotpink2" "hotpink3" "hotpink4"
456 | "indianred" "indianred1" "indianred2" "indianred3" "indianred4"
457 | "indigo" "ivory" "ivory1" "ivory2" "ivory3" "ivory4" "khaki" "khaki1"
458 | "khaki2" "khaki3" "khaki4" "lavender" "lavenderblush"
459 | "lavenderblush1" "lavenderblush2" "lavenderblush3"
460 | "lavenderblush4" "lawngreen" "lemonchiffon" "lemonchiffon1"
461 | "lemonchiffon2" "lemonchiffon3" "lemonchiffon4" "lightblue"
462 | "lightblue1" "lightblue2" "lightblue3" "lightblue4"
463 | "lightcoral" "lightcyan" "lightcyan1" "lightcyan2" "lightcyan3"
464 | "lightcyan4" "lightgoldenrod" "lightgoldenrod1"
465 | "lightgoldenrod2" "lightgoldenrod3" "lightgoldenrod4"
466 | "lightgoldenrodyellow" "lightgray" "lightgrey" "lightpink"
467 | "lightpink1" "lightpink2" "lightpink3" "lightpink4"
468 | "lightsalmon" "lightsalmon1" "lightsalmon2" "lightsalmon3"
469 | "lightsalmon4" "lightseagreen" "lightskyblue" "lightskyblue1"
470 | "lightskyblue2" "lightskyblue3" "lightskyblue4"
471 | "lightslateblue" "lightslategray" "lightslategrey"
472 | "lightsteelblue" "lightsteelblue1" "lightsteelblue2"
473 | "lightsteelblue3" "lightsteelblue4" "lightyellow"
474 | "lightyellow1" "lightyellow2" "lightyellow3" "lightyellow4"
475 | "limegreen" "linen" "magenta" "magenta1" "magenta2" "magenta3"
476 | "magenta4" "maroon" "maroon1" "maroon2" "maroon3" "maroon4"
477 | "mediumaquamarine" "mediumblue" "mediumorchid"
478 | "mediumorchid1" "mediumorchid2" "mediumorchid3"
479 | "mediumorchid4" "mediumpurple" "mediumpurple1"
480 | "mediumpurple2" "mediumpurple3" "mediumpurple4"
481 | "mediumseagreen" "mediumslateblue" "mediumspringgreen"
482 | "mediumturquoise" "mediumvioletred" "midnightblue"
483 | "mintcream" "mistyrose" "mistyrose1" "mistyrose2" "mistyrose3"
484 | "mistyrose4" "moccasin" "navajowhite" "navajowhite1"
485 | "navajowhite2" "navajowhite3" "navajowhite4" "navy" "navyblue"
486 | "oldlace" "olivedrab" "olivedrap" "olivedrab1" "olivedrab2"
487 | "olivedrap3" "oragne" "palegoldenrod" "palegreen" "palegreen1"
488 | "palegreen2" "palegreen3" "palegreen4" "paleturquoise"
489 | "paleturquoise1" "paleturquoise2" "paleturquoise3"
490 | "paleturquoise4" "palevioletred" "palevioletred1"
491 | "palevioletred2" "palevioletred3" "palevioletred4"
492 | "papayawhip" "peachpuff" "peachpuff1" "peachpuff2"
493 | "peachpuff3" "peachpuff4" "peru" "pink" "pink1" "pink2" "pink3"
494 | "pink4" "plum" "plum1" "plum2" "plum3" "plum4" "powderblue"
495 | "purple" "purple1" "purple2" "purple3" "purple4" "red" "red1" "red2"
496 | "red3" "red4" "rosybrown" "rosybrown1" "rosybrown2" "rosybrown3"
497 | "rosybrown4" "royalblue" "royalblue1" "royalblue2" "royalblue3"
498 | "royalblue4" "saddlebrown" "salmon" "salmon1" "salmon2" "salmon3"
499 | "salmon4" "sandybrown" "seagreen" "seagreen1" "seagreen2"
500 | "seagreen3" "seagreen4" "seashell" "seashell1" "seashell2"
501 | "seashell3" "seashell4" "sienna" "sienna1" "sienna2" "sienna3"
502 | "sienna4" "skyblue" "skyblue1" "skyblue2" "skyblue3" "skyblue4"
503 | "slateblue" "slateblue1" "slateblue2" "slateblue3" "slateblue4"
504 | "slategray" "slategray1" "slategray2" "slategray3" "slategray4"
505 | "slategrey" "snow" "snow1" "snow2" "snow3" "snow4" "springgreen"
506 | "springgreen1" "springgreen2" "springgreen3" "springgreen4"
507 | "steelblue" "steelblue1" "steelblue2" "steelblue3" "steelblue4"
508 | "tan" "tan1" "tan2" "tan3" "tan4" "thistle" "thistle1" "thistle2"
509 | "thistle3" "thistle4" "tomato" "tomato1" "tomato2" "tomato3"
510 | "tomato4" "transparent" "turquoise" "turquoise1" "turquoise2"
511 | "turquoise3" "turquoise4" "violet" "violetred" "violetred1"
512 | "violetred2" "violetred3" "violetred4" "wheat" "wheat1" "wheat2"
513 | "wheat3" "wheat4" "white" "whitesmoke" "yellow" "yellow1" "yellow2"
514 | "yellow3" "yellow4" "yellowgreen")
515 | "Possible color constants in the dot language.
516 | See URL `https://graphviz.org/doc/info/colors.html'")
517 |
518 |
519 | ;;; Key map
520 | (defvar graphviz-dot-mode-map
521 | (let ((map (make-sparse-keymap)))
522 | (define-key map "\C-\M-q" 'graphviz-dot-indent-graph)
523 | (define-key map "\C-c\C-p" 'graphviz-dot-preview)
524 | (define-key map "\C-c\C-c" 'compile)
525 | (define-key map "\C-c\C-v" 'graphviz-dot-view)
526 | map)
527 | "Keymap used in Graphviz Dot mode.")
528 |
529 | ;;; Syntax table
530 | (defvar graphviz-dot-mode-syntax-table
531 | (let ((st (make-syntax-table)))
532 | (modify-syntax-entry ?/ ". 124b" st)
533 | (modify-syntax-entry ?* ". 23" st)
534 | (modify-syntax-entry ?\n "> b" st)
535 | (modify-syntax-entry ?= "." st)
536 | (modify-syntax-entry ?_ "_" st)
537 | (modify-syntax-entry ?- "_" st)
538 | (modify-syntax-entry ?> "." st)
539 | (modify-syntax-entry ?\[ "(]" st)
540 | (modify-syntax-entry ?\] ")[" st)
541 | (modify-syntax-entry ?\" "\"" st)
542 | st)
543 | "Syntax table for `graphviz-dot-mode'.")
544 |
545 | (defvar graphviz-dot-syntax-propertize-function
546 | (syntax-propertize-rules
547 | ("^#" (0 "< b"))))
548 |
549 | (defvar graphviz-dot-font-lock-keywords
550 | `(;; Match ID, first case
551 | ("\\(?:di\\|sub\\)?graph\\(?:[[:space:]]+\\)\\([a-zA-Z_]+[a-zA-Z0-9_]*\\)"
552 | (1 font-lock-function-name-face))
553 | ;; Match ID, second case
554 | ("\\(?:di\\|sub\\)?graph\\(?:[[:space:]]+\\)\\(-?[0-9]*\\(\\.[0-9]*\\)?\\)"
555 | (1 font-lock-function-name-face))
556 | (,(regexp-opt graphviz-dot-value-keywords 'words)
557 | . font-lock-constant-face)
558 | ;; to build the font-locking for the colors,
559 | ;; we need more room for max-specpdl-size,
560 | ;; after that we take the list of symbols,
561 | ;; convert them to a list of strings, and make
562 | ;; an optimized regexp from them
563 | (,(let ((max-specpdl-size (max max-specpdl-size 1200)))
564 | (regexp-opt graphviz-dot-color-keywords 'words))
565 | . font-lock-string-face)
566 | (,(concat
567 | (regexp-opt graphviz-dot-attr-keywords 'words)
568 | "[ \\t\\n]*=")
569 | ;; RR - ugly, really, but I don't know why xemacs does not work
570 | ;; if I change the next car to "1"...
571 | (0 font-lock-variable-name-face))
572 | ;; The 'graph' nonterminal
573 | ("\\(\\_<\\(?:strict\\)?[[:space:]]*\\(?:\\(?:di\\)?graph\\)\\_>\\)"
574 | (1 'font-lock-keyword-face))
575 | ;; The 'attr_stmt'
576 | ("\\_<\\(edge\\|graph\\|node\\)\\_>[[:space:]]*\\["
577 | 1 'font-lock-keyword-face)
578 | ;; The 'subgraph' nonterminal
579 | ("\\_" . 'font-lock-keyword-face))
580 | "Keyword highlighting specification for `graphviz-dot-mode'.
581 | See URL `https://graphviz.org/doc/info/lang.html'.")
582 |
583 | (defun graphviz-output-file-name (f-name)
584 | "Return the filename of the preview, using F-NAME."
585 | (concat (file-name-sans-extension f-name)
586 | "." graphviz-dot-preview-extension))
587 |
588 | (defun graphviz-compile-command (f-name)
589 | "Shell command to compile F-NAME.
590 | By default this is `dot -T png file.dot -o file.png', the used
591 | program to compile can be changed by setting
592 | `graphviz-dot-dot-program', the output format and extension can
593 | be changed with `graphviz-dot-preview-extension'."
594 | (when f-name
595 | (setq compile-command
596 | (concat graphviz-dot-dot-program
597 | " -T" graphviz-dot-preview-extension " "
598 | (shell-quote-argument
599 | (file-name-unquote (file-local-name f-name)))
600 | " -o "
601 | (shell-quote-argument
602 | (file-name-unquote
603 | (file-local-name (graphviz-output-file-name f-name))))))))
604 |
605 | (defun graphviz-dot--syntax-at-point ()
606 | "Return the syntax at point.
607 | This can be one of comment, string, out, value, attribute, color,
608 | arrow, shape, style, dir, outputmode or other."
609 | (let ((state (syntax-ppss)))
610 | (cond
611 | ((nth 4 state) 'comment)
612 | ((nth 3 state) 'string)
613 | ((not (nth 1 state)) 'out)
614 | (t (save-excursion
615 | (skip-chars-backward "^[\\[,;=:\n]")
616 | (backward-char)
617 | (cond
618 | ((looking-at "[\\[,;\n]") 'attribute)
619 | ((looking-at ":") 'compasspoint)
620 | ((looking-at "=")
621 | (progn
622 | (backward-word 1)
623 | (cond
624 | ((looking-at "[a-zA-Z]*color") 'color)
625 | ((member (word-at-point) graphviz-attributes-type-arrow) 'arrow)
626 | ((member (word-at-point) graphviz-attributes-type-shape) 'shape)
627 | ((member (word-at-point) graphviz-attributes-type-style) 'style)
628 | ((member (word-at-point) graphviz-attributes-type-dir) 'dir)
629 | ((member (word-at-point) graphviz-attributes-type-outputmode) 'outputmode)
630 | ((member (word-at-point) graphviz-attributes-type-packmode) 'packmode)
631 | ((member (word-at-point) graphviz-attributes-type-pagedir) 'pagedir)
632 | ((member (word-at-point) graphviz-attributes-type-portpos) 'portpos)
633 | ((member (word-at-point) graphviz-attributes-splines) 'splines)
634 | ((member (word-at-point) graphviz-attributes-type-bool) 'bool)
635 | (t 'value))))
636 | (t 'other)))))))
637 |
638 | (defun graphviz-completion-at-point ()
639 | "Function to use in the hook `completion-at-point-functions'."
640 | (let* ((bounds (bounds-of-thing-at-point 'symbol))
641 | (start (if bounds (car bounds) (point)))
642 | (end (if bounds (cdr bounds) (point)))
643 | (collection
644 | (cl-case (graphviz-dot--syntax-at-point)
645 | (compasspoint graphviz-values-type-portpos)
646 | (color graphviz-dot-color-keywords)
647 | (arrow graphviz-values-type-arrow)
648 | (shape graphviz-values-type-shape)
649 | (style graphviz-values-type-style)
650 | (dir graphviz-values-type-dir)
651 | (outputmode graphviz-values-type-outputmode)
652 | (packmode graphviz-values-type-packmode)
653 | (pagedir graphviz-values-type-pagedir)
654 | (portpos graphviz-values-type-portpos)
655 | (splines graphviz-attributes-splines-values)
656 | (bool graphviz-values-type-bool)
657 | (value graphviz-dot-value-keywords)
658 | ((comment string) nil)
659 | (t graphviz-dot-attr-keywords))))
660 | (list start end collection . nil)))
661 |
662 | (defvar dot-menu nil
663 | "Menu for Graphviz Dot Mode.
664 | This menu will get created automatically if you have the `easymenu'
665 | package.")
666 |
667 | ;;;###autoload
668 | (define-derived-mode graphviz-dot-mode prog-mode "dot"
669 | "Major mode for the dot language.
670 |
671 | Functionallity specific to this mode:
672 |
673 | `indent-for-tab-command' \\[indent-for-tab-command]
674 | Indents a single line.
675 | `graphviz-dot-preview' \\[graphviz-dot-preview]
676 | Previews graph in a buffer.
677 | `graphviz-dot-view' \\[graphviz-dot-view]
678 | Views graph in an external viewer.
679 | `graphviz-dot-indent-line' \\[graphviz-dot-indent-line]
680 | Indents current line of code.
681 |
682 | Variables specific to this mode:
683 |
684 | `graphviz-dot-dot-program' (default `dot')
685 | Program used to compile the graphs.
686 | `graphviz-dot-preview-extension' (default `png')
687 | File type to use for output.
688 | `graphviz-dot-view-command' (default `dotty %s')
689 | Command to run when `graphviz-dot-view' is executed.
690 | `graphviz-dot-view-edit-command' (default nil)
691 | If the user should be asked to edit the view command.
692 | `graphviz-dot-save-before-view' (default t)
693 | Automatically save current buffer berore `graphviz-dot-view'."
694 | :group 'graphviz
695 | (setq-local font-lock-defaults '(graphviz-dot-font-lock-keywords))
696 | (setq-local comment-start "//")
697 | (setq-local comment-start-skip "/\\*+ *\\|//+ *")
698 | (setq-local indent-line-function #'graphviz-dot-indent-line)
699 | (setq-local syntax-propertize-function
700 | graphviz-dot-syntax-propertize-function)
701 | (when (buffer-file-name)
702 | (setq-local compile-command
703 | (graphviz-compile-command (buffer-file-name))))
704 | (add-to-list 'compilation-error-regexp-alist 'dot)
705 | (add-to-list 'compilation-error-regexp-alist-alist
706 | '(dot "^Error: \\(.+\\): .*error in line \\([0-9]+\\).*" 1 2))
707 | (add-hook 'after-save-hook 'graphviz-live-reload-hook)
708 | (add-hook 'completion-at-point-functions
709 | 'graphviz-completion-at-point
710 | nil
711 | 'local)
712 | (run-hooks 'graphviz-dot-mode-hook))
713 |
714 | ;;;; Menu definitions
715 |
716 | (and (condition-case nil
717 | (require 'easymenu)
718 | (error nil))
719 | (easy-menu-define
720 | dot-menu graphviz-dot-mode-map "Graphviz Mode menu"
721 | '("Graphviz"
722 | ["Indent Graph" graphviz-dot-indent-graph t]
723 | ["Comment Out Region" comment-region (mark)]
724 | ["Uncomment Region" uncomment-region (mark)]
725 | "-"
726 | ["Compile" compile t]
727 | ["Preview" graphviz-dot-preview
728 | (and (buffer-file-name)
729 | (not (buffer-modified-p)))]
730 | ["External Viewer" graphviz-dot-view (buffer-file-name)]
731 | "-"
732 | ["Customize..." graphviz-dot-customize t]
733 | )))
734 |
735 | ;;;;
736 | ;;;; Indentation
737 | ;;;;
738 |
739 | (defun graphviz-dot-indent-line ()
740 | "Indent current line of dot code."
741 | (interactive)
742 | (if (bolp)
743 | (graphviz-dot-real-indent-line)
744 | (save-excursion
745 | (graphviz-dot-real-indent-line))))
746 |
747 | (defun graphviz-dot-real-indent-line ()
748 | "Indent current line of dot code."
749 | (beginning-of-line)
750 | (cond
751 | ((bobp)
752 | ;; simple case, indent to 0
753 | (indent-line-to 0))
754 | ((looking-at "^[ \t]*}[ \t]*$")
755 | ;; block closing, deindent relative to previous line
756 | (indent-line-to (save-excursion
757 | (forward-line -1)
758 | (if (looking-at "\\(^.*{[^}]*$\\)")
759 | ;; previous line opened a block
760 | ;; use same indentation
761 | (current-indentation)
762 | (max 0 (- (current-indentation) graphviz-dot-indent-width))))))
763 | ;; other cases need to look at previous lines
764 | (t
765 | (indent-line-to (save-excursion
766 | (forward-line -1)
767 | (while (and (not (bobp))
768 | (looking-back "^[[:space:]]*$" (line-beginning-position)))
769 | (forward-line -1))
770 | (cond
771 | ((looking-at "\\(^.*{[^}]*$\\)")
772 | ;; previous line opened a block
773 | ;; indent to that line
774 | (+ (current-indentation) graphviz-dot-indent-width))
775 | ((and (not (looking-at ".*\\[.*\\].*"))
776 | (looking-at ".*\\[.*")) ; TODO:PP : can be 1 regex
777 | ;; previous line started filling
778 | ;; attributes, intend to that start
779 | (search-forward "[")
780 | (current-column))
781 | ((and (not (looking-at ".*\\[.*\\].*"))
782 | (looking-at ".*\\].*")) ; TODO:PP : "
783 | ;; previous line stopped filling
784 | ;; attributes, find the line that started
785 | ;; filling them and indent to that line
786 | (while (and (not (bobp))
787 | (or (looking-at ".*\\[.*\\].*")
788 | (not (looking-at ".*\\[.*")))) ; TODO:PP : "
789 | (forward-line -1))
790 | (current-indentation))
791 | (t
792 | ;; default case, indent the
793 | ;; same as previous NON-BLANK line
794 | ;; (or the first line, if there are no previous non-blank lines)
795 | (while (and (not (bobp))
796 | (looking-at "^\[ \t\]*$"))
797 | (forward-line -1))
798 | ;; if we find a closing square bracket, don't indent
799 | ;; to the level of its attributes, but instead
800 | ;; find the opening bracket and indent to that
801 | (if (looking-at ".*\\].*")
802 | (while (and (not (bobp))
803 | (not (looking-at ".*\\[.*")))
804 | (forward-line -1)))
805 | (current-indentation)) ))) )))
806 |
807 | (defun graphviz-dot-indent-graph ()
808 | "Indent the graph/digraph/subgraph where point is at.
809 | This will first teach the beginning of the graph were point is at, and
810 | then indent this and each subgraph in it."
811 | (interactive)
812 | (save-excursion
813 | ;; position point at start of graph
814 | (while (not (or (looking-at "\\(^.*{[^}]*$\\)") (bobp)))
815 | (forward-line -1))
816 | ;; bracket { one +; bracket } one -
817 | (let ((bracket-count 0))
818 | (while
819 | (progn
820 | (cond
821 | ;; update bracket-count
822 | ((looking-at "\\(^.*{[^}]*$\\)")
823 | (setq bracket-count (+ bracket-count 1)))
824 | ;; update bracket-count
825 | ((looking-at "^[ \t]*}[ \t]*$")
826 | (setq bracket-count (- bracket-count 1))))
827 | ;; indent this line and move on
828 | (graphviz-dot-indent-line)
829 | (forward-line 1)
830 | ;; as long as we are not completed or at end of buffer
831 | (and (> bracket-count 0) (not (eobp))))))))
832 |
833 | (defconst graphviz-preview-buffer
834 | "*Graphviz Preview: %s*")
835 |
836 | (defconst graphviz-error-buffer
837 | "*Graphviz Errors*")
838 |
839 | (defun graphviz--display-preview-buffer (stdout-buffer)
840 | "Display STDOUT-BUFFER as the dot preview."
841 | (with-current-buffer stdout-buffer
842 | (goto-char (point-min))
843 | (image-mode))
844 | (display-buffer stdout-buffer))
845 |
846 | (defun graphviz--display-stderr-buffer (stderr-buffer input-file)
847 | "Display the compilation buffer when the preview fails.
848 | STDERR-BUFFER is the compilation buffer.
849 | INPUT-FILE is the file we are previewing."
850 | (with-current-buffer stderr-buffer
851 | (let ((inhibit-read-only t))
852 | (goto-char (point-min))
853 | (while (search-forward "" nil t)
854 | (replace-match input-file)))
855 | (compilation-mode))
856 | (display-buffer stderr-buffer)
857 | (with-selected-window (get-buffer-window stderr-buffer)
858 | (goto-char (point-min))))
859 |
860 | ;;;###autoload
861 | (defun graphviz-dot-preview (&optional begin end)
862 | "Compile the graph between BEGIN and END and preview it in an other buffer.
863 | BEGIN (resp. END) is a number defaulting to `point-min' (resp. `point-max')
864 | representing the current buffer's point where the graph definition starts
865 | \(resp. stops)."
866 | (interactive)
867 | (let* ((use-empty-active-region nil)
868 | (graphviz-preview-buffer (format graphviz-preview-buffer
869 | (buffer-name)))
870 | (stdout (get-buffer-create graphviz-preview-buffer))
871 | (stderr (get-buffer-create graphviz-error-buffer))
872 | (begin (or begin
873 | (and (use-region-p) (region-beginning))
874 | (point-min)))
875 | (end (or end
876 | (and (use-region-p) (region-end))
877 | (point-max)))
878 | (process (make-process
879 | :name "graphviz-dot"
880 | :command `(,graphviz-dot-dot-program
881 | ,(format "-T%s" graphviz-dot-preview-extension))
882 | :buffer stdout
883 | :stderr stderr
884 | :sentinel
885 | (lambda (_ event)
886 | (cond
887 | ((string= event "finished\n")
888 | (graphviz--display-preview-buffer stdout))
889 | ((string-prefix-p "exited" event)
890 | (graphviz--display-stderr-buffer stderr
891 | (buffer-name))))))))
892 | (with-current-buffer stdout
893 | (fundamental-mode)
894 | (erase-buffer))
895 | (with-current-buffer stderr
896 | (let ((inhibit-read-only t))
897 | (fundamental-mode)
898 | (erase-buffer)))
899 | (process-send-region process begin end)
900 | (process-send-eof process)))
901 |
902 | ;;;###autoload
903 | (defun graphviz-turn-on-live-preview ()
904 | "Turn on live preview.
905 | This will update the preview on every save."
906 | (interactive)
907 | (setq graphviz-dot-auto-preview-on-save t)
908 | (add-hook 'after-save-hook 'graphviz-live-reload-hook))
909 |
910 | ;;;###autoload
911 | (defun graphviz-turn-off-live-preview ()
912 | "Turn off live preview.
913 | Saving the file will no longer also update the preview."
914 | (interactive)
915 | (setq graphviz-dot-auto-preview-on-save nil)
916 | (remove-hook 'after-save-hook 'graphviz-live-reload-hook))
917 |
918 | (defun graphviz-live-reload-hook ()
919 | "Hook to run in `after-save-hook' for live preview to work."
920 | (when (and (eq major-mode 'graphviz-dot-mode) graphviz-dot-auto-preview-on-save)
921 | (graphviz-dot-preview)))
922 |
923 | ;;;;
924 | ;;;; View
925 | ;;;;
926 | (defun graphviz-dot-view ()
927 | "Run an external viewer.
928 | This creates an external process every time it is executed. If
929 | `graphviz-dot-save-before-view' is set, the current buffer is
930 | saved before the command is executed."
931 | (interactive)
932 | (let ((cmd (if graphviz-dot-view-edit-command
933 | (if (fboundp 'read-shell-command)
934 | (read-shell-command "View command: "
935 | (format graphviz-dot-view-command
936 | (shell-quote-argument (buffer-file-name))))
937 | ;; read-shell-command not available in GNU Emacs 21
938 | (read-from-minibuffer "View command: "
939 | (format graphviz-dot-view-command
940 | (shell-quote-argument (buffer-file-name)))))
941 | (format graphviz-dot-view-command
942 | (shell-quote-argument (buffer-file-name))))))
943 | (if graphviz-dot-save-before-view
944 | (save-buffer))
945 | (start-process-shell-command (downcase mode-name) nil cmd)
946 | (message (format "Executing `%s'..." cmd))))
947 |
948 | (defun graphviz-dot-set-layout ()
949 | "Change the value of `graphviz-dot-dot-program'."
950 | (interactive)
951 | (setq graphviz-dot-dot-program
952 | (completing-read "Layout: " graphviz-dot-layout-programs)))
953 |
954 | ;;;###autoload
955 | (add-to-list 'auto-mode-alist '("\\.dot\\'" . graphviz-dot-mode))
956 | ;;;###autoload
957 | (add-to-list 'auto-mode-alist '("\\.gv\\'" . graphviz-dot-mode))
958 |
959 | ;; Support org-mode, when adding a code block for dot, use this mode
960 | (with-eval-after-load 'org-src
961 | (defvar org-src-lang-modes)
962 | (add-to-list 'org-src-lang-modes '("dot" . graphviz-dot)))
963 |
964 | (provide 'graphviz-dot-mode)
965 | ;;; graphviz-dot-mode.el ends here
966 |
--------------------------------------------------------------------------------
/texinfo/.gitignore:
--------------------------------------------------------------------------------
1 | # Auto-Save Files
2 | \#*
3 | .#*
4 |
5 | # Log Files
6 | *.log
7 |
8 | # Intermediate Files
9 | *.aux
10 | *.cp
11 | *.cps
12 | *.dvi
13 | *.toc
14 | *.vr
15 | *.vrs
16 | *.fn
17 | *.fns
18 | *.ky
19 | *.kys
20 | *.pg
21 | *.pgs
22 | *._texi
23 |
24 | # Output Files
25 | *.xml
26 | *.epub
27 | *.info
28 | *.md
29 | *.ps
30 | *.txt
31 | *.adoc
32 |
--------------------------------------------------------------------------------
/texinfo/Makefile:
--------------------------------------------------------------------------------
1 | BASENAME := graphviz-dot-mode
2 | SOURCE := $(BASENAME).texi
3 | INCLUDE := fdl.texi gpl-2.0.texi gpl.texi
4 |
5 | INFODIR := ~/info
6 |
7 | TEXINFODIR := /usr/local/Cellar/texinfo/6.5/bin
8 | TEXI2ANY := $(TEXINFODIR)/texi2any
9 | TEXI2PDF := $(TEXINFODIR)/texi2pdf
10 | TEXI2DVI := $(TEXINFODIR)/texi2dvi
11 | INSTALLINFO := $(TEXINFODIR)/install-info
12 | SMARTYPANTS := /usr/local/bin/smartypants
13 | PANDOC := /usr/local/bin/pandoc
14 | GZIP := /usr/bin/gzip
15 | INSTALL := /usr/bin/install
16 |
17 | help:
18 | # Options:
19 | # make info
20 | # make install
21 | #
22 | # make html
23 | # make pdf
24 | # make ps
25 | # make txt
26 | # make docbook
27 | # make adoc
28 | # make epub # lacks index
29 | # make md # lacks index
30 | #
31 | # make clean
32 | #
33 | # This Makefile uses TexInfo and Pandoc
34 | # Check the file locations at top of this Makefile.
35 |
36 | info: $(BASENAME).info.gz
37 |
38 | html: $(BASENAME).html
39 |
40 | pdf: $(BASENAME).pdf
41 |
42 | ps: $(BASENAME).ps
43 |
44 | txt: $(BASENAME).txt
45 |
46 | docbook: $(BASENAME).xml
47 |
48 | adoc: $(BASENAME).adoc
49 |
50 | epub: $(BASENAME).epub
51 |
52 | md: $(BASENAME).md
53 |
54 | $(BASENAME).info: ${SOURCE} ${INCLUDE}
55 | $(TEXI2ANY) --info $<
56 |
57 | $(BASENAME).info.gz: $(BASENAME).info
58 | $(GZIP) $<
59 |
60 | install: $(BASENAME).info.gz
61 | $(INSTALL) $< $(INFODIR)
62 | $(INSTALLINFO) $(INFODIR)/$< $(INFODIR)/dir
63 |
64 | $(BASENAME).html: ${SOURCE} ${INCLUDE}
65 | $(TEXI2ANY) --HTML --no-split --no-headers ${SOURCE} | ${SMARTYPANTS}
66 |
67 | $(BASENAME).pdf: ${SOURCE} ${INCLUDE} $(BASENAME).info
68 | $(TEXI2PDF) $<
69 |
70 | $(BASENAME).ps: ${SOURCE} ${INCLUDE} $(BASENAME).info
71 | $(TEXI2DVI) --ps $<
72 |
73 | $(BASENAME).txt: ${SOURCE} ${INCLUDE}
74 | $(TEXI2ANY) --plaintext $< >$@
75 |
76 | # texi2any --docbook handles @Xindex entries poorly. Remove them first.
77 | $(BASENAME).xml: ${SOURCE} ${INCLUDE} $(BASENAME).info
78 | grep -v "^@[cfkptv]index " $< >$(BASENAME)._texi
79 | $(TEXI2ANY) --docbook $(BASENAME)._texi
80 |
81 | $(BASENAME).adoc: $(BASENAME).xml
82 | $(PANDOC) -t asciidoc -o $@ -f docbook $<
83 |
84 | $(BASENAME).epub: $(BASENAME).xml
85 | $(PANDOC) -t epub -o $@ -f docbook $<
86 |
87 | $(BASENAME).md: $(BASENAME).xml
88 | $(PANDOC) -t markdown_strict -o $@ -f docbook $<
89 |
90 | clean:
91 | rm *.aux *.toc *.log || true
92 | rm *.cp *.cps *.vr *.vrs *.fn *.fns *.ky *.kys *.pg *.pgs || true
93 | rm $(BASENAME).dvi $(BASENAME).ps $(BASENAME).adoc || true
94 | rm $(BASENAME).xml $(BASENAME).epub $(BASENAME).md || true
95 | rm $(BASENAME).html $(BASENAME).txt $(BASENAME).pdf || true
96 | rm $(BASENAME).info $(BASENAME).info.gz || true
97 |
98 |
--------------------------------------------------------------------------------
/texinfo/fdl.texi:
--------------------------------------------------------------------------------
1 | @c The GNU Free Documentation License.
2 | @center Version 1.3, 3 November 2008
3 |
4 | @c This file is intended to be included within another document,
5 | @c hence no sectioning command or @node.
6 |
7 | @display
8 | Copyright @copyright{} 2000, 2001, 2002, 2007, 2008 Free Software Foundation, Inc.
9 | @uref{http://fsf.org/}
10 |
11 | Everyone is permitted to copy and distribute verbatim copies
12 | of this license document, but changing it is not allowed.
13 | @end display
14 |
15 | @enumerate 0
16 | @item
17 | PREAMBLE
18 |
19 | The purpose of this License is to make a manual, textbook, or other
20 | functional and useful document @dfn{free} in the sense of freedom: to
21 | assure everyone the effective freedom to copy and redistribute it,
22 | with or without modifying it, either commercially or noncommercially.
23 | Secondarily, this License preserves for the author and publisher a way
24 | to get credit for their work, while not being considered responsible
25 | for modifications made by others.
26 |
27 | This License is a kind of ``copyleft'', which means that derivative
28 | works of the document must themselves be free in the same sense. It
29 | complements the GNU General Public License, which is a copyleft
30 | license designed for free software.
31 |
32 | We have designed this License in order to use it for manuals for free
33 | software, because free software needs free documentation: a free
34 | program should come with manuals providing the same freedoms that the
35 | software does. But this License is not limited to software manuals;
36 | it can be used for any textual work, regardless of subject matter or
37 | whether it is published as a printed book. We recommend this License
38 | principally for works whose purpose is instruction or reference.
39 |
40 | @item
41 | APPLICABILITY AND DEFINITIONS
42 |
43 | This License applies to any manual or other work, in any medium, that
44 | contains a notice placed by the copyright holder saying it can be
45 | distributed under the terms of this License. Such a notice grants a
46 | world-wide, royalty-free license, unlimited in duration, to use that
47 | work under the conditions stated herein. The ``Document'', below,
48 | refers to any such manual or work. Any member of the public is a
49 | licensee, and is addressed as ``you''. You accept the license if you
50 | copy, modify or distribute the work in a way requiring permission
51 | under copyright law.
52 |
53 | A ``Modified Version'' of the Document means any work containing the
54 | Document or a portion of it, either copied verbatim, or with
55 | modifications and/or translated into another language.
56 |
57 | A ``Secondary Section'' is a named appendix or a front-matter section
58 | of the Document that deals exclusively with the relationship of the
59 | publishers or authors of the Document to the Document's overall
60 | subject (or to related matters) and contains nothing that could fall
61 | directly within that overall subject. (Thus, if the Document is in
62 | part a textbook of mathematics, a Secondary Section may not explain
63 | any mathematics.) The relationship could be a matter of historical
64 | connection with the subject or with related matters, or of legal,
65 | commercial, philosophical, ethical or political position regarding
66 | them.
67 |
68 | The ``Invariant Sections'' are certain Secondary Sections whose titles
69 | are designated, as being those of Invariant Sections, in the notice
70 | that says that the Document is released under this License. If a
71 | section does not fit the above definition of Secondary then it is not
72 | allowed to be designated as Invariant. The Document may contain zero
73 | Invariant Sections. If the Document does not identify any Invariant
74 | Sections then there are none.
75 |
76 | The ``Cover Texts'' are certain short passages of text that are listed,
77 | as Front-Cover Texts or Back-Cover Texts, in the notice that says that
78 | the Document is released under this License. A Front-Cover Text may
79 | be at most 5 words, and a Back-Cover Text may be at most 25 words.
80 |
81 | A ``Transparent'' copy of the Document means a machine-readable copy,
82 | represented in a format whose specification is available to the
83 | general public, that is suitable for revising the document
84 | straightforwardly with generic text editors or (for images composed of
85 | pixels) generic paint programs or (for drawings) some widely available
86 | drawing editor, and that is suitable for input to text formatters or
87 | for automatic translation to a variety of formats suitable for input
88 | to text formatters. A copy made in an otherwise Transparent file
89 | format whose markup, or absence of markup, has been arranged to thwart
90 | or discourage subsequent modification by readers is not Transparent.
91 | An image format is not Transparent if used for any substantial amount
92 | of text. A copy that is not ``Transparent'' is called ``Opaque''.
93 |
94 | Examples of suitable formats for Transparent copies include plain
95 | ASCII without markup, Texinfo input format, La@TeX{} input
96 | format, SGML or XML using a publicly available
97 | DTD, and standard-conforming simple HTML,
98 | PostScript or PDF designed for human modification. Examples
99 | of transparent image formats include PNG, XCF and
100 | JPG@. Opaque formats include proprietary formats that can be
101 | read and edited only by proprietary word processors, SGML or
102 | XML for which the DTD and/or processing tools are
103 | not generally available, and the machine-generated HTML,
104 | PostScript or PDF produced by some word processors for
105 | output purposes only.
106 |
107 | The ``Title Page'' means, for a printed book, the title page itself,
108 | plus such following pages as are needed to hold, legibly, the material
109 | this License requires to appear in the title page. For works in
110 | formats which do not have any title page as such, ``Title Page'' means
111 | the text near the most prominent appearance of the work's title,
112 | preceding the beginning of the body of the text.
113 |
114 | The ``publisher'' means any person or entity that distributes copies
115 | of the Document to the public.
116 |
117 | A section ``Entitled XYZ'' means a named subunit of the Document whose
118 | title either is precisely XYZ or contains XYZ in parentheses following
119 | text that translates XYZ in another language. (Here XYZ stands for a
120 | specific section name mentioned below, such as ``Acknowledgements'',
121 | ``Dedications'', ``Endorsements'', or ``History''.) To ``Preserve the Title''
122 | of such a section when you modify the Document means that it remains a
123 | section ``Entitled XYZ'' according to this definition.
124 |
125 | The Document may include Warranty Disclaimers next to the notice which
126 | states that this License applies to the Document. These Warranty
127 | Disclaimers are considered to be included by reference in this
128 | License, but only as regards disclaiming warranties: any other
129 | implication that these Warranty Disclaimers may have is void and has
130 | no effect on the meaning of this License.
131 |
132 | @item
133 | VERBATIM COPYING
134 |
135 | You may copy and distribute the Document in any medium, either
136 | commercially or noncommercially, provided that this License, the
137 | copyright notices, and the license notice saying this License applies
138 | to the Document are reproduced in all copies, and that you add no other
139 | conditions whatsoever to those of this License. You may not use
140 | technical measures to obstruct or control the reading or further
141 | copying of the copies you make or distribute. However, you may accept
142 | compensation in exchange for copies. If you distribute a large enough
143 | number of copies you must also follow the conditions in section 3.
144 |
145 | You may also lend copies, under the same conditions stated above, and
146 | you may publicly display copies.
147 |
148 | @item
149 | COPYING IN QUANTITY
150 |
151 | If you publish printed copies (or copies in media that commonly have
152 | printed covers) of the Document, numbering more than 100, and the
153 | Document's license notice requires Cover Texts, you must enclose the
154 | copies in covers that carry, clearly and legibly, all these Cover
155 | Texts: Front-Cover Texts on the front cover, and Back-Cover Texts on
156 | the back cover. Both covers must also clearly and legibly identify
157 | you as the publisher of these copies. The front cover must present
158 | the full title with all words of the title equally prominent and
159 | visible. You may add other material on the covers in addition.
160 | Copying with changes limited to the covers, as long as they preserve
161 | the title of the Document and satisfy these conditions, can be treated
162 | as verbatim copying in other respects.
163 |
164 | If the required texts for either cover are too voluminous to fit
165 | legibly, you should put the first ones listed (as many as fit
166 | reasonably) on the actual cover, and continue the rest onto adjacent
167 | pages.
168 |
169 | If you publish or distribute Opaque copies of the Document numbering
170 | more than 100, you must either include a machine-readable Transparent
171 | copy along with each Opaque copy, or state in or with each Opaque copy
172 | a computer-network location from which the general network-using
173 | public has access to download using public-standard network protocols
174 | a complete Transparent copy of the Document, free of added material.
175 | If you use the latter option, you must take reasonably prudent steps,
176 | when you begin distribution of Opaque copies in quantity, to ensure
177 | that this Transparent copy will remain thus accessible at the stated
178 | location until at least one year after the last time you distribute an
179 | Opaque copy (directly or through your agents or retailers) of that
180 | edition to the public.
181 |
182 | It is requested, but not required, that you contact the authors of the
183 | Document well before redistributing any large number of copies, to give
184 | them a chance to provide you with an updated version of the Document.
185 |
186 | @item
187 | MODIFICATIONS
188 |
189 | You may copy and distribute a Modified Version of the Document under
190 | the conditions of sections 2 and 3 above, provided that you release
191 | the Modified Version under precisely this License, with the Modified
192 | Version filling the role of the Document, thus licensing distribution
193 | and modification of the Modified Version to whoever possesses a copy
194 | of it. In addition, you must do these things in the Modified Version:
195 |
196 | @enumerate A
197 | @item
198 | Use in the Title Page (and on the covers, if any) a title distinct
199 | from that of the Document, and from those of previous versions
200 | (which should, if there were any, be listed in the History section
201 | of the Document). You may use the same title as a previous version
202 | if the original publisher of that version gives permission.
203 |
204 | @item
205 | List on the Title Page, as authors, one or more persons or entities
206 | responsible for authorship of the modifications in the Modified
207 | Version, together with at least five of the principal authors of the
208 | Document (all of its principal authors, if it has fewer than five),
209 | unless they release you from this requirement.
210 |
211 | @item
212 | State on the Title page the name of the publisher of the
213 | Modified Version, as the publisher.
214 |
215 | @item
216 | Preserve all the copyright notices of the Document.
217 |
218 | @item
219 | Add an appropriate copyright notice for your modifications
220 | adjacent to the other copyright notices.
221 |
222 | @item
223 | Include, immediately after the copyright notices, a license notice
224 | giving the public permission to use the Modified Version under the
225 | terms of this License, in the form shown in the Addendum below.
226 |
227 | @item
228 | Preserve in that license notice the full lists of Invariant Sections
229 | and required Cover Texts given in the Document's license notice.
230 |
231 | @item
232 | Include an unaltered copy of this License.
233 |
234 | @item
235 | Preserve the section Entitled ``History'', Preserve its Title, and add
236 | to it an item stating at least the title, year, new authors, and
237 | publisher of the Modified Version as given on the Title Page. If
238 | there is no section Entitled ``History'' in the Document, create one
239 | stating the title, year, authors, and publisher of the Document as
240 | given on its Title Page, then add an item describing the Modified
241 | Version as stated in the previous sentence.
242 |
243 | @item
244 | Preserve the network location, if any, given in the Document for
245 | public access to a Transparent copy of the Document, and likewise
246 | the network locations given in the Document for previous versions
247 | it was based on. These may be placed in the ``History'' section.
248 | You may omit a network location for a work that was published at
249 | least four years before the Document itself, or if the original
250 | publisher of the version it refers to gives permission.
251 |
252 | @item
253 | For any section Entitled ``Acknowledgements'' or ``Dedications'', Preserve
254 | the Title of the section, and preserve in the section all the
255 | substance and tone of each of the contributor acknowledgements and/or
256 | dedications given therein.
257 |
258 | @item
259 | Preserve all the Invariant Sections of the Document,
260 | unaltered in their text and in their titles. Section numbers
261 | or the equivalent are not considered part of the section titles.
262 |
263 | @item
264 | Delete any section Entitled ``Endorsements''. Such a section
265 | may not be included in the Modified Version.
266 |
267 | @item
268 | Do not retitle any existing section to be Entitled ``Endorsements'' or
269 | to conflict in title with any Invariant Section.
270 |
271 | @item
272 | Preserve any Warranty Disclaimers.
273 | @end enumerate
274 |
275 | If the Modified Version includes new front-matter sections or
276 | appendices that qualify as Secondary Sections and contain no material
277 | copied from the Document, you may at your option designate some or all
278 | of these sections as invariant. To do this, add their titles to the
279 | list of Invariant Sections in the Modified Version's license notice.
280 | These titles must be distinct from any other section titles.
281 |
282 | You may add a section Entitled ``Endorsements'', provided it contains
283 | nothing but endorsements of your Modified Version by various
284 | parties---for example, statements of peer review or that the text has
285 | been approved by an organization as the authoritative definition of a
286 | standard.
287 |
288 | You may add a passage of up to five words as a Front-Cover Text, and a
289 | passage of up to 25 words as a Back-Cover Text, to the end of the list
290 | of Cover Texts in the Modified Version. Only one passage of
291 | Front-Cover Text and one of Back-Cover Text may be added by (or
292 | through arrangements made by) any one entity. If the Document already
293 | includes a cover text for the same cover, previously added by you or
294 | by arrangement made by the same entity you are acting on behalf of,
295 | you may not add another; but you may replace the old one, on explicit
296 | permission from the previous publisher that added the old one.
297 |
298 | The author(s) and publisher(s) of the Document do not by this License
299 | give permission to use their names for publicity for or to assert or
300 | imply endorsement of any Modified Version.
301 |
302 | @item
303 | COMBINING DOCUMENTS
304 |
305 | You may combine the Document with other documents released under this
306 | License, under the terms defined in section 4 above for modified
307 | versions, provided that you include in the combination all of the
308 | Invariant Sections of all of the original documents, unmodified, and
309 | list them all as Invariant Sections of your combined work in its
310 | license notice, and that you preserve all their Warranty Disclaimers.
311 |
312 | The combined work need only contain one copy of this License, and
313 | multiple identical Invariant Sections may be replaced with a single
314 | copy. If there are multiple Invariant Sections with the same name but
315 | different contents, make the title of each such section unique by
316 | adding at the end of it, in parentheses, the name of the original
317 | author or publisher of that section if known, or else a unique number.
318 | Make the same adjustment to the section titles in the list of
319 | Invariant Sections in the license notice of the combined work.
320 |
321 | In the combination, you must combine any sections Entitled ``History''
322 | in the various original documents, forming one section Entitled
323 | ``History''; likewise combine any sections Entitled ``Acknowledgements'',
324 | and any sections Entitled ``Dedications''. You must delete all
325 | sections Entitled ``Endorsements.''
326 |
327 | @item
328 | COLLECTIONS OF DOCUMENTS
329 |
330 | You may make a collection consisting of the Document and other documents
331 | released under this License, and replace the individual copies of this
332 | License in the various documents with a single copy that is included in
333 | the collection, provided that you follow the rules of this License for
334 | verbatim copying of each of the documents in all other respects.
335 |
336 | You may extract a single document from such a collection, and distribute
337 | it individually under this License, provided you insert a copy of this
338 | License into the extracted document, and follow this License in all
339 | other respects regarding verbatim copying of that document.
340 |
341 | @item
342 | AGGREGATION WITH INDEPENDENT WORKS
343 |
344 | A compilation of the Document or its derivatives with other separate
345 | and independent documents or works, in or on a volume of a storage or
346 | distribution medium, is called an ``aggregate'' if the copyright
347 | resulting from the compilation is not used to limit the legal rights
348 | of the compilation's users beyond what the individual works permit.
349 | When the Document is included in an aggregate, this License does not
350 | apply to the other works in the aggregate which are not themselves
351 | derivative works of the Document.
352 |
353 | If the Cover Text requirement of section 3 is applicable to these
354 | copies of the Document, then if the Document is less than one half of
355 | the entire aggregate, the Document's Cover Texts may be placed on
356 | covers that bracket the Document within the aggregate, or the
357 | electronic equivalent of covers if the Document is in electronic form.
358 | Otherwise they must appear on printed covers that bracket the whole
359 | aggregate.
360 |
361 | @item
362 | TRANSLATION
363 |
364 | Translation is considered a kind of modification, so you may
365 | distribute translations of the Document under the terms of section 4.
366 | Replacing Invariant Sections with translations requires special
367 | permission from their copyright holders, but you may include
368 | translations of some or all Invariant Sections in addition to the
369 | original versions of these Invariant Sections. You may include a
370 | translation of this License, and all the license notices in the
371 | Document, and any Warranty Disclaimers, provided that you also include
372 | the original English version of this License and the original versions
373 | of those notices and disclaimers. In case of a disagreement between
374 | the translation and the original version of this License or a notice
375 | or disclaimer, the original version will prevail.
376 |
377 | If a section in the Document is Entitled ``Acknowledgements'',
378 | ``Dedications'', or ``History'', the requirement (section 4) to Preserve
379 | its Title (section 1) will typically require changing the actual
380 | title.
381 |
382 | @item
383 | TERMINATION
384 |
385 | You may not copy, modify, sublicense, or distribute the Document
386 | except as expressly provided under this License. Any attempt
387 | otherwise to copy, modify, sublicense, or distribute it is void, and
388 | will automatically terminate your rights under this License.
389 |
390 | However, if you cease all violation of this License, then your license
391 | from a particular copyright holder is reinstated (a) provisionally,
392 | unless and until the copyright holder explicitly and finally
393 | terminates your license, and (b) permanently, if the copyright holder
394 | fails to notify you of the violation by some reasonable means prior to
395 | 60 days after the cessation.
396 |
397 | Moreover, your license from a particular copyright holder is
398 | reinstated permanently if the copyright holder notifies you of the
399 | violation by some reasonable means, this is the first time you have
400 | received notice of violation of this License (for any work) from that
401 | copyright holder, and you cure the violation prior to 30 days after
402 | your receipt of the notice.
403 |
404 | Termination of your rights under this section does not terminate the
405 | licenses of parties who have received copies or rights from you under
406 | this License. If your rights have been terminated and not permanently
407 | reinstated, receipt of a copy of some or all of the same material does
408 | not give you any rights to use it.
409 |
410 | @item
411 | FUTURE REVISIONS OF THIS LICENSE
412 |
413 | The Free Software Foundation may publish new, revised versions
414 | of the GNU Free Documentation License from time to time. Such new
415 | versions will be similar in spirit to the present version, but may
416 | differ in detail to address new problems or concerns. See
417 | @uref{http://www.gnu.org/copyleft/}.
418 |
419 | Each version of the License is given a distinguishing version number.
420 | If the Document specifies that a particular numbered version of this
421 | License ``or any later version'' applies to it, you have the option of
422 | following the terms and conditions either of that specified version or
423 | of any later version that has been published (not as a draft) by the
424 | Free Software Foundation. If the Document does not specify a version
425 | number of this License, you may choose any version ever published (not
426 | as a draft) by the Free Software Foundation. If the Document
427 | specifies that a proxy can decide which future versions of this
428 | License can be used, that proxy's public statement of acceptance of a
429 | version permanently authorizes you to choose that version for the
430 | Document.
431 |
432 | @item
433 | RELICENSING
434 |
435 | ``Massive Multiauthor Collaboration Site'' (or ``MMC Site'') means any
436 | World Wide Web server that publishes copyrightable works and also
437 | provides prominent facilities for anybody to edit those works. A
438 | public wiki that anybody can edit is an example of such a server. A
439 | ``Massive Multiauthor Collaboration'' (or ``MMC'') contained in the
440 | site means any set of copyrightable works thus published on the MMC
441 | site.
442 |
443 | ``CC-BY-SA'' means the Creative Commons Attribution-Share Alike 3.0
444 | license published by Creative Commons Corporation, a not-for-profit
445 | corporation with a principal place of business in San Francisco,
446 | California, as well as future copyleft versions of that license
447 | published by that same organization.
448 |
449 | ``Incorporate'' means to publish or republish a Document, in whole or
450 | in part, as part of another Document.
451 |
452 | An MMC is ``eligible for relicensing'' if it is licensed under this
453 | License, and if all works that were first published under this License
454 | somewhere other than this MMC, and subsequently incorporated in whole
455 | or in part into the MMC, (1) had no cover texts or invariant sections,
456 | and (2) were thus incorporated prior to November 1, 2008.
457 |
458 | The operator of an MMC Site may republish an MMC contained in the site
459 | under CC-BY-SA on the same site at any time before August 1, 2009,
460 | provided the MMC is eligible for relicensing.
461 |
462 | @end enumerate
463 |
464 | @page
465 | @heading ADDENDUM: How to use this License for your documents
466 |
467 | To use this License in a document you have written, include a copy of
468 | the License in the document and put the following copyright and
469 | license notices just after the title page:
470 |
471 | @smallexample
472 | @group
473 | Copyright (C) @var{year} @var{your name}.
474 | Permission is granted to copy, distribute and/or modify this document
475 | under the terms of the GNU Free Documentation License, Version 1.3
476 | or any later version published by the Free Software Foundation;
477 | with no Invariant Sections, no Front-Cover Texts, and no Back-Cover
478 | Texts. A copy of the license is included in the section entitled ``GNU
479 | Free Documentation License''.
480 | @end group
481 | @end smallexample
482 |
483 | If you have Invariant Sections, Front-Cover Texts and Back-Cover Texts,
484 | replace the ``with@dots{}Texts.''@: line with this:
485 |
486 | @smallexample
487 | @group
488 | with the Invariant Sections being @var{list their titles}, with
489 | the Front-Cover Texts being @var{list}, and with the Back-Cover Texts
490 | being @var{list}.
491 | @end group
492 | @end smallexample
493 |
494 | If you have Invariant Sections without Cover Texts, or some other
495 | combination of the three, merge those two alternatives to suit the
496 | situation.
497 |
498 | If your document contains nontrivial examples of program code, we
499 | recommend releasing these examples in parallel under your choice of
500 | free software license, such as the GNU General Public License,
501 | to permit their use in free software.
502 |
503 | @c Local Variables:
504 | @c ispell-local-pdict: "ispell-dict"
505 | @c End:
506 |
--------------------------------------------------------------------------------
/texinfo/gpl-2.0.texi:
--------------------------------------------------------------------------------
1 | @c The GNU General Public License.
2 | @center Version 2, June 1991
3 |
4 | @c This file is intended to be included within another document,
5 | @c hence no sectioning command or @node.
6 |
7 | @display
8 | Copyright @copyright{} 1989, 1991 Free Software Foundation, Inc.
9 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
10 |
11 | Everyone is permitted to copy and distribute verbatim copies
12 | of this license document, but changing it is not allowed.
13 | @end display
14 |
15 | @heading Preamble
16 |
17 | The licenses for most software are designed to take away your
18 | freedom to share and change it. By contrast, the GNU General Public
19 | License is intended to guarantee your freedom to share and change free
20 | software---to make sure the software is free for all its users. This
21 | General Public License applies to most of the Free Software
22 | Foundation's software and to any other program whose authors commit to
23 | using it. (Some other Free Software Foundation software is covered by
24 | the GNU Lesser General Public License instead.) You can apply it to
25 | your programs, too.
26 |
27 | When we speak of free software, we are referring to freedom, not
28 | price. Our General Public Licenses are designed to make sure that you
29 | have the freedom to distribute copies of free software (and charge for
30 | this service if you wish), that you receive source code or can get it
31 | if you want it, that you can change the software or use pieces of it
32 | in new free programs; and that you know you can do these things.
33 |
34 | To protect your rights, we need to make restrictions that forbid
35 | anyone to deny you these rights or to ask you to surrender the rights.
36 | These restrictions translate to certain responsibilities for you if you
37 | distribute copies of the software, or if you modify it.
38 |
39 | For example, if you distribute copies of such a program, whether
40 | gratis or for a fee, you must give the recipients all the rights that
41 | you have. You must make sure that they, too, receive or can get the
42 | source code. And you must show them these terms so they know their
43 | rights.
44 |
45 | We protect your rights with two steps: (1) copyright the software, and
46 | (2) offer you this license which gives you legal permission to copy,
47 | distribute and/or modify the software.
48 |
49 | Also, for each author's protection and ours, we want to make certain
50 | that everyone understands that there is no warranty for this free
51 | software. If the software is modified by someone else and passed on, we
52 | want its recipients to know that what they have is not the original, so
53 | that any problems introduced by others will not reflect on the original
54 | authors' reputations.
55 |
56 | Finally, any free program is threatened constantly by software
57 | patents. We wish to avoid the danger that redistributors of a free
58 | program will individually obtain patent licenses, in effect making the
59 | program proprietary. To prevent this, we have made it clear that any
60 | patent must be licensed for everyone's free use or not licensed at all.
61 |
62 | The precise terms and conditions for copying, distribution and
63 | modification follow.
64 |
65 | @heading TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
66 |
67 | @enumerate 0
68 | @item
69 | This License applies to any program or other work which contains
70 | a notice placed by the copyright holder saying it may be distributed
71 | under the terms of this General Public License. The ``Program'', below,
72 | refers to any such program or work, and a ``work based on the Program''
73 | means either the Program or any derivative work under copyright law:
74 | that is to say, a work containing the Program or a portion of it,
75 | either verbatim or with modifications and/or translated into another
76 | language. (Hereinafter, translation is included without limitation in
77 | the term ``modification''.) Each licensee is addressed as ``you''.
78 |
79 | Activities other than copying, distribution and modification are not
80 | covered by this License; they are outside its scope. The act of
81 | running the Program is not restricted, and the output from the Program
82 | is covered only if its contents constitute a work based on the
83 | Program (independent of having been made by running the Program).
84 | Whether that is true depends on what the Program does.
85 |
86 | @item
87 | You may copy and distribute verbatim copies of the Program's
88 | source code as you receive it, in any medium, provided that you
89 | conspicuously and appropriately publish on each copy an appropriate
90 | copyright notice and disclaimer of warranty; keep intact all the
91 | notices that refer to this License and to the absence of any warranty;
92 | and give any other recipients of the Program a copy of this License
93 | along with the Program.
94 |
95 | You may charge a fee for the physical act of transferring a copy, and
96 | you may at your option offer warranty protection in exchange for a fee.
97 |
98 | @item
99 | You may modify your copy or copies of the Program or any portion
100 | of it, thus forming a work based on the Program, and copy and
101 | distribute such modifications or work under the terms of Section 1
102 | above, provided that you also meet all of these conditions:
103 |
104 | @enumerate a
105 | @item
106 | You must cause the modified files to carry prominent notices
107 | stating that you changed the files and the date of any change.
108 |
109 | @item
110 | You must cause any work that you distribute or publish, that in
111 | whole or in part contains or is derived from the Program or any
112 | part thereof, to be licensed as a whole at no charge to all third
113 | parties under the terms of this License.
114 |
115 | @item
116 | If the modified program normally reads commands interactively
117 | when run, you must cause it, when started running for such
118 | interactive use in the most ordinary way, to print or display an
119 | announcement including an appropriate copyright notice and a
120 | notice that there is no warranty (or else, saying that you provide
121 | a warranty) and that users may redistribute the program under
122 | these conditions, and telling the user how to view a copy of this
123 | License. (Exception: if the Program itself is interactive but
124 | does not normally print such an announcement, your work based on
125 | the Program is not required to print an announcement.)
126 | @end enumerate
127 |
128 | These requirements apply to the modified work as a whole. If
129 | identifiable sections of that work are not derived from the Program,
130 | and can be reasonably considered independent and separate works in
131 | themselves, then this License, and its terms, do not apply to those
132 | sections when you distribute them as separate works. But when you
133 | distribute the same sections as part of a whole which is a work based
134 | on the Program, the distribution of the whole must be on the terms of
135 | this License, whose permissions for other licensees extend to the
136 | entire whole, and thus to each and every part regardless of who wrote it.
137 |
138 | Thus, it is not the intent of this section to claim rights or contest
139 | your rights to work written entirely by you; rather, the intent is to
140 | exercise the right to control the distribution of derivative or
141 | collective works based on the Program.
142 |
143 | In addition, mere aggregation of another work not based on the Program
144 | with the Program (or with a work based on the Program) on a volume of
145 | a storage or distribution medium does not bring the other work under
146 | the scope of this License.
147 |
148 | @item
149 | You may copy and distribute the Program (or a work based on it,
150 | under Section 2) in object code or executable form under the terms of
151 | Sections 1 and 2 above provided that you also do one of the following:
152 |
153 | @enumerate a
154 | @item
155 | Accompany it with the complete corresponding machine-readable
156 | source code, which must be distributed under the terms of Sections
157 | 1 and 2 above on a medium customarily used for software interchange; or,
158 |
159 | @item
160 | Accompany it with a written offer, valid for at least three
161 | years, to give any third party, for a charge no more than your
162 | cost of physically performing source distribution, a complete
163 | machine-readable copy of the corresponding source code, to be
164 | distributed under the terms of Sections 1 and 2 above on a medium
165 | customarily used for software interchange; or,
166 |
167 | @item
168 | Accompany it with the information you received as to the offer
169 | to distribute corresponding source code. (This alternative is
170 | allowed only for noncommercial distribution and only if you
171 | received the program in object code or executable form with such
172 | an offer, in accord with Subsection b above.)
173 | @end enumerate
174 |
175 | The source code for a work means the preferred form of the work for
176 | making modifications to it. For an executable work, complete source
177 | code means all the source code for all modules it contains, plus any
178 | associated interface definition files, plus the scripts used to
179 | control compilation and installation of the executable. However, as a
180 | special exception, the source code distributed need not include
181 | anything that is normally distributed (in either source or binary
182 | form) with the major components (compiler, kernel, and so on) of the
183 | operating system on which the executable runs, unless that component
184 | itself accompanies the executable.
185 |
186 | If distribution of executable or object code is made by offering
187 | access to copy from a designated place, then offering equivalent
188 | access to copy the source code from the same place counts as
189 | distribution of the source code, even though third parties are not
190 | compelled to copy the source along with the object code.
191 |
192 | @item
193 | You may not copy, modify, sublicense, or distribute the Program
194 | except as expressly provided under this License. Any attempt
195 | otherwise to copy, modify, sublicense or distribute the Program is
196 | void, and will automatically terminate your rights under this License.
197 | However, parties who have received copies, or rights, from you under
198 | this License will not have their licenses terminated so long as such
199 | parties remain in full compliance.
200 |
201 | @item
202 | You are not required to accept this License, since you have not
203 | signed it. However, nothing else grants you permission to modify or
204 | distribute the Program or its derivative works. These actions are
205 | prohibited by law if you do not accept this License. Therefore, by
206 | modifying or distributing the Program (or any work based on the
207 | Program), you indicate your acceptance of this License to do so, and
208 | all its terms and conditions for copying, distributing or modifying
209 | the Program or works based on it.
210 |
211 | @item
212 | Each time you redistribute the Program (or any work based on the
213 | Program), the recipient automatically receives a license from the
214 | original licensor to copy, distribute or modify the Program subject to
215 | these terms and conditions. You may not impose any further
216 | restrictions on the recipients' exercise of the rights granted herein.
217 | You are not responsible for enforcing compliance by third parties to
218 | this License.
219 |
220 | @item
221 | If, as a consequence of a court judgment or allegation of patent
222 | infringement or for any other reason (not limited to patent issues),
223 | conditions are imposed on you (whether by court order, agreement or
224 | otherwise) that contradict the conditions of this License, they do not
225 | excuse you from the conditions of this License. If you cannot
226 | distribute so as to satisfy simultaneously your obligations under this
227 | License and any other pertinent obligations, then as a consequence you
228 | may not distribute the Program at all. For example, if a patent
229 | license would not permit royalty-free redistribution of the Program by
230 | all those who receive copies directly or indirectly through you, then
231 | the only way you could satisfy both it and this License would be to
232 | refrain entirely from distribution of the Program.
233 |
234 | If any portion of this section is held invalid or unenforceable under
235 | any particular circumstance, the balance of the section is intended to
236 | apply and the section as a whole is intended to apply in other
237 | circumstances.
238 |
239 | It is not the purpose of this section to induce you to infringe any
240 | patents or other property right claims or to contest validity of any
241 | such claims; this section has the sole purpose of protecting the
242 | integrity of the free software distribution system, which is
243 | implemented by public license practices. Many people have made
244 | generous contributions to the wide range of software distributed
245 | through that system in reliance on consistent application of that
246 | system; it is up to the author/donor to decide if he or she is willing
247 | to distribute software through any other system and a licensee cannot
248 | impose that choice.
249 |
250 | This section is intended to make thoroughly clear what is believed to
251 | be a consequence of the rest of this License.
252 |
253 | @item
254 | If the distribution and/or use of the Program is restricted in
255 | certain countries either by patents or by copyrighted interfaces, the
256 | original copyright holder who places the Program under this License
257 | may add an explicit geographical distribution limitation excluding
258 | those countries, so that distribution is permitted only in or among
259 | countries not thus excluded. In such case, this License incorporates
260 | the limitation as if written in the body of this License.
261 |
262 | @item
263 | The Free Software Foundation may publish revised and/or new versions
264 | of the General Public License from time to time. Such new versions will
265 | be similar in spirit to the present version, but may differ in detail to
266 | address new problems or concerns.
267 |
268 | Each version is given a distinguishing version number. If the Program
269 | specifies a version number of this License which applies to it and ``any
270 | later version'', you have the option of following the terms and conditions
271 | either of that version or of any later version published by the Free
272 | Software Foundation. If the Program does not specify a version number of
273 | this License, you may choose any version ever published by the Free Software
274 | Foundation.
275 |
276 | @item
277 | If you wish to incorporate parts of the Program into other free
278 | programs whose distribution conditions are different, write to the author
279 | to ask for permission. For software which is copyrighted by the Free
280 | Software Foundation, write to the Free Software Foundation; we sometimes
281 | make exceptions for this. Our decision will be guided by the two goals
282 | of preserving the free status of all derivatives of our free software and
283 | of promoting the sharing and reuse of software generally.
284 |
285 | @iftex
286 | @heading NO WARRANTY
287 | @end iftex
288 | @ifinfo
289 | @center NO WARRANTY
290 |
291 | @end ifinfo
292 |
293 | @item
294 | BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
295 | FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
296 | OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
297 | PROVIDE THE PROGRAM ``AS IS'' WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
298 | OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
299 | MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
300 | TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
301 | PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
302 | REPAIR OR CORRECTION.
303 |
304 | @item
305 | IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
306 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
307 | REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
308 | INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
309 | OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
310 | TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
311 | YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
312 | PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
313 | POSSIBILITY OF SUCH DAMAGES.
314 | @end enumerate
315 |
316 | @iftex
317 | @heading END OF TERMS AND CONDITIONS
318 | @end iftex
319 | @ifinfo
320 | @center END OF TERMS AND CONDITIONS
321 |
322 | @end ifinfo
323 |
324 | @page
325 | @heading Appendix: How to Apply These Terms to Your New Programs
326 |
327 | If you develop a new program, and you want it to be of the greatest
328 | possible use to the public, the best way to achieve this is to make it
329 | free software which everyone can redistribute and change under these terms.
330 |
331 | To do so, attach the following notices to the program. It is safest
332 | to attach them to the start of each source file to most effectively
333 | convey the exclusion of warranty; and each file should have at least
334 | the ``copyright'' line and a pointer to where the full notice is found.
335 |
336 | @smallexample
337 | @var{one line to give the program's name and a brief idea of what it does.}
338 | Copyright (C) @var{yyyy} @var{name of author}
339 |
340 | This program is free software; you can redistribute it and/or modify
341 | it under the terms of the GNU General Public License as published by
342 | the Free Software Foundation; either version 2 of the License, or
343 | (at your option) any later version.
344 |
345 | This program is distributed in the hope that it will be useful,
346 | but WITHOUT ANY WARRANTY; without even the implied warranty of
347 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
348 | GNU General Public License for more details.
349 |
350 | You should have received a copy of the GNU General Public License
351 | along with this program; if not, write to the Free Software
352 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
353 | @end smallexample
354 |
355 | Also add information on how to contact you by electronic and paper mail.
356 |
357 | If the program is interactive, make it output a short notice like this
358 | when it starts in an interactive mode:
359 |
360 | @smallexample
361 | Gnomovision version 69, Copyright (C) @var{year} @var{name of author}
362 | Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
363 | This is free software, and you are welcome to redistribute it
364 | under certain conditions; type `show c' for details.
365 | @end smallexample
366 |
367 | The hypothetical commands @samp{show w} and @samp{show c} should show
368 | the appropriate parts of the General Public License. Of course, the
369 | commands you use may be called something other than @samp{show w} and
370 | @samp{show c}; they could even be mouse-clicks or menu items---whatever
371 | suits your program.
372 |
373 | You should also get your employer (if you work as a programmer) or your
374 | school, if any, to sign a ``copyright disclaimer'' for the program, if
375 | necessary. Here is a sample; alter the names:
376 |
377 | @example
378 | Yoyodyne, Inc., hereby disclaims all copyright interest in the program
379 | `Gnomovision' (which makes passes at compilers) written by James Hacker.
380 |
381 | @var{signature of Ty Coon}, 1 April 1989
382 | Ty Coon, President of Vice
383 | @end example
384 |
385 | This General Public License does not permit incorporating your program into
386 | proprietary programs. If your program is a subroutine library, you may
387 | consider it more useful to permit linking proprietary applications with the
388 | library. If this is what you want to do, use the GNU Lesser General
389 | Public License instead of this License.
390 |
--------------------------------------------------------------------------------
/texinfo/gpl.texi:
--------------------------------------------------------------------------------
1 | @c The GNU General Public License.
2 | @center Version 3, 29 June 2007
3 |
4 | @c This file is intended to be included within another document,
5 | @c hence no sectioning command or @node.
6 |
7 | @display
8 | Copyright @copyright{} 2007 Free Software Foundation, Inc. @url{http://fsf.org/}
9 |
10 | Everyone is permitted to copy and distribute verbatim copies of this
11 | license document, but changing it is not allowed.
12 | @end display
13 |
14 | @heading Preamble
15 |
16 | The GNU General Public License is a free, copyleft license for
17 | software and other kinds of works.
18 |
19 | The licenses for most software and other practical works are designed
20 | to take away your freedom to share and change the works. By contrast,
21 | the GNU General Public License is intended to guarantee your freedom
22 | to share and change all versions of a program---to make sure it remains
23 | free software for all its users. We, the Free Software Foundation,
24 | use the GNU General Public License for most of our software; it
25 | applies also to any other work released this way by its authors. You
26 | can apply it to your programs, too.
27 |
28 | When we speak of free software, we are referring to freedom, not
29 | price. Our General Public Licenses are designed to make sure that you
30 | have the freedom to distribute copies of free software (and charge for
31 | them if you wish), that you receive source code or can get it if you
32 | want it, that you can change the software or use pieces of it in new
33 | free programs, and that you know you can do these things.
34 |
35 | To protect your rights, we need to prevent others from denying you
36 | these rights or asking you to surrender the rights. Therefore, you
37 | have certain responsibilities if you distribute copies of the
38 | software, or if you modify it: responsibilities to respect the freedom
39 | of others.
40 |
41 | For example, if you distribute copies of such a program, whether
42 | gratis or for a fee, you must pass on to the recipients the same
43 | freedoms that you received. You must make sure that they, too,
44 | receive or can get the source code. And you must show them these
45 | terms so they know their rights.
46 |
47 | Developers that use the GNU GPL protect your rights with two steps:
48 | (1) assert copyright on the software, and (2) offer you this License
49 | giving you legal permission to copy, distribute and/or modify it.
50 |
51 | For the developers' and authors' protection, the GPL clearly explains
52 | that there is no warranty for this free software. For both users' and
53 | authors' sake, the GPL requires that modified versions be marked as
54 | changed, so that their problems will not be attributed erroneously to
55 | authors of previous versions.
56 |
57 | Some devices are designed to deny users access to install or run
58 | modified versions of the software inside them, although the
59 | manufacturer can do so. This is fundamentally incompatible with the
60 | aim of protecting users' freedom to change the software. The
61 | systematic pattern of such abuse occurs in the area of products for
62 | individuals to use, which is precisely where it is most unacceptable.
63 | Therefore, we have designed this version of the GPL to prohibit the
64 | practice for those products. If such problems arise substantially in
65 | other domains, we stand ready to extend this provision to those
66 | domains in future versions of the GPL, as needed to protect the
67 | freedom of users.
68 |
69 | Finally, every program is threatened constantly by software patents.
70 | States should not allow patents to restrict development and use of
71 | software on general-purpose computers, but in those that do, we wish
72 | to avoid the special danger that patents applied to a free program
73 | could make it effectively proprietary. To prevent this, the GPL
74 | assures that patents cannot be used to render the program non-free.
75 |
76 | The precise terms and conditions for copying, distribution and
77 | modification follow.
78 |
79 | @heading TERMS AND CONDITIONS
80 |
81 | @enumerate 0
82 | @item Definitions.
83 |
84 | ``This License'' refers to version 3 of the GNU General Public License.
85 |
86 | ``Copyright'' also means copyright-like laws that apply to other kinds
87 | of works, such as semiconductor masks.
88 |
89 | ``The Program'' refers to any copyrightable work licensed under this
90 | License. Each licensee is addressed as ``you''. ``Licensees'' and
91 | ``recipients'' may be individuals or organizations.
92 |
93 | To ``modify'' a work means to copy from or adapt all or part of the work
94 | in a fashion requiring copyright permission, other than the making of
95 | an exact copy. The resulting work is called a ``modified version'' of
96 | the earlier work or a work ``based on'' the earlier work.
97 |
98 | A ``covered work'' means either the unmodified Program or a work based
99 | on the Program.
100 |
101 | To ``propagate'' a work means to do anything with it that, without
102 | permission, would make you directly or secondarily liable for
103 | infringement under applicable copyright law, except executing it on a
104 | computer or modifying a private copy. Propagation includes copying,
105 | distribution (with or without modification), making available to the
106 | public, and in some countries other activities as well.
107 |
108 | To ``convey'' a work means any kind of propagation that enables other
109 | parties to make or receive copies. Mere interaction with a user
110 | through a computer network, with no transfer of a copy, is not
111 | conveying.
112 |
113 | An interactive user interface displays ``Appropriate Legal Notices'' to
114 | the extent that it includes a convenient and prominently visible
115 | feature that (1) displays an appropriate copyright notice, and (2)
116 | tells the user that there is no warranty for the work (except to the
117 | extent that warranties are provided), that licensees may convey the
118 | work under this License, and how to view a copy of this License. If
119 | the interface presents a list of user commands or options, such as a
120 | menu, a prominent item in the list meets this criterion.
121 |
122 | @item Source Code.
123 |
124 | The ``source code'' for a work means the preferred form of the work for
125 | making modifications to it. ``Object code'' means any non-source form
126 | of a work.
127 |
128 | A ``Standard Interface'' means an interface that either is an official
129 | standard defined by a recognized standards body, or, in the case of
130 | interfaces specified for a particular programming language, one that
131 | is widely used among developers working in that language.
132 |
133 | The ``System Libraries'' of an executable work include anything, other
134 | than the work as a whole, that (a) is included in the normal form of
135 | packaging a Major Component, but which is not part of that Major
136 | Component, and (b) serves only to enable use of the work with that
137 | Major Component, or to implement a Standard Interface for which an
138 | implementation is available to the public in source code form. A
139 | ``Major Component'', in this context, means a major essential component
140 | (kernel, window system, and so on) of the specific operating system
141 | (if any) on which the executable work runs, or a compiler used to
142 | produce the work, or an object code interpreter used to run it.
143 |
144 | The ``Corresponding Source'' for a work in object code form means all
145 | the source code needed to generate, install, and (for an executable
146 | work) run the object code and to modify the work, including scripts to
147 | control those activities. However, it does not include the work's
148 | System Libraries, or general-purpose tools or generally available free
149 | programs which are used unmodified in performing those activities but
150 | which are not part of the work. For example, Corresponding Source
151 | includes interface definition files associated with source files for
152 | the work, and the source code for shared libraries and dynamically
153 | linked subprograms that the work is specifically designed to require,
154 | such as by intimate data communication or control flow between those
155 | subprograms and other parts of the work.
156 |
157 | The Corresponding Source need not include anything that users can
158 | regenerate automatically from other parts of the Corresponding Source.
159 |
160 | The Corresponding Source for a work in source code form is that same
161 | work.
162 |
163 | @item Basic Permissions.
164 |
165 | All rights granted under this License are granted for the term of
166 | copyright on the Program, and are irrevocable provided the stated
167 | conditions are met. This License explicitly affirms your unlimited
168 | permission to run the unmodified Program. The output from running a
169 | covered work is covered by this License only if the output, given its
170 | content, constitutes a covered work. This License acknowledges your
171 | rights of fair use or other equivalent, as provided by copyright law.
172 |
173 | You may make, run and propagate covered works that you do not convey,
174 | without conditions so long as your license otherwise remains in force.
175 | You may convey covered works to others for the sole purpose of having
176 | them make modifications exclusively for you, or provide you with
177 | facilities for running those works, provided that you comply with the
178 | terms of this License in conveying all material for which you do not
179 | control copyright. Those thus making or running the covered works for
180 | you must do so exclusively on your behalf, under your direction and
181 | control, on terms that prohibit them from making any copies of your
182 | copyrighted material outside their relationship with you.
183 |
184 | Conveying under any other circumstances is permitted solely under the
185 | conditions stated below. Sublicensing is not allowed; section 10
186 | makes it unnecessary.
187 |
188 | @item Protecting Users' Legal Rights From Anti-Circumvention Law.
189 |
190 | No covered work shall be deemed part of an effective technological
191 | measure under any applicable law fulfilling obligations under article
192 | 11 of the WIPO copyright treaty adopted on 20 December 1996, or
193 | similar laws prohibiting or restricting circumvention of such
194 | measures.
195 |
196 | When you convey a covered work, you waive any legal power to forbid
197 | circumvention of technological measures to the extent such
198 | circumvention is effected by exercising rights under this License with
199 | respect to the covered work, and you disclaim any intention to limit
200 | operation or modification of the work as a means of enforcing, against
201 | the work's users, your or third parties' legal rights to forbid
202 | circumvention of technological measures.
203 |
204 | @item Conveying Verbatim Copies.
205 |
206 | You may convey verbatim copies of the Program's source code as you
207 | receive it, in any medium, provided that you conspicuously and
208 | appropriately publish on each copy an appropriate copyright notice;
209 | keep intact all notices stating that this License and any
210 | non-permissive terms added in accord with section 7 apply to the code;
211 | keep intact all notices of the absence of any warranty; and give all
212 | recipients a copy of this License along with the Program.
213 |
214 | You may charge any price or no price for each copy that you convey,
215 | and you may offer support or warranty protection for a fee.
216 |
217 | @item Conveying Modified Source Versions.
218 |
219 | You may convey a work based on the Program, or the modifications to
220 | produce it from the Program, in the form of source code under the
221 | terms of section 4, provided that you also meet all of these
222 | conditions:
223 |
224 | @enumerate a
225 | @item
226 | The work must carry prominent notices stating that you modified it,
227 | and giving a relevant date.
228 |
229 | @item
230 | The work must carry prominent notices stating that it is released
231 | under this License and any conditions added under section 7. This
232 | requirement modifies the requirement in section 4 to ``keep intact all
233 | notices''.
234 |
235 | @item
236 | You must license the entire work, as a whole, under this License to
237 | anyone who comes into possession of a copy. This License will
238 | therefore apply, along with any applicable section 7 additional terms,
239 | to the whole of the work, and all its parts, regardless of how they
240 | are packaged. This License gives no permission to license the work in
241 | any other way, but it does not invalidate such permission if you have
242 | separately received it.
243 |
244 | @item
245 | If the work has interactive user interfaces, each must display
246 | Appropriate Legal Notices; however, if the Program has interactive
247 | interfaces that do not display Appropriate Legal Notices, your work
248 | need not make them do so.
249 | @end enumerate
250 |
251 | A compilation of a covered work with other separate and independent
252 | works, which are not by their nature extensions of the covered work,
253 | and which are not combined with it such as to form a larger program,
254 | in or on a volume of a storage or distribution medium, is called an
255 | ``aggregate'' if the compilation and its resulting copyright are not
256 | used to limit the access or legal rights of the compilation's users
257 | beyond what the individual works permit. Inclusion of a covered work
258 | in an aggregate does not cause this License to apply to the other
259 | parts of the aggregate.
260 |
261 | @item Conveying Non-Source Forms.
262 |
263 | You may convey a covered work in object code form under the terms of
264 | sections 4 and 5, provided that you also convey the machine-readable
265 | Corresponding Source under the terms of this License, in one of these
266 | ways:
267 |
268 | @enumerate a
269 | @item
270 | Convey the object code in, or embodied in, a physical product
271 | (including a physical distribution medium), accompanied by the
272 | Corresponding Source fixed on a durable physical medium customarily
273 | used for software interchange.
274 |
275 | @item
276 | Convey the object code in, or embodied in, a physical product
277 | (including a physical distribution medium), accompanied by a written
278 | offer, valid for at least three years and valid for as long as you
279 | offer spare parts or customer support for that product model, to give
280 | anyone who possesses the object code either (1) a copy of the
281 | Corresponding Source for all the software in the product that is
282 | covered by this License, on a durable physical medium customarily used
283 | for software interchange, for a price no more than your reasonable
284 | cost of physically performing this conveying of source, or (2) access
285 | to copy the Corresponding Source from a network server at no charge.
286 |
287 | @item
288 | Convey individual copies of the object code with a copy of the written
289 | offer to provide the Corresponding Source. This alternative is
290 | allowed only occasionally and noncommercially, and only if you
291 | received the object code with such an offer, in accord with subsection
292 | 6b.
293 |
294 | @item
295 | Convey the object code by offering access from a designated place
296 | (gratis or for a charge), and offer equivalent access to the
297 | Corresponding Source in the same way through the same place at no
298 | further charge. You need not require recipients to copy the
299 | Corresponding Source along with the object code. If the place to copy
300 | the object code is a network server, the Corresponding Source may be
301 | on a different server (operated by you or a third party) that supports
302 | equivalent copying facilities, provided you maintain clear directions
303 | next to the object code saying where to find the Corresponding Source.
304 | Regardless of what server hosts the Corresponding Source, you remain
305 | obligated to ensure that it is available for as long as needed to
306 | satisfy these requirements.
307 |
308 | @item
309 | Convey the object code using peer-to-peer transmission, provided you
310 | inform other peers where the object code and Corresponding Source of
311 | the work are being offered to the general public at no charge under
312 | subsection 6d.
313 |
314 | @end enumerate
315 |
316 | A separable portion of the object code, whose source code is excluded
317 | from the Corresponding Source as a System Library, need not be
318 | included in conveying the object code work.
319 |
320 | A ``User Product'' is either (1) a ``consumer product'', which means any
321 | tangible personal property which is normally used for personal,
322 | family, or household purposes, or (2) anything designed or sold for
323 | incorporation into a dwelling. In determining whether a product is a
324 | consumer product, doubtful cases shall be resolved in favor of
325 | coverage. For a particular product received by a particular user,
326 | ``normally used'' refers to a typical or common use of that class of
327 | product, regardless of the status of the particular user or of the way
328 | in which the particular user actually uses, or expects or is expected
329 | to use, the product. A product is a consumer product regardless of
330 | whether the product has substantial commercial, industrial or
331 | non-consumer uses, unless such uses represent the only significant
332 | mode of use of the product.
333 |
334 | ``Installation Information'' for a User Product means any methods,
335 | procedures, authorization keys, or other information required to
336 | install and execute modified versions of a covered work in that User
337 | Product from a modified version of its Corresponding Source. The
338 | information must suffice to ensure that the continued functioning of
339 | the modified object code is in no case prevented or interfered with
340 | solely because modification has been made.
341 |
342 | If you convey an object code work under this section in, or with, or
343 | specifically for use in, a User Product, and the conveying occurs as
344 | part of a transaction in which the right of possession and use of the
345 | User Product is transferred to the recipient in perpetuity or for a
346 | fixed term (regardless of how the transaction is characterized), the
347 | Corresponding Source conveyed under this section must be accompanied
348 | by the Installation Information. But this requirement does not apply
349 | if neither you nor any third party retains the ability to install
350 | modified object code on the User Product (for example, the work has
351 | been installed in ROM).
352 |
353 | The requirement to provide Installation Information does not include a
354 | requirement to continue to provide support service, warranty, or
355 | updates for a work that has been modified or installed by the
356 | recipient, or for the User Product in which it has been modified or
357 | installed. Access to a network may be denied when the modification
358 | itself materially and adversely affects the operation of the network
359 | or violates the rules and protocols for communication across the
360 | network.
361 |
362 | Corresponding Source conveyed, and Installation Information provided,
363 | in accord with this section must be in a format that is publicly
364 | documented (and with an implementation available to the public in
365 | source code form), and must require no special password or key for
366 | unpacking, reading or copying.
367 |
368 | @item Additional Terms.
369 |
370 | ``Additional permissions'' are terms that supplement the terms of this
371 | License by making exceptions from one or more of its conditions.
372 | Additional permissions that are applicable to the entire Program shall
373 | be treated as though they were included in this License, to the extent
374 | that they are valid under applicable law. If additional permissions
375 | apply only to part of the Program, that part may be used separately
376 | under those permissions, but the entire Program remains governed by
377 | this License without regard to the additional permissions.
378 |
379 | When you convey a copy of a covered work, you may at your option
380 | remove any additional permissions from that copy, or from any part of
381 | it. (Additional permissions may be written to require their own
382 | removal in certain cases when you modify the work.) You may place
383 | additional permissions on material, added by you to a covered work,
384 | for which you have or can give appropriate copyright permission.
385 |
386 | Notwithstanding any other provision of this License, for material you
387 | add to a covered work, you may (if authorized by the copyright holders
388 | of that material) supplement the terms of this License with terms:
389 |
390 | @enumerate a
391 | @item
392 | Disclaiming warranty or limiting liability differently from the terms
393 | of sections 15 and 16 of this License; or
394 |
395 | @item
396 | Requiring preservation of specified reasonable legal notices or author
397 | attributions in that material or in the Appropriate Legal Notices
398 | displayed by works containing it; or
399 |
400 | @item
401 | Prohibiting misrepresentation of the origin of that material, or
402 | requiring that modified versions of such material be marked in
403 | reasonable ways as different from the original version; or
404 |
405 | @item
406 | Limiting the use for publicity purposes of names of licensors or
407 | authors of the material; or
408 |
409 | @item
410 | Declining to grant rights under trademark law for use of some trade
411 | names, trademarks, or service marks; or
412 |
413 | @item
414 | Requiring indemnification of licensors and authors of that material by
415 | anyone who conveys the material (or modified versions of it) with
416 | contractual assumptions of liability to the recipient, for any
417 | liability that these contractual assumptions directly impose on those
418 | licensors and authors.
419 | @end enumerate
420 |
421 | All other non-permissive additional terms are considered ``further
422 | restrictions'' within the meaning of section 10. If the Program as you
423 | received it, or any part of it, contains a notice stating that it is
424 | governed by this License along with a term that is a further
425 | restriction, you may remove that term. If a license document contains
426 | a further restriction but permits relicensing or conveying under this
427 | License, you may add to a covered work material governed by the terms
428 | of that license document, provided that the further restriction does
429 | not survive such relicensing or conveying.
430 |
431 | If you add terms to a covered work in accord with this section, you
432 | must place, in the relevant source files, a statement of the
433 | additional terms that apply to those files, or a notice indicating
434 | where to find the applicable terms.
435 |
436 | Additional terms, permissive or non-permissive, may be stated in the
437 | form of a separately written license, or stated as exceptions; the
438 | above requirements apply either way.
439 |
440 | @item Termination.
441 |
442 | You may not propagate or modify a covered work except as expressly
443 | provided under this License. Any attempt otherwise to propagate or
444 | modify it is void, and will automatically terminate your rights under
445 | this License (including any patent licenses granted under the third
446 | paragraph of section 11).
447 |
448 | However, if you cease all violation of this License, then your license
449 | from a particular copyright holder is reinstated (a) provisionally,
450 | unless and until the copyright holder explicitly and finally
451 | terminates your license, and (b) permanently, if the copyright holder
452 | fails to notify you of the violation by some reasonable means prior to
453 | 60 days after the cessation.
454 |
455 | Moreover, your license from a particular copyright holder is
456 | reinstated permanently if the copyright holder notifies you of the
457 | violation by some reasonable means, this is the first time you have
458 | received notice of violation of this License (for any work) from that
459 | copyright holder, and you cure the violation prior to 30 days after
460 | your receipt of the notice.
461 |
462 | Termination of your rights under this section does not terminate the
463 | licenses of parties who have received copies or rights from you under
464 | this License. If your rights have been terminated and not permanently
465 | reinstated, you do not qualify to receive new licenses for the same
466 | material under section 10.
467 |
468 | @item Acceptance Not Required for Having Copies.
469 |
470 | You are not required to accept this License in order to receive or run
471 | a copy of the Program. Ancillary propagation of a covered work
472 | occurring solely as a consequence of using peer-to-peer transmission
473 | to receive a copy likewise does not require acceptance. However,
474 | nothing other than this License grants you permission to propagate or
475 | modify any covered work. These actions infringe copyright if you do
476 | not accept this License. Therefore, by modifying or propagating a
477 | covered work, you indicate your acceptance of this License to do so.
478 |
479 | @item Automatic Licensing of Downstream Recipients.
480 |
481 | Each time you convey a covered work, the recipient automatically
482 | receives a license from the original licensors, to run, modify and
483 | propagate that work, subject to this License. You are not responsible
484 | for enforcing compliance by third parties with this License.
485 |
486 | An ``entity transaction'' is a transaction transferring control of an
487 | organization, or substantially all assets of one, or subdividing an
488 | organization, or merging organizations. If propagation of a covered
489 | work results from an entity transaction, each party to that
490 | transaction who receives a copy of the work also receives whatever
491 | licenses to the work the party's predecessor in interest had or could
492 | give under the previous paragraph, plus a right to possession of the
493 | Corresponding Source of the work from the predecessor in interest, if
494 | the predecessor has it or can get it with reasonable efforts.
495 |
496 | You may not impose any further restrictions on the exercise of the
497 | rights granted or affirmed under this License. For example, you may
498 | not impose a license fee, royalty, or other charge for exercise of
499 | rights granted under this License, and you may not initiate litigation
500 | (including a cross-claim or counterclaim in a lawsuit) alleging that
501 | any patent claim is infringed by making, using, selling, offering for
502 | sale, or importing the Program or any portion of it.
503 |
504 | @item Patents.
505 |
506 | A ``contributor'' is a copyright holder who authorizes use under this
507 | License of the Program or a work on which the Program is based. The
508 | work thus licensed is called the contributor's ``contributor version''.
509 |
510 | A contributor's ``essential patent claims'' are all patent claims owned
511 | or controlled by the contributor, whether already acquired or
512 | hereafter acquired, that would be infringed by some manner, permitted
513 | by this License, of making, using, or selling its contributor version,
514 | but do not include claims that would be infringed only as a
515 | consequence of further modification of the contributor version. For
516 | purposes of this definition, ``control'' includes the right to grant
517 | patent sublicenses in a manner consistent with the requirements of
518 | this License.
519 |
520 | Each contributor grants you a non-exclusive, worldwide, royalty-free
521 | patent license under the contributor's essential patent claims, to
522 | make, use, sell, offer for sale, import and otherwise run, modify and
523 | propagate the contents of its contributor version.
524 |
525 | In the following three paragraphs, a ``patent license'' is any express
526 | agreement or commitment, however denominated, not to enforce a patent
527 | (such as an express permission to practice a patent or covenant not to
528 | sue for patent infringement). To ``grant'' such a patent license to a
529 | party means to make such an agreement or commitment not to enforce a
530 | patent against the party.
531 |
532 | If you convey a covered work, knowingly relying on a patent license,
533 | and the Corresponding Source of the work is not available for anyone
534 | to copy, free of charge and under the terms of this License, through a
535 | publicly available network server or other readily accessible means,
536 | then you must either (1) cause the Corresponding Source to be so
537 | available, or (2) arrange to deprive yourself of the benefit of the
538 | patent license for this particular work, or (3) arrange, in a manner
539 | consistent with the requirements of this License, to extend the patent
540 | license to downstream recipients. ``Knowingly relying'' means you have
541 | actual knowledge that, but for the patent license, your conveying the
542 | covered work in a country, or your recipient's use of the covered work
543 | in a country, would infringe one or more identifiable patents in that
544 | country that you have reason to believe are valid.
545 |
546 | If, pursuant to or in connection with a single transaction or
547 | arrangement, you convey, or propagate by procuring conveyance of, a
548 | covered work, and grant a patent license to some of the parties
549 | receiving the covered work authorizing them to use, propagate, modify
550 | or convey a specific copy of the covered work, then the patent license
551 | you grant is automatically extended to all recipients of the covered
552 | work and works based on it.
553 |
554 | A patent license is ``discriminatory'' if it does not include within the
555 | scope of its coverage, prohibits the exercise of, or is conditioned on
556 | the non-exercise of one or more of the rights that are specifically
557 | granted under this License. You may not convey a covered work if you
558 | are a party to an arrangement with a third party that is in the
559 | business of distributing software, under which you make payment to the
560 | third party based on the extent of your activity of conveying the
561 | work, and under which the third party grants, to any of the parties
562 | who would receive the covered work from you, a discriminatory patent
563 | license (a) in connection with copies of the covered work conveyed by
564 | you (or copies made from those copies), or (b) primarily for and in
565 | connection with specific products or compilations that contain the
566 | covered work, unless you entered into that arrangement, or that patent
567 | license was granted, prior to 28 March 2007.
568 |
569 | Nothing in this License shall be construed as excluding or limiting
570 | any implied license or other defenses to infringement that may
571 | otherwise be available to you under applicable patent law.
572 |
573 | @item No Surrender of Others' Freedom.
574 |
575 | If conditions are imposed on you (whether by court order, agreement or
576 | otherwise) that contradict the conditions of this License, they do not
577 | excuse you from the conditions of this License. If you cannot convey
578 | a covered work so as to satisfy simultaneously your obligations under
579 | this License and any other pertinent obligations, then as a
580 | consequence you may not convey it at all. For example, if you agree
581 | to terms that obligate you to collect a royalty for further conveying
582 | from those to whom you convey the Program, the only way you could
583 | satisfy both those terms and this License would be to refrain entirely
584 | from conveying the Program.
585 |
586 | @item Use with the GNU Affero General Public License.
587 |
588 | Notwithstanding any other provision of this License, you have
589 | permission to link or combine any covered work with a work licensed
590 | under version 3 of the GNU Affero General Public License into a single
591 | combined work, and to convey the resulting work. The terms of this
592 | License will continue to apply to the part which is the covered work,
593 | but the special requirements of the GNU Affero General Public License,
594 | section 13, concerning interaction through a network will apply to the
595 | combination as such.
596 |
597 | @item Revised Versions of this License.
598 |
599 | The Free Software Foundation may publish revised and/or new versions
600 | of the GNU General Public License from time to time. Such new
601 | versions will be similar in spirit to the present version, but may
602 | differ in detail to address new problems or concerns.
603 |
604 | Each version is given a distinguishing version number. If the Program
605 | specifies that a certain numbered version of the GNU General Public
606 | License ``or any later version'' applies to it, you have the option of
607 | following the terms and conditions either of that numbered version or
608 | of any later version published by the Free Software Foundation. If
609 | the Program does not specify a version number of the GNU General
610 | Public License, you may choose any version ever published by the Free
611 | Software Foundation.
612 |
613 | If the Program specifies that a proxy can decide which future versions
614 | of the GNU General Public License can be used, that proxy's public
615 | statement of acceptance of a version permanently authorizes you to
616 | choose that version for the Program.
617 |
618 | Later license versions may give you additional or different
619 | permissions. However, no additional obligations are imposed on any
620 | author or copyright holder as a result of your choosing to follow a
621 | later version.
622 |
623 | @item Disclaimer of Warranty.
624 |
625 | THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
626 | APPLICABLE LAW@. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
627 | HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM ``AS IS'' WITHOUT
628 | WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT
629 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
630 | A PARTICULAR PURPOSE@. THE ENTIRE RISK AS TO THE QUALITY AND
631 | PERFORMANCE OF THE PROGRAM IS WITH YOU@. SHOULD THE PROGRAM PROVE
632 | DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR
633 | CORRECTION.
634 |
635 | @item Limitation of Liability.
636 |
637 | IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
638 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR
639 | CONVEYS THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
640 | INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES
641 | ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT
642 | NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR
643 | LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM
644 | TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER
645 | PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
646 |
647 | @item Interpretation of Sections 15 and 16.
648 |
649 | If the disclaimer of warranty and limitation of liability provided
650 | above cannot be given local legal effect according to their terms,
651 | reviewing courts shall apply local law that most closely approximates
652 | an absolute waiver of all civil liability in connection with the
653 | Program, unless a warranty or assumption of liability accompanies a
654 | copy of the Program in return for a fee.
655 |
656 | @end enumerate
657 |
658 | @heading END OF TERMS AND CONDITIONS
659 |
660 | @heading How to Apply These Terms to Your New Programs
661 |
662 | If you develop a new program, and you want it to be of the greatest
663 | possible use to the public, the best way to achieve this is to make it
664 | free software which everyone can redistribute and change under these
665 | terms.
666 |
667 | To do so, attach the following notices to the program. It is safest
668 | to attach them to the start of each source file to most effectively
669 | state the exclusion of warranty; and each file should have at least
670 | the ``copyright'' line and a pointer to where the full notice is found.
671 |
672 | @smallexample
673 | @var{one line to give the program's name and a brief idea of what it does.}
674 | Copyright (C) @var{year} @var{name of author}
675 |
676 | This program is free software: you can redistribute it and/or modify
677 | it under the terms of the GNU General Public License as published by
678 | the Free Software Foundation, either version 3 of the License, or (at
679 | your option) any later version.
680 |
681 | This program is distributed in the hope that it will be useful, but
682 | WITHOUT ANY WARRANTY; without even the implied warranty of
683 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE@. See the GNU
684 | General Public License for more details.
685 |
686 | You should have received a copy of the GNU General Public License
687 | along with this program. If not, see @url{http://www.gnu.org/licenses/}.
688 | @end smallexample
689 |
690 | Also add information on how to contact you by electronic and paper mail.
691 |
692 | If the program does terminal interaction, make it output a short
693 | notice like this when it starts in an interactive mode:
694 |
695 | @smallexample
696 | @var{program} Copyright (C) @var{year} @var{name of author}
697 | This program comes with ABSOLUTELY NO WARRANTY; for details type @samp{show w}.
698 | This is free software, and you are welcome to redistribute it
699 | under certain conditions; type @samp{show c} for details.
700 | @end smallexample
701 |
702 | The hypothetical commands @samp{show w} and @samp{show c} should show
703 | the appropriate parts of the General Public License. Of course, your
704 | program's commands might be different; for a GUI interface, you would
705 | use an ``about box''.
706 |
707 | You should also get your employer (if you work as a programmer) or school,
708 | if any, to sign a ``copyright disclaimer'' for the program, if necessary.
709 | For more information on this, and how to apply and follow the GNU GPL, see
710 | @url{http://www.gnu.org/licenses/}.
711 |
712 | The GNU General Public License does not permit incorporating your
713 | program into proprietary programs. If your program is a subroutine
714 | library, you may consider it more useful to permit linking proprietary
715 | applications with the library. If this is what you want to do, use
716 | the GNU Lesser General Public License instead of this License. But
717 | first, please read @url{http://www.gnu.org/philosophy/why-not-lgpl.html}.
718 |
--------------------------------------------------------------------------------
/texinfo/graphviz-dot-mode.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ppareit/graphviz-dot-mode/8ff793b13707cb511875f56e167ff7f980a31136/texinfo/graphviz-dot-mode.pdf
--------------------------------------------------------------------------------
/texinfo/graphviz-dot-mode.texi:
--------------------------------------------------------------------------------
1 | \input texinfo @c -*-texinfo-*-
2 | @comment %**start of header
3 | @setfilename graphviz-dot-mode.info
4 | @comment created under Texinfo 6.4
5 | @set PACKAGE @code{graphviz-dot-mode}
6 | @set AUTHOR Pieter Pareit
7 | @set VERSION 0.3.10
8 | @set RELEASED 25 May 2015
9 | @set SWCYEARS 2002-2015
10 | @set PACURL @uref{http://ppareit.github.io/graphviz-dot-mode/}
11 | @set SRCURL @uref{https://github.com/ppareit/graphviz-dot-mode}
12 | @set PACSRC @code{graphviz-dot-mode.el}
13 |
14 | @set TITLE @value{PACKAGE} Manual
15 | @settitle @value{TITLE}
16 | @set DESCRIPTION This manual describes how to install and use @value{PACKAGE}, an Emacs package for working with @cite{Graphviz} DOT-format files.
17 | @documentdescription
18 | @value{DESCRIPTION}
19 | @end documentdescription
20 | @set EDITION @value{VERSION}.a
21 | @set EDITOR Daniel Birket
22 | @set DOCURL @uref{https://github.com/daniel-birket/graphviz-dot-mode}
23 |
24 | @set TEXINFO @cite{@acronym{GNU} Texinfo v6.4}
25 | @set EMACS @cite{Emacs v25.2.1}
26 | @set PANDOC @cite{Pandoc v1.19.2.1}
27 | @comment %**end of header
28 | @syncodeindex vr fn
29 | @syncodeindex ky cp
30 |
31 | @copying
32 | @cindex copyright (manual)
33 | Copyright @copyright{} 2018 @value{EDITOR}.
34 |
35 | @quotation
36 | Permission is granted to copy, distribute and/or modify this document
37 | under the terms of the @acronym{GNU} Free Documentation License,
38 | Version 1.3 or any later version published by the Free Software
39 | Foundation; with no Invariant Sections, with no Front-Cover Texts, and
40 | with no Back-Cover Texts. A copy of the license is included in the
41 | section entitled @cite{@acronym{GNU} Free Documentation License}.
42 | @end quotation
43 |
44 | This is the @cite{@value{TITLE}}, edition @value{EDITION}, by
45 | @value{EDITOR}, updated @today{}, which describes how to install and
46 | use the Emacs package @value{PACKAGE}, version @value{VERSION},
47 | released @value{RELEASED}, which was written by and Copyright
48 | @copyright{} @value{SWCYEARS} @value{AUTHOR}, et al@. (See
49 | @value{PACURL})
50 |
51 | @ifinfo
52 | This @command{info}
53 | @end ifinfo
54 | @iftex
55 | This typeset
56 | @end iftex
57 | @ifhtml
58 | This @acronym{HTML}
59 | @end ifhtml
60 | @ifdocbook
61 | This
62 | @end ifdocbook
63 | document was composed using @value{EMACS} (Richard
64 | M. Stallman, et al. See @uref{https://www.gnu.org/software/emacs/})
65 | and compiled from @file{.texi} source with @value{TEXINFO} (Richard
66 | M. Stallman, et al. See @uref{https://www.gnu.org/software/texinfo/})
67 | @iftex
68 | and typeset using @TeX{} (Donald Knuth, et al. See
69 | @uref{https://www.gnu.org/software/texinfo/})
70 | @end iftex
71 | @ifdocbook
72 | to @command{docbook} format (@acronym{OASIS} See @uref{http://docbook.org}, then
73 | converted to this format using @value{PANDOC} (John MacFarlane, et
74 | al@. @uref{http://pandoc.org}) This format has no index.
75 | @end ifdocbook
76 | @cite{Graphviz} is by @acronym{AT&T} Labs Research. (See @uref{http://graphviz.org})
77 | @end copying
78 |
79 | @dircategory Emacs editing modes
80 | @direntry
81 | * Graphviz DOT mode: (graphviz-dot-mode). Emacs mode for Graphviz format.
82 | @end direntry
83 |
84 | @titlepage
85 | @title @value{TITLE}
86 | @subtitle edition @value{EDITION}
87 | @subtitle for @value{PACKAGE} version @value{VERSION}
88 | @author @value{PACKAGE} by @value{AUTHOR}, et al.
89 | @author manual by @value{EDITOR}
90 | @page
91 | @vskip 0pt plus 1filll
92 | @insertcopying
93 | @end titlepage
94 |
95 | @contents
96 |
97 | @ifnotdocbook
98 | @ifnottex
99 | @node Top
100 | @top @value{TITLE}
101 | @value{DESCRIPTION}
102 |
103 | @ifinfo
104 | In @command{info}, type @kbd{3} to jump to the chapter on using
105 | @value{PACKAGE}.
106 | @end ifinfo
107 |
108 | @insertcopying
109 | @end ifnottex
110 | @end ifnotdocbook
111 |
112 | This manual is based upon the comments and doc strings in the
113 | @value{PACSRC} source code, which begins with:
114 |
115 | @cindex copyright (software)
116 | @lisp
117 | ;;; graphviz-dot-mode.el --- Mode for the dot-language used by graphviz (att).
118 |
119 | ;; Copyright (C) 2002 - 2015 Pieter Pareit
120 |
121 | ;; This program is free software; you can redistribute it and/or
122 | ;; modify it under the terms of the GNU General Public License as
123 | ;; published by the Free Software Foundation; either version 2 of
124 | ;; the License, or (at your option) any later version.
125 |
126 | ;; This program is distributed in the hope that it will be
127 | ;; useful, but WITHOUT ANY WARRANTY; without even the implied
128 | ;; warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
129 | ;; PURPOSE. See the GNU General Public License for more details.
130 | @dots{}
131 |
132 | ;; Authors: Pieter Pareit
133 | ;; Rubens Ramos
134 | ;; Eric Anderson http://www.ece.cmu.edu/~andersoe/
135 | ;; Maintainer: Pieter Pareit
136 | ;; Homepage: https://ppareit.github.io/graphviz-dot-mode/
137 | ;; Created: 28 Oct 2002
138 | ;; Last modified: 25 May 2015
139 | ;; Version: 0.3.10
140 | ;; Keywords: mode dot dot-language dotlanguage graphviz graphs att
141 | @end lisp
142 |
143 | @menu
144 | * Introduction:: About @cite{Graphviz} and @value{PACKAGE}.
145 | * Installing:: How to Get and Install @value{PACKAGE}.
146 | * Using @value{PACKAGE}:: How to Use @value{PACKAGE}
147 | * Customizing:: How to customize @value{PACKAGE}.
148 | * Credits::
149 | * @acronym{GNU} General Public License 2.0:: License of @value{PACKAGE}.
150 | * @acronym{GNU} Free Documentation License:: License of this document.
151 | * Functions & Variables::
152 | * Keys and Concepts::
153 | @end menu
154 |
155 | @node Introduction
156 | @chapter Introduction
157 | @cindex introduction
158 | @value{DESCRIPTION}
159 | The features of this package help you to create @file{.dot} or
160 | @file{.gv} files containing syntax compatible with the separate
161 | @cite{Graphviz} package and use @cite{Graphviz} to convert these files
162 | to diagrams.
163 |
164 | @pindex Graphviz
165 | @cindex graph
166 | @cindex node
167 | @cindex edge
168 | @cite{Graphviz} is a set of open source graph visualization tools
169 | created by @acronym{AT&T} Labs Research. A @dfn{graph} is a way of
170 | representing information as a network of connected @dfn{nodes} (shapes) and
171 | @dfn{edges} (lines). @cite{Graphviz} is documented at
172 | @uref{http://graphviz.org}.
173 |
174 | @pindex Emacs
175 | The powerful text editor, Emacs, was created in 1976 by Richard
176 | Stallman. It is highly customizable and has 40 years of other
177 | extensions. @cite{@acronym{GNU} Emacs} is documented at
178 | @uref{https://www.gnu.org/software/emacs/}. @cite{XEmacs} is
179 | documented at @uref{http://www.xemacs.org}.
180 |
181 | @node Installing
182 | @chapter Installing
183 | @cindex installing
184 | This chapter describes how to install @value{PACKAGE}.
185 |
186 | @menu
187 | * Recommended Installation:: Install the easy way.
188 | * Installing by Hand:: Install the hard way.
189 | * Installing this Info Manual:: How to Install this @command{info} manual.
190 | @end menu
191 |
192 | @node Recommended Installation
193 | @section Recommended Installation
194 | @cindex recommended installation
195 | @cindex installation, the easy way
196 | @cindex @code{package.el}, installing with
197 | @cindex MELPA Stable, installing from
198 | The recommended way to install the package @value{PACKAGE} is to
199 | use @code{package.el} and @kbd{M-x package-install}.
200 |
201 | @vindex package-archives
202 | @findex package-initialize
203 | To install @value{PACKAGE}, first add the MELPA Stable archive to the
204 | list of archives used by @code{package.el} (if it is not already there)
205 | by adding the following lines to your @file{.emacs} or other Emacs
206 | startup file. Then restart Emacs.
207 |
208 | @lisp
209 | (require 'package)
210 | (add-to-list 'package-archives
211 | '("melpa-stable" . "https://stable.melpa.org/packages/"))
212 |
213 | (package-initialize)
214 | @end lisp
215 |
216 | (For more detailed and comprehensive instructions about using MELPA,
217 | please see @uref{https://melpa.org/#/getting-started}.)
218 |
219 | @findex package-install
220 | After restarting Emacs, type the following to install @value{PACKAGE}.
221 |
222 | @kbd{M-x package-install @key{RET} graphviz-dot-mode @key{RET}}.
223 |
224 | When installed this way using the package manager, @value{PACKAGE}
225 | will be activated automatically for file names ending in either @file{.dot}
226 | or @file{.gv}.
227 |
228 | @node Installing by Hand
229 | @section Installing by Hand
230 | @cindex installing by hand
231 | @cindex installation, the hard way
232 | You can manually download and install @value{PACKAGE}, but it is best
233 | to use the recommended method above if you don't already know how to
234 | manually install an Emacs program.
235 |
236 | You may download @file{graphviz-dot-mode.el} from@*@value{PACURL} and
237 | follow the instructions that you find there.
238 |
239 | @node Installing this Info Manual
240 | @section Installing this Info Manual
241 | @cindex Installing this Info Manual
242 | This section describes how to install this manual so that it may be
243 | used from within Emacs using its @code{info} reader.
244 | @enumerate
245 | @item Obtain the file containing the info-format version of this manual, @file{graphviz-dot-mode.info.gz} (See @value{DOCURL}.)
246 | @item In Emacs, use @kbd{C-h v Info-directory-list@key{RET}} to display the contents of the @code{Info-directory-list} variable. (This may be the same as the @env{INFOPATH} environment variable.)
247 | @item Copy the @file{graphviz-dot-mode.info.gz} file to one of the directories in the @code{Info-directory-list} variable.
248 | @item Use @command{install-info} to add an entry for the new @file{graphviz-dot-mode.info.gz} file into the @file{dir} file in the info directory where you copied the file.
249 | @item In Emacs, use @kbd{C-h i d m graphviz-dot-mode @key{RET}} to display this help file.
250 | @end enumerate
251 |
252 | The @file{Makefile} in the @file{texinfo} subdirectory of the GitHub archive at @value{DOCURL} includes an option to install the info file with @command{make install}. You must first modify the variables in the top of the Makefile to use the correct directories and files for your system.
253 |
254 | You must install @value{TEXINFO} to use @command{install-info} or the @file{Makefile}.
255 | @node Using @value{PACKAGE}
256 | @chapter Using @value{PACKAGE}
257 | @cindex using
258 | This chapter describes how to use @value{PACKAGE}.
259 |
260 | @menu
261 | * Compiling & Viewing:: How to use Compile and View Functions.
262 | * Editing:: How to edit.
263 | @end menu
264 |
265 | @node Compiling & Viewing
266 | @section Compiling & Viewing
267 | @cindex compiling
268 | @cindex viewing
269 | This section describes how to use compile and view
270 | functions. @xref{Compile & View Variables}.
271 |
272 | @table @asis
273 | @item @kbd{C-c c} (@code{compile})
274 | @kindex @kbd{C-c c}
275 | @findex compile
276 | This command compiles the current dot file visited by the @cite{Emacs}
277 | buffer. The output file is in the same directory and has the extension
278 | determined by the variable @code{graphviz-dot-preview-extension}.
279 |
280 | @item @kbd{C-x `} (@code{next-error})
281 | @kindex @kbd{C-x `}
282 | @findex next-error
283 | This command will jump to the location in the source file of the next
284 | error from the most recent compile. Use @kbd{C-c c} to compile first.
285 |
286 | @item @kbd{C-c p} (@code{graphviz-dot-preview})
287 | @kindex @kbd{C-c p}
288 | @findex graphviz-dot-preview
289 | @cindex preview
290 | @vindex image-file-name-extensions
291 | @vindex image-formats-alist
292 | This command compiles and then (if it compiled successfully) shows the
293 | output of the current dot file visited by the @cite{Emacs} buffer,
294 | provided that @cite{@acronym{GNU} Emacs} or @cite{XEmacs} is running
295 | on a graphical display capable of displaying the graphic file output
296 | by @command{dot}.
297 |
298 | See @code{image-file-name-extensions} in @cite{@acronym{GNU} Emacs} or
299 | @code{image-formats-alist} in @cite{XEmacs} to customize the graphic
300 | files that can be displayed.
301 |
302 | @item @kbd{C-c v} (@code{graphviz-dot-view})
303 | @kindex @kbd{C-c v}
304 | @findex graphviz-dot-view
305 | @cindex external viewer
306 | @vindex graphviz-dot-view-edit-command
307 | @vindex graphviz-dot-save-before-view
308 | This command invokes an external viewer specified by the variable
309 | @code{graphviz-dot-view-command}. If
310 | @code{graphviz-dot-view-edit-command} is @code{t}, you will be
311 | prompted to enter a new @code{graphviz-dot-view-command}. If
312 | @code{graphviz-dot-save-before-view} is @code{t}, the buffer is saved
313 | before the external viewer command is invoked.
314 |
315 | (See @uref{http://graphviz.org/content/resources} for a
316 | list of @cite{Graphviz} viewers and editors.)
317 | @end table
318 |
319 | @node Editing
320 | @section Editing
321 | @cindex editing
322 | This section describes how to edit with @value{PACKAGE}.
323 | @xref{Editing Variables}.
324 | @menu
325 | * Indenting:: How to use Indenting commands
326 | * Completion:: How to use Completion command
327 | * Commenting:: How to use Commenting commands
328 | @end menu
329 |
330 | @node Indenting
331 | @subsection Indenting
332 | @cindex indenting
333 | @table @asis
334 | @item @kbd{C-M-q} (@code{graphviz-dot-indent-graph})
335 | @kindex @kbd{C-M-q}
336 | @findex graphviz-dot-indent-graph
337 | This command will indent the graph, diagraph, or subgraph at point and
338 | any subgraph within it.
339 |
340 | @item @kbd{@key{TAB}}
341 | @kindex @kbd{@key{TAB}}
342 | This key will automatically indent the line. It does not perform completion.
343 |
344 | @item @kbd{M-j} (@code{comment-indent-newline})
345 | @xref{Commenting}
346 |
347 | @item @kbd{@key{RET}} (@code{electric-graphviz-dot-terminate-line})
348 | @kindex @kbd{@key{RET}}
349 | @findex electric-graphviz-dot-terminate-line
350 | If the variable @code{graphviz-dot-auto-indent-on-newline} is
351 | @code{t}, @kbd{@key{RET}} will insert a newline and indent the next line.
352 |
353 | @item @kbd{@{} (@code{electric-graphviz-dot-open-brace})
354 | @kindex @kbd{@{}
355 | @findex electric-graphviz-dot-open-brace
356 | If the variable @code{graphviz-dot-auto-indent-on-braces} is
357 | @code{t}, @kbd{@{} will insert a @kbd{@{}, newline and indent the next line.
358 |
359 | @item @kbd{@}} (@code{electric-graphviz-dot-close-brace})
360 | @kindex @kbd{@}}
361 | @findex electric-graphviz-dot-close-brace
362 | If the variable @code{graphviz-dot-auto-indent-on-braces} is
363 | @code{t}, @kbd{@}} will insert a @kbd{@}}, newline and indent the next line.
364 |
365 | @item @kbd{;} (@code{electric-graphviz-dot-semi})
366 | @kindex @kbd{;}
367 | @findex electric-graphviz-dot-semi
368 | If the variable @code{graphviz-dot-auto-indent-on-semi} is
369 | @code{t}, @kbd{;} will insert a @kbd{;}, newline and indent the next line.
370 | @end table
371 |
372 | @node Completion
373 | @subsection Completion
374 | @table @asis
375 | @item @kbd{M-t} (@code{graphviz-dot-complete-word})
376 | @kindex @kbd{M-t}
377 | @findex graphviz-dot-complete-word
378 | This command will complete the attribute or value keyword at point. If
379 | more than one completion is possible, a list is displayed in the
380 | minbuffer.
381 | @end table
382 |
383 | @xref{Completion Variables}
384 |
385 | @node Commenting
386 | @subsection Commenting
387 | @cindex commenting
388 |
389 | @table @asis
390 | @item @kbd{M-;} (@code{comment-dwim})
391 | @kindex @kbd{M-;}
392 | @findex comment-dwim
393 | This command will perform the comment command you want (Do What I
394 | Mean). If the region is active and @code{transient-mark-mode} is on, it
395 | will comment the region, unless it only consists of comments, in which
396 | case it will un-comment the region. Else, if the current line is
397 | empty, it will insert a blank comment line,
398 | otherwise it will append a comment to the line and indent it.
399 |
400 | @kindex C-u M-;
401 | Use @kbd{C-u M-;} to kill the comment on the current line.
402 |
403 | @item @kbd{C-x C-;} (@code{comment-line})
404 | @kindex C-x C-;
405 | @findex comment-line
406 | This command will comment or un-comment the current line.
407 |
408 | @item @kbd{M-j} (@code{comment-indent-newline})
409 | @kindex @kbd{M-j}
410 | @findex comment-indent-newline
411 | This command will break line the at point and indent, continuing a
412 | comment if within one. This indents the body of the continued comment
413 | under the previous comment line.
414 |
415 | @item @kbd{C-c C-c} (@code{comment-region})
416 | @kindex @kbd{C-c C-c}
417 | @findex comment-region
418 | This command will comment-out the region.
419 |
420 | You may also use @kbd{M-;} (@code{comment-dwin}) to comment the region
421 | if @code{transient-mark-mode} is on.
422 |
423 | @item @kbd{C-c C-u} (@code{graphviz-dot-uncomment-region})
424 | @kindex @kbd{C-c C-u}
425 | @findex graphviz-dot-uncomment-region
426 | This command will un-comment the region.
427 |
428 | You may also use @kbd{C-u M-;} (@code{comment-dwin}) to un-comment the region
429 | if @code{transient-mark-mode} is on.
430 | @end table
431 |
432 | @node Customizing
433 | @chapter Customizing
434 | @cindex customizing
435 | This section describes the customizable variables of @value{PACKAGE}.
436 | You may customize variables by typing
437 |
438 | @table @kbd
439 | @item M-x graphviz-dot-customize @key{RET}
440 | @kindex M-x graphviz-dot-customize @key{RET}
441 | @findex graphviz-dot-customize
442 | This function invokes the Emacs customization facility to allow you to
443 | view and change the @value{PACKAGE} variables below.
444 | @end table
445 |
446 | @menu
447 | * Compile & View Variables:: How to customize Compile & View Functions.
448 | * Editing Variables:: How to customize Editing Functions.
449 | * Keyword Variables:: Keyword Customizations.
450 | * Mode Hook:: The mode hook variable.
451 | @end menu
452 |
453 | @node Compile & View Variables
454 | @section Compile & View Variables
455 | @cindex variables, compile
456 | @cindex variables, view
457 | This section describes variables related to compiling and viewing.
458 | @xref{Compiling & Viewing}
459 |
460 | @vtable @code
461 | @item graphviz-dot-dot-program
462 | @kindex @kbd{C-c c}
463 | @findex compile
464 | string, default: ``dot''
465 |
466 | This variable determines the command name (and path, if necessary)
467 | used to invoke the @cite{Graphviz} @command{dot} program. The @kbd{C-c
468 | c} (@code{compile}) function invokes this command.
469 |
470 | @item graphviz-dot-preview-extension
471 | @findex compile
472 | @kindex @kbd{C-c p}
473 | @findex graphviz-dot-preview
474 | string, default ``png''
475 |
476 | This variable determines the file extension used for the @kbd{C-c c}
477 | (@code{compile}) and @kbd{C-c p} (@code{graphviz-dot-preview})
478 | functions. The format for the compile command is
479 |
480 | @command{dot -T .dot > .}
481 |
482 | @item graphviz-dot-save-before-view
483 | @kindex @kbd{C-c v}
484 | @findex graphviz-dot-view
485 | boolean, default @code{t}
486 |
487 | This variable controls whether the buffer will be saved to the visited file
488 | before the @kbd{C-c v} (@code{graphviz-dot-view}) function invokes the
489 | external dot-file viewer command. Set this boolean variable to
490 | @code{t} (true) or @code{nil} (false).
491 |
492 | @item graphviz-dot-view-command
493 | @kindex @kbd{C-c v}
494 | @findex graphviz-dot-view
495 | string, default: ``doted %s''
496 |
497 | This variable determines the command name (and path, if necessary)
498 | used to invoke an external dot-file viewer program. The @kbd{C-c v}
499 | (@code{graphviz-dot-view}) function invokes this command. The name of
500 | the file visited by the buffer will be substituted for @code{%s} in
501 | this string.
502 |
503 | (See @uref{http://graphviz.org/content/resources} for a
504 | list of @cite{Graphviz} viewers and editors.)
505 |
506 | @item graphviz-dot-view-edit-command
507 | @kindex @kbd{C-c v}
508 | @findex graphviz-dot-view
509 | @vindex graphviz-dot-view-command
510 | boolean, default: @code{nil}
511 |
512 | This variable controls whether you will be prompted for the external dot-file
513 | viewer command name when you use @kbd{C-c v}
514 | @code{graphviz-dot-view}. Set this to @code{t} (true) to be prompted
515 | to edit the viewer command variable @code{graphviz-dot-view-command}
516 | every time you use @kbd{C-c v} or @code{nil} to avoid the prompt.
517 |
518 | @end vtable
519 |
520 | @node Editing Variables
521 | @section Editing Variables
522 | @cindex variables, editing
523 | This section describes variables related to editing.
524 | @xref{Editing}
525 |
526 | @menu
527 | * Indenting Variables:: Variables about Indenting.
528 | * Completion Variables:: Variables about Completion.
529 | @end menu
530 |
531 | @node Indenting Variables
532 | @subsection Indenting Variables
533 | @cindex variables, indenting
534 | This subsection describes variables related to indenting.
535 |
536 | @vtable @code
537 | @item graphviz-dot-auto-indent-on-braces
538 | @kbd{@{}
539 | @findex electric-graphviz-dot-open-brace
540 | @kbd{@}}
541 | @findex electric-graphviz-dot-close-brace
542 | boolean, default @code{nil}
543 |
544 | This variable controls whether the functions
545 | @code{electric-graphviz-dot-open-brace} and
546 | @code{electric-graphviz-dot-close-brace} are called when @kbd{@{} and
547 | @kbd{@}} are typed. Set this boolean variable to @code{t} (true) or
548 | @code{nil} (false).
549 |
550 | @item graphviz-dot-auto-indent-on-newline
551 | @kindex @kbd{@key{RET}}
552 | @findex electric-graphviz-dot-terminate-line
553 | boolean, default @code{t}
554 |
555 | This variable controls whether the function
556 | @code{electric-graphviz-dot-terminate-line} is called when a line is
557 | terminated with a newline. Set this boolean variable to @code{t}
558 | (true) or @code{nil} (false).
559 |
560 | @item graphviz-dot-auto-indent-on-semi
561 | @kindex @kbd{;}
562 | @findex electric-graphviz-dot-semi
563 | boolean, default @code{t}
564 |
565 | This variable controls whether the function @code{electric-graphviz-dot-semi}
566 | is called when a semicolon @kbd{;} is typed. Set this boolean variable
567 | to @code{t} (true) or @code{nil} (false).
568 |
569 | @item graphviz-dot-indent-width
570 | @vindex standard-indent
571 | integer, default: @code{standard-indent}
572 |
573 | This variable determines the indentation used in @value{PACKAGE} buffers.
574 |
575 | @end vtable
576 |
577 | @node Completion Variables
578 | @subsection Completion Variables
579 | @cindex variables, completion
580 | This subsection describes variables related to completion.
581 |
582 | @vtable @code
583 | @item graphviz-dot-delete-completions
584 | boolean, default: @code{nil}
585 |
586 | This variable controls whether the completion buffer is automatically
587 | deleted when a key is pressed. Set this boolean variable to @code{t}
588 | (true) or @code{nil} (false).
589 |
590 | @item graphviz-dot-toggle-completions
591 | @kindex @kbd{M-t}
592 | @findex graphviz-dot-complete-word
593 | boolean, default: @code{nil}
594 |
595 | This variable controls whether repeated use of @kbd{M-t}
596 | @code{graphviz-dot-complete-word} will toggle the display of possible
597 | completions in the minibuffer. If this variable is set to @code{nil},
598 | when there are more than one possible completions, a buffer will display
599 | all completions. Set this boolean variable to @code{t} (true) or
600 | @code{nil} (false).
601 |
602 | @end vtable
603 |
604 | @node Keyword Variables
605 | @section Keyword Variables
606 | @cindex variables, keyword
607 | This section describes the variables containing DOT-language keywords,
608 | which may change if @cite{Graphviz} is updated. You may update these
609 | variables after new releases of @cite{Graphviz}from
610 | @uref{http://www.graphviz.org/doc/schema/attributes.xml} .
611 |
612 | @vtable @code
613 | @item graphviz-dot-attr-keywords
614 | list of strings, default: (``graph'' ``digraph'' @dots{} )
615 |
616 | This variable holds a list of keywords for attribute names in a
617 | graph. This is used by the @kbd{M-t} auto completion function. The
618 | actual completion tables are built when the mode is loaded, so changes
619 | to this variable are not immediately visible.
620 |
621 | @item graphviz-dot-value-keywords
622 | list of strings, default: (``true'' ``false'' @dots{} )
623 |
624 | This variable holds a list of keywords for attribute values in a
625 | graph. This is used by the @kbd{M-t} auto completion function. The
626 | actual completion tables are built when the mode is loaded, so changes
627 | to this variable are not immediately visible.
628 |
629 | @end vtable
630 |
631 | @node Mode Hook
632 | @section Mode Hook
633 | @cindex variables, mode hook
634 |
635 | @vtable @code
636 | @item graphviz-dot-mode-hook
637 | list of functions, default: @code{nil}
638 |
639 | This variable determines which functions are called when
640 | @value{PACKAGE} starts. To use it, add a line like below to your
641 | @file{.emacs} or other startup file.
642 | @lisp
643 | (add-hook 'graphviz-dot-mode-hook 'my-hook)
644 | @end lisp
645 | @end vtable
646 |
647 | @node Credits
648 | @chapter Credits
649 | @cindex credits
650 | @value{PACKAGE} was written by:
651 | @itemize
652 | @item Pieter Pareit @email{pieter.pareit@@gmail.com}
653 | @item Rubens Ramos @email{rubensr@@users.sourceforge.net}
654 | @item Eric Anderson @uref{http://www.ece.cmu.edu/~andersoe/}
655 | @end itemize
656 |
657 | Other contributors are noted in the version history in the
658 | @value{PACSRC} file and the commit history on GitHub.
659 |
660 | The source code is maintained on GitHub at @value{SRCURL} by Pieter
661 | Pareit (@email{pieter.pareit@@gmail.com}). Please email software
662 | comments, suggestions and corrections there.
663 |
664 | This manual is maintained on GitHub at @value{DOCURL} by Daniel Birket
665 | (@email{danielb@@birket.com}). Please submit document errata to the
666 | issue tracker there.
667 |
668 | @node @acronym{GNU} General Public License 2.0
669 | @unnumbered @acronym{GNU} General Public License 2.0
670 | @cindex license (software)
671 | @cindex @acronym{GNU} General Public License 2.0
672 |
673 | @include gpl-2.0.texi
674 |
675 | @c @node @acronym{GNU} General Public License 3.0
676 | @c @unnumbered @acronym{GNU} General Public License 3.0
677 | @c @cindex license (updated)
678 | @c @cindex @acronym{GNU} General Public License 3.0
679 | @c
680 | @c @include gpl.texi
681 | @c
682 | @node @acronym{GNU} Free Documentation License
683 | @unnumbered @acronym{GNU} Free Documentation License
684 | @cindex license (manual)
685 | @cindex @acronym{GNU} Free Documentation License
686 |
687 | @include fdl.texi
688 | @node Functions & Variables
689 | @unnumbered Functions & Variables
690 | @printindex fn
691 | @node Keys and Concepts
692 | @unnumbered Keys and Concepts
693 | @printindex cp
694 | @bye
695 |
--------------------------------------------------------------------------------