[
  {
    "path": ".gitignore",
    "content": "org-mind-map.el~\n*~"
  },
  {
    "path": "LICENSE",
    "content": "                    GNU GENERAL PUBLIC LICENSE\n                       Version 3, 29 June 2007\n\n Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>\n Everyone is permitted to copy and distribute verbatim copies\n of this license document, but changing it is not allowed.\n\n                            Preamble\n\n  The GNU General Public License is a free, copyleft license for\nsoftware and other kinds of works.\n\n  The licenses for most software and other practical works are designed\nto take away your freedom to share and change the works.  By contrast,\nthe GNU General Public License is intended to guarantee your freedom to\nshare and change all versions of a program--to make sure it remains free\nsoftware for all its users.  We, the Free Software Foundation, use the\nGNU General Public License for most of our software; it applies also to\nany other work released this way by its authors.  You can apply it to\nyour programs, too.\n\n  When we speak of free software, we are referring to freedom, not\nprice.  Our General Public Licenses are designed to make sure that you\nhave the freedom to distribute copies of free software (and charge for\nthem if you wish), that you receive source code or can get it if you\nwant it, that you can change the software or use pieces of it in new\nfree programs, and that you know you can do these things.\n\n  To protect your rights, we need to prevent others from denying you\nthese rights or asking you to surrender the rights.  Therefore, you have\ncertain responsibilities if you distribute copies of the software, or if\nyou modify it: responsibilities to respect the freedom of others.\n\n  For example, if you distribute copies of such a program, whether\ngratis or for a fee, you must pass on to the recipients the same\nfreedoms that you received.  You must make sure that they, too, receive\nor can get the source code.  And you must show them these terms so they\nknow their rights.\n\n  Developers that use the GNU GPL protect your rights with two steps:\n(1) assert copyright on the software, and (2) offer you this License\ngiving you legal permission to copy, distribute and/or modify it.\n\n  For the developers' and authors' protection, the GPL clearly explains\nthat there is no warranty for this free software.  For both users' and\nauthors' sake, the GPL requires that modified versions be marked as\nchanged, so that their problems will not be attributed erroneously to\nauthors of previous versions.\n\n  Some devices are designed to deny users access to install or run\nmodified versions of the software inside them, although the manufacturer\ncan do so.  This is fundamentally incompatible with the aim of\nprotecting users' freedom to change the software.  The systematic\npattern of such abuse occurs in the area of products for individuals to\nuse, which is precisely where it is most unacceptable.  Therefore, we\nhave designed this version of the GPL to prohibit the practice for those\nproducts.  If such problems arise substantially in other domains, we\nstand ready to extend this provision to those domains in future versions\nof the GPL, as needed to protect the freedom of users.\n\n  Finally, every program is threatened constantly by software patents.\nStates should not allow patents to restrict development and use of\nsoftware on general-purpose computers, but in those that do, we wish to\navoid the special danger that patents applied to a free program could\nmake it effectively proprietary.  To prevent this, the GPL assures that\npatents cannot be used to render the program non-free.\n\n  The precise terms and conditions for copying, distribution and\nmodification follow.\n\n                       TERMS AND CONDITIONS\n\n  0. Definitions.\n\n  \"This License\" refers to version 3 of the GNU General Public License.\n\n  \"Copyright\" also means copyright-like laws that apply to other kinds of\nworks, such as semiconductor masks.\n\n  \"The Program\" refers to any copyrightable work licensed under this\nLicense.  Each licensee is addressed as \"you\".  \"Licensees\" and\n\"recipients\" may be individuals or organizations.\n\n  To \"modify\" a work means to copy from or adapt all or part of the work\nin a fashion requiring copyright permission, other than the making of an\nexact copy.  The resulting work is called a \"modified version\" of the\nearlier work or a work \"based on\" the earlier work.\n\n  A \"covered work\" means either the unmodified Program or a work based\non the Program.\n\n  To \"propagate\" a work means to do anything with it that, without\npermission, would make you directly or secondarily liable for\ninfringement under applicable copyright law, except executing it on a\ncomputer or modifying a private copy.  Propagation includes copying,\ndistribution (with or without modification), making available to the\npublic, and in some countries other activities as well.\n\n  To \"convey\" a work means any kind of propagation that enables other\nparties to make or receive copies.  Mere interaction with a user through\na computer network, with no transfer of a copy, is not conveying.\n\n  An interactive user interface displays \"Appropriate Legal Notices\"\nto the extent that it includes a convenient and prominently visible\nfeature that (1) displays an appropriate copyright notice, and (2)\ntells the user that there is no warranty for the work (except to the\nextent that warranties are provided), that licensees may convey the\nwork under this License, and how to view a copy of this License.  If\nthe interface presents a list of user commands or options, such as a\nmenu, a prominent item in the list meets this criterion.\n\n  1. Source Code.\n\n  The \"source code\" for a work means the preferred form of the work\nfor making modifications to it.  \"Object code\" means any non-source\nform of a work.\n\n  A \"Standard Interface\" means an interface that either is an official\nstandard defined by a recognized standards body, or, in the case of\ninterfaces specified for a particular programming language, one that\nis widely used among developers working in that language.\n\n  The \"System Libraries\" of an executable work include anything, other\nthan the work as a whole, that (a) is included in the normal form of\npackaging a Major Component, but which is not part of that Major\nComponent, and (b) serves only to enable use of the work with that\nMajor Component, or to implement a Standard Interface for which an\nimplementation is available to the public in source code form.  A\n\"Major Component\", in this context, means a major essential component\n(kernel, window system, and so on) of the specific operating system\n(if any) on which the executable work runs, or a compiler used to\nproduce the work, or an object code interpreter used to run it.\n\n  The \"Corresponding Source\" for a work in object code form means all\nthe source code needed to generate, install, and (for an executable\nwork) run the object code and to modify the work, including scripts to\ncontrol those activities.  However, it does not include the work's\nSystem Libraries, or general-purpose tools or generally available free\nprograms which are used unmodified in performing those activities but\nwhich are not part of the work.  For example, Corresponding Source\nincludes interface definition files associated with source files for\nthe work, and the source code for shared libraries and dynamically\nlinked subprograms that the work is specifically designed to require,\nsuch as by intimate data communication or control flow between those\nsubprograms and other parts of the work.\n\n  The Corresponding Source need not include anything that users\ncan regenerate automatically from other parts of the Corresponding\nSource.\n\n  The Corresponding Source for a work in source code form is that\nsame work.\n\n  2. Basic Permissions.\n\n  All rights granted under this License are granted for the term of\ncopyright on the Program, and are irrevocable provided the stated\nconditions are met.  This License explicitly affirms your unlimited\npermission to run the unmodified Program.  The output from running a\ncovered work is covered by this License only if the output, given its\ncontent, constitutes a covered work.  This License acknowledges your\nrights of fair use or other equivalent, as provided by copyright law.\n\n  You may make, run and propagate covered works that you do not\nconvey, without conditions so long as your license otherwise remains\nin force.  You may convey covered works to others for the sole purpose\nof having them make modifications exclusively for you, or provide you\nwith facilities for running those works, provided that you comply with\nthe terms of this License in conveying all material for which you do\nnot control copyright.  Those thus making or running the covered works\nfor you must do so exclusively on your behalf, under your direction\nand control, on terms that prohibit them from making any copies of\nyour copyrighted material outside their relationship with you.\n\n  Conveying under any other circumstances is permitted solely under\nthe conditions stated below.  Sublicensing is not allowed; section 10\nmakes it unnecessary.\n\n  3. Protecting Users' Legal Rights From Anti-Circumvention Law.\n\n  No covered work shall be deemed part of an effective technological\nmeasure under any applicable law fulfilling obligations under article\n11 of the WIPO copyright treaty adopted on 20 December 1996, or\nsimilar laws prohibiting or restricting circumvention of such\nmeasures.\n\n  When you convey a covered work, you waive any legal power to forbid\ncircumvention of technological measures to the extent such circumvention\nis effected by exercising rights under this License with respect to\nthe covered work, and you disclaim any intention to limit operation or\nmodification of the work as a means of enforcing, against the work's\nusers, your or third parties' legal rights to forbid circumvention of\ntechnological measures.\n\n  4. Conveying Verbatim Copies.\n\n  You may convey verbatim copies of the Program's source code as you\nreceive it, in any medium, provided that you conspicuously and\nappropriately publish on each copy an appropriate copyright notice;\nkeep intact all notices stating that this License and any\nnon-permissive terms added in accord with section 7 apply to the code;\nkeep intact all notices of the absence of any warranty; and give all\nrecipients a copy of this License along with the Program.\n\n  You may charge any price or no price for each copy that you convey,\nand you may offer support or warranty protection for a fee.\n\n  5. Conveying Modified Source Versions.\n\n  You may convey a work based on the Program, or the modifications to\nproduce it from the Program, in the form of source code under the\nterms of section 4, provided that you also meet all of these conditions:\n\n    a) The work must carry prominent notices stating that you modified\n    it, and giving a relevant date.\n\n    b) The work must carry prominent notices stating that it is\n    released under this License and any conditions added under section\n    7.  This requirement modifies the requirement in section 4 to\n    \"keep intact all notices\".\n\n    c) You must license the entire work, as a whole, under this\n    License to anyone who comes into possession of a copy.  This\n    License will therefore apply, along with any applicable section 7\n    additional terms, to the whole of the work, and all its parts,\n    regardless of how they are packaged.  This License gives no\n    permission to license the work in any other way, but it does not\n    invalidate such permission if you have separately received it.\n\n    d) If the work has interactive user interfaces, each must display\n    Appropriate Legal Notices; however, if the Program has interactive\n    interfaces that do not display Appropriate Legal Notices, your\n    work need not make them do so.\n\n  A compilation of a covered work with other separate and independent\nworks, which are not by their nature extensions of the covered work,\nand which are not combined with it such as to form a larger program,\nin or on a volume of a storage or distribution medium, is called an\n\"aggregate\" if the compilation and its resulting copyright are not\nused to limit the access or legal rights of the compilation's users\nbeyond what the individual works permit.  Inclusion of a covered work\nin an aggregate does not cause this License to apply to the other\nparts of the aggregate.\n\n  6. Conveying Non-Source Forms.\n\n  You may convey a covered work in object code form under the terms\nof sections 4 and 5, provided that you also convey the\nmachine-readable Corresponding Source under the terms of this License,\nin one of these ways:\n\n    a) Convey the object code in, or embodied in, a physical product\n    (including a physical distribution medium), accompanied by the\n    Corresponding Source fixed on a durable physical medium\n    customarily used for software interchange.\n\n    b) Convey the object code in, or embodied in, a physical product\n    (including a physical distribution medium), accompanied by a\n    written offer, valid for at least three years and valid for as\n    long as you offer spare parts or customer support for that product\n    model, to give anyone who possesses the object code either (1) a\n    copy of the Corresponding Source for all the software in the\n    product that is covered by this License, on a durable physical\n    medium customarily used for software interchange, for a price no\n    more than your reasonable cost of physically performing this\n    conveying of source, or (2) access to copy the\n    Corresponding Source from a network server at no charge.\n\n    c) Convey individual copies of the object code with a copy of the\n    written offer to provide the Corresponding Source.  This\n    alternative is allowed only occasionally and noncommercially, and\n    only if you received the object code with such an offer, in accord\n    with subsection 6b.\n\n    d) Convey the object code by offering access from a designated\n    place (gratis or for a charge), and offer equivalent access to the\n    Corresponding Source in the same way through the same place at no\n    further charge.  You need not require recipients to copy the\n    Corresponding Source along with the object code.  If the place to\n    copy the object code is a network server, the Corresponding Source\n    may be on a different server (operated by you or a third party)\n    that supports equivalent copying facilities, provided you maintain\n    clear directions next to the object code saying where to find the\n    Corresponding Source.  Regardless of what server hosts the\n    Corresponding Source, you remain obligated to ensure that it is\n    available for as long as needed to satisfy these requirements.\n\n    e) Convey the object code using peer-to-peer transmission, provided\n    you inform other peers where the object code and Corresponding\n    Source of the work are being offered to the general public at no\n    charge under subsection 6d.\n\n  A separable portion of the object code, whose source code is excluded\nfrom the Corresponding Source as a System Library, need not be\nincluded in conveying the object code work.\n\n  A \"User Product\" is either (1) a \"consumer product\", which means any\ntangible personal property which is normally used for personal, family,\nor household purposes, or (2) anything designed or sold for incorporation\ninto a dwelling.  In determining whether a product is a consumer product,\ndoubtful cases shall be resolved in favor of coverage.  For a particular\nproduct received by a particular user, \"normally used\" refers to a\ntypical or common use of that class of product, regardless of the status\nof the particular user or of the way in which the particular user\nactually uses, or expects or is expected to use, the product.  A product\nis a consumer product regardless of whether the product has substantial\ncommercial, industrial or non-consumer uses, unless such uses represent\nthe only significant mode of use of the product.\n\n  \"Installation Information\" for a User Product means any methods,\nprocedures, authorization keys, or other information required to install\nand execute modified versions of a covered work in that User Product from\na modified version of its Corresponding Source.  The information must\nsuffice to ensure that the continued functioning of the modified object\ncode is in no case prevented or interfered with solely because\nmodification has been made.\n\n  If you convey an object code work under this section in, or with, or\nspecifically for use in, a User Product, and the conveying occurs as\npart of a transaction in which the right of possession and use of the\nUser Product is transferred to the recipient in perpetuity or for a\nfixed term (regardless of how the transaction is characterized), the\nCorresponding Source conveyed under this section must be accompanied\nby the Installation Information.  But this requirement does not apply\nif neither you nor any third party retains the ability to install\nmodified object code on the User Product (for example, the work has\nbeen installed in ROM).\n\n  The requirement to provide Installation Information does not include a\nrequirement to continue to provide support service, warranty, or updates\nfor a work that has been modified or installed by the recipient, or for\nthe User Product in which it has been modified or installed.  Access to a\nnetwork may be denied when the modification itself materially and\nadversely affects the operation of the network or violates the rules and\nprotocols for communication across the network.\n\n  Corresponding Source conveyed, and Installation Information provided,\nin accord with this section must be in a format that is publicly\ndocumented (and with an implementation available to the public in\nsource code form), and must require no special password or key for\nunpacking, reading or copying.\n\n  7. Additional Terms.\n\n  \"Additional permissions\" are terms that supplement the terms of this\nLicense by making exceptions from one or more of its conditions.\nAdditional permissions that are applicable to the entire Program shall\nbe treated as though they were included in this License, to the extent\nthat they are valid under applicable law.  If additional permissions\napply only to part of the Program, that part may be used separately\nunder those permissions, but the entire Program remains governed by\nthis License without regard to the additional permissions.\n\n  When you convey a copy of a covered work, you may at your option\nremove any additional permissions from that copy, or from any part of\nit.  (Additional permissions may be written to require their own\nremoval in certain cases when you modify the work.)  You may place\nadditional permissions on material, added by you to a covered work,\nfor which you have or can give appropriate copyright permission.\n\n  Notwithstanding any other provision of this License, for material you\nadd to a covered work, you may (if authorized by the copyright holders of\nthat material) supplement the terms of this License with terms:\n\n    a) Disclaiming warranty or limiting liability differently from the\n    terms of sections 15 and 16 of this License; or\n\n    b) Requiring preservation of specified reasonable legal notices or\n    author attributions in that material or in the Appropriate Legal\n    Notices displayed by works containing it; or\n\n    c) Prohibiting misrepresentation of the origin of that material, or\n    requiring that modified versions of such material be marked in\n    reasonable ways as different from the original version; or\n\n    d) Limiting the use for publicity purposes of names of licensors or\n    authors of the material; or\n\n    e) Declining to grant rights under trademark law for use of some\n    trade names, trademarks, or service marks; or\n\n    f) Requiring indemnification of licensors and authors of that\n    material by anyone who conveys the material (or modified versions of\n    it) with contractual assumptions of liability to the recipient, for\n    any liability that these contractual assumptions directly impose on\n    those licensors and authors.\n\n  All other non-permissive additional terms are considered \"further\nrestrictions\" within the meaning of section 10.  If the Program as you\nreceived it, or any part of it, contains a notice stating that it is\ngoverned by this License along with a term that is a further\nrestriction, you may remove that term.  If a license document contains\na further restriction but permits relicensing or conveying under this\nLicense, you may add to a covered work material governed by the terms\nof that license document, provided that the further restriction does\nnot survive such relicensing or conveying.\n\n  If you add terms to a covered work in accord with this section, you\nmust place, in the relevant source files, a statement of the\nadditional terms that apply to those files, or a notice indicating\nwhere to find the applicable terms.\n\n  Additional terms, permissive or non-permissive, may be stated in the\nform of a separately written license, or stated as exceptions;\nthe above requirements apply either way.\n\n  8. Termination.\n\n  You may not propagate or modify a covered work except as expressly\nprovided under this License.  Any attempt otherwise to propagate or\nmodify it is void, and will automatically terminate your rights under\nthis License (including any patent licenses granted under the third\nparagraph of section 11).\n\n  However, if you cease all violation of this License, then your\nlicense from a particular copyright holder is reinstated (a)\nprovisionally, unless and until the copyright holder explicitly and\nfinally terminates your license, and (b) permanently, if the copyright\nholder fails to notify you of the violation by some reasonable means\nprior to 60 days after the cessation.\n\n  Moreover, your license from a particular copyright holder is\nreinstated permanently if the copyright holder notifies you of the\nviolation by some reasonable means, this is the first time you have\nreceived notice of violation of this License (for any work) from that\ncopyright holder, and you cure the violation prior to 30 days after\nyour receipt of the notice.\n\n  Termination of your rights under this section does not terminate the\nlicenses of parties who have received copies or rights from you under\nthis License.  If your rights have been terminated and not permanently\nreinstated, you do not qualify to receive new licenses for the same\nmaterial under section 10.\n\n  9. Acceptance Not Required for Having Copies.\n\n  You are not required to accept this License in order to receive or\nrun a copy of the Program.  Ancillary propagation of a covered work\noccurring solely as a consequence of using peer-to-peer transmission\nto receive a copy likewise does not require acceptance.  However,\nnothing other than this License grants you permission to propagate or\nmodify any covered work.  These actions infringe copyright if you do\nnot accept this License.  Therefore, by modifying or propagating a\ncovered work, you indicate your acceptance of this License to do so.\n\n  10. Automatic Licensing of Downstream Recipients.\n\n  Each time you convey a covered work, the recipient automatically\nreceives a license from the original licensors, to run, modify and\npropagate that work, subject to this License.  You are not responsible\nfor enforcing compliance by third parties with this License.\n\n  An \"entity transaction\" is a transaction transferring control of an\norganization, or substantially all assets of one, or subdividing an\norganization, or merging organizations.  If propagation of a covered\nwork results from an entity transaction, each party to that\ntransaction who receives a copy of the work also receives whatever\nlicenses to the work the party's predecessor in interest had or could\ngive under the previous paragraph, plus a right to possession of the\nCorresponding Source of the work from the predecessor in interest, if\nthe predecessor has it or can get it with reasonable efforts.\n\n  You may not impose any further restrictions on the exercise of the\nrights granted or affirmed under this License.  For example, you may\nnot impose a license fee, royalty, or other charge for exercise of\nrights granted under this License, and you may not initiate litigation\n(including a cross-claim or counterclaim in a lawsuit) alleging that\nany patent claim is infringed by making, using, selling, offering for\nsale, or importing the Program or any portion of it.\n\n  11. Patents.\n\n  A \"contributor\" is a copyright holder who authorizes use under this\nLicense of the Program or a work on which the Program is based.  The\nwork thus licensed is called the contributor's \"contributor version\".\n\n  A contributor's \"essential patent claims\" are all patent claims\nowned or controlled by the contributor, whether already acquired or\nhereafter acquired, that would be infringed by some manner, permitted\nby this License, of making, using, or selling its contributor version,\nbut do not include claims that would be infringed only as a\nconsequence of further modification of the contributor version.  For\npurposes of this definition, \"control\" includes the right to grant\npatent sublicenses in a manner consistent with the requirements of\nthis License.\n\n  Each contributor grants you a non-exclusive, worldwide, royalty-free\npatent license under the contributor's essential patent claims, to\nmake, use, sell, offer for sale, import and otherwise run, modify and\npropagate the contents of its contributor version.\n\n  In the following three paragraphs, a \"patent license\" is any express\nagreement or commitment, however denominated, not to enforce a patent\n(such as an express permission to practice a patent or covenant not to\nsue for patent infringement).  To \"grant\" such a patent license to a\nparty means to make such an agreement or commitment not to enforce a\npatent against the party.\n\n  If you convey a covered work, knowingly relying on a patent license,\nand the Corresponding Source of the work is not available for anyone\nto copy, free of charge and under the terms of this License, through a\npublicly available network server or other readily accessible means,\nthen you must either (1) cause the Corresponding Source to be so\navailable, or (2) arrange to deprive yourself of the benefit of the\npatent license for this particular work, or (3) arrange, in a manner\nconsistent with the requirements of this License, to extend the patent\nlicense to downstream recipients.  \"Knowingly relying\" means you have\nactual knowledge that, but for the patent license, your conveying the\ncovered work in a country, or your recipient's use of the covered work\nin a country, would infringe one or more identifiable patents in that\ncountry that you have reason to believe are valid.\n\n  If, pursuant to or in connection with a single transaction or\narrangement, you convey, or propagate by procuring conveyance of, a\ncovered work, and grant a patent license to some of the parties\nreceiving the covered work authorizing them to use, propagate, modify\nor convey a specific copy of the covered work, then the patent license\nyou grant is automatically extended to all recipients of the covered\nwork and works based on it.\n\n  A patent license is \"discriminatory\" if it does not include within\nthe scope of its coverage, prohibits the exercise of, or is\nconditioned on the non-exercise of one or more of the rights that are\nspecifically granted under this License.  You may not convey a covered\nwork if you are a party to an arrangement with a third party that is\nin the business of distributing software, under which you make payment\nto the third party based on the extent of your activity of conveying\nthe work, and under which the third party grants, to any of the\nparties who would receive the covered work from you, a discriminatory\npatent license (a) in connection with copies of the covered work\nconveyed by you (or copies made from those copies), or (b) primarily\nfor and in connection with specific products or compilations that\ncontain the covered work, unless you entered into that arrangement,\nor that patent license was granted, prior to 28 March 2007.\n\n  Nothing in this License shall be construed as excluding or limiting\nany implied license or other defenses to infringement that may\notherwise be available to you under applicable patent law.\n\n  12. No Surrender of Others' Freedom.\n\n  If conditions are imposed on you (whether by court order, agreement or\notherwise) that contradict the conditions of this License, they do not\nexcuse you from the conditions of this License.  If you cannot convey a\ncovered work so as to satisfy simultaneously your obligations under this\nLicense and any other pertinent obligations, then as a consequence you may\nnot convey it at all.  For example, if you agree to terms that obligate you\nto collect a royalty for further conveying from those to whom you convey\nthe Program, the only way you could satisfy both those terms and this\nLicense would be to refrain entirely from conveying the Program.\n\n  13. Use with the GNU Affero General Public License.\n\n  Notwithstanding any other provision of this License, you have\npermission to link or combine any covered work with a work licensed\nunder version 3 of the GNU Affero General Public License into a single\ncombined work, and to convey the resulting work.  The terms of this\nLicense will continue to apply to the part which is the covered work,\nbut the special requirements of the GNU Affero General Public License,\nsection 13, concerning interaction through a network will apply to the\ncombination as such.\n\n  14. Revised Versions of this License.\n\n  The Free Software Foundation may publish revised and/or new versions of\nthe GNU General Public License from time to time.  Such new versions will\nbe similar in spirit to the present version, but may differ in detail to\naddress new problems or concerns.\n\n  Each version is given a distinguishing version number.  If the\nProgram specifies that a certain numbered version of the GNU General\nPublic License \"or any later version\" applies to it, you have the\noption of following the terms and conditions either of that numbered\nversion or of any later version published by the Free Software\nFoundation.  If the Program does not specify a version number of the\nGNU General Public License, you may choose any version ever published\nby the Free Software Foundation.\n\n  If the Program specifies that a proxy can decide which future\nversions of the GNU General Public License can be used, that proxy's\npublic statement of acceptance of a version permanently authorizes you\nto choose that version for the Program.\n\n  Later license versions may give you additional or different\npermissions.  However, no additional obligations are imposed on any\nauthor or copyright holder as a result of your choosing to follow a\nlater version.\n\n  15. Disclaimer of Warranty.\n\n  THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY\nAPPLICABLE LAW.  EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT\nHOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM \"AS IS\" WITHOUT WARRANTY\nOF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,\nTHE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR\nPURPOSE.  THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM\nIS WITH YOU.  SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF\nALL NECESSARY SERVICING, REPAIR OR CORRECTION.\n\n  16. Limitation of Liability.\n\n  IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING\nWILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS\nTHE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY\nGENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE\nUSE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF\nDATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD\nPARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),\nEVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF\nSUCH DAMAGES.\n\n  17. Interpretation of Sections 15 and 16.\n\n  If the disclaimer of warranty and limitation of liability provided\nabove cannot be given local legal effect according to their terms,\nreviewing courts shall apply local law that most closely approximates\nan absolute waiver of all civil liability in connection with the\nProgram, unless a warranty or assumption of liability accompanies a\ncopy of the Program in return for a fee.\n\n                     END OF TERMS AND CONDITIONS\n\n            How to Apply These Terms to Your New Programs\n\n  If you develop a new program, and you want it to be of the greatest\npossible use to the public, the best way to achieve this is to make it\nfree software which everyone can redistribute and change under these terms.\n\n  To do so, attach the following notices to the program.  It is safest\nto attach them to the start of each source file to most effectively\nstate the exclusion of warranty; and each file should have at least\nthe \"copyright\" line and a pointer to where the full notice is found.\n\n    {one line to give the program's name and a brief idea of what it does.}\n    Copyright (C) {year}  {name of author}\n\n    This program is free software: you can redistribute it and/or modify\n    it under the terms of the GNU General Public License as published by\n    the Free Software Foundation, either version 3 of the License, or\n    (at your option) any later version.\n\n    This program is distributed in the hope that it will be useful,\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n    GNU General Public License for more details.\n\n    You should have received a copy of the GNU General Public License\n    along with this program.  If not, see <http://www.gnu.org/licenses/>.\n\nAlso add information on how to contact you by electronic and paper mail.\n\n  If the program does terminal interaction, make it output a short\nnotice like this when it starts in an interactive mode:\n\n    {project}  Copyright (C) {year}  {fullname}\n    This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.\n    This is free software, and you are welcome to redistribute it\n    under certain conditions; type `show c' for details.\n\nThe hypothetical commands `show w' and `show c' should show the appropriate\nparts of the General Public License.  Of course, your program's commands\nmight be different; for a GUI interface, you would use an \"about box\".\n\n  You should also get your employer (if you work as a programmer) or school,\nif any, to sign a \"copyright disclaimer\" for the program, if necessary.\nFor more information on this, and how to apply and follow the GNU GPL, see\n<http://www.gnu.org/licenses/>.\n\n  The GNU General Public License does not permit incorporating your program\ninto proprietary programs.  If your program is a subroutine library, you\nmay consider it more useful to permit linking proprietary applications with\nthe library.  If this is what you want to do, use the GNU Lesser General\nPublic License instead of this License.  But first, please read\n<http://www.gnu.org/philosophy/why-not-lgpl.html>.\n"
  },
  {
    "path": "README.md",
    "content": "# org-mind-map\nThis is an emacs package that creates graphviz directed graphs from org-mode files. This project is currently unmaintained! If anyone would like to take this over an fix up my (very messy) code, please let me know.\n\n# Requirements\n\nThis package relies on the [Graphviz](http://graphviz.org/) suite of graphical diagramming tools.\n## windows\n(the default option), these tools are available via [cygwin](http://cygwin.com/).\n## linux\nthese tools are available through any of the popular package managers.\n## mac\nbinarys are at the graphviz site, but for recent versions like El Capitan, Sierra and High Sierra, macports or\nhomebrew are recommended.\n\n```bash\nbrew install graphviz\n```\n\nThis package also relies on the org-mode and dash libraries, available from melpa (M-x list-packages).\n\n# Installation and usage\n\nTo install, add this code to your .emacs:\n\n```elisp\n(load \"INSTALLPATH/org-mind-map.el\")\n```\n\nor if you're using use-package:\n\n```elisp\n;; This is an Emacs package that creates graphviz directed graphs from\n;; the headings of an org file\n(use-package org-mind-map\n  :init\n  (require 'ox-org)\n  :ensure t\n  ;; Uncomment the below if 'ensure-system-packages` is installed\n  ;;:ensure-system-package (gvgen . graphviz)\n  :config\n  (setq org-mind-map-engine \"dot\")       ; Default. Directed Graph\n  ;; (setq org-mind-map-engine \"neato\")  ; Undirected Spring Graph\n  ;; (setq org-mind-map-engine \"twopi\")  ; Radial Layout\n  ;; (setq org-mind-map-engine \"fdp\")    ; Undirected Spring Force-Directed\n  ;; (setq org-mind-map-engine \"sfdp\")   ; Multiscale version of fdp for the layout of large graphs\n  ;; (setq org-mind-map-engine \"twopi\")  ; Radial layouts\n  ;; (setq org-mind-map-engine \"circo\")  ; Circular Layout\n  )\n```\n\nThen, run `M-x org-mind-map-write` within the org-mode file you would like to make a mind-map for. If all works as expected, a PDF file will be generated in the same directory as the org file.\n\n# Examples\n\n- [Basic concept](#basic-concept)\n- [Tags](#tags)\n- [Selective Colors](#selective-colors)\n- [Links](#links)\n- [Including text](#including-text)\n- [Including images (BETA)](#including-images-beta)\n- [Selective Export](#selective-export)\n\n## Basic concept\n\nHere is an example org-mode tree that demonstrates the basic concept:\n\n```Org\n* This is an example org-mode tree\nThe content of the node doesn't matter.\n** Branch A\n*** Sub-Branch 1\n*** Sub-Branch 2\n*** Sub-Branch 3\n** Branch B\n** Branch C\n** Branch D\n```\n\nand the result is shown below:\n\n![examples/example-1.org.pdf](examples/example-1.org.png)\n\n## Tags\n\nYou can also add tags, as in this org-mode file:\n\n```Org\n* This is an org-mode tree with tags\n** Branch A :TagA:\n*** Sub-Branch 1 :TagA:\n*** Sub-Branch 2 :TagA:\n*** Sub-Branch 3 :TagA:TagB:\n** Branch B :TagB:\n** Branch C\n** Branch D\n```\n\nThese are randomly color-coded into pastel tags:\n\n![examples/example-2.org.pdf](examples/example-2.org.png)\n\n## Selective Colors\n   If you would like a node to show up as a specific color, you can add the `:OMM-COLOR:` and `:OMM-LEGEND:` properties to a node. The node will be colored in, and a legend entry item will be added, as shown below:\n\n```Org\n* This is an org-mode tree with tags\n:PROPERTIES:\n:OMM-COLOR: GREEN\n:OMM-LEGEND: Legend entry\n:END:\n\n** Branch A\n*** Sub-Branch 1\n*** Sub-Branch 2\n*** Sub-Branch 3\n\n** Branch B\n\n\n** Branch C\n** Branch D\n* This is an org-mode tree that interleaves :TagOne:\n** Branch E\n*** Sub-Branch 3 :TagTwo:\n\n*** Sub-Branch 3 :TagOne:\n** Branch B\n** Branch C\n```\n\n this results in this file:\n\n![examples/example-4.org.png](examples/example-4.org.png)\n\n## Links\n   You can also draw edges between nodes by including links to headlines in your Org mode files. Links will be drawn from the parent heading to  the heading of the destination link. This works as shown below:\n\n```Org\n* This is an org-mode tree with tags\n:PROPERTIES:\n:OMM-COLOR: GREEN\n:OMM-LEGEND: Legend entry\n:END:\n\n** Branch A\n*** Sub-Branch 1\n*** Sub-Branch 2\n*** Sub-Branch 3\n\n** Branch B\n\n\n** Branch C\n** Branch D\n* Here is another tree\n** Branch One\n** Branch Two\n   [[Branch C]]\n** Branch Three\n\n   [[Branch One][Another link]]\n\n   [[Sub-Branch 1][Yet Another Link]]\n```\n\n this results in this file:\n\n![examples/example-5.org.png](examples/example-5.org.png)\n\n## Including text\n\n   You can also control the display of text within each heading with\n   the `org-mind-map-include-text` option. When set to `t`, this\n   displays all of the paragraph text underneath a given\n   headline.\n\nFor example,\n\n```Org\n* Branch One\n** Branch Two\n   Here is some interesting text...\n\n** Branch Three\n*** Example\n    - Plain lists show up as additional paragraphs\n\n    [[http://www.google.com/][But links don't show up at all]]\n\n    #+BEGIN_SRC\n    Nor do source code blocks.\n    #+END_SRC\n```\n\nthis results in this file:\n\n![examples/example-7.png](examples/example-7.png)\n\n\n## Including images BETA\n\n   You can also now include PNG files. These will be included as sub-headings. The images are currently scaled to a rectangle of 100px by 100px. This may be updated in the future.\n\nFor example,\n\n```Org\n* Node A\n\n** Node B\n\n   Example paragraph\n\n   [[Node C]]\n\n   [[./Lena.png]]\n\n** Node C\n\n   More details\n\n** Node D\n\n   [[Node A]]\n```\n\nResults in this file:\n\n![examples/example-8.png](examples/example-8.png)\n\n# Thanks!\n\nhttp://pages.sachachua.com/evil-plans/\n\n# Other Options\n\nCustomize the `org-mind-map-engine` variable to specify additional layout options (e.g. radial layouts where root nodes are in the center of the graph), and customize `org-mind-map-rankdir` to specify if the chart is going up-and-down or left-to-right.\n\n## Selective Export\n   Use the command `org-mind-map-write-current-tree` to just create a map from the current tree.\n"
  },
  {
    "path": "example-1.org",
    "content": "* This is an example org-mode tree \nThe content of the node doesn't matter.\n** Branch A\n*** Sub-Branch 1\n*** Sub-Branch 2\n*** Sub-Branch 3\n** Branch B\n** Branch C\n** Branch D\n\n"
  },
  {
    "path": "example-2.org",
    "content": "* This is an org-mode tree with tags\n** Branch A :TagA:\n*** Sub-Branch 1 :TagA:\n*** Sub-Branch 2 :TagA:\n*** Sub-Branch 3 :TagA:TagB:\n** Branch B :TagB:\n** Branch C\n** Branch D\n"
  },
  {
    "path": "example-3.org",
    "content": "* This is an org-mode tree with tags\n** Branch A :TagA:\n*** Sub-Branch 1 :TagA:\n*** Sub-Branch 2 :TagA:\n*** Sub-Branch 3 :TagA:TagB:\n** Branch B :TagB:\n** Branch C\n** Branch D\n* This is an org-mode tree that interleaves\n** Branch E\n*** Sub-Branch 3\n*** Sub-Branch 3 :TagA:TagB:\n** Branch B\n\n\n"
  },
  {
    "path": "example-4.org",
    "content": "* This is an org-mode tree with tags\n:PROPERTIES:\n:OMM-COLOR: GREEN\n:OMM-LEGEND: Legend entry\n:END:\n\n** Branch A \n*** Sub-Branch 1 \n*** Sub-Branch 2 \n*** Sub-Branch 3 \n\n** Branch B\n\n\n** Branch C \n** Branch D \n* This is an org-mode tree that interleaves :TagOne:\n** Branch E\n*** Sub-Branch 3 :TagTwo:\n\n*** Sub-Branch 3 :TagOne:\n** Branch B\n** Branch C\n"
  },
  {
    "path": "example-5.org",
    "content": "* This is an org-mode tree with tags\n:PROPERTIES:\n:OMM-COLOR: GREEN\n:OMM-LEGEND: Legend entry\n:END:\n\n** Branch A \n*** Sub-Branch 1 \n*** Sub-Branch 2 \n*** Sub-Branch 3 \n\n** Branch B\n\n\n** Branch C \n** Branch D \n* Here is another tree\n** Branch One\n** Branch Two\n   [[Branch C]]\n** Branch Three\n\n   [[Branch One][Another link]]\n\n   [[Sub-Branch 1][Yet Another Link]]\n\n\n"
  },
  {
    "path": "example-7.org",
    "content": "* Branch One\n** Branch Two\n   Here is some interesting text...\n\n** Branch Three\n*** Example\n    - Plain lists show up as additional paragraphs\n\n    [[http://www.google.com/][But links don't show up at all]]\n\n    #+BEGIN_SRC\n    Nor do source code blocks.\n    #+END_SRC\n"
  },
  {
    "path": "examples/example-1.org",
    "content": "* This is an example org-mode tree \nThe content of the node doesn't matter.\n** Branch A\n*** Sub-Branch 1\n*** Sub-Branch 2\n*** Sub-Branch 3\n** Branch B\n** Branch C\n** Branch D\n\n"
  },
  {
    "path": "examples/example-2.org",
    "content": "* This is an org-mode tree with tags\n** Branch A :TagA:\n*** Sub-Branch 1 :TagA:\n*** Sub-Branch 2 :TagA:\n*** Sub-Branch 3 :TagA:TagB:\n** Branch B :TagB:\n** Branch C\n** Branch D\n"
  },
  {
    "path": "examples/example-3.org",
    "content": "* This is an org-mode tree with tags\n** Branch A :TagA:\n*** Sub-Branch 1 :TagA:\n*** Sub-Branch 2 :TagA:\n*** Sub-Branch 3 :TagA:TagB:\n** Branch B :TagB:\n** Branch C\n** Branch D\n* This is an org-mode tree that interleaves\n** Branch E\n*** Sub-Branch 3\n*** Sub-Branch 3 :TagA:TagB:\n** Branch B\n\n\n"
  },
  {
    "path": "examples/example-4.org",
    "content": "* This is an org-mode tree with tags\n:PROPERTIES:\n:OMM-COLOR: GREEN\n:OMM-LEGEND: Legend entry\n:END:\n\n** Branch A \n*** Sub-Branch 1 \n*** Sub-Branch 2 \n*** Sub-Branch 3 \n\n** Branch B\n\n\n** Branch C \n** Branch D \n* This is an org-mode tree that interleaves :TagOne:\n** Branch E\n*** Sub-Branch 3 :TagTwo:\n\n*** Sub-Branch 3 :TagOne:\n** Branch B\n** Branch C\n"
  },
  {
    "path": "examples/example-5.org",
    "content": "* This is an org-mode tree with tags\n:PROPERTIES:\n:OMM-COLOR: GREEN\n:OMM-LEGEND: Legend entry\n:END:\n\n** Branch A \n*** Sub-Branch 1 \n*** Sub-Branch 2 \n*** Sub-Branch 3 \n\n** Branch B\n\n\n** Branch C \n** Branch D \n* Here is another tree\n** Branch One\n** Branch Two\n   [[Branch C]]\n** Branch Three\n\n   [[Branch One][Another link]]\n\n   [[Sub-Branch 1][Yet Another Link]]\n\n\n"
  },
  {
    "path": "examples/example-7.org",
    "content": "* Branch One\n** Branch Two\n   Here is some interesting text...\n\n** Branch Three\n*** Example\n    - Plain lists show up as additional paragraphs\n\n    [[http://www.google.com/][But links don't show up at all]]\n\n    #+BEGIN_SRC\n    Nor do source code blocks.\n    #+END_SRC\n"
  },
  {
    "path": "examples/example-8.org",
    "content": "* Node A\n\n** Node B\n\n   Example paragraph\n\n   [[Node C]]\n\n   [[./Lena.png]]\n\n** Node C\n\n   More details\n\n** Node D\n   \n   [[Node A]]\n"
  },
  {
    "path": "org-mind-map.el",
    "content": ";;; org-mind-map.el --- Creates a directed graph from org-mode files\n;; Author: Ted Wiles <theodore.wiles@gmail.com>\n;; Keywords: orgmode, extensions, graphviz, dot\n;; Version: 0.4\n;; URL: https://github.com/theodorewiles/org-mind-map\n;; Package-Requires: ((emacs \"24\") (dash \"1.8.0\") (org \"8.2.10\"))\n\n;; This file is NOT part of GNU Emacs.\n\n;; This program is free software; you can redistribute it and/or modify\n;; it under the terms of the GNU General Public License as published by\n;; the Free Software Foundation; either version 3, or (at your option)\n;; any later version.\n\n;; This program is distributed in the hope that it will be useful,\n;; but WITHOUT ANY WARRANTY; without even the implied warranty of\n;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n;; GNU General Public License for more details.\n\n;; You should have received a copy of the GNU General Public License\n;; along with GNU Emacs; see the file LICENSE.  If not, write to the\n;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,\n;; Boston, MA 02110-1301, USA.\n\n;;; Commentary:\n\n;; This package takes an org-mode tree and converts it into a\n;; file that can be read into graphviz in order to visually show the\n;; tree as a directed graph.  Mail to <theodore.wiles@gmail.com> to discuss\n;; features and additions.  All suggestions are more than welcome.\n\n;;; Commands:\n;;\n;; Below is a complete list of commands:\n;;\n;;  `org-mind-map-write'\n;;    Create a digraph based on all org trees in the current buffer.\n;;    Keybinding: M-x org-mind-map-write\n;;  `org-mind-map-write-current-branch'\n;;    Create a directed graph output based on just the current org tree branch.\n;;    Keybinding: M-x org-mind-map-write-current-branch\n;;  `org-mind-map-write-current-tree'\n;;    Create a directed graph output based on the whole current org tree.\n;;    Keybinding: M-x org-mind-map-write-current-tree\n;;\n;;; Customizable Options:\n;;\n;; Below is a list of customizable options:\n;;\n;;  `org-mind-map-wrap-line-length'\n;;    Line length within graphviz nodes.\n;;    default = 30\n;;  `org-mind-map-wrap-legend-line-length'\n;;    Line length of the graphviz legend.\n;;    default = 45\n;;  `org-mind-map-unflatten-command'\n;;    Shell executable command for running the UNFLATTEN command.\n;;    default = \"unflatten -l3\"\n;;  `org-mind-map-dot-command'\n;;    Shell executable command for running the DOT command.\n;;    default = \"dot\"\n;;  `org-mind-map-dot-output'\n;;    Format of the DOT output.  Defaults to PDF.\n;;    default = \"pdf\"\n;;  `org-mind-map-engine'\n;;    Sets the layout engine used in your graphs.\n;;    default = \"dot\"\n;;  `org-mind-map-default-node-attribs'\n;;    Alist of default node attributes and values.\n;;    default = '((\"shape\" . \"plaintext\"))\n;;  `org-mind-map-default-edge-attribs'\n;;    Alist of default edge attributes and values.\n;;    default = nil\n;;  `org-mind-map-default-graph-attribs'\n;;    Alist of default graph attributes and values.\n;;    default = '((\"autosize\" . \"false\") (\"size\" . \"9,12\") (\"resolution\" . \"100\") ...))\n;;  `org-mind-map-node-formats'\n;;    Assoc list of (NAME . FN) pairs where NAME is a value for the :OMM-NODE-FMT property\n;;    See also `org-mind-map-make-node-fn'\n;;    default = nil\n;;  `org-mind-map-edge-formats'\n;;    Assoc list of (NAME . FN) pairs where NAME is a value for the :OMM-EDGE-FMT property\n;;    See also `org-mind-map-make-edge-fn'\n;;    default = nil\n;;  `org-mind-map-edge-format-default'\n;;    Default format string for graph edges, e.g. \"[style=dotted]\".\n;;    default = \"\"\n;;  `org-mind-map-reserved-colors'\n;;    List of colors that will not be used for coloring tags.\n;;    default = nil\n;;  `org-mind-map-tag-colors'\n;;    An alist of (TAG . COLOR) pairs for choosing colors for tags.\n;;    default = nil\n;;  `org-mind-map-include-text'\n;;    A boolean indicating whether our not to include paragraph text in body of nodes.\n;;    default = t\n;;  `org-mind-map-include-images'\n;;    A boolean indicating whether our not to include images in body of nodes.\n;;    default = t\n\n\n;; The headings of the org-mode file are treated as node text in the resulting tree.\n;; Org-mode heading tags are included in the resulting tree as additional cells\n;; within the node.\n\n;; The tags are color-coded to be consistent across the tree.\n\n;; Tree interleaving is also possible by naming multiple org-mode headings\n;; with the same heading.\n\n;; NOTE: this requires the GRAPHVIZ software.  This is installable on\n;; windows using cygwin.\n\n;; To install, add this code to your .emacs:\n;; (load \"org-mind-map.el\")\n\n;; If on linux, customize the values of `org-mind-map-unflatten-command'\n;; and `org-mind-map-dot-command' to have the values corresponding to\n;; the executables in your system.\n\n;; Then, run \"M-x org-mind-map-write\" to create a graph of all trees in the current buffer,\n\n;; You can customize the style of the graph by adding :OMM-NODE-FMT and :OMM-EDGE-FMT properties\n;; to the headlines in the tree.\n\n;; The latest version is available at:\n;;\n;; https://github.com/theodorewiles/org-mind-map\n;;\n\n;;; Code:\n\n(require 'dash)\n(require 'org)\n(require 'subr-x)\n\n(defconst org-mind-map-version \"0.4\")\n\n(defgroup org-mind-map nil\n  \"Convert org-mode tree into a graphviz directed graph\"\n  :group 'org)\n\n(defcustom org-mind-map-wrap-line-length 30\n  \"Line length within graphviz nodes.\"\n  :type 'integer\n  :group 'org-mind-map)\n\n(defcustom org-mind-map-wrap-text-length 60\n  \"Line length within graphviz nodes that have longer text.\"\n  :type 'integer\n  :group 'org-mind-map)\n\n(defcustom org-mind-map-wrap-legend-line-length 45\n  \"Line length of the graphviz legend.\"\n  :type 'integer\n  :group 'org-mind-map)\n\n(defcustom org-mind-map-unflatten-command \"unflatten -l3\"\n  \"Shell executable command for running the UNFLATTEN command.\"\n  :type 'string\n  :group 'org-mind-map)\n\n(defcustom org-mind-map-dot-command \"dot\"\n  \"Shell executable command for running the DOT command.\"\n  :type 'string\n  :group 'org-mind-map)\n\n(defcustom org-mind-map-dot-output '(\"pdf\" \"png\" \"jpeg\" \"svg\" \"eps\" \"gif\" \"tiff\")\n  \"List of formats for the DOT output file.\nIf more than one are specified then the user will be prompted to choose one.\nTo find a list of available formats, on the command line enter: dot -T?\"\n  :type '(repeat (string :tag \"File type\"))\n  :group 'org-mind-map)\n\n(defcustom org-mind-map-display nil\n  \"How the results should be displayed:\nnil = don't display results\ncurrent = display results in current window\nwindow = display results in new window\nframe = display results in new frame\"\n  :type '(choice (const :tag \"Don't display\" nil)\n\t\t (const :tag \"Display in current window\" current)\n\t\t (const :tag \"Display in new window\" window)\n\t\t (const :tag \"Display in new frame\" frame))\n  :group 'org-mind-map)\n\n(defcustom org-mind-map-engine \"dot\"\n  \"Sets the layout engine used in your graphs.\nSee the graphviz user manual for description of these options.\"\n  :type '(choice\n          (const :tag \"Directed Graph\" \"dot\")\n          (const :tag \"Undirected Spring Graph\" \"neato\")\n          (const :tag \"Radial Layout\" \"twopi\")\n          (const :tag \"Circular Layout\" \"circo\")\n          (const :tag \"Undirected Spring Force-Directed\" \"fdp\"))\n  :group 'org-mind-map)\n\n(defcustom org-mind-map-default-node-attribs '((\"shape\" . \"plaintext\"))\n  \"Alist of default node attributes and values.\nEach item in the alist should be a cons cell of the form (ATTRIB . VALUE)\nwhere ATTRIB and VALUE are strings.\nFor a list of value attributes, see here: https://graphviz.gitlab.io/_pages/doc/info/attrs.html\"\n  :type '(alist :key-type (string :tag \"Attribute\") :value-type (string :tag \" Value\"))\n  :group 'org-mind-map)\n\n(defcustom org-mind-map-default-edge-attribs nil\n  \"Alist of default edge attributes and values.\nEach item in the alist should be a cons cell of the form (ATTRIB . VALUE)\nwhere ATTRIB and VALUE are strings.\nFor a list of value attributes, see here: https://graphviz.gitlab.io/_pages/doc/info/attrs.html\"\n  :type '(alist :key-type (string :tag \"Attribute\") :value-type (string :tag \" Value\"))\n  :group 'org-mind-map)\n\n(defcustom org-mind-map-default-graph-attribs '((\"autosize\" . \"false\")\n\t\t\t\t\t\t(\"size\" . \"9,12\")\n\t\t\t\t\t\t(\"resolution\" . \"100\")\n\t\t\t\t\t\t(\"nodesep\" . \"0.75\")\n\t\t\t\t\t\t(\"overlap\" . \"false\")\n\t\t\t\t\t\t(\"spline\" . \"true\")\n\t\t\t\t\t\t(\"rankdir\" . \"LR\"))\n  \"Alist of default graph attributes and values.\nEach item in the alist should be a cons cell of the form (ATTRIB . VALUE)\nwhere ATTRIB and VALUE are strings.\nFor a list of value attributes, see here: https://graphviz.gitlab.io/_pages/doc/info/attrs.html\"\n  :type '(alist :key-type (string :tag \"Attribute\") :value-type (string :tag \" Value\"))\n  :group 'org-mind-map)\n\n(defcustom org-mind-map-node-formats nil\n  \"Assoc list of (NAME . FN) pairs where NAME is a value for the :OMM-NODE-FMT property \nof a node/headline, and FN is a function which outputs a format string to be placed after the \nnode name (e.g. \\\"[label='Node1',color='red']\\\").\nThe function FN should take the following 5 arguments which can be used to construct the format: \n\nTITLE = the label string for the node\nTAGS = a list of org tags for the current node\nCOLOR = the contents of the OMM-COLOR property for the current node\nHM = a hash map of colors\nEL = an org element obtained from `org-element-map'\n\nNote: the :OMM-NODE-FMT property is inherited by children of the node/headline where it is defined.\"\n  :type '(alist :key-type (string :tag \"              Name\")\n\t\t:value-type (function :tag \"Format function\"))\n  :group 'org-mind-map)\n\n(defcustom org-mind-map-edge-formats nil\n  \"Assoc list of (NAME . FN) pairs where NAME is a value for the :OMM-EDGE-FMT property\nof a node/headline, and FN is a function which outputs a format string to be placed after an \nedge (e.g. \\\"[style=dotted]\\\"). \nThe function FN should take the following 2 arguments which can be used to construct the format: \n\nHM = a hash map of colors\nEL = an org element obtained from `org-element-map'\n\nNote: the :OMM-EDGE-FMT property affects edges leading to the node at which it is defined, and \nis inherited by children of that node/headline.\"\n  :type '(alist :key-type (string :tag \"              Name\")\n\t\t:value-type (function :tag \"Format function\"))\n  :group 'org-mind-map)\n\n(defcustom org-mind-map-edge-format-default \"\"\n  \"Default format string for graph edges, e.g. \\\"[style=dotted]\\\".\"\n  :type 'string\n  :group 'org-mind-map)\n\n(defcustom org-mind-map-reserved-colors nil\n  \"List of colors that will not be used for coloring tags.\nThese colors will be excluded when random tag colors are chosen by `org-mind-map-rgb'\nso that you can use them for other things.\nEach color should be in hexadecimal form, e.g: \\\"#e3cfbc\\\", where the consecutive pairs\nof hexdigits indicate levels of red, green and blue respectively.\nIt is not necessary to include any colors with levels below 7d, as these are not used\nfor creating random tag colors.\"\n  :type '(repeat string)\n  :group 'org-mind-map)\n\n(defcustom org-mind-map-tag-colors nil\n  \"An alist of (TAG . COLOR) pairs for choosing colors for tags.\nAny tags not listed here will be colored with randomly selected colors that dont\nclash with those in `org-mind-map-reserved-colors'.\nEach color should be in hexadecimal form, e.g: \\\"#e3cfbc\\\", where the consecutive pairs\nof hexdigits indicate levels of red, green and blue respectively.\n\nNote: you can also set tag colors by altering the hashmap passed as an argument to functions\ndefined in `org-mind-map-node-formats'.\"\n  :type '(alist :key-type (string :tag \"     Tag\") :value-type (string :tag \"Color\"))\n  :group 'org-mind-map)\n\n(defcustom org-mind-map-include-text t\n  \"A boolean indicating whether our not to include paragraph text in body of nodes.\n   default = t\"\n  :type 'boolean\n  :group 'org-mind-map\n  )\n\n(defcustom org-mind-map-include-images t\n  \"A boolean indicating whether our not to include paragraph text in body of nodes.\n   default = t\"\n  :type 'boolean\n  :group 'org-mind-map\n  )\n\n\n(defun org-mind-map-do-wrap (words width)\n  \"Create lines of maximum width WIDTH (in characters) from word list WORDS.\"\n  (let (lines line)\n    (while words\n      (setq line (pop words))\n      (while (and words (< (+ (length line) (length (car words))) width))\n\t(setq line (concat line \" \" (pop words))))\n      (setq lines (push line lines)))\n    (nreverse lines)))\n\n(defun org-mind-map-wrap (s l)\n  (let* ((s2 (org-mind-map-do-wrap (split-string s \" \") l)))\n    (mapconcat 'identity s2 \"<br></br>\")))\n\n(defun org-mind-map-wrap-lines (s)\n  \"Wraps a string S so that it can never be more than ORG-MIND-MAP-WRAP-LINE-LENGTH characters long.\"\n  (org-mind-map-wrap s org-mind-map-wrap-line-length))\n\n(defun org-mind-map-wrap-text (s)\n  \"Wraps a string S so that it can never be more than ORG-MIND-MAP-WRAP-TEXT-LENGTH characters long.\"\n  (org-mind-map-wrap s org-mind-map-wrap-text-length))\n\n\n(defun org-mind-map-wrap-legend-lines (s)\n  \"Wraps a string S so that it can never be more than ORG-MIND-MAP-WRAP-LEGEND-LINE-LENGTH characters long.\"\n  (let* ((s2 (org-mind-map-do-wrap (split-string s \" \") org-mind-map-wrap-legend-line-length)))\n    (mapconcat 'identity s2 \"<br></br>\")))\n\n(defun org-mind-map-dot-node-name (s)\n  \"Make string S formatted to be usable within dot node names.\"\n  (concat \"\\\"\"\n\t  (replace-regexp-in-string\n\t   \"</?\\\\(table\\\\|tr\\\\|td\\\\)[^<>]*>\" \"\"\n\t   (replace-regexp-in-string \"label=\\\\(\\\"[^\\\"]+\\\"\\\\|[^,]+\\\\).*\" \"\\\\1\" s))\n\t  \"\\\"\"))\n\n(defun org-mind-map-add-color (hm tag &optional colspan)\n  \"Create data element containing TAG with associated color found in hashmap HM.\"\n  (let* ((color (gethash tag hm)))\n    (concat \"<td\"\n\t    (if colspan (concat \" colspan=\\\"\" (int-to-string colspan) \"\\\"\"))\n\t    (if color (concat \" bgcolor=\\\"\" color \"\\\"\")) \">\" tag \"</td>\")))\n\n(defun org-mind-map-write-tags-default (title tags color hm el &optional content images)\n  \"Default function for writing nodes.\nLabel node with TITLE and background COLOR, and write TAGS (a list of tag names)\ninto boxes underneath, using associated colors in hashmap HM.\nThe EL argument is not used, but is needed for compatibility.\"\n  (concat \"[label=<<table>\"\n\t  (if (> (length tags) 0)\n\t      (concat \"<tr><td colspan=\\\"\" (int-to-string (length tags)) \"\\\" \")\n\t    \"<tr><td\")\n\t  (if color (concat \" bgcolor=\\\"\" color \"\\\" \"))\n\t  \">\" title \"</td></tr>\"\n\t  (if (> (length tags) 0)\n\t      (concat\n\t       \"<tr>\" (mapconcat (-partial 'org-mind-map-add-color hm) tags \"\") \"</tr>\"))\n\t  (if (> (length content) 0)\n\t      (concat\n\t       \"<tr><td BALIGN=\\\"LEFT\\\" ALIGN=\\\"LEFT\\\">\" content \"</td></tr>\")\n\t    )\n\n\t  (if (> (length images) 0)\n\t      images \"\"\n\t    )\n\t  \"</table>>];\"))\n\n(defun org-mind-map-get-property (prop el &optional inheritp)\n  \"Get property PROP from an org element EL, using inheritance if INHERITP is non-nil.\nPROP can be either the property symbol (beginning with :), or the name of the property (with or without :).\nIf there is a column summary value for the property that has recently be calculated it will be used.\"\n  (let* ((node el)\n\t (propstr (if (stringp prop)\n\t\t      (upcase (if (string-match \"^:\" prop)\n\t\t\t\t  (substring prop 1)\n\t\t\t\tprop))\n\t\t    (substring (symbol-name prop) 1)))\n\t (prop (if (stringp prop) (intern (concat \":\" propstr)) prop))\n\t (val (or (cdr (cl-find propstr (get-text-property\n\t\t\t\t\t (org-element-property :begin el)\n\t\t\t\t\t 'org-summaries)\n\t\t\t\t:test (lambda (x y) (equal (caar y) x))))\n\t\t  (org-element-property prop el))))\n    (while (and inheritp\n\t\t(not val)\n\t\t(not (eq (org-element-type node) 'org-data)))\n      (setq node (org-element-property :parent node)\n\t    val (org-element-property prop node)))\n    val))\n\n(defun org-mind-map-narrow-to-heading-content (b)\n  \"Narrow to the region until the next headline, if applicable\"\n  (let* ((new-end \n\t  (org-element-map (org-element-parse-buffer 'object 'true)\n\t      'headline\n\t    (lambda (x)\n\t      (if (not\n\t\t   (= (org-element-property :begin x) b))\n\t\t  b nil))\n\t    nil 'true)))\n    (if new-end\n\t(progn\n\t  (widen)\n\t  (narrow-to-region b new-end)))))\n\n\n(defun org-mind-map-write-tags (hm el &optional edgep)\n  \"Use HM as the hash-map of colors and takes an element EL and extracts the title and tags.  \nThen, formats the titles and tags so as to be usable within DOT's graphviz language.\"\n  (let* ((ts (org-element-property :title el))\n\t (wrapped-title (org-mind-map-wrap-lines (if (listp ts) (first ts) ts)))\n         (title (replace-regexp-in-string \"&\" \"&amp;\" wrapped-title nil t))\n         (color (org-element-property :OMM-COLOR el))\n\t (tags (org-element-property :tags el))\n\t (fmt (org-mind-map-get-property (if edgep :OMM-EDGE-FMT :OMM-NODE-FMT) el))\n\t (b (org-element-property :begin el))\n\t (e (org-element-property :end el))\n\t (images\n\t  (if org-mind-map-include-images\n\t      (save-restriction\n\t\t(narrow-to-region b e)\n\t\t(org-mind-map-narrow-to-heading-content b)\n\t\t(mapconcat 'identity\n\t\t\t   (org-element-map (org-element-parse-buffer 'object 'true)\n\t\t\t       '(link)\n\t\t\t     (lambda (x)\n\t\t\t       (message \"Inline image: %s\" (org-export-inline-image-p x))\n\t\t\t       (if (org-export-inline-image-p x)\n\t\t\t\t   (concat \n\t\t\t\t    \"<tr><td fixedsize='TRUE' height='100' width='100'>\" \"<IMG src='\"\n\t\t\t\t    (org-element-property :path x)\n\t\t\t\t    \"'/>\"\n\t\t\t\t    \"</td></tr>\")\n\t\t\t\t \"\")))\n\t\t\t   \"\"))))\n\t (content\n\t  (if org-mind-map-include-text\n\t      (save-restriction\n\t\t(narrow-to-region b e)\n\t\t(org-mind-map-narrow-to-heading-content b)\n\t\t(mapconcat 'identity\n\t\t\t   (org-element-map (org-element-parse-buffer 'object 'true)\n\t\t\t       '(paragraph)\n\t\t\t     (lambda (x)\n\t\t\t       (org-mind-map-wrap-text\n\t\t\t\t(string-trim\n\t\t\t\t (substring-no-properties\n\t\t\t\t  (car (org-element-contents x)))))))\n\t\t\t   \"<br></br><br></br>\"))\n\t    nil))\n\t )\n\t(if edgep (funcall (or (cdr (assoc fmt org-mind-map-edge-formats))\n\t\t\t       (lambda (a b) org-mind-map-edge-format-default))\n\t\t\t   hm el)\n\t  (funcall (or (cdr (assoc fmt org-mind-map-node-formats))\n\t\t       'org-mind-map-write-tags-default)\n\t\t   title tags color hm el content images))))\n\n(defun org-mind-map-first-headline (e)\n  \"Figure out the first headline within element E.\"\n  (let* ((parent (org-element-property :parent e)))\n    (if parent\n        (if (eq (org-element-type parent) 'headline)\n            parent\n          (org-mind-map-first-headline parent))\n      nil)))\n\n(defun org-mind-map-valid-link? (e)\n  \"Is E at a valid link?\"\n  (condition-case ex\n      (let* ((org-link-search-inhibit-query t)\n\t     (type (org-element-property :type e))\n             (l (org-element-property :path e)))\n\t(if (string= type \"fuzzy\")\n\t    (save-excursion\n\t      (org-link-search l) t)\n\t  nil))\n    ('error nil)))\n\n(defun org-mind-map-destination-headline (e)\n  \"Figure out where the link in E is pointing to.\"\n  (let* ((l (org-element-property :path e))\n         (org-link-search-inhibit-query t))\n\t(save-excursion\n\t  (org-open-link-from-string (concat \"[[\" l \"]]\"))\n\t  (org-element-at-point))))\n\n(defun org-mind-map-get-links (hm)\n  \"Make a list of links with the headline they are within and\ntheir destination. Pass hashmap arg HM mapping tags to colors \nin order to keep the tag colors consistent across calls.\"\n  (org-element-map (org-element-parse-buffer 'object)\n      'link\n    (lambda (l)\n      (if (org-mind-map-valid-link? l)\n\t  (let* ((origin\n\t\t  (org-mind-map-write-tags hm\n\t\t\t\t\t   (org-mind-map-first-headline l)))\n\t\t (h (org-mind-map-destination-headline l))\n\t\t (destination\n\t\t  (org-mind-map-write-tags hm h)))\n\t    (list origin destination))))))\n\n(defun org-mind-map-make-legend (h)\n  \"Make a legend using the hash-map HM.\"\n  (let ((res '()))\n    (maphash (lambda (k v) (push k res)) h)\n    (if (> (length res) 0)\n        (concat\n         \"{\n    Legend [shape=none, margin=0, label=<\n    <TABLE BORDER=\\\"0\\\" CELLBORDER=\\\"1\\\" CELLSPACING=\\\"0\\\" CELLPADDING=\\\"4\\\">\n     <TR>\n      <TD COLSPAN=\\\"2\\\"><B>Legend</B></TD>\n     </TR>\"\n         (mapconcat 'identity\n                    (let* (result)\n                      (maphash\n                       (lambda (name color)\n                         (push (concat \"<tr><td>\" (org-mind-map-wrap-legend-lines name)\n                                       \"</td><td bgcolor=\\\"\" color \"\\\">&nbsp;&nbsp;&nbsp;&nbsp;</td></tr>\")\n                               result))\n                       h)\n                      (reverse result))\n                    \"\")\n         \"</TABLE>>];}\"))))\n\n(defun org-mind-map-rgb (&optional exceptions)\n  \"Make a random pastel-like RGB color.\nDont return any of the colors listed in the optional arg EXCEPTIONS.\"\n  (let* ((fn (lambda nil\n\t       (concat \"#\"\n\t\t       (format \"%x\" (+ 125 (random (- 255 125))))\n\t\t       (format \"%x\" (+ 125 (random (- 255 125))))\n\t\t       (format \"%x\" (+ 125 (random (- 255 125)))))))\n\t (color (funcall fn)))\n    (while (member color exceptions)\n      (setq color (funcall fn)))\n    color))\n\n(defun org-mind-map-tags (&optional exceptions)\n  \"Return a hash map of tags in the org file mapped to random colors.\nDont return any of the colors listed in the optional arg EXCEPTIONS.\"\n  (let* ((hm (make-hash-table :test 'equal)))\n    (org-element-map (org-element-parse-buffer 'headline) 'headline\n      (lambda (hl)\n        (let ((tags (mapcar 'substring-no-properties (org-element-property :tags hl)))\n\t      (legend (org-element-property :OMM-LEGEND hl))\n              (color (org-element-property :OMM-COLOR hl)))\n          (if legend (puthash legend color hm))\n\t  (if tags (mapcar (lambda (x)\n\t\t\t     (puthash x (--if-let (assoc x org-mind-map-tag-colors)\n\t\t\t\t\t    (cdr it)\n\t\t\t\t\t  (org-mind-map-rgb\n\t\t\t\t\t   (append exceptions\n\t\t\t\t\t\t   (mapcar 'cdr org-mind-map-tag-colors))))\n\t\t\t\t      hm))\n\t\t\t   tags)))))\n    hm))\n\n(defun org-mind-map-data (&optional linksp)\n  \"Create graph & tag legend of all directed pairs of headlines for constructing the digraph.\nIf LINKSP is non-nil include graph edges for org links.\"\n  (let* ((hm (org-mind-map-tags org-mind-map-reserved-colors))\n\t (output\n\t  (org-element-map (org-element-parse-buffer 'headline) 'headline\n\t    (lambda (hl)\n\t      (let ((parent (org-element-property :parent hl)))\n\t\t(and (eq (org-element-type parent) 'headline)\n\t\t     (list (org-mind-map-write-tags hm parent)\n\t\t\t   (org-mind-map-write-tags hm hl)\n\t\t\t   (org-mind-map-write-tags hm hl t))))))))\n    (list (append output (if linksp (org-mind-map-get-links hm))) hm)))\n\n(defun org-mind-map-make-dot (data)\n  \"Create the dot file from DATA.\"\n  (let ((table (nth 0 data))\n        (legend (nth 1 data)))\n    (concat \"digraph structs {\\n        // DEFAULT OPTIONS\\n\"\n\t    (if org-mind-map-default-graph-attribs\n\t\t(concat \"        graph [\"\n\t\t\t(mapconcat #'(lambda (x) (concat (car x) \"=\\\"\" (cdr x) \"\\\"\"))\n\t\t\t\t   org-mind-map-default-graph-attribs \", \")\n\t\t\t\"];\\n\"))\n\t    (if org-mind-map-default-node-attribs\n\t\t(concat\n\t\t \"        node [\" (mapconcat #'(lambda (x) (concat (car x) \"=\\\"\" (cdr x) \"\\\"\"))\n\t\t\t\t\t     org-mind-map-default-node-attribs \", \")\n\t\t \"];\\n\"))\n\t    (if org-mind-map-default-edge-attribs\n\t\t(concat\n\t\t \"        edge [\" (mapconcat #'(lambda (x) (concat (car x) \"=\\\"\" (cdr x) \"\\\"\"))\n\t\t\t\t\t     org-mind-map-default-edge-attribs \", \")\n\t\t \"];\\n\"))\n\t    \"        // NODES\\n\"\n\t    (mapconcat\n\t     #'(lambda (x) (concat \"        \" (org-mind-map-dot-node-name x) \" \" x))\n\t     (-distinct (-flatten (mapcar (lambda (x) (list (nth 0 x) (nth 1 x))) table)))\n\t     \"\\n\")\n\t    \"\\n        // EDGES\\n\"\n\t    (mapconcat #'(lambda (x) (format \"        %s -> %s;\"\n\t\t\t\t\t     (org-mind-map-dot-node-name (nth 0 x))\n\t\t\t\t\t     (org-mind-map-dot-node-name (nth 1 x))\n\t\t\t\t\t     (nth 2 x)))\n\t\t       table \"\\n\")\n\t    (org-mind-map-make-legend legend)\n\t    \"}\")))\n\n(defun org-mind-map-command (name outputtype)\n  \"Return the shell script that will create the correct file NAME of type OUTPUTTYPE.\nThe output file will be in the same location as the org file.\"\n  (concat org-mind-map-unflatten-command \" | \"\n\t  org-mind-map-dot-command \" -T\"\n\t  (shell-quote-argument outputtype) \" -K\"\n          (shell-quote-argument org-mind-map-engine) \" -o\"\n          (shell-quote-argument (concat name \".\" outputtype \"\"))))\n\n(defun org-mind-map-update-message (filename process event)\n  \"Write an update message on the output of running org-mind-map based on PROCESS and EVENT.\nOpen FILENAME according to value of `org-mind-map-display'.\"\n  (let* ((e (with-current-buffer \"*org-mind-map-errors*\"\n\t      (buffer-string))))\n    (if (string= e \"\")\n        (princ (format \"Org mind map %s\" event))\n      (princ (format \"Org mind map %sErrors: %s\" event e)))\n    (if (string= event \"finished\\n\")\n\t(progn\n\t  (cl-case org-mind-map-display\n\t    (nil nil)\n\t    (current (find-file filename))\n\t    (window (find-file-other-window filename))\n\t    (frame (switch-to-buffer-other-frame (find-file-noselect filename))))\n\t  (cl-case major-mode\n\t    (pdf-view-mode (pdf-view-fit-page-to-window))\n\t    (doc-view-mode (doc-view-fit-page-to-window)))))))\n\n(defun org-mind-map-write-named (name &optional debug linksp)\n  \"Create a directed graph output based on the org tree in the current buffer, with name NAME.  \nTo customize, see the org-mind-map group.\nIf DEBUG is non-nil, then print the dot command to the *Messages* buffer,\nand print the dotfile to the *Messages* buffer or to a file if DEBUG is a filename.\nIf LINKSP is non-nil include graph edges for org links.\"\n  (let ((dot (org-mind-map-make-dot (org-mind-map-data linksp)))\na\t(outputtype (if (> (length org-mind-map-dot-output) 1)\n\t\t\t(completing-read \"Output file type: \" org-mind-map-dot-output)\n\t\t      (car org-mind-map-dot-output))))\n    (if debug\n\t(progn (message (org-mind-map-command name outputtype))\n\t       (if (stringp debug)\n\t\t   (with-temp-file debug (insert dot))\n\t\t (message dot \"%s\"))))\n    (if (get-buffer \"*org-mind-map-errors*\")\n\t(kill-buffer \"*org-mind-map-errors*\"))\n    (let* ((p (start-process-shell-command\n\t       \"org-mind-map-s\" \"*org-mind-map-errors*\"\n\t       (org-mind-map-command name outputtype)))\n\t   (filename (concat name \".\" outputtype \"\")))\n      (process-send-string p dot)\n      (process-send-string p \"\\n\")\n      (process-send-eof p)\n      (set-process-sentinel p (-partial 'org-mind-map-update-message filename))\n      filename)))\n\n;;;###autoload\n(defun org-mind-map-write-with-prompt nil\n  \"Prompt for an output FILENAME (without extension) to write your output and .dot files.\"\n  (let ((filename (read-file-name \"What is the file name you would like to save to?\")))\n    (org-mind-map-write-named filename (concat filename \".dot\")\n\t\t\t      (y-or-n-p \"Include org links? \"))))\n\n(defun org-mind-map-default-filename (treenamep)\n  \"Return a default filename for saving the tree diagram.\nIf TREENAMEP is non-nil include in the filename the name of the top level header of the tree.\"\n  (concat (file-name-sans-extension (buffer-name))\n\t  \"_diagram\"\n\t  (if treenamep\n\t      (concat \"-\"\n\t\t      (replace-regexp-in-string \" +\" \"_\" (nth 4 (org-heading-components)))))))\n\n;;;###autoload\n(defun org-mind-map-write (&optional promptp)\n  \"Create a digraph based on all org trees in the current buffer.\nThe digraph will be named the same name as the current buffer.\nTo customize, see the org-mind-map group.\nIf called with prefix arg (or PROMPTP is non-nil), then call `org-mind-map-write-with-prompt'.\"\n  (interactive \"P\")\n  (if promptp (org-mind-map-write-with-prompt)\n    (org-mind-map-write-named (org-mind-map-default-filename nil))))\n\n;;;###autoload\n(defun org-mind-map-write-current-branch (&optional promptp)\n  \"Create a directed graph output based on just the current org tree branch.\nTo customize, see the org-mind-map group.\nIf called with prefix arg (or PROMPTP is non-nil), then call `org-mind-map-write-with-prompt'.\"\n  (interactive \"P\")\n  (org-narrow-to-subtree)\n  (let ((filename (if promptp (org-mind-map-write-with-prompt)\n\t\t    (org-mind-map-write-named (org-mind-map-default-filename t)))))\n    (widen)\n    filename))\n\n;;;###autoload\n(defun org-mind-map-write-current-tree (&optional promptp)\n  \"Create a directed graph output based on the whole current org tree.\nIf called with prefix arg (or PROMPTP is non-nil), then call `org-mind-map-write-with-prompt'.\"\n  (interactive \"P\")\n  (save-restriction\n    (ignore-errors (outline-up-heading 100))\n    (org-mind-map-write-current-branch promptp)))\n\n;;;###autoload\n(defmacro org-mind-map-make-node-fn (name doc props &optional shape color other)\n  \"Create a function org-mind-map-NAME-node for use with :OMM-NODE-FMT writing node properties.\nThe created function should be added to `org-mind-map-node-formats' and the associated string\ncan be used as the :OMM-NODE-FMT for a tree. \nDocument the function with the DOC arg.\nPROPS is a list of either property & format string pairs, or individual property names,\nwhich will be placed in each node, e.g: ((\\\"PROB\\\" \\\"probability=%s\\\") \\\"COST\\\"). \nFor property names with no format string, \\\"%s=%s\\\" will be used with the property name and value.\n\nThe node shape and background color can be specified with the optional SHAPE and COLOR arguments, \nand any other attributes (e.g. \\\"fontsize=30\\\") can be specified with the OTHER argument.\nEach of these arguments can be either a string or a form which is evaluated for each node, \nand returns a string.\n\nExample: (org-mind-map-make-node-fn decisiontree \\\"Draw decision tree\\\" (\\\"COST\\\" (\\\"NOTES\\\" \\\"Notes: %s\\\")) nil\n\t\t\t   (cond ((equal (org-mind-map-get-property :todo-keyword el) \\\"ACTION\\\") \\\"red\\\")\n\t\t\t\t ((equal (org-mind-map-get-property :todo-keyword el) \\\"STATE\\\") \\\"yellow\\\")\n\t\t\t\t ((equal (org-mind-map-get-property :todo-keyword el) \\\"DECISION\\\") \\\"green\\\")))\n\nYou could put this code in your emacs startup file (e.g. ~/.emacs) and then add to `org-mind-map-node-formats' \nthe pair '(\\\"decisiontree\\\" . org-mind-map-decisiontree-node), and use \\\":OMM-NODE-FMT: decisiontree\\\" as a\ntree property.\"\n  `(defun ,(intern (concat \"org-mind-map-\" (symbol-name name) \"-node\"))\n       (title tags color hm el)\n     ,doc\n     (let* ((numtags (if tags (length tags)))\n\t    (colspan (if tags (int-to-string numtags)))\n\t    (propstxt\n\t     (cl-remove\n\t      nil (list ,@(mapcar\n\t\t\t   (lambda (p)\n\t\t\t     (cond ((stringp p)\n\t\t\t\t    `(--if-let (org-mind-map-get-property ,p el)\n\t\t\t\t\t (concat ,(upcase p) \"=\" it)))\n\t\t\t\t   ((consp p)\n\t\t\t\t    `(--if-let (org-mind-map-get-property ,(car p) el)\n\t\t\t\t\t (format ,(nth 1 p) it)))\n\t\t\t\t   (t (error \"Invalid props value\"))))\n\t\t\t   props))))\n\t    (shape ,shape)\n\t    (color (or color ,color))\n\t    (other ,other))\n       (concat \"[label=<<table\" (if shape \" border=\\\"0\\\"\") \">\"\n\t       (if numtags (concat \"<tr><td colspan=\\\"\" colspan \"\\\" \") \"<tr><td\")\n\t       (if (and color (not shape)) (concat \" bgcolor=\\\"\" color \"\\\" \"))\n\t       \">\" title \"</td></tr>\"\n\t       (mapconcat (lambda (p)\n\t\t\t    (concat \"<tr>\" (org-mind-map-add-color hm p numtags) \"</tr>\"))\n\t\t\t  propstxt \"\")\n\t       (if numtags\n\t\t   (concat \"<tr>\"\n\t\t\t   (mapconcat (-partial 'org-mind-map-add-color hm) tags \"\")\n\t\t\t   \"</tr>\"))\n\t       \"</table>>\"\n\t       (if shape (concat \",shape=\" shape (if color (concat \",style=filled,color=\" color))))\n\t       (if other (concat \",\" other)) \"];\"))))\n\n;;;###autoload\n(defmacro org-mind-map-make-edge-fn (name doc props &optional style color other)\n  \"Create a function org-mind-map-write-NAME for writing edge properties which can be used for :OMM-EDGE-FMT.\nDocument the function with the DOC arg.\nPROPS is a list of either property & format string pairs, or individual property names,\nwhich will concatenated and used to label the edges, e.g: ((\\\"PROB\\\" \\\"probability=%s\\\") \\\"COST\\\"). \nFor property names with no format string \\\"%s=%s\\\" will be used with the property name and value.\n\nThe edge style and color can be specified with the optional STYLE and COLOR arguments,\nand any other attributes (e.g. \\\"fontsize=30\\\") can be specified with the OTHER argument.\nEach of these arguments can be either a string or a form which is evaluated for each node, \nand returns a string.\n\nExample: (org-mind-map-make-edge-fn decisiontree \\\"Draw decision tree\\\" (\\\"PROB\\\"))\n\nYou could put this code in your emacs startup file (e.g. ~/.emacs) and then add to `org-mind-map-edge-formats' \nthe pair '(\\\"decisiontree\\\" . org-mind-map-decisiontree-edge), and use \\\":OMM-EDGE-FMT: decisiontree\\\" as a\ntree property.\"\n  `(defun ,(intern (concat \"org-mind-map-\" (symbol-name name) \"-edge\"))\n       (hm el)\n     ,doc\n     (let* ((propstxt (cl-remove\n\t\t       nil (list ,@(mapcar (lambda (p)\n\t\t\t\t\t     (cond ((stringp p)\n\t\t\t\t\t\t    `(--if-let (org-mind-map-get-property ,p el)\n\t\t\t\t\t\t\t (concat ,(upcase p) \"=\" it)))\n\t\t\t\t\t\t   ((consp p)\n\t\t\t\t\t\t    `(--if-let (org-mind-map-get-property ,(car p) el)\n\t\t\t\t\t\t\t (format ,(nth 1 p) it)))\n\t\t\t\t\t\t   (t (error \"Invalid props value\"))))\n\t\t\t\t\t   props))))\n\t    (style ,style)\n\t    (color ,color)\n\t    (other ,other))\n       (concat \"[label=\\\"\" (mapconcat 'identity propstxt \",\") \"\\\"\"\n\t       (if color (concat \",color=\\\"\" color \"\\\" \"))\n\t       (if style (concat \",style=\\\"\" style \"\\\"\"))\n\t       (if other (concat \",\" other)) \"]\"))))\n\n(defun ox-graphviz-export (&optional async subtreep visible-only body-only info)\n  \"Export the current buffer to a graphviz diagram.\nOptional argument ASYNC to asynchronously export.\nOptional argument SUBTREEP to export current subtree.\nOptional argument VISIBLE-ONLY to only export visible content.\nOptional argument BODY-ONLY export only the body.\nOptional argument INFO is a plist of options.\"\n  (let ((org-mind-map-display nil))\n    (if subtreep (org-mind-map-write-current-branch)\n      (org-mind-map-write))))\n\n(defun ox-graphviz-export-and-open (&optional async subtreep visible-only body-only info)\n  \"Export the current buffer to a graphviz diagram, and open the output file.\nOptional argument ASYNC to asynchronously export.\nOptional argument SUBTREEP to export current subtree.\nOptional argument VISIBLE-ONLY to only export visible content.\nOptional argument BODY-ONLY export only the body.\nOptional argument INFO is a plist of options.\"\n  (let ((org-mind-map-display (or org-mind-map-display 'current)))\n    (if subtreep (org-mind-map-write-current-branch)\n      (org-mind-map-write))))\n\n(defun ox-graphviz-export-dot (&optional async subtreep visible-only body-only info)\n  \"Export the current buffer to a graphviz diagram, and create and open a dot file.\nOptional argument ASYNC to asynchronously export.\nOptional argument SUBTREEP to export current subtree.\nOptional argument VISIBLE-ONLY to only export visible content.\nOptional argument BODY-ONLY export only the body.\nOptional argument INFO is a plist of options.\"\n  (let ((org-mind-map-display nil)\n\t(filename (org-mind-map-default-filename subtreep))\n\t(linksp (y-or-n-p \"Include org links? \")))\n    (if subtreep (org-narrow-to-subtree))\n    (org-mind-map-write-named filename (concat filename \".dot\") linksp)\n    (widen)))\n\n(defun ox-graphviz-export-dot-and-open (&optional async subtreep visible-only body-only info)\n  \"Export the current buffer to a graphviz diagram and a dot file, and open the output file.\nOptional argument ASYNC to asynchronously export.\nOptional argument SUBTREEP to export current subtree.\nOptional argument VISIBLE-ONLY to only export visible content.\nOptional argument BODY-ONLY export only the body.\nOptional argument INFO is a plist of options.\"\n  (let ((org-mind-map-display (or org-mind-map-display 'current))\n\t(filename (org-mind-map-default-filename subtreep))\n\t(linksp (y-or-n-p \"Include org links? \")))\n    (if subtreep (org-narrow-to-subtree))\n    (org-mind-map-write-named filename (concat filename \".dot\") linksp)\n    (widen)))\n\n(defun org-mind-map-export-message nil\n  \"Message string for `org-export-dispatch' buffer.\"\n  (if (> (length org-mind-map-dot-output) 1)\n      \"Select output file format\"\n    (concat \"As \" (car org-mind-map-dot-output) \" file\")))\n\n(org-export-define-derived-backend 'graphviz 'org\n  :menu-entry\n  '(?g \"Export to graphviz diagram\"\n       ((?f \"Create graph\" ox-graphviz-export)\n\t(?o \"Create graph and open\" ox-graphviz-export-and-open)\n\t(?d \"Create graph & dot file\" ox-graphviz-export-dot)\n\t(?O \"Create graph & dot file, and open graph\" ox-graphviz-export-dot-and-open))))\n\n;; Add a tool bar icon\n;; (define-key org-mode-map [tool-bar org-button]\n;; '(menu-item \"Write the org-mode file mind map to disk.\" org-mind-map-write-with-prompt\n;;    :image (image :type xpm :file \"info.xpm\")\n;;    ))\n\n;; Add menu items\n;; (define-key org-mode-map [menu-bar Org Diagram]\n;;   (cons \"Graphviz diagram\" (make-sparse-keymap \"Graphviz diagram\")))\n\n;; (define-key org-mode-map [menu-bar Org Diagram all]\n;;   '(\"Diagram of whole buffer\" . org-mind-map-write))\n\n;; (define-key org-mode-map [menu-bar Org Diagram current]\n;;   '(\"Diagram of current tree\" . org-mind-map-write-current-tree))\n\n;; (define-key org-mode-map [menu-bar Org Diagram branch]\n;;   '(\"Diagram of current branch\" . org-mind-map-write-current-branch))\n\n;; (global-set-key (kbd \"<f4>\") 'org-mind-map-write)\n\n(provide 'org-mind-map)\n;;; org-mind-map.el ends here\n\n"
  }
]