From: rocky Date: Sun, 15 Feb 2015 23:28:34 +0000 (-0500) Subject: Oops - should have added in branch externals/ X-Git-Url: https://code.delx.au/gnu-emacs-elpa/commitdiff_plain/bfb36f072e1d8b382639bd5cc6087fb0c963894b Oops - should have added in branch externals/ --- diff --git a/packages/load-relative/.gitignore b/packages/load-relative/.gitignore deleted file mode 100644 index 61da6af28..000000000 --- a/packages/load-relative/.gitignore +++ /dev/null @@ -1,16 +0,0 @@ -/*.elc -/*~ -/Makefile -/Makefile.in -/aclocal.m4 -/autom4te.cache -/config.log -/config.status -/configure -/configure.lineno -/elc-stamp -/elc-temp -/elpa -/emacs-load-relative-*.tar.gz -/install-sh -/missing diff --git a/packages/load-relative/.travis.yml b/packages/load-relative/.travis.yml deleted file mode 100644 index d396f9e58..000000000 --- a/packages/load-relative/.travis.yml +++ /dev/null @@ -1,8 +0,0 @@ -language: emacs-lisp - -env: - - EMACS=emacs24 - -# run the tests -script: - - /bin/bash ./autogen.sh && cd test && make check-elget diff --git a/packages/load-relative/AUTHORS b/packages/load-relative/AUTHORS deleted file mode 100644 index 38a13b723..000000000 --- a/packages/load-relative/AUTHORS +++ /dev/null @@ -1 +0,0 @@ -Rocky Bernstein (rockyb@rubyforge.org) diff --git a/packages/load-relative/COPYING b/packages/load-relative/COPYING deleted file mode 100644 index 94a9ed024..000000000 --- a/packages/load-relative/COPYING +++ /dev/null @@ -1,674 +0,0 @@ - GNU GENERAL PUBLIC LICENSE - Version 3, 29 June 2007 - - Copyright (C) 2007 Free Software Foundation, Inc. - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The GNU General Public License is a free, copyleft license for -software and other kinds of works. - - The licenses for most software and other practical works are designed -to take away your freedom to share and change the works. By contrast, -the GNU General Public License is intended to guarantee your freedom to -share and change all versions of a program--to make sure it remains free -software for all its users. We, the Free Software Foundation, use the -GNU General Public License for most of our software; it applies also to -any other work released this way by its authors. You can apply it to -your programs, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -them if you wish), that you receive source code or can get it if you -want it, that you can change the software or use pieces of it in new -free programs, and that you know you can do these things. - - To protect your rights, we need to prevent others from denying you -these rights or asking you to surrender the rights. Therefore, you have -certain responsibilities if you distribute copies of the software, or if -you modify it: responsibilities to respect the freedom of others. - - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must pass on to the recipients the same -freedoms that you received. You must make sure that they, too, receive -or can get the source code. And you must show them these terms so they -know their rights. - - Developers that use the GNU GPL protect your rights with two steps: -(1) assert copyright on the software, and (2) offer you this License -giving you legal permission to copy, distribute and/or modify it. - - For the developers' and authors' protection, the GPL clearly explains -that there is no warranty for this free software. For both users' and -authors' sake, the GPL requires that modified versions be marked as -changed, so that their problems will not be attributed erroneously to -authors of previous versions. - - Some devices are designed to deny users access to install or run -modified versions of the software inside them, although the manufacturer -can do so. This is fundamentally incompatible with the aim of -protecting users' freedom to change the software. The systematic -pattern of such abuse occurs in the area of products for individuals to -use, which is precisely where it is most unacceptable. Therefore, we -have designed this version of the GPL to prohibit the practice for those -products. If such problems arise substantially in other domains, we -stand ready to extend this provision to those domains in future versions -of the GPL, as needed to protect the freedom of users. - - Finally, every program is threatened constantly by software patents. -States should not allow patents to restrict development and use of -software on general-purpose computers, but in those that do, we wish to -avoid the special danger that patents applied to a free program could -make it effectively proprietary. To prevent this, the GPL assures that -patents cannot be used to render the program non-free. - - The precise terms and conditions for copying, distribution and -modification follow. - - TERMS AND CONDITIONS - - 0. Definitions. - - "This License" refers to version 3 of the GNU General Public License. - - "Copyright" also means copyright-like laws that apply to other kinds of -works, such as semiconductor masks. - - "The Program" refers to any copyrightable work licensed under this -License. Each licensee is addressed as "you". "Licensees" and -"recipients" may be individuals or organizations. - - To "modify" a work means to copy from or adapt all or part of the work -in a fashion requiring copyright permission, other than the making of an -exact copy. The resulting work is called a "modified version" of the -earlier work or a work "based on" the earlier work. - - A "covered work" means either the unmodified Program or a work based -on the Program. - - To "propagate" a work means to do anything with it that, without -permission, would make you directly or secondarily liable for -infringement under applicable copyright law, except executing it on a -computer or modifying a private copy. Propagation includes copying, -distribution (with or without modification), making available to the -public, and in some countries other activities as well. - - To "convey" a work means any kind of propagation that enables other -parties to make or receive copies. Mere interaction with a user through -a computer network, with no transfer of a copy, is not conveying. - - An interactive user interface displays "Appropriate Legal Notices" -to the extent that it includes a convenient and prominently visible -feature that (1) displays an appropriate copyright notice, and (2) -tells the user that there is no warranty for the work (except to the -extent that warranties are provided), that licensees may convey the -work under this License, and how to view a copy of this License. If -the interface presents a list of user commands or options, such as a -menu, a prominent item in the list meets this criterion. - - 1. Source Code. - - The "source code" for a work means the preferred form of the work -for making modifications to it. "Object code" means any non-source -form of a work. - - A "Standard Interface" means an interface that either is an official -standard defined by a recognized standards body, or, in the case of -interfaces specified for a particular programming language, one that -is widely used among developers working in that language. - - The "System Libraries" of an executable work include anything, other -than the work as a whole, that (a) is included in the normal form of -packaging a Major Component, but which is not part of that Major -Component, and (b) serves only to enable use of the work with that -Major Component, or to implement a Standard Interface for which an -implementation is available to the public in source code form. A -"Major Component", in this context, means a major essential component -(kernel, window system, and so on) of the specific operating system -(if any) on which the executable work runs, or a compiler used to -produce the work, or an object code interpreter used to run it. - - The "Corresponding Source" for a work in object code form means all -the source code needed to generate, install, and (for an executable -work) run the object code and to modify the work, including scripts to -control those activities. However, it does not include the work's -System Libraries, or general-purpose tools or generally available free -programs which are used unmodified in performing those activities but -which are not part of the work. For example, Corresponding Source -includes interface definition files associated with source files for -the work, and the source code for shared libraries and dynamically -linked subprograms that the work is specifically designed to require, -such as by intimate data communication or control flow between those -subprograms and other parts of the work. - - The Corresponding Source need not include anything that users -can regenerate automatically from other parts of the Corresponding -Source. - - The Corresponding Source for a work in source code form is that -same work. - - 2. Basic Permissions. - - All rights granted under this License are granted for the term of -copyright on the Program, and are irrevocable provided the stated -conditions are met. This License explicitly affirms your unlimited -permission to run the unmodified Program. The output from running a -covered work is covered by this License only if the output, given its -content, constitutes a covered work. This License acknowledges your -rights of fair use or other equivalent, as provided by copyright law. - - You may make, run and propagate covered works that you do not -convey, without conditions so long as your license otherwise remains -in force. You may convey covered works to others for the sole purpose -of having them make modifications exclusively for you, or provide you -with facilities for running those works, provided that you comply with -the terms of this License in conveying all material for which you do -not control copyright. Those thus making or running the covered works -for you must do so exclusively on your behalf, under your direction -and control, on terms that prohibit them from making any copies of -your copyrighted material outside their relationship with you. - - Conveying under any other circumstances is permitted solely under -the conditions stated below. Sublicensing is not allowed; section 10 -makes it unnecessary. - - 3. Protecting Users' Legal Rights From Anti-Circumvention Law. - - No covered work shall be deemed part of an effective technological -measure under any applicable law fulfilling obligations under article -11 of the WIPO copyright treaty adopted on 20 December 1996, or -similar laws prohibiting or restricting circumvention of such -measures. - - When you convey a covered work, you waive any legal power to forbid -circumvention of technological measures to the extent such circumvention -is effected by exercising rights under this License with respect to -the covered work, and you disclaim any intention to limit operation or -modification of the work as a means of enforcing, against the work's -users, your or third parties' legal rights to forbid circumvention of -technological measures. - - 4. Conveying Verbatim Copies. - - You may convey verbatim copies of the Program's source code as you -receive it, in any medium, provided that you conspicuously and -appropriately publish on each copy an appropriate copyright notice; -keep intact all notices stating that this License and any -non-permissive terms added in accord with section 7 apply to the code; -keep intact all notices of the absence of any warranty; and give all -recipients a copy of this License along with the Program. - - You may charge any price or no price for each copy that you convey, -and you may offer support or warranty protection for a fee. - - 5. Conveying Modified Source Versions. - - You may convey a work based on the Program, or the modifications to -produce it from the Program, in the form of source code under the -terms of section 4, provided that you also meet all of these conditions: - - a) The work must carry prominent notices stating that you modified - it, and giving a relevant date. - - b) The work must carry prominent notices stating that it is - released under this License and any conditions added under section - 7. This requirement modifies the requirement in section 4 to - "keep intact all notices". - - c) You must license the entire work, as a whole, under this - License to anyone who comes into possession of a copy. This - License will therefore apply, along with any applicable section 7 - additional terms, to the whole of the work, and all its parts, - regardless of how they are packaged. This License gives no - permission to license the work in any other way, but it does not - invalidate such permission if you have separately received it. - - d) If the work has interactive user interfaces, each must display - Appropriate Legal Notices; however, if the Program has interactive - interfaces that do not display Appropriate Legal Notices, your - work need not make them do so. - - A compilation of a covered work with other separate and independent -works, which are not by their nature extensions of the covered work, -and which are not combined with it such as to form a larger program, -in or on a volume of a storage or distribution medium, is called an -"aggregate" if the compilation and its resulting copyright are not -used to limit the access or legal rights of the compilation's users -beyond what the individual works permit. Inclusion of a covered work -in an aggregate does not cause this License to apply to the other -parts of the aggregate. - - 6. Conveying Non-Source Forms. - - You may convey a covered work in object code form under the terms -of sections 4 and 5, provided that you also convey the -machine-readable Corresponding Source under the terms of this License, -in one of these ways: - - a) Convey the object code in, or embodied in, a physical product - (including a physical distribution medium), accompanied by the - Corresponding Source fixed on a durable physical medium - customarily used for software interchange. - - b) Convey the object code in, or embodied in, a physical product - (including a physical distribution medium), accompanied by a - written offer, valid for at least three years and valid for as - long as you offer spare parts or customer support for that product - model, to give anyone who possesses the object code either (1) a - copy of the Corresponding Source for all the software in the - product that is covered by this License, on a durable physical - medium customarily used for software interchange, for a price no - more than your reasonable cost of physically performing this - conveying of source, or (2) access to copy the - Corresponding Source from a network server at no charge. - - c) Convey individual copies of the object code with a copy of the - written offer to provide the Corresponding Source. This - alternative is allowed only occasionally and noncommercially, and - only if you received the object code with such an offer, in accord - with subsection 6b. - - d) Convey the object code by offering access from a designated - place (gratis or for a charge), and offer equivalent access to the - Corresponding Source in the same way through the same place at no - further charge. You need not require recipients to copy the - Corresponding Source along with the object code. If the place to - copy the object code is a network server, the Corresponding Source - may be on a different server (operated by you or a third party) - that supports equivalent copying facilities, provided you maintain - clear directions next to the object code saying where to find the - Corresponding Source. Regardless of what server hosts the - Corresponding Source, you remain obligated to ensure that it is - available for as long as needed to satisfy these requirements. - - e) Convey the object code using peer-to-peer transmission, provided - you inform other peers where the object code and Corresponding - Source of the work are being offered to the general public at no - charge under subsection 6d. - - A separable portion of the object code, whose source code is excluded -from the Corresponding Source as a System Library, need not be -included in conveying the object code work. - - A "User Product" is either (1) a "consumer product", which means any -tangible personal property which is normally used for personal, family, -or household purposes, or (2) anything designed or sold for incorporation -into a dwelling. In determining whether a product is a consumer product, -doubtful cases shall be resolved in favor of coverage. For a particular -product received by a particular user, "normally used" refers to a -typical or common use of that class of product, regardless of the status -of the particular user or of the way in which the particular user -actually uses, or expects or is expected to use, the product. A product -is a consumer product regardless of whether the product has substantial -commercial, industrial or non-consumer uses, unless such uses represent -the only significant mode of use of the product. - - "Installation Information" for a User Product means any methods, -procedures, authorization keys, or other information required to install -and execute modified versions of a covered work in that User Product from -a modified version of its Corresponding Source. The information must -suffice to ensure that the continued functioning of the modified object -code is in no case prevented or interfered with solely because -modification has been made. - - If you convey an object code work under this section in, or with, or -specifically for use in, a User Product, and the conveying occurs as -part of a transaction in which the right of possession and use of the -User Product is transferred to the recipient in perpetuity or for a -fixed term (regardless of how the transaction is characterized), the -Corresponding Source conveyed under this section must be accompanied -by the Installation Information. But this requirement does not apply -if neither you nor any third party retains the ability to install -modified object code on the User Product (for example, the work has -been installed in ROM). - - The requirement to provide Installation Information does not include a -requirement to continue to provide support service, warranty, or updates -for a work that has been modified or installed by the recipient, or for -the User Product in which it has been modified or installed. Access to a -network may be denied when the modification itself materially and -adversely affects the operation of the network or violates the rules and -protocols for communication across the network. - - Corresponding Source conveyed, and Installation Information provided, -in accord with this section must be in a format that is publicly -documented (and with an implementation available to the public in -source code form), and must require no special password or key for -unpacking, reading or copying. - - 7. Additional Terms. - - "Additional permissions" are terms that supplement the terms of this -License by making exceptions from one or more of its conditions. -Additional permissions that are applicable to the entire Program shall -be treated as though they were included in this License, to the extent -that they are valid under applicable law. If additional permissions -apply only to part of the Program, that part may be used separately -under those permissions, but the entire Program remains governed by -this License without regard to the additional permissions. - - When you convey a copy of a covered work, you may at your option -remove any additional permissions from that copy, or from any part of -it. (Additional permissions may be written to require their own -removal in certain cases when you modify the work.) You may place -additional permissions on material, added by you to a covered work, -for which you have or can give appropriate copyright permission. - - Notwithstanding any other provision of this License, for material you -add to a covered work, you may (if authorized by the copyright holders of -that material) supplement the terms of this License with terms: - - a) Disclaiming warranty or limiting liability differently from the - terms of sections 15 and 16 of this License; or - - b) Requiring preservation of specified reasonable legal notices or - author attributions in that material or in the Appropriate Legal - Notices displayed by works containing it; or - - c) Prohibiting misrepresentation of the origin of that material, or - requiring that modified versions of such material be marked in - reasonable ways as different from the original version; or - - d) Limiting the use for publicity purposes of names of licensors or - authors of the material; or - - e) Declining to grant rights under trademark law for use of some - trade names, trademarks, or service marks; or - - f) Requiring indemnification of licensors and authors of that - material by anyone who conveys the material (or modified versions of - it) with contractual assumptions of liability to the recipient, for - any liability that these contractual assumptions directly impose on - those licensors and authors. - - All other non-permissive additional terms are considered "further -restrictions" within the meaning of section 10. If the Program as you -received it, or any part of it, contains a notice stating that it is -governed by this License along with a term that is a further -restriction, you may remove that term. If a license document contains -a further restriction but permits relicensing or conveying under this -License, you may add to a covered work material governed by the terms -of that license document, provided that the further restriction does -not survive such relicensing or conveying. - - If you add terms to a covered work in accord with this section, you -must place, in the relevant source files, a statement of the -additional terms that apply to those files, or a notice indicating -where to find the applicable terms. - - Additional terms, permissive or non-permissive, may be stated in the -form of a separately written license, or stated as exceptions; -the above requirements apply either way. - - 8. Termination. - - You may not propagate or modify a covered work except as expressly -provided under this License. Any attempt otherwise to propagate or -modify it is void, and will automatically terminate your rights under -this License (including any patent licenses granted under the third -paragraph of section 11). - - However, if you cease all violation of this License, then your -license from a particular copyright holder is reinstated (a) -provisionally, unless and until the copyright holder explicitly and -finally terminates your license, and (b) permanently, if the copyright -holder fails to notify you of the violation by some reasonable means -prior to 60 days after the cessation. - - Moreover, your license from a particular copyright holder is -reinstated permanently if the copyright holder notifies you of the -violation by some reasonable means, this is the first time you have -received notice of violation of this License (for any work) from that -copyright holder, and you cure the violation prior to 30 days after -your receipt of the notice. - - Termination of your rights under this section does not terminate the -licenses of parties who have received copies or rights from you under -this License. If your rights have been terminated and not permanently -reinstated, you do not qualify to receive new licenses for the same -material under section 10. - - 9. Acceptance Not Required for Having Copies. - - You are not required to accept this License in order to receive or -run a copy of the Program. Ancillary propagation of a covered work -occurring solely as a consequence of using peer-to-peer transmission -to receive a copy likewise does not require acceptance. However, -nothing other than this License grants you permission to propagate or -modify any covered work. These actions infringe copyright if you do -not accept this License. Therefore, by modifying or propagating a -covered work, you indicate your acceptance of this License to do so. - - 10. Automatic Licensing of Downstream Recipients. - - Each time you convey a covered work, the recipient automatically -receives a license from the original licensors, to run, modify and -propagate that work, subject to this License. You are not responsible -for enforcing compliance by third parties with this License. - - An "entity transaction" is a transaction transferring control of an -organization, or substantially all assets of one, or subdividing an -organization, or merging organizations. If propagation of a covered -work results from an entity transaction, each party to that -transaction who receives a copy of the work also receives whatever -licenses to the work the party's predecessor in interest had or could -give under the previous paragraph, plus a right to possession of the -Corresponding Source of the work from the predecessor in interest, if -the predecessor has it or can get it with reasonable efforts. - - You may not impose any further restrictions on the exercise of the -rights granted or affirmed under this License. For example, you may -not impose a license fee, royalty, or other charge for exercise of -rights granted under this License, and you may not initiate litigation -(including a cross-claim or counterclaim in a lawsuit) alleging that -any patent claim is infringed by making, using, selling, offering for -sale, or importing the Program or any portion of it. - - 11. Patents. - - A "contributor" is a copyright holder who authorizes use under this -License of the Program or a work on which the Program is based. The -work thus licensed is called the contributor's "contributor version". - - A contributor's "essential patent claims" are all patent claims -owned or controlled by the contributor, whether already acquired or -hereafter acquired, that would be infringed by some manner, permitted -by this License, of making, using, or selling its contributor version, -but do not include claims that would be infringed only as a -consequence of further modification of the contributor version. For -purposes of this definition, "control" includes the right to grant -patent sublicenses in a manner consistent with the requirements of -this License. - - Each contributor grants you a non-exclusive, worldwide, royalty-free -patent license under the contributor's essential patent claims, to -make, use, sell, offer for sale, import and otherwise run, modify and -propagate the contents of its contributor version. - - In the following three paragraphs, a "patent license" is any express -agreement or commitment, however denominated, not to enforce a patent -(such as an express permission to practice a patent or covenant not to -sue for patent infringement). To "grant" such a patent license to a -party means to make such an agreement or commitment not to enforce a -patent against the party. - - If you convey a covered work, knowingly relying on a patent license, -and the Corresponding Source of the work is not available for anyone -to copy, free of charge and under the terms of this License, through a -publicly available network server or other readily accessible means, -then you must either (1) cause the Corresponding Source to be so -available, or (2) arrange to deprive yourself of the benefit of the -patent license for this particular work, or (3) arrange, in a manner -consistent with the requirements of this License, to extend the patent -license to downstream recipients. "Knowingly relying" means you have -actual knowledge that, but for the patent license, your conveying the -covered work in a country, or your recipient's use of the covered work -in a country, would infringe one or more identifiable patents in that -country that you have reason to believe are valid. - - If, pursuant to or in connection with a single transaction or -arrangement, you convey, or propagate by procuring conveyance of, a -covered work, and grant a patent license to some of the parties -receiving the covered work authorizing them to use, propagate, modify -or convey a specific copy of the covered work, then the patent license -you grant is automatically extended to all recipients of the covered -work and works based on it. - - A patent license is "discriminatory" if it does not include within -the scope of its coverage, prohibits the exercise of, or is -conditioned on the non-exercise of one or more of the rights that are -specifically granted under this License. You may not convey a covered -work if you are a party to an arrangement with a third party that is -in the business of distributing software, under which you make payment -to the third party based on the extent of your activity of conveying -the work, and under which the third party grants, to any of the -parties who would receive the covered work from you, a discriminatory -patent license (a) in connection with copies of the covered work -conveyed by you (or copies made from those copies), or (b) primarily -for and in connection with specific products or compilations that -contain the covered work, unless you entered into that arrangement, -or that patent license was granted, prior to 28 March 2007. - - Nothing in this License shall be construed as excluding or limiting -any implied license or other defenses to infringement that may -otherwise be available to you under applicable patent law. - - 12. No Surrender of Others' Freedom. - - If conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot convey a -covered work so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you may -not convey it at all. For example, if you agree to terms that obligate you -to collect a royalty for further conveying from those to whom you convey -the Program, the only way you could satisfy both those terms and this -License would be to refrain entirely from conveying the Program. - - 13. Use with the GNU Affero General Public License. - - Notwithstanding any other provision of this License, you have -permission to link or combine any covered work with a work licensed -under version 3 of the GNU Affero General Public License into a single -combined work, and to convey the resulting work. The terms of this -License will continue to apply to the part which is the covered work, -but the special requirements of the GNU Affero General Public License, -section 13, concerning interaction through a network will apply to the -combination as such. - - 14. Revised Versions of this License. - - The Free Software Foundation may publish revised and/or new versions of -the GNU General Public License from time to time. Such new versions will -be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - - Each version is given a distinguishing version number. If the -Program specifies that a certain numbered version of the GNU General -Public License "or any later version" applies to it, you have the -option of following the terms and conditions either of that numbered -version or of any later version published by the Free Software -Foundation. If the Program does not specify a version number of the -GNU General Public License, you may choose any version ever published -by the Free Software Foundation. - - If the Program specifies that a proxy can decide which future -versions of the GNU General Public License can be used, that proxy's -public statement of acceptance of a version permanently authorizes you -to choose that version for the Program. - - Later license versions may give you additional or different -permissions. However, no additional obligations are imposed on any -author or copyright holder as a result of your choosing to follow a -later version. - - 15. Disclaimer of Warranty. - - THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY -APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT -HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY -OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM -IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF -ALL NECESSARY SERVICING, REPAIR OR CORRECTION. - - 16. Limitation of Liability. - - IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS -THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY -GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE -USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF -DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD -PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), -EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF -SUCH DAMAGES. - - 17. Interpretation of Sections 15 and 16. - - If the disclaimer of warranty and limitation of liability provided -above cannot be given local legal effect according to their terms, -reviewing courts shall apply local law that most closely approximates -an absolute waiver of all civil liability in connection with the -Program, unless a warranty or assumption of liability accompanies a -copy of the Program in return for a fee. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Programs - - If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. - - To do so, attach the following notices to the program. It is safest -to attach them to the start of each source file to most effectively -state the exclusion of warranty; and each file should have at least -the "copyright" line and a pointer to where the full notice is found. - - - Copyright (C) - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . - -Also add information on how to contact you by electronic and paper mail. - - If the program does terminal interaction, make it output a short -notice like this when it starts in an interactive mode: - - Copyright (C) - This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. - This is free software, and you are welcome to redistribute it - under certain conditions; type `show c' for details. - -The hypothetical commands `show w' and `show c' should show the appropriate -parts of the General Public License. Of course, your program's commands -might be different; for a GUI interface, you would use an "about box". - - You should also get your employer (if you work as a programmer) or school, -if any, to sign a "copyright disclaimer" for the program, if necessary. -For more information on this, and how to apply and follow the GNU GPL, see -. - - The GNU General Public License does not permit incorporating your program -into proprietary programs. If your program is a subroutine library, you -may consider it more useful to permit linking proprietary applications with -the library. If this is what you want to do, use the GNU Lesser General -Public License instead of this License. But first, please read -. diff --git a/packages/load-relative/Carton b/packages/load-relative/Carton deleted file mode 100644 index 092be8115..000000000 --- a/packages/load-relative/Carton +++ /dev/null @@ -1,6 +0,0 @@ -(source "melpa" "http://melpa.milkbox.net/packages/") - -(package "load-relative" "0.2.0" "relative file load like Ruby's require_relative") - -(development - (depends-on "test-simple")) diff --git a/packages/load-relative/ChangeLog b/packages/load-relative/ChangeLog deleted file mode 100644 index 5f2040453..000000000 --- a/packages/load-relative/ChangeLog +++ /dev/null @@ -1,228 +0,0 @@ -2010-09-30 rocky - - * .gitignore: git Administrivia. - -2010-09-30 rocky - - Merge branch 'master' of github.com:rocky/emacs-load-relative - Conflicts: .gitignore - -2010-09-30 rocky - - * .gitignore, COPYING, Makefile.am, README, configure.ac: - Administrivia. Add COPYING, update README and .gitignore, bump - version number. - -2010-08-17 R. Bernstein - - * INSTALL: Customize more for emacs. - -2010-08-13 R. Bernstein - - * .gitignore, INSTALL: Make INSTALL less generic and more specific - to Emacs - -2010-07-25 rocky - - * AUTHORS, Makefile.am, configure.ac, load-relative.el: Add Emacs - Lisp Code Archive (ELCA) meta-comments. - -2010-03-08 rocky - - Merge branch 'master' of - git@github.com:rocky/emacs-load-relative - -2010-03-08 rocky - - * .gitignore: elisp-comp is now in the repository - -2009-12-18 rocky - - * .gitignore, autogen.sh, elisp-comp: Don't overwrigte elisp-comp. - -2009-12-18 rocky - - * autogen.sh: Add --enable-maintainer-mode to configure when running - autogen.sh - -2009-12-14 rocky - - Merge branch 'master' of - git@github.com:rocky/emacs-load-relative - -2009-12-13 rocky - - * test/behave.el, test/test-load.el, test/test-require-list.el: - Remove local behave.el in favor of new installed package test-unit. - - -2009-12-13 rocky - - * .gitignore, ChangeLog, Makefile.am, configure.ac: Administrivia. - -2009-12-13 rocky - - Merge branch 'master' of - git@github.com:rocky/emacs-load-relative - -2009-12-13 rocky - - * configure.ac: Fix package name typo. - -2009-12-13 rocky - - * Makefile.am: Include textile README in distribution tarball - -2009-12-12 rocky - - * README.textile: Reformat without line breaks - -2009-12-12 rocky - - * README.md, README.textile: Try textile for readme - -2009-12-12 rocky - - * README.md, README.redcloth: Try using .md extension for doc. - -2009-11-29 rocky - - * test/behave.el: Add assert-raises. - -2009-11-25 rocky - - * test/behave.el: behave.el: fix incorrect initialization on - *behave-total-assertions*. - -2009-11-24 rocky - - * test/behave.el: Show number of assertions run. - -2009-11-22 rocky - - * load-relative.el: Add provision for getting __FILE__ when we are - byte compiling. - -2009-11-22 rocky - - * load-relative.el, test/require-file2.el, test/require-file3.el, - test/test-load.el: Add optional prefix to require-relative, - require-relative and provide-me which will add that prefix to the - feature name. - -2009-11-22 rocky - - * test/test-load.el: Minimal test of provide-me. - -2009-11-22 rocky - - * load-relative.el: Doc string fix. - -2009-11-21 rocky - - * Makefile.am, README, README.redcloth: Turn README back into text. - Add special redcloth version. - -2009-11-21 rocky - - * README, README.markup: Nope changing the name made things worse. - -2009-11-21 rocky - - * README, README.markup: See if changing the name from README to - README.markup gives github a clue - -2009-11-21 rocky - - * README, load-relative.el: load-relative.el: Add provide-me and - make GPL v3. README: expand and turn into red-cloth markup. - -2009-11-19 R. Bernstein - - * test/test-load.el: Another test of (__FILE__). Make test-load more - eval-current'able. - -2009-11-19 R. Bernstein - - * test/test-load.el: Add first __FILE__ test. - -2009-11-17 R. Bernstein - - * load-relative.el: Bug: was not require-relative when not at - compile time. - -2009-11-15 rocky - - * load-relative.el: Working towards a more perfect __FILE__. Perhaps - I am flailing here. Need much better tests. - -2009-11-15 rocky - - * Makefile.am, load-relative.el, test/test-require-list.el: Add - macro to handle relative requires using a list. And use this list - eval-when-compile to remove the undefined function messages in - byte-compilation. - -2009-11-13 rocky - - * load-relative.el: Go over __FILE__ test ordering and more comments - to as to why we do what we do. - -2009-11-13 rocky - - * load-relative.el: Update __FILE__ docstring comment. - -2009-11-13 rocky - - * load-relative.el: Also try #$ - "the name of this file as a - string". Thanks due to grischka for the suggestion. - -2009-11-13 rocky - - * test/require-file1.el: Used in testing require-relative - -2009-11-13 rocky - - * load-relative.el, test/load-file2.el, test/test-load.el: - load-relative.el: Use current-load-list to get loaded/eval'd file - name. It is perhaps is the most reliable but also the most low-level - and it is an undocumented API. Update doc strings to record what we - now understand. Allow an optional symbol -- just in case. Update - tests. - -2009-11-12 rocky - - * test/behave.el, test/test-load.el: test-load.el: add a - require-relative test behave.el: sync up with emacs-dbgr - one bug - removed. - -2009-11-12 rocky - - * load-relative.el: Add require-relative. - -2009-11-12 rocky - - Merge branch 'master' of - git@github.com:rocky/emacs-load-relative Conflicts: - load-relative.el - -2009-11-12 rocky - - * load-relative.el, test/test-load.el: Add require-relative. - -2009-11-10 R. Bernstein - - * load-relative.el, test/behave.el, test/test-load.el: test-load.el: - I think we need to expand the filename before calling load. - behave.el: reduce dependency on spec part. - -2009-11-09 rocky - - * load-relative.el, test/load-file1.el, test/test-load.el: Allow - load-relative to accept a list of strings of files to load. - -2009-11-09 rocky - - * Relative loads for Emacs Lisp files. Adds functions __FILE__ and - load-relative. - diff --git a/packages/load-relative/INSTALL b/packages/load-relative/INSTALL deleted file mode 100644 index aaa3bf86a..000000000 --- a/packages/load-relative/INSTALL +++ /dev/null @@ -1,246 +0,0 @@ -Installation Instructions -************************* - -Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002, 2004, 2005, -2006, 2007, 2008, 2009 Free Software Foundation, Inc. - - Copying and distribution of this file, with or without modification, -are permitted in any medium without royalty provided the copyright -notice and this notice are preserved. This file is offered as-is, -without warranty of any kind. - -Basic Installation -================== - - Briefly, the shell commands `./configure && make' should configure, -and build this package. If that succeeds `make install' will install -the package. However on some systems you may need root privileges, you -may have use `sudo make install' or perhaps `su root' beforehand. - -Generic Information -=================== - - The `configure' shell script attempts to guess correct values for -various system-dependent variables used during compilation. It uses -those values to create a `Makefile' in each directory of the package. -It also creates a shell script `config.status' that you can run in -the future to recreate the current configuration, and a file -`config.log' containing compiler output (useful mainly for debugging -`configure'). - - The configure script can also use an optional file (typically -called `config.cache' and enabled with `--cache-file=config.cache' or -simply `-C') that saves the results of its tests to speed up -reconfiguring. Caching is disabled by default to prevent problems -with accidental use of stale cache files. - - If you need to do unusual things to compile the package, please try -to figure out how `configure' could check whether to do them, and mail -diffs or instructions to the address given in the `README' so they can -be considered for the next release. If you are using the cache, and at -some point `config.cache' contains results you don't want to keep, you -may remove or edit it. - - The file `configure.ac' is used to create `configure' by a program -called `autoconf'. You need `configure.ac' if you want to change it -or regenerate `configure' using a newer version of `autoconf'. - - The simplest way to compile this package is: - - 1. `cd' to the directory containing the package's source code and type - `./configure' to configure the package for your system. - - Running `configure' might take a while. While running, it prints - some messages telling which features it is checking for. - - 2. Type `make' to compile the package. - - 3. Optionally, type `make check' to run any self-tests that come with - the package, generally using the just-built uninstalled binaries. - - 4. Type `make install' to install the programs and any data files and - documentation. When installing into a prefix owned by root, it is - recommended that the package be configured and built as a regular - user, and only the `make install' phase executed with root - privileges. - - 5. You can remove the compiled Emacs Lisp files and other derived - files from the source code directory by typing `make clean'. To - also remove the files that `configure' created (so you can - compile the package for a different kind of computer), type `make - distclean'. There is also a `make maintainer-clean' target, but - that is intended mainly for the package's developers. If you use - it, you may have to get all sorts of other programs in order to - regenerate files that came with the distribution. - - 6. You can also type `make uninstall' to remove the installed files - again. - - 7. We don't provide `make distcheck' right now, but perhaps someday - we will. This is by used by developers to test that all other - targets like `make install' and `make uninstall' work correctly. - This target is generally not run by end users. - -Options -===================== - - Run `./configure --help' for details on the pertinent -environment variables. - - You can give `configure' initial values for configuration parameters -by setting variables in the command line or in the environment. Here -is an example: - - ./configure CC=c99 EMACS=/usr/bin/emacs23-x - - *Note Defining Variables::, for more details. - -Installation Names -================== - - By default, `make install' installs the package's emacs files under -`/usr/local/share/emacs/site-lisp', You can specify an installation -prefix other than `/usr/local/emacs/site-lisp' by giving `configure' -the option `--with-site-lisp=PREFIX', where PREFIX must be an absolute -file name. - - The most portable way to affect installation locations is to pass the -correct locations to `configure'; however, many packages provide one or -both of the following shortcuts of passing variable assignments to the -`make install' command line to change installation locations without -having to reconfigure or recompile. - - The first method involves providing an override variable for each -affected directory. For example, `make install -prefix=/alternate/directory' will choose an alternate location for all -directory configuration variables that were expressed in terms of -`${prefix}'. Any directories that were specified during `configure', -but not in terms of `${prefix}', must each be overridden at install -time for the entire installation to be relocated. The approach of -makefile variable overrides for each directory variable is required by -the GNU Coding Standards, and ideally causes no recompilation. -However, some platforms have known limitations with the semantics of -shared libraries that end up requiring recompilation when using this -method, particularly noticeable in packages that use GNU Libtool. - - The second method involves providing the `DESTDIR' variable. For -example, `make install DESTDIR=/alternate/directory' will prepend -`/alternate/directory' before all installation names. The approach of -`DESTDIR' overrides is not required by the GNU Coding Standards, and -does not work on platforms that have drive letters. On the other hand, -it does better at avoiding recompilation issues, and works well even -when some directory options were not specified in terms of `${prefix}' -at `configure' time. - -Optional Features -================= - - If the package supports it, you can cause programs to be installed -with an extra prefix or suffix on their names by giving `configure' the -option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'. - - Some packages pay attention to `--enable-FEATURE' options to -`configure', where FEATURE indicates an optional part of the package. -They may also pay attention to `--with-PACKAGE' options, where PACKAGE -is something like `gnu-as' or `x' (for the X Window System). The -`README' should mention any `--enable-' and `--with-' options that the -package recognizes. - - For packages that use the X Window System, `configure' can usually -find the X include and library files automatically, but if it doesn't, -you can use the `configure' options `--x-includes=DIR' and -`--x-libraries=DIR' to specify their locations. - - Some packages offer the ability to configure how verbose the -execution of `make' will be. For these packages, running `./configure ---enable-silent-rules' sets the default to minimal output, which can be -overridden with `make V=1'; while running `./configure ---disable-silent-rules' sets the default to verbose, which can be -overridden with `make V=0'. - - -Sharing Defaults -================ - - If you want to set default values for `configure' scripts to share, -you can create a site shell script called `config.site' that gives -default values for variables like `CC', `cache_file', and `prefix'. -`configure' looks for `PREFIX/share/config.site' if it exists, then -`PREFIX/etc/config.site' if it exists. Or, you can set the -`CONFIG_SITE' environment variable to the location of the site script. -A warning: not all `configure' scripts look for a site script. - -Defining Variables -================== - - Variables not defined in a site shell script can be set in the -environment passed to `configure'. However, some packages may run -configure again during the build, and the customized values of these -variables may be lost. In order to avoid this problem, you should set -them in the `configure' command line, using `VAR=value'. For example: - - ./configure EMACS=/usr/bin/emacs23-x - -causes the specified `/usr/bin/emacs23-x' to be used as the Emacs program -to use. - -Unfortunately, this technique does not work for `CONFIG_SHELL' due to -an Autoconf bug. Until the bug is fixed you can use this workaround: - - CONFIG_SHELL=/bin/bash /bin/bash ./configure CONFIG_SHELL=/bin/bash - -`configure' Invocation -====================== - - `configure' recognizes the following options to control how it -operates. - -`--help' -`-h' - Print a summary of all of the options to `configure', and exit. - -`--help=short' -`--help=recursive' - Print a summary of the options unique to this package's - `configure', and exit. The `short' variant lists options used - only in the top level, while the `recursive' variant lists options - also present in any nested packages. - -`--version' -`-V' - Print the version of Autoconf used to generate the `configure' - script, and exit. - -`--cache-file=FILE' - Enable the cache: use and save the results of the tests in FILE, - traditionally `config.cache'. FILE defaults to `/dev/null' to - disable caching. - -`--config-cache' -`-C' - Alias for `--cache-file=config.cache'. - -`--quiet' -`--silent' -`-q' - Do not print messages saying which checks are being made. To - suppress all normal output, redirect it to `/dev/null' (any error - messages will still be shown). - -`--srcdir=DIR' - Look for the package's source code in directory DIR. Usually - `configure' can determine that directory automatically. - -`--prefix=DIR' - Use DIR as the installation prefix. *note Installation Names:: - for more details, including other options available for fine-tuning - the installation locations. - -`--no-create' -`-n' - Run the configure checks, but stop before creating any output - files. - -`configure' also accepts some other, not widely useful, options. Run -`configure --help' for more details. - diff --git a/packages/load-relative/Makefile.am b/packages/load-relative/Makefile.am deleted file mode 100644 index 981101be3..000000000 --- a/packages/load-relative/Makefile.am +++ /dev/null @@ -1,37 +0,0 @@ -lisp_files := $(wildcard *.el) -lisp_LISP = $(lisp_files) - -PHONY=check check-short clean dist distclean test - -EXTRA_DIST = $(lisp_files) $(test_files) README.md THANKS COPYING -GIT2CL ?= git2cl - -#: Run all tests -check: $(test-files) - $(MAKE) -C test check - -#: Run all tests with minimum verbosity -check-short: - $(MAKE) -C test check 2>&1 | ruby make-check-filter.rb - - -#: same as check -test: check - -#: same as check-short -test-short: check-short - -#: Read this first. -README: README.md - ln -s README.md README - -if MAINTAINER_MODE - -CL = ChangeLog -#: Create a log file from the individual commits via git2cl -ChangeLog: - git log --pretty --numstat --summary | $(GIT2CL) > $@ - -ACLOCAL_AMFLAGS=-I . - -endif diff --git a/packages/load-relative/NEWS b/packages/load-relative/NEWS deleted file mode 100644 index e69de29bb..000000000 diff --git a/packages/load-relative/README.md b/packages/load-relative/README.md deleted file mode 100644 index d1d06a966..000000000 --- a/packages/load-relative/README.md +++ /dev/null @@ -1,113 +0,0 @@ -[![Build Status](https://travis-ci.org/rocky/emacs-load-relative.png)](https://travis-ci.org/rocky/emacs-load-relative) - -# Emacs multi-file develop/run-from-of-source routines - -The rational behind module is to be able to write small Emacs -functions or modules in a larger multi-file Emacs package and -facilitate running from the source tree without having to "install" -the code or fiddle with evil *load-path*'s . See my [NYC Lisp talk](https://github.com/rocky/emacs-load-relative/wiki/NYC-Lisp-talk) for more background on this. - - -## Contents ## - -* [\__FILE__](https://github.com/rocky/emacs-load-relative#file) -* [load-relative](https://github.com/rocky/emacs-load-relative#load-relative) -* [require-relative](https://github.com/rocky/emacs-load-relative#require-relative-require-relative-list) -* [provide-me](https://github.com/rocky/emacs-load-relative#provide-me) - -The latest version is at http://github.com/rocky/emacs-load-relative - -## \__FILE__ - -\__FILE__ returns the file name that that the calling program is -running. If you are *eval*'ing a buffer then the file name of that -buffer is used. The name was selected to be analogous to the name used -in C, Perl, and Ruby. - -For an common example of using this, see [How to Insert Demo Code into an Emacs Lisp Module](https://github.com/rocky/emacs-load-relative/wiki/How-to-Insert-Demo-Code-into-an-Emacs-Lisp-Module). - -## load-relative - -*load-relative* loads an Emacs Lisp file relative to another - (presumably currently running) Emacs Lisp file. For example suppose - you have Emacs Lisp files `foo.el` and `bar.el` in the same directory. - To load Emacs Lisp file `bar.el` from inside Emacs lisp file `foo.el`: - -```lisp - (require 'load-relative) - (load-relative "baz") -``` - -That *load-relative* line could above have also been written as: - -```lisp - (load-relative "./baz") -``` - -or: - -```lisp - (load-relative "baz.el") # if you want to exclude any byte-compiled files -``` - -## require-relative, require-relative-list - -Use *require-relative* if you want to *require* the file instead of -*load*'ing it: - -```lisp - (require-relative "baz") -``` - -or: - -```lisp - (require-relative "./baz") -``` - -The above not only does a *require* on `'baz`, but makes sure you get -that from the same file as you would have if you had issued -*load_relative*. - -Use *require-relative-list* when you have a list of files you want to -*require*. To *require-relative* them in one shot: - -```lisp - (require-relative-list '("dbgr-init" "dbgr-fringe")) -``` - -## provide-me - -Finally, macro *provide-me* saves you the trouble of adding a symbol -after *provide*, by using the file basename (without directory or file -extension) as the name of the thing you want to provide. Using this -forces the *provide* names to be the same as the filename, but I -consider that a good thing. - -*provide-me* also takes an optional string which will be prepended to the provide name. This is useful if you have a multi-file package and want the files to bue prefaced with the name of the package. - -Assume your package *foo* and contains simply file `foo.el`. Then -adding: - -```lisp - (provide-me) -``` - -inside that file is the same thing as writing: - -```lisp - (provide 'foo) -``` - -Now suppose `foo.el` is part of a larger package called *bar*. Then if -you write: - -```lisp - (provide-me "bar-") -``` - -this is the same as writing: - -```lisp - (provide 'bar-foo) -``` diff --git a/packages/load-relative/THANKS b/packages/load-relative/THANKS deleted file mode 100644 index 7408d2a03..000000000 --- a/packages/load-relative/THANKS +++ /dev/null @@ -1 +0,0 @@ -Lars Anderson - Melapa packaging, among other things diff --git a/packages/load-relative/autogen.sh b/packages/load-relative/autogen.sh deleted file mode 100755 index 8a728371d..000000000 --- a/packages/load-relative/autogen.sh +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh -autoreconf -vi && \ -autoconf && { - echo "Running configure with --enable-maintainer-mode $@" - ./configure --enable-maintainer-mode $@ -} diff --git a/packages/load-relative/common.mk b/packages/load-relative/common.mk deleted file mode 100644 index 26b632560..000000000 --- a/packages/load-relative/common.mk +++ /dev/null @@ -1,5 +0,0 @@ -short: - $(MAKE) 2>&1 >/dev/null | ruby $(top_srcdir)/make-check-filter.rb - -%.short: - $(MAKE) $(@:.short=) 2>&1 >/dev/null diff --git a/packages/load-relative/configure.ac b/packages/load-relative/configure.ac deleted file mode 100644 index 35bddabd0..000000000 --- a/packages/load-relative/configure.ac +++ /dev/null @@ -1,28 +0,0 @@ -AC_INIT(emacs-load-relative, 1.0,) -AC_CONFIG_SRCDIR(load-relative.el) -AM_INIT_AUTOMAKE -AM_MAINTAINER_MODE -AM_MISSING_PROG(GIT2CL, git2cl, $missing_dir) - -AC_PATH_PROG(EMACS, emacs, no) -if test x$EMACS != xno ; then - $EMACS -batch -q -no-site-file -eval \ - '(if (<= emacs-major-version 22) - (progn - (error "You need GNU Emacs 23 or better for this package.") - (kill-emacs 1) - ))' - if test $? -ne 0 ; then - EMACS=no - fi -fi - - -## -## Find out where to install the debugger emacs lisp files -## -AM_PATH_LISPDIR -AM_CONDITIONAL(INSTALL_EMACS_LISP, test "x$lispdir" != "x") - -AC_CONFIG_FILES([Makefile test/Makefile]) -AC_OUTPUT diff --git a/packages/load-relative/el-get-install.el b/packages/load-relative/el-get-install.el deleted file mode 100644 index e175e2800..000000000 --- a/packages/load-relative/el-get-install.el +++ /dev/null @@ -1,105 +0,0 @@ -(eval-when-compile - (defvar el-get-sources) -) - -(declare-function el-get-post-install 'el-get) - -(add-to-list 'load-path "~/.emacs.d/el-get/el-get") - -;;; el-get-install.el --- installer for the lazy -;; -;; Copyright (C) 2010 Dimitri Fontaine -;; -;; Author: Dimitri Fontaine -;; URL: http://www.emacswiki.org/emacs/el-get.el -;; Created: 2010-06-17 -;; Keywords: emacs package elisp install elpa git git-svn bzr cvs apt-get fink http http-tar -;; Licence: WTFPL, grab your copy here: http://sam.zoy.org/wtfpl/ -;; -;; This file is NOT part of GNU Emacs. -;; -;; bootstrap your el-get installation, the goal is then to use el-get to -;; update el-get. -;; -;; So the idea is that you copy/paste this code into your *scratch* buffer, -;; hit C-j, and you have a working el-get. - -(let ((el-get-root - (file-name-as-directory - (or (bound-and-true-p el-get-dir) - (concat (file-name-as-directory user-emacs-directory) "el-get"))))) - - (when (file-directory-p el-get-root) - (add-to-list 'load-path el-get-root)) - - ;; try to require el-get, failure means we have to install it - (unless (require 'el-get nil t) - (unless (file-directory-p el-get-root) - (make-directory el-get-root t)) - - (let* ((package "el-get") - (buf (switch-to-buffer "*el-get bootstrap*")) - (pdir (file-name-as-directory (concat el-get-root package))) - (git (or (executable-find "git") - (error "Unable to find `git'"))) - (url (or (bound-and-true-p el-get-git-install-url) - "http://github.com/dimitri/el-get.git")) - (default-directory el-get-root) - (process-connection-type nil) ; pipe, no pty (--no-progress) - - ;; First clone el-get - (status - (call-process - git nil `(,buf t) t "--no-pager" "clone" "-v" url package))) - - (unless (zerop status) - (error "Couldn't clone el-get from the Git repository: %s" url)) - - ;; switch branch if we have to - (let* ((branch (cond - ;; Check if a specific branch is requested - ((bound-and-true-p el-get-install-branch)) - ;; Check if master branch is requested - ((boundp 'el-get-master-branch) "master") - ;; Read the default branch from the el-get recipe - ((plist-get (with-temp-buffer - (insert-file-contents-literally - (expand-file-name "recipes/el-get.rcp" pdir)) - (read (current-buffer))) - :branch)) - ;; As a last resort, use the master branch - ("master"))) - (remote-branch (format "origin/%s" branch)) - (default-directory pdir) - (bstatus - (if (string-equal branch "master") - 0 - (call-process git nil (list buf t) t "checkout" "-t" remote-branch)))) - (unless (zerop bstatus) - (error "Couldn't `git checkout -t %s`" branch))) - - (add-to-list 'load-path pdir) - (load package) - (let ((el-get-default-process-sync t) ; force sync operations for installer - (el-get-verbose t)) ; let's see it all - (el-get-post-install "el-get")) - (with-current-buffer buf - (goto-char (point-max)) - (insert "\nCongrats, el-get is installed and ready to serve!"))))) - - -(declare-function el-get 'el-get) - -;; now either el-get is `require'd already, or have been `load'ed by the -;; el-get installer. -(setq - el-get-sources - '(el-get ; el-get is self-hosting - loc-changes ; loc marks in buffers - list-utils ; list utilities like list-utils-flatten - load-relative ; load emacs lisp relative to emacs source - test-simple ; simple test framework - )) - -;; install new packages and init already installed packages -(el-get 'sync '(test-simple)) diff --git a/packages/load-relative/elisp-comp b/packages/load-relative/elisp-comp deleted file mode 100755 index 263a26d8d..000000000 --- a/packages/load-relative/elisp-comp +++ /dev/null @@ -1,87 +0,0 @@ -#!/bin/sh -# Copyright (C) 1995, 2000, 2003, 2004, 2005 Free Software Foundation, Inc. - -scriptversion=2009-11-26.09 - -# Franc,ois Pinard , 1995. -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2, or (at your option) -# any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - -# As a special exception to the GNU General Public License, if you -# distribute this file as part of a program that contains a -# configuration script generated by Autoconf, you may include it under -# the same distribution terms that you use for the rest of that program. - -# This file is maintained in Automake, please report -# bugs to or send patches to -# . - -case $1 in - '') - echo "$0: No files. Try \`$0 --help' for more information." 1>&2 - exit 1; - ;; - -h | --h*) - cat <<\EOF -Usage: elisp-comp [--help] [--version] FILES... - -This script byte-compiles all `.el' files listed as FILES using GNU -Emacs, and put the resulting `.elc' files into the current directory, -so disregarding the original directories used in `.el' arguments. - -This script manages in such a way that all Emacs LISP files to -be compiled are made visible between themselves, in the event -they require or load-library one another. - -Report bugs to . -EOF - exit $? - ;; - -v | --v*) - echo "elisp-comp $scriptversion" - exit $? - ;; -esac - -if test -z "$EMACS" || test "$EMACS" = "t"; then - # Value of "t" means we are running in a shell under Emacs. - # Just assume Emacs is called "emacs". - EMACS=emacs -fi - -tempdir=. - -# Cleanup the temporary directory on exit. -# trap 'ret=$?; rm -rf "$tempdir" && exit $ret' 0 -trap 'ret=$?; rm -rf "./script" && exit $ret' 0 -trap '(exit $?); exit' 1 2 13 15 - -( - cd $tempdir - echo "(setq load-path (cons nil load-path))" > script - $EMACS -batch -q -l script -f batch-byte-compile *.el || exit $? - # mv *.elc .. -) || exit $? - -(exit 0); exit 0 - -# Local Variables: -# mode: shell-script -# sh-indentation: 2 -# eval: (add-hook 'write-file-hooks 'time-stamp) -# time-stamp-start: "scriptversion=" -# time-stamp-format: "%:y-%02m-%02d.%02H" -# time-stamp-end: "$" -# End: diff --git a/packages/load-relative/install-from-git.sh b/packages/load-relative/install-from-git.sh deleted file mode 100755 index f36afa45a..000000000 --- a/packages/load-relative/install-from-git.sh +++ /dev/null @@ -1,99 +0,0 @@ -#!/bin/bash - -# This installs all realgud and its prerequisites. If you are lucky -# you can just run this: -# -# bash ./install-from-git.sh -# -# However we do provide for some customization... -# -# 1. GIT PROTOCOL -# =============== -# -# If your "git clone" can't handle the "http" protocol, you might be -# able to use the "git" protocol. To do this set the GIT_PROTOCOL -# variable like this: -# -# GIT_PROTOCOL=git sh ./install-from-git.sh -# -# 2. configure options (e.g --prefix) -# ==================================== - -# If you want to customize configuration parameters, for example, -# choose where to install, you can pass configure options to this -# script. For example:# can pass configure options. -# -# sh ./install-from-git.sh --prefix=/tmp -# -# 3. TO "sudo" or not to "sudo"? -# ============================== -# If you are running as root on a *Nix-like box, then there's no problem. -# -# If you are not running as root, "sudo" might be invoked to install -# code. On systems that don't have a "sudo" command but need -# filesystem permission, then you get by with setting SUDO_CMD to "su root-c" -# For example: -# -# SUDO_CMD='su root -c' sh ./install-from-git.sh -# -# If you have sufficient filesystem permission (which is often the -# case on Windows or cygwin) then you might not need or want sudo. So -# here, set SUDO_CMD to a blank: -# -# SUDO_CMD=' ' sh ./install-from-git.sh -# -# -# To finish here is an invocation using all 3 above options: -# GIT_PROTOCOL='git' SUDO_CMD=' ' sh ./install-from-git.sh --prefix=/tmp - -GIT_PROTOCOL=${GIT_PROTOCOL:-http} - -# Run and echo a command -run_cmd() { - echo "--- Running command: $@" - $@ - rc=$? - echo "--- $@ exit status is $?" - return $rc -} - -# environment variable SUDO_CMD could be "sudo" or "su root -c" or " " -# for don't need sudo - -if (( $(id -u) != 0)) ; then - if [[ -z "$SUDO_CMD" ]] ; then - need_sudo='sudo' - if which $need_sudo >/dev/null 2>&1 ; then - try_cmd='' - else - need_sudo='su root -c' - try_cmd='su' - fi - else - need_sudo="$SUDO_CMD" - fi -else - need_sudo='' - try_cmd='' -fi - -for program in git make $need_sudo ; do - if ! which $program >/dev/null 2>&1 ; then - echo "Cant find program $program in $PATH" - exit 1 - fi -done - -for pkg in emacs-{test-simple,load-relative} ; do - echo '******************************************' - echo Trying to install ${pkg}... - echo '******************************************' - run_cmd git clone ${GIT_PROTOCOL}://github.com/rocky/${pkg}.git - (cd $pkg && \ - run_cmd $SHELL ./autogen.sh && \ - run_cmd ./configure $@ && \ - run_cmd make && \ - run_cmd make check && \ - run_cmd $need_sudo make install - ) -done diff --git a/packages/load-relative/load-relative.el b/packages/load-relative/load-relative.el deleted file mode 100644 index 409c3c589..000000000 --- a/packages/load-relative/load-relative.el +++ /dev/null @@ -1,255 +0,0 @@ -;;; load-relative.el --- relative file load (within a multi-file Emacs package) - -;; Author: Rocky Bernstein -;; Version: 1.0 -;; Keywords: internal -;; URL: http://github.com/rocky/emacs-load-relative -;; Compatibility: GNU Emacs 23.x - -;; Copyright (C) 2009-2010, 2012-2014 Rocky Bernstein - -;; This program is free software: you can redistribute it and/or -;; modify it under the terms of the GNU General Public License as -;; published by the Free Software Foundation, either version 3 of the -;; License, or (at your option) any later version. - -;; This program is distributed in the hope that it will be useful, but -;; WITHOUT ANY WARRANTY; without even the implied warranty of -;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -;; General Public License for more details. - -;; You should have received a copy of the GNU General Public License -;; along with this program. If not, see -;; . - -;;; Commentary: - -;; Here we provide functions which facilitate writing multi-file Emacs -;; packages and facilitate running from the source tree without having -;; to "install" code or fiddle with evil `load-path'. See -;; https://github.com/rocky/emacs-load-relative/wiki/NYC-Lisp-talk for -;; the the rationale behind this. -;; -;; The functions we add are relative versions of `load', and `require' -;; and versions which take list arguments. We also add a `__FILE__' -;; function and a `provide-me' macro. - -;; The latest version of this code is at: -;; http://github.com/rocky/emacs-load-relative/ - -;; `__FILE__' returns the file name that that the calling program is -;; running. If you are `eval''ing a buffer then the file name of that -;; buffer is used. The name was selected to be analogous to the name -;; used in C, Perl, Python, and Ruby. - -;; `load-relative' loads an Emacs Lisp file relative to another -;; (presumably currently running) Emacs Lisp file. For example suppose -;; you have Emacs Lisp files "foo.el" and "bar.el" in the same -;; directory. To load "bar.el" from inside Emacs lisp file "foo.el": -;; -;; (require 'load-relative) -;; (load-relative "baz") -;; -;; The above `load-relative' line could above have also been written as: -;; -;; (load-relative "./baz") -;; or: -;; (load-relative "baz.el") # if you want to exclude any byte-compiled files -;; -;; Use `require-relative' if you want to `require' the file instead of -;; `load'ing it: -;; -;; (require-relative "baz") -;; -;; or: -;; -;; (require-relative "./baz") -;; -;; The above not only does a `require' on 'baz', but makes sure you -;; get that from the same file as you would have if you had issued -;; `load_relative'. -;; -;; Use `require-relative-list' when you have a list of files you want -;; to `require'. To `require-relative' them all in one shot: -;; -;; (require-relative-list '("dbgr-init" "dbgr-fringe")) -;; -;; Finally, macro `provide-me' saves you the trouble of adding a -;; symbol after `provide' using the file basename (without directory -;; or file extension) as the name of the thing you want to -;; provide. -;; -;; Using this constrains the `provide' name to be the same as -;; the filename, but I consider that a good thing. - -;;; Code: - -;;;###autoload -(defun __FILE__ (&optional symbol) - "Return the string name of file/buffer that is currently begin executed. - -The first approach for getting this information is perhaps the -most pervasive and reliable. But it the most low-level and not -part of a public API, so it might change in future -implementations. This method uses the name that is recorded by -readevalloop of `lread.c' as the car of variable -`current-load-list'. - -Failing that, we use `load-file-name' which should work in some -subset of the same places that the first method works. However -`load-file-name' will be nil for code that is eval'd. To cover -those cases, we try `buffer-file-name' which is initially -correct, for eval'd code, but will change and may be wrong if the -code sets or switches buffers after the initial execution. - -As a last resort, you can pass in SYMBOL which should be some -symbol that has been previously defined if none of the above -methods work we will use the file-name value find via -`symbol-file'." - ;; Not used right now: - ;; Failing the above the next approach we try is to use the value of - ;; $# - 'the name of this file as a string'. Although it doesn't - ;; work for eval-like things, it has the advantage that this value - ;; persists after loading or evaluating a file. So it would be - ;; suitable if __FILE__ were called from inside a function. - - - (cond - ;; lread.c's readevalloop sets (car current-load-list) - ;; via macro LOADHIST_ATTACH of lisp.h. At least in Emacs - ;; 23.0.91 and this code goes back to '93. - ((stringp (car-safe current-load-list)) (car current-load-list)) - - ;; load-like things. 'relative-file-expand' tests in - ;; test/test-load.el indicates we should put this ahead of - ;; $#. - (load-file-name) - - ;; Pick up "name of this file as a string" which is set on - ;; reading and persists. In contrast, load-file-name is set only - ;; inside eval. As such, it won't work when not in the middle of - ;; loading. - ;; (#$) - - ;; eval-like things - ((buffer-file-name)) - - ;; When byte compiling. FIXME: use a more thorough precondition like - ;; byte-compile-file is somehwere in the backtrace or that - ;; bytecomp-filename comes from that routine? - ((boundp 'bytecomp-filename) bytecomp-filename) - - (t (symbol-file symbol)) ;; last resort - )) - -(defun autoload-relative (function-or-list - file &optional docstring interactive type - symbol) - "Autoload an Emacs Lisp file relative to Emacs Lisp code that is in -the process of being loaded or eval'd. - - -Define FUNCTION to autoload from FILE. FUNCTION is a symbol. - -FILE is a string to pass to `load'. - -DOCSTRING is documentation for the function. - -INTERACATIVE if non-nil says function can be called -interactively. - -TYPE indicates the type of the object: nil or omitted says -function is a function, `keymap' says function is really a -keymap, and `macro' or t says function is really a macro. Third -through fifth args give info about the real definition. They -default to nil. If function is already defined other than as an -autoload, this does nothing and returns nil. - -SYMBOL is the location of of the file of where that was -defined (as given by `symbol-file' is used if other methods of -finding __FILE__ don't work." - - (if (listp function-or-list) - (mapcar (lambda(function) - (autoload function-or-list - (relative-expand-file-name file symbol) - docstring interactive type)) - file) - (autoload function-or-list (relative-expand-file-name file symbol) - docstring interactive type)) - ) - -;;;###autoload -(defun load-relative (file-or-list &optional symbol) - "Load an Emacs Lisp file relative to Emacs Lisp code that is in -the process of being loaded or eval'd. - -FILE-OR-LIST is either a string or a list of strings containing -files that you want to loaded. If SYMBOL is given, the location of -of the file of where that was defined (as given by `symbol-file' is used -if other methods of finding __FILE__ don't work." - - (if (listp file-or-list) - (mapcar (lambda(relative-file) - (load (relative-expand-file-name relative-file symbol))) - file-or-list) - (load (relative-expand-file-name file-or-list symbol))) - ) - -(defun relative-expand-file-name(relative-file &optional opt-file) - "Expand RELATIVE-FILE relative to the Emacs Lisp code that is in -the process of being loaded or eval'd. - -WARNING: it is best to to run this function before any -buffer-setting or buffer changing operations." - (let ((file (or opt-file (__FILE__) default-directory)) - (prefix)) - (unless file - (error "Can't expand __FILE__ here and no file name given")) - (setq prefix (file-name-directory file)) - (expand-file-name (concat prefix relative-file)))) - -;;;###autoload -(defun require-relative (relative-file &optional opt-file opt-prefix) - "Run `require' on an Emacs Lisp file relative to the Emacs Lisp code -that is in the process of being loaded or eval'd. The symbol used in require -is the base file name (without directory or file extension) treated as a -symbol. - -WARNING: it is best to to run this function before any -buffer-setting or buffer changing operations." - (let ((require-string-name - (concat opt-prefix (file-name-sans-extension - (file-name-nondirectory relative-file))))) - (require (intern require-string-name) - (relative-expand-file-name relative-file opt-file)))) - -;;;###autoload -(defmacro require-relative-list (list &optional opt-prefix) - "Run `require-relative' on each name in LIST which should be a list of -strings, each string being the relative name of file you want to run." - `(progn - (eval-when-compile - (require 'cl - (dolist (rel-file ,list) - (require-relative rel-file (__FILE__) ,opt-prefix)))) - (dolist (rel-file ,list) - (require-relative rel-file (__FILE__) ,opt-prefix)))) - -;;;###autoload -(defmacro provide-me ( &optional prefix ) - "Call `provide' with the feature's symbol name made from -source-code's file basename sans extension. For example if you -write (provide-me) inside file ~/lisp/foo.el, this is the same as -writing: (provide 'foo). - -With a prefix, that prefix is prepended to the `provide' So in -the previous example, if you write (provide-me \"bar-\") this is the -same as writing (provide 'bar-foo) -" - `(provide (intern (concat ,prefix (file-name-sans-extension - (file-name-nondirectory (__FILE__))))))) - -(provide-me) - -;;; load-relative.el ends here diff --git a/packages/load-relative/make-check-filter.rb b/packages/load-relative/make-check-filter.rb deleted file mode 100644 index d7d5cbf80..000000000 --- a/packages/load-relative/make-check-filter.rb +++ /dev/null @@ -1,22 +0,0 @@ -#!/usr/bin/env ruby -# Use this to cut out the crud from make check. -# Use like this: -# make check 2>&1 | ruby ../make-check-filter.rb -# See Makefile.am -pats = ["^(?:Loading", - '(re)?make\[', - "Making check in", - '\(cd \.\.', - "make -C", - "Test-Unit", - "Fontifying", - '\s*$', - '##[<>]+$' - ].join('|') + ')' -# puts pats -skip_re = /#{pats}/ - -while gets() - next if $_ =~ skip_re - puts $_ -end diff --git a/packages/load-relative/test/.gitignore b/packages/load-relative/test/.gitignore deleted file mode 100644 index ddeeca758..000000000 --- a/packages/load-relative/test/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -/*~ -/Makefile -/Makefile.in diff --git a/packages/load-relative/test/Makefile.am b/packages/load-relative/test/Makefile.am deleted file mode 100644 index df1647fcb..000000000 --- a/packages/load-relative/test/Makefile.am +++ /dev/null @@ -1,64 +0,0 @@ -include $(top_srcdir)/common.mk - -PHONY=check test all check-elget test-elget help - -#: overall help on running the make targets -help: - @echo "The main function of this Makefile is to facilitate running tests." - @echo - @echo "To run all of the tests, use targets \"test\", \"check\" or \"check-short\"." - @echo "For example:" - @echo - @echo " make check" - @echo "or:" - @echo " make check-short" - @echo - @echo "The -short target uses a filter written in Ruby to remove extreanous output." - @echo - @echo "To run a specific test like test-srcbuf.el, change \".el\" to" - @echo "\".run\". For example:" - @echo - @echo " make test-srcbuf.run" - @echo - @echo "Tests can also be run via the Emacs el-get package and this loads dependent emacs " - @echo "package, like load-relative. To do this, use targets, \"check-elget\"," - @echo "\"test-elget\", or \"check-short-elget\"." - @echo - @echo "To run a specific test like test-srcbuf.el via el-get change \".el\"" - @echo "to \".elrun\" For example:" - @echo - @echo " make test-srcbuf.elrun" - -#: same thing as "check" -test: check - -test_files := $(wildcard test-*.el) - -CHECK_FILES = $(notdir $(test_files:.el=.run)) -EL_GET_CHECK_FILES = $(notdir $(test_files:.el=.elrun)) - -#: Run all tests -check: $(CHECK_FILES) - -#: Run all tests via el-get -check-elget: $(EL_GET_CHECK_FILES) - -#: Run all tests with minimum verbosity -check-short: - $(MAKE) check 2>&1 | ruby ../make-check-filter.rb - -#: Run all tests with minimum verbosity via el-get -check-short-elget: - $(MAKE) check-elget 2>&1 | ruby ../make-check-filter.rb - -test-%.run: - (cd $(top_srcdir)/test && $(EMACS) --batch --no-site-file --no-splash --load $(@:.run=.el)) - -#: Run tests using el-get to specify external Lisp dependencies -test-%.elrun: - (cd $(top_srcdir)/test && $(EMACS) --batch --no-site-file --no-splash --load ../el-get-install.el --load $(@:.elrun=.el)) - -# # Whatever it is you want to do, it should be forwarded to the -# # to top-level directories -# %: -# $(MAKE) -C .. $@ diff --git a/packages/load-relative/test/load-file1.el b/packages/load-relative/test/load-file1.el deleted file mode 100644 index 724b52820..000000000 --- a/packages/load-relative/test/load-file1.el +++ /dev/null @@ -1,3 +0,0 @@ -(setq loaded-file "load-file1") -(setq loaded-file1 't) - diff --git a/packages/load-relative/test/load-file2.el b/packages/load-relative/test/load-file2.el deleted file mode 100644 index ca6f3d20a..000000000 --- a/packages/load-relative/test/load-file2.el +++ /dev/null @@ -1 +0,0 @@ -(load-relative "load-file3") diff --git a/packages/load-relative/test/load-file3.el b/packages/load-relative/test/load-file3.el deleted file mode 100644 index fb1594726..000000000 --- a/packages/load-relative/test/load-file3.el +++ /dev/null @@ -1 +0,0 @@ -(setq loaded-file "load-file3") diff --git a/packages/load-relative/test/require-file1.el b/packages/load-relative/test/require-file1.el deleted file mode 100644 index 53c149ef6..000000000 --- a/packages/load-relative/test/require-file1.el +++ /dev/null @@ -1 +0,0 @@ -(provide 'require-file1) diff --git a/packages/load-relative/test/require-file2.el b/packages/load-relative/test/require-file2.el deleted file mode 100644 index e751183aa..000000000 --- a/packages/load-relative/test/require-file2.el +++ /dev/null @@ -1 +0,0 @@ -(provide-me "my-") diff --git a/packages/load-relative/test/require-file3.el b/packages/load-relative/test/require-file3.el deleted file mode 100644 index d9236cd5b..000000000 --- a/packages/load-relative/test/require-file3.el +++ /dev/null @@ -1 +0,0 @@ -(provide 'require-file3) diff --git a/packages/load-relative/test/subdir/.gitignore b/packages/load-relative/test/subdir/.gitignore deleted file mode 100644 index aeaec0f71..000000000 --- a/packages/load-relative/test/subdir/.gitignore +++ /dev/null @@ -1 +0,0 @@ -/*~ diff --git a/packages/load-relative/test/subdir/Makefile b/packages/load-relative/test/subdir/Makefile deleted file mode 100644 index bc80236c1..000000000 --- a/packages/load-relative/test/subdir/Makefile +++ /dev/null @@ -1,7 +0,0 @@ -# Whatever it is you want to do, it should be forwarded to the -# to top-level irectories -PHONY=check all -all: check - -%: - $(MAKE) -C .. $@ diff --git a/packages/load-relative/test/subdir/test-require-list-from-subdir.el b/packages/load-relative/test/subdir/test-require-list-from-subdir.el deleted file mode 100644 index 6d936059f..000000000 --- a/packages/load-relative/test/subdir/test-require-list-from-subdir.el +++ /dev/null @@ -1,18 +0,0 @@ -(require 'cl) -(require 'test-unit) -(load-file "../../load-relative.el") - -(test-unit-clear-contexts) - -(context "load-relative-list-from-subdir" - (tag load-relative-list-from-subdir) - (if (featurep 'require-file1) - (unload-feature 'require-file1)) - (specify "relative-relative-list" - (require-relative-list '("../require-file1")) - (assert-t (featurep 'require-file1)) - ) - -) - -(test-unit "load-relative-list-from-subdir") diff --git a/packages/load-relative/test/test-load.el b/packages/load-relative/test/test-load.el deleted file mode 100644 index 3dbce3b28..000000000 --- a/packages/load-relative/test/test-load.el +++ /dev/null @@ -1,82 +0,0 @@ -(require 'cl) -(require 'test-simple) -(load-file "../load-relative.el") - -(test-simple-start) - -;; (setq tempbuf (generate-new-buffer "*cmdbuf-test*")) -;; (assert-nil -;; (with-current-buffer tempbuf -;; (insert "(__FILE__)\n") -;; (eval-current-buffer)) -;; (kill-buffer tempbuf) "(__FILE__) on temporary buffer") - -(assert-equal "test-load" - (file-name-sans-extension - (file-name-nondirectory (__FILE__))) - "(__FILE__) on this running program" - ) - -(dolist (file-name - '("load-file1.el" "./load-file1.el" "../test/load-file1.el")) - (assert-equal - (expand-file-name file-name) - (relative-expand-file-name file-name)) - "relative-expand-filename" -) - -(note "Basic load-relative") -(setq loaded-file nil) -(assert-equal t (load-relative "load-file2")) -(assert-equal "load-file3" loaded-file) - -(setq loaded-file nil) -(setq loaded-file1 nil) -(assert-equal '(t t) - (load-relative '("load-file1" "load-file2") - )) -(assert-equal 't loaded-file1) -(assert-equal "load-file3" loaded-file) - - -(dolist (file-name - '("load-file1.el" "./load-file1.el" "../test/load-file1.el")) - (setq loaded-file nil) - (assert-equal t (load-relative file-name) - (format "load-relative with list file %s" loaded-file)) - (assert-equal "load-file1" loaded-file - (format "load-relative value with list file %s" loaded-file) - )) - -(if (featurep 'require-file1 t) - (unload-feature 'require-file1)) - -(require-relative "require-file1") -(assert-t (featurep 'require-file1) "require-relative") - -(if (featurep 'require-file1 t) - (unload-feature 'require-file1)) - -(require-relative-list '("require-file1" "require-file3")) -(assert-t (and (featurep 'require-file1) - (featurep 'require-file3)) "require-relative-list") - -(if (featurep 'my-require-file2 t) - (unload-feature 'my-require-file2)) - -(require-relative-list '("require-file2") "my-") -(assert-t (featurep 'my-require-file2) "require-relative-list with prefix") - - -(if (featurep 'test-load t) - (unload-feature 'test-load) "provide-me - no prefix") -(provide-me) -(assert-t (featurep 'test-load)) - -(if (featurep 'my-test-load t) - (unload-feature 'my-test-load)) -(provide-me "my-") -(assert-t (featurep 'my-test-load) "provide-me - prefix") - -(end-tests) - diff --git a/packages/load-relative/test/test-require-list.el b/packages/load-relative/test/test-require-list.el deleted file mode 100644 index 4a6b731c4..000000000 --- a/packages/load-relative/test/test-require-list.el +++ /dev/null @@ -1,12 +0,0 @@ -(require 'cl) -(require 'test-simple) -(load-file "../load-relative.el") - -(test-simple-start) - -(if (featurep 'require-file1) - (unload-feature 'require-file1)) -(require-relative-list '("./require-file1")) -(assert-t (featurep 'require-file1) "relative-relative-list") - -(end-tests) diff --git a/packages/loc-changes/.gitignore b/packages/loc-changes/.gitignore deleted file mode 100644 index 073378209..000000000 --- a/packages/loc-changes/.gitignore +++ /dev/null @@ -1,13 +0,0 @@ -/*.elc -/*~ -/aclocal.m4 -/autom4te.cache -/config.log -/config.status -/configure -/elc-stamp -/install-sh -/missing -/script -Makefile -Makefile.in diff --git a/packages/loc-changes/.travis.yml b/packages/loc-changes/.travis.yml deleted file mode 100644 index 93ff22f9a..000000000 --- a/packages/loc-changes/.travis.yml +++ /dev/null @@ -1,18 +0,0 @@ -language: emacs-lisp - -env: - - EMACS=emacs24 - -before_install: - - if [ "$EMACS" = 'emacs24' ]; then - sudo add-apt-repository -y ppa:cassou/emacs && - sudo apt-get update -qq && - sudo apt-get install -qq - emacs24 emacs24-el emacs24-common-non-dfsg; - fi - - - sudo apt-get install -qq $EMACS - -# run the tests -script: - - NO_CHECK_EMACS_PACKAGES=1 /bin/bash ./autogen.sh && cd test && make check-elget diff --git a/packages/loc-changes/AUTHORS b/packages/loc-changes/AUTHORS deleted file mode 100644 index 60fc84e7a..000000000 --- a/packages/loc-changes/AUTHORS +++ /dev/null @@ -1 +0,0 @@ -rocky@gnu.org diff --git a/packages/loc-changes/COPYING b/packages/loc-changes/COPYING deleted file mode 100644 index 94a9ed024..000000000 --- a/packages/loc-changes/COPYING +++ /dev/null @@ -1,674 +0,0 @@ - GNU GENERAL PUBLIC LICENSE - Version 3, 29 June 2007 - - Copyright (C) 2007 Free Software Foundation, Inc. - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The GNU General Public License is a free, copyleft license for -software and other kinds of works. - - The licenses for most software and other practical works are designed -to take away your freedom to share and change the works. By contrast, -the GNU General Public License is intended to guarantee your freedom to -share and change all versions of a program--to make sure it remains free -software for all its users. We, the Free Software Foundation, use the -GNU General Public License for most of our software; it applies also to -any other work released this way by its authors. You can apply it to -your programs, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -them if you wish), that you receive source code or can get it if you -want it, that you can change the software or use pieces of it in new -free programs, and that you know you can do these things. - - To protect your rights, we need to prevent others from denying you -these rights or asking you to surrender the rights. Therefore, you have -certain responsibilities if you distribute copies of the software, or if -you modify it: responsibilities to respect the freedom of others. - - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must pass on to the recipients the same -freedoms that you received. You must make sure that they, too, receive -or can get the source code. And you must show them these terms so they -know their rights. - - Developers that use the GNU GPL protect your rights with two steps: -(1) assert copyright on the software, and (2) offer you this License -giving you legal permission to copy, distribute and/or modify it. - - For the developers' and authors' protection, the GPL clearly explains -that there is no warranty for this free software. For both users' and -authors' sake, the GPL requires that modified versions be marked as -changed, so that their problems will not be attributed erroneously to -authors of previous versions. - - Some devices are designed to deny users access to install or run -modified versions of the software inside them, although the manufacturer -can do so. This is fundamentally incompatible with the aim of -protecting users' freedom to change the software. The systematic -pattern of such abuse occurs in the area of products for individuals to -use, which is precisely where it is most unacceptable. Therefore, we -have designed this version of the GPL to prohibit the practice for those -products. If such problems arise substantially in other domains, we -stand ready to extend this provision to those domains in future versions -of the GPL, as needed to protect the freedom of users. - - Finally, every program is threatened constantly by software patents. -States should not allow patents to restrict development and use of -software on general-purpose computers, but in those that do, we wish to -avoid the special danger that patents applied to a free program could -make it effectively proprietary. To prevent this, the GPL assures that -patents cannot be used to render the program non-free. - - The precise terms and conditions for copying, distribution and -modification follow. - - TERMS AND CONDITIONS - - 0. Definitions. - - "This License" refers to version 3 of the GNU General Public License. - - "Copyright" also means copyright-like laws that apply to other kinds of -works, such as semiconductor masks. - - "The Program" refers to any copyrightable work licensed under this -License. Each licensee is addressed as "you". "Licensees" and -"recipients" may be individuals or organizations. - - To "modify" a work means to copy from or adapt all or part of the work -in a fashion requiring copyright permission, other than the making of an -exact copy. The resulting work is called a "modified version" of the -earlier work or a work "based on" the earlier work. - - A "covered work" means either the unmodified Program or a work based -on the Program. - - To "propagate" a work means to do anything with it that, without -permission, would make you directly or secondarily liable for -infringement under applicable copyright law, except executing it on a -computer or modifying a private copy. Propagation includes copying, -distribution (with or without modification), making available to the -public, and in some countries other activities as well. - - To "convey" a work means any kind of propagation that enables other -parties to make or receive copies. Mere interaction with a user through -a computer network, with no transfer of a copy, is not conveying. - - An interactive user interface displays "Appropriate Legal Notices" -to the extent that it includes a convenient and prominently visible -feature that (1) displays an appropriate copyright notice, and (2) -tells the user that there is no warranty for the work (except to the -extent that warranties are provided), that licensees may convey the -work under this License, and how to view a copy of this License. If -the interface presents a list of user commands or options, such as a -menu, a prominent item in the list meets this criterion. - - 1. Source Code. - - The "source code" for a work means the preferred form of the work -for making modifications to it. "Object code" means any non-source -form of a work. - - A "Standard Interface" means an interface that either is an official -standard defined by a recognized standards body, or, in the case of -interfaces specified for a particular programming language, one that -is widely used among developers working in that language. - - The "System Libraries" of an executable work include anything, other -than the work as a whole, that (a) is included in the normal form of -packaging a Major Component, but which is not part of that Major -Component, and (b) serves only to enable use of the work with that -Major Component, or to implement a Standard Interface for which an -implementation is available to the public in source code form. A -"Major Component", in this context, means a major essential component -(kernel, window system, and so on) of the specific operating system -(if any) on which the executable work runs, or a compiler used to -produce the work, or an object code interpreter used to run it. - - The "Corresponding Source" for a work in object code form means all -the source code needed to generate, install, and (for an executable -work) run the object code and to modify the work, including scripts to -control those activities. However, it does not include the work's -System Libraries, or general-purpose tools or generally available free -programs which are used unmodified in performing those activities but -which are not part of the work. For example, Corresponding Source -includes interface definition files associated with source files for -the work, and the source code for shared libraries and dynamically -linked subprograms that the work is specifically designed to require, -such as by intimate data communication or control flow between those -subprograms and other parts of the work. - - The Corresponding Source need not include anything that users -can regenerate automatically from other parts of the Corresponding -Source. - - The Corresponding Source for a work in source code form is that -same work. - - 2. Basic Permissions. - - All rights granted under this License are granted for the term of -copyright on the Program, and are irrevocable provided the stated -conditions are met. This License explicitly affirms your unlimited -permission to run the unmodified Program. The output from running a -covered work is covered by this License only if the output, given its -content, constitutes a covered work. This License acknowledges your -rights of fair use or other equivalent, as provided by copyright law. - - You may make, run and propagate covered works that you do not -convey, without conditions so long as your license otherwise remains -in force. You may convey covered works to others for the sole purpose -of having them make modifications exclusively for you, or provide you -with facilities for running those works, provided that you comply with -the terms of this License in conveying all material for which you do -not control copyright. Those thus making or running the covered works -for you must do so exclusively on your behalf, under your direction -and control, on terms that prohibit them from making any copies of -your copyrighted material outside their relationship with you. - - Conveying under any other circumstances is permitted solely under -the conditions stated below. Sublicensing is not allowed; section 10 -makes it unnecessary. - - 3. Protecting Users' Legal Rights From Anti-Circumvention Law. - - No covered work shall be deemed part of an effective technological -measure under any applicable law fulfilling obligations under article -11 of the WIPO copyright treaty adopted on 20 December 1996, or -similar laws prohibiting or restricting circumvention of such -measures. - - When you convey a covered work, you waive any legal power to forbid -circumvention of technological measures to the extent such circumvention -is effected by exercising rights under this License with respect to -the covered work, and you disclaim any intention to limit operation or -modification of the work as a means of enforcing, against the work's -users, your or third parties' legal rights to forbid circumvention of -technological measures. - - 4. Conveying Verbatim Copies. - - You may convey verbatim copies of the Program's source code as you -receive it, in any medium, provided that you conspicuously and -appropriately publish on each copy an appropriate copyright notice; -keep intact all notices stating that this License and any -non-permissive terms added in accord with section 7 apply to the code; -keep intact all notices of the absence of any warranty; and give all -recipients a copy of this License along with the Program. - - You may charge any price or no price for each copy that you convey, -and you may offer support or warranty protection for a fee. - - 5. Conveying Modified Source Versions. - - You may convey a work based on the Program, or the modifications to -produce it from the Program, in the form of source code under the -terms of section 4, provided that you also meet all of these conditions: - - a) The work must carry prominent notices stating that you modified - it, and giving a relevant date. - - b) The work must carry prominent notices stating that it is - released under this License and any conditions added under section - 7. This requirement modifies the requirement in section 4 to - "keep intact all notices". - - c) You must license the entire work, as a whole, under this - License to anyone who comes into possession of a copy. This - License will therefore apply, along with any applicable section 7 - additional terms, to the whole of the work, and all its parts, - regardless of how they are packaged. This License gives no - permission to license the work in any other way, but it does not - invalidate such permission if you have separately received it. - - d) If the work has interactive user interfaces, each must display - Appropriate Legal Notices; however, if the Program has interactive - interfaces that do not display Appropriate Legal Notices, your - work need not make them do so. - - A compilation of a covered work with other separate and independent -works, which are not by their nature extensions of the covered work, -and which are not combined with it such as to form a larger program, -in or on a volume of a storage or distribution medium, is called an -"aggregate" if the compilation and its resulting copyright are not -used to limit the access or legal rights of the compilation's users -beyond what the individual works permit. Inclusion of a covered work -in an aggregate does not cause this License to apply to the other -parts of the aggregate. - - 6. Conveying Non-Source Forms. - - You may convey a covered work in object code form under the terms -of sections 4 and 5, provided that you also convey the -machine-readable Corresponding Source under the terms of this License, -in one of these ways: - - a) Convey the object code in, or embodied in, a physical product - (including a physical distribution medium), accompanied by the - Corresponding Source fixed on a durable physical medium - customarily used for software interchange. - - b) Convey the object code in, or embodied in, a physical product - (including a physical distribution medium), accompanied by a - written offer, valid for at least three years and valid for as - long as you offer spare parts or customer support for that product - model, to give anyone who possesses the object code either (1) a - copy of the Corresponding Source for all the software in the - product that is covered by this License, on a durable physical - medium customarily used for software interchange, for a price no - more than your reasonable cost of physically performing this - conveying of source, or (2) access to copy the - Corresponding Source from a network server at no charge. - - c) Convey individual copies of the object code with a copy of the - written offer to provide the Corresponding Source. This - alternative is allowed only occasionally and noncommercially, and - only if you received the object code with such an offer, in accord - with subsection 6b. - - d) Convey the object code by offering access from a designated - place (gratis or for a charge), and offer equivalent access to the - Corresponding Source in the same way through the same place at no - further charge. You need not require recipients to copy the - Corresponding Source along with the object code. If the place to - copy the object code is a network server, the Corresponding Source - may be on a different server (operated by you or a third party) - that supports equivalent copying facilities, provided you maintain - clear directions next to the object code saying where to find the - Corresponding Source. Regardless of what server hosts the - Corresponding Source, you remain obligated to ensure that it is - available for as long as needed to satisfy these requirements. - - e) Convey the object code using peer-to-peer transmission, provided - you inform other peers where the object code and Corresponding - Source of the work are being offered to the general public at no - charge under subsection 6d. - - A separable portion of the object code, whose source code is excluded -from the Corresponding Source as a System Library, need not be -included in conveying the object code work. - - A "User Product" is either (1) a "consumer product", which means any -tangible personal property which is normally used for personal, family, -or household purposes, or (2) anything designed or sold for incorporation -into a dwelling. In determining whether a product is a consumer product, -doubtful cases shall be resolved in favor of coverage. For a particular -product received by a particular user, "normally used" refers to a -typical or common use of that class of product, regardless of the status -of the particular user or of the way in which the particular user -actually uses, or expects or is expected to use, the product. A product -is a consumer product regardless of whether the product has substantial -commercial, industrial or non-consumer uses, unless such uses represent -the only significant mode of use of the product. - - "Installation Information" for a User Product means any methods, -procedures, authorization keys, or other information required to install -and execute modified versions of a covered work in that User Product from -a modified version of its Corresponding Source. The information must -suffice to ensure that the continued functioning of the modified object -code is in no case prevented or interfered with solely because -modification has been made. - - If you convey an object code work under this section in, or with, or -specifically for use in, a User Product, and the conveying occurs as -part of a transaction in which the right of possession and use of the -User Product is transferred to the recipient in perpetuity or for a -fixed term (regardless of how the transaction is characterized), the -Corresponding Source conveyed under this section must be accompanied -by the Installation Information. But this requirement does not apply -if neither you nor any third party retains the ability to install -modified object code on the User Product (for example, the work has -been installed in ROM). - - The requirement to provide Installation Information does not include a -requirement to continue to provide support service, warranty, or updates -for a work that has been modified or installed by the recipient, or for -the User Product in which it has been modified or installed. Access to a -network may be denied when the modification itself materially and -adversely affects the operation of the network or violates the rules and -protocols for communication across the network. - - Corresponding Source conveyed, and Installation Information provided, -in accord with this section must be in a format that is publicly -documented (and with an implementation available to the public in -source code form), and must require no special password or key for -unpacking, reading or copying. - - 7. Additional Terms. - - "Additional permissions" are terms that supplement the terms of this -License by making exceptions from one or more of its conditions. -Additional permissions that are applicable to the entire Program shall -be treated as though they were included in this License, to the extent -that they are valid under applicable law. If additional permissions -apply only to part of the Program, that part may be used separately -under those permissions, but the entire Program remains governed by -this License without regard to the additional permissions. - - When you convey a copy of a covered work, you may at your option -remove any additional permissions from that copy, or from any part of -it. (Additional permissions may be written to require their own -removal in certain cases when you modify the work.) You may place -additional permissions on material, added by you to a covered work, -for which you have or can give appropriate copyright permission. - - Notwithstanding any other provision of this License, for material you -add to a covered work, you may (if authorized by the copyright holders of -that material) supplement the terms of this License with terms: - - a) Disclaiming warranty or limiting liability differently from the - terms of sections 15 and 16 of this License; or - - b) Requiring preservation of specified reasonable legal notices or - author attributions in that material or in the Appropriate Legal - Notices displayed by works containing it; or - - c) Prohibiting misrepresentation of the origin of that material, or - requiring that modified versions of such material be marked in - reasonable ways as different from the original version; or - - d) Limiting the use for publicity purposes of names of licensors or - authors of the material; or - - e) Declining to grant rights under trademark law for use of some - trade names, trademarks, or service marks; or - - f) Requiring indemnification of licensors and authors of that - material by anyone who conveys the material (or modified versions of - it) with contractual assumptions of liability to the recipient, for - any liability that these contractual assumptions directly impose on - those licensors and authors. - - All other non-permissive additional terms are considered "further -restrictions" within the meaning of section 10. If the Program as you -received it, or any part of it, contains a notice stating that it is -governed by this License along with a term that is a further -restriction, you may remove that term. If a license document contains -a further restriction but permits relicensing or conveying under this -License, you may add to a covered work material governed by the terms -of that license document, provided that the further restriction does -not survive such relicensing or conveying. - - If you add terms to a covered work in accord with this section, you -must place, in the relevant source files, a statement of the -additional terms that apply to those files, or a notice indicating -where to find the applicable terms. - - Additional terms, permissive or non-permissive, may be stated in the -form of a separately written license, or stated as exceptions; -the above requirements apply either way. - - 8. Termination. - - You may not propagate or modify a covered work except as expressly -provided under this License. Any attempt otherwise to propagate or -modify it is void, and will automatically terminate your rights under -this License (including any patent licenses granted under the third -paragraph of section 11). - - However, if you cease all violation of this License, then your -license from a particular copyright holder is reinstated (a) -provisionally, unless and until the copyright holder explicitly and -finally terminates your license, and (b) permanently, if the copyright -holder fails to notify you of the violation by some reasonable means -prior to 60 days after the cessation. - - Moreover, your license from a particular copyright holder is -reinstated permanently if the copyright holder notifies you of the -violation by some reasonable means, this is the first time you have -received notice of violation of this License (for any work) from that -copyright holder, and you cure the violation prior to 30 days after -your receipt of the notice. - - Termination of your rights under this section does not terminate the -licenses of parties who have received copies or rights from you under -this License. If your rights have been terminated and not permanently -reinstated, you do not qualify to receive new licenses for the same -material under section 10. - - 9. Acceptance Not Required for Having Copies. - - You are not required to accept this License in order to receive or -run a copy of the Program. Ancillary propagation of a covered work -occurring solely as a consequence of using peer-to-peer transmission -to receive a copy likewise does not require acceptance. However, -nothing other than this License grants you permission to propagate or -modify any covered work. These actions infringe copyright if you do -not accept this License. Therefore, by modifying or propagating a -covered work, you indicate your acceptance of this License to do so. - - 10. Automatic Licensing of Downstream Recipients. - - Each time you convey a covered work, the recipient automatically -receives a license from the original licensors, to run, modify and -propagate that work, subject to this License. You are not responsible -for enforcing compliance by third parties with this License. - - An "entity transaction" is a transaction transferring control of an -organization, or substantially all assets of one, or subdividing an -organization, or merging organizations. If propagation of a covered -work results from an entity transaction, each party to that -transaction who receives a copy of the work also receives whatever -licenses to the work the party's predecessor in interest had or could -give under the previous paragraph, plus a right to possession of the -Corresponding Source of the work from the predecessor in interest, if -the predecessor has it or can get it with reasonable efforts. - - You may not impose any further restrictions on the exercise of the -rights granted or affirmed under this License. For example, you may -not impose a license fee, royalty, or other charge for exercise of -rights granted under this License, and you may not initiate litigation -(including a cross-claim or counterclaim in a lawsuit) alleging that -any patent claim is infringed by making, using, selling, offering for -sale, or importing the Program or any portion of it. - - 11. Patents. - - A "contributor" is a copyright holder who authorizes use under this -License of the Program or a work on which the Program is based. The -work thus licensed is called the contributor's "contributor version". - - A contributor's "essential patent claims" are all patent claims -owned or controlled by the contributor, whether already acquired or -hereafter acquired, that would be infringed by some manner, permitted -by this License, of making, using, or selling its contributor version, -but do not include claims that would be infringed only as a -consequence of further modification of the contributor version. For -purposes of this definition, "control" includes the right to grant -patent sublicenses in a manner consistent with the requirements of -this License. - - Each contributor grants you a non-exclusive, worldwide, royalty-free -patent license under the contributor's essential patent claims, to -make, use, sell, offer for sale, import and otherwise run, modify and -propagate the contents of its contributor version. - - In the following three paragraphs, a "patent license" is any express -agreement or commitment, however denominated, not to enforce a patent -(such as an express permission to practice a patent or covenant not to -sue for patent infringement). To "grant" such a patent license to a -party means to make such an agreement or commitment not to enforce a -patent against the party. - - If you convey a covered work, knowingly relying on a patent license, -and the Corresponding Source of the work is not available for anyone -to copy, free of charge and under the terms of this License, through a -publicly available network server or other readily accessible means, -then you must either (1) cause the Corresponding Source to be so -available, or (2) arrange to deprive yourself of the benefit of the -patent license for this particular work, or (3) arrange, in a manner -consistent with the requirements of this License, to extend the patent -license to downstream recipients. "Knowingly relying" means you have -actual knowledge that, but for the patent license, your conveying the -covered work in a country, or your recipient's use of the covered work -in a country, would infringe one or more identifiable patents in that -country that you have reason to believe are valid. - - If, pursuant to or in connection with a single transaction or -arrangement, you convey, or propagate by procuring conveyance of, a -covered work, and grant a patent license to some of the parties -receiving the covered work authorizing them to use, propagate, modify -or convey a specific copy of the covered work, then the patent license -you grant is automatically extended to all recipients of the covered -work and works based on it. - - A patent license is "discriminatory" if it does not include within -the scope of its coverage, prohibits the exercise of, or is -conditioned on the non-exercise of one or more of the rights that are -specifically granted under this License. You may not convey a covered -work if you are a party to an arrangement with a third party that is -in the business of distributing software, under which you make payment -to the third party based on the extent of your activity of conveying -the work, and under which the third party grants, to any of the -parties who would receive the covered work from you, a discriminatory -patent license (a) in connection with copies of the covered work -conveyed by you (or copies made from those copies), or (b) primarily -for and in connection with specific products or compilations that -contain the covered work, unless you entered into that arrangement, -or that patent license was granted, prior to 28 March 2007. - - Nothing in this License shall be construed as excluding or limiting -any implied license or other defenses to infringement that may -otherwise be available to you under applicable patent law. - - 12. No Surrender of Others' Freedom. - - If conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot convey a -covered work so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you may -not convey it at all. For example, if you agree to terms that obligate you -to collect a royalty for further conveying from those to whom you convey -the Program, the only way you could satisfy both those terms and this -License would be to refrain entirely from conveying the Program. - - 13. Use with the GNU Affero General Public License. - - Notwithstanding any other provision of this License, you have -permission to link or combine any covered work with a work licensed -under version 3 of the GNU Affero General Public License into a single -combined work, and to convey the resulting work. The terms of this -License will continue to apply to the part which is the covered work, -but the special requirements of the GNU Affero General Public License, -section 13, concerning interaction through a network will apply to the -combination as such. - - 14. Revised Versions of this License. - - The Free Software Foundation may publish revised and/or new versions of -the GNU General Public License from time to time. Such new versions will -be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - - Each version is given a distinguishing version number. If the -Program specifies that a certain numbered version of the GNU General -Public License "or any later version" applies to it, you have the -option of following the terms and conditions either of that numbered -version or of any later version published by the Free Software -Foundation. If the Program does not specify a version number of the -GNU General Public License, you may choose any version ever published -by the Free Software Foundation. - - If the Program specifies that a proxy can decide which future -versions of the GNU General Public License can be used, that proxy's -public statement of acceptance of a version permanently authorizes you -to choose that version for the Program. - - Later license versions may give you additional or different -permissions. However, no additional obligations are imposed on any -author or copyright holder as a result of your choosing to follow a -later version. - - 15. Disclaimer of Warranty. - - THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY -APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT -HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY -OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM -IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF -ALL NECESSARY SERVICING, REPAIR OR CORRECTION. - - 16. Limitation of Liability. - - IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS -THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY -GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE -USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF -DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD -PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), -EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF -SUCH DAMAGES. - - 17. Interpretation of Sections 15 and 16. - - If the disclaimer of warranty and limitation of liability provided -above cannot be given local legal effect according to their terms, -reviewing courts shall apply local law that most closely approximates -an absolute waiver of all civil liability in connection with the -Program, unless a warranty or assumption of liability accompanies a -copy of the Program in return for a fee. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Programs - - If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. - - To do so, attach the following notices to the program. It is safest -to attach them to the start of each source file to most effectively -state the exclusion of warranty; and each file should have at least -the "copyright" line and a pointer to where the full notice is found. - - - Copyright (C) - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . - -Also add information on how to contact you by electronic and paper mail. - - If the program does terminal interaction, make it output a short -notice like this when it starts in an interactive mode: - - Copyright (C) - This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. - This is free software, and you are welcome to redistribute it - under certain conditions; type `show c' for details. - -The hypothetical commands `show w' and `show c' should show the appropriate -parts of the General Public License. Of course, your program's commands -might be different; for a GUI interface, you would use an "about box". - - You should also get your employer (if you work as a programmer) or school, -if any, to sign a "copyright disclaimer" for the program, if necessary. -For more information on this, and how to apply and follow the GNU GPL, see -. - - The GNU General Public License does not permit incorporating your program -into proprietary programs. If your program is a subroutine library, you -may consider it more useful to permit linking proprietary applications with -the library. If this is what you want to do, use the GNU Lesser General -Public License instead of this License. But first, please read -. diff --git a/packages/loc-changes/Carton b/packages/loc-changes/Carton deleted file mode 100644 index 2581298f6..000000000 --- a/packages/loc-changes/Carton +++ /dev/null @@ -1,7 +0,0 @@ -(source "melpa" "http://melpa.milkbox.net/packages/") - -(package "loc-change" "0.1.0" - "Unit tests for GNU emacs that work interactively and in batch") - -(development - (depends-on "test-simple")) diff --git a/packages/loc-changes/INSTALL b/packages/loc-changes/INSTALL deleted file mode 100644 index aaa3bf86a..000000000 --- a/packages/loc-changes/INSTALL +++ /dev/null @@ -1,246 +0,0 @@ -Installation Instructions -************************* - -Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002, 2004, 2005, -2006, 2007, 2008, 2009 Free Software Foundation, Inc. - - Copying and distribution of this file, with or without modification, -are permitted in any medium without royalty provided the copyright -notice and this notice are preserved. This file is offered as-is, -without warranty of any kind. - -Basic Installation -================== - - Briefly, the shell commands `./configure && make' should configure, -and build this package. If that succeeds `make install' will install -the package. However on some systems you may need root privileges, you -may have use `sudo make install' or perhaps `su root' beforehand. - -Generic Information -=================== - - The `configure' shell script attempts to guess correct values for -various system-dependent variables used during compilation. It uses -those values to create a `Makefile' in each directory of the package. -It also creates a shell script `config.status' that you can run in -the future to recreate the current configuration, and a file -`config.log' containing compiler output (useful mainly for debugging -`configure'). - - The configure script can also use an optional file (typically -called `config.cache' and enabled with `--cache-file=config.cache' or -simply `-C') that saves the results of its tests to speed up -reconfiguring. Caching is disabled by default to prevent problems -with accidental use of stale cache files. - - If you need to do unusual things to compile the package, please try -to figure out how `configure' could check whether to do them, and mail -diffs or instructions to the address given in the `README' so they can -be considered for the next release. If you are using the cache, and at -some point `config.cache' contains results you don't want to keep, you -may remove or edit it. - - The file `configure.ac' is used to create `configure' by a program -called `autoconf'. You need `configure.ac' if you want to change it -or regenerate `configure' using a newer version of `autoconf'. - - The simplest way to compile this package is: - - 1. `cd' to the directory containing the package's source code and type - `./configure' to configure the package for your system. - - Running `configure' might take a while. While running, it prints - some messages telling which features it is checking for. - - 2. Type `make' to compile the package. - - 3. Optionally, type `make check' to run any self-tests that come with - the package, generally using the just-built uninstalled binaries. - - 4. Type `make install' to install the programs and any data files and - documentation. When installing into a prefix owned by root, it is - recommended that the package be configured and built as a regular - user, and only the `make install' phase executed with root - privileges. - - 5. You can remove the compiled Emacs Lisp files and other derived - files from the source code directory by typing `make clean'. To - also remove the files that `configure' created (so you can - compile the package for a different kind of computer), type `make - distclean'. There is also a `make maintainer-clean' target, but - that is intended mainly for the package's developers. If you use - it, you may have to get all sorts of other programs in order to - regenerate files that came with the distribution. - - 6. You can also type `make uninstall' to remove the installed files - again. - - 7. We don't provide `make distcheck' right now, but perhaps someday - we will. This is by used by developers to test that all other - targets like `make install' and `make uninstall' work correctly. - This target is generally not run by end users. - -Options -===================== - - Run `./configure --help' for details on the pertinent -environment variables. - - You can give `configure' initial values for configuration parameters -by setting variables in the command line or in the environment. Here -is an example: - - ./configure CC=c99 EMACS=/usr/bin/emacs23-x - - *Note Defining Variables::, for more details. - -Installation Names -================== - - By default, `make install' installs the package's emacs files under -`/usr/local/share/emacs/site-lisp', You can specify an installation -prefix other than `/usr/local/emacs/site-lisp' by giving `configure' -the option `--with-site-lisp=PREFIX', where PREFIX must be an absolute -file name. - - The most portable way to affect installation locations is to pass the -correct locations to `configure'; however, many packages provide one or -both of the following shortcuts of passing variable assignments to the -`make install' command line to change installation locations without -having to reconfigure or recompile. - - The first method involves providing an override variable for each -affected directory. For example, `make install -prefix=/alternate/directory' will choose an alternate location for all -directory configuration variables that were expressed in terms of -`${prefix}'. Any directories that were specified during `configure', -but not in terms of `${prefix}', must each be overridden at install -time for the entire installation to be relocated. The approach of -makefile variable overrides for each directory variable is required by -the GNU Coding Standards, and ideally causes no recompilation. -However, some platforms have known limitations with the semantics of -shared libraries that end up requiring recompilation when using this -method, particularly noticeable in packages that use GNU Libtool. - - The second method involves providing the `DESTDIR' variable. For -example, `make install DESTDIR=/alternate/directory' will prepend -`/alternate/directory' before all installation names. The approach of -`DESTDIR' overrides is not required by the GNU Coding Standards, and -does not work on platforms that have drive letters. On the other hand, -it does better at avoiding recompilation issues, and works well even -when some directory options were not specified in terms of `${prefix}' -at `configure' time. - -Optional Features -================= - - If the package supports it, you can cause programs to be installed -with an extra prefix or suffix on their names by giving `configure' the -option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'. - - Some packages pay attention to `--enable-FEATURE' options to -`configure', where FEATURE indicates an optional part of the package. -They may also pay attention to `--with-PACKAGE' options, where PACKAGE -is something like `gnu-as' or `x' (for the X Window System). The -`README' should mention any `--enable-' and `--with-' options that the -package recognizes. - - For packages that use the X Window System, `configure' can usually -find the X include and library files automatically, but if it doesn't, -you can use the `configure' options `--x-includes=DIR' and -`--x-libraries=DIR' to specify their locations. - - Some packages offer the ability to configure how verbose the -execution of `make' will be. For these packages, running `./configure ---enable-silent-rules' sets the default to minimal output, which can be -overridden with `make V=1'; while running `./configure ---disable-silent-rules' sets the default to verbose, which can be -overridden with `make V=0'. - - -Sharing Defaults -================ - - If you want to set default values for `configure' scripts to share, -you can create a site shell script called `config.site' that gives -default values for variables like `CC', `cache_file', and `prefix'. -`configure' looks for `PREFIX/share/config.site' if it exists, then -`PREFIX/etc/config.site' if it exists. Or, you can set the -`CONFIG_SITE' environment variable to the location of the site script. -A warning: not all `configure' scripts look for a site script. - -Defining Variables -================== - - Variables not defined in a site shell script can be set in the -environment passed to `configure'. However, some packages may run -configure again during the build, and the customized values of these -variables may be lost. In order to avoid this problem, you should set -them in the `configure' command line, using `VAR=value'. For example: - - ./configure EMACS=/usr/bin/emacs23-x - -causes the specified `/usr/bin/emacs23-x' to be used as the Emacs program -to use. - -Unfortunately, this technique does not work for `CONFIG_SHELL' due to -an Autoconf bug. Until the bug is fixed you can use this workaround: - - CONFIG_SHELL=/bin/bash /bin/bash ./configure CONFIG_SHELL=/bin/bash - -`configure' Invocation -====================== - - `configure' recognizes the following options to control how it -operates. - -`--help' -`-h' - Print a summary of all of the options to `configure', and exit. - -`--help=short' -`--help=recursive' - Print a summary of the options unique to this package's - `configure', and exit. The `short' variant lists options used - only in the top level, while the `recursive' variant lists options - also present in any nested packages. - -`--version' -`-V' - Print the version of Autoconf used to generate the `configure' - script, and exit. - -`--cache-file=FILE' - Enable the cache: use and save the results of the tests in FILE, - traditionally `config.cache'. FILE defaults to `/dev/null' to - disable caching. - -`--config-cache' -`-C' - Alias for `--cache-file=config.cache'. - -`--quiet' -`--silent' -`-q' - Do not print messages saying which checks are being made. To - suppress all normal output, redirect it to `/dev/null' (any error - messages will still be shown). - -`--srcdir=DIR' - Look for the package's source code in directory DIR. Usually - `configure' can determine that directory automatically. - -`--prefix=DIR' - Use DIR as the installation prefix. *note Installation Names:: - for more details, including other options available for fine-tuning - the installation locations. - -`--no-create' -`-n' - Run the configure checks, but stop before creating any output - files. - -`configure' also accepts some other, not widely useful, options. Run -`configure --help' for more details. - diff --git a/packages/loc-changes/Makefile.am b/packages/loc-changes/Makefile.am deleted file mode 100644 index 99b64db53..000000000 --- a/packages/loc-changes/Makefile.am +++ /dev/null @@ -1,34 +0,0 @@ -lispdir = @lispdir@ - -lisp_files := $(wildcard *.el) -lisp_LISP = $(lisp_files) - -include common.mk - -EXTRA_DIST = $(lisp_files) $(test_files) README.md THANKS - -test_files := $(wildcard test/test-*.el) - -#: Run all tests without bloated output -check-short: - $(MAKE) check 2>&1 | ruby make-check-filter.rb - -if MAINTAINER_MODE - -CL = ChangeLog -ChangeLog: - git log --pretty --numstat --summary | $(GIT2CL) > $@ - -ACLOCAL_AMFLAGS=-I . - -endif - -#: Run all tests -test: check - -#: Run all tests without bloated output -check-short: - $(MAKE) check 2>&1 | ruby make-check-filter.rb - -check: - $(MAKE) -C test $@ diff --git a/packages/loc-changes/NEWS b/packages/loc-changes/NEWS deleted file mode 100644 index e69de29bb..000000000 diff --git a/packages/loc-changes/README b/packages/loc-changes/README deleted file mode 120000 index 42061c01a..000000000 --- a/packages/loc-changes/README +++ /dev/null @@ -1 +0,0 @@ -README.md \ No newline at end of file diff --git a/packages/loc-changes/README.md b/packages/loc-changes/README.md deleted file mode 100644 index b0fe3a9c1..000000000 --- a/packages/loc-changes/README.md +++ /dev/null @@ -1,15 +0,0 @@ -[![Build Status](https://travis-ci.org/rocky/emacs-loc-changes.png)](https://travis-ci.org/rocky/emacs-loc-changes) - -Keeps track of important buffer positions after buffer changes. - -Sometimes it is useful to make note of certain locations in program -code. For example these might be error locations reported in a -compilation. Or you could be inside a debugger and change the source -code but want to continue debugging. - -Without this, the positions that a compilation error report or that a -debugger refers to may be a little off from the modified source. - -This package tries to ameliorate that by allowing a user or program -(e.g. a debugger front-end) to set marks to track the original -locations. diff --git a/packages/loc-changes/THANKS b/packages/loc-changes/THANKS deleted file mode 100644 index 7408d2a03..000000000 --- a/packages/loc-changes/THANKS +++ /dev/null @@ -1 +0,0 @@ -Lars Anderson - Melapa packaging, among other things diff --git a/packages/loc-changes/autogen.sh b/packages/loc-changes/autogen.sh deleted file mode 100755 index 8a728371d..000000000 --- a/packages/loc-changes/autogen.sh +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh -autoreconf -vi && \ -autoconf && { - echo "Running configure with --enable-maintainer-mode $@" - ./configure --enable-maintainer-mode $@ -} diff --git a/packages/loc-changes/common.mk b/packages/loc-changes/common.mk deleted file mode 100644 index 26b632560..000000000 --- a/packages/loc-changes/common.mk +++ /dev/null @@ -1,5 +0,0 @@ -short: - $(MAKE) 2>&1 >/dev/null | ruby $(top_srcdir)/make-check-filter.rb - -%.short: - $(MAKE) $(@:.short=) 2>&1 >/dev/null diff --git a/packages/loc-changes/configure.ac b/packages/loc-changes/configure.ac deleted file mode 100644 index 439ceff1a..000000000 --- a/packages/loc-changes/configure.ac +++ /dev/null @@ -1,13 +0,0 @@ -AC_INIT(emacs-loc-changes, 1.1) -AC_CONFIG_SRCDIR(loc-changes.el) -AM_INIT_AUTOMAKE -AM_MAINTAINER_MODE - -## -## Find out where to install the debugger emacs lisp files -## -AM_PATH_LISPDIR -AM_CONDITIONAL(INSTALL_EMACS_LISP, test "x$lispdir" != "x") - -AC_CONFIG_FILES([Makefile test/Makefile]) -AC_OUTPUT diff --git a/packages/loc-changes/el-get-install.el b/packages/loc-changes/el-get-install.el deleted file mode 100644 index 4ed032588..000000000 --- a/packages/loc-changes/el-get-install.el +++ /dev/null @@ -1,103 +0,0 @@ -(eval-when-compile - (defvar el-get-sources) -) - -(declare-function el-get-post-install 'el-get) - -(add-to-list 'load-path "~/.emacs.d/el-get/el-get") - -;;; el-get-install.el --- installer for the lazy -;; -;; Copyright (C) 2010 Dimitri Fontaine -;; -;; Author: Dimitri Fontaine -;; URL: http://www.emacswiki.org/emacs/el-get.el -;; Created: 2010-06-17 -;; Keywords: emacs package elisp install elpa git git-svn bzr cvs apt-get fink http http-tar -;; Licence: WTFPL, grab your copy here: http://sam.zoy.org/wtfpl/ -;; -;; This file is NOT part of GNU Emacs. -;; -;; bootstrap your el-get installation, the goal is then to use el-get to -;; update el-get. -;; -;; So the idea is that you copy/paste this code into your *scratch* buffer, -;; hit C-j, and you have a working el-get. - -(let ((el-get-root - (file-name-as-directory - (or (bound-and-true-p el-get-dir) - (concat (file-name-as-directory user-emacs-directory) "el-get"))))) - - (when (file-directory-p el-get-root) - (add-to-list 'load-path el-get-root)) - - ;; try to require el-get, failure means we have to install it - (unless (require 'el-get nil t) - (unless (file-directory-p el-get-root) - (make-directory el-get-root t)) - - (let* ((package "el-get") - (buf (switch-to-buffer "*el-get bootstrap*")) - (pdir (file-name-as-directory (concat el-get-root package))) - (git (or (executable-find "git") - (error "Unable to find `git'"))) - (url (or (bound-and-true-p el-get-git-install-url) - "http://github.com/dimitri/el-get.git")) - (default-directory el-get-root) - (process-connection-type nil) ; pipe, no pty (--no-progress) - - ;; First clone el-get - (status - (call-process - git nil `(,buf t) t "--no-pager" "clone" "-v" url package))) - - (unless (zerop status) - (error "Couldn't clone el-get from the Git repository: %s" url)) - - ;; switch branch if we have to - (let* ((branch (cond - ;; Check if a specific branch is requested - ((bound-and-true-p el-get-install-branch)) - ;; Check if master branch is requested - ((boundp 'el-get-master-branch) "master") - ;; Read the default branch from the el-get recipe - ((plist-get (with-temp-buffer - (insert-file-contents-literally - (expand-file-name "recipes/el-get.rcp" pdir)) - (read (current-buffer))) - :branch)) - ;; As a last resort, use the master branch - ("master"))) - (remote-branch (format "origin/%s" branch)) - (default-directory pdir) - (bstatus - (if (string-equal branch "master") - 0 - (call-process git nil (list buf t) t "checkout" "-t" remote-branch)))) - (unless (zerop bstatus) - (error "Couldn't `git checkout -t %s`" branch))) - - (add-to-list 'load-path pdir) - (load package) - (let ((el-get-default-process-sync t) ; force sync operations for installer - (el-get-verbose t)) ; let's see it all - (el-get-post-install "el-get")) - (with-current-buffer buf - (goto-char (point-max)) - (insert "\nCongrats, el-get is installed and ready to serve!"))))) - - -(declare-function el-get 'el-get) - -;; now either el-get is `require'd already, or have been `load'ed by the -;; el-get installer. -(setq - el-get-sources - '(el-get ; el-get is self-hosting - load-relative ; load emacs lisp relative to emacs source - test-simple ; simple test framework - )) - -;; install new packages and init already installed packages -(el-get 'sync '(loc-changes load-relative test-simple)) diff --git a/packages/loc-changes/elisp-comp b/packages/loc-changes/elisp-comp deleted file mode 100755 index 73a5edac1..000000000 --- a/packages/loc-changes/elisp-comp +++ /dev/null @@ -1,93 +0,0 @@ -#!/bin/sh -# Copyright (C) 1995-2012 Free Software Foundation, Inc. - -scriptversion=2013-03-27.22 - -# Franc,ois Pinard , 1995. -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2, or (at your option) -# any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . - -# As a special exception to the GNU General Public License, if you -# distribute this file as part of a program that contains a -# configuration script generated by Autoconf, you may include it under -# the same distribution terms that you use for the rest of that program. - -# This file is maintained in Automake, please report -# bugs to or send patches to -# . - -case $1 in - '') - echo "$0: No files. Try '$0 --help' for more information." 1>&2 - exit 1; - ;; - -h | --h*) - cat <<\EOF -Usage: elisp-comp [--help] [--version] FILES... - -This script byte-compiles all '.el' files listed as FILES using GNU -Emacs, and put the resulting '.elc' files into the current directory, -so disregarding the original directories used in '.el' arguments. - -This script manages in such a way that all Emacs LISP files to -be compiled are made visible between themselves, in the event -they require or load-library one another. - -Report bugs to . -EOF - exit $? - ;; - -v | --v*) - echo "elisp-comp $scriptversion" - exit $? - ;; -esac - -if test -z "$EMACS" || test "$EMACS" = "t"; then - # Value of "t" means we are running in a shell under Emacs. - # Just assume Emacs is called "emacs". - EMACS=emacs -fi - -tempdir=elc.$$ - -# Cleanup the temporary directory on exit. -trap 'ret=$?; rm -rf "$tempdir" && exit $ret' 0 -do_exit='(exit $ret); exit $ret' -trap "ret=129; $do_exit" 1 -trap "ret=130; $do_exit" 2 -trap "ret=141; $do_exit" 13 -trap "ret=143; $do_exit" 15 - -# mkdir $tempdir -# cp "$@" $tempdir - -( - # cd $tempdir - echo "(setq load-path (cons nil (cons \"$abs_srcdir\" load-path)))" > script - $EMACS -batch -q -l script -f batch-byte-compile *.el || exit $? - # mv *.elc .. -) || exit $? - -(exit 0); exit 0 - -# Local Variables: -# mode: shell-script -# sh-indentation: 2 -# eval: (add-hook 'write-file-hooks 'time-stamp) -# time-stamp-start: "scriptversion=" -# time-stamp-format: "%:y-%02m-%02d.%02H" -# time-stamp-time-zone: "UTC" -# time-stamp-end: "; # UTC" -# End: diff --git a/packages/loc-changes/install-from-git.sh b/packages/loc-changes/install-from-git.sh deleted file mode 100755 index 5bed782a9..000000000 --- a/packages/loc-changes/install-from-git.sh +++ /dev/null @@ -1,36 +0,0 @@ -#!/bin/bash -# Install emacs-dbgr from git -run_cmd() { - echo "--- Running command: $@" - $@ - rc=$? - echo "--- $@ exit status is $?" - return $rc -} - -if (( $(id -u) != 0)) ; then - need_sudo='sudo' -else - need_sudo='' -fi -for program in git make $need_sudo ; do - if ! which $program >/dev/null 2>&1 ; then - echo "Cant find program $program in $PATH" - exit 1 - fi -done - -packages=emacs-{test-simple,load-relative,loc-changes,dbgr} -for pkg in $packages ; do - echo '******************************************' - echo Trying to install ${pkg}... - echo '******************************************' - run_cmd git clone http://github.com/rocky/${pkg}.git - (cd $pkg && \ - run_cmd $SHELL ./autogen.sh && \ - run_cmd ./configure && \ - run_cmd make && \ - run_cmd make check && \ - run_cmd $need_sudo make install - ) -done diff --git a/packages/loc-changes/loc-changes.el b/packages/loc-changes/loc-changes.el deleted file mode 100644 index 417f2fe78..000000000 --- a/packages/loc-changes/loc-changes.el +++ /dev/null @@ -1,226 +0,0 @@ -;;; loc-changes.el --- Helps users and programs keep track of positions even after buffer changes. - -;; Author: Rocky Bernstein -;; Version: 1.1 -;; URL: http://github.com/rocky/emacs-loc-changes -;; Compatibility: GNU Emacs 24.x - -;; Copyright (C) 2013-2014 Rocky Bernstein - -;; This program is free software: you can redistribute it and/or -;; modify it under the terms of the GNU General Public License as -;; published by the Free Software Foundation, either version 3 of the -;; License, or (at your option) any later version. - -;; This program is distributed in the hope that it will be useful, but -;; WITHOUT ANY WARRANTY; without even the implied warranty of -;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -;; General Public License for more details. - -;; You should have received a copy of the GNU General Public License -;; along with this program. If not, see -;; . - -;;; Commentary: - -;; This package lets users or programs set marks in a buffer prior to -;; changes so that we can track the original positions after the -;; change. - -;; One common use is say when debugging a program. The debugger has its static -;; notion of the file and positions inside that. However it may be convenient -;; for a programmer to edit the program but not restart execution of the program. - -;; Another use might be in a compilation buffer for errors and -;; warnings which refer to file and line positions. - -;; Should be available via Melpa. - - -;;; Code: - -(make-variable-buffer-local 'loc-changes-alist) -(defvar loc-changes-alist '() - "A buffer-local association-list (alist) of line numbers and -their corresponding markers in the buffer. The 'key' is the line number; the value -the marker" - ) - -;;;###autoload -(defun loc-changes-goto-line (line-number &optional column-number) - "Position `point' at LINE-NUMBER of the current buffer. If -COLUMN-NUMBER is given, position `point' at that column just -before that column number within the line. Note that the beginning of -the line starts at column 0, so the column number display will be one less -than COLUMN-NUMBER. For example COLUMN-NUMBER 1 will set before the first -column on the line and show 0. - -The Emacs `goto-line' docstring says it is the wrong to use that -function in a Lisp program. So here is something that I proclaim -is okay to use in a Lisp program." - (interactive - (if (and current-prefix-arg (not (consp current-prefix-arg))) - (list (prefix-numeric-value current-prefix-arg)) - ;; Look for a default, a number in the buffer at point. - (let* ((default - (save-excursion - (skip-chars-backward "0-9") - (if (looking-at "[0-9]") - (string-to-number - (buffer-substring-no-properties - (point) - (progn (skip-chars-forward "0-9") - (point))))))) - ;; Decide if we're switching buffers. - (buffer - (if (consp current-prefix-arg) - (other-buffer (current-buffer) t))) - (buffer-prompt - (if buffer - (concat " in " (buffer-name buffer)) - ""))) - ;; Read the argument, offering that number (if any) as default. - (list (read-number (format "Goto line%s: " buffer-prompt) - (list default (line-number-at-pos))) - buffer)))) - (unless (wholenump line-number) - (error "Expecting line-number parameter `%s' to be a whole number" - line-number)) - (unless (> line-number 0) - (error "Expecting line-number parameter `%d' to be greater than 0" - line-number)) - (let ((last-line (line-number-at-pos (point-max)))) - (unless (<= line-number last-line) - (error - "Line number %d should not exceed %d, the number of lines in the buffer" - line-number last-line)) - (goto-char (point-min)) - (forward-line (1- line-number)) - (if column-number - (let ((last-column - (save-excursion - (move-end-of-line 1) - (current-column)))) - (cond ((not (wholenump column-number)) - (message - "Column ignored. Expecting column-number parameter `%s' to be a whole number" - column-number)) - ((<= column-number 0) - (message - "Column ignored. Expecting column-number parameter `%d' to be a greater than 1" - column-number)) - ((>= column-number last-column) - (message - "Column ignored. Expecting column-number parameter `%d' to be a less than %d" - column-number last-column)) - (t (forward-char (1- column-number))))) - ) - (redisplay) - ) - ) - -(defun loc-changes-add-elt (pos) - "Add an element `loc-changes-alist'. The car will be POS and a -marker for it will be created at the point." - (setq loc-changes-alist - (cons (cons pos (point-marker)) loc-changes-alist))) - -;;;###autoload -(defun loc-changes-add-and-goto (line-number &optional opt-buffer) - "Add a marker at LINE-NUMBER and record LINE-NUMBER and its -marker association in `loc-changes-alist'." - (interactive - (if (and current-prefix-arg (not (consp current-prefix-arg))) - (list (prefix-numeric-value current-prefix-arg)) - ;; Look for a default, a number in the buffer at point. - (let* ((default - (save-excursion - (skip-chars-backward "0-9") - (if (looking-at "[0-9]") - (string-to-number - (buffer-substring-no-properties - (point) - (progn (skip-chars-forward "0-9") - (point))))))) - ;; Decide if we're switching buffers. - (buffer - (if (consp current-prefix-arg) - (other-buffer (current-buffer) t))) - (buffer-prompt - (if buffer - (concat " in " (buffer-name buffer)) - ""))) - ;; Read the argument, offering that number (if any) as default. - (list (read-number (format "Goto line%s: " buffer-prompt) - (list default (line-number-at-pos))) - buffer)))) - - (let ((buffer (or opt-buffer (current-buffer)))) - (with-current-buffer buffer - (loc-changes-goto-line line-number) - (loc-changes-add-elt line-number) - )) - ) - -;;;###autoload -(defun loc-changes-clear-buffer (&optional opt-buffer) - "Remove all location-tracking associations in BUFFER." - (interactive "bbuffer: ") - (let ((buffer (or opt-buffer (current-buffer))) - ) - (with-current-buffer buffer - (setq loc-changes-alist '()) - )) - ) - -;;;###autoload -(defun loc-changes-reset-position (&optional opt-buffer no-insert) - "Update `loc-changes-alist' so that the line number of point is -used to when aline number is requested. - -Updates any existing line numbers referred to in marks at this -position. - -This may be useful for example in debugging if you save the -buffer and then cause the debugger to reread/reevaluate the file -so that its positions are will be reflected." - (interactive "") - (let* ((line-number (line-number-at-pos (point))) - (elt (assq line-number loc-changes-alist))) - (let ((buffer (or opt-buffer (current-buffer))) - ) - (with-current-buffer buffer - (if elt - (setcdr elt (point)) - (unless no-insert - (loc-changes-add-elt line-number) - ) - )) - ) - )) - - -(defun loc-changes-goto (position &optional opt-buffer no-update) - "Go to the position inside BUFFER taking into account the -previous location marks. Normally if the position hasn't been -seen before, we will add a new mark for this position. However if -NO-UPDATE is set, no mark is added." - (unless (wholenump position) - (error "Expecting line-number parameter `%s' to be a whole number" - position)) - (let ((elt (assq position loc-changes-alist))) - (if elt - (let ((marker (cdr elt))) - (unless (markerp marker) - (error "Internal error: loc-changes-alist is not a marker")) - (goto-char (marker-position marker))) - (if no-update - (loc-changes-goto-line position) - (loc-changes-add-and-goto position)) - ) - ) - ) - -(provide 'loc-changes) - -;;; loc-changes.el ends here diff --git a/packages/loc-changes/make-check-filter.rb b/packages/loc-changes/make-check-filter.rb deleted file mode 100644 index 88cad140e..000000000 --- a/packages/loc-changes/make-check-filter.rb +++ /dev/null @@ -1,25 +0,0 @@ -#!/usr/bin/env ruby -# Use this to cut out the crud from make check. -# Use like this: -# make check 2>&1 | ruby ../make-check-filter.rb -# See Makefile.am -pats = ["^(?:Loading", - '(re)?make\[', - "Making check in", - '\(cd \.\.', - "Column ignored", - "buffer \\*scratch\\*", - "\\*scratch\\*", - "make -C", - "Test-Unit", - "Fontifying", - '\s*$', - '##[<>]+$' - ].join('|') + ')' -# puts pats -skip_re = /#{pats}/ - -while gets() - next if $_ =~ skip_re - puts $_ -end diff --git a/packages/loc-changes/test/Makefile.am b/packages/loc-changes/test/Makefile.am deleted file mode 100644 index 8df6424c3..000000000 --- a/packages/loc-changes/test/Makefile.am +++ /dev/null @@ -1,43 +0,0 @@ -include $(top_srcdir)/common.mk - -PHONY=check test all -EXTRA_DIST=sample.txt - -all: - -#: same thing as "check" -test: check - -#: same thing as "check-elget" -test-elget: check-elget - -test_files := $(wildcard test-*.el) - -CHECK_FILES = $(notdir $(test_files:.el=.run)) -EL_GET_CHECK_FILES = $(notdir $(test_files:.el=.elrun)) - -#: Run all tests -check: $(CHECK_FILES) - -#: Run all tests via el-get -check-elget: $(EL_GET_CHECK_FILES) - -#: Run all tests with minimum verbosity -check-short: - $(MAKE) check 2>&1 | ruby ../make-check-filter.rb - -#: Run all tests with minimum verbosity via el-get -check-short-elget: - $(MAKE) check-elget 2>&1 | ruby ../make-check-filter.rb - -test-%.run: - (cd $(top_srcdir)/test && $(EMACS) --batch --no-site-file --no-splash --load $(@:.run=.el)) - -#: Run tests using el-get to specify external Lisp dependencies -test-%.elrun: - (cd $(top_srcdir)/test && $(EMACS) --batch --no-site-file --no-splash --load ../el-get-install.el --load $(@:.elrun=.el)) - -# Whatever it is you want to do, it should be forwarded to the -# to top-level directories -# %: -# $(MAKE) -C .. $@ diff --git a/packages/loc-changes/test/sample.txt b/packages/loc-changes/test/sample.txt deleted file mode 100644 index 7f07c10a1..000000000 --- a/packages/loc-changes/test/sample.txt +++ /dev/null @@ -1,14 +0,0 @@ -This is line 1 -This is line 2 -This is line 3 -This is line 4 -This is line 5 -This is line 6 -This is line 7 -This is line 8 -This is line 9 -This is line 10 -This is line 11 -This is line 12 -This is line 13 -This is line 14 diff --git a/packages/loc-changes/test/test-basic.el b/packages/loc-changes/test/test-basic.el deleted file mode 100644 index 0169b7067..000000000 --- a/packages/loc-changes/test/test-basic.el +++ /dev/null @@ -1,90 +0,0 @@ -(require 'cl) -(require 'test-simple) -(load-file "../loc-changes.el") - -(test-simple-start) - -(setq sample-buffer (find-file-noselect "./sample.txt")) - -(note "loc-changes-goto-line error conditions") -(assert-raises error (loc-changes-goto-line "foo")) -(message "buffer %s" (current-buffer)) -(assert-raises error (loc-changes-goto-line "0")) -(assert-raises error (loc-changes-goto-line 0)) -(assert-raises error (loc-changes-goto-line 10000)) - -(note "loc-changes-goto-line") -(save-excursion - (set-buffer sample-buffer) - (loc-changes-goto-line 5) - (assert-equal 5 (line-number-at-pos (point)))) - -(note "loc-changes-goto-line-with-column") -(with-current-buffer sample-buffer - (set-buffer sample-buffer) - (loc-changes-goto-line 1 3) - (assert-equal 1 (line-number-at-pos (point))) - ;; FIXME: - ;; (assert-equal 2 (current-column)) - ) - -(note "loc-changes-goto-line-invalid-column") -(save-excursion - (set-buffer sample-buffer) - (loc-changes-goto-line 1 300) - (assert-equal 1 (line-number-at-pos (point))) - ;; FIXME - ;; (assert-equal 0 (current-column)) - (assert-t (or - (not (current-message)) - (string-match "^Column ignored." (current-message)))) - ;; FIXME: - ;; (loc-changes-goto-line 2 -5) - ;; (assert-equal 2 (line-number-at-pos (point))) - ;; (assert-equal 0 (current-column)) - ;; (assert-t (or - ;; (not (current-message)) - ;; (string-match "^Column ignored." (current-message)))) - ) - -(note "loc-changes-clear-buffer null") -(loc-changes-clear-buffer) -(assert-equal '() loc-changes-alist) - -(note "loc-changes-add-and-goto - update") -(save-excursion - (set-buffer sample-buffer) - (loc-changes-add-and-goto 10) - (assert-equal 10 (line-number-at-pos) - "point should be at line 10") - ;; FIXME: - ;; (assert-t (assq 10 loc-changes-alist) - ;; "Should find 10 in loc-changes-alist") - ;; (assert-t (markerp (cdr (assq 10 loc-changes-alist))) - ;; "10 in loc-changes-alist should be a marker") - ) - -(note "loc-changes-goto - update") -(save-excursion - (set-buffer sample-buffer) - (loc-changes-goto 11) - (assert-equal 11 (line-number-at-pos) - "point should be at line 11") - ;; FIXME: - ;; (assert-t (assq 11 loc-changes-alist) - ;; "Should find 11 in loc-changes-alist") - ;; (assert-t (markerp (cdr (assq 11 loc-changes-alist))) - ;; "11 in loc-changes-alist should be a marker") - ) - -(note "loc-changes-goto - no update") -(save-excursion - (set-buffer sample-buffer) - (loc-changes-goto 12 nil 't) - (assert-equal 12 (line-number-at-pos) - "point should be at line 12") - (assert-nil (assq 12 loc-changes-alist) - "Should not find 12 in loc-changes-alist") - ) - -(end-tests) diff --git a/packages/realgud/.gitignore b/packages/realgud/.gitignore deleted file mode 100644 index ebc253ab2..000000000 --- a/packages/realgud/.gitignore +++ /dev/null @@ -1,22 +0,0 @@ -*.elc -*~ -/*-pkg.el -/*.tar.gz -/.python-version -/README -/aclocal.m4 -/autom4te.cache -/config.log -/config.status -/configure -/configure.lineno -/elpa -/install-sh -/missing -/test/npm-debug.log -/tmp -Makefile -Makefile.in -elc-stamp -elc-temp -script diff --git a/packages/realgud/.travis.yml b/packages/realgud/.travis.yml deleted file mode 100644 index 92dafef94..000000000 --- a/packages/realgud/.travis.yml +++ /dev/null @@ -1,16 +0,0 @@ -language: emacs-lisp - -env: - - EMACS=emacs24 - -before_install: - - if [ "$EMACS" = 'emacs24' ]; then - sudo add-apt-repository -y ppa:cassou/emacs && - sudo apt-get update -qq && - sudo apt-get install -qq - emacs24 emacs24-el emacs24-common-non-dfsg; - fi - -# run the tests -script: - - NO_CHECK_EMACS_PACKAGES=1 /bin/bash ./autogen.sh && cd test && make check-elget diff --git a/packages/realgud/AUTHORS b/packages/realgud/AUTHORS deleted file mode 100644 index 60fc84e7a..000000000 --- a/packages/realgud/AUTHORS +++ /dev/null @@ -1 +0,0 @@ -rocky@gnu.org diff --git a/packages/realgud/COPYING b/packages/realgud/COPYING deleted file mode 100644 index 94a9ed024..000000000 --- a/packages/realgud/COPYING +++ /dev/null @@ -1,674 +0,0 @@ - GNU GENERAL PUBLIC LICENSE - Version 3, 29 June 2007 - - Copyright (C) 2007 Free Software Foundation, Inc. - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The GNU General Public License is a free, copyleft license for -software and other kinds of works. - - The licenses for most software and other practical works are designed -to take away your freedom to share and change the works. By contrast, -the GNU General Public License is intended to guarantee your freedom to -share and change all versions of a program--to make sure it remains free -software for all its users. We, the Free Software Foundation, use the -GNU General Public License for most of our software; it applies also to -any other work released this way by its authors. You can apply it to -your programs, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -them if you wish), that you receive source code or can get it if you -want it, that you can change the software or use pieces of it in new -free programs, and that you know you can do these things. - - To protect your rights, we need to prevent others from denying you -these rights or asking you to surrender the rights. Therefore, you have -certain responsibilities if you distribute copies of the software, or if -you modify it: responsibilities to respect the freedom of others. - - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must pass on to the recipients the same -freedoms that you received. You must make sure that they, too, receive -or can get the source code. And you must show them these terms so they -know their rights. - - Developers that use the GNU GPL protect your rights with two steps: -(1) assert copyright on the software, and (2) offer you this License -giving you legal permission to copy, distribute and/or modify it. - - For the developers' and authors' protection, the GPL clearly explains -that there is no warranty for this free software. For both users' and -authors' sake, the GPL requires that modified versions be marked as -changed, so that their problems will not be attributed erroneously to -authors of previous versions. - - Some devices are designed to deny users access to install or run -modified versions of the software inside them, although the manufacturer -can do so. This is fundamentally incompatible with the aim of -protecting users' freedom to change the software. The systematic -pattern of such abuse occurs in the area of products for individuals to -use, which is precisely where it is most unacceptable. Therefore, we -have designed this version of the GPL to prohibit the practice for those -products. If such problems arise substantially in other domains, we -stand ready to extend this provision to those domains in future versions -of the GPL, as needed to protect the freedom of users. - - Finally, every program is threatened constantly by software patents. -States should not allow patents to restrict development and use of -software on general-purpose computers, but in those that do, we wish to -avoid the special danger that patents applied to a free program could -make it effectively proprietary. To prevent this, the GPL assures that -patents cannot be used to render the program non-free. - - The precise terms and conditions for copying, distribution and -modification follow. - - TERMS AND CONDITIONS - - 0. Definitions. - - "This License" refers to version 3 of the GNU General Public License. - - "Copyright" also means copyright-like laws that apply to other kinds of -works, such as semiconductor masks. - - "The Program" refers to any copyrightable work licensed under this -License. Each licensee is addressed as "you". "Licensees" and -"recipients" may be individuals or organizations. - - To "modify" a work means to copy from or adapt all or part of the work -in a fashion requiring copyright permission, other than the making of an -exact copy. The resulting work is called a "modified version" of the -earlier work or a work "based on" the earlier work. - - A "covered work" means either the unmodified Program or a work based -on the Program. - - To "propagate" a work means to do anything with it that, without -permission, would make you directly or secondarily liable for -infringement under applicable copyright law, except executing it on a -computer or modifying a private copy. Propagation includes copying, -distribution (with or without modification), making available to the -public, and in some countries other activities as well. - - To "convey" a work means any kind of propagation that enables other -parties to make or receive copies. Mere interaction with a user through -a computer network, with no transfer of a copy, is not conveying. - - An interactive user interface displays "Appropriate Legal Notices" -to the extent that it includes a convenient and prominently visible -feature that (1) displays an appropriate copyright notice, and (2) -tells the user that there is no warranty for the work (except to the -extent that warranties are provided), that licensees may convey the -work under this License, and how to view a copy of this License. If -the interface presents a list of user commands or options, such as a -menu, a prominent item in the list meets this criterion. - - 1. Source Code. - - The "source code" for a work means the preferred form of the work -for making modifications to it. "Object code" means any non-source -form of a work. - - A "Standard Interface" means an interface that either is an official -standard defined by a recognized standards body, or, in the case of -interfaces specified for a particular programming language, one that -is widely used among developers working in that language. - - The "System Libraries" of an executable work include anything, other -than the work as a whole, that (a) is included in the normal form of -packaging a Major Component, but which is not part of that Major -Component, and (b) serves only to enable use of the work with that -Major Component, or to implement a Standard Interface for which an -implementation is available to the public in source code form. A -"Major Component", in this context, means a major essential component -(kernel, window system, and so on) of the specific operating system -(if any) on which the executable work runs, or a compiler used to -produce the work, or an object code interpreter used to run it. - - The "Corresponding Source" for a work in object code form means all -the source code needed to generate, install, and (for an executable -work) run the object code and to modify the work, including scripts to -control those activities. However, it does not include the work's -System Libraries, or general-purpose tools or generally available free -programs which are used unmodified in performing those activities but -which are not part of the work. For example, Corresponding Source -includes interface definition files associated with source files for -the work, and the source code for shared libraries and dynamically -linked subprograms that the work is specifically designed to require, -such as by intimate data communication or control flow between those -subprograms and other parts of the work. - - The Corresponding Source need not include anything that users -can regenerate automatically from other parts of the Corresponding -Source. - - The Corresponding Source for a work in source code form is that -same work. - - 2. Basic Permissions. - - All rights granted under this License are granted for the term of -copyright on the Program, and are irrevocable provided the stated -conditions are met. This License explicitly affirms your unlimited -permission to run the unmodified Program. The output from running a -covered work is covered by this License only if the output, given its -content, constitutes a covered work. This License acknowledges your -rights of fair use or other equivalent, as provided by copyright law. - - You may make, run and propagate covered works that you do not -convey, without conditions so long as your license otherwise remains -in force. You may convey covered works to others for the sole purpose -of having them make modifications exclusively for you, or provide you -with facilities for running those works, provided that you comply with -the terms of this License in conveying all material for which you do -not control copyright. Those thus making or running the covered works -for you must do so exclusively on your behalf, under your direction -and control, on terms that prohibit them from making any copies of -your copyrighted material outside their relationship with you. - - Conveying under any other circumstances is permitted solely under -the conditions stated below. Sublicensing is not allowed; section 10 -makes it unnecessary. - - 3. Protecting Users' Legal Rights From Anti-Circumvention Law. - - No covered work shall be deemed part of an effective technological -measure under any applicable law fulfilling obligations under article -11 of the WIPO copyright treaty adopted on 20 December 1996, or -similar laws prohibiting or restricting circumvention of such -measures. - - When you convey a covered work, you waive any legal power to forbid -circumvention of technological measures to the extent such circumvention -is effected by exercising rights under this License with respect to -the covered work, and you disclaim any intention to limit operation or -modification of the work as a means of enforcing, against the work's -users, your or third parties' legal rights to forbid circumvention of -technological measures. - - 4. Conveying Verbatim Copies. - - You may convey verbatim copies of the Program's source code as you -receive it, in any medium, provided that you conspicuously and -appropriately publish on each copy an appropriate copyright notice; -keep intact all notices stating that this License and any -non-permissive terms added in accord with section 7 apply to the code; -keep intact all notices of the absence of any warranty; and give all -recipients a copy of this License along with the Program. - - You may charge any price or no price for each copy that you convey, -and you may offer support or warranty protection for a fee. - - 5. Conveying Modified Source Versions. - - You may convey a work based on the Program, or the modifications to -produce it from the Program, in the form of source code under the -terms of section 4, provided that you also meet all of these conditions: - - a) The work must carry prominent notices stating that you modified - it, and giving a relevant date. - - b) The work must carry prominent notices stating that it is - released under this License and any conditions added under section - 7. This requirement modifies the requirement in section 4 to - "keep intact all notices". - - c) You must license the entire work, as a whole, under this - License to anyone who comes into possession of a copy. This - License will therefore apply, along with any applicable section 7 - additional terms, to the whole of the work, and all its parts, - regardless of how they are packaged. This License gives no - permission to license the work in any other way, but it does not - invalidate such permission if you have separately received it. - - d) If the work has interactive user interfaces, each must display - Appropriate Legal Notices; however, if the Program has interactive - interfaces that do not display Appropriate Legal Notices, your - work need not make them do so. - - A compilation of a covered work with other separate and independent -works, which are not by their nature extensions of the covered work, -and which are not combined with it such as to form a larger program, -in or on a volume of a storage or distribution medium, is called an -"aggregate" if the compilation and its resulting copyright are not -used to limit the access or legal rights of the compilation's users -beyond what the individual works permit. Inclusion of a covered work -in an aggregate does not cause this License to apply to the other -parts of the aggregate. - - 6. Conveying Non-Source Forms. - - You may convey a covered work in object code form under the terms -of sections 4 and 5, provided that you also convey the -machine-readable Corresponding Source under the terms of this License, -in one of these ways: - - a) Convey the object code in, or embodied in, a physical product - (including a physical distribution medium), accompanied by the - Corresponding Source fixed on a durable physical medium - customarily used for software interchange. - - b) Convey the object code in, or embodied in, a physical product - (including a physical distribution medium), accompanied by a - written offer, valid for at least three years and valid for as - long as you offer spare parts or customer support for that product - model, to give anyone who possesses the object code either (1) a - copy of the Corresponding Source for all the software in the - product that is covered by this License, on a durable physical - medium customarily used for software interchange, for a price no - more than your reasonable cost of physically performing this - conveying of source, or (2) access to copy the - Corresponding Source from a network server at no charge. - - c) Convey individual copies of the object code with a copy of the - written offer to provide the Corresponding Source. This - alternative is allowed only occasionally and noncommercially, and - only if you received the object code with such an offer, in accord - with subsection 6b. - - d) Convey the object code by offering access from a designated - place (gratis or for a charge), and offer equivalent access to the - Corresponding Source in the same way through the same place at no - further charge. You need not require recipients to copy the - Corresponding Source along with the object code. If the place to - copy the object code is a network server, the Corresponding Source - may be on a different server (operated by you or a third party) - that supports equivalent copying facilities, provided you maintain - clear directions next to the object code saying where to find the - Corresponding Source. Regardless of what server hosts the - Corresponding Source, you remain obligated to ensure that it is - available for as long as needed to satisfy these requirements. - - e) Convey the object code using peer-to-peer transmission, provided - you inform other peers where the object code and Corresponding - Source of the work are being offered to the general public at no - charge under subsection 6d. - - A separable portion of the object code, whose source code is excluded -from the Corresponding Source as a System Library, need not be -included in conveying the object code work. - - A "User Product" is either (1) a "consumer product", which means any -tangible personal property which is normally used for personal, family, -or household purposes, or (2) anything designed or sold for incorporation -into a dwelling. In determining whether a product is a consumer product, -doubtful cases shall be resolved in favor of coverage. For a particular -product received by a particular user, "normally used" refers to a -typical or common use of that class of product, regardless of the status -of the particular user or of the way in which the particular user -actually uses, or expects or is expected to use, the product. A product -is a consumer product regardless of whether the product has substantial -commercial, industrial or non-consumer uses, unless such uses represent -the only significant mode of use of the product. - - "Installation Information" for a User Product means any methods, -procedures, authorization keys, or other information required to install -and execute modified versions of a covered work in that User Product from -a modified version of its Corresponding Source. The information must -suffice to ensure that the continued functioning of the modified object -code is in no case prevented or interfered with solely because -modification has been made. - - If you convey an object code work under this section in, or with, or -specifically for use in, a User Product, and the conveying occurs as -part of a transaction in which the right of possession and use of the -User Product is transferred to the recipient in perpetuity or for a -fixed term (regardless of how the transaction is characterized), the -Corresponding Source conveyed under this section must be accompanied -by the Installation Information. But this requirement does not apply -if neither you nor any third party retains the ability to install -modified object code on the User Product (for example, the work has -been installed in ROM). - - The requirement to provide Installation Information does not include a -requirement to continue to provide support service, warranty, or updates -for a work that has been modified or installed by the recipient, or for -the User Product in which it has been modified or installed. Access to a -network may be denied when the modification itself materially and -adversely affects the operation of the network or violates the rules and -protocols for communication across the network. - - Corresponding Source conveyed, and Installation Information provided, -in accord with this section must be in a format that is publicly -documented (and with an implementation available to the public in -source code form), and must require no special password or key for -unpacking, reading or copying. - - 7. Additional Terms. - - "Additional permissions" are terms that supplement the terms of this -License by making exceptions from one or more of its conditions. -Additional permissions that are applicable to the entire Program shall -be treated as though they were included in this License, to the extent -that they are valid under applicable law. If additional permissions -apply only to part of the Program, that part may be used separately -under those permissions, but the entire Program remains governed by -this License without regard to the additional permissions. - - When you convey a copy of a covered work, you may at your option -remove any additional permissions from that copy, or from any part of -it. (Additional permissions may be written to require their own -removal in certain cases when you modify the work.) You may place -additional permissions on material, added by you to a covered work, -for which you have or can give appropriate copyright permission. - - Notwithstanding any other provision of this License, for material you -add to a covered work, you may (if authorized by the copyright holders of -that material) supplement the terms of this License with terms: - - a) Disclaiming warranty or limiting liability differently from the - terms of sections 15 and 16 of this License; or - - b) Requiring preservation of specified reasonable legal notices or - author attributions in that material or in the Appropriate Legal - Notices displayed by works containing it; or - - c) Prohibiting misrepresentation of the origin of that material, or - requiring that modified versions of such material be marked in - reasonable ways as different from the original version; or - - d) Limiting the use for publicity purposes of names of licensors or - authors of the material; or - - e) Declining to grant rights under trademark law for use of some - trade names, trademarks, or service marks; or - - f) Requiring indemnification of licensors and authors of that - material by anyone who conveys the material (or modified versions of - it) with contractual assumptions of liability to the recipient, for - any liability that these contractual assumptions directly impose on - those licensors and authors. - - All other non-permissive additional terms are considered "further -restrictions" within the meaning of section 10. If the Program as you -received it, or any part of it, contains a notice stating that it is -governed by this License along with a term that is a further -restriction, you may remove that term. If a license document contains -a further restriction but permits relicensing or conveying under this -License, you may add to a covered work material governed by the terms -of that license document, provided that the further restriction does -not survive such relicensing or conveying. - - If you add terms to a covered work in accord with this section, you -must place, in the relevant source files, a statement of the -additional terms that apply to those files, or a notice indicating -where to find the applicable terms. - - Additional terms, permissive or non-permissive, may be stated in the -form of a separately written license, or stated as exceptions; -the above requirements apply either way. - - 8. Termination. - - You may not propagate or modify a covered work except as expressly -provided under this License. Any attempt otherwise to propagate or -modify it is void, and will automatically terminate your rights under -this License (including any patent licenses granted under the third -paragraph of section 11). - - However, if you cease all violation of this License, then your -license from a particular copyright holder is reinstated (a) -provisionally, unless and until the copyright holder explicitly and -finally terminates your license, and (b) permanently, if the copyright -holder fails to notify you of the violation by some reasonable means -prior to 60 days after the cessation. - - Moreover, your license from a particular copyright holder is -reinstated permanently if the copyright holder notifies you of the -violation by some reasonable means, this is the first time you have -received notice of violation of this License (for any work) from that -copyright holder, and you cure the violation prior to 30 days after -your receipt of the notice. - - Termination of your rights under this section does not terminate the -licenses of parties who have received copies or rights from you under -this License. If your rights have been terminated and not permanently -reinstated, you do not qualify to receive new licenses for the same -material under section 10. - - 9. Acceptance Not Required for Having Copies. - - You are not required to accept this License in order to receive or -run a copy of the Program. Ancillary propagation of a covered work -occurring solely as a consequence of using peer-to-peer transmission -to receive a copy likewise does not require acceptance. However, -nothing other than this License grants you permission to propagate or -modify any covered work. These actions infringe copyright if you do -not accept this License. Therefore, by modifying or propagating a -covered work, you indicate your acceptance of this License to do so. - - 10. Automatic Licensing of Downstream Recipients. - - Each time you convey a covered work, the recipient automatically -receives a license from the original licensors, to run, modify and -propagate that work, subject to this License. You are not responsible -for enforcing compliance by third parties with this License. - - An "entity transaction" is a transaction transferring control of an -organization, or substantially all assets of one, or subdividing an -organization, or merging organizations. If propagation of a covered -work results from an entity transaction, each party to that -transaction who receives a copy of the work also receives whatever -licenses to the work the party's predecessor in interest had or could -give under the previous paragraph, plus a right to possession of the -Corresponding Source of the work from the predecessor in interest, if -the predecessor has it or can get it with reasonable efforts. - - You may not impose any further restrictions on the exercise of the -rights granted or affirmed under this License. For example, you may -not impose a license fee, royalty, or other charge for exercise of -rights granted under this License, and you may not initiate litigation -(including a cross-claim or counterclaim in a lawsuit) alleging that -any patent claim is infringed by making, using, selling, offering for -sale, or importing the Program or any portion of it. - - 11. Patents. - - A "contributor" is a copyright holder who authorizes use under this -License of the Program or a work on which the Program is based. The -work thus licensed is called the contributor's "contributor version". - - A contributor's "essential patent claims" are all patent claims -owned or controlled by the contributor, whether already acquired or -hereafter acquired, that would be infringed by some manner, permitted -by this License, of making, using, or selling its contributor version, -but do not include claims that would be infringed only as a -consequence of further modification of the contributor version. For -purposes of this definition, "control" includes the right to grant -patent sublicenses in a manner consistent with the requirements of -this License. - - Each contributor grants you a non-exclusive, worldwide, royalty-free -patent license under the contributor's essential patent claims, to -make, use, sell, offer for sale, import and otherwise run, modify and -propagate the contents of its contributor version. - - In the following three paragraphs, a "patent license" is any express -agreement or commitment, however denominated, not to enforce a patent -(such as an express permission to practice a patent or covenant not to -sue for patent infringement). To "grant" such a patent license to a -party means to make such an agreement or commitment not to enforce a -patent against the party. - - If you convey a covered work, knowingly relying on a patent license, -and the Corresponding Source of the work is not available for anyone -to copy, free of charge and under the terms of this License, through a -publicly available network server or other readily accessible means, -then you must either (1) cause the Corresponding Source to be so -available, or (2) arrange to deprive yourself of the benefit of the -patent license for this particular work, or (3) arrange, in a manner -consistent with the requirements of this License, to extend the patent -license to downstream recipients. "Knowingly relying" means you have -actual knowledge that, but for the patent license, your conveying the -covered work in a country, or your recipient's use of the covered work -in a country, would infringe one or more identifiable patents in that -country that you have reason to believe are valid. - - If, pursuant to or in connection with a single transaction or -arrangement, you convey, or propagate by procuring conveyance of, a -covered work, and grant a patent license to some of the parties -receiving the covered work authorizing them to use, propagate, modify -or convey a specific copy of the covered work, then the patent license -you grant is automatically extended to all recipients of the covered -work and works based on it. - - A patent license is "discriminatory" if it does not include within -the scope of its coverage, prohibits the exercise of, or is -conditioned on the non-exercise of one or more of the rights that are -specifically granted under this License. You may not convey a covered -work if you are a party to an arrangement with a third party that is -in the business of distributing software, under which you make payment -to the third party based on the extent of your activity of conveying -the work, and under which the third party grants, to any of the -parties who would receive the covered work from you, a discriminatory -patent license (a) in connection with copies of the covered work -conveyed by you (or copies made from those copies), or (b) primarily -for and in connection with specific products or compilations that -contain the covered work, unless you entered into that arrangement, -or that patent license was granted, prior to 28 March 2007. - - Nothing in this License shall be construed as excluding or limiting -any implied license or other defenses to infringement that may -otherwise be available to you under applicable patent law. - - 12. No Surrender of Others' Freedom. - - If conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot convey a -covered work so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you may -not convey it at all. For example, if you agree to terms that obligate you -to collect a royalty for further conveying from those to whom you convey -the Program, the only way you could satisfy both those terms and this -License would be to refrain entirely from conveying the Program. - - 13. Use with the GNU Affero General Public License. - - Notwithstanding any other provision of this License, you have -permission to link or combine any covered work with a work licensed -under version 3 of the GNU Affero General Public License into a single -combined work, and to convey the resulting work. The terms of this -License will continue to apply to the part which is the covered work, -but the special requirements of the GNU Affero General Public License, -section 13, concerning interaction through a network will apply to the -combination as such. - - 14. Revised Versions of this License. - - The Free Software Foundation may publish revised and/or new versions of -the GNU General Public License from time to time. Such new versions will -be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - - Each version is given a distinguishing version number. If the -Program specifies that a certain numbered version of the GNU General -Public License "or any later version" applies to it, you have the -option of following the terms and conditions either of that numbered -version or of any later version published by the Free Software -Foundation. If the Program does not specify a version number of the -GNU General Public License, you may choose any version ever published -by the Free Software Foundation. - - If the Program specifies that a proxy can decide which future -versions of the GNU General Public License can be used, that proxy's -public statement of acceptance of a version permanently authorizes you -to choose that version for the Program. - - Later license versions may give you additional or different -permissions. However, no additional obligations are imposed on any -author or copyright holder as a result of your choosing to follow a -later version. - - 15. Disclaimer of Warranty. - - THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY -APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT -HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY -OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM -IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF -ALL NECESSARY SERVICING, REPAIR OR CORRECTION. - - 16. Limitation of Liability. - - IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS -THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY -GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE -USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF -DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD -PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), -EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF -SUCH DAMAGES. - - 17. Interpretation of Sections 15 and 16. - - If the disclaimer of warranty and limitation of liability provided -above cannot be given local legal effect according to their terms, -reviewing courts shall apply local law that most closely approximates -an absolute waiver of all civil liability in connection with the -Program, unless a warranty or assumption of liability accompanies a -copy of the Program in return for a fee. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Programs - - If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. - - To do so, attach the following notices to the program. It is safest -to attach them to the start of each source file to most effectively -state the exclusion of warranty; and each file should have at least -the "copyright" line and a pointer to where the full notice is found. - - - Copyright (C) - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . - -Also add information on how to contact you by electronic and paper mail. - - If the program does terminal interaction, make it output a short -notice like this when it starts in an interactive mode: - - Copyright (C) - This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. - This is free software, and you are welcome to redistribute it - under certain conditions; type `show c' for details. - -The hypothetical commands `show w' and `show c' should show the appropriate -parts of the General Public License. Of course, your program's commands -might be different; for a GUI interface, you would use an "about box". - - You should also get your employer (if you work as a programmer) or school, -if any, to sign a "copyright disclaimer" for the program, if necessary. -For more information on this, and how to apply and follow the GNU GPL, see -. - - The GNU General Public License does not permit incorporating your program -into proprietary programs. If your program is a subroutine library, you -may consider it more useful to permit linking proprietary applications with -the library. If this is what you want to do, use the GNU Lesser General -Public License instead of this License. But first, please read -. diff --git a/packages/realgud/ChangeLog b/packages/realgud/ChangeLog deleted file mode 100644 index bc3f48c05..000000000 --- a/packages/realgud/ChangeLog +++ /dev/null @@ -1,1741 +0,0 @@ -2010-11-27 rocky - - * dbgr/debugger/trepan/init.el, dbgr/lang/ruby.el, - test/test-regexp-trepan.el: Add trepan frame regexp tests. - -2010-11-27 rocky - - * dbgr/debugger/rdebug/init.el, dbgr/debugger/trepan/init.el, - dbgr/debugger/trepanx/init.el, dbgr/lang/ruby.el: Go over rdebug for - backtrace buffer regexp and improve other regexps. - -2010-11-27 rocky - - * dbgr/common/buffer/helper.el, dbgr/debugger/trepan/init.el, - dbgr/debugger/trepanx/init.el, dbgr/lang/ruby.el: Work on trepanx - regexps for backtrace. (Might have broken trepan regexps) - -2010-11-26 rocky - - * dbgr.el, dbgr/common/buffer/backtrace.el, - dbgr/common/buffer/helper.el, dbgr/debugger/trepan/init.el: Parses - backtrace lines (more) correctly now. Add text property for frame - number and. goto-frame now works. - -2010-11-26 rocky - - * dbgr.el, dbgr/common/bp.el, dbgr/common/buffer/backtrace.el, - dbgr/common/file.el, dbgr/common/init/kshdb.el, dbgr/common/loc.el, - dbgr/common/regexp.el, dbgr/common/track.el, - dbgr/debugger/bashdb/init.el, dbgr/debugger/gdb/init.el, - dbgr/debugger/pydbgr/init.el, dbgr/debugger/rdebug/init.el, - dbgr/debugger/trepan/init.el, dbgr/debugger/trepanx/init.el, - dbgr/debugger/zshdb/init.el, test/test-track.el: Start to add text - properties to backtrace buffer. Much more is needed. Start adding - string examples of things matching trepan regexps. - -2010-11-26 rocky - - * configure.ac, dbgr.el, dbgr/common/init/bashdb.el, - dbgr/debugger/Makefile.am, dbgr/debugger/bashdb/.gitignore, - dbgr/debugger/bashdb/Makefile.am, dbgr/debugger/bashdb/bashdb.el, - dbgr/debugger/bashdb/cmds.el, dbgr/debugger/bashdb/core.el, - dbgr/debugger/bashdb/init.el, dbgr/debugger/bashdb/track-mode.el, - dbgr/debugger/zshdb/core.el, dbgr/debugger/zshdb/init.el, - test/test-dbgr.el: Add emacs debugger as a full-fledged front-end. - -2010-11-22 rocky - - * test/test-regexp-trepanx.el: Work on trepanx regexp test - -2010-11-22 rocky - - * dbgr/debugger/pydbgr/pydbgr.el, dbgr/debugger/zshdb/zshdb.el: - Small Doc string fixes from cut-and-paste. - -2010-11-22 rocky - - * dbgr/common/track.el, dbgr/debugger/pydbgr/track-mode.el, - dbgr/debugger/trepan/track-mode.el, - dbgr/debugger/zshdb/track-mode.el: track.el: call up - debugger-specific track mode track-mode.el: experiment with more - robust mode hook. - -2010-11-22 rocky - - * dbgr/common/track-mode.el, dbgr/debugger/trepanx/init.el, - dbgr/lang/ruby.el: Parent map of track-mode come from shell, not - comint. Correct rubinius backtrace regexp. - -2010-11-21 rocky - - * dbgr/common/buffer/command.el, dbgr/debugger/pydbgr/track-mode.el: - Fix some small bugs - -2010-11-21 rocky - - * dbgr/common/track-mode.el, dbgr/debugger/gdb/track-mode.el, - dbgr/debugger/pydbgr/track-mode.el, - dbgr/debugger/rdebug/track-mode.el, - dbgr/debugger/trepan/track-mode.el, - dbgr/debugger/trepanx/track-mode.el, - dbgr/debugger/zshdb/track-mode.el: keybindings now work properly for - specific debugger track modes. Could be better, but this is a start - and a big improvement. - -2010-11-21 rocky - - * dbgr/common/fringe.el, dbgr/common/track-mode.el, - dbgr/debugger/gdb/track-mode.el, - dbgr/debugger/pydbgr/track-mode.el, - dbgr/debugger/rdebug/track-mode.el, - dbgr/debugger/trepan/track-mode.el, - dbgr/debugger/trepanx/track-mode.el, test/test-track-mode.el: Keymap - definition (which was probably improper) is messing up - define-minor-mode so leave that out for now. rename keymap variable - to a value which I hope is picked up automagically. - -2010-11-21 rocky - - * dbgr/common/buffer/helper.el: This time, for sure? - -2010-11-21 rocky - - * dbgr/common/buffer/helper.el, dbgr/common/track.el: Fix an - annoying bug where we weren't tracking changes in the source buffer. - - -2010-11-04 rocky - - * dbgr/debugger/rdebug/track-mode.el, - dbgr/debugger/trepan/track-mode.el, - dbgr/debugger/trepanx/track-mode.el: This time, for sure! - -2010-11-04 rocky - - * dbgr/debugger/rdebug/track-mode.el: Now redundant (and wrong) - line. - -2010-11-04 rocky - - * dbgr/debugger/rdebug/track-mode.el, - dbgr/debugger/trepanx/track-mode.el: One more place to fold in - ruby-specific traceback key bindings. - -2010-11-04 rocky - - * dbgr/common/track.el, dbgr/debugger/rdebug/core.el, - dbgr/debugger/trepan/core.el, dbgr/debugger/trepan/track-mode.el, - dbgr/debugger/trepanx/core.el, dbgr/debugger/trepanx/track-mode.el, - dbgr/lang/ruby.el: Dry some code bound to ruby keys. Should do the - same for others... - -2010-11-03 rocky - - * dbgr/common/buffer/command.el, dbgr/common/init/Makefile.am, - dbgr/common/send.el, dbgr/common/track.el, - dbgr/debugger/.gitignore, dbgr/debugger/Makefile.am, - dbgr/debugger/pydbgr/pydbgr.el, dbgr/debugger/rdebug/rdebug.el, - dbgr/debugger/trepan/trepan.el, dbgr/debugger/trepanx/trepanx.el, - dbgr/debugger/zshdb/zshdb.el, test/Makefile.am, test/test-track.el: - Remove output for internal-status commands like dbgr-backtrace-init. - Front-end command names now universally start dbgr-, e.g. - dbgr-trepan with most having aliases to shorter name, e.g. trepan. - The exception is "gdb" which doesn't have an alias, since "gdb" is a - well-established and Emacs command. Go over Makefile's yet again. - -2010-11-03 rocky - - * dbgr/common/init/gdb.el, dbgr/debugger/gdb/init.el, - dbgr/debugger/gdb/track-mode.el, test/test-regexp-gdb.el: - common/init/gdb.el -> debugger/gdb/init.el gdb-pat-hash -> - dbgr-gdb-pat-hash - -2010-11-02 rocky - - * configure.ac, dbgr.el, dbgr/Makefile.am, dbgr/common.mk, - dbgr/common/Makefile.am, dbgr/common/buffer/Makefile.am, - dbgr/debugger/.gitignore, dbgr/debugger/Makefile.am, - dbgr/debugger/common.mk, dbgr/debugger/gdb/.gitignore, - dbgr/debugger/gdb/Makefile.am, dbgr/debugger/gdb/core.el, - dbgr/debugger/gdb/gdb.el, dbgr/debugger/gdb/track-mode.el, - dbgr/debugger/pydbgr/.gitignore, dbgr/debugger/pydbgr/Makefile.am, - dbgr/debugger/pydbgr/cmds.el, dbgr/debugger/pydbgr/core.el, - dbgr/debugger/pydbgr/init.el, dbgr/debugger/pydbgr/pydbgr.el, - dbgr/debugger/pydbgr/track-mode.el, - dbgr/debugger/rdebug/.gitignore, dbgr/debugger/rdebug/Makefile.am, - dbgr/debugger/rdebug/cmds.el, dbgr/debugger/rdebug/core.el, - dbgr/debugger/rdebug/init.el, dbgr/debugger/rdebug/rdebug.el, - dbgr/debugger/rdebug/track-mode.el, - dbgr/debugger/trepan/.gitignore, dbgr/debugger/trepan/Makefile.am, - dbgr/debugger/trepan/cmds.el, dbgr/debugger/trepan/core.el, - dbgr/debugger/trepan/init.el, dbgr/debugger/trepan/track-mode.el, - dbgr/debugger/trepan/trepan.el, dbgr/debugger/trepanx/.gitignore, - dbgr/debugger/trepanx/Makefile.am, dbgr/debugger/trepanx/cmds.el, - dbgr/debugger/trepanx/core.el, dbgr/debugger/trepanx/init.el, - dbgr/debugger/trepanx/track-mode.el, - dbgr/debugger/trepanx/trepanx.el, dbgr/debugger/zshdb/.gitignore, - dbgr/debugger/zshdb/Makefile.am, dbgr/debugger/zshdb/cmds.el, - dbgr/debugger/zshdb/core.el, dbgr/debugger/zshdb/init.el, - dbgr/debugger/zshdb/track-mode.el, dbgr/debugger/zshdb/zshdb.el, - dbgr/gdb/.gitignore, dbgr/gdb/Makefile.am, dbgr/gdb/core.el, - dbgr/gdb/gdb.el, dbgr/gdb/track-mode.el, dbgr/lang/Makefile.am, - dbgr/pydbgr/.gitignore, dbgr/pydbgr/Makefile.am, - dbgr/pydbgr/cmds.el, dbgr/pydbgr/core.el, dbgr/pydbgr/init.el, - dbgr/pydbgr/pydbgr.el, dbgr/pydbgr/track-mode.el, - dbgr/rdebug/.gitignore, dbgr/rdebug/Makefile.am, - dbgr/rdebug/cmds.el, dbgr/rdebug/core.el, dbgr/rdebug/init.el, - dbgr/rdebug/rdebug.el, dbgr/rdebug/track-mode.el, - dbgr/trepan/.gitignore, dbgr/trepan/Makefile.am, - dbgr/trepan/cmds.el, dbgr/trepan/core.el, dbgr/trepan/init.el, - dbgr/trepan/track-mode.el, dbgr/trepan/trepan.el, - dbgr/trepanx/.gitignore, dbgr/trepanx/Makefile.am, - dbgr/trepanx/cmds.el, dbgr/trepanx/core.el, dbgr/trepanx/init.el, - dbgr/trepanx/track-mode.el, dbgr/trepanx/trepanx.el, - dbgr/zshdb/.gitignore, dbgr/zshdb/Makefile.am, dbgr/zshdb/cmds.el, - dbgr/zshdb/core.el, dbgr/zshdb/init.el, dbgr/zshdb/track-mode.el, - dbgr/zshdb/zshdb.el, test/test-bt-pydbgr.el, - test/test-bt-rdebug.el, test/test-bt-trepan.el, - test/test-bt-trepanx.el, test/test-bt-zshdb.el, - test/test-buf-cmd.el, test/test-core.el, test/test-pydbgr.el, - test/test-rdebug.el, test/test-regexp-pydbgr.el, - test/test-regexp-rdebug.el, test/test-regexp-trepan.el, - test/test-regexp-trepanx.el, test/test-regexp.el, - test/test-send.el, test/test-srcbuf.el, test/test-track-mode.el, - test/test-track.el: move debugger-specific code down to a debugger - directory. - -2010-11-02 rocky - - * dbgr/Makefile.am, dbgr/common.mk, dbgr/gdb/Makefile.am, - dbgr/lang/Makefile.am, dbgr/pydbgr/Makefile.am, - dbgr/rdebug/Makefile.am, dbgr/trepan/Makefile.am, - dbgr/trepanx/Makefile.am, dbgr/zshdb/Makefile.am: DRY Makefile.am - code. - -2010-11-02 rocky - - * configure.ac, dbgr.el, dbgr/Makefile.am, dbgr/common/Makefile.am, - dbgr/common/buffer/Makefile.am, dbgr/common/core.el, - dbgr/common/init/rbdbgr.el, dbgr/gdb/Makefile.am, - dbgr/lang/Makefile.am, dbgr/lang/ruby.el, dbgr/rbdbgr/.gitignore, - dbgr/rbdbgr/Makefile.am, dbgr/rbdbgr/cmds.el, dbgr/rbdbgr/core.el, - dbgr/rbdbgr/rbdbgr.el, dbgr/rbdbgr/track-mode.el, - dbgr/rdebug/init.el, dbgr/trepan/init.el, test/Makefile.am, - test/test-buf-cmd.el, test/test-dbgr.el, test/test-regexp-gdb.el, - test/test-regexp-rbdbgr.el, test/test-regexp.el, test/test-send.el, - test/test-srcbuf.el: Remove rbdbgr. Nevering-ending struggle to DRY - code more. - -2010-11-02 rocky - - * configure.ac, dbgr/Makefile.am, dbgr/common/init/bashdb.el, - dbgr/common/init/gdb.el, dbgr/common/init/kshdb.el, - dbgr/common/init/pydb.el, dbgr/common/init/rbdbgr.el, - dbgr/common/init/remake.el, dbgr/gdb/track-mode.el, - dbgr/lang/.gitignore, dbgr/lang/Makefile.am, dbgr/lang/ruby.el, - dbgr/pydbgr/core.el, dbgr/pydbgr/init.el, - dbgr/pydbgr/track-mode.el, dbgr/rbdbgr/core.el, - dbgr/rdebug/core.el, dbgr/rdebug/init.el, - dbgr/rdebug/track-mode.el, dbgr/trepan/core.el, - dbgr/trepan/init.el, dbgr/trepan/track-mode.el, - dbgr/trepanx/core.el, dbgr/trepanx/init.el, - dbgr/trepanx/track-mode.el, dbgr/zshdb/core.el, dbgr/zshdb/init.el, - dbgr/zshdb/track-mode.el, test/test-regexp-rdebug.el: - traceback->backtrace Start to DRY common language regular - expressions. - -2010-11-02 rocky - - * dbgr/common/init/trepanx.el, dbgr/trepanx/cmds.el, - dbgr/trepanx/core.el, dbgr/trepanx/init.el, - dbgr/trepanx/track-mode.el, dbgr/trepanx/trepanx.el, - test/Makefile.am, test/test-bt-trepanx.el, - test/test-regexp-trepanx.el: common/init/trepanx.el -> - trepanx/init.el Add font-lock-default test. - -2010-11-01 rocky - - * dbgr/zshdb/init.el, test/Makefile.am, test/test-bt-zshdb.el: Start - font lock for zshdb. - -2010-11-01 rocky - - * dbgr/pydbgr/init.el, dbgr/rdebug/init.el, dbgr/trepan/init.el, - test/Makefile.am, test/test-bt-pydbgr.el: Work on pydbgr - font-lock-defaults. Comments regexps better. - -2010-11-01 rocky - - * dbgr/common/init.el, dbgr/pydbgr/init.el, dbgr/rdebug/init.el, - dbgr/trepan/init.el, test/test-bt-rdebug.el, test/test-bt-trepan.el: - Better backtrace font-lock defaults. Start working on pydbgr - backtrace font-lock. - -2010-11-01 rocky - - * dbgr/trepan/init.el, test/Makefile.am, test/test-bt-trepan.el: - trepan backtrace font-lock-default is more correct. - -2010-11-01 rocky - - * dbgr/trepan/init.el, test/Makefile.am, test/test-bt-rdebug.el, - test/test-bt-trepan.el, test/test-buf-bt.el: More regourous rdebug - backtrace font-lock-default tests. Start work on trepan backtrace - font-lock-default. - -2010-11-01 rocky - - * dbgr/common/buffer/backtrace.el, test/test-buf-bt.el: Add 1st - fontify test. - -2010-10-31 rocky - - * dbgr/common/buffer/backtrace.el, dbgr/common/buffer/command.el, - dbgr/common/init.el, dbgr/rdebug/init.el, dbgr/trepan/init.el: Add - font-lock faces to backtrace buffer. Attempt to do for command, but - more work is needed. - -2010-10-31 rocky - - * dbgr/common/buffer/backtrace.el, dbgr/common/init/trepan.el, - dbgr/trepan/cmds.el, dbgr/trepan/core.el, dbgr/trepan/init.el, - dbgr/trepan/track-mode.el, dbgr/trepan/trepan.el, - test/test-regexp-trepan.el, test/test-track.el: - common/init/trepan.el -> trepan/init.el backtrace.el: remove compile - warnings by commenting out future code - -2010-10-31 rocky - - * dbgr/common/buffer/backtrace.el, test/Makefile.am, - test/test-buf-bt.el, test/test-buf-cmd.el, test/test-cmdbuf.el: Work - on backtrace buffer and mode. More to come... - -2010-10-31 rocky - - * dbgr/common/init/rdebug.el, dbgr/rdebug/cmds.el, - dbgr/rdebug/core.el, dbgr/rdebug/init.el, dbgr/rdebug/rdebug.el, - dbgr/rdebug/track-mode.el, test/test-regexp-rdebug.el: - common/init/rdebug.el -> rdebug/init.el - -2010-10-31 rocky - - * dbgr/common/buffer/backtrace.el, dbgr/common/init/pydbgr.el, - dbgr/pydbgr/cmds.el, dbgr/pydbgr/core.el, dbgr/pydbgr/init.el, - dbgr/pydbgr/pydbgr.el, dbgr/pydbgr/track-mode.el, - dbgr/zshdb/core.el, dbgr/zshdb/init.el, dbgr/zshdb/track-mode.el, - test/test-regexp-pydbgr.el: Move init/pydbgr.el to pydbgr/init.el. - zshdb/*.el: Correct some mistakes in moving from before. - buffer/backtrace.el: Make this loadable without error. - -2010-10-31 rocky - - * dbgr/common/init/zshdb.el, dbgr/zshdb/cmds.el, - dbgr/zshdb/core.el, dbgr/zshdb/init.el, dbgr/zshdb/track-mode.el, - dbgr/zshdb/zshdb.el: Start to move init/*.el into respective - debugger-specific directories. - -2010-10-31 rocky - - * configure.ac, dbgr/common/Makefile.am, dbgr/common/bt-buf.el, - dbgr/common/buffer.el, dbgr/common/buffer/.gitignore, - dbgr/common/buffer/Makefile.am, dbgr/common/buffer/backtrace.el, - dbgr/common/buffer/command.el, dbgr/common/buffer/helper.el, - dbgr/common/buffer/source.el, dbgr/common/cmdbuf.el, - dbgr/common/cmds.el, dbgr/common/core.el, dbgr/common/reset.el, - dbgr/common/send.el, dbgr/common/shortkey.el, - dbgr/common/srcbuf.el, dbgr/common/track-mode.el, - dbgr/common/track.el, dbgr/common/window.el, test/test-cmdbuf.el, - test/test-regexp.el, test/test-srcbuf.el: Move buffer-related files - into a separate directory. Will help future growth. - -2010-10-31 rocky - - * dbgr.el, dbgr/zshdb/Makefile.am, dbgr/zshdb/core.el: Administrivia - around adding zshdb properly. - -2010-10-31 rocky - - * configure.ac, dbgr/Makefile.am, dbgr/zshdb/.gitignore, - dbgr/zshdb/Makefile.am, dbgr/zshdb/cmds.el, dbgr/zshdb/core.el, - dbgr/zshdb/track-mode.el, dbgr/zshdb/zshdb.el: Start zshdb debugger - support. - -2010-10-31 rocky - - * dbgr.el, dbgr/common/bp.el, dbgr/common/bt-buf.el, - dbgr/common/buffer.el, dbgr/common/cmdbuf.el, dbgr/common/cmds.el, - dbgr/common/core.el, dbgr/common/custom.el, dbgr/common/file.el, - dbgr/common/fringe.el, dbgr/common/helper.el, dbgr/common/init.el, - dbgr/common/init/bashdb.el, dbgr/common/init/gdb.el, - dbgr/common/init/kshdb.el, dbgr/common/init/pydb.el, - dbgr/common/init/pydbgr.el, dbgr/common/init/rbdbgr.el, - dbgr/common/init/rdebug.el, dbgr/common/init/remake.el, - dbgr/common/init/trepan.el, dbgr/common/init/trepanx.el, - dbgr/common/init/zshdb.el, dbgr/common/key.el, dbgr/common/lang.el, - dbgr/common/loc.el, dbgr/common/lochist.el, dbgr/common/menu.el, - dbgr/common/regexp.el, dbgr/common/reset.el, dbgr/common/send.el, - dbgr/common/shortkey.el, dbgr/common/srcbuf.el, - dbgr/common/track-mode.el, dbgr/common/window.el, dbgr/gdb/core.el, - dbgr/gdb/gdb.el, dbgr/gdb/track-mode.el, dbgr/pydbgr/cmds.el, - dbgr/pydbgr/core.el, dbgr/pydbgr/pydbgr.el, - dbgr/pydbgr/track-mode.el, dbgr/rdebug/cmds.el, - dbgr/rdebug/core.el, dbgr/rdebug/rdebug.el, - dbgr/rdebug/track-mode.el, dbgr/trepan/cmds.el, - dbgr/trepan/core.el, dbgr/trepan/track-mode.el, - dbgr/trepan/trepan.el, dbgr/trepanx/cmds.el, dbgr/trepanx/core.el, - dbgr/trepanx/track-mode.el, dbgr/trepanx/trepanx.el: Start to add - copyright. - -2010-10-31 rocky - - * dbgr/common/bt-buf.el, dbgr/common/track.el: Fix problem with - divert-output sequencing problem which caused old output to be used. - - -2010-10-30 rocky - - * dbgr/common/bt-buf.el, dbgr/common/cmdbuf.el, - dbgr/common/send.el, dbgr/common/tb-buf.el, - dbgr/common/track-mode.el, dbgr/common/track.el, - test/test-track-mode.el, test/test-track.el: More progress on - diverting output. - -2010-10-30 rocky - - * dbgr.el: Add dbgr-reload-features which is really what we probably - want rather than dbgr-unload-features. - -2010-10-30 rocky - - * dbgr/common/track-mode.el, test/test-track-mode.el: Fix - dbgr-track-mode-vars macro. - -2010-10-30 rocky - - * dbgr/common/send.el, dbgr/common/tb-buf.el, dbgr/common/track.el: - Work on sending commands for status whose output needs to be - diverted and sent to a special buffer, like "backtrace" - -2010-10-29 rocky - - * dbgr/common/track-mode.el, dbgr/common/track.el, - test/test-track.el: Start working on commands that divert output. We - will use this for auxiliary status buffers for breakponts or - backtrace, etc. - -2010-10-16 rocky - - * dbgr/pydbgr/core.el: Small bug in recognizing if pydbgr or cli.py - given - -2010-10-16 rocky - - * dbgr/common/core.el, dbgr/common/lang.el, dbgr/gdb/core.el, - dbgr/pydbgr/core.el, dbgr/rbdbgr/core.el, dbgr/rdebug/core.el, - dbgr/trepan/core.el, dbgr/trepanx/core.el, test/Makefile.am, - test/test-core.el, test/test-lang.el, test/test-pydbgr.el, - test/test-rdebug.el: DRY via dbgr-suggest-lang-file. Fix up tests - related to this region. - -2010-10-16 rocky - - * dbgr/common/lang.el, dbgr/pydbgr/core.el, dbgr/rbdbgr/core.el, - dbgr/rdebug/core.el, dbgr/trepan/core.el, dbgr/trepanx/core.el, - test/test-core.el, test/test-pydbgr.el, test/test-rdebug.el: Better - initial suggestion of language file to debug by searching visited - buffers. DRY some of the code a little. Much much much more is - DRYness is needed. Start putting in Programming-language-specific - code into common/lang.el - -2010-10-06 rocky - - * dbgr/trepan/core.el: Tolerate .exe on ruby interpreter for - Microsoft. - -2010-10-06 rocky - - * dbgr/common/cmds.el, dbgr/common/core.el, - dbgr/common/shortkey.el, dbgr/pydbgr/cmds.el, dbgr/rdebug/cmds.el, - dbgr/trepan/cmds.el, dbgr/trepanx/cmds.el: Work on terminating - gracefully. cmds.el: Add dbgr-terminate (reset debugger information) - to dbgr-cmd-quit. core.el: Create dbgr-terminate to encapsulate what - needs to be done on reset. shortkey.el: use 0 to turn off mode. - debugger/cmds.el: call define-gdb-like-commands explicitly - trepan/cmds.el: use quit! instead of quit. - -2010-10-05 rocky - - * dbgr/common/core.el: Suppress and emacs warning. - -2010-10-05 rocky - - * dbgr/pydbgr/core.el, dbgr/rdebug/.gitignore, - dbgr/rdebug/elc-stamp: core.el: Allow python.exe as an interpreter - name on Microsoft. Allow cli.py as alternative to pydbgr - rdebug/*: Adminstrivia - -2010-10-01 rocky - - * dbgr/common/cmdbuf.el, dbgr/common/track.el: short-key-on-tracing? - -> dbgr-short-key-on-tracing? - -2010-10-01 rocky - - * dbgr/common/cmdbuf.el, dbgr/common/core.el: Do better with respect - to cleaning up on process end: Remove fringe arrows, short-key-mode - and breakpoints in source buffers. - -2010-09-30 rocky - - * dbgr/common/shortkey.el, dbgr/common/srcbuf.el, - dbgr/common/track.el, dbgr/trepan/track-mode.el: Add customizable - variable "short-key-on-tracing?" which will set short-key mode for - any source buffer that is traced into. - -2010-09-30 rocky - - * dbgr/common/cmds.el, dbgr/common/key.el, - dbgr/common/track-mode.el, dbgr/gdb/core.el, dbgr/gdb/gdb.el, - dbgr/gdb/track-mode.el, dbgr/pydbgr/track-mode.el, - dbgr/rbdbgr/cmds.el, dbgr/rdebug/track-mode.el, - dbgr/trepan/track-mode.el, dbgr/trepanx/track-mode.el: Use expanded - file name in 'break' command. See also previous commit message since - it appears that many changes didn't get pushed from that. - -2010-09-29 rocky - - * dbgr/pydbgr/cmds.el: DRY track mode code. Add M-kp-up and - M-kp-down in standard keys. - -2010-09-29 rocky - - * README.textile: rbdbgr -> trepanning - -2010-09-29 rocky - - * dbgr/common/key.el, dbgr/gdb/track-mode.el, dbgr/pydbgr/core.el, - dbgr/pydbgr/track-mode.el, dbgr/rdebug/track-mode.el, - dbgr/trepan/track-mode.el, dbgr/trepanx/track-mode.el: Work on - getting debugger-specific minor-mode keymaps working. Some of the - prior workarounds were remove. Still really need to DRY code. Try - C-c SPC for break. - -2010-09-29 rocky - - * dbgr/common/srcbuf.el, dbgr/gdb/track-mode.el, - dbgr/pydbgr/track-mode.el, dbgr/rbdbgr/track-mode.el, - dbgr/rdebug/track-mode.el, dbgr/trepan/track-mode.el, - dbgr/trepanx/track-mode.el: Debugger common keys are now set in - source-code windows. Figured out how to use debugger keymaps in - command window, and setting debugger-specific command buffer keys. - However more work is needed here and we really need to DRY code. - -2010-09-29 rocky - - * dbgr/common/init/pydbgr.el, dbgr/common/key.el, - dbgr/pydbgr/core.el, dbgr/pydbgr/track-mode.el, - test/test-rdebug.el, test/test-regexp-pydbgr.el: key.el: Add "b" for - break in shortkey mode. test-rdebug.el: fix up faulty cut-n-paste: - python -> ruby; pydbgr => rdebug pydbgr.el, test-regexp-pydbgr.el - traceback -> backtrace - -2010-09-24 rocky - - * dbgr.el, dbgr/trepan/.gitignore, dbgr/trepanx/rbdbgr.el, - dbgr/trepanx/trepanx.el, test/test-regexp-trepan.el, - test/test-regexp-trepanx.el: Growing pains related to adding - trepan(x). - -2010-09-24 rocky - - * configure.ac, dbgr/Makefile.am, dbgr/common/init/trepan.el, - dbgr/common/init/trepanx.el, dbgr/trepan/.gitignore, - dbgr/trepan/Makefile.am, dbgr/trepan/cmds.el, dbgr/trepan/core.el, - dbgr/trepan/track-mode.el, dbgr/trepan/trepan.el, - dbgr/trepanx/.gitignore, dbgr/trepanx/Makefile.am, - dbgr/trepanx/cmds.el, dbgr/trepanx/core.el, dbgr/trepanx/rbdbgr.el, - dbgr/trepanx/track-mode.el, test/Makefile.am: Add trepan and trepanx - debuggers. - -2010-09-24 rocky - - * dbgr/gdb/core.el, dbgr/pydbgr/core.el, dbgr/pydbgr/pydbgr.el, - dbgr/rbdbgr/core.el, dbgr/rdebug/core.el: Wasn't picking up variable - set by xxx-command-name. See comment in - http://stackoverflow.com/questions/3764575/using-pydbgr-with-emacs - -2010-09-18 rocky - - * test/test-regexp-pydbgr.el: Add onto the end - just in - case. - -2010-09-18 rocky - - * test/test-regexp-pydbgr.el: Add test for MS prompt locations (with - drive letter and backslash) and non-MS prompt location without drive - and forward slash. - -2010-09-09 rocky - - * dbgr/Makefile.am, dbgr/common/Makefile.am, - dbgr/common/init/Makefile.am, dbgr/common/init/rbdbgr.el, - test/test-regexp-rbdbgr.el: init/rbdbgr.el: lfp and dfp are *hex* - addresses. Makefile.am: clean now removes compiled lisp files - teste-regexp-rbdbgr.el: previously renamed key from traceback to - backtrace -- Ooops - -2010-08-27 rocky - - * dbgr/rdebug/track-mode.el: Found one more C-c! -> C-c!! - -2010-08-22 rocky - - * dbgr/common/key.el: More keys for M-up. My PC keyboard has a - messed-up up-arrow. So allow Kp-up as well. - -2010-08-20 R. Bernstein - - * dbgr/common/init/rbdbgr.el, dbgr/rbdbgr/core.el, - dbgr/rbdbgr/track-mode.el: traceback -> backtrace which is what I - think it's called in Ruby (i.e. rb_backtrace) and use C-c!b which I - think is more mnemonic than C-c!e. - -2010-08-20 R. Bernstein - - * dbgr/rbdbgr/core.el: rbdbgr/core.el Match function name listed in - init/rbdbgr.el - -2010-08-20 R. Bernstein - - * dbgr/common/init/rbdbgr.el, dbgr/rbdbgr/core.el, - dbgr/rbdbgr/track-mode.el, test/test-regexp-rbdbgr.el: Add command - to position on control-frame traceback. - -2010-08-17 R. Bernstein - - * INSTALL, dbgr/common/key.el: Customize more for Emacs. - -2010-08-17 rocky - - * configure.ac: Check for required prerequisite packages. - -2010-08-17 rocky - - * configure.ac: Set default value for EMACS to, well, "emacs". - -2010-08-17 rocky - - * configure.ac: Test to make sure we have emacs 23 or greater. - -2010-08-13 R. Bernstein - - * .gitignore, INSTALL: More specific installation instructions. - -2010-08-12 rocky - - * README.textile: Typo - -2010-08-12 rocky - - * README.textile: Better textile linking. - -2010-08-12 rocky - - * README.textile: Add link to detailed installation instructions. - Thanks to Andrea Crotti for the suggestion. - -2010-08-09 R. Bernstein - - * dbgr/common/shortkey.el: M-[insert] toggles dbgr-short-key-mode as - well. And when you aren't in short-key mode, it works too -- - provided the buffer has an associated debugger. - -2010-08-05 rocky - - * dbgr/common/shortkey.el: shortkey.el: Add 'c' for 'continue. - -2010-08-05 rocky - - * dbgr/common/init/pydbgr.el, dbgr/common/init/rbdbgr.el, - dbgr/common/shortkey.el, test/test-regexp-pydbgr.el: shortkey.el: - Shortkey 'b' to set a breakpoint. (Don't have delete or toggle yet). - pydbgr.el Add regexp for breakpoint set and deleted. - -2010-08-04 rocky - - * dbgr/pydbgr/core.el: .rb -> .py - -2010-08-03 rocky - - * dbgr/pydbgr/core.el, test/Makefile.am, test/gcd.py, test/gcd.rb, - test/test-pydbgr.el, test/test-rdebug.el: As suggesting a Ruby file - in pydbgr. Add test for this now. - -2010-08-01 rocky - - * dbgr/rdebug/rdebug.el: M-x rdebug -> M-x dbgr-rdebug so as not to - conflict with the older rdebug code. - -2010-06-15 rocky - - * .gitignore, autogen.sh, test/test-track-mode.el: automess needs a - README. - -2010-06-11 rocky - - Merge branch 'master' of github.com:rocky/emacs-dbgr - -2010-06-11 rocky - - * README, README.textile: Update README to note dependencies and - what debugger's we've got. - -2010-06-07 R. Bernstein - - * dbgr/common/init/rdebug.el: Comment typo - -2010-05-23 rocky - - * dbgr/rdebug/rdebug.el, test/Makefile.am, test/test-rdebug.el: Add - routine from rdebug to parse out command line options and get script - name. - -2010-05-22 rocky - - * ChangeLog, dbgr/common/init/pydb.el: Add "provide-me" for pydb - -2010-05-06 rocky - - * dbgr/common/init/bashdb.el, dbgr/common/init/kshdb.el, - dbgr/common/init/pydbgr.el, dbgr/common/init/rbdbgr.el, - test/Makefile.am, test/test-dbgr.el, test/test-regexp-rbdbgr.el: - common/init/rbdbgr.el: prompt pattern has changed Makefile.am: - wasn't testing rbdbgr reset: Add more provide's in init files. - -2010-03-20 rocky - - * dbgr/pydbgr/Makefile.am: Forgot one python->pydbgr - -2010-03-19 R. Bernstein - - * dbgr.el, dbgr/gdb/gdb.el, dbgr/pydbgr/pydbgr.el, - dbgr/rbdbgr/rbdbgr.el, dbgr/rdebug/rdebug.el: Add "dbgr-" prefix to - keep namespace separate from other standalones, e.g. dbg-gdb vs gdb. - - -2010-03-19 rocky - - * configure.ac: One more python->pydbgr - -2010-03-19 R. Bernstein - - * dbgr.el, dbgr/Makefile.am, dbgr/gdb/core.el, - dbgr/gdb/gdb-core.el, dbgr/gdb/gdb-track-mode.el, dbgr/gdb/gdb.el, - dbgr/gdb/track-mode.el, dbgr/pydbgr/.gitignore, - dbgr/pydbgr/Makefile.am, dbgr/pydbgr/core.el, - dbgr/pydbgr/pydbgr.el, dbgr/pydbgr/track-mode.el, - dbgr/python/.gitignore, dbgr/python/Makefile.am, - dbgr/python/pydbgr-core.el, dbgr/python/pydbgr-track-mode.el, - dbgr/python/pydbgr.el, test/Makefile.am, - test/test-regexp-pydbgr.el, test/test-regexp-python.el: directory - python -> pydbgr. Debugger-specific file anme simplifications. - -2010-03-19 R. Bernstein - - * configure.ac, dbgr.el, dbgr/Makefile.am, dbgr/bp.el, - dbgr/buffer.el, dbgr/cmdbuf.el, dbgr/cmds.el, - dbgr/common/.gitignore, dbgr/common/Makefile.am, dbgr/common/bp.el, - dbgr/common/buffer.el, dbgr/common/cmdbuf.el, dbgr/common/cmds.el, - dbgr/common/core.el, dbgr/common/custom.el, dbgr/common/file.el, - dbgr/common/fringe.el, dbgr/common/helper.el, dbgr/common/init.el, - dbgr/common/init/.gitignore, dbgr/common/init/Makefile.am, - dbgr/common/init/bashdb.el, dbgr/common/init/gdb.el, - dbgr/common/init/kshdb.el, dbgr/common/init/pydb.el, - dbgr/common/init/pydbgr.el, dbgr/common/init/rbdbgr.el, - dbgr/common/init/rdebug.el, dbgr/common/init/remake.el, - dbgr/common/init/zshdb.el, dbgr/common/key.el, dbgr/common/loc.el, - dbgr/common/lochist.el, dbgr/common/menu.el, dbgr/common/regexp.el, - dbgr/common/reset.el, dbgr/common/send.el, dbgr/common/shortkey.el, - dbgr/common/srcbuf.el, dbgr/common/track-mode.el, - dbgr/common/track.el, dbgr/common/window.el, dbgr/core.el, - dbgr/custom.el, dbgr/file.el, dbgr/fringe.el, dbgr/gdb/gdb-core.el, - dbgr/gdb/gdb-track-mode.el, dbgr/gdb/gdb.el, dbgr/helper.el, - dbgr/init.el, dbgr/init/.gitignore, dbgr/init/Makefile.am, - dbgr/init/bashdb.el, dbgr/init/gdb.el, dbgr/init/kshdb.el, - dbgr/init/pydb.el, dbgr/init/pydbgr.el, dbgr/init/rbdbgr.el, - dbgr/init/rdebug.el, dbgr/init/remake.el, dbgr/init/zshdb.el, - dbgr/key.el, dbgr/loc.el, dbgr/lochist.el, dbgr/menu.el, - dbgr/python/pydbgr-core.el, dbgr/python/pydbgr-track-mode.el, - dbgr/python/pydbgr.el, dbgr/rbdbgr/cmds.el, dbgr/rbdbgr/core.el, - dbgr/rbdbgr/rbdbgr.el, dbgr/rbdbgr/track-mode.el, - dbgr/rdebug/cmds.el, dbgr/rdebug/core.el, dbgr/rdebug/rdebug.el, - dbgr/rdebug/track-mode.el, dbgr/regexp.el, dbgr/reset.el, - dbgr/send.el, dbgr/shortkey.el, dbgr/srcbuf.el, dbgr/track-mode.el, - dbgr/track.el, dbgr/window.el, test/test-bp.el, - test/test-cmdbuf.el, test/test-core.el, test/test-file.el, - test/test-helper.el, test/test-loc.el, test/test-lochist.el, - test/test-regexp-gdb.el, test/test-regexp-python.el, - test/test-regexp-rbdbgr.el, test/test-regexp-rdebug.el, - test/test-regexp.el, test/test-send.el, test/test-shortkey.el, - test/test-srcbuf.el, test/test-track.el: All common code now pushed - to common directory one level don. First part an overall filesystem - reorganization. Later on we will remove init, and rename python to - pydbgr, and add pydb. - -2010-03-13 rocky - - * dbgr/key.el, dbgr/lochist.el, dbgr/rdebug/.gitignore, - dbgr/rdebug/Makefile: key.el: add key to set breakpoints lochist.el: - larger default history ring .gitignore, Makefile: is derived from - Makefile.am - -2010-03-12 R. Bernstein - - * dbgr/gdb/gdb-track-mode.el, dbgr/python/pydbgr-track-mode.el, - dbgr/rbdbgr/track-mode.el, dbgr/rdebug/track-mode.el, - test/Makefile.am, test/test-track-mode.el, test/test-track.el: Base - the specific debugger track-mode-maps on the generic track-mode map. - Start a track-mode unit test. - -2010-03-04 R. Bernstein - - * configure.ac, dbgr.el, dbgr/Makefile.am, dbgr/init/rdebug.el, - dbgr/rbdbgr/.gitignore, dbgr/rbdbgr/Makefile.am, - dbgr/rbdbgr/cmds.el, dbgr/rbdbgr/core.el, dbgr/rbdbgr/rbdbgr.el, - dbgr/rbdbgr/track-mode.el, dbgr/rdebug/.gitignore, - dbgr/rdebug/Makefile, dbgr/rdebug/Makefile.am, dbgr/rdebug/cmds.el, - dbgr/rdebug/core.el, dbgr/rdebug/elc-stamp, dbgr/rdebug/rdebug.el, - dbgr/rdebug/track-mode.el, dbgr/ruby/.gitignore, - dbgr/ruby/Makefile.am, dbgr/ruby/cmds.el, dbgr/ruby/core.el, - dbgr/ruby/rbdbgr.el, dbgr/ruby/track-mode.el, test/test-core.el: - Start rdebug. Will probably reorganize directories down the line. - -2010-01-31 rocky - - * dbgr/cmdbuf.el, dbgr/cmds.el, dbgr/key.el, dbgr/menu.el, - dbgr/ruby/core.el, dbgr/ruby/rbdbgr.el, dbgr/ruby/track-mode.el, - dbgr/track.el, test/test-core.el: Move forward on breakpoints. Add - breakpoint list to cmdbuf and menu items for breakpoint track.el - Reduce use of depreciated fields in cmdbuf ruby/*.el: simplify - names. - -2010-01-31 rocky - - * dbgr/ruby/cmds.el, dbgr/ruby/core.el, dbgr/ruby/rbdbgr-core.el, - dbgr/ruby/rbdbgr-track-mode.el, dbgr/ruby/track-mode.el: Move - forward towards handling breakpoints: Keep a list of breakpoints in - cmdbuf, add menu item to set a breakpoint ruby/*: simplify names - track.el: reduce use of depricated loc-regex, file-group, line-group - fields. - -2010-01-30 rocky - - * dbgr/cmdbuf.el, dbgr/init/rbdbgr.el, dbgr/track.el: Start to - remove dbgr-cmdbuf-info loc-regexp, file-group and line-group. Add - pat for in rbdbgr a deleted breakpoint. - -2010-01-27 rocky - - * dbgr.el: dbr.el: dbgr-loaded-features is a command. - -2010-01-27 R. Bernstein - - * dbgr.el, dbgr/bp.el, test/Makefile.am, test/test-bp.el, - test/test-dbgr.el: dbgr.el test-dbgr.el: Add ability to get list of - feature loaded with dbgr and unload them. This makes it possible to - reload dbgr without leaving the Emacs. bp.el: More work needed on - testing. - -2010-01-27 rocky - - * dbgr/core.el, dbgr/gdb/gdb.el, dbgr/python/pydbgr.el, - dbgr/reset.el, dbgr/ruby/rbdbgr.el: Add reset by default to - dbg-exec-shell. - -2010-01-26 rocky - - * dbgr/reset.el: Start a reset routine. - -2010-01-26 rocky - - * dbgr/cmdbuf.el, dbgr/track.el, test/test-cmdbuf.el, - test/test-track.el: cmdbuf.el: Save source buffers associated with a - given command buffer. track.el: ditto. dbgr-track-from-region(): - check that cmdbuf is a cmdbuf. - -2010-01-24 rocky - - * dbgr/core.el, dbgr/gdb/gdb.el: gdb.el: expand script filename. - core.el: docstring fix. - -2010-01-24 rocky - - * dbgr.el, dbgr/gdb/.gitignore, dbgr/init/gdb.el, dbgr/loc.el, - dbgr/regexp.el: Add fields for address, and character offset. - -2010-01-21 R. Bernstein - - * dbgr/gdb/gdb-track-mode.el, dbgr/track.el: Tolerate missing source - file. Need to do better though between file.el: - dbgr-file-loc-from-line and dbgr/track.el - -2010-01-20 rocky - - * configure.ac: Administrivia - -2010-01-20 rocky - - * dbgr/Makefile.am, dbgr/gdb/.gitignore, dbgr/gdb/Makefile.am, - dbgr/gdb/gdb-core.el, dbgr/gdb/gdb-track-mode.el, dbgr/gdb/gdb.el: - Fill out more gdb interaction via dbgr. - -2010-01-18 rocky - - * dbgr/loc.el, test/test-regexp-gdb.el: loc.el: add place holder for - column number test-regexp-gdb.el: start unit test for gdb. - -2010-01-18 R. Bernstein - - * dbgr/init/gdb.el: Start gdb mode. - -2010-01-09 rocky - - * dbgr/bp.el, dbgr/track.el, test/test-track.el: Breakpont fixes. - Show only one breakpoint icon in margin. Store breakpoint number as - a number, not a string. Show breakpoint in help string. Add a - dbgr-track-bp-loc test. - -2010-01-02 rocky - - * dbgr/init/bashdb.el, dbgr/init/kshdb.el, dbgr/init/zshdb.el: Add - breakpoint tracking regexp. - -2010-01-01 rocky - - * dbgr/init/rdebug.el: Add breakpoint regexp for rdebug. - -2010-01-01 rocky - - * test/test-regexp-rbdbgr.el, test/test-regexp-rdebug.el, - test/test-regexp-ruby.el: Add breakpoint tracking for rdebug. - -2010-01-01 rocky - - * test/Makefile: Makefile is derived - -2010-01-01 rocky - - * dbgr/track.el: Remove erroneous message. - -2010-01-01 rocky - - * dbgr/bp.el, dbgr/file.el, dbgr/init/rbdbgr.el, dbgr/loc.el, - dbgr/regexp.el, dbgr/track.el, test/test-bp.el, - test/test-regexp-ruby.el, test/test-track.el: Attempt to move - forward in tracking breakpoints setting. - -2009-12-28 rocky - - * dbgr/bp.el, dbgr/brkpt.el: Add breakpoint handling test. - -2009-12-28 rocky - - * dbgr/brkpt.el: More display/remove cleanup. - -2009-12-27 rocky - - * dbgr/brkpt.el: Small improvements (?) towards getting breakpoint - icons working. - -2009-12-27 rocky - - * Makefile.am, configure.ac, dbgr/Makefile.am, dbgr/brkpt.el, - dbgr/fringe.el, test/.gitignore, test/Makefile, test/Makefile.am: - Start working on breakpoint icons. "make test" works inside dbgr - directory. - -2009-12-22 rocky - - * dbgr/cmds.el, dbgr/send.el, dbgr/window.el, test/test-send.el: - Some debugger commands prompt. So we need to make sure we show the - command buffer for those. - -2009-12-21 rocky - - * dbgr/cmds.el, dbgr/custom.el, dbgr/key.el, dbgr/menu.el, - dbgr/shortkey.el: Get menus under control. Works now in "short-key" - mode. Help is provided too! - -2009-12-20 rocky - - * dbgr/buffer.el, dbgr/cmds.el, dbgr/menu.el, - dbgr/ruby/rbdbgr-track-mode.el, dbgr/shortkey.el, - dbgr/track-mode.el: Start to add menu commands. gdb command "finish" - added. - -2009-12-18 rocky - - * autogen.sh: Don't overwrite elisp-comp. - -2009-12-16 rocky - - * dbgr/loc.el: Use loc-changes-goto of new package loc-changes to - find line number positions. loc-changes-goto is more tolerant of - buffer modifications. - -2009-12-16 rocky - - * .gitignore, Makefile.am, buffer.el, cmdbuf.el, cmds.el, - configure.ac, core.el, custom.el, dbgr.el, dbgr/.gitignore, - dbgr/Makefile.am, dbgr/buffer.el, dbgr/cmdbuf.el, dbgr/cmds.el, - dbgr/core.el, dbgr/custom.el, dbgr/file.el, dbgr/fringe.el, - dbgr/helper.el, dbgr/init.el, dbgr/init/.gitignore, - dbgr/init/Makefile.am, dbgr/init/bashdb.el, dbgr/init/kshdb.el, - dbgr/init/pydb.el, dbgr/init/pydbgr.el, dbgr/init/rbdbgr.el, - dbgr/init/rdebug.el, dbgr/init/remake.el, dbgr/init/zshdb.el, - dbgr/key.el, dbgr/loc.el, dbgr/lochist.el, dbgr/python/.gitignore, - dbgr/python/Makefile.am, dbgr/python/pydbgr-core.el, - dbgr/python/pydbgr-track-mode.el, dbgr/python/pydbgr.el, - dbgr/regexp.el, dbgr/ruby/.gitignore, dbgr/ruby/Makefile.am, - dbgr/ruby/rbdbgr-core.el, dbgr/ruby/rbdbgr-track-mode.el, - dbgr/ruby/rbdbgr.el, dbgr/send.el, dbgr/shortkey.el, - dbgr/srcbuf.el, dbgr/track-mode.el, dbgr/track.el, dbgr/window.el, - file.el, fringe.el, helper.el, init.el, init/.gitignore, - init/Makefile.am, init/bashdb.el, init/kshdb.el, init/pydb.el, - init/pydbgr.el, init/rbdbgr.el, init/rdebug.el, init/remake.el, - init/zshdb.el, key.el, loc.el, lochist.el, python/.gitignore, - python/Makefile.am, python/pydbgr-core.el, - python/pydbgr-track-mode.el, python/pydbgr.el, regexp.el, - ruby/.gitignore, ruby/Makefile.am, ruby/rbdbgr-core.el, - ruby/rbdbgr-track-mode.el, ruby/rbdbgr.el, send.el, shortkey.el, - srcbuf.el, test/test-cmdbuf.el, test/test-core.el, - test/test-file.el, test/test-helper.el, test/test-loc.el, - test/test-lochist.el, test/test-regexp-python.el, - test/test-regexp-ruby.el, test/test-regexp.el, test/test-send.el, - test/test-shortkey.el, test/test-srcbuf.el, test/test-track.el, - track-mode.el, track.el, window.el: dbgr.el - loads everything (via - load-relative). Push dbgr source files into dbgr which is where they - are installed. Cleaner this way. - -2009-12-14 rocky - - * test/test-srcbuf.el, test/test-track.el: behave -> test-unit - -2009-12-13 rocky - - * test/behave.el, test/test-cmdbuf.el, test/test-core.el, - test/test-file.el, test/test-helper.el, test/test-loc.el, - test/test-lochist.el, test/test-regexp-python.el, - test/test-regexp-ruby.el, test/test-regexp.el, test/test-send.el, - test/test-shortkey.el: Remove local behave.el in favor of new - test-unit package. - -2009-12-10 rocky - - * track.el: Give error message when track-from-region on a - non-debugger command buffer. - -2009-12-10 rocky - - * core.el, fringe.el, track-mode.el, track.el: - dbgr-fringe-history-unset -> dbgr-fringe-erase-history-arrows. Also - let it be used as a command. Update some docstrings. - -2009-12-10 rocky - - * track.el: Make dbgr-track-from-region more interactive useful: - call the location tracking routine adjust the display. - -2009-12-09 rocky - - * AUTHORS, init/rdebug.el, track.el: rdebug.el: make more - user-friendly for interactive dbgr-track-from-region calls. - -2009-12-08 rocky - - * fringe.el, python/pydbgr.el, ruby/rbdbgr.el: Small changes. - -2009-12-06 rocky - - * key.el, track-mode.el, track.el: track.el: Fix bug in - dbgr-goto-line-for-loc-pat key.el, track-mode.el: temporary - workaround for VMware keybinding mess up. - -2009-12-06 rocky - - * init/rbdbgr.el, ruby/rbdbgr-track-mode.el, ruby/rbdbgr.el: Make - rbdbgr-track-mode.el stand on its own. - -2009-11-29 rocky - - * cmdbuf.el, cmds.el, core.el, key.el, send.el, srcbuf.el, - test/test-send.el, track.el: Start adding flags to command-send to - indicate whether to record history, and whether we have a - frame-changing command. Do more error checking in command-send for - running processes and so on. Add more commands and keys bindings to - short-key. core.el: consider source and command buffer past history - *only* if it was run with the same debugger as we want to currently - run. - -2009-11-29 rocky - - * cmds.el, helper.el, key.el, send.el, test/test-send.el: Make gdb - commands more short-key friendly - that is can be called from the - source window. Add newer-frame: "<" and older frame ">". - -2009-11-29 rocky - - * fringe.el, track-mode.el, track.el: Handle some error cases, and - fix source tracking created in DRYing code. fringe.el: handle - deleting the buffer we are trying to update the fringe arrow for - track-mode.el: handle error case where we invoke dbgr-track-mode in - a non-process buffer. track.el: need to switch to source buffer to - query overlay arrow. - -2009-11-29 rocky - - * shortkey.el, track.el, window.el: Keep command buffer position and - source location position in sync when moving back in the history of - positions. See docstring of dbgr-track-hist-fn-internal for which - windows get displayed. DRY code a little. - -2009-11-29 rocky - - * Makefile.am, cmdbuf.el, core.el, key.el, loc.el, shortkey.el, - srcbuf.el, test/behave.el, test/test-file.el, - test/test-shortkey.el, track-mode.el, track.el, window.el: Fix up - and simplify short-key mode so the setting is saved in the process - buffer and propagated to the source buffers encountered. key.el: - add 's' for step. test/behave.el: add assert-raises! track-mode.el: - use standard name -setup instead of -body. Pass an explicit - parameter. window.el: remove older, now-unused code. - -2009-11-27 rocky - - * cmdbuf.el, cmds.el, file.el, loc.el, shortkey.el, - test/test-cmdbuf.el, track.el, window.el: Bang on (source) window - update and display. Less disruption of windows on update. Add - variable in cmdbuf to track shortkey mode. file.el - (dbgr-file-line-count): remove bug. save-current isn't what we want. - Use find-file-noselect so we don't disrupt current buffer. - cmdbuf.el, cmds,el: at ? to ends of boolean variables. loc.el: - don't change the selected buffer. test-cmdbuf.el: fix improper call - to dbgr-cmdbuf-info-cmd-args= - -2009-11-26 rocky - - * cmdbuf.el: Remove spurious warning. - -2009-11-26 rocky - - * Makefile.am, elisp-comp, helper.el, test/test-cmdbuf.el: - elisp-comp: remove temp script. Makefile.am: Wasn't running cmdbuf - test. helper.el: current best guess at a setter method. - -2009-11-25 rocky - - * test/behave.el, test/test-send.el: behave.el: fix incorrect - initializion of assert count. test-send.el: Check docstring is set - on dbgr-define-command - -2009-11-24 rocky - - * send.el, test/behave.el, test/test-send.el: send.el: docstring - elaboration. test-send.el: Add test of dbgr-define-command. Show - number of assertions run. - -2009-11-24 rocky - - * ruby/rbdbgr.el: Need to use require-relative-list with prefix? - -2009-11-24 rocky - - * track.el: Force going to the current source-code line when in the - case that buffer is already visible. No doubt there will be more - work on this. - -2009-11-23 rocky - - * configure.ac: dbgr-loc.el -> dbgr.el - -2009-11-23 R. Bernstein - - * core.el, python/pydbgr-track-mode.el, python/pydbgr.el, - ruby/rbdbgr-track-mode.el, ruby/rbdbgr.el, track-mode.el: Deal with - process sentinel as part of turning on dbgr-track-mode so that we - catch process hangup dbgr-track-mode (as well as running the - debugger from the outset). - -2009-11-23 R. Bernstein - - * buffer.el, cmdbuf.el, core.el, lochist.el, srcbuf.el: docstring - name regularization. - -2009-11-22 rocky - - * buffer.el, cmdbuf.el, cmds.el, core.el, custom.el, - dbgr-buffer.el, dbgr-cmdbuf.el, dbgr-cmds.el, dbgr-core.el, - dbgr-custom.el, dbgr-file.el, dbgr-fringe.el, dbgr-helper.el, - dbgr-init.el, dbgr-key.el, dbgr-loc.el, dbgr-lochist.el, - dbgr-regexp.el, dbgr-send.el, dbgr-shortkey.el, dbgr-srcbuf.el, - dbgr-track-mode.el, dbgr-track.el, dbgr-window.el, file.el, - fringe.el, helper.el, init.el, init/bashdb.el, init/kshdb.el, - init/pydb.el, init/pydbgr.el, init/rbdbgr.el, init/rdebug.el, - init/remake.el, init/zshdb.el, key.el, loc.el, lochist.el, - python/pydbgr-core.el, python/pydbgr-track-mode.el, - python/pydbgr.el, regexp.el, ruby/rbdbgr-core.el, - ruby/rbdbgr-track-mode.el, ruby/rbdbgr.el, send.el, shortkey.el, - srcbuf.el, test/test-core.el, test/test-file.el, - test/test-helper.el, test/test-loc.el, test/test-lochist.el, - test/test-regexp.el, test/test-send.el, test/test-srcbuf.el, - test/test-track.el, track-mode.el, track.el, window.el: Remove dbgr- - from filenames, although the files still provide with a dbgr- prefix - thanks to recent changes to load-relative. - -2009-11-22 rocky - - * dbgr-buffer.el, dbgr-cmdbuf.el, dbgr-cmds.el, dbgr-helper.el, - dbgr-key.el, dbgr-send.el, dbgr-shortkey.el, dbgr-track-mode.el, - dbgr-track.el, dbgr-window.el: Bang on short-key mode. Add variable - in command buffer which tell whether to add a cmmand to the history - or and to end up in the command buffer. Bugs in dbgr-define-command - fixed. provide-me used more often. - -2009-11-20 rocky - - * dbgr-buffer.el, dbgr-cmdbuf.el, dbgr-core.el, dbgr-custom.el, - dbgr-file.el, dbgr-helper.el, dbgr-key.el, dbgr-send.el, - dbgr-shortkey.el, dbgr-srcbuf.el, dbgr-track.el: (provide 'xxx) -> - (provide-me). This ensures we get it right. Start to fold in Anders' - shortkey mode and keybindings and all that other great stuff. - -2009-11-20 rocky - - * dbgr-send.el: dbgr-send-process: send a debugger command and - redirect output to a temporary buffer. The hope is that this is will - be a cleaner way to make a request and get an answer - no comint - filters are involved. - -2009-11-20 R. Bernstein - - * dbgr-core.el, dbgr-fringe.el, dbgr-track.el: Set fringe arrows for - dedicated command buffers. - -2009-11-20 R. Bernstein - - * test/test-lochist.el: Test changes since we no longer remove - duplicate locations. - -2009-11-20 R. Bernstein - - * dbgr-cmds.el, dbgr-fringe.el, dbgr-lochist.el, - dbgr-track-mode.el, python/pydbgr-track-mode.el, - ruby/rbdbgr-track-mode.el: dbgr-fringe.el: remove duplicate test. - This needs to be done at a higher level. Empirically get fringe - history access correct, until I better understand what's wrong. - dbgr-cmds.el: add more gdb commands. Use them in the python and ruby - debuggers. - -2009-11-20 rocky - - * dbgr-fringe.el, dbgr-track.el: Don't set older marks if the are at - the same position as newer ones. - -2009-11-20 rocky - - * dbgr-cmdbuf.el, dbgr-core.el, dbgr-fringe.el, dbgr-loc.el, - dbgr-srcbuf.el, dbgr-track-mode.el, dbgr-track.el, - test/test-regexp.el: Add history of locations stopped (last 3) in - the fringe. Also some associated simplification and cleanup around - this code. - -2009-11-19 R. Bernstein - - * dbgr-arrow.el, dbgr-buffer.el, dbgr-cmdbuf.el, dbgr-core.el, - dbgr-fringe.el, dbgr-loc.el, dbgr-track.el: dbgr-arrow -> - dbgr-fringe. Simplify a tad more. - -2009-11-19 rocky - - * dbgr-arrow.el, dbgr-core.el, dbgr-loc.el, dbgr-track-mode.el, - dbgr-track.el: Improve arrow interface to just the essentials. - Remove arrow when leaving dbgr-track-mode. - -2009-11-19 rocky - - * dbgr-arrow.el: Fringe arrow cleanup and simplification in advance - of reworking to add a source buffer-local variable of ring of - history positions and marking them in the fringe in both the source - and command buffers. list of positions - -2009-11-19 rocky - - * dbgr-arrow.el, ruby/rbdbgr-core.el: rbdbgr-core.el: fix invalid fn - name dbgr-arrow.el: start allow location history in fringe. - -2009-11-18 rocky - - * test/test-send.el, test/test-srcbuf.el: Attempt more realistic - tests. - -2009-11-18 R. Bernstein - - * dbgr-buffer.el, dbgr-cmdbuf.el, dbgr-init.el, dbgr-srcbuf.el, - dbgr-track-mode.el, test/test-send.el: Bugs I probably would have - caught if I had done more thorough unit testing. - -2009-11-18 R. Bernstein - - * dbgr-core.el, init/Makefile.am: Small bugfix. - -2009-11-18 R. Bernstein - - * Makefile.am, python/pydbgr-core.el, python/pydbgr-track-mode.el, - python/pydbgr.el, ruby/rbdbgr-core.el, ruby/rbdbgr-track-mode.el, - ruby/rbdbgr.el: Since elisp-comp has been fixed we can use - require-relative-list in subdirectories. Reinstate compiling them. - DRY code some. - -2009-11-18 rocky - - * .gitignore, Makefile.am, dbgr-cmdbuf.el, dbgr-core.el, - dbgr-init.el, dbgr-track-mode.el, elisp-comp, - python/pydbgr-core.el, python/pydbgr-track-mode.el, - python/pydbgr.el, ruby/rbdbgr-core.el, ruby/rbdbgr.el, - test/test-send.el, test/test-track.el: Correct bugs in and clean up - track-mode setting and debugger invocation. Suggested debugger - invocation command is now the last invocation unless the buffer has - a better idea. elisp-comp: we now need our own since we don't want - to compile in a directory. Makefile.am: no subdirs until I have more - time to go over this. - -2009-11-17 rocky - - * Makefile.am, configure.ac, dbgr-cmdbuf.el, dbgr-core.el, - dbgr-init.el, dbgr-regexp.el, dbgr-track.el, init/.gitignore, - init/Makefile.am, init/bashdb.el, init/kshdb.el, init/pydb.el, - init/pydbgr.el, init/rbdbgr.el, init/rdebug.el, init/remake.el, - init/zshdb.el, python/pydbgr-core.el, python/pydbgr-regexp.el, - python/pydbgr.el, ruby/rbdbgr-core.el, ruby/rbdbgr-regexp.el, - ruby/rbdbgr-track-mode.el, ruby/rbdbgr.el, test/test-cmdbuf.el, - test/test-regexp-python.el, test/test-regexp-ruby.el, - test/test-regexp.el, test/test-send.el: Create a global hash which - contains regular expression information for each of the debuggers. - Each debugger has a regular expression to match a prompt location - and a regular expression for the prompt string that comint uses. - However there may be other regular expressions for things like stack - traces. Part of a long-needed refactoring. More to follow. Expect - breakage. - -2009-11-17 R. Bernstein - - * dbgr-cmdbuf.el, test/test-send.el: I think the bug in - load-relative may have been the cause of some of the weirdness found - here. - -2009-11-17 R. Bernstein - - * dbgr-cmds.el, dbgr-send.el: Add dbgr-define-command and some - common gdb-commands. - -2009-11-17 R. Bernstein - - * dbgr-send.el, test/test-send.el: Don't issue message if we are in - a command buffer Fill in test cases more. - -2009-11-17 rocky - - * dbgr-send.el, test/test-send.el: Make dbgr-command interactive. - -2009-11-17 rocky - - * Makefile.am, dbgr-send.el, test/test-send.el: Add - dbgr-expand-format-string - -2009-11-17 rocky - - * dbgr-arrow.el: dbgr-set-arrow: add optional indicator pair - -2009-11-16 rocky - - * dbgr-arrow.el: Minor - -2009-11-16 rocky - - * dbgr-core.el, python/pydbgr.el, ruby/rbdbgr.el: Hoist some common - code. Missing a require in rbdbgr.el and remove an extra prvide in - pydbgr.el - -2009-11-16 rocky - - * dbgr-buffer.el, dbgr-cmdbuf.el, dbgr-core.el, dbgr-helper.el, - dbgr-srcbuf.el, dbgr-track-mode.el, test/test-helper.el: Simpilify - struct access even more by removing "dbgr-" prefix. I like things to - look real simple. - -2009-11-16 rocky - - * dbgr-buffer.el, dbgr-cmdbuf.el, dbgr-core.el, dbgr-srcbuf.el, - python/pydbgr-core.el, ruby/rbdbgr-core.el: Push forward with - simpler access to struct fields. pydbgr, rbdbgr: remove compilation - bug/warning. - -2009-11-16 R. Bernstein - - * dbgr-cmdbuf.el, dbgr-srcbuf.el, dbgr-track-mode.el, - dbgr-track.el, python/pydbgr.el, ruby/rbdbgr.el: dbgr-cmdbuf: minor - fixes. SMake more use simplified defstruct access, add dbgr-cmdbuf? - rbdbgr: pass in pat-hash to get set correctly. - -2009-11-16 rocky - - * dbgr-cmdbuf.el, dbgr-helper.el, dbgr-track.el, test/behave.el, - test/test-cmdbuf.el, test/test-helper.el: dbgr-sget: start to - simplify access to defstruct fields. More cmdbuf tests. - -2009-11-15 rocky - - * dbgr-cmdbuf.el, dbgr-send.el, dbgr-track-mode.el, dbgr-track.el, - python/pydbgr-core.el, python/pydbgr-regexp.el, - python/pydbgr-track-mode.el, python/pydbgr.el, - ruby/rbdbgr-regexp.el, ruby/rbdbgr-track-mode.el: dbgr-command-send - now echos its output. prompt is set correctly for rbdbgr and pydbgr. - - -2009-11-15 rocky - - * Makefile.am, dbgr-buffer.el, dbgr-cmdbuf.el, dbgr-core.el, - dbgr-helper.el, dbgr-regexp.el, dbgr-scriptbuf.el, dbgr-send.el, - dbgr-srcbuf.el, dbgr-track-mode.el, dbgr-track.el, - python/pydbgr-core.el, python/pydbgr-regexp.el, python/pydbgr.el, - ruby/rbdbgr-core.el, ruby/rbdbgr-regexp.el, ruby/rbdbgr.el, - test/test-scriptbuf.el, test/test-srcbuf.el: Bug fix: minibuffer - history was not saving prior of debugger invocations. scriptbuf -> - srcbuf. - -2009-11-15 rocky - - * test/test-helper.el, test/test-regexp-ruby.el, - test/test-regexp2.el: Add with-current-buffer-safe to guard against - deleted buffers. Set/save comint-prompt-regexp. Correct debugger - prompts which are not the same as location matching patterns. - Workaround problem in loading pydbg/rbdbgr not pulling in all files. - Include python regexp test. - -2009-11-15 rocky - - * dbgr-buffer.el, dbgr-send.el: Start routines which allow us to - send commands to the debugger process: dbgr-send-command. Right now - though, It is not inserting into the buffer nor the output filter - function to kick in. - -2009-11-15 rocky - - * dbgr-buffer.el, dbgr-core.el, dbgr-file.el, dbgr-loc.el, - dbgr-lochist.el, dbgr-track.el, dbgr-window.el: Start to use - require-relative-list more. Note: require-relative-list has problems - when used in subdirectories python or ruby. But for '.' -like - require relative, it is fine. - -2009-11-15 rocky - - * dbgr-buffer.el, dbgr-cmdbuf.el, dbgr-core.el, dbgr-file.el, - dbgr-scriptbuf.el, dbgr-track.el, test/test-cmdbuf.el: - dbg-buffer.el: Start buffer access routines Start to reduce - declare-functions by getting definitions more directly. - -2009-11-14 rocky - - * Makefile.am, dbgr-cmdbuf.el, dbgr-loc.el, dbgr-scriptbuf.el, - test/test-cmdbuf.el, test/test-scriptbuf.el: Start cmdbuf tests. Add - predicates to see if a buffer is a debugger script or command. - -2009-11-13 R. Bernstein - - * Makefile.am, configure.ac, python/.gitignore, python/Makefile.am, - ruby/Makefile.am: Fix up install so that we go to our own directory - and have language-specific directories underneath that. - -2009-11-13 R. Bernstein - - * python/.gitignore, python/Makefile.am, python/pydbgr.el, - ruby/.gitignore, ruby/rbdbgr.el: Mostly administrivia. - -2009-11-13 rockyb - - * dbgr-core.el, python/pydbgr-track-mode.el, python/pydbgr.el, - ruby/rbdbgr.el: Sentinel should detect deleted buffers. comint - output hooks were not installed in pydbgr and rbdbgr. - -2009-11-13 R. Bernstein - - * Makefile.am, configure.ac, dbgr-track-mode.el, dbgr-track.el, - python/pydbgr-core.el, python/pydbgr-regexp.el, - python/pydbgr-track-mode.el, python/pydbgr.el, ruby/Makefile.am, - ruby/rbdbgr-core.el, ruby/rbdbgr-regexp.el, - ruby/rbdbgr-track-mode.el, ruby/rbdbgr.el: Add Makefiles in python - and ruby. Remove byte-compile warnings in python and ruby. - dbgr-track.el: goto-... -> dbgr-goto - -2009-11-13 rocky - - * dbgr-arrow.el, dbgr-cmdbuf.el, dbgr-file.el, dbgr-helper.el, - dbgr-loc.el, dbgr-lochist.el, dbgr-scriptbuf.el, - dbgr-track-mode.el, dbgr-track.el, dbgr-window.el, - python/pydbgr-core.el, python/pydbgr.el, ruby/rbdbgr-core.el, - ruby/rbdbgr.el: Switch to using require-relative instead of - load-realative. - -2009-11-13 rocky - - * dbgr-cmdbuf.el, dbgr-core.el, dbgr-file.el, dbgr-loc.el, - dbgr-lochist.el, dbgr-scriptbuf.el, dbgr-track-mode.el, - dbgr-track.el, dbgr-window.el, python/pydbgr-core.el, - python/pydbgr-track-mode.el, python/pydbgr.el, ruby/rbdbgr-core.el, - ruby/rbdbgr-regexp.el, ruby/rbdbgr-track-mode.el, ruby/rbdbgr.el: - Used in testing require-relative - -2009-11-11 rocky - - * dbgr-cmdbuf.el, dbgr-core.el, dbgr-helper.el, - python/pydbgr-core.el, python/pydbgr.el, ruby/rbdbgr-core.el, - ruby/rbdbgr.el, test/test-scriptbuf.el: */*-core.el Common routine - to query for command line. dbgr-cmdf.el: fix bugs in command-line - retrieval. - -2009-11-11 R. Bernstein - - * dbgr-cmdbuf.el, dbgr-scriptbuf.el, python/pydbgr-core.el, - python/pydbgr.el, ruby/rbdbgr-core.el, ruby/rbdbgr.el: First cut at - saving command arguments in script buffer. Much improved but More - work needed. - -2009-11-11 R. Bernstein - - * dbgr-cmdbuf.el, dbgr-core.el, dbgr-procbuf.el, dbgr-scriptbuf.el, - dbgr-track-mode.el, dbgr-track.el, test/test-regexp.el, - test/test-scriptbuf.el, test/test-track.el: procbuf -> cmdbuf - -2009-11-11 rocky - - * dbgr-file.el, dbgr-helper.el, dbgr-procbuf.el, dbgr-scriptbuf.el, - dbgr-track.el, dbgr-window.el, test/.gitignore, test/behave.el, - test/test-helper.el, test/test-scriptbuf.el: behave.el: was not - passing assertion message to assert-t Store debugger name inside - script buffers. Command invocation to come... dbgr-window.el: add - provide for my name. Start helper file. xx-p -> xx? because it is - cooler. - -2009-11-10 rocky - - * dbgr-loc.el, ruby/rbdbgr.el: dbgr-loc.el: fix M-up/down motion in - command buffer to match mark ruby/rbdbgr.el: remove bogus - (shell-mode). - -2009-11-10 R. Bernstein - - * dbgr-file.el, dbgr-loc.el, dbgr-lochist.el, dbgr-procbuf.el, - dbgr-track.el, test/test-file.el, test/test-load.el, - test/test-loc.el, test/test-lochist.el: Move command process mark - into location structure. More work is needed. - -2009-11-10 rocky - - * dbgr-loc.el, dbgr-lochist.el, dbgr-procbuf.el, dbgr-track.el: Keep - (historical) process buffer position in sync with historical source - buffer position. Warning: this needs refactorization. - -2009-11-10 rocky - - * dbgr-arrow.el: switch-buffer -> set-buffer so we don't mess up - window positions. - -2009-11-09 rocky - - * dbgr-core.el: dbgr-exec-shell Deal with nil directory in command - invocation - -2009-11-09 R. Bernstein - - * dbgr-core.el, dbgr-loc.el, dbgr-lochist.el, dbgr-procbuf.el, - dbgr-regexp.el, dbgr-scriptbuf.el, dbgr-track.el: Remove - byte-compile warnings. - -2009-11-09 R. Bernstein - - * dbgr-track-mode.el, dbgr-track.el: Better load-relative uses and - remove a failing require. - -2009-11-09 rocky - - * ruby/rbdbgr-core.el, ruby/rbdbgr-regexp.el, - ruby/rbdbgr-track-mode.el, ruby/rbdbgr.el: Use require-relative now. - - -2009-11-09 rocky - - * dbgr-core.el, dbgr-file.el, dbgr-procbuf.el, dbgr-track.el: Use - load-relative with lists of files when possible. - -2009-11-09 rocky - - * README, dbgr-core.el, dbgr-load.el, dbgr-loc.el, - dbgr-track-mode.el, dbgr-track.el, test/behave.el: Start to use - load-relative. dbgr-core.el: fix bug in dbgr-term-sentinal - -2009-11-08 rocky - - * dbgr-core.el, dbgr-procbuf.el, dbgr-scriptbuf.el, dbgr-track.el, - ruby/rbdbgr-core.el, test/test-scriptbuf.el: Clean up code with sets - buffer-local variables in scriptbuf and procbuf. Although this is a - big improvement, more work is needed. - -2009-11-08 rocky - - * Makefile.am, dbgr-arrow.el, dbgr-core.el, dbgr-scriptbuf-var.el, - dbgr-scriptbuf.el, dbgr-track.el, python/pydbgr-core.el, - ruby/rbdbgr-core.el, test/test-scriptbuf.el: Set debugger - buffer-local variables for command/process and source buffers. Set - default directory in command buffer. Source buffer now has last - command invocation and a pointer to the process buffer. - -2009-11-07 rocky - - * dbgr-arrow.el, dbgr-core.el, dbgr-load.el, dbgr-loc.el, - dbgr-procbuf-var.el, dbgr-procbuf.el, dbgr-scriptbuf-var.el, - dbgr-track-mode.el, dbgr-track.el, test/test-regexp.el, - test/test-track.el: Put overla/arrow/fringe arrow on current - location in source window. - -2009-11-02 rocky - - * dbgr-regexp.el, dbgr-track-mode.el, dbgr-track.el: dbgr-regexp.el: - regexp bug fixes for rdebug. dbgr-track-mode.el: docstring typo - dbgr-track.el: don't run hooks if dbgr-track-mode is not set. - -2009-11-02 R. Bernstein - - * dbgr-file.el, dbgr-track.el, python/pydbgr-core.el, - ruby/rbdbgr-core.el, ruby/rbdbgr-regexp.el: Keep history of pydbgr, - rbdbgr invocations and modify minibuffer mode map to do filename - completion. FIXME: need to DRY this code. - -2009-11-02 rocky - - * dbgr-core.el, dbgr-scriptbuf-var.el, python/pydbgr.el, - ruby/rbdbgr-core.el, ruby/rbdbgr.el: Save the last invocation as a - buffer-local variable in the process buffer. - -2009-11-01 rocky - - * test/behave.el, test/test-regexp-python.el: Add an optional - message parmater on assert-... . - -2009-11-01 rocky - - * test/behave.el: Tidy behave.el a little bit more. - -2009-11-01 rocky - - * test/behave.el, test/test-core.el, test/test-file.el, - test/test-load.el, test/test-loc.el, test/test-lochist.el, - test/test-regexp-python.el, test/test-regexp.el, - test/test-regexp2.el, test/test-track.el: behave.el: expect- => - assert- . DRY assert-t. - -2009-11-01 rocky - - * dbgr-core.el, dbgr-track.el, python/pydbgr-core.el, - python/pydbgr-regexp.el, python/pydbgr-track-mode.el, - python/pydbgr.el, ruby/.gitignore, ruby/rbdbgr-core.el, - ruby/rbdbgr-track-mode.el, test/test-regexp-python.el: Add a 2nd - debugger. In the process DRY and make common some code. - -2009-10-31 rocky - - * dbgr-core.el, dbgr-loc.el: Don't kill existing processes in - processe buffers when rerunning the same command Showing location - negotiates the buffers correctly now. - -2009-10-31 rocky - - * dbgr-core.el, dbgr-file.el, dbgr-track-mode.el, dbgr-track.el, - dbgr-window.el, ruby/rbdbgr-core.el, ruby/rbdbgr-track-mode.el, - ruby/rbdbgr.el: rbdbgr via comint now works. - -2009-10-30 R. Bernstein - - * dbgr-core.el, dbgr-file.el, ruby/rbdbgr.el: More work on term - mode. - -2009-10-30 rocky - - * Makefile.am, configure.ac, dbgr-core.el, dbgr-file.el, - dbgr-regexp.el, dbgr-track-mode.el, dbgr-track.el, ruby/.gitignore, - ruby/Makefile.am, ruby/rbdbgr-core.el, ruby/rbdbgr-regexp.el, - ruby/rbdbgr-track-mode.el, ruby/rbdbgr.el, test/behave.el, - test/test-core.el, test/test-track.el: For now rbdbgr uses term.el - for its process buffer. However term.el doesn't have an output - filter function - yet. - -2009-10-29 R. Bernstein - - * dbgr-core.el, ruby/rbdbgr-core.el, test/test-core.el: More - detailed command-line parsing. Warning - is in intermediate state. - -2009-10-29 R. Bernstein - - * dbgr-core.el, ruby/rbdbgr-core.el, ruby/rbdbgr.el: Closer to - having command rbdbgr working. - -2009-10-29 R. Bernstein - - * dbgr-core.el: Start dbgr-exec-shell and dbgr-term-sential - - creation of an eterm shell to run debugger in. - -2009-10-29 rocky - - * dbgr-file.el, dbgr-track-mode.el, dbgr-track.el, - ruby/rbdbgr-core.el, test/test-core.el, test/test-file.el, - test/test-load.el, test/test-loc.el, test/test-lochist.el, - test/test-regexp.el, test/test-regexp2.el, test/test-track.el: Use - save-current-buffer. clean up dbgr-track-mode.el and misc small - fixes. - -2009-10-29 rocky - - * dbgr-core.el, dbgr-track-mode.el, ruby/rbdbgr-core.el, - test/behave.el, test/gcd.rb, test/test-core.el, test/test-file.el, - test/test-load.el, test/test-loc.el, test/test-lochist.el, - test/test-regexp.el, test/test-regexp2.el: test/behave.el: add - expect-equal, expect-t, expect-nil and show actual + expected on - error dbgr-core.el: move option parsing here rbdbgr-core.el: fn-name - typo; adjust for new dbgr-core test-core.el: add more - rbdbgr-file-mode tests - -2009-10-28 rocky - - * dbgr-track-mode.el, dbgr-track.el, ruby/rbdbgr-core.el, - ruby/rbdbgr-regexp.el, ruby/rbdbgr-track-mode.el: - dbgr-track-mode.el: simplify mode hook code by using - define-minor-mode macro more effectively. dbgr-track.el: we'll see - if we can get away with not having dbg-info global. ruby/*.el: - rbdbgr-track-mode now works again - -2009-10-28 rocky - - * dbgr-track-mode.el, dbgr-track.el, ruby/rbdbgr-track-mode.el: - dbgr-track-mode sets status dynamically based on debugger name. - -2009-10-28 rockyb - - * autogen.sh, configure.ac, dbgr-file.el, dbgr-load.el, - dbgr-loc.el, dbgr-scriptbuf-var.el, dbgr-track-mode.el, - dbgr-track.el, ruby/rbdbgr-core.el, test/test-core.el: - dbgr-track-mode minimally works. - -2009-10-28 rockyb - - * Start the Grand Unified Debugger Rewrite. - diff --git a/packages/realgud/INSTALL b/packages/realgud/INSTALL deleted file mode 100644 index 810186078..000000000 --- a/packages/realgud/INSTALL +++ /dev/null @@ -1,250 +0,0 @@ -Installation Instructions -************************* - -Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002, 2004, 2005, -2006, 2007, 2008, 2009 Free Software Foundation, Inc. - - Copying and distribution of this file, with or without modification, -are permitted in any medium without royalty provided the copyright -notice and this notice are preserved. This file is offered as-is, -without warranty of any kind. - -Basic Installation -================== - - Briefly, the shell commands `./configure && make' should configure, -and build this package. If that succeeds `make install' will install -the package. However on some systems you may need root privileges, you -may have to use `sudo make install' or perhaps `su root' beforehand. - - - See http://wiki.github.com/rocky/emacs-dbgr/how-to-install for more -detail as to how to install this package. - -Generic Information -=================== - - The `configure' shell script attempts to guess correct values for -various system-dependent variables used during compilation. It uses -those values to create a `Makefile' in each directory of the package. -It also creates a shell script `config.status' that you can run in -the future to recreate the current configuration, and a file -`config.log' containing compiler output (useful mainly for debugging -`configure'). - - The configure script can also use an optional file (typically -called `config.cache' and enabled with `--cache-file=config.cache' or -simply `-C') that saves the results of its tests to speed up -reconfiguring. Caching is disabled by default to prevent problems -with accidental use of stale cache files. - - If you need to do unusual things to compile the package, please try -to figure out how `configure' could check whether to do them, and mail -diffs or instructions to the address given in the `README' so they can -be considered for the next release. If you are using the cache, and at -some point `config.cache' contains results you don't want to keep, you -may remove or edit it. - - The file `configure.ac' is used to create `configure' by a program -called `autoconf'. You need `configure.ac' if you want to change it -or regenerate `configure' using a newer version of `autoconf'. - - The simplest way to compile this package is: - - 1. `cd' to the directory containing the package's source code and type - `./configure' to configure the package for your system. - - Running `configure' might take a while. While running, it prints - some messages telling which features it is checking for. - - 2. Type `make' to compile the package. - - 3. Optionally, type `make check' to run any self-tests that come with - the package, generally using the just-built uninstalled binaries. - - 4. Type `make install' to install the programs and any data files and - documentation. When installing into a prefix owned by root, it is - recommended that the package be configured and built as a regular - user, and only the `make install' phase executed with root - privileges. - - 5. You can remove the compiled Emacs Lisp files and other derived - files from the source code directory by typing `make clean'. To - also remove the files that `configure' created (so you can - compile the package for a different kind of computer), type `make - distclean'. There is also a `make maintainer-clean' target, but - that is intended mainly for the package's developers. If you use - it, you may have to get all sorts of other programs in order to - regenerate files that came with the distribution. - - 6. You can also type `make uninstall' to remove the installed files - again. - - 7. We don't provide `make distcheck' right now, but perhaps someday - we will. This is by used by developers to test that all other - targets like `make install' and `make uninstall' work correctly. - This target is generally not run by end users. - -Options -===================== - - Run `./configure --help' for details on the pertinent -environment variables. - - You can give `configure' initial values for configuration parameters -by setting variables in the command line or in the environment. Here -is an example: - - ./configure CC=c99 EMACS=/usr/bin/emacs23-x - - *Note Defining Variables::, for more details. - -Installation Names -================== - - By default, `make install' installs the package's emacs files under -`/usr/local/share/emacs/site-lisp', You can specify an installation -prefix other than `/usr/local/emacs/site-lisp' by giving `configure' -the option `--with-site-lisp=PREFIX', where PREFIX must be an absolute -file name. - - The most portable way to affect installation locations is to pass the -correct locations to `configure'; however, many packages provide one or -both of the following shortcuts of passing variable assignments to the -`make install' command line to change installation locations without -having to reconfigure or recompile. - - The first method involves providing an override variable for each -affected directory. For example, `make install -prefix=/alternate/directory' will choose an alternate location for all -directory configuration variables that were expressed in terms of -`${prefix}'. Any directories that were specified during `configure', -but not in terms of `${prefix}', must each be overridden at install -time for the entire installation to be relocated. The approach of -makefile variable overrides for each directory variable is required by -the GNU Coding Standards, and ideally causes no recompilation. -However, some platforms have known limitations with the semantics of -shared libraries that end up requiring recompilation when using this -method, particularly noticeable in packages that use GNU Libtool. - - The second method involves providing the `DESTDIR' variable. For -example, `make install DESTDIR=/alternate/directory' will prepend -`/alternate/directory' before all installation names. The approach of -`DESTDIR' overrides is not required by the GNU Coding Standards, and -does not work on platforms that have drive letters. On the other hand, -it does better at avoiding recompilation issues, and works well even -when some directory options were not specified in terms of `${prefix}' -at `configure' time. - -Optional Features -================= - - If the package supports it, you can cause programs to be installed -with an extra prefix or suffix on their names by giving `configure' the -option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'. - - Some packages pay attention to `--enable-FEATURE' options to -`configure', where FEATURE indicates an optional part of the package. -They may also pay attention to `--with-PACKAGE' options, where PACKAGE -is something like `gnu-as' or `x' (for the X Window System). The -`README' should mention any `--enable-' and `--with-' options that the -package recognizes. - - For packages that use the X Window System, `configure' can usually -find the X include and library files automatically, but if it doesn't, -you can use the `configure' options `--x-includes=DIR' and -`--x-libraries=DIR' to specify their locations. - - Some packages offer the ability to configure how verbose the -execution of `make' will be. For these packages, running `./configure ---enable-silent-rules' sets the default to minimal output, which can be -overridden with `make V=1'; while running `./configure ---disable-silent-rules' sets the default to verbose, which can be -overridden with `make V=0'. - - -Sharing Defaults -================ - - If you want to set default values for `configure' scripts to share, -you can create a site shell script called `config.site' that gives -default values for variables like `CC', `cache_file', and `prefix'. -`configure' looks for `PREFIX/share/config.site' if it exists, then -`PREFIX/etc/config.site' if it exists. Or, you can set the -`CONFIG_SITE' environment variable to the location of the site script. -A warning: not all `configure' scripts look for a site script. - -Defining Variables -================== - - Variables not defined in a site shell script can be set in the -environment passed to `configure'. However, some packages may run -configure again during the build, and the customized values of these -variables may be lost. In order to avoid this problem, you should set -them in the `configure' command line, using `VAR=value'. For example: - - ./configure EMACS=/usr/bin/emacs23-x - -causes the specified `/usr/bin/emacs23-x' to be used as the Emacs program -to use. - -Unfortunately, this technique does not work for `CONFIG_SHELL' due to -an Autoconf bug. Until the bug is fixed you can use this workaround: - - CONFIG_SHELL=/bin/bash /bin/bash ./configure CONFIG_SHELL=/bin/bash - -`configure' Invocation -====================== - - `configure' recognizes the following options to control how it -operates. - -`--help' -`-h' - Print a summary of all of the options to `configure', and exit. - -`--help=short' -`--help=recursive' - Print a summary of the options unique to this package's - `configure', and exit. The `short' variant lists options used - only in the top level, while the `recursive' variant lists options - also present in any nested packages. - -`--version' -`-V' - Print the version of Autoconf used to generate the `configure' - script, and exit. - -`--cache-file=FILE' - Enable the cache: use and save the results of the tests in FILE, - traditionally `config.cache'. FILE defaults to `/dev/null' to - disable caching. - -`--config-cache' -`-C' - Alias for `--cache-file=config.cache'. - -`--quiet' -`--silent' -`-q' - Do not print messages saying which checks are being made. To - suppress all normal output, redirect it to `/dev/null' (any error - messages will still be shown). - -`--srcdir=DIR' - Look for the package's source code in directory DIR. Usually - `configure' can determine that directory automatically. - -`--prefix=DIR' - Use DIR as the installation prefix. *note Installation Names:: - for more details, including other options available for fine-tuning - the installation locations. - -`--no-create' -`-n' - Run the configure checks, but stop before creating any output - files. - -`configure' also accepts some other, not widely useful, options. Run -`configure --help' for more details. - diff --git a/packages/realgud/Makefile.am b/packages/realgud/Makefile.am deleted file mode 100644 index 6f99d6ec4..000000000 --- a/packages/realgud/Makefile.am +++ /dev/null @@ -1,47 +0,0 @@ -# Note: This makefile include remake-style target comments. -# These comments before the targets start with #: -# remake --tasks to shows the targets and the comments - -SUBDIRS = realgud test - -GIT2CL ?= git2cl -RUBY ?= ruby - -lispdir = @lispdir@ - -include common.mk - -PHONY=check clean dist distclean test check-short check-terse install-short - -EXTRA_DIST+=common.mk README.md THANKS - -if MAINTAINER_MODE - -#: Remove change log: ChangeLog -rmChangeLog: - rm ChangeLog || true - -#: Create a ChangeLog file from git logs -ChangeLog: rmChangeLog - git log --pretty --numstat --summary | $(GIT2CL) > $@ - -ACLOCAL_AMFLAGS=-I . - -endif - -#: Run all tests -test: check - -#: Run all tests without bloated output -check-short: - $(MAKE) check 2>&1 | $(RUBY) make-check-filter.rb - -#: Run all tests without and show just the failure lines -check-terse: - $(MAKE) check 2>&1 | $(RUBY) make-check-filter.rb | grep failure - -#: Run "make install" -install-short: - $(MAKE) install 2>&1 | $(RUBY) make-check-filter.rb - -.PHONY: test check check-short rmChangeLog diff --git a/packages/realgud/NEWS b/packages/realgud/NEWS deleted file mode 100644 index e69de29bb..000000000 diff --git a/packages/realgud/README.md b/packages/realgud/README.md deleted file mode 100644 index 6255f1516..000000000 --- a/packages/realgud/README.md +++ /dev/null @@ -1,17 +0,0 @@ -[![Build Status](https://travis-ci.org/rocky/emacs-dbgr.png)](https://travis-ci.org/rocky/emacs-dbgr) [![MELPA Stable](http://stable.melpa.org/packages/realgud-badge.svg)](http://stable.melpa.org/#/realgud) - -A modular GNU Emacs front-end for interacting with external debuggers. - -See https://github.com/rocky/emacs-dbgr/wiki/Debuggers-Supported for a list of debuggers supported. - -The debugger is run out of a *comint* process buffer, or you can use a -`M-x realgud-track-mode` inside an existing shell. - -To install, you'll need a couple of other Emacs packages installed. See -[the installation instructions](http://wiki.github.com/rocky/emacs-dbgr/how-to-install) -for details. - -To get started using, see the -[notes on using realgud](http://wiki.github.com/rocky/emacs-dbgr/how-to-use). - -*Author:* Rocky Bernstein
diff --git a/packages/realgud/THANKS b/packages/realgud/THANKS deleted file mode 100644 index 11efa3067..000000000 --- a/packages/realgud/THANKS +++ /dev/null @@ -1,7 +0,0 @@ -Lars Andersen (expez) - Getting this packaged and put on to Melpa. Also the new name, realgud, is basically his idea. - -Anders Lindgren - The inspiration behind in an earlier incarnation of this code, ruby-debug. Ideas like short-key-mode are his. - -Nick Roberts - We used some of the code for the fringe icons from gdb-mi. - -NYC Emacs Meetup and Nicolas Dudebout - straightening me out on set-keymap-parent diff --git a/packages/realgud/autogen.sh b/packages/realgud/autogen.sh deleted file mode 100755 index 8948b34a2..000000000 --- a/packages/realgud/autogen.sh +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/sh -ln -fs README.md README -autoreconf -vi && \ -autoconf && { - echo "Running configure with --enable-maintainer-mode $@" - ./configure --enable-maintainer-mode $@ -} diff --git a/packages/realgud/common.mk b/packages/realgud/common.mk deleted file mode 100644 index c8fc92a62..000000000 --- a/packages/realgud/common.mk +++ /dev/null @@ -1,10 +0,0 @@ -lisp_files := $(wildcard *.el) -lisp_LISP = $(lisp_files) -EXTRA_DIST = $(lisp_files) -MOSTLYCLEANFILES = *.elc - -short: - $(MAKE) 2>&1 >/dev/null | ruby $(top_srcdir)/make-check-filter.rb - -%.short: - $(MAKE) $(@:.short=) 2>&1 >/dev/null diff --git a/packages/realgud/compute-lispdir.sh b/packages/realgud/compute-lispdir.sh deleted file mode 100755 index 220befd86..000000000 --- a/packages/realgud/compute-lispdir.sh +++ /dev/null @@ -1,46 +0,0 @@ -#!/bin/bash -# Figures out a reasonable --prefix -typeset -i rc=0 -typeset -i DEBUG=${DEBUG:-0} -EMACS_PROG=${EMACS_PROG:-emacs} -list=$($EMACS_PROG --batch --no-splash --no-site-file --eval '(message (substring (format "%s" load-path) 1 -1))' 2>&1) -rc=$? -if (( rc != 0 )) ; then - echo >&2 "Something went wrong running $EMACS_PROG" - exit $rc -$cmd -fi -for dir in $list ; do - if [[ -d $dir ]] ; then - case $dir in - */emacs/site-lisp) - ((DEBUG)) && echo "site lisp: $dir" - echo "$dir" - exit 0 - ;; - esac - fi -done -for dir in $list ; do - if [[ -d $dir ]] ; then - case $dir in - */emacs/2[34]\.[0-9]/site-lisp) - ((DEBUG)) && echo "versioned site lisp: $dir" - echo "$dir" - exit 0 - ;; - esac - fi -done -for dir in $list ; do - if [[ -d $dir ]] ; then - case $dir in - */emacs/2[34]\.[0-9]/site-lisp) - ((DEBUG)) && echo "versioned site lisp: $dir" - echo "$dir" - exit 0 - ;; - esac - fi -done -exit 0 diff --git a/packages/realgud/configure.ac b/packages/realgud/configure.ac deleted file mode 100644 index 4e4615538..000000000 --- a/packages/realgud/configure.ac +++ /dev/null @@ -1,89 +0,0 @@ -dnl FIXME: pick up from realgud.el -AC_INIT(emacs-realgud, 1.1,) -AC_CONFIG_SRCDIR(realgud.el) -AM_INIT_AUTOMAKE([foreign]) -AM_MAINTAINER_MODE - -AC_PATH_PROG([EMACS], [emacs], [emacs]) -AC_ARG_WITH(emacs, AC_HELP_STRING([--with-emacs], - [location of emacs program]), EMACS=$withval) - -AC_MSG_NOTICE("Checking emacs version") -$EMACS -batch -q --no-site-file -eval \ - '(if (<= emacs-major-version 23) - (progn - (error "You need GNU Emacs 24 or better.") - (kill-emacs 1) - ) - )' -if test $? -ne 0 ; then - AC_MSG_ERROR([Can't continue until above error is corrected.]) -fi - -if test "$NO_CHECK_EMACS_PACKAGES" = "" ; then -AC_MSG_NOTICE("Checking prerequiste packages") -$EMACS -batch -q --no-site-file -eval \ - '(dolist (package - (quote (cl-lib list-utils loc-changes load-relative test-simple))) - (require package)) - )' -fi -if test $? -ne 0 ; then - AC_MSG_ERROR([Can't continue until above error is corrected.]) -fi - -################################################################## -# See if --with-lispdir was set. If not, set it to a reasonable default -# based on where bash thinks bashdb is supposed to be installed. -################################################################## - -AM_MISSING_PROG(GIT2CL, git2cl, $missing_dir) - -# Check whether --with-lispdir was given. -if test "${with_lispdir+set}" = set; then : -else - my_lispdir=$(EMACS_PROG=$EMACS $SH_PROG $(dirname $0)/compute-lispdir.sh) - if test "${my_lispdir+set}" = set; then : - with_lispdir=$my_lispdir - echo "'compute-lispdir.sh' lispdir install directory override: '$with_lispdir'" - fi -fi - -## -## Find out where to install the debugger emacs lisp files -## -AM_PATH_LISPDIR -lispdir_realgud=$lispdir/realgud -AC_SUBST([lispdir]) -AC_SUBST([lispdir_realgud]) - -AM_CONDITIONAL(INSTALL_EMACS_LISP, test "x$lispdir_realgud" != "x") - -AC_CONFIG_FILES([Makefile \ - realgud/Makefile \ - realgud/common/Makefile \ - realgud/common/buffer/Makefile \ - realgud/debugger/Makefile \ - realgud/debugger/bashdb/Makefile \ - realgud/debugger/gdb/Makefile \ - realgud/debugger/gub/Makefile \ - realgud/debugger/jdb/Makefile \ - realgud/debugger/kshdb/Makefile \ - realgud/debugger/nodejs/Makefile \ - realgud/debugger/perldb/Makefile \ - realgud/debugger/pdb/Makefile \ - realgud/debugger/pydb/Makefile \ - realgud/debugger/pydbgr/Makefile \ - realgud/debugger/rdebug/Makefile \ - realgud/debugger/remake/Makefile \ - realgud/debugger/trepan/Makefile \ - realgud/debugger/trepan2/Makefile \ - realgud/debugger/trepan3k/Makefile \ - realgud/debugger/trepan.pl/Makefile \ - realgud/debugger/trepanx/Makefile \ - realgud/debugger/trepan8/Makefile \ - realgud/debugger/zshdb/Makefile \ - realgud/lang/Makefile \ - test/Makefile \ - ]) -AC_OUTPUT diff --git a/packages/realgud/el-get-install.el b/packages/realgud/el-get-install.el deleted file mode 100644 index 86c55ec75..000000000 --- a/packages/realgud/el-get-install.el +++ /dev/null @@ -1,104 +0,0 @@ -(eval-when-compile - (defvar el-get-sources) -) - -(declare-function el-get-post-install 'el-get) - -(add-to-list 'load-path "~/.emacs.d/el-get/el-get") - -;;; el-get-install.el --- installer for the lazy -;; -;; Copyright (C) 2010 Dimitri Fontaine -;; -;; Author: Dimitri Fontaine -;; URL: http://www.emacswiki.org/emacs/el-get.el -;; Created: 2010-06-17 -;; Keywords: emacs package elisp install elpa git git-svn bzr cvs apt-get fink http http-tar -;; Licence: WTFPL, grab your copy here: http://sam.zoy.org/wtfpl/ -;; -;; This file is NOT part of GNU Emacs. -;; -;; bootstrap your el-get installation, the goal is then to use el-get to -;; update el-get. -;; -;; So the idea is that you copy/paste this code into your *scratch* buffer, -;; hit C-j, and you have a working el-get. - -(let ((el-get-root - (file-name-as-directory - (or (bound-and-true-p el-get-dir) - (concat (file-name-as-directory user-emacs-directory) "el-get"))))) - - (when (file-directory-p el-get-root) - (add-to-list 'load-path el-get-root)) - - ;; try to require el-get, failure means we have to install it - (unless (require 'el-get nil t) - (unless (file-directory-p el-get-root) - (make-directory el-get-root t)) - - (let* ((package "el-get") - (buf (switch-to-buffer "*el-get bootstrap*")) - (pdir (file-name-as-directory (concat el-get-root package))) - (git (or (executable-find "git") - (error "Unable to find `git'"))) - (url (or (bound-and-true-p el-get-git-install-url) - "http://github.com/dimitri/el-get.git")) - (default-directory el-get-root) - (process-connection-type nil) ; pipe, no pty (--no-progress) - - ;; First clone el-get - (status - (call-process - git nil `(,buf t) t "--no-pager" "clone" "-v" url package))) - - (unless (zerop status) - (error "Couldn't clone el-get from the Git repository: %s" url)) - - ;; switch branch if we have to - (let* ((branch (cond - ;; Check if a specific branch is requested - ((bound-and-true-p el-get-install-branch)) - ;; Check if master branch is requested - ((boundp 'el-get-master-branch) "master") - ;; Read the default branch from the el-get recipe - ((plist-get (with-temp-buffer - (insert-file-contents-literally - (expand-file-name "recipes/el-get.rcp" pdir)) - (read (current-buffer))) - :branch)) - ;; As a last resort, use the master branch - ("master"))) - (remote-branch (format "origin/%s" branch)) - (default-directory pdir) - (bstatus - (if (string-equal branch "master") - 0 - (call-process git nil (list buf t) t "checkout" "-t" remote-branch)))) - (unless (zerop bstatus) - (error "Couldn't `git checkout -t %s`" branch))) - - (add-to-list 'load-path pdir) - (load package) - (let ((el-get-default-process-sync t) ; force sync operations for installer - (el-get-verbose t)) ; let's see it all - (el-get-post-install "el-get")) - (with-current-buffer buf - (goto-char (point-max)) - (insert "\nCongrats, el-get is installed and ready to serve!"))))) - - -(declare-function el-get 'el-get) - -;; now either el-get is `require'd already, or have been `load'ed by the -;; el-get installer. -(setq - el-get-sources - '(el-get ; el-get is self-hosting - loc-changes ; loc marks in buffers - load-relative ; load emacs lisp relative to emacs source - test-simple ; simple test framework - )) - -;; install new packages and init already installed packages -(el-get 'sync '(loc-changes list-utils load-relative test-simple)) diff --git a/packages/realgud/elisp-comp b/packages/realgud/elisp-comp deleted file mode 100755 index 827755267..000000000 --- a/packages/realgud/elisp-comp +++ /dev/null @@ -1,93 +0,0 @@ -#!/bin/sh -# Copyright (C) 1995-2012 Free Software Foundation, Inc. - -scriptversion=2014-02-09.22; # UTC - -# Franc,ois Pinard , 1995. -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2, or (at your option) -# any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . - -# As a special exception to the GNU General Public License, if you -# distribute this file as part of a program that contains a -# configuration script generated by Autoconf, you may include it under -# the same distribution terms that you use for the rest of that program. - -# This file is maintained in Automake, please report -# bugs to or send patches to -# . - -case $1 in - '') - echo "$0: No files. Try '$0 --help' for more information." 1>&2 - exit 1; - ;; - -h | --h*) - cat <<\EOF -Usage: elisp-comp [--help] [--version] FILES... - -This script byte-compiles all '.el' files listed as FILES using GNU -Emacs, and put the resulting '.elc' files into the current directory, -so disregarding the original directories used in '.el' arguments. - -This script manages in such a way that all Emacs LISP files to -be compiled are made visible between themselves, in the event -they require or load-library one another. - -Report bugs to . -EOF - exit $? - ;; - -v | --v*) - echo "elisp-comp $scriptversion" - exit $? - ;; -esac - -if test -z "$EMACS" || test "$EMACS" = "t"; then - # Value of "t" means we are running in a shell under Emacs. - # Just assume Emacs is called "emacs". - EMACS=emacs -fi - -tempdir=elc.$$ - -# Cleanup the temporary directory on exit. -trap 'ret=$?; rm -rf "$tempdir" && exit $ret' 0 -do_exit='(exit $ret); exit $ret' -trap "ret=129; $do_exit" 1 -trap "ret=130; $do_exit" 2 -trap "ret=141; $do_exit" 13 -trap "ret=143; $do_exit" 15 - -# mkdir $tempdir -# cp "$@" $tempdir - -( - # cd $tempdir - echo "(setq load-path (cons nil (cons \"$abs_srcdir\" load-path)))" > script - $EMACS -batch -q -l script -f batch-byte-compile-if-not-done *.el || exit $? - # mv *.elc .. -) || exit $? - -(exit 0); exit 0 - -# Local Variables: -# mode: shell-script -# sh-indentation: 2 -# eval: (add-hook 'write-file-hooks 'time-stamp) -# time-stamp-start: "scriptversion=" -# time-stamp-format: "%:y-%02m-%02d.%02H" -# time-stamp-time-zone: "UTC" -# time-stamp-end: "; # UTC" -# End: diff --git a/packages/realgud/install-from-git.sh b/packages/realgud/install-from-git.sh deleted file mode 100755 index 8f1291a57..000000000 --- a/packages/realgud/install-from-git.sh +++ /dev/null @@ -1,102 +0,0 @@ -#!/bin/bash - -# This installs all realgud and its prerequisites. If you are lucky -# you can just run this: -# -# bash ./install-from-git.sh -# -# However we do provide for some customization... -# -# 1. GIT PROTOCOL -# =============== -# -# If your "git clone" can't handle the "http" protocol, you might be -# able to use the "git" protocol. To do this set the GIT_PROTOCOL -# variable like this: -# -# GIT_PROTOCOL=git sh ./install-from-git.sh -# -# 2. configure options (e.g --prefix) -# ==================================== - -# If you want to customize configuration parameters, for example, -# choose where to install, you can pass configure options to this -# script. For example:# can pass configure options. -# -# sh ./install-from-git.sh --prefix=/tmp -# -# 3. TO "sudo" or not to "sudo"? -# ============================== -# If you are running as root on a *Nix-like box, then there's no problem. -# -# If you are not running as root, "sudo" might be invoked to install -# code. On systems that don't have a "sudo" command but need -# filesystem permission, then you get by with setting SUDO_CMD to "su root-c" -# For example: -# -# SUDO_CMD='su root -c' sh ./install-from-git.sh -# -# If you have sufficient filesystem permission (which is often the -# case on Windows or cygwin) then you might not need or want sudo. So -# here, set SUDO_CMD to a blank: -# -# SUDO_CMD=' ' sh ./install-from-git.sh -# -# -# To finish here is an invocation using all 3 above options: -# GIT_PROTOCOL='git' SUDO_CMD=' ' sh ./install-from-git.sh --prefix=/tmp - -GIT_PROTOCOL=${GIT_PROTOCOL:-https} - -# Run and echo a command -run_cmd() { - echo "--- Running command: $@" - $@ - rc=$? - echo "--- $@ exit status is $?" - return $rc -} - -# environment variable SUDO_CMD could be "sudo" or "su root -c" or " " -# for don't need sudo - -if (( $(id -u) != 0)) ; then - if [[ -z "$SUDO_CMD" ]] ; then - need_sudo='sudo' - if which $need_sudo >/dev/null 2>&1 ; then - try_cmd='' - else - need_sudo='su root -c' - try_cmd='su' - fi - else - need_sudo="$SUDO_CMD" - fi -else - need_sudo='' - try_cmd='' -fi - -for program in git make $try_cmd ; do - if ! which $program >/dev/null 2>&1 ; then - echo "Can't find program $program in $PATH" - exit 1 - fi -done - -for pkg in emacs-{test-simple,load-relative,loc-changes,dbgr} ; do - echo '******************************************' - echo Trying to install ${pkg}... - echo '******************************************' - if [[ -d $pkg ]]; then - run_cmd $need_sudo rm -fr $pkg - fi - run_cmd git clone ${GIT_PROTOCOL}://github.com/rocky/${pkg}.git - (cd $pkg && \ - run_cmd $SHELL ./autogen.sh && \ - run_cmd ./configure $@ && \ - run_cmd make && \ - run_cmd make check && \ - run_cmd $need_sudo make install - ) -done diff --git a/packages/realgud/make-check-filter.rb b/packages/realgud/make-check-filter.rb deleted file mode 100644 index 508c8f629..000000000 --- a/packages/realgud/make-check-filter.rb +++ /dev/null @@ -1,24 +0,0 @@ -#!/usr/bin/env ruby -# Use this to cut out the crud from make check. -# Use like this: -# make check 2>&1 | ruby ../make-check-filter.rb -# See Makefile.am -pats = ["^(?:Loading", - '(re)?make\[', - "Making check in", - '\(cd \.\.', - "make -C", - "Test-Unit", - "Fontifying", - "`flet'", - '\s*$', - '##[<>]+$' - ].join('|') + ')' -# puts pats -skip_re = /#{pats}/ - -while gets() - next if $_.encode!('UTF-8', 'binary', - invalid: :replace, undef: :replace, replace: '') =~ skip_re - puts $_ -end diff --git a/packages/realgud/realgud.el b/packages/realgud/realgud.el deleted file mode 100644 index 581d5512a..000000000 --- a/packages/realgud/realgud.el +++ /dev/null @@ -1,192 +0,0 @@ -;;; realgud.el --- A modular front-end for interacting with external debuggers - -;; Author: Rocky Bernstein -;; Version: 1.1 -;; Package-Requires: ((load-relative "1.0") (list-utils "0.4.2") (loc-changes "1.1") (test-simple "1.0")) -;; URL: http://github.com/rocky/emacs-dbgr -;; Compatibility: GNU Emacs 24.x - -;; Copyright (C) 2013-2015 Rocky Bernstein - -;; This program is free software: you can redistribute it and/or -;; modify it under the terms of the GNU General Public License as -;; published by the Free Software Foundation, either version 3 of the -;; License, or (at your option) any later version. - -;; This program is distributed in the hope that it will be useful, but -;; WITHOUT ANY WARRANTY; without even the implied warranty of -;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -;; General Public License for more details. - -;; You should have received a copy of the GNU General Public License -;; along with this program. If not, see -;; . - -;;; Commentary: - -;; Once upon a time in an Emacs far far away and a programming-style -;; deservedly banished, there was a monolithic Cathederal-like -;; debugger front-end called gub. This interfaced with a number of -;; debuggers, many now dead. Is there anyone still alive that -;; remembers sdb from UNIX/32V circa 1980? -;; -;; This isn't that. Here we make use of more modern programming -;; practices, more numerous and smaller files, unit tests, and better -;; use of emacs primitives, e.g. buffer marks, buffer-local variables, -;; structures, rings, hash tables. Although there is still much to be -;; desired, this code is more scalable and suitable as a common base for -;; an Emacs front-end to modern debuggers. -;; -;; Oh, and because global variables are largely banned, we can support -;; several simultaneous debug sessions. -;; -;; See URL `https://github.com/rocky/emacs-dbgr/wiki/Features' for a list -;; features. - -;; -;; The debuggers we currently support are: - -;; NAME INVOCATION** WHAT -; ----------------------------------- -;; bashdb bashdb bash -;; Devel::Trepan trepan.pl Perl5 -;; gdb realgud:gdb gdb -;; gub gub Go SSA debugger -;; jdb realgud:jdb Java jdb debugger -;; kshdb kshdb Korn Shell 93u+ -;; nodejs nodejs node.js javascript debugger -;; pdb realgud:pdb stock C Python debugger -;; perldb realgud:perldb stock Perl5 debugger -;; pydb pydb slighly enhanced pdb for Python 2.x -;; pydbgr pydbgr obsolete trepanning debugger for Python 2.x -;; rb8-trepanning trepan8 MRI Ruby 1.8 and an unpatched YARV 1.9 -;; rbx-trepanning trepanx trepanning debugger for Rubinius Ruby -;; remake remake GNU Make -;; ruby-debug rdebug Ruby -;; trepanning trepan trepanning debugger for a patched Ruby 1.9 -;; trepan2 trepan2 trepanning debugger for Python 2.x -;; trepan3k trepan3k trepanning debugger for Python 3.x -;; zshdb zshdb Zsh -;; -;; -;; **gdb, jdb, perldb, pdb invocations require the realgud: preface to -;; disambiguate it from older, preexisting emacs commands in `gud'. The other -;; invocations also accept realgud: prefaces, e.g. realgud:bashdb or -;; realgud:rdebug. Alas there are older obsolete (i.e. often written by me) -;; Emacs packages out there for bashdb, kshdb, nodejs, pydb, rdebug, zshdb. - -;; If you don't see your favorite debugger above, see URL -;; `https://github.com/rocky/emacs-dbgr/wiki/How-to-add-a-new-debugger/' -;; for how you can add your own. - -;; The debugger is run out of a comint process buffer, or you can use -;; a `realgud-track-mode' inside an existing shell. - -;; To install you will need a couple of other Emacs packages -;; installed. If you install via melpa (`package-install') or -;; `el-get', these will be pulled in automatically. See the -;; installation instructions URL -;; `https://github.com/rocky/emacs-dbgr/wiki/How-to-Install' for all -;; the ways to to install and more details on installation. - -;;; Code: - -(require 'load-relative) - -(defgroup realgud nil - "The Grand Cathedral Debugger rewrite" - :group 'processes - :group 'tools - :version "24.2") - -;; FIXME: extend require-relative for "autoload". -(defun realgud:load-features() - (require-relative-list - '( - "./realgud/common/track-mode" - "./realgud/common/utils" - "./realgud/debugger/bashdb/bashdb" - "./realgud/debugger/gdb/gdb" - "./realgud/debugger/gub/gub" - "./realgud/debugger/jdb/jdb" - "./realgud/debugger/kshdb/kshdb" - "./realgud/debugger/nodejs/nodejs" - "./realgud/debugger/pdb/pdb" - "./realgud/debugger/perldb/perldb" - "./realgud/debugger/pydb/pydb" - "./realgud/debugger/pydbgr/pydbgr" - "./realgud/debugger/rdebug/rdebug" - "./realgud/debugger/remake/remake" - "./realgud/debugger/trepan/trepan" - "./realgud/debugger/trepan.pl/trepanpl" - "./realgud/debugger/trepan2/trepan2" - "./realgud/debugger/trepan3k/trepan3k" - "./realgud/debugger/trepanx/trepanx" - "./realgud/debugger/trepan8/trepan8" - "./realgud/debugger/zshdb/zshdb" - ) "realgud-") - ) - -(load-relative "./realgud/common/custom") - -(defun realgud-feature-starts-with(feature prefix) - "realgud-strings-starts-with on stringified FEATURE and PREFIX." - (declare (indent 1)) - (string-prefix-p (symbol-name feature) prefix) - ) - -(defun realgud:loaded-features() - "Return a list of loaded debugger features. These are the -features that start with 'realgud-' and also include standalone debugger features -like 'pydbgr'." - (let ((result nil)) - (dolist (feature features result) - (setq feature-str (symbol-name feature)) - (cond ((eq 't - (string-prefix-p feature-str "realgud-")) - (setq result (cons feature-str result))) - ((eq 't - (string-prefix-p feature-str "nodejs")) - (setq result (cons feature-str result))) - ((eq 't - (string-prefix-p feature-str "pydbgr")) - (setq result (cons feature-str result))) - ((eq 't - ;; No trailing '-' to get a plain "trepan". - (string-prefix-p feature-str "trepan")) - (setq result (cons feature-str result))) - ((eq 't - ;; No trailing '-' to get a plain "trepanx". - (string-prefix-p feature-str "trepanx")) - (setq result (cons feature-str result))) - ('t nil)) - ) - ) -) - -(defun realgud:unload-features() - "Remove all features loaded from this package. Used in -`realgud:reload-features'. See that." - (interactive "") - (let ((result (realgud:loaded-features))) - (dolist (feature result result) - (unless (symbolp feature) (setq feature (make-symbol feature))) - (if (featurep feature) - (unload-feature feature) 't)) - )) - -(defun realgud:reload-features() - "Reload all features loaded from this package. Useful if have -changed some code or want to reload another version, say a newer -development version and you already have this package loaded." - (interactive "") - (realgud:unload-features) - (realgud:load-features) - ) - -;; Load everything. -(realgud:load-features) - -(provide-me) - -;;; realgud.el ends here diff --git a/packages/realgud/realgud/Makefile.am b/packages/realgud/realgud/Makefile.am deleted file mode 100644 index 75a2af8cd..000000000 --- a/packages/realgud/realgud/Makefile.am +++ /dev/null @@ -1 +0,0 @@ -SUBDIRS = common debugger lang diff --git a/packages/realgud/realgud/common/Makefile.am b/packages/realgud/realgud/common/Makefile.am deleted file mode 100644 index 44d7530a1..000000000 --- a/packages/realgud/realgud/common/Makefile.am +++ /dev/null @@ -1,4 +0,0 @@ -SUBDIRS = buffer - -include $(top_srcdir)/common.mk -lispdir = @lispdir_realgud@/$(notdir $(subdir)) diff --git a/packages/realgud/realgud/common/attach.el b/packages/realgud/realgud/common/attach.el deleted file mode 100644 index 32734b09f..000000000 --- a/packages/realgud/realgud/common/attach.el +++ /dev/null @@ -1,54 +0,0 @@ -;;; Copyright (C) 2014 Rocky Bernstein -;;; Emacs Commands to associate or attach a source buffer to a command -;;; buffer and vice versa. - -(eval-when-compile (require 'cl)) -(require 'load-relative) -(require-relative-list '("buffer/command" "buffer/source") - "realgud-buffer-") -(require-relative-list '("shortkey") "realgud-") - -(declare-function realgud-cmdbuf-add-srcbuf 'realgud-buffer-command) -(declare-function realgud-cmdbuf? 'realgud-buffer-command) -(declare-function realgud-srcbuf-init-or-update 'realgud-source) -(declare-function realgud-short-key-mode-setup 'realgud-shortkey) - -(defun realgud:attach-source-buffer(srcbuf) - "Associate a source buffer with the current command buffer" - (interactive "bsource buffer: ") - (unless (realgud-cmdbuf?) - (error "The command only works inside a command buffer")) - (unless (get-buffer-process (current-buffer)) - (warn "Can't find a process for command buffer %s" (current-buffer))) - - (let* ((cmdbuf (current-buffer)) - (shortkey-mode? (realgud-sget 'cmdbuf-info 'src-shortkey?))) - (if (stringp srcbuf) (setq srcbuf (get-buffer srcbuf))) - (realgud-cmdbuf-add-srcbuf srcbuf) - (realgud-srcbuf-init-or-update srcbuf cmdbuf) - (if shortkey-mode? - (with-current-buffer srcbuf - (realgud-short-key-mode-setup 't)) - ) - ) - ) - -(defun realgud:attach-command-buffer(cmdbuf) - "Associate a command buffer with the current source buffer" - - (interactive "bcommand buffer: ") - (if (stringp cmdbuf) (setq cmdbuf (get-buffer cmdbuf))) - (let* ((srcbuf (current-buffer)) - (shortkey-mode?)) - (with-current-buffer cmdbuf - (unless (realgud-cmdbuf?) - (error "The buffer is not a command buffer")) - (unless (get-buffer-process (current-buffer)) - (warn "Can't find a process for command buffer %s" (current-buffer))) - (setq shortkey-mode? (realgud-sget 'cmdbuf-info 'src-shortkey?))) - (realgud-cmdbuf-add-srcbuf srcbuf) - (realgud-srcbuf-init-or-update srcbuf cmdbuf) - (if shortkey-mode? (realgud-short-key-mode-setup 't))) - ) - -(provide-me "realgud-") diff --git a/packages/realgud/realgud/common/backtrace-mode.el b/packages/realgud/realgud/common/backtrace-mode.el deleted file mode 100644 index 1ea264872..000000000 --- a/packages/realgud/realgud/common/backtrace-mode.el +++ /dev/null @@ -1,101 +0,0 @@ -;;; Debugger Backtrace buffer mode settings -;;; Copyright (C) 2011, 2013, 2015 Rocky Bernstein -(require 'load-relative) -(require-relative-list '("menu" "key") "realgud-") -(require-relative-list '("buffer/command") "realgud-buffer-") - -(declare-function realgud-populate-debugger-menu 'realgud-menu) -(declare-function realgud-populate-common-keys 'realgud-menu) -(declare-function realgud-cmdbuf-pat 'realgud-menu) - -(defvar realgud:frames-menu nil - "Frames menu in Backtrace menu.") - -;; (setq realgud:frames-menu -;; (let ((map (make-sparse-keymap "Goto Specific Frames"))) -;; (define-key map [frames-menu] -;; (list 'menu-item "Specific Frames" 'realgud:frames-menu)) -;; (realgud-menu-item map "Frame 1" 'realgud-goto-frame-1) -;; (realgud-menu-item map "Frame 2" 'realgud-goto-frame-2) -;; (realgud-menu-item map "Frame 3" 'realgud-goto-frame-3) -;; ) -;; map) - -(defvar realgud-backtrace-mode-map - (let ((map (realgud-populate-debugger-menu (make-sparse-keymap)))) - (suppress-keymap map) - (realgud-populate-common-keys map) - (define-key map "." 'realgud-backtrace-moveto-frame-selected) - (define-key map "r" 'realgud:backtrace-init) - (define-key map [double-mouse-1] 'realgud:follow-event) - (define-key map [mouse-2] 'realgud:follow-event) - (define-key map [enter] 'realgud:follow-event) - (define-key map [mouse-3] 'realgud:follow-event) - (define-key map [enter] 'realgud:follow-event) - (define-key map [return] 'realgud:follow-point) - (define-key map [up] 'realgud-backtrace-moveto-frame-prev) - (define-key map [down] 'realgud-backtrace-moveto-frame-next) - (define-key map "l" 'realgud-recenter-arrow) - - (define-key map [frames-menu] - (list 'menu-item "Specific Frames" 'realgud:frames-menu)) - - ;; FIXME: these can go to a common routine. See also shortkey.el and - ;; key.el - (define-key map "<" 'realgud:cmd-newer-frame) - (define-key map ">" 'realgud:cmd-older-frame) - (define-key map "d" 'realgud:cmd-newer-frame) - (define-key map "u" 'realgud:cmd-older-frame) - (define-key map "q" 'realgud:cmd-quit) - (define-key map "C" 'realgud-window-cmd-undisturb-src) - (define-key map "F" 'realgud:window-bt) - (define-key map "I" 'realgud:cmdbuf-info-describe) - (define-key map "S" 'realgud-window-src-undisturb-cmd) - - (define-key map "n" 'realgud-backtrace-moveto-frame-next) - (define-key map "p" 'realgud-backtrace-moveto-frame-prev) - (define-key map "0" 'realgud-goto-frame-n) - (define-key map "1" 'realgud-goto-frame-n) - (define-key map "2" 'realgud-goto-frame-n) - (define-key map "3" 'realgud-goto-frame-n) - (define-key map "4" 'realgud-goto-frame-n) - (define-key map "5" 'realgud-goto-frame-n) - (define-key map "6" 'realgud-goto-frame-n) - (define-key map "7" 'realgud-goto-frame-n) - (define-key map "8" 'realgud-goto-frame-n) - (define-key map "9" 'realgud-goto-frame-n) - - ;; -------------------- - ;; The "Stack window" submenu. - ;; (let ((submenu realgud:frames-menu)) - ;; (define-key-after map [menu-bar debugger stack] - ;; (cons "Stack window" submenu) - ;; 'placeholder)) - map) - "Keymap to navigate realgud stack frames.") - -(defun realgud-backtrace-mode (&optional cmdbuf) - "Major mode for displaying the stack frames. -\\{realgud-frames-mode-map}" - (interactive) - (kill-all-local-variables) - (setq buffer-read-only 't) - (setq major-mode 'realgud-backtrace-mode) - (setq mode-name "Realgud Stack Frames") - ;; (set (make-local-variable 'realgud-secondary-buffer) t) - (setq mode-line-process 'realgud-mode-line-process) - (use-local-map realgud-backtrace-mode-map) - - ;; FIXME: make buffer specific - (if cmdbuf - (let* ((font-lock-keywords - (with-current-buffer cmdbuf - (realgud-cmdbuf-pat "font-lock-keywords")))) - (if font-lock-keywords - (set (make-local-variable 'font-lock-defaults) - (list font-lock-keywords))) - )) - ;; (run-mode-hooks 'realgud-backtrace-mode-hook) - ) - -(provide-me "realgud-") diff --git a/packages/realgud/realgud/common/backtrack-mode.el b/packages/realgud/realgud/common/backtrack-mode.el deleted file mode 100644 index 46ef27cfe..000000000 --- a/packages/realgud/realgud/common/backtrack-mode.el +++ /dev/null @@ -1,98 +0,0 @@ -;;; Copyright (C) 2011, 2013, 2014 Rocky Bernstein -;;; Used to parse programming-language backtrace-like tracks -;;; output. In contrast to track-mode, there doesn't have to be a -;;; process shell arround Compare with backtrace-mode.el which -;;; handles backtraces inside the debugger - -(eval-when-compile (require 'cl)) -(require 'shell) - -(require 'load-relative) -(require-relative-list - '("core" "helper" "track" "loc" "lochist" "file" - "fringe" "window" "regexp" "menu" - "send" "shortkey") "realgud-") - -(require-relative-list '("buffer/command") "realgud-buffer-") - -(declare-function realgud:debugger-name-transform 'realgud-helper) -(declare-function realgud-populate-debugger-menu 'realgud-menu) -(declare-function realgud:track-set-debugger 'realgud-track) - -(defvar realgud-backtrack-mode-map - (let ((map (make-sparse-keymap))) - (define-key map [frames-menu] - (list 'menu-item "Specific Frames" 'realgud:frames-menu)) - (define-key map [M-right] 'realgud-track-hist-newest) - (define-key map [M-down] 'realgud-track-hist-newer) - (define-key map [M-up] 'realgud-track-hist-older) - (define-key map [M-print] 'realgud-track-hist-older) - (define-key map [M-S-down] 'realgud-track-hist-newest) - (define-key map [M-S-up] 'realgud-track-hist-oldest) - (realgud-populate-debugger-menu map) - map) - "Keymap used in `realgud-backtrack-minor-mode'.") - -;; FIXME figure out if I can put this in something like a header file. -;; FIXME: combine with realgud:track-set-debugger's completing read -(defun realgud-backtrack-set-debugger (debugger-name) - "Set debugger name This info is returned or nil if we can't find a -debugger with that information" - (interactive - (list (completing-read "Debugger name: " realgud-pat-hash))) - (let ((regexp-hash (gethash debugger-name realgud-pat-hash))) - (if regexp-hash - (let* ((prefix (realgud:debugger-name-transform debugger-name)) - (specific-track-mode (intern (concat prefix "-backtrack-mode"))) - ) - (if (and (not (eval specific-track-mode)) - (functionp specific-track-mode)) - (funcall specific-track-mode 't)) - ) - (progn - (message "I Don't have %s listed as a debugger." debugger-name) - nil) - ))) - -(define-minor-mode realgud-backtrack-mode - "Minor mode for backtracking parsing." - :init-value nil - :global nil - :group 'realgud - - :lighter - (:eval (progn - (concat " " - (if (realgud-cmdbuf-info-set?) - (realgud-sget 'cmdbuf-info 'debugger-name) - "dbgr??")))) - - :keymap realgud-backtrack-mode-map - ;; Setup/teardown - ) - -(defmacro realgud-backtrack-mode-vars (name) - `(progn - (defvar ,(intern (concat name "-backtrack-mode")) nil - ,(format "Non-nil if using %s-backtrack-mode as a minor mode of some other mode. -Use the command `%s-track-mode' to toggle or set this variable." name name)) - (defvar ,(intern (concat name "-backtrack-mode-map")) (make-sparse-keymap) - ,(format "Keymap used in `%s-backtrack-mode'." name)) - )) - -;; FIXME: The below could be a macro? I have a hard time getting -;; macros right. -(defun realgud-backtrack-mode-body(name) - "Used in by custom debuggers: pydbgr, trepan, gdb, etc. NAME is -the name of the debugger which is used to preface variables." - (realgud:track-set-debugger name) - (funcall (intern (concat "realgud-define-" name "-commands"))) - (if (intern (concat name "-backtrack-mode")) - (progn - (realgud-backtrack-mode 't) - (run-mode-hooks (intern (concat name "-backtrack-mode-hook")))) - (progn - (realgud-backtrack-mode nil) - ))) - -(provide-me "realgud-") diff --git a/packages/realgud/realgud/common/bp-image-data.el b/packages/realgud/realgud/common/bp-image-data.el deleted file mode 100644 index 01abaf38e..000000000 --- a/packages/realgud/realgud/common/bp-image-data.el +++ /dev/null @@ -1,357 +0,0 @@ -(require 'load-relative) -(defconst realgud-bp-xpm-data - "/* XPM */ -static char *magick[] = { -/* columns rows colors chars-per-pixel */ -\"10 10 2 1\", -\" c red\", -\"+ c None\", -/* pixels */ -\"+++ +++\", -\"++ ++\", -\"+ +\", -\" \", -\" \", -\" \", -\" \", -\"+ +\", -\"++ ++\", -\"+++ +++\", -};" - "XPM data used for breakpoint enable and disable icon.") - -;; For seeing what above icon looks like: -(if nil - (progn - (let ((image - (find-image `((:type xpm :data - ,realgud-bp-xpm-data - :ascent 100 :pointer hand))))) - (insert-image image)) ;; eval-last-sexp after previous )) - (let ((image - (find-image `((:type xpm :data - ,realgud-bp-xpm-data - :conversion disabled - :ascent 100 :pointer hand))))) - (insert-image image)) ;; eval-last-sexp after previous )) - ) - ) - -(defconst realgud-bp-enabled-pbm-data - "P1 -10 10\", -0 0 0 0 1 1 1 1 0 0 0 0 -0 0 0 1 1 1 1 1 1 0 0 0 -0 0 1 1 1 1 1 1 1 1 0 0 -0 1 1 1 1 1 1 1 1 1 1 0 -0 1 1 1 1 1 1 1 1 1 1 0 -0 1 1 1 1 1 1 1 1 1 1 0 -0 1 1 1 1 1 1 1 1 1 1 0 -0 0 1 1 1 1 1 1 1 1 0 0 -0 0 0 1 1 1 1 1 1 0 0 0 -0 0 0 0 1 1 1 1 0 0 0 0" - "PBM data used for enabled breakpoint icon.") - -;; For seeing what above icon looks like: -(if nil - (let ((image - (find-image `((:type pbm :data - ,realgud-bp-enabled-pbm-data - :ascent 100 :pointer hand))))) - (insert-image image)) ;; eval-last-sexp after previous )) - ) - -(defconst realgud-bp-disabled-pbm-data - "P1 -10 10\", -1 1 1 1 0 0 0 0 1 1 1 1 -1 1 1 0 0 0 0 0 0 1 1 1 -1 1 0 0 0 0 0 0 0 0 1 1 -1 0 0 0 0 0 0 0 0 0 0 1 -1 0 0 0 0 0 0 0 0 0 0 1 -1 0 0 0 0 0 0 0 0 0 0 1 -1 0 0 0 0 0 0 0 0 0 0 1 -1 1 0 0 0 0 0 0 0 0 1 1 -1 1 1 0 0 0 0 0 0 1 1 1 -1 1 1 1 0 0 0 0 1 1 1 1" - "PBM data used for disabled breakpoint icon.") - -;; For seeing what above icon looks like: -(if nil - (let ((image - (find-image `((:type pbm :data - ,realgud-bp-disabled-pbm-data - :ascent 100 :pointer hand))))) - (insert-image image)) ;; eval-last-sexp after previous )) - ) - - - -(defconst realgud-bp-enabled-svg-data -" - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -") - -;; For seeing what above icon looks like: -(if nil - (let ((image - (find-image `((:type svg :data - ,realgud-bp-enabled-svg-data - :ascent 100 :pointer hand))))) - (insert-image image)) ;; eval-last-sexp after previous )) - ) - -(defconst realgud-bp-disabled-svg-data -" - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -") - -;; For seeing what above icon looks like: -(if nil - (let ((image - (find-image `((:type svg :data - ,realgud-bp-disabled-svg-data - :ascent 100 :pointer hand))))) - (insert-image image)) ;; eval-last-sexp after previous )) - ) - -(defconst realgud-bp-enabled-tiff-data -"II*(ÿÿÿÿÿÿÿÿþÿ@@@@ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿBBBBÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿþÿ@@@@ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿBBBBÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿBBBBÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿþÿ>>>>ÿÿþÿ<<<<ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿþÿ>>>>ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿþÿ<<<<ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿþÿ>>>>ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿþÿ<<<<ÿÿÿÿÿÿÿÿÿÿÿÿÿÿþÿ>>>>ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ - - -  &f 4<()>D?TR/tmp/en.tiffHHàF@V@€Âõ(@`¸@@33@€ff&@ ™™ @< -×@" - "TIFF data used for breakpoint enabled icon.") - -;; For seeing what above icon looks like: -(if nil - (let ((image - (find-image `((:type tiff :data - ,realgud-bp-enabled-tiff-data - :ascent 100 :pointer hand))))) - (insert-image image)) ;; eval-last-sexp after previous )) - ) - -(defconst realgud-bp-disabled-tiff-data -"II*˜ÿÿÿÿ  ÿÿ‚‚ÿÿ€ÿÿ€ÿÿ€ÿÿ‚‚ÿÿ ¡ÿÿÿÿÿÿÿÿÿÿ  ÿÿ‚‚ÿÿ€ÿÿ€ÿÿ€ÿÿ€ÿÿ€ÿÿ‚‚ÿÿ ¡ÿÿÿÿÿÿ‚‚ÿÿ€ÿÿ€ÿÿ€ÿÿ€ÿÿ€ÿÿ€ÿÿ€ÿÿ‚‚ÿÿ ¡ÿÿ€ÿÿ€ÿÿ€ÿÿ€ÿÿ€ÿÿ€ÿÿ€ÿÿ€ÿÿ€ÿÿ‡ˆÿÿ€ÿÿ€ÿÿ€ÿÿ€ÿÿ€ÿÿ€ÿÿ€ÿÿ€ÿÿ€ÿÿ‡ˆÿÿ€ÿÿ€ÿÿ€ÿÿ€ÿÿ€ÿÿ€ÿÿ€ÿÿ€ÿÿ€ÿÿ‡ˆÿÿ‚‚ÿÿ€ÿÿ€ÿÿ€ÿÿ€ÿÿ€ÿÿ€ÿÿ€ÿÿ‚‚ÿÿŸŸÿÿžžÿÿ‚‚ÿÿ€ÿÿ€ÿÿ€ÿÿ€ÿÿ€ÿÿ‚‚ÿÿŸŸÿÿÿÿÿÿÿÿÿÿžžÿÿ‚‚ÿÿ€ÿÿ€ÿÿ€ÿÿ‚‚ÿÿŸŸÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿžžÿÿ‡ˆÿÿ‡ˆÿÿ‡ˆÿÿŸŸÿÿÿÿÿÿÿÿÿÿÿÿÿÿ - - - ŽÌœ¤()>¬?¼R/tmp/dis.tiffHHàF@V@€Âõ(@`¸@@33@€ff&@ ™™ @< -×@" - "TIFF data used for breakpoint disabled icon.") - -;; For seeing what above icon looks like: -(if nil - (let ((image - (find-image `((:type tiff :data - ,realgud-bp-disabled-tiff-data - :ascent 100 :pointer hand))))) - (insert-image image)) ;; eval-last-sexp after previous )) - ) - - -(provide-me "realgud-") diff --git a/packages/realgud/realgud/common/bp.el b/packages/realgud/realgud/common/bp.el deleted file mode 100644 index 7b9365fac..000000000 --- a/packages/realgud/realgud/common/bp.el +++ /dev/null @@ -1,180 +0,0 @@ -;; Copyright (C) 2010, 2012-2015 Rocky Bernstein -;; Code associated with breakpoints - -(require 'image) -(require 'load-relative) -(require-relative-list '("loc" "bp-image-data") "realgud-") - -(defvar realgud-bp-enabled-icon nil - "Icon for an enabled breakpoint in display margin.") - -(defvar realgud-bp-disabled-icon nil - "Icon for a disabled breakpoint in display margin.") - -(defun realgud-bp-remove-icons (&optional opt-begin-pos opt-end-pos) - "Remove dbgr breakpoint icons (overlays) in the region -OPT-BEGIN-POS to OPT-END-POS. The default value for OPT-BEGIN-POS -is `point'. The default value for OPT-END-POS is OPT-BEGIN-POS. - -The way we determine if an overlay is ours is by inspecting the -overlay for a before-string property containing one we normally set. -" - (interactive "r") - (let* ((begin-pos (or opt-begin-pos (point))) - (end-pos (or opt-end-pos begin-pos)) - ) - (dolist (overlay (overlays-in begin-pos end-pos)) - ;; We determine if this overlay is one we set by seeing if the - ;; string in its 'before-string property has a 'realgud-bptno property - (let ((before-string (overlay-get overlay 'before-string))) - (when (and before-string (get-text-property 0 'realgud-bptno before-string)) - (delete-overlay overlay) - ) - ) - ) - ) - ) - -(defun realgud-set-bp-icons() - (if (display-images-p) - ;; NOTE: if you don't see the icon, check the that the window margin - ;; is not nil. - (progn - (setq realgud-bp-enabled-icon - (find-image `((:type xpm :data - ,realgud-bp-xpm-data - :ascent 100 :pointer hand) - (:type svg :data - ,realgud-bp-enabled-svg-data - :ascent 100 :pointer hand) - (:type tiff :data - ,realgud-bp-enabled-tiff-data - :ascent 100 :pointer hand) - (:type pbm :data - ,realgud-bp-enabled-pbm-data - :ascent 100 :pointer hand) - ))) - - ;; For seeing what realgud-bp-enabled-icon looks like: - ;; (insert-image realgud-bp-enabled-icon) - - (setq realgud-bp-disabled-icon - (find-image `((:type xpm :data - ,realgud-bp-xpm-data - :conversion disabled ;; different than 'enabled' - :ascent 100 :pointer hand) - (:type svg :data - ,realgud-bp-disabled-svg-data - :ascent 100 :pointer hand) - (:type tiff :data - ,realgud-bp-disabled-tiff-data - :ascent 100 :pointer hand) - (:type pbm :data - ,realgud-bp-disabled-pbm-data - :ascent 100 :pointer hand) - (:type svg :data - ,realgud-bp-disabled-svg-data - :ascent 100 :pointer hand) - ))) - ;; For seeing what realgud-bp-enabled-icon looks like: - ;; (insert-image realgud-bp-disabled-icon) - ) - (message "Display doesn't support breakpoint images in fringe") - ) - ) - - -(defun realgud-bp-put-icon (pos enabled bp-num &optional opt-buf) - "Add a breakpoint icon in the left margin at POS via a `put-image' overlay. -The alternate string name for the image is created from the value -of ENABLED and BP-NUM. In particular, if ENABLED is 't and -BP-NUM is 5 the overlay string is be 'B5:' If ENABLED is false -then the overlay string is 'b5:'. Breakpoint text properties are -also attached to the icon via its display string." - (let ((enabled-str) - (buf (or opt-buf (current-buffer))) - (bp-num-str - (cond - ((or (not bp-num) (not (numberp bp-num))) ":") - ('t (format "%d:" bp-num)))) - (brkpt-icon) - (bp-str) - (help-string "mouse-1: enable/disable bkpt") - ) - (with-current-buffer buf - (unless realgud-bp-enabled-icon (realgud-set-bp-icons)) - (if enabled - (progn - (setq enabled-str "B") - (setq brkpt-icon realgud-bp-enabled-icon) - ) - (progn - (setq enabled-str "b") - (setq brkpt-icon realgud-bp-disabled-icon) - )) - ;; Create alternate display string and attach - ;; properties it. - (setq bp-str (concat enabled-str bp-num-str)) - (add-text-properties - 0 1 `(realgud-bptno ,bp-num enabled ,enabled) bp-str) - (add-text-properties - 0 1 (list 'help-echo (format "%s %s" bp-str help-string)) - bp-str) - - ;; Display breakpoint icon or display string. If the window is - ;; nil, the image doesn't get displayed, so make sure it is large - ;; enough. - (let ((window (get-buffer-window (current-buffer) 0))) - (if window - (set-window-margins window 2) - ;; FIXME: This is all crap, but I don't know how to fix. - (let ((buffer-save (window-buffer (selected-window)))) - (set-window-buffer (selected-window) (current-buffer)) - (set-window-margins (selected-window) 2) - (set-window-buffer (selected-window) buffer-save)) - )) - (realgud-bp-remove-icons pos) - (if brkpt-icon - (put-image brkpt-icon pos bp-str 'left-margin)) - ) - ) - ) - -(defun realgud-bp-del-icon (pos &optional opt-buf) - "Delete breakpoint icon in the left margin at POS via a `put-image' overlay. -The alternate string name for the image is created from the value -of ENABLED and BP-NUM. In particular, if ENABLED is 't and -BP-NUM is 5 the overlay string is be 'B5:' If ENABLED is false -then the overlay string is 'b5:'. Breakpoint text properties are -also attached to the icon via its display string." - (let ((buf (or opt-buf (current-buffer)))) - (with-current-buffer buf - (realgud-bp-remove-icons pos) - ) - ) -) - -(defun realgud-bp-add-info (loc) - "Record bp information for location LOC." - (if (realgud-loc? loc) - (let* ((marker (realgud-loc-marker loc)) - (bp-num (realgud-loc-num loc)) - ) - (realgud-bp-put-icon marker 't bp-num) - ) - ) -) - -(defun realgud-bp-del-info (loc) - "Remove bp information for location LOC." - (if (realgud-loc? loc) - (let* ((marker (realgud-loc-marker loc)) - (bp-num (realgud-loc-num loc)) - ) - (realgud-bp-del-icon marker) - ) - ) -) - - -(provide-me "realgud-") diff --git a/packages/realgud/realgud/common/buffer/Makefile.am b/packages/realgud/realgud/common/buffer/Makefile.am deleted file mode 100644 index b881b440a..000000000 --- a/packages/realgud/realgud/common/buffer/Makefile.am +++ /dev/null @@ -1,3 +0,0 @@ -include $(top_srcdir)/common.mk - -lispdir = @lispdir_realgud@/common/buffer diff --git a/packages/realgud/realgud/common/buffer/backtrace.el b/packages/realgud/realgud/common/buffer/backtrace.el deleted file mode 100644 index 7eb11bd95..000000000 --- a/packages/realgud/realgud/common/buffer/backtrace.el +++ /dev/null @@ -1,460 +0,0 @@ -;;; Backtrace buffer -;;; Copyright (C) 2010-2015 Rocky Bernstein -(require 'load-relative) -(eval-when-compile (require 'cl-lib)) -(require-relative-list - '("../key" "helper" "follow" "loc") "realgud-") - -(require-relative-list - '("command") "realgud-buffer-") - -(declare-function realgud-cmdbuf-debugger-name 'realgud-buffer-command) -(declare-function realgud-cmdbuf? 'realgud-buffer-command) -(declare-function realgud-backtrace-mode (cmdbuf)) -(declare-function realgud:cmd-backtrace (arg)) -(declare-function realgud-cmdbuf-pat(key)) -(declare-function realgud-cmdbuf-info-in-srcbuf?= (arg)) -(declare-function realgud-get-cmdbuf 'realgud-buffer-helper) -(declare-function realgud:file-loc-from-line 'realgud-file) - -(defstruct realgud-backtrace-info - "debugger object/structure specific to a (top-level) program to be debugged." - (cmdbuf nil) ;; buffer of the associated debugger process - (cur-pos 0) ;; Frame we are at - frame-ring ;; ring of marks in buffer of frame numbers. The - ;; text at that marker has additional properties about the - ;; frame -) - -(declare-function realgud:cmd-frame 'realgud-buffer-command) -(declare-function realgud-get-cmdbuf(&optional opt-buffer)) -(declare-function realgud-command (fmt &optional arg no-record? - frame-switch? realgud-prompts?)) - -(make-variable-buffer-local (defvar realgud-backtrace-info)) - -;: FIXME: not picked up from track. Why? -(defvar realgud-track-divert-string nil) - -(defvar realgud-goto-entry-acc "") - -(defun realgud-get-buffer-base-name(string) - "Leading and ending * in string. For example: - *shell<2>* -> shell<2> - *foo shell* -> foo - buffer.c -> buffer.c" - (if (string-match "^[*]?\\([^*]+\\)[*]?$" string) - (let ((string-sans-stars (match-string 1 string))) - (if (string-match "\\(.+\\) shell" string-sans-stars) - (match-string 1 string-sans-stars) - string-sans-stars) - ) - string - ) -) - -(defun realgud:backtrace-describe (&optional buffer) - (interactive "") - (unless buffer (setq buffer (current-buffer))) - (with-current-buffer buffer - (let ((frames (realgud-backtrace-info-frame-ring realgud-backtrace-info)) - (frame) - (loc) - (i 0)) - (switch-to-buffer (get-buffer-create "*Describe*")) - (while (and (< i (ring-length frames)) (setq frame (ring-ref frames i))) - (insert (format "*** %d\n" i)) - (insert (format "%s\n" frame)) - (when (markerp frame) - (with-current-buffer (marker-buffer frame) - (goto-char frame) - (setq loc (get-text-property (point) 'loc)) - ) - (when loc (realgud:loc-describe loc))) - (setq i (1+ i)) - ) - ) - )) - -;; FIXME: create this in a new frame. -(defun realgud:backtrace-init () - (interactive) - (let ((buffer (current-buffer)) - (cmdbuf (realgud-get-cmdbuf)) - (process) - ) - (with-current-buffer-safe cmdbuf - (let ((frame-pat (realgud-cmdbuf-pat "debugger-backtrace")) - (indicator-re (or (realgud-cmdbuf-pat "selected-frame-indicator") - "->")) - (selected-frame-num) - (frame-pos-ring) - (sleep-count 0) - ) - (unless frame-pat - (error "No 'debugger-backtrace' regular expression recorded for debugger %s" - (realgud-cmdbuf-debugger-name))) - (setq process (get-buffer-process (current-buffer))) - (realgud-cmdbuf-info-in-srcbuf?= (not (realgud-cmdbuf? buffer))) - (realgud-cmdbuf-info-divert-output?= 't) - (setq realgud-track-divert-string nil) - (realgud:cmd-backtrace 0) - (while (and (eq 'run (process-status process)) - (null realgud-track-divert-string) - (> 1000 (setq sleep-count (1+ sleep-count)))) - (sleep-for 0.001) - ) - (if (>= sleep-count 1000) - (message "Timeout on running debugger command") - ;; else - ;; (message "+++4 %s" realgud-track-divert-string) - (let ((bt-buffer (get-buffer-create - (format "*Backtrace %s*" - (realgud-get-buffer-base-name - (buffer-name))))) - (divert-string realgud-track-divert-string) - ) - (realgud-cmdbuf-info-bt-buf= bt-buffer) - (with-current-buffer bt-buffer - (setq buffer-read-only nil) - (delete-region (point-min) (point-max)) - (if divert-string - (let* ((triple - (realgud:backtrace-add-text-properties - frame-pat cmdbuf indicator-re)) - (string-with-props - (ansi-color-filter-apply (car triple))) - (frame-num-pos-list (caddr triple)) - ) - (setq selected-frame-num (cadr triple)) - (insert string-with-props) - ;; add marks for each position - (realgud-backtrace-mode cmdbuf) - (setq frame-pos-ring - (make-ring (length frame-num-pos-list))) - (dolist (pos frame-num-pos-list) - (goto-char (1+ pos)) - (ring-insert-at-beginning frame-pos-ring (point-marker)) - ) - ) - ) - ;; realgud-backtrace-mode kills all local variables so - ;; we set this after. Alternatively change realgud-backtrace-mode. - (set (make-local-variable 'realgud-backtrace-info) - (make-realgud-backtrace-info - :cmdbuf cmdbuf - :frame-ring frame-pos-ring - )) - (if selected-frame-num - (realgud-backtrace-moveto-frame selected-frame-num)) - ) - ) - ) - ) - ) - (unless cmdbuf - (message "Unable to find debugger command buffer for %s" buffer)) - ) - ) - -(defun realgud-backtrace? ( &optional buffer) - "Return true if BUFFER is a debugger command buffer." - (with-current-buffer-safe - (or buffer (current-buffer)) - (realgud-backtrace-info-set?))) - - -(defalias 'realgud-backtrace-info? 'realgud-backtrace-info-p) - -(defun realgud-backtrace-info-set? () - "Return true if realgud-backtrace-info is set." - (and (boundp 'realgud-backtrace-info) - realgud-backtrace-info - (realgud-backtrace-info? realgud-backtrace-info))) - - -(defun realgud-backtrace-moveto-frame-selected () - "Set point to the selected frame." - (interactive) - (if (realgud-backtrace?) - (let* ((cur-pos (realgud-sget 'backtrace-info 'cur-pos)) - (ring-size (ring-size (realgud-sget 'backtrace-info 'frame-ring))) - ) - (if (and cur-pos (> ring-size 0)) - (realgud-backtrace-moveto-frame cur-pos) - ;else - (message "No frame information recorded") - ) - ) - ) - ) - -(defun realgud-backtrace-moveto-frame (num &optional opt-buffer) - (if (integerp num) - (if (realgud-backtrace?) - (let* ((ring (realgud-sget 'backtrace-info 'frame-ring)) - (marker (ring-ref ring num))) - (setf (realgud-backtrace-info-cur-pos realgud-backtrace-info) num) - (goto-char marker) - ) - ) - ; else - (message "frame number %s is not an integer" num) - ) - ) - -(defun realgud-backtrace-moveto-frame-next () - "Set point to the next frame. If we are at the end, wrap to the -beginning. Note that we are just moving in the backtrace buffer, -not updating the frame stack." - (interactive) - (if (realgud-backtrace?) - (let* ((cur-pos (realgud-sget 'backtrace-info 'cur-pos)) - (ring-size (ring-size (realgud-sget 'backtrace-info 'frame-ring))) - ) - (if (and cur-pos (> ring-size 0)) - (realgud-backtrace-moveto-frame (ring-plus1 cur-pos ring-size)) - ;else - (message "No frame information recorded") - ) - ) - ) - ) - -(defun realgud-backtrace-moveto-frame-prev () - "Set point to the next frame. If we are at the beginning, wrap to the -end. Note that we are just moving in the backtrace buffer, -not updating the frame stack." - (interactive) - (if (realgud-backtrace?) - (let* ((cur-pos (realgud-sget 'backtrace-info 'cur-pos)) - (ring-size (ring-size (realgud-sget 'backtrace-info 'frame-ring))) - ) - (if (and cur-pos (> ring-size 0)) - (realgud-backtrace-moveto-frame (ring-minus1 cur-pos ring-size)) - ;else - (message "No frame information recorded") - ) - ) - ) - ) - -(defun realgud-goto-frame-n-internal (keys) - (if (and (stringp keys) - (= (length keys) 1)) - (progn - (setq realgud-goto-entry-acc (concat realgud-goto-entry-acc keys)) - ;; Try to find the longest suffix. - (let ((acc realgud-goto-entry-acc)) - (while (not (string= acc "")) - (if (not (realgud-goto-entry-try acc)) - (setq acc (substring acc 1)) - (realgud:cmd-frame (string-to-number acc)) - ;; Break loop. - (setq acc ""))))) - (message "`realgud-goto-frame-n' must be bound to a number key"))) - -;; FIXME: replace with ring. -(defun realgud-goto-entry-try (str) - "See if there is an entry with number STR. If not return nil." - (goto-char (point-min)) - (if (re-search-forward (concat "^[^0-9]*\\(" str "\\)[^0-9]") nil t) - (progn - (goto-char (match-end 1)) - t) - nil)) - - -;; The following is split in two to facilitate debugging. -(defun realgud-goto-entry-n-internal (keys) - (if (and (stringp keys) - (= (length keys) 1)) - (progn - (setq realgud-goto-entry-acc (concat realgud-goto-entry-acc keys)) - ;; Try to find the longest suffix. - (let ((acc realgud-goto-entry-acc) - (p (point))) - (while (not (string= acc "")) - (if (not (realgud-goto-entry-try acc)) - (setq acc (substring acc 1)) - (setq p (point)) - ;; Break loop. - (setq acc ""))) - (goto-char p))) - (message "`realgud-goto-entry-n' must be bound to a number key"))) - - -(defun realgud-goto-entry-n () - "Go to an entry number. - -Breakpoints, Display expressions and Stack Frames all have -numbers associated with them which are distinct from line -numbers. In a secondary buffer, this function is usually bound to -a numeric key which will position you at that entry number. To -go to an entry above 9, just keep entering the number. For -example, if you press 1 and then 9, you should jump to entry -1 (if it exists) and then 19 (if that exists). Entering any -non-digit will start entry number from the beginning again." - (interactive) - (if (not (eq last-command 'realgud-goto-entry-n)) - (setq realgud-goto-entry-acc "")) - (realgud-goto-entry-n-internal (this-command-keys))) - -(defun realgud-goto-frame () - "Go to the frame number. We get the frame number from the -'frame-num property" - (interactive) - (if (realgud-backtrace?) - (let ((frame-num (get-text-property (point) 'frame-num))) - (if frame-num - (realgud:cmd-frame frame-num) - (message "No frame property found at this point") - ) - ) - ) - ) - -(defun realgud-goto-frame-1 () - "Go to the frame 1" - (interactive) - (if (realgud-backtrace?) - (realgud:cmd-frame 1) - ) - ) - -(defun realgud-goto-frame-2 () - "Go to the frame 2" - (interactive) - (if (realgud-backtrace?) - (realgud:cmd-frame 2) - ) - ) - -(defun realgud-goto-frame-3 () - "Go to the frame 3" - (interactive) - (if (realgud-backtrace?) - (realgud:cmd-frame 3) - ) - ) - -(defun realgud-goto-frame-mouse (event) - (interactive "e") - (let* ((pos (posn-point (event-end event))) - (frame-num (get-text-property pos 'frame-num))) - (if (realgud-backtrace?) - (if frame-num - (realgud:cmd-frame frame-num) - (message "No frame property found at this point") - ) - ) - ) -) - -(defun realgud-goto-frame-n () - "Go to the frame number indicated by the accumulated numeric keys just entered. - -This function is usually bound to a numeric key in a 'frame' -secondary buffer. To go to an entry above 9, just keep entering -the number. For example, if you press 1 and then 9, frame 1 is selected -\(if it exists) and then frame 19 (if that exists). Entering any -non-digit will start entry number from the beginning again." - (interactive) - (if (not (eq last-command 'realgud-goto-frame-n)) - (setq realgud-goto-entry-acc "")) - (realgud-goto-frame-n-internal (this-command-keys))) - -(defun realgud:backtrace-add-text-properties(frame-pat cmdbuf &optional opt-string - frame-indicator-re) - "Parse OPT-STRING or the current buffer and add frame properties: frame number, -filename, line number, whether the frame is selected as text properties." - - (let* ((string (or opt-string - (buffer-substring (point-min) (point-max)) - )) - (stripped-string (ansi-color-filter-apply string)) - (frame-regexp (realgud-loc-pat-regexp frame-pat)) - (frame-group-pat (realgud-loc-pat-num frame-pat)) - (file-group-pat (realgud-loc-pat-file-group frame-pat)) - (line-group-pat (realgud-loc-pat-line-group frame-pat)) - (alt-frame-num -1) - (last-pos 0) - (selected-frame-num nil) - (frame-num-pos-list '()) - ) - (while (string-match frame-regexp stripped-string last-pos) - (let ((frame-num-str) (frame-num) (line-num) (filename) - ;; FIXME: Remove hack that group 1 is always the frame indicator. - (frame-indicator - (substring stripped-string (match-beginning 1) (match-end 1))) - (frame-num-pos) - - ) - (if frame-group-pat - (progn - (setq frame-num-str - (substring stripped-string - (match-beginning frame-group-pat) - (match-end frame-group-pat))) - (setq frame-num (string-to-number frame-num-str)) - (setq frame-num-pos (match-beginning frame-group-pat)) - (add-to-list 'frame-num-pos-list frame-num-pos 't) - (add-text-properties (match-beginning frame-group-pat) - (match-end frame-group-pat) - (list 'mouse-face 'highlight - 'help-echo "mouse-2: goto this frame" - 'frame frame-num) - string) - ) - ; else - (progn - (setq frame-num-str - (substring stripped-string (match-beginning 0) - (match-end 0))) - (setq frame-num (incf alt-frame-num)) - (setq frame-num-pos (match-beginning 0)) - (add-to-list 'frame-num-pos-list frame-num-pos 't) - (add-text-properties (match-beginning 0) (match-end 0) - (list 'mouse-face 'highlight - 'help-echo "mouse-2: goto this frame" - 'frame frame-num) - string) - ) - ) - (when file-group-pat - (setq filename (substring stripped-string - (match-beginning file-group-pat) - (match-end file-group-pat))) - (add-text-properties (match-beginning file-group-pat) - (match-end file-group-pat) - (list 'mouse-face 'highlight - 'help-echo "mouse-2: goto this file" - 'action 'realgud:follow-event - 'file filename) - string) - ) - (when line-group-pat - (let ((line-num-str (substring stripped-string - (match-beginning line-group-pat) - (match-end line-group-pat)))) - (setq line-num (string-to-number (or line-num-str "1"))) - )) - - (when (and (stringp filename) (numberp line-num)) - (let ((loc (realgud:file-loc-from-line filename line-num cmdbuf))) - (put-text-property (match-beginning 0) (match-end 0) - 'loc loc string) - )) - (put-text-property (match-beginning 0) (match-end 0) - 'frame-num frame-num string) - (setq last-pos (match-end 0)) - - (if (string-match frame-indicator-re frame-indicator) - (setq selected-frame-num frame-num)) - )) - - (list string selected-frame-num frame-num-pos-list) - ) - ) - -(provide-me "realgud-buffer-") diff --git a/packages/realgud/realgud/common/buffer/command.el b/packages/realgud/realgud/common/buffer/command.el deleted file mode 100644 index fc9791a6d..000000000 --- a/packages/realgud/realgud/common/buffer/command.el +++ /dev/null @@ -1,362 +0,0 @@ -;;; process-command buffer things -;;; Copyright (C) 2010-2012, 2014-2015 Rocky Bernstein - -(require 'load-relative) -(require 'json) -(require-relative-list - '("../fringe" "../loc" "../lochist" "../regexp") "realgud-") -(require-relative-list '("info") "realgud-buffer-") - -(declare-function realgud-get-cmdbuf 'realgud-buffer-helper) - -(eval-when-compile - (byte-compile-disable-warning 'cl-functions) - ;; Somehow disabling cl-functions causes the erroneous message: - ;; Warning: the function `reduce' might not be defined at runtime. - ;; FIXME: isolate, fix and/or report back to Emacs developers a bug - (byte-compile-disable-warning 'unresolved) - (defvar realgud-cmdbuf-info) - ) -(require 'cl-lib) - -(defface debugger-running - '((((class color) (min-colors 16) (background light)) - (:foreground "Green4" :weight bold)) - (((class color) (min-colors 88) (background dark)) - (:foreground "Green1" :weight bold)) - (((class color) (min-colors 16) (background dark)) - (:foreground "Green" :weight bold)) - (((class color)) (:foreground "green" :weight bold)) - (t (:weight bold))) - "Face used to highlight debugger run information." - :group 'realgud - :version "24.1") - -(defface debugger-not-running - '((t :inherit font-lock-warning-face)) - "Face used when debugger or process is not running." - :group 'realgud - :version "24.1") - - -(defstruct realgud-cmdbuf-info - "The debugger object/structure specific to a process buffer." - debugger-name ;; Name of debugger - cmd-args ;; Command-line invocation arguments - frame-switch? ;; Should the selected window be the source buffer or - ;; command buffer? - in-srcbuf? ;; If true, selected window should be the source buffer. - ;; Otherwise, the command buffer? - last-input-end ;; point where input last ended. Set from - ;; comint-last-input-end - prior-prompt-regexp ;; regular expression prompt (e.g. - ;; comint-prompt-regexp) *before* setting - ;; loc-regexp - no-record? ;; Should we update the location history? - in-debugger? ;; True if we think we are in a debugger - src-shortkey? ;; Are source buffers in realgud-short-key mode? - regexp-hash ;; hash table of regular expressions appropriate for - ;; this debugger. Eventually loc-regexp, file-group - ;; and line-group below will removed and stored here. - srcbuf-list ;; list of source buffers we have stopped at - bt-buf ;; backtrace buffer if it exists - bp-list ;; list of breakpoints - divert-output? ;; Output is part of a conversation between front-end - ;; debugger. - cmd-hash ;; Allows us to remap command names like - ;; quit => quit! - callback-loc-fn ;; If we need, as in the case of Java, to do - ;; special handling to map output to a file - ;; location, this is set to that special - ;; function - - ;; FIXME: REMOVE THIS and use regexp-hash - loc-regexp ;; Location regular expression string - file-group - line-group - text-group - ignore-file-re - - loc-hist ;; ring of locations seen in the course of execution - ;; see realgud-lochist -) -(make-variable-buffer-local 'realgud-cmdbuf-info) -(make-variable-buffer-local 'realgud-last-output-start) - -(defalias 'realgud-cmdbuf-info? 'realgud-cmdbuf-info-p) - -;; FIXME: figure out how to put in a loop. -(realgud-struct-field-setter "realgud-cmdbuf-info" "bp-list") -(realgud-struct-field-setter "realgud-cmdbuf-info" "bt-buf") -(realgud-struct-field-setter "realgud-cmdbuf-info" "cmd-args") -(realgud-struct-field-setter "realgud-cmdbuf-info" "last-input-end") -(realgud-struct-field-setter "realgud-cmdbuf-info" "divert-output?") -(realgud-struct-field-setter "realgud-cmdbuf-info" "frame-switch?") -(realgud-struct-field-setter "realgud-cmdbuf-info" "in-srcbuf?") -(realgud-struct-field-setter "realgud-cmdbuf-info" "no-record?") -(realgud-struct-field-setter "realgud-cmdbuf-info" "prior-prompt-regexp") -(realgud-struct-field-setter "realgud-cmdbuf-info" "src-shortkey?") -(realgud-struct-field-setter "realgud-cmdbuf-info" "in-debugger?") -(realgud-struct-field-setter "realgud-cmdbuf-info" "callback-loc-fn") - -(defun realgud:cmdbuf-follow-buffer(event) - (interactive "e") - (let* ((pos (posn-point (event-end event))) - (buffer (get-text-property pos 'buffer))) - (find-file-other-window (buffer-file-name buffer)))) - -(defun realgud:cmdbuf-buffers-describe (buffer-list) - (insert "** Source Buffers Seen\n") - (dolist (buffer buffer-list) - (insert " - ") - (put-text-property - (insert-text-button - (buffer-name buffer) - 'action 'realgud:cmdbuf-follow-buffer - 'help-echo "mouse-2: visit this file") - (point) - 'buffer buffer) - (insert "\n") - )) - -(defun realgud:cmdbuf-info-describe (&optional buffer) - "Display realgud-cmdcbuf-info fields of BUFFER. -BUFFER is either a debugger command or source buffer. If BUFFER is not given -the current buffer is used as a starting point. -Information is put in an internal buffer called *Describe*." - (interactive "") - (setq buffer (realgud-get-cmdbuf buffer)) - (if buffer - (with-current-buffer buffer - (let ((info realgud-cmdbuf-info) - (cmdbuf-name (buffer-name))) - (switch-to-buffer (get-buffer-create "*Describe*")) - (setq buffer-read-only 'nil) - (delete-region (point-min) (point-max)) - (insert "#+STARTUP: showall\n") - ;;(insert "#+OPTIONS: H:2 num:nil toc:t \\n:nil ::t |:t ^:nil -:t f:t *:t tex:t d:(HIDE) tags:not-in-toc\n") - (insert (format "#+TITLE: Debugger info for %s\n" cmdbuf-name)) - (insert "** General Information\n") - (mapc 'insert - (list - (format " - Debugger name ::\t%s\n" - (json-encode (realgud-cmdbuf-info-debugger-name info))) - (format " - Command-line args ::\t%s\n" - (json-encode (realgud-cmdbuf-info-cmd-args info))) - (format " - Selected window should contain source? :: %s\n" - (realgud-cmdbuf-info-in-srcbuf? info)) - (format " - Last input end ::\t%s\n" - (realgud-cmdbuf-info-last-input-end info)) - (format " - Source should go into short-key mode? :: %s\n" - (realgud-cmdbuf-info-src-shortkey? info)) - (format " - Breakpoint list ::\t %s\n" - (realgud-cmdbuf-info-bp-list info)) - (format " - Remap table for debugger commands ::\n\t%s\n" - (json-encode (realgud-cmdbuf-info-cmd-hash info))) - (format " - Backtrace buffer ::\t%s\n" - (realgud-cmdbuf-info-bt-buf info)) - (format " - In debugger? ::\t%s\n" - (realgud-cmdbuf-info-in-debugger? info)) - )) - (insert "\n") - (realgud:cmdbuf-buffers-describe (realgud-cmdbuf-info-srcbuf-list info)) - (insert "\n") - (realgud:loc-hist-describe (realgud-cmdbuf-info-loc-hist info)) - (goto-char (point-min)) - (realgud:info-mode) - ) - ) - (message "Buffer %s is not a debugger source or command buffer; nothing done." - (or buffer (current-buffer))) - ) - ) - -(defun realgud-cmdbuf? (&optional buffer) - "Return true if BUFFER is a debugger command buffer." - (with-current-buffer-safe - (or buffer (current-buffer)) - (realgud-cmdbuf-info-set?))) - -(defun realgud-cmdbuf-info-set? () - "Return true if realgud-cmdbuf-info is set." - (and (boundp 'realgud-cmdbuf-info) - realgud-cmdbuf-info - (realgud-cmdbuf-info? realgud-cmdbuf-info))) - -(defun realgud-cmdbuf-toggle-in-debugger? (&optional buffer) - "Toggle state of whether we think we are in the debugger or not" - (interactive "") - (setq buffer (realgud-get-cmdbuf buffer)) - (if buffer - (with-current-buffer buffer - (realgud-cmdbuf-info-in-debugger?= - (not (realgud-sget 'cmdbuf-info 'in-debugger?))) - (message "Command buffer is in debugger?: %s\n" - (realgud-cmdbuf-info-in-debugger? realgud-cmdbuf-info)) - (realgud-cmdbuf-mode-line-update) - ) - (message "Buffer %s is not a debugger buffer; nothing done." - (or buffer (current-buffer))) - ) - ) - -(defun realgud-cmdbuf-stay-in-source-toggle (&optional buffer) - "Toggle state of whether we should stay in source code or not" - (interactive "") - (setq buffer (realgud-get-cmdbuf buffer)) - (if buffer - (with-current-buffer buffer - (realgud-cmdbuf-info-in-srcbuf?= - (not (realgud-sget 'cmdbuf-info 'in-srcbuf?))) - (message "Selected window should contain source?: %s\n" - (realgud-cmdbuf-info-in-srcbuf? realgud-cmdbuf-info)) - ) - (message "Buffer %s is not a debugger buffer; nothing done." - (or buffer (current-buffer))) - ) - ) - -(defun realgud-cmdbuf-add-srcbuf(srcbuf &optional cmdbuf) - "Add SRCBUF to srcbuf-list field of INFO unless it is already included." - (setq cmdbuf (or cmdbuf (current-buffer))) - (if (realgud-cmdbuf? cmdbuf) - (with-current-buffer-safe cmdbuf - (unless (memq srcbuf (realgud-cmdbuf-info-srcbuf-list realgud-cmdbuf-info)) - (setf (realgud-cmdbuf-info-srcbuf-list realgud-cmdbuf-info) - (cons srcbuf (realgud-cmdbuf-info-srcbuf-list realgud-cmdbuf-info)))) - ) - ) - ) - -(defun realgud-cmdbuf-set-shortkey(&optional cmdbuf unset) - (interactive "") - (setq cmdbuf (or cmdbuf (current-buffer))) - (if (realgud-cmdbuf? cmdbuf) - (with-current-buffer-safe cmdbuf - (setf (realgud-cmdbuf-info-src-shortkey? realgud-cmdbuf-info) (not unset)) - (message "Set source to shortkey is now %s" (not unset)) - )) - ) - -(defun realgud-cmdbuf-command-string(cmd-buffer) - "Get the command string invocation for this command buffer" - (cond - ((realgud-cmdbuf? cmd-buffer) - (with-current-buffer cmd-buffer - (let* - ((cmd-args (realgud-sget 'cmdbuf-info 'cmd-args)) - (result (car cmd-args))) - (and cmd-args - (reduce (lambda(result x) - (setq result (concat result " " x))) - cmd-args))))) - (t nil))) - -;; FIXME cmd-hash should not be optional. And while I am at it, remove -;; parameters loc-regexp, file-group, and line-group which can be found -;; inside pat-hash -;; -;; To do this however we need to fix up the caller -;; realgud:track-set-debugger by changing realgud-pat-hash to store a hash -;; rather than the loc, file, and line fields; those fields then get -;; removed. - -(defun realgud-cmdbuf-init - (cmd-buf debugger-name regexp-hash &optional cmd-hash) - "Initialize CMD-BUF for a working with a debugger. -DEBUGGER-NAME is the name of the debugger; REGEXP-HASH are debugger-specific -values set in the debugger's init.el." - (with-current-buffer-safe cmd-buf - (let ((realgud-loc-pat (gethash "loc" regexp-hash)) - (font-lock-keywords) - ) - (setq realgud-cmdbuf-info - (make-realgud-cmdbuf-info - :in-srcbuf? nil - :debugger-name debugger-name - :loc-regexp (realgud-sget 'loc-pat 'regexp) - :file-group (realgud-sget 'loc-pat 'file-group) - :line-group (realgud-sget 'loc-pat 'line-group) - :text-group (realgud-sget 'loc-pat 'text-group) - :ignore-file-re (realgud-sget 'loc-pat 'ignore-file-re) - :loc-hist (make-realgud-loc-hist) - :regexp-hash regexp-hash - :bt-buf nil - :last-input-end (point-max) - :cmd-hash cmd-hash - :src-shortkey? 't - :in-debugger? nil - :callback-loc-fn (gethash "loc-callback-fn" regexp-hash) - )) - (setq font-lock-keywords (realgud-cmdbuf-pat "font-lock-keywords")) - (if font-lock-keywords - (set (make-local-variable 'font-lock-defaults) - (list font-lock-keywords))) - ) - - (put 'realgud-cmdbuf-info 'variable-documentation - "Debugger object for a process buffer.")) - ) - -(defun realgud-cmdbuf-debugger-name (&optional cmd-buf) - "Return the debugger name recorded in the debugger command-process buffer." - (with-current-buffer-safe (or cmd-buf (current-buffer)) - (if (realgud-cmdbuf?) - (realgud-sget 'cmdbuf-info 'debugger-name) - nil)) - ) - -(defun realgud-cmdbuf-pat(key) - "Extract regexp stored under KEY in a realgud-cmdbuf via realgud-cmdbuf-info" - (if (realgud-cmdbuf?) - (let* - ((debugger-name (realgud-cmdbuf-debugger-name)) - (regexp-hash (gethash debugger-name realgud-pat-hash)) - (loc-pat (gethash key regexp-hash))) - loc-pat) - nil)) - -(defun realgud-cmdbuf-loc-hist(cmd-buf) - "Return the history ring of locations that a debugger -command-process buffer has stored." - (with-current-buffer-safe cmd-buf - (realgud-sget 'cmdbuf-info 'loc-hist)) -) - -(defun realgud-cmdbuf-src-marker(cmd-buf) - "Return a marker to current source location stored in the history ring." - (with-current-buffer cmd-buf - (lexical-let* ((loc (realgud-loc-hist-item (realgud-cmdbuf-loc-hist cmd-buf)))) - (and loc (realgud-loc-marker loc))))) - -(defun realgud-cmdbuf-mode-line-update (&optional opt-cmdbuf) - "Force update of command buffer to include process status" - (let ((cmdbuf (realgud-get-cmdbuf opt-cmdbuf)) - (debug-status) - (status) - (cmd-process) - ) - (if (and cmdbuf (buffer-name cmdbuf)) - (with-current-buffer cmdbuf - (setq cmd-process (get-buffer-process cmdbuf)) - (setq debug-status - (if (realgud-sget 'cmdbuf-info 'in-debugger?) - " debugger" - "")) - (setq status - (if cmd-process - (list (propertize - (format ":%s%s" - (process-status cmd-process) debug-status) - 'face 'debugger-running)) - (list (propertize ":not running" 'face - 'debugger-not-running)) - )) - (setq mode-line-process status) - ;; Force mode line redisplay soon. - (force-mode-line-update)) - )) - ) - - -(provide-me "realgud-buffer-") diff --git a/packages/realgud/realgud/common/buffer/helper.el b/packages/realgud/realgud/common/buffer/helper.el deleted file mode 100644 index 1c4703552..000000000 --- a/packages/realgud/realgud/common/buffer/helper.el +++ /dev/null @@ -1,168 +0,0 @@ -;; Copyright (C) 2010, 2014 Rocky Bernstein -(require 'load-relative) -(require-relative-list '("../fringe" "../helper" "../lochist") - "realgud-") -(require-relative-list '("command" "source" "backtrace") "realgud-buffer-") - -(declare-function realgud-backtrace? 'realgud-buffer-backtace) -(declare-function realgud-cmdbuf? 'realgud-buffer-command) -(declare-function realgud:loc-hist-describe 'realgud-lochist) -(declare-function realgud-loc-hist-item 'realgud-lochist) -(declare-function realgud-srcbuf? 'realgud-buffer-command) -(declare-function buffer-killed? 'realgud-helper) - -(defvar realgud-cmdbuf-info) - -(defun realgud-get-cmdbuf-from-backtrace ( &optional opt-buffer) - "Return the command buffer associated with source -OPT-BUFFER or if that is ommited `current-buffer' which is -assumed to be a source-code buffer." - (let ((buffer (or opt-buffer (current-buffer)))) - (if (realgud-backtrace? buffer) - (with-current-buffer-safe buffer - (realgud-sget 'backtrace-info 'cmdbuf)) - nil))) - -(defun realgud-get-cmdbuf-from-srcbuf ( &optional opt-buffer) - "Return the command buffer associated with source -OPT-BUFFER or if that is ommited `current-buffer' which is -assumed to be a source-code buffer." - (let ((buffer (or opt-buffer (current-buffer)))) - (if (realgud-srcbuf? buffer) - (with-current-buffer-safe buffer - (realgud-sget 'srcbuf-info 'cmdproc)) - nil))) - -(defun realgud-get-srcbuf-from-cmdbuf ( &optional opt-buffer opt-loc) - "Return the source-code buffer associated with command -OPT-BUFFER or if that is ommited `current-buffer' which is -assumed to be a process-command buffer." - (let ((buffer (or opt-buffer (current-buffer)))) - (if (realgud-cmdbuf? buffer) - (with-current-buffer-safe buffer - (let ((loc - (or opt-loc - (realgud-loc-hist-item - (realgud-cmdbuf-info-loc-hist realgud-cmdbuf-info))))) - (if loc - (marker-buffer (realgud-loc-marker loc)) - nil) - )) - nil))) - -(defun realgud-get-srcbuf( &optional opt-buffer opt-loc) - "Return source-code buffer associated with OPT-BUFFER or -`current-buffer' if that is omitted. nil is returned if we don't -find anything. If we started out with a buffer that is set up to -be a source-code buffer we will use that even though it might not -be the source code buffer for the frame that the debugger is -using. See also `realgud-get-current-srcbuf'." - - (let ((buffer (or opt-buffer (current-buffer)))) - (with-current-buffer-safe buffer - (cond - ;; Perhaps buffer is a source source-code buffer? - ((realgud-srcbuf? buffer) buffer) - ;; Perhaps buffer is a process-command buffer. - ((realgud-cmdbuf? buffer) - (realgud-get-srcbuf-from-cmdbuf buffer opt-loc)) - (t nil))))) - -(defun realgud-get-current-srcbuf( &optional opt-buffer) - "Return the source-code buffer associated with OPT-BUFFER -or `current-buffer' if that is omitted. nil is returned -if we don't find anything." - - (let ((buffer (or opt-buffer (current-buffer)))) - (with-current-buffer-safe buffer - (let ((cmdbuf - (cond - ((realgud-srcbuf? buffer) - (realgud-get-cmdbuf-from-srcbuf buffer)) - ((realgud-cmdbuf? buffer) - buffer) - (t nil)))) - (if cmdbuf - (realgud-get-srcbuf-from-cmdbuf cmdbuf) - nil))))) - -(defun realgud-get-cmdbuf( &optional opt-buffer) - "Return the command buffer associated with OPT-BUFFER -or `current-buffer' if that is omitted. nil is returned -if we don't find anything." - - (let ((buffer (or opt-buffer (current-buffer)))) - (with-current-buffer-safe buffer - (cond - ;; Perhaps buffer is a process-command buffer? - ((realgud-cmdbuf? buffer) buffer) - ;; Perhaps buffer is a source-code buffer? - ((realgud-srcbuf? buffer) - (realgud-get-cmdbuf-from-srcbuf buffer)) - ;; Perhaps buffer is a backtrace buffer? - ((realgud-backtrace? buffer) - (realgud-get-cmdbuf-from-backtrace buffer)) - (t nil))))) - -(defun realgud-get-backtrace-buf( &optional opt-buffer) - "Return the backtrace buffer associated with -OPT-BUFFER or if that is ommited `current-buffer'." - (let* ((buffer (or opt-buffer (current-buffer))) - (cmdbuf (realgud-get-cmdbuf buffer))) - (with-current-buffer-safe cmdbuf - (realgud-sget 'cmdbuf-info 'bt-buf) - )) - ) - -(defun realgud-get-process (&optional opt-buffer) - "Return the process buffer associated with OPT-BUFFER or - `current-buffer' if that is omitted. nil is returned if -we don't find anything." - (let* ((buffer (or opt-buffer (current-buffer))) - (cmdbuf (realgud-get-cmdbuf buffer))) - (if cmdbuf - (get-buffer-process cmdbuf) - nil) - ) -) - -(defun realgud:srcbuf-info-describe (&optional buffer) - "Provide descriptive information of the buffer-local variable -`realgud-srcbuf-info', a defstruct. BUFFER if given is the buffer to -use to get the information from. -" - (interactive "") - (setq buffer (realgud-get-srcbuf buffer)) - (if buffer - (with-current-buffer buffer - (let ((info realgud-srcbuf-info) - (srcbuf-name (buffer-name)) - (a1 realgud-overlay-arrow1) - (a2 realgud-overlay-arrow2) - (a3 realgud-overlay-arrow3) - ) - (switch-to-buffer (get-buffer-create "*Describe*")) - (delete-region (point-min) (point-max)) - (mapc 'insert - (list - (format "srcbuf-info for %s\n" srcbuf-name) - (format "Was previously read only?: %s\n" - (realgud-srcbuf-info-was-read-only? info)) - (format "Command Process buffer: %s\n" - (realgud-srcbuf-info-cmdproc info)) - - ;; FIXME This info isn't part of the src info structure. - (format "Overlay arrow 1: %s\n" a1) - (format "Overlay arrow 2: %s\n" a2) - (format "Overlay arrow 3: %s\n" a3) - (format "Location history:\n") - )) - (realgud:loc-hist-describe (realgud-srcbuf-info-loc-hist info)) - ) - ) - (message "Buffer %s is not a debugger source buffer; nothing done." - (or buffer (current-buffer))) - ) - ) - -(provide-me "realgud-buffer-") diff --git a/packages/realgud/realgud/common/buffer/info.el b/packages/realgud/realgud/common/buffer/info.el deleted file mode 100644 index 328a4780b..000000000 --- a/packages/realgud/realgud/common/buffer/info.el +++ /dev/null @@ -1,50 +0,0 @@ -;;; Copyright (C) 2015 Rocky Bernstein -;;; -;;; A mode based off of org mode to show debugger information - -(eval-when-compile (require 'cl)) -(require 'org) - -(require 'load-relative) - -(defstruct realgud-backtrace-info - "debugger object/structure specific to debugger info." - (cmdbuf nil) ;; buffer of the associated debugger process -) - -;; Can't load because this causes a cyclic dependency on -;; buffer/commands via cmd and buffer/commands uses us. -;; (require-relative-list '("menu") "realgud-") - -;; FIXME: full definition is in menu. -(defvar realgud:info-mode-map) - -(defcustom realgud:info-mode-hook '() - "Hook for customizing realgud info mode." - :type 'hook - :group 'realgud) - - -(define-derived-mode realgud:info-mode org-mode "Debugger Info" - "Major mode for interacting realgud debugger information." - (use-local-map realgud:info-mode-map) - (setq buffer-read-only 't) - ) - -;; FIXME: -;; (defvar realgud:info-mode-map -;; (realgud-populate-debugger-menu -;; (make-sparse-keymap "Debugger"))) - -;; (define-key realgud:info-mode-map [menu-bar debugger] -;; (cons "Debugger" (realgud-populate-debugger-menu -;; (make-sparse-keymap "Debugger")))) - -;; (define-key realgud:info-mode-map [menu-bar debugger backtrace] -;; '("Backtrace" . realgud:window-bt)) -;;(define-key realgud:info-mode-map [menu-bar debugger command] -;; '("Go to Command Buffer" . realgud-window-cmd-undisturb-src)) -;;(define-key realgud:info-mode-map [menu-bar debugger source] -;; '("Go to Source Buffer" . realgud-window-src-undisturb-cmd)) - -(provide-me "realgud-buffer-") diff --git a/packages/realgud/realgud/common/buffer/source.el b/packages/realgud/realgud/common/buffer/source.el deleted file mode 100644 index 7294bbab2..000000000 --- a/packages/realgud/realgud/common/buffer/source.el +++ /dev/null @@ -1,169 +0,0 @@ -;;; Copyright (C) 2010, 2012-2015 Rocky Bernstein -;;; source-code buffer code -(eval-when-compile - (require 'cl-lib) - (defvar realgud-srcbuf-info) ;; is buffer local - (defvar realgud-cmdbuf-info) ;; in the cmdbuf, this is buffer local - ) - -(require 'load-relative) -(require-relative-list '("../helper" "../key") "realgud-") - -(declare-function realgud-populate-common-keys 'realgud-menu) -(declare-function buffer-killed? 'realgud-helper) -(declare-function buffer-loc-line-number? 'realgud-loc) -(declare-function realgud-cmdbuf-add-srcbuf 'realgud-cmdbuf) -(declare-function realgud-cmdbuf-info-bp-list 'realgud-cmdbuf) -(declare-function realgud-loc-marker 'realgud-loc) -(declare-function realgud-loc-line-number 'realgud-loc) -(declare-function realgud-loc-num 'realgud-loc) -(declare-function make-realgud-loc-hist 'realgud-lochist) -(declare-function realgud-get-srcbuf 'helper) -(declare-function realgud-short-key-mode-setup 'realgud-shortkey) - -(defstruct realgud-srcbuf-info - "debugger object/structure specific to a (top-level) source program -to be debugged." - cmdproc ;; buffer of the associated debugger process - cur-pos ;; If not nil, the debugger thinks we are currently - ;; positioned at a corresponding place in the - ;; program. - short-key? ;; Was the source buffer previously in short-key - ;; mode? Used to deterimine when short-key mode - ;; changes state in a source buffer, so we need to - ;; perform on/off actions. - was-read-only? ;; Was buffer initially read only? (i.e. the original - ;; value of the buffer's buffer-read-only - ;; variable. Short-key-mode may change the read-only - ;; state, so we need restore this value when leaving - ;; short-key mode - - loc-hist ;; ring of locations seen - - ;; FILL IN THE FUTURE - ;;(brkpt-alist '()) ;; alist of breakpoints the debugger has referring - ;; to this buffer. Each item is (brkpt-name . marker) - ;; -) - - -(defalias 'realgud-srcbuf-info? 'realgud-srcbuf-p) - -;; FIXME: figure out how to put in a loop. -(realgud-struct-field-setter "realgud-srcbuf-info" "cmdproc") -(realgud-struct-field-setter "realgud-srcbuf-info" "short-key?") -(realgud-struct-field-setter "realgud-srcbuf-info" "was-read-only?") - -(defun realgud-srcbuf-info-set? () - "Return true if `realgud-srcbuf-info' is set." - (and (boundp 'realgud-srcbuf-info) - realgud-srcbuf-info - (realgud-srcbuf-info? realgud-srcbuf-info))) - -(defun realgud-srcbuf? (&optional buffer) - "Return true if BUFFER is a debugger source buffer." - (with-current-buffer-safe (or buffer (current-buffer)) - (and (realgud-srcbuf-info-set?) - (not (buffer-killed? (realgud-sget 'srcbuf-info 'cmdproc))) - ))) - -(defun realgud-srcbuf-debugger-name (&optional src-buf) - "Return the debugger name recorded in the debugger command-process buffer." - (with-current-buffer-safe (or src-buf (current-buffer)) - (realgud-sget 'srcbuf-info 'debugger-name)) -) - -(defun realgud-srcbuf-loc-hist(src-buf) - "Return the history ring of locations that a debugger process has stored." - (with-current-buffer-safe src-buf - (realgud-sget 'srcbuf-info 'loc-hist)) -) - -(declare-function fn-p-to-fn?-alias(sym)) -(fn-p-to-fn?-alias 'realgud-srcbuf-info-p) -(declare-function realgud-srcbuf-info?(var)) -(declare-function realgud-cmdbuf-info-name(cmdbuf-info)) - -;; FIXME: support a list of cmdprocs's since we want to allow -;; a source buffer to potentially participate in several debuggers -;; which might be active. -(make-variable-buffer-local 'realgud-srcbuf-info) - -(defun realgud-srcbuf-init - (src-buffer cmdproc-buffer) - "Initialize SRC-BUFFER as a source-code buffer for a debugger. -CMDPROC-BUFFER is the process-command buffer containing the -debugger. DEBUGGER-NAME is the name of the debugger as a main -program name." - (with-current-buffer cmdproc-buffer - (set-buffer src-buffer) - (set (make-local-variable 'realgud-srcbuf-info) - (make-realgud-srcbuf-info - :cmdproc cmdproc-buffer - :loc-hist (make-realgud-loc-hist))) - (put 'realgud-srcbuf-info 'variable-documentation - "Debugger information for a buffer containing source code."))) - -(defun realgud-srcbuf-init-or-update (src-buffer cmdproc-buffer) - "Call `realgud-srcbuf-init' for SRC-BUFFER update `realgud-srcbuf-info' variables -in it with those from CMDPROC-BUFFER" - (realgud-cmdbuf-add-srcbuf src-buffer cmdproc-buffer) - (with-current-buffer-safe src-buffer - (realgud-populate-common-keys - ;; use-local-map returns nil so e have to call (current-local-map) - ;; again in this case. - (or (current-local-map) (use-local-map (make-sparse-keymap)) - (current-local-map))) - (if (realgud-srcbuf-info? realgud-srcbuf-info) - (realgud-srcbuf-info-cmdproc= cmdproc-buffer) - (realgud-srcbuf-init src-buffer cmdproc-buffer)))) - -(defun realgud:cmdbuf-associate(cmdbuf-name) -"Associate a command buffer with for the current buffer which is -assumed to be a source-code buffer" - (interactive "brealgud command buffer: ") - (realgud-srcbuf-init-or-update (current-buffer) (get-buffer cmdbuf-name)) - (realgud-short-key-mode-setup 't) - ) - -(defun realgud-srcbuf-bp-list(&optional buffer) - "Return a list of breakpoint loc structures that reside in -BUFFER which should be an initialized source buffer." - (let ((src-buffer (realgud-get-srcbuf buffer))) - (if src-buffer - (with-current-buffer src-buffer - (let* ((info realgud-srcbuf-info) - (cmdbuf (realgud-srcbuf-info-cmdproc info))) - (with-current-buffer cmdbuf - (let ((bp-list - (realgud-cmdbuf-info-bp-list realgud-cmdbuf-info))) - (delq nil - (mapcar (lambda (loc) - (cond ((eq src-buffer - (marker-buffer (realgud-loc-marker loc))) - loc) - (nil))) - bp-list)) - ))))))) - -(defun realgud-get-bpnum-from-line-num(line-num &optional buffer) - "Find a breakpoint number associated with LINE-NUM in source code BUFFER. -If none exists return nil" - (let ((src-buffer (realgud-get-srcbuf buffer)) - (bp-num nil) - (bp) - (bp-list) - ) - (if src-buffer - (progn - (setq bp-list (realgud-srcbuf-bp-list src-buffer)) - (while (and (not bp-num) bp-list) - (setq bp (car bp-list)) - (setq bp-list (cdr bp-list)) - (if (eq line-num (realgud-loc-line-number bp)) - (setq bp-num (realgud-loc-num bp))) - )) - ) - bp-num)) - -(provide-me "realgud-buffer-") diff --git a/packages/realgud/realgud/common/cmds.el b/packages/realgud/realgud/common/cmds.el deleted file mode 100644 index 49a546bcf..000000000 --- a/packages/realgud/realgud/common/cmds.el +++ /dev/null @@ -1,256 +0,0 @@ -;;; Copyright (C) 2010-2011, 2013-2015 Rocky Bernstein -(require 'load-relative) -(require-relative-list '("send" "core") "realgud-") -(require-relative-list '("buffer/command") "realgud-buffer-") -(require-relative-list '("buffer/source") "realgud-buffer-") - -(declare-function buffer-killed? 'helper) -(declare-function realgud-cmdbuf-info-in-srcbuf?= 'realgud-buffer-command) -(declare-function realgud-cmdbuf? 'realgud-buffer-command) -(declare-function realgud-command 'realgud-cmd) -(declare-function realgud-get-cmdbuf 'realgud-buffer-helper) -(declare-function realgud-get-command 'realgud-buffer-command) -(declare-function realgud-get-bpnum-from-line-num 'realgud-buffer-source) - -(declare-function realgud:terminate 'realgud-core) -(declare-function realgud:terminate-srcbuf 'realdgud-core) - -(defun realgud:cmd-remap(arg cmd-name default-cmd-template key - &optional no-record? frame-switch? - realgud-prompts?) - "Run debugger command CMD-NAME using DEFAULT-CMD-TEMPLATE -if none has been set in the command hash. If key is given we'll set -a shortcut for that key." - (let ((buffer (current-buffer)) - (cmdbuf (realgud-get-cmdbuf)) - (cmd-hash) - (cmd) - ) - (with-current-buffer-safe cmdbuf - (realgud-cmdbuf-info-in-srcbuf?= (not (realgud-cmdbuf? buffer))) - (setq cmd-hash (realgud-cmdbuf-info-cmd-hash realgud-cmdbuf-info)) - (unless (and cmd-hash (setq cmd (gethash cmd-name cmd-hash))) - (setq cmd default-cmd-template)) - ) - (realgud-command cmd arg no-record? frame-switch? realgud-prompts?) - ;; FIXME: Figure out how to update the position if the source - ;; buffer is displayed. - ;; (if frame-switch? - ;; (let* ((src-buffer (realgud-get-srcbuf-from-cmdbuf cmdbuf)) - ;; (src-window (get-buffer-window src-buffer)) - ;; )) - ;; (with-selected-window src-window - ;; (message "recentering...") - ;; (realgud-recenter-arrow) - ;; )) - ) - ;; FIXME: this is a one-time thing. Put in caller. - (if key - (local-set-key (format "\C-c%s" key) - (intern (format "realgud:cmd-%s" cmd-name))) - ) - ) - -(defun realgud:cmd-backtrace(arg) - "Show the current call stack" - (interactive "p") - (realgud:cmd-remap arg "backtrace" "backtrace" "T") - ) - -(defun realgud:cmd-break(arg) - "Set a breakpoint at the current line" - (interactive "p") - (realgud:cmd-remap arg "break" "break %X:%l" "b")) - -(defun realgud:cmd-clear(line-num) - "Delete breakpoint at the current line" - (interactive "p") - (realgud:cmd-remap line-num "clear" "clear %l" "X")) - -(defun realgud:cmd-continue(&optional arg) - "Continue execution." - (interactive "MContinue args: ") - (realgud:cmd-remap arg "continue" "continue" "c") -) - -(defun realgud:cmd-delete(&optional arg) - "Delete breakpoint by number." - (interactive "pBreakpoint number: ") - (let* ((line-num (line-number-at-pos)) - (arg (realgud-get-bpnum-from-line-num line-num))) - (if arg - (realgud:cmd-remap arg "delete" "delete %p" "D") - (message "Can't find breakpoint at line %d" line-num)) - ) - ) - -(defun realgud:cmd-disable(&optional arg) - "Disable breakpoint." - (interactive "NBreakpoint number: ") - (realgud:cmd-remap arg "disable" "disable %p" "-") - ) - -(defun realgud:cmd-enable(&optional arg) - "Enable breakpoint." - (interactive "NBreakpoint number: ") - (realgud:cmd-remap arg "enable" "enable %p" "+") - ) - -(defun realgud:cmd-eval(arg) - "Exaluate an expression." - (interactive "MEval expesssion: ") - (realgud:cmd-remap arg "eval" "eval %s" "e") -) - -(defun realgud:cmd-eval-region(start end) - (interactive "r") - (let ((text (buffer-substring-no-properties start end))) - (realgud:cmd-remap text "eval" "eval %s" "e") - ) - ) - -(defun realgud:cmd-finish(&optional arg) - "Run until the completion of the current stack frame. - -This command is often referred to as 'step out' as opposed to -'step over' or 'step into'. -" - (interactive "p") - (realgud:cmd-remap arg "finish" "finish" ".") -) - -(defun realgud:cmd-frame(arg) - "Change the current frame number to the value of the numeric argument. -If no argument specified use 0 or the most recent frame." - (interactive "p") - (realgud:cmd-remap arg "frame" "frame %p" "f" t t) -) - -(defun realgud:cmd-kill(arg) - "kill debugger process" - (interactive "p") - (realgud:cmd-remap arg "kill" "kill" "k" nil nil 't) - ) - -(defun realgud:cmd-newer-frame(&optional arg) - "Move the current frame to a newer (more recent) frame. -With a numeric argument move that many levels forward." - (interactive "p") - (realgud:cmd-remap arg "down" "down %p" "<" t t) -) - -(defun realgud:cmd-next(&optional arg) - "Step one source line at current call level. - -With a numeric argument, step that many times. This command is -often referred to as 'step through' as opposed to 'step into' or -'step out'. - -The definition of 'next' is debugger specific so, see the -debugger documentation for a more complete definition of what is -getting stepped." - (interactive "p") - (realgud:cmd-remap arg "next" "next %p" "n") -) - -(defun realgud:cmd-next-no-arg(&optional arg) - "Step one source line at current call level. - -The definition of 'next' is debugger specific so, see the -debugger documentation for a more complete definition of what is -getting stepped." - (interactive) - (realgud:cmd-remap nil "next" "next" "n") -) - -(defun realgud:cmd-older-frame(&optional arg) - "Move the current frame to an older (less recent) frame. -With a numeric argument move that many levels back." - (interactive "p") - (realgud:cmd-remap arg "up" "up %p" ">" t t) -) - -(defun realgud:cmd-restart(&optional arg) - "Restart execution." - (interactive "MRestart args: ") - (realgud:cmd-remap arg "restart" "run" "R" 't nil 't) -) - -(defun realgud:cmd-shell(&optional arg) - "Restart execution." - (interactive "p") - (realgud:cmd-remap arg "shell" "shell" "S") -) - -(defun realgud:cmd-step(&optional arg) - "Step one source line. - -With a numeric argument, step that many times. -This command is often referred to as 'step into' as opposed to -'step over' or 'step out'. - -The definition of 'step' is debugger specific so, see the -debugger documentation for a more complete definition of what is -getting stepped." - (interactive "p") - (realgud:cmd-remap arg "step" "step %p" "s") -) - -(defun realgud:cmd-step-no-arg() - "Step one source line. - -The definition of 'step' is debugger specific so, see the -debugger documentation for a more complete definition of what is -getting stepped." - (interactive) - (realgud:cmd-remap nil "step" "step" "s") -) - -(defun realgud:cmd-terminate (&optional arg) - "Gently terminate source and command buffers without possibly -issuing a command to the underlying debuger. Use this if the -underlying debugger has died or you want to get out of all -shortkey modes in the source window and possibly restart -debugging after editing source." - (interactive "p") - (realgud:terminate (current-buffer)) -) - -(defun realgud:cmd-until(&optional arg) - "Run until the completion of the current stack frame. - -Continue until the current line. In some cases this is really -two commands - setting a temporary breakpoint on the line and -continuing execution." - (interactive "p") - (realgud:cmd-remap arg "until" "until" "u") -) - -(defun realgud:cmd-quit (&optional arg) - "Gently terminate execution of the debugged program." - (interactive "p") - (let ((buffer (current-buffer)) - (cmdbuf (realgud-get-cmdbuf)) - (cmd-hash) - (cmd) - ) - (if cmdbuf - (progn - (with-current-buffer cmdbuf - (realgud-cmdbuf-info-in-srcbuf?= (not (realgud-cmdbuf? buffer))) - (setq cmd-hash (realgud-cmdbuf-info-cmd-hash realgud-cmdbuf-info)) - (unless (and cmd-hash (setq cmd (gethash "quit" cmd-hash))) - (setq cmd "quit")) - ) - (realgud-command cmd arg 't) - (if cmdbuf (realgud:terminate cmdbuf)) - ) - ; else - (realgud:terminate-srcbuf buffer) - ) - ) - ) - -(local-set-key "\C-cq" 'realgud:cmd-quit) - -(provide-me "realgud-") diff --git a/packages/realgud/realgud/common/core.el b/packages/realgud/realgud/common/core.el deleted file mode 100644 index 63e285b2b..000000000 --- a/packages/realgud/realgud/common/core.el +++ /dev/null @@ -1,300 +0,0 @@ -;;; Copyright (C) 2010-2015 Rocky Bernstein -; (require 'term) -(if (< emacs-major-version 24) - (error - "You need at least Emacs 24 or greater to run this - you have version %d" - emacs-major-version)) - -(require 'comint) -(require 'load-relative) -(require 'loc-changes) -(require-relative-list '("fringe" "helper" "lang" "reset") - "realgud-") -(require-relative-list '("buffer/command" "buffer/source") "realgud-buffer-") - -(declare-function comint-exec 'comint) -(declare-function comint-mode 'comint) -(declare-function realgud-bp-remove-icons 'realgud-bp) -(declare-function realgud:suggest-file-from-buffer 'realgud-lang) -(declare-function realgud-cmdbuf-args= 'realgud-buffer-command) -(declare-function realgud-cmdbuf-command-string 'realgud-buffer-command) -(declare-function realgud-cmdbuf-debugger-name 'realgud-buffer-command) -(declare-function realgud-cmdbuf-info-bp-list= 'realgud-buffer-command) -(declare-function realgud-cmdbuf-info-in-debugger?= 'realgud-buffer-command) -(declare-function realgud-cmdbuf-mode-line-update 'realgud-buffer-command) -(declare-function realgud-cmdbuf? 'realgud-helper) -(declare-function realgud-command-string 'realgud-buffer-command) -(declare-function realgud-fringe-erase-history-arrows 'realgud-buffer-command) -(declare-function realgud-get-cmdbuf 'realgud-helper) -(declare-function realgud:reset 'realgud-reset) -(declare-function realgud-short-key-mode-setup 'realgud-shortkey) -(declare-function realgud-srcbuf-command-string 'realgud-buffer-source) -(declare-function realgud-srcbuf-debugger-name 'realgud-buffer-source) -(declare-function realgud-srcbuf-init 'realgud-buffer-source) -(declare-function realgud-srcbuf? 'realgud-buffer-source) -(declare-function realgud-suggest-lang-file 'realgud-lang) - -(defvar realgud-srcbuf-info) - -(defun realgud:expand-file-name-if-exists (filename) - "Return FILENAME expanded using `expand-file-name' if that name exists. -Otherwise, just return FILENAME." - (let* ((expanded-filename (expand-file-name filename)) - (result (cond ((file-exists-p expanded-filename) - expanded-filename) - ('t filename)))) - result) -) - -(defun realgud-suggest-invocation - (debugger-name minibuffer-history lang-str lang-ext-regexp - &optional last-resort) - "Suggest a debugger command invocation. If the current buffer -is a source file or process buffer previously set, then use the -value of that the command invocations found by buffer-local -variables. Next, try to use the first value of MINIBUFFER-HISTORY -if that exists. Finally we try to find a suitable program file -using LANG-STR and LANG-EXT-REGEXP." - (let* ((buf (current-buffer)) - (filename) - (cmd-str-cmdbuf (realgud-cmdbuf-command-string buf)) - ) - (cond - ((and cmd-str-cmdbuf (equal debugger-name (realgud-cmdbuf-debugger-name buf))) - cmd-str-cmdbuf) - ((and minibuffer-history (listp minibuffer-history)) - (car minibuffer-history)) - ((setq filename (realgud:suggest-file-from-buffer lang-str)) - (concat debugger-name " " filename)) - (t (concat debugger-name " " - (realgud-suggest-lang-file lang-str lang-ext-regexp last-resort))) - ))) - -(defun realgud-query-cmdline - (suggest-invocation-fn - minibuffer-local-map - minibuffer-history - &optional opt-debugger) - "Prompt for a debugger command invocation to run. -Analogous to `gud-query-cmdline'. - -If you happen to be in a debugger process buffer, the last command invocation -for that first one suggested. Failing that, some amount of guessing is done -to find a suitable file via SUGGEST-INVOCATION-FN. - -We also set filename completion and use a history of the prior -dbgr invocations " - (let ((debugger (or opt-debugger - (realgud-sget 'srcbuf-info 'debugger-name)))) - (read-from-minibuffer - (format "Run %s (like this): " debugger) ;; prompt string - (funcall suggest-invocation-fn debugger) ;; initial value - minibuffer-local-map ;; keymap - nil ;; read - use default value - minibuffer-history ;; history variable - ))) - -(defun realgud-parse-command-arg (args two-args opt-two-args) - "Return a cons node where the car is a list containing the -entire first option and the cdr is the remaining arguments from ARGS. - -We determine if an option has length one or two using the lists -TWO-ARGS and OPT-TWO-ARGS. Both of these are list of 'options', -that is strings without the leading dash. TWO-ARGS takes a -mandatory additional argument. OPT-TWO-ARGS might take two -arguments. The rule for an optional argument that we use is if -the next parameter starts with a dash ('-'), it is not part of -the preceeding parameter when that parameter is optional. - -NOTE: we don't check whether the first arguments of ARGS is an -option by testing to see if it starts say with a dash. So on -return the first argument is always removed. -" - (let ((arg (car args)) - (d-two-args (mapcar (lambda(x) (concat "-" x)) two-args)) - (d-opt-two-args (mapcar (lambda(x) (concat "-" x)) opt-two-args)) - (remaining (cdr args))) - (cond - ((member arg d-two-args) - (if (not remaining) - (progn - (message "Expecting an argument after %s. Continuing anyway." - arg) - (cons (list arg) (list remaining))) - (cons (list arg (car remaining)) (list (cdr remaining))))) - ((member arg d-opt-two-args) - (if (and remaining (not (string-match "^-" (car remaining)))) - (cons (list arg (car remaining)) (list (cdr remaining))) - (cons (list arg) (list remaining)))) - (t (cons (list arg) (list remaining)))))) - -(defun realgud:terminate-srcbuf (&optional srcbuf) - "Resets source buffer." - (interactive "bsource buffer: ") - (if (stringp srcbuf) (setq srcbuf (get-buffer srcbuf))) - (with-current-buffer srcbuf - (realgud-fringe-erase-history-arrows) - (realgud-bp-remove-icons (point-min) (point-max)) - (when (realgud-srcbuf?) - (realgud-short-key-mode-setup nil) - (redisplay) - ) - (loc-changes-clear-buffer) - )) - -(defun realgud:terminate (&optional buf) - "Resets state in all buffers associated with source or command -buffer BUF) This does things like remove fringe arrows breakpoint -icons and resets short-key mode." - (interactive "bbuffer: ") - (if (stringp buf) (setq buf (get-buffer buf))) - (let ((cmdbuf (realgud-get-cmdbuf buf))) - (if cmdbuf - (with-current-buffer cmdbuf - (realgud-cmdbuf-info-in-debugger?= nil) - (realgud-cmdbuf-info-bp-list= '()) - (realgud-cmdbuf-mode-line-update) - (realgud-fringe-erase-history-arrows) - (if realgud-cmdbuf-info - (dolist (srcbuf (realgud-cmdbuf-info-srcbuf-list realgud-cmdbuf-info)) - (if (realgud-srcbuf? srcbuf) - (with-current-buffer srcbuf - (realgud:terminate-srcbuf srcbuf) - )) - ) - ) - ) - (error "Buffer %s does not seem to be attached to a debugger" - (buffer-name)) - ) - ) - ) - -(defun realgud:kill-buffer-hook () - "When a realgud command buffer is killed, call `realgud:terminate' to -clean up. -Note that `realgud-term-sentinel' is not helpful here because -the buffer and data associated with it are already gone." - (when (realgud-cmdbuf?) (realgud:terminate (current-buffer))) -) -(add-hook 'kill-buffer-hook 'realgud:kill-buffer-hook) - -(defun realgud-term-sentinel (process string) - "Called when PROCESS dies. We call `realgud:terminate' to clean up." - (let ((cmdbuf (realgud-get-cmdbuf))) - (if cmdbuf (realgud:terminate cmdbuf))) - (message "That's all folks.... %s" string)) - -(defun realgud:binary (file-name) -"Return a priority for wehther file-name is likely we can run gdb on" - (let ((output (shell-command-to-string (format "file %s" file-name)))) - (cond - ((string-match "ELF" output) t) - ('t nil)))) - - -(defun realgud-exec-shell (debugger-name script-filename program - &optional no-reset &rest args) - "Run the specified SCRIPT-FILENAME in under debugger DEBUGGER-NAME a -comint process buffer. ARGS are the arguments passed to the -PROGRAM. At the moment, no piping of input is allowed. - -SCRIPT-FILENAME will have local variable `realgud-script-info' set -which contains the debugger name and debugger process-command -buffer. - -Normally command buffers are reused when the same debugger is -reinvoked inside a command buffer with a similar command. If we -discover that the buffer has prior command-buffer information and -NO-RESET is nil, then that information which may point into other -buffers and source buffers which may contain marks and fringe or -marginal icons is reset." - - (let* ((starting-directory - (or (file-name-directory script-filename) - default-directory "./")) - (cmdproc-buffer-name - (format "*%s %s shell*" - (file-name-nondirectory debugger-name) - (file-name-nondirectory script-filename))) - (cmdproc-buffer (get-buffer-create cmdproc-buffer-name)) - (realgud-buf (current-buffer)) - (cmd-args (cons program args)) - (process (get-buffer-process cmdproc-buffer))) - - - (with-current-buffer cmdproc-buffer - ;; If the found command buffer isn't for the same debugger - ;; invocation command, rename that and start a new one. - ;; - ;; For example: "bashdb /tmp/foo" does not match "bashdb - ;; /etc/foo" even though they both canonicalize to the buffer - ;; "*bashdb foo shell*" - (unless (and (realgud-cmdbuf?) - (equal cmd-args - (realgud-cmdbuf-info-cmd-args realgud-cmdbuf-info))) - (rename-uniquely) - (setq cmdproc-buffer (get-buffer-create cmdproc-buffer-name)) - (setq process nil) - )) - - (unless (and process (eq 'run (process-status process))) - (with-current-buffer cmdproc-buffer - (and (realgud-cmdbuf?) (not no-reset) (realgud:reset)) - (setq default-directory default-directory) - (insert "Current directory: " default-directory "\n") - (insert "Command: " (mapconcat 'identity cmd-args " ") "\n") - - ;; For term.el - ;; (term-mode) - ;; (set (make-local-variable 'term-term-name) realgud-term-name) - ;; (make-local-variable 'realgud-parent-buffer) - ;; (setq realgud-parent-buffer realgud-buf) - - ;; For comint.el. - (comint-mode) - - ;; Making overlay-arrow-variable-list buffer local has to be - ;; done after running commint mode. FIXME: find out why and if - ;; this reason is justifyable. Also consider moving this somewhere - ;; else. - (make-local-variable 'overlay-arrow-variable-list) - (make-local-variable 'realgud-overlay-arrow1) - (make-local-variable 'realgud-overlay-arrow2) - (make-local-variable 'realgud-overlay-arrow3) - - (condition-case nil - (comint-exec cmdproc-buffer debugger-name program nil args) - (error cmdproc-buffer)) - - (setq process (get-buffer-process cmdproc-buffer)) - - (if (and process (eq 'run (process-status process))) - (let ((src-buffer) - (cmdline-list (cons program args))) - ;; is this right? - (unless (realgud:binary script-filename) - (setq src-buffer (find-file-noselect script-filename)) - (point-max) - (realgud-srcbuf-init src-buffer cmdproc-buffer)) - ) - ;; else - (insert - (format - "Failed to invoke debugger %s on program %s with args %s\n" - debugger-name program (mapconcat 'identity args " "))) - (error cmdproc-buffer) - ) - (process-put process 'buffer cmdproc-buffer))) - cmdproc-buffer)) - -;; Start of a term-output-filter for term.el -(defun realgud-term-output-filter (process string) - (let ((process-buffer (process-get process 'buffer))) - (if process-buffer - (save-current-buffer - (set-buffer process-buffer) - ;; (insert-before-markers (format "+++1 %s" string)) - (insert-before-markers string))))) - -(provide-me "realgud-") diff --git a/packages/realgud/realgud/common/custom.el b/packages/realgud/realgud/common/custom.el deleted file mode 100644 index c47614272..000000000 --- a/packages/realgud/realgud/common/custom.el +++ /dev/null @@ -1,15 +0,0 @@ -;;; Copyright (C) 2010 Rocky Bernstein -(require 'load-relative) - -(defcustom realgud-key-prefix "\C-x\C-a" - "Prefix of all realgud commands valid in source buffers." - :type 'string - :group 'realgud) - -(defcustom realgud-srcbuf-lock t - "Set source buffers read-only when the debugger is active. -A setting of `nil` allows editing, but Short-Key-mode use may inhibit this." - :type 'boolean - :group 'realgud) - -(provide-me "realgud-") diff --git a/packages/realgud/realgud/common/file.el b/packages/realgud/realgud/common/file.el deleted file mode 100644 index b4c378c8e..000000000 --- a/packages/realgud/realgud/common/file.el +++ /dev/null @@ -1,129 +0,0 @@ -;;; Copyright (C) 2010-2011, 2013-2014 Rocky Bernstein -; Should realgud:file-loc-from-line be here or elsewhere? -(require 'load-relative) -(require 'compile) ;; for compilation-find-file -(require-relative-list '("helper" "loc") "realgud-") - -(defvar realgud-file-remap (make-hash-table :test 'equal) - "How to remap files we otherwise can't find in the - filesystem. The hash key is the file string we saw, and the - value is associated filesystem string presumably in the - filesystem") - -(declare-function realgud:strip 'realgud) -(declare-function realgud-loc-goto 'realgud-loc) -(declare-function buffer-killed? 'helper) -(declare-function compilation-find-file 'compile) - -(defun realgud:file-line-count(filename) - "Return the number of lines in file FILENAME, or nil FILENAME can't be -found" - (if (file-exists-p filename) - (let ((file-buffer (find-file-noselect filename))) - (with-current-buffer-safe file-buffer - (line-number-at-pos (point-max)))) - nil)) - -(defun realgud:file-column-from-string(filename line-number source-text - &optional no-strip-blanks) - "Return the column of the first column position of SOURCE-TEXT -at LINE-NUMBER or nil if it is not there" - (condition-case nil - (if (file-exists-p filename) - (let ((file-buffer (find-file-noselect filename))) - (with-current-buffer-safe file-buffer - (save-excursion - (goto-char (point-min)) - (forward-line (1- line-number)) - (unless no-strip-blanks - (setq source-text (realgud:strip source-text))) - (if (search-forward source-text (point-at-eol)) - (- (current-column) - (length source-text)))))) - ;; else - nil) - (error nil)) -) - - -;; FIXME: should allow column number to be passed in. -(defun realgud:file-loc-from-line(filename line-number - &optional cmd-marker source-text bp-num - ;; FIXME: remove ignore-file-re and cover with - ;; find-file-fn. - ignore-file-re find-file-fn) - "Return a realgud-loc for FILENAME and LINE-NUMBER and the -other optional position information. - -CMD-MARKER and BP-NUM get stored in the realgud-loc -object. FIND-FILE-FN is a function which do special things to -transform filename so it can be found. This could include -searching classpaths (in Java), stripping leading and trailing -blanks, or deliberately ignoring 'pseudo-file patterns like (eval -1) of Perl and of Python. - -If we're unable find the source code we return a string describing the -problem as best as we can determine." - - (unless (and filename (file-readable-p filename)) - (if find-file-fn - (setq filename (funcall find-file-fn filename)) - ;; FIXME: Remove the below by refactoring to use the above find-file-fn - ;; else - (if (and ignore-file-re (string-match ignore-file-re filename)) - (message "tracking ignored for psuedo-file %s" filename) - ;; else - (let ((remapped-filename)) - (if (gethash filename realgud-file-remap) - (progn - (setq remapped-filename (gethash filename realgud-file-remap)) - (if (file-exists-p remapped-filename) - (setq filename remapped-filename) - (remhash filename realgud-file-remap))) - ;; else - (progn - (setq remapped-filename - (buffer-file-name - (compilation-find-file (point-marker) filename nil))) - (when (and remapped-filename (file-exists-p remapped-filename)) - (puthash filename remapped-filename realgud-file-remap) - (setq filename remapped-filename) - ) - ))) - ) - ;; FIXME: remove above -----------------------------------. - )) - (if filename - (if (file-readable-p filename) - (if (integerp line-number) - (if (> line-number 0) - (lexical-let ((line-count)) - (if (setq line-count (realgud:file-line-count filename)) - (if (> line-count line-number) - (let* ((column-number - (realgud:file-column-from-string filename - line-number - source-text)) - ;; And you thought we'd never get around to - ;; doing something other than validation? - (loc (make-realgud-loc - :num bp-num - :cmd-marker cmd-marker - :filename filename - :line-number line-number - :column-number column-number - :source-text source-text - :marker (make-marker) - ))) - loc) - ;; else - (format "File %s has only %d lines. (Line %d requested.)" - filename line-count line-number)) - (format "Problem getting line count for file `%s'" filename))) - (format "line number %s should be greater than 0" line-number)) - (format "%s is not an integer" line-number)) - ;; else - (format "File named `%s' not readable" filename))) - ) - -(provide-me "realgud-") diff --git a/packages/realgud/realgud/common/follow.el b/packages/realgud/realgud/common/follow.el deleted file mode 100644 index a3605229d..000000000 --- a/packages/realgud/realgud/common/follow.el +++ /dev/null @@ -1,37 +0,0 @@ -;;; Copyright (C) 2015 Rocky Bernstein -;;; Follows or goto's something -(require 'load-relative) - -(declare-function realgud:cmd-frame 'realgud-cmds) - -(defun realgud:follow-mark(mark) - (when (markerp mark) - (let ((buffer (marker-buffer mark))) - (set-buffer buffer) - (set-window-point (display-buffer buffer) mark) - (goto-char mark) - ))) - - -(defun realgud:follow(pos) - (interactive "%d") - (let* ((mark (get-text-property pos 'mark)) - (filename (get-text-property pos 'file)) - (frame-num (get-text-property pos 'frame-num)) - ) - (cond ((markerp mark) (realgud:follow-mark mark) 't) - ((stringp filename) - (find-file-other-window filename)) - ((numberp frame-num) (realgud:cmd-frame frame-num)) - ('t (message "No location property found here"))) - )) - -(defun realgud:follow-point() - (interactive "") - (realgud:follow (point))) - -(defun realgud:follow-event(event) - (interactive "e") - (realgud:follow (posn-point (event-end event)))) - -(provide-me "realgud-") diff --git a/packages/realgud/realgud/common/fringe.el b/packages/realgud/realgud/common/fringe.el deleted file mode 100644 index 7256ed55d..000000000 --- a/packages/realgud/realgud/common/fringe.el +++ /dev/null @@ -1,198 +0,0 @@ -;;; Copyright (C) 2010, 2012, 2014-2015 Rocky Bernstein -;; Fringe marks for history of stopping points -(require 'load-relative) -(require-relative-list '("helper") "realgud-") - -(declare-function realgud-loc-hist-item-at 'realgud-lochist) -(declare-function buffer-killed? 'helper) -(declare-function realgud-loc-cmd-marker 'realgud-loc) -(declare-function realgud:loc-follow 'realgud-loc) -(declare-function realgud-loc-marker 'realgud-loc) - -;; Bitmap for hollow overlay-arrow in fringe -(if (display-images-p) - (define-fringe-bitmap 'hollow-right-triangle - "\xe0\x90\x88\x84\x84\x88\x90\xe0")) - -;; FIXME: Figure out how to do this as a macro. - -(defface realgud-overlay-arrow1 - '((t - :foreground "black" - :weight bold)) - "Fringe face for current position." - :group 'realgud) - -(defface realgud-overlay-arrow2 - '((t - :foreground "gray" - :weight bold)) - "Fringe face for position one back in fringe." - :group 'realgud) - -(defface realgud-overlay-arrow3 - '((t - :foreground "gainsboro" - :weight bold)) - "Fringe face for position two back in fringe." - :group 'realgud) - - -(defvar realgud-overlay-arrow1 nil - "Overlay arrow variable which contains the most recent debugger -position.") -(defvar realgud-overlay-arrow2 nil - "Overlay arrow variable which contains the 2nd most recent debugger -position.") -(defvar realgud-overlay-arrow3 nil - "Overlay arrow variable which contains the 3rd most recent debugger -position.") - -(eval-when-compile (require 'cl)) - - -;; FIXME: since overlay overlay-arrow-list can be global, and perhaps -;; has to stay that way since some Emacs code may expect that, we -;; should use different global overlay arrow variables for the -;; different debuggers. E.g. trepan-overlay-arrow1, -;; pyrealgud-overlay-arrow1 and so on. That way, if those debuggers are -;; running concurrently, the fringe for one doesn't interfere with the -;; fringe for another. - -;; Loop to set up fringe position markers. - -;; Here is an example of what each iteration does: -;; -;; (make-local-variable 'realgud-overlay-arrow1) ;; or 2, or 3 -;; (put 'realgud-overlay-arrow1 'overlay-arrow-string "=>" ;; or "2>", or ">3" -;; (define-fringe-bitmap 'realgud-overlay-arrow1 "\xc0...") -;; (add-to-list 'overlay-arrow-variable-list 'realgud-overlay-arrow1) - -(dolist (pair - '( ("3" . "3>") ("2" . "2>") ("1" . "=>"))) - (let ((arrow-symbol (intern (concat "realgud-overlay-arrow" (car pair)))) - (arrow-bitmap (intern (concat "realgud-right-triangle" (car pair)))) - (arrow-face (intern (concat "realgud-overlay-arrow" (car pair))))) - (make-local-variable arrow-symbol) - (put arrow-symbol 'overlay-arrow-string (cdr pair)) - (if (display-images-p) - (progn - (define-fringe-bitmap arrow-bitmap "\xc0\xf0\xf8\xfc\xfc\xf8\xf0\xc0") - (put arrow-symbol 'overlay-arrow-bitmap arrow-bitmap) - (set-fringe-bitmap-face arrow-bitmap arrow-face))) - (add-to-list 'overlay-arrow-variable-list arrow-symbol))) - -(defun realgud-fringe-set-arrow (overlay-arrow marker) - "Set the fringe indicator or overlay arrow to MARKER. This is done -for example to indicate a debugger position." - (let ((position (marker-position marker))) - (if position - (with-current-buffer (marker-buffer marker) - (save-excursion - (save-restriction - (widen) - (progn - (goto-char position) - ;; We need to ignore field boundaries, so we use - ;; forward-line rather than beginning-of-line. - (forward-line 0) - (set overlay-arrow (point-marker))))))))) - -(defun realgud-fringe-history-set (loc-hist &optional do-cmdbuf?) - "Set arrows on the last positions we have stopped on." - ;; FIXME DRY somehow - (let* ( - (loc1 (realgud-loc-hist-item-at loc-hist 2)) - (loc2 (realgud-loc-hist-item-at loc-hist 1)) - (loc3 (realgud-loc-hist-item-at loc-hist 0)) - (mark1 (and loc3 (realgud-loc-marker loc3))) - (mark2 (and loc2 (realgud-loc-marker loc2))) - (mark3 (and loc1 (realgud-loc-marker loc1))) - (cmd-mark1 (and loc3 (realgud-loc-cmd-marker loc3))) - (cmd-mark2 (and loc2 (realgud-loc-cmd-marker loc2))) - (cmd-mark3 (and loc1 (realgud-loc-cmd-marker loc1))) - ) - (when (and loc3 (not (equal mark3 mark2))) - (realgud-fringe-set-arrow 'realgud-overlay-arrow3 mark3) - (if do-cmdbuf? - (realgud-fringe-set-arrow 'realgud-overlay-arrow3 cmd-mark3))) - (when (and loc2 (not (equal mark2 mark1))) - (realgud-fringe-set-arrow 'realgud-overlay-arrow2 mark2) - (if do-cmdbuf? - (realgud-fringe-set-arrow 'realgud-overlay-arrow2 cmd-mark2))) - (when loc1 - (realgud-fringe-set-arrow 'realgud-overlay-arrow1 mark1) - (when (and do-cmdbuf? cmd-mark1) - (realgud-fringe-set-arrow 'realgud-overlay-arrow1 cmd-mark1) - (goto-char (marker-position cmd-mark1))) - ) - )) - -(defun realgud-fringe-erase-history-arrows () - "Erase the history arrows from the fringe. You might want call -this command interactively if you have conceptually stopped -debugging and now find the fringe arrows distracting. But you -don't want to kill the debugger process or quit a debugger -session which should also erase those fringe arrows." - (interactive) - (setq realgud-overlay-arrow1 nil) - (setq realgud-overlay-arrow2 nil) - (setq realgud-overlay-arrow3 nil)) - -(defun realgud-goto-arrow1() - "Goto the position stored in realgud-overlay-arrow1" - (interactive "") - (if realgud-overlay-arrow1 - (realgud:loc-follow realgud-overlay-arrow1)) - ) - -(defun realgud-goto-arrow2() - "Goto the position stored in realgud-overlay-arrow2" - (interactive "") - (if realgud-overlay-arrow2 - (realgud:loc-follow realgud-overlay-arrow2)) - ) - - -(defun realgud-goto-arrow3() - "Goto the position stored in realgud-overlay-arrow3" - (interactive "") - (if realgud-overlay-arrow3 - (realgud:loc-follow realgud-overlay-arrow3)) - ) - -(defun realgud-recenter-arrow1() - "If the current buffer contains realgud-overlay-arrow1 go to that position" - (interactive "") - (if (and realgud-overlay-arrow1 - (eq (marker-buffer realgud-overlay-arrow1) (current-buffer))) - (goto-char realgud-overlay-arrow1)) - ) - -(defun realgud-recenter-arrow(&optional opt-buffer) - "If the current buffer contains realgud-overlay-arrows 1, 2 or 3 - recenter window to show that" - (interactive "") - (let ((buffer (or opt-buffer (current-buffer)))) - ;; We need to update in the order 3..1 so that if there are more than on - ;; arrows in the same buffer the smaller number (e.g. arrow 1) is the - ;; position we are at rather than the earlier one (e.g. arrow 3). - (with-current-buffer-safe buffer - (if (and realgud-overlay-arrow3 - (eq (marker-buffer realgud-overlay-arrow3) buffer)) - (realgud:loc-follow realgud-overlay-arrow3) - ) - (if (and realgud-overlay-arrow2 - (eq (marker-buffer realgud-overlay-arrow2) buffer)) - (realgud:loc-follow realgud-overlay-arrow2) - ) - (if (and realgud-overlay-arrow1 - (eq (marker-buffer realgud-overlay-arrow1) buffer)) - (realgud:loc-follow realgud-overlay-arrow1) - ) - (redisplay) - ) - )) - - -(provide 'realgud-fringe) diff --git a/packages/realgud/realgud/common/helper.el b/packages/realgud/realgud/common/helper.el deleted file mode 100644 index 26054a0dd..000000000 --- a/packages/realgud/realgud/common/helper.el +++ /dev/null @@ -1,89 +0,0 @@ -;;; Copyright (C) 2010, 2014 Rocky Bernstein -;;; Miscellaneous utility functions -(require 'load-relative) - -(defun fn-p-to-fn?-alias (fn-sym) - "FN-SYM is assumed to be a symbol which is a function. If it -ends in a 'p' or '-p', that suffix is stripped; in either case, a -suffix with '?' is added this name is a new alias for that -function FN-SYM." - (if (and (symbolp fn-sym) (functionp fn-sym)) - (let* - ((fn-str (symbol-name fn-sym)) - (new-fn-str - (cond - ((and (> (length fn-str) 2) (equal "-p" (substring fn-str -2))) - (substring fn-str 0 -2)) - ((and (> (length fn-str) 1) (equal "p" (substring fn-str -1))) - (substring fn-str 0 -1)) - (t fn-str))) - (new-fn-sym (intern (concat new-fn-str "?")))) - (defalias new-fn-sym fn-sym)))) - -;; FIXME push the special casing into the debuggers themselves. -(defun realgud:debugger-name-transform (debugger-name) - "In some cases we need to prefix a short debugger name, like -'gdb' with 'realgud:'. This does that." - (let ((debugger-name-short - (file-name-sans-extension (file-name-nondirectory debugger-name)))) - (cond - ((equal debugger-name-short "gdb") "realgud:gdb") - ((equal debugger-name-short "jdb") "realgud:jdb") - ((equal debugger-name-short "tortoise") "gub") - ((or (equal debugger-name "trepan.pl") - (equal debugger-name-short "trepanpl")) - "realgud:trepanpl") - ('t debugger-name-short)))) - -(defun buffer-killed? (buffer) - "Return t if BUFFER is killed." - (not (buffer-name buffer))) - -(defmacro with-current-buffer-safe (buffer &rest body) - "Check that BUFFER has not been deleted before calling -`with-current-buffer'. If it has been deleted return nil." - (declare (indent 1) (debug t)) - `(if (or (not ,buffer) (buffer-killed? ,buffer)) - nil - (with-current-buffer ,buffer - ,@body))) - - -;; FIXME: prepend realgud- onto the beginning of struct-symbol -(defmacro realgud-sget (struct-symbol struct-field) - "Simplified access to a field of a `defstruct' -variable. STRUCT-SYMBOL is a defstruct symbol name. STRUCT-FIELD -is a field in that. Access (STRUCT-SYMBOL-STRUCT-FIELD STRUCT-SYMBOL)" - (declare (indent 1) (debug t)) - `(let* ((realgud-symbol-str - (concat "realgud-" (symbol-name ,struct-symbol))) - (realgud-field-access - (intern (concat realgud-symbol-str "-" (symbol-name, struct-field))))) - (funcall realgud-field-access (eval (intern realgud-symbol-str))))) - - -(defmacro realgud-struct-field-setter (variable-name field) - "Creates an defstruct setter method for field FIELD with -of defstruct variable VARIABLE-NAME. For example: - - (realgud-struct-field-setter \"realgud-srcbuf-info\" \"short-key?\") -gives: - (defun realgud-srcbuf-info-short-key?=(value) - (setf (realgud-srcbuf-info-short-key? realgud-srcbuf-info) value)) -" - (declare (indent 1) (debug t)) - `(defun ,(intern (concat variable-name "-" field "=")) (value) - ;; FIXME: figure out how to add docstring - ;; ,(concat "Sets field" ,field " of " ,variable-name " to VALUE") - (if ,(intern variable-name) - (setf (,(intern (concat variable-name "-" field)) - ,(intern variable-name)) value)) - )) - -;; (defun realgud-struct-field (var-sym field-sym) -;; (setq var-str (symbol-name var-sym)) -;; (setq field-str (symbol-name field-sym)) -;; (funcall (symbol-function (intern (concat var-str "-" field-str))) -;; (eval (intern var-str)))) - -(provide-me "realgud-") diff --git a/packages/realgud/realgud/common/init.el b/packages/realgud/realgud/common/init.el deleted file mode 100644 index 38ee39c64..000000000 --- a/packages/realgud/realgud/common/init.el +++ /dev/null @@ -1,32 +0,0 @@ -;;; Copyright (C) 2010, 2015 Rocky Bernstein -(require 'load-relative) - -(defface realgud-line-number - '((t :inherit font-lock-variable-name-face)) - "Face for displaying line numbers in." - :group 'realgud - :version "23.4") - -(defvar realgud-line-number-face 'realgud-line-number - "Face name to use for line numbers.") - -(defface realgud-file-name - '((t :inherit font-lock-preprocessor-face)) - "Face for displaying file names." - :group 'realgud - :version "23.4") - -(defface realgud-backtrace-number - '((t - :foreground "black" - :weight bold)) - "Fringe face for current position." - :group 'realgud) - -(defvar realgud-backtrace-number-face 'realgud-backtrace-number - "Face name to use for backtrace numbers.") - -(defvar realgud-file-name-face 'realgud-file-name - "Face name to use for file names.") - -(provide-me "realgud-") diff --git a/packages/realgud/realgud/common/key.el b/packages/realgud/realgud/common/key.el deleted file mode 100644 index 75e779701..000000000 --- a/packages/realgud/realgud/common/key.el +++ /dev/null @@ -1,118 +0,0 @@ -;;; Copyright (C) 2010-2011, 2014-2015 Rocky Bernstein -(require 'load-relative) -(require-relative "custom" nil "realgud-") - -(defcustom realgud-populate-common-fn-keys-function - 'realgud-populate-common-fn-keys-standard - "The function to call to populate key bindings common to all dbgr windows. -This includes the secondary windows, the debugger shell, and all -Ruby source buffers when the debugger is active. - -This variable can be bound to the following: - -* nil -- Don't bind any keys. - -* `realgud-populate-common-fn-keys-standard' -- Bind the function - keys according to a widely used debugger convention: - -\\{realgud-example-map-standard} - -* `realgud-populate-common-fn-keys-eclipse' -- Bind according to Eclipse. - -\\{realgud-example-map-eclipse} - -* `realgud-populate-common-fn-keys-netbeans' -- Bind according to NetBeans. - -\\{realgud-example-map-netbeans} - -* Any other value is expected to be a callable function that takes one - argument, the keymap, and populates it with suitable keys." - :type 'function - :group 'realgud) - -;; ------------------------------------------------------------------- -;; Key bindings -;; - -(defun realgud-populate-common-fn-keys-standard (&optional map) - "Bind the debugger function key layout used by many debuggers. - -\\{realgud-example-map-standard}" - (define-key map [f5] 'realgud-continue) - (define-key map [S-f5] 'realgud:cmd-quit) - ;; (define-key map [f9] 'realgud-toggle-source-breakpoint) - (define-key map [f9] 'realgud:cmd-break) - ;; (define-key map [C-f9] 'realgud-toggle-source-breakpoint-enabled) - (define-key map [f10] 'realgud:cmd-next) - (define-key map [f11] 'realgud:cmd-step) - (define-key map [S-f11] 'realgud:cmd-finish) - (define-key map [M-down] 'realgud-track-hist-newer) - (define-key map [A-down] 'realgud-track-hist-newer) - (define-key map [M-kp-2] 'realgud-track-hist-newer) - (define-key map [M-up] 'realgud-track-hist-older) - (define-key map [A-up] 'realgud-track-hist-older) - (define-key map [M-kp-8] 'realgud-track-hist-older) - (define-key map [M-kp-up] 'realgud-track-hist-older) - (define-key map [M-kp-down] 'realgud-track-hist-newer) - (define-key map [M-print] 'realgud-track-hist-older) - (define-key map [M-S-down] 'realgud-track-hist-newest) - (define-key map [M-S-up] 'realgud-track-hist-oldest) - (define-key map "\C-c " 'realgud:cmd-break) - ) - -;; TODO: add eclipse, and netbeans - -(defun realgud-populate-common-keys (map) - "Define the keys that are used by all debugger buffers, including -source-code buffers - -The variable `realgud-populate-common-fn-keys-function' controls the layout." - (define-key map "\C-x\C-a\C-q" 'realgud-short-key-mode) - (if realgud-populate-common-fn-keys-function - (funcall realgud-populate-common-fn-keys-function map)) - (realgud-populate-common-fn-keys-standard map) -) - -(defun realgud-populate-src-buffer-map-plain (map) - "Bind ordinary text characters used in debugger source-code buffers. - -This does not touch change menus; for that see `realgud-populate-debugger-menu'. -Nor does it touch prefix keys; for that see `realgud-populate-keys-standard'" - ;; Common Debugger functions - (let ((prefix-map (make-sparse-keymap))) - (define-key map "b" 'realgud:cmd-break) - (define-key map "D" 'realgud:cmd-delete) - (define-key map [delete] 'realgud:cmd-delete) - (define-key map " " 'realgud:cmd-step) - (define-key map "f" 'realgud:cmd-finish) - (define-key map "n" 'realgud:cmd-next) - (define-key map "q" 'realgud:cmd-quit) - (define-key map "r" 'realgud:cmd-restart) - (define-key map "R" 'realgud:cmd-restart) - (define-key map "s" 'realgud:cmd-step) - (define-key map "!" 'realgud:cmd-shell) - - ;; FIXME: these can go to a common routine. See also shortkey.el - ;; and backtrace-mode.el - (define-key map "<" 'realgud:cmd-newer-frame) - (define-key map ">" 'realgud:cmd-older-frame) - (define-key map "d" 'realgud:cmd-newer-frame) - (define-key map "u" 'realgud:cmd-older-frame) - (define-key map "C" 'realgud-window-cmd-undisturb-src) - (define-key map "F" 'realgud:window-bt) - (define-key map "Q" 'realgud:cmd-terminate) - (define-key map "S" 'realgud-window-src-undisturb-cmd) - (define-key map "U" 'realgud:cmd-until) - - (define-key map [M-down] 'realgud-track-hist-newer) - (define-key map [M-kp-2] 'realgud-track-hist-newer) - (define-key map [M-up] 'realgud-track-hist-older) - (define-key map [M-kp-8] 'realgud-track-hist-older) - (define-key map [M-kp-up] 'realgud-track-hist-older) - (define-key map [M-kp-down] 'realgud-track-hist-newer) - (define-key map [M-print] 'realgud-track-hist-older) - (define-key map [M-S-down] 'realgud-track-hist-newest) - (define-key map [M-S-up] 'realgud-track-hist-oldest) - )) - -(provide-me "realgud-") diff --git a/packages/realgud/realgud/common/lang.el b/packages/realgud/realgud/common/lang.el deleted file mode 100644 index 3d32891c9..000000000 --- a/packages/realgud/realgud/common/lang.el +++ /dev/null @@ -1,98 +0,0 @@ -;;; Copyright (C) 2010, 2012, 2014-2015 Rocky Bernstein -;;; Programming language specific stuff. -(require 'load-relative) - -(defun realgud-lang-mode? (filename lang-str) - "Return true if FILENAME is a buffer we are visiting a buffer -that is in LANG-STR mode. The test is just that the major mode -starts LANG-STR." - (let ((buffer (and filename (find-buffer-visiting filename))) - (match-pos)) - (cond (buffer - (save-current-buffer - (set-buffer buffer) - (setq match-pos - (string-match (format "^%s-" lang-str) - (format "%s" major-mode)))) - (and match-pos (= 0 match-pos))) - ('t nil) - )) - ) - -(defun realgud:suggest-file-from-buffer (lang-str &optional opt-buff-list) - "Suggest the first in the buffer list for which test-func is - 't. Typically this is used. To search for a buffer in one of - the programming modes like Ruby or Python." - (let ((file) - (buff) - (not-found 't) - (buff-list (or opt-buff-list (buffer-list))) - ) - (while (and not-found (setq buff (car-safe buff-list))) - (setq buff-list (cdr buff-list)) - (setq file (buffer-file-name buff)) - (if (realgud-lang-mode? file lang-str) - (setq not-found nil) - )) - (if not-found nil file) - ) - ) - -(defun realgud-suggest-lang-file (lang-str lang-ext-regexp &optional last-resort) - "Suggest a file to debug. We search for the the major mode for -that programming language using we check filenames using -LANG-EXT-REGEXP. For example, for ruby LANG-STR would be 'ruby' -and LANG-EXT-REGEXP would be '\\.rb$'. - -Buffers and files are ranked with a priority. Higher is more -priority and selected will be selected over lower-priorities. - -The first priority is given to the current buffer. If the major -mode matches LANG-STR, then we are done. If not, we'll set -priority 2 and we keep going. Then we will try files in the -default-directory. Of those buffers we are visiting, we check the -major mode. The first one we find we will return. Failing this, -we see if the file is executable and has a LANG-EXT suffix. These -have priority 8. Failing that, we'll go for just having a -LANG-EXT suffix. These have priority 7. And other executable -files that are not directories have priority 6 if they have the -right LANG-EXT, otherwise they are priority 5. - -Within a given priority, we use the first one we find." - (let* ((file) - (file-list (directory-files default-directory)) - (priority 2) - (is-not-directory) - (result (buffer-file-name))) - (unless (realgud-lang-mode? result lang-str) - (while (and (setq file (car-safe file-list)) (< priority 8)) - (setq file-list (cdr file-list)) - (when (realgud-lang-mode? file lang-str) - (setq result file) - (setq priority - (if (file-executable-p file) - (setq priority 8) - (setq priority 7)))) - ;; The file isn't in a language-mode buffer, - ;; Check for an executable file with a language extension. - (if (and file (file-executable-p file) - (setq is-not-directory (not (file-directory-p file)))) - (if (and (string-match lang-ext-regexp file)) - (if (< priority 6) - (progn - (setq result file) - (setq priority 6)))) - (when (and is-not-directory (< priority 5)) - ;; Found some sort of regular file. - (setq result file) - (setq priority 5)) - )) - ) - (if (< priority 6) - (if (setq file (realgud:suggest-file-from-buffer lang-str)) - (setq result file) - (if last-resort (setq result last-resort)))) - result) - ) - -(provide-me "realgud-") diff --git a/packages/realgud/realgud/common/loc.el b/packages/realgud/realgud/common/loc.el deleted file mode 100644 index fe4b2140c..000000000 --- a/packages/realgud/realgud/common/loc.el +++ /dev/null @@ -1,172 +0,0 @@ -;;; Copyright (C) 2010, 2012, 2014-2015 Rocky Bernstein -;;; Debugger location -;;; Commentary: - -;; This describes a debugger location structure and has code for -;; working with them. - -(require 'load-relative) -(require 'loc-changes) -(require-relative-list '("fringe" "follow") "realgud-") -(require-relative-list '("buffer/source") "realgud-buffer-") - -;; FIXME: removed because of recursive loads -;; (require-relative-list '("buffer/helper") "realgud-buffer-") - -(declare-function realgud:strip 'realgud) -(declare-function realgud-get-cmdbuf-from-srcbuf 'realgud-buffer-helper) -(declare-function realgud-srcbuf? 'realgud-buffer-source) - -(defstruct realgud-loc -"Our own location type. Even though a mark contains a -file-name (via a buffer) and a line number (via an offset), we -want to save the values that were seen/requested originally." - num ;; If there is a number such as a breakpoint or frame - ;; number associated with this location, this is set. - ;; nil otherwise. - filename - line-number - column-number ;; Column offset within line - source-text ;; Source text if available - marker ;; Position in source code - cmd-marker ;; Position in command process buffer -) - -(defalias 'realgud-loc? 'realgud-loc-p) - -;; The below function is generic and might be found in standard -;; library. Or it might be moved someplace more generic. -(defun realgud:buffer-line-no-props() - "Returns a string containing the line that `point' is at, -without buffer properties." - (buffer-substring-no-properties (point-at-bol) - (point-at-eol))) - -(defun realgud:loc-describe (loc) - "Display realgud-cmdcbuf-info. -Information is put in an internal buffer called *Describe*." - (interactive "") - (switch-to-buffer (get-buffer-create "*Describe*")) - (let ((link-start) (link-end) (map) (filename)) - (insert " - filename :: ") - (setq filename (realgud-loc-filename loc)) - (put-text-property - (insert-text-button filename - 'action 'realgud:follow-event - 'help-echo "mouse-2: go to this file") - (point) - 'file filename) - (insert "\n") - (mapc 'insert - (list - (format " - line number :: %s\n" (realgud-loc-line-number loc)) - (format " - brkpt num :: %s\n" (realgud-loc-num loc)) - (format " - column number :: %s\n" - (realgud-loc-column-number loc)) - (format " - source text :: %s\n" (realgud-loc-source-text loc)) - )) - ;; Make locations clickable - (insert " - source marker :: ") - (put-text-property - (insert-text-button (format "%s" (realgud-loc-marker loc)) - 'action 'realgud:follow-event - 'help-echo "mouse-2: go to this source location") - (point) - 'mark (realgud-loc-marker loc)) - - (insert "\n - cmdbuf marker :: ") - (put-text-property - (insert-text-button (format "%s" (realgud-loc-cmd-marker loc)) - 'action 'realgud:follow-event - 'help-echo "mouse-2: go to this command-buffer location") - (point) - 'mark (realgud-loc-cmd-marker loc)) - (insert "\n") - ) - ) - - -(defun realgud-loc-current(&optional source-buffer cmd-marker) - "Create a location object for the point in the current buffer. - If SOURCE-BUFFER is not given, take the current buffer as the - source buffer." - (interactive "") - (unless source-buffer - (setq source-buffer (current-buffer))) - (unless (realgud-srcbuf? source-buffer) - (error "%s is not a realgud source buffer" source-buffer)) - (unless cmd-marker - (setq cmd-marker - (realgud-get-cmdbuf-from-srcbuf source-buffer)) - ) - (with-current-buffer source-buffer - (let ((mark (point-marker)) - (text (realgud:buffer-line-no-props))) - (make-realgud-loc - :filename (buffer-file-name source-buffer) - :column-number (current-column) - :line-number (line-number-at-pos) - :source-text text - :marker mark - :cmd-marker cmd-marker - ) - ))) - -(defun realgud-loc-marker=(loc marker) - (setf (realgud-loc-marker loc) marker)) - -(defun realgud-loc-goto(loc) - "Position point in the buffer referred to by LOC. This may -involve reading in a file. In the process, the marker inside LOC -may be updated. - -If LOC is found, The buffer containing the location referred to, -the source-code buffer, is returned. Otherwise, nil is returned." - (if (realgud-loc? loc) - (let* ((filename (realgud-loc-filename loc)) - (line-number (realgud-loc-line-number loc)) - (column-number (realgud-loc-column-number loc)) - (marker (realgud-loc-marker loc)) - (cmd-marker (realgud-loc-cmd-marker loc)) - (use-marker nil) - (src-buffer (marker-buffer (or marker (make-marker))))) - (if (and (not src-buffer) filename) - (setq src-buffer (find-file-noselect filename))) - (if cmd-marker - (with-current-buffer (marker-buffer cmd-marker) - (goto-char cmd-marker))) - (if src-buffer - (with-current-buffer src-buffer - (when (and marker (marker-position marker)) - ;; A marker has been set in loc, so use that. - (goto-char (marker-position marker)) - (setq use-marker 't) - (let ((current-text (realgud:buffer-line-no-props)) - (loc-text (realgud-loc-source-text loc))) - (unless (and loc-text - (equal (realgud:strip current-text) (realgud:strip loc-text))) - (loc-changes-goto line-number) - (setq current-text (realgud:buffer-line-no-props)) - (when (equal current-text loc-text) - (message "Marked location needed updating") - (setq use-marker nil)) - ))) - (if use-marker - (goto-char (marker-position marker)) - ;; else - ;; We don't have a position set in the source buffer - ;; so find it and go there. We use `loc-changes-goto' - ;; to find that spot. `loc-changes-goto' keeps a - ;; record of the first time we went to that spot, so - ;; in the face of buffer modifications, it may be more - ;; reliable. - (let ((src-marker)) - (loc-changes-goto line-number) - (when column-number - (move-to-column column-number)) - (setq src-marker (point-marker)) - (realgud-loc-marker= loc src-marker) - )))) - src-buffer ))) - -(provide-me "realgud-") diff --git a/packages/realgud/realgud/common/lochist.el b/packages/realgud/realgud/common/lochist.el deleted file mode 100644 index ed6100113..000000000 --- a/packages/realgud/realgud/common/lochist.el +++ /dev/null @@ -1,132 +0,0 @@ -;;; Copyright (C) 2010, 2012, 2014-2015 Rocky Bernstein -;;; Debugger location ring -;;; Commentary: - -;; This file manages a ring of (recently stopped) positions to allow -;; the programmer to move between them. - -;;; Code: - -(require 'ring) -(require 'org) -(require 'load-relative) -(require-relative-list '("loc") "realgud-") - -(declare-function realgud:loc-describe 'realgud-loc) - -(defcustom realgud-loc-hist-size 20 ; For testing. Should really be larger. - "Size of realgud's position history ring" - :type 'integer - :group 'realgud) - -(defstruct realgud-loc-hist - "A list of source-code positions recently encountered" - (position -1) - (ring (make-ring realgud-loc-hist-size))) - -(defun realgud:loc-hist-describe(loc-hist) - "Format LOC-HIST values inside buffer *Describe*" - (switch-to-buffer (get-buffer-create "*Describe*")) - (org-mode) - (insert "** Source Positions Stopped At\n") - (mapc 'insert - (list - (format " - buffer size :: %d\n" realgud-loc-hist-size) - (format " - position :: %d\n" - (realgud-loc-hist-position loc-hist)))) - (let ((locs (cddr (realgud-loc-hist-ring loc-hist))) - (loc) - (i 0)) - (while (and (< i (length locs)) (setq loc (elt locs i)) (realgud-loc? loc) ) - (insert (format "*** %d\n" i)) - (realgud:loc-describe loc) - (setq i (1+ i)) - ) - ) -) - -(defun realgud-loc-hist-item-at(loc-hist position) - "Get the current item stored at POSITION of the ring -component in LOC-HIST" - (lexical-let ((ring (realgud-loc-hist-ring loc-hist))) - (if (ring-empty-p ring) - nil - (ring-ref ring position)))) - -(defun realgud-loc-hist-item(loc-hist) - "Get the current item of LOC-HIST at the position previously set" - (realgud-loc-hist-item-at - loc-hist - (realgud-loc-hist-position loc-hist))) - -(defun realgud-loc-hist-add(loc-hist loc) - "Add FRAME to LOC-HIST" - ;; Switching frames shouldn't save a new ring - ;; position. Also make sure no position is different. - ;; Perhaps duplicates should be controlled by an option. - (let* ((ring (realgud-loc-hist-ring loc-hist)) - (old-loc (realgud-loc-hist-item loc-hist))) - (unless (and - old-loc - (equal (realgud-loc-filename old-loc) - (realgud-loc-filename loc)) - (equal (realgud-loc-line-number old-loc) - (realgud-loc-line-number loc)) - (equal (realgud-loc-column-number old-loc) - (realgud-loc-column-number old-loc))) - (setf (realgud-loc-hist-position loc-hist) 0) - (ring-insert ring loc) - ) - )) - -(defun realgud-loc-hist-clear(loc-hist) - "Clear out all source locations in LOC-HIST" - (lexical-let* ((ring (ring-ref (realgud-loc-hist-ring loc-hist) - (realgud-loc-hist-position loc-hist))) - (head (car ring))) - (setf (realgud-loc-hist-position loc-hist) (- head 1)) - (while (not (ring-empty-p ring)) - (ring-remove ring)))) - -(defun realgud-loc-hist-index(loc-hist) - "Return the ring-index value of LOC-HIST" - (lexical-let* ( - (ring (realgud-loc-hist-ring loc-hist)) - (head (car ring)) - (ringlen (cadr ring)) - (index (mod (+ ringlen head - (- (realgud-loc-hist-position loc-hist))) - ringlen))) - (if (zerop index) ringlen index) - )) - -(defun realgud-loc-hist-set (loc-hist position) - "Set LOC-HIST to POSITION in the stopping history" - (setf (realgud-loc-hist-position loc-hist) position)) - -;; FIXME: add numeric arg? -(defun realgud-loc-hist-newer (loc-hist) - "Set LOC-HIST position to an newer position." - - (setf (realgud-loc-hist-position loc-hist) - (ring-minus1 (realgud-loc-hist-position loc-hist) - (ring-length (realgud-loc-hist-ring loc-hist))))) - -(defun realgud-loc-hist-newest (loc-hist) - "Set LOC-HIST position to the newest position." - (setf (realgud-loc-hist-position loc-hist) -1)) - -;; FIXME: add numeric arg? -(defun realgud-loc-hist-older (loc-hist) - "Set LOC-HIST position to an older position." - (setf (realgud-loc-hist-position loc-hist) - (ring-plus1 (realgud-loc-hist-position loc-hist) - (ring-length (realgud-loc-hist-ring loc-hist))))) - -(defun realgud-loc-hist-oldest (loc-hist) - "Set LOC-HIST to the oldest stopping point." - (lexical-let* ((ring (realgud-loc-hist-ring loc-hist)) - (head (car ring))) - (setf (realgud-loc-hist-position loc-hist) head))) - -(provide-me "realgud-") diff --git a/packages/realgud/realgud/common/menu.el b/packages/realgud/realgud/common/menu.el deleted file mode 100644 index 94d138518..000000000 --- a/packages/realgud/realgud/common/menu.el +++ /dev/null @@ -1,170 +0,0 @@ -;; Copyright (C) 2010-2011, 2015 Rocky Bernstein -;; ------------------------------------------------------------------- -;; Menu support. -;; - -(require 'load-relative) - -;; We want the doc strings from gdb-like commands for our help -;; menus. -(require-relative-list '("cmds") "realgud-") - -;; Note: We want the key binding to show in the menu. However, our -;; situation is a little bit complex: -;; -;; 1) We want the binding of the `common' man (i.e. the function key -;; the user has selected.) -;; -;; 2) We want this even when the menu is disabled and the key isn't -;; bound, typically when the debugger isn't running. -;; -;; This has been solved by setting up an explicit ":keys" properly. -(defun realgud-menu-item (common-map name cmd &rest args) - "Return a menu item entry with the correct key bindings. - -A command can be bound to a number of different key sequences. If -the realgud common map contains a binding it is displayed in the -menu. (The common map typically contains function key bindings.)" - (let ((key-binding (where-is-internal cmd (list common-map) t)) - (hint '())) - (if key-binding - (setq hint (list :keys (key-description key-binding)))) - (append (list 'menu-item name cmd) - hint - args))) - - -;; I had a *lot* of trouble with emacs keymaps and duplicate menus. -;; Don't use set-parent-mode on any minor mode. -;; It is possible that realgud-track-mode could be a derived major mode whose parent -;; is comint, but that seems drastic. -;; Instead we take the various minor modes and add a debugger menu to that. -(defun realgud-populate-debugger-menu (map) - "Populate the 'Debugger' menu inside an existing menu (short-key or track-mode)." - (let ((debugger-map (make-sparse-keymap "Debugger"))) - (define-key map [menu-bar debugger] (cons "Debugger" debugger-map)) - (define-key debugger-map [command] - (realgud-menu-item debugger-map "Go to Command Buffer" - 'realgud-window-cmd-undisturb-src - :enable '(and (realgud-get-process) (not (realgud-cmdbuf?))) - :help (documentation 'realgud-window-cmd-undisturb-src) - )) - - (define-key debugger-map [source] - (realgud-menu-item debugger-map "Go to Source Buffer" - 'realgud-window-src-undisturb-cmd - :enable '(and (realgud-get-process) (not (realgud-srcbuf?))) - :help (documentation 'realgud-window-src-undisturb-cmd) - )) - - (define-key debugger-map [info] - (realgud-menu-item debugger-map "Debugger Info" - 'realgud:cmdbuf-info-describe - :help (documentation 'realgud:cmdbuf-info-describe) - )) - - (define-key debugger-map [backtrace] - (realgud-menu-item debugger-map "Backtrace" 'realgud:window-bt - :enable '(realgud-get-process) - :help (documentation 'realgud:window-bt) - )) - - (define-key debugger-map [arrow3] - (realgud-menu-item debugger-map "Arrow 3" 'realgud-goto-arrow3 - :enable '(realgud-get-process) - :help (documentation 'realgud-goto-arrow3) - )) - - (define-key debugger-map [arrow2] - (realgud-menu-item debugger-map "Arrow 2" 'realgud-goto-arrow2 - :enable '(realgud-get-process) - :help (documentation 'realgud-goto-arrow2) - )) - - (define-key debugger-map [arrow1] - (realgud-menu-item debugger-map "Arrow 1" 'realgud-goto-arrow1 - :enable '(realgud-get-process) - :help (documentation 'realgud-goto-arrow1) - )) - - (define-key debugger-map [break] - (realgud-menu-item debugger-map "Set Breakpoint" 'realgud:cmd-break - :enable '(realgud-get-process) - :help (documentation 'realgud:cmd-break) - )) - - (define-key debugger-map [continue] - (realgud-menu-item debugger-map "Continue" 'realgud:cmd-continue - :enable '(realgud-get-process) - :help (documentation 'realgud:cmd-continue) - )) - - (define-key debugger-map [until] - (realgud-menu-item debugger-map "Continue to Line" 'realgud:cmd-until - :enable '(and (realgud-get-process) realgud-short-key-mode) - :help (documentation 'realgud:cmd-until) - )) - - (define-key debugger-map [next] - (realgud-menu-item debugger-map "Next (step through)" 'realgud:cmd-next - :enable '(realgud-get-process) - :help (documentation 'realgud:cmd-next) - )) - - (define-key debugger-map [finish] - (realgud-menu-item debugger-map "Finish (step out)" 'realgud:cmd-finish - :enable '(realgud-get-process) - :help (documentation 'realgud:cmd-finish) - )) - - (define-key debugger-map [step] - (realgud-menu-item debugger-map "Step (step into)" 'realgud:cmd-step - :enable '(realgud-get-process) - :help (documentation 'realgud:cmd-step) - )) - - (define-key debugger-map [menu-bar debugger line1] '(menu-item "--")) - - (define-key debugger-map [down] - (realgud-menu-item debugger-map "Down Stack" 'realgud:cmd-newer-frame - :enable '(realgud-get-process) - :help (documentation 'realgud:cmd-newer-frame) - )) - - (define-key debugger-map [up] - (realgud-menu-item debugger-map "Up Stack" 'realgud:cmd-older-frame - :enable '(realgud-get-process) - :help (documentation 'realgud:cmd-older-frame) - )) - - (define-key debugger-map [menu-bar debugger line1] '(menu-item "--")) - - (define-key debugger-map [quit] - (realgud-menu-item debugger-map "Quit" 'realgud:cmd-quit - :enable '(realgud-get-process) - :help (documentation 'realgud:cmd-quit) - )) - - (define-key debugger-map [restart] - (realgud-menu-item debugger-map "Restart" 'realgud:cmd-restart - :enable '(realgud-get-process) - :help (documentation 'realgud:cmd-restart) - )) - - (define-key debugger-map [eval] - (realgud-menu-item debugger-map "Evaluate Region" 'realgud:cmd-eval-region - :enable '(realgud-get-process) - :help (documentation 'realgud:cmd-eval-region) - )) - - (define-key debugger-map [Recenter] - (realgud-menu-item debugger-map "Recenter" 'realgud-recenter-arrow - :enable '(realgud-get-process) - :help (documentation 'realgud-recenter-arrow) - )) - ;; Put them in the menu bar: - (setq menu-bar-final-items (append '(debugger) menu-bar-final-items)) - map - )) - -(provide-me "realgud-") diff --git a/packages/realgud/realgud/common/regexp.el b/packages/realgud/realgud/common/regexp.el deleted file mode 100644 index bc7879591..000000000 --- a/packages/realgud/realgud/common/regexp.el +++ /dev/null @@ -1,48 +0,0 @@ -;;; Copyright (C) 2010-2011, 2014 Rocky Bernstein -;;; FIXME - think of a better name. -;;; -;;; Debugger regular expressions for many kinds of -;;; debuggers - -;;; Here we have hash tables used in each kind of debugger -;;; and names for patterns matching fields in a location -;;; structure - -;;; Code: - -;; ------------------------------------------------------------------- -;; Variables defining regular expressions (regexp:s). -;; - -(eval-when-compile (require 'cl)) - -(defstruct realgud-loc-pat - "Information to match and extract position and other related information typically -output by a debugger inside a process shell" - (num) ;; General number, could be for example breakpoint number, - ;; a stack position, or thread number. - (regexp) - (file-group) ;; Filename position in struct - (line-group) ;; Line number poistion in struct - (char-offset-group) ;; Character offset position in struct - (instruction-address-group) - (column-group) - (ignore-file-re) ;; Some debuggers create pseudo files in eval strings - ;; for example "(eval)" in Ruby and Perl - (text-group) ;; Some source text that should found at position - (class-group) ;; Java doesn't refer to files, but class names - (event-group) ;; Stopping event, e.g.statement, breakpoint, - ;; call, return, exception, etc. -) - -(defvar realgud-pat-hash (make-hash-table :test 'equal) - "Hash key is the debugger name, a string. The values of a hash entry - is a realgud-loc-pat struct") - -(defvar realgud-command-hash (make-hash-table :test 'equal) - "Hash key is the debugger name, a string. The values of a hash - entry is a hash table mapping cannonic command name - debugger-specific command name. For example, for trepanning: - 'quit' -> 'quit!'") - -(provide 'realgud-regexp) diff --git a/packages/realgud/realgud/common/reset.el b/packages/realgud/realgud/common/reset.el deleted file mode 100644 index c5c06b44d..000000000 --- a/packages/realgud/realgud/common/reset.el +++ /dev/null @@ -1,45 +0,0 @@ -;;; Copyright (C) 2010, 2014 Rocky Bernstein -;; reset state on quit or restart - -(require 'load-relative) -(require 'loc-changes) -(require-relative-list '("bp" "fringe" "helper") "realgud-") -(require-relative-list '("buffer/helper" "buffer/command" "buffer/source") - "realgud-buffer-") - -(declare-function loc-changes-clear-buffer 'loc-changes) -(declare-function realgud-bp-remove-icons 'realgud-buffer-command) -(declare-function realgud-cmdbuf? 'realgud-buffer-command) -(declare-function realgud-get-cmdbuf-from-srcbuf 'realgud-buffer-helper) -(declare-function realgud-fringe-erase-history-arrows - 'realgud-buffer-command) - -(defun realgud:reset (&optional opt-buffer) - "Reset state prior to quitting or restarting" - (interactive) - (let* ((buf (or opt-buffer (current-buffer))) - (cmdbuf - (cond ((realgud-cmdbuf? buf) buf) - ((realgud-get-cmdbuf-from-srcbuf buf)) - ('t nil)))) - (if cmdbuf - (with-current-buffer cmdbuf - (realgud-fringe-erase-history-arrows) - (let ((buf-list (realgud-sget 'cmdbuf-info 'srcbuf-list))) - (dolist (buf buf-list buf-list) - (with-current-buffer buf - (loc-changes-clear-buffer) - (realgud-fringe-erase-history-arrows) - ;; FIXME: iterate over specific breakpoints. - (realgud-bp-remove-icons (point-min) (point-max)) - ) - (message "buffer %s" buf) - )) - (setq realgud-cmdbuf-info nil) - ) - ;; else - (error "Unable to find command buffer from %s" buf) - )) - ) - -(provide-me "realgud-") diff --git a/packages/realgud/realgud/common/run.el b/packages/realgud/realgud/common/run.el deleted file mode 100644 index 93934e6e7..000000000 --- a/packages/realgud/realgud/common/run.el +++ /dev/null @@ -1,174 +0,0 @@ -;;; Copyright (C) 2014-2015 Rocky Bernstein -; (require 'term) - -(require 'shell) -(require 'list-utils) -(require 'load-relative) -(require-relative-list '("core" "track" "utils") "realgud-") -(require-relative-list '("buffer/command") "realgud-buffer-") - -(declare-function realgud-cmdbuf-info-in-debugger?= 'realgud-buffer-command) -(declare-function realgud-cmdbuf-info-cmd-args= 'realgud-buffer-command) -(declare-function realgud:track-set-debugger 'realgud-track) -(declare-function realgud-parse-command-arg 'realgud-core) -(declare-function realgud:expand-file-name-if-exists 'realgud-core) - -(defun realgud:parse-cmd-args(args two-args opt-two-args interp-regexp debugger-regexp - path-args-list annotate-args) - "Parse command line ARGS for the annotate level and name of script to debug. - -ARGS should contain a tokenized list of the command line to run. - -We return the a list containing: -* the command processor (e.g. bash) and it's arguments if any - a list of strings -* the name of the debugger given (e.g. bashdb) and its arguments - a list of strings. - If there is no debugger, for example gdb, nodejs then nil is returned. -* the script name and its arguments - list of strings -* whether the annotate or emacs option was given ('-A', '--annotate' or '--emacs) - a boolean - -The script name and options mentioning paths are file expanded - -For example for the following input - (map 'list 'symbol-name - '(bash --norc bashdb -l . --emacs ./gcd.sh a b)) - -we might return: - ((\"bash\" \"--norc\") (\"bashdb\" \"-l\" \"/tmp\" \"--emacs\") (\"/tmp/gcd.sh\" \"a\" \"b\") t) - -Note that path elements have been expanded via `expand-file-name'. -" - ;; Parse the following kind of pattern: - ;; [bash bash-options] bashdb bashdb-options script-name script-options - (let ( - (pair) - ;; Things returned - (script-name nil) - (debugger-name nil) - (interpreter-args '()) - (debugger-args '()) - (script-args '()) - (annotate-p nil)) - - (if (not (and args)) - ;; Got nothing: return '(nil, nil nil nil) - (list interpreter-args debugger-args script-args annotate-p) - ;; else - ;; Strip off optional interpreter name - (when (and interp-regexp - (string-match interp-regexp - (file-name-sans-extension - (file-name-nondirectory (car args))))) - (setq interpreter-args (list (pop args))) - - ;; Strip off compiler/intepreter-specific options - (while (and args - (string-match "^-" (car args))) - (setq pair (realgud-parse-command-arg - args two-args opt-two-args)) - (nconc interpreter-args (car pair)) - (setq args (cadr pair)))) - - ;; Skip to the first non-option argument. - (while (and args (not script-name)) - (let ((arg (car args))) - (cond - ;; path-like options - ((member arg path-args-list) - (setq arg (pop args)) - (nconc debugger-args - (list arg (realgud:expand-file-name-if-exists - (pop args))))) - ;; Other options with arguments. - ((string-match "^-" arg) - (setq pair (realgud-parse-command-arg - args two-args opt-two-args)) - (nconc debugger-args (car pair)) - (setq args (cadr pair))) - ;; Anything else must be the script to debug. - (t (setq script-name (realgud:expand-file-name-if-exists arg)) - (setq script-args (cons script-name (cdr args)))) - ))) - (list interpreter-args debugger-args script-args annotate-p)))) - -(defun realgud:run-process(debugger-name script-filename cmd-args - minibuffer-history - &optional no-reset) - "Runs `realgud-exec-shell' with DEBUGGER-NAME SCRIPT-FILENAME -and CMD-ARGS If this succeeds, we save CMD-ARGS in command-buffer -for use if we want to restart. If we don't succeed in running -the program, we will switch to the command buffer which shows -details of the error. The command buffer or nil is returned." - - (let ((cmd-buf)) - (condition-case nil - (setq cmd-buf - (apply 'realgud-exec-shell debugger-name script-filename - (car cmd-args) no-reset (cdr cmd-args))) - (error nil)) - ;; FIXME: Is there probably is a way to remove the - ;; below test and combine in condition-case? - (let ((process (get-buffer-process cmd-buf))) - (if (and process (eq 'run (process-status process))) - (progn - (switch-to-buffer cmd-buf) - (realgud:track-set-debugger debugger-name) - (realgud-cmdbuf-info-in-debugger?= 't) - (realgud-cmdbuf-info-cmd-args= cmd-args) - (when cmd-buf - (switch-to-buffer cmd-buf) - (when realgud-cmdbuf-info - (let* ((info realgud-cmdbuf-info) - (cmd-args (realgud-cmdbuf-info-cmd-args info)) - (cmd-str (mapconcat 'identity cmd-args " "))) - (set minibuffer-history - (list-utils-uniq (cons cmd-str - (eval minibuffer-history))) - )) - ))) - ;; else - (progn - (if cmd-buf (switch-to-buffer cmd-buf)) - (message "Error running command: %s" (mapconcat 'identity cmd-args " ")) - ) - ) - ) - cmd-buf - ) - ) - -(defun realgud:run-debugger (debugger-name query-cmdline-fn parse-cmd-args-fn - minibuffer-history - &optional opt-command-line - no-reset) - "Invoke the a debugger and start the Emacs user interface. - -String OPT-COMMAND-LINE specifies how to run DEBUGGER-NAME. You -will be prompted for a command line using QUERY-CMDLINE-FN is one -isn't supplied. - -OPT-COMMAND-LINE is treated like a shell string; arguments are -tokenized by `split-string-and-unquote'. The tokenized string is -parsed by PARSE-CMD-FN and path elements found by that -are expanded using `expand-file-name'. - -If successful, The command buffer of the debugger process is returned. -Otherwise nil is returned. -" - (let* ((cmd-str (or opt-command-line (funcall query-cmdline-fn debugger-name))) - (cmd-args (split-string-and-unquote cmd-str)) - (parsed-args (funcall parse-cmd-args-fn cmd-args)) - (script-args (caddr parsed-args)) - (script-name (car script-args)) - (parsed-cmd-args - (remove-if 'nil (realgud:flatten parsed-args))) - ) - (realgud:run-process debugger-name script-name parsed-cmd-args - minibuffer-history no-reset) - ) - ) - -(provide-me "realgud:") - -;; Local Variables: -;; byte-compile-warnings: (not cl-functions) -;; End: diff --git a/packages/realgud/realgud/common/send.el b/packages/realgud/realgud/common/send.el deleted file mode 100644 index be0b16a47..000000000 --- a/packages/realgud/realgud/common/send.el +++ /dev/null @@ -1,222 +0,0 @@ -;;; Copyright (C) 2010, 2014 Rocky Bernstein -(require 'comint) -(require 'load-relative) -(require-relative-list '("window") "realgud-") -(require-relative-list '("buffer/helper") "realgud-buffer-") - -(declare-function realgud-get-cmdbuf 'realgud-buffer-helper) -(declare-function comint-goto-process-mark 'comint) -(declare-function comint-send-input 'comint) - -(defun realgud-send-command-comint (process command-str) - "Assume we are in a comint buffer. Insert COMMAND-STR and -send that input onto the process." - (if (eq 'run (process-status process)) - (progn - (comint-goto-process-mark) - (setq comint-last-output-start - (setq realgud-last-output-start (point-marker))) - (insert command-str) - (comint-send-input) - ) - ;; else - (message "Process %s not in `run' state; not issuing %s" - process command-str) - ) - ) - -(defalias 'comint-output-filter-orig - (symbol-function 'comint-output-filter)) - -(defvar realgud-last-output-start) -(defun fake-output-filter(process string) - "A process output filter that saves the results into a temporary buffer." - (with-current-buffer (get-buffer-create "*realgud-process-output-temp*") - (goto-char (point-max)) - (set (make-local-variable 'realgud-last-output-start) - (point-marker)) - (insert (concat "\n" string)) - (goto-char (point-max)))) - -(defun realgud-send-command-process (process command-str) - "Invoke debugger COMMAND adding that command and the -results into the command buffer." - (fset 'comint-output-filter (symbol-function 'fake-output-filter)) - (apply comint-input-sender (list process command-str)) - (sit-for 0.25) ;; FIXME with something better - (fset 'comint-output-filter (symbol-function 'comint-output-filter-orig)) - ) - -;; Here are some other possibilities for functions. -;; Comint-specific: doesn't insert input into the buffer which is -;; what gud-call does. -;; (apply comint-input-sender (list proc command)) -;; -;; Works on any process-oriented buffer, not just comint. -;; (process-send-string (get-buffer-process (current-buffer)) -;; (concat command "\n")) - - -(defun realgud-send-command (command &optional opt-send-fn opt-buffer) - "Invoke the debugger COMMAND adding that command and the -results into the command buffer." - (let* ((cmdbuf (realgud-get-cmdbuf opt-buffer)) - (send-command-fn (or opt-send-fn (function realgud-send-command-comint))) - ) - (if cmdbuf - (with-current-buffer cmdbuf - (let ((process (get-buffer-process cmdbuf))) - (unless process - (realgud-cmdbuf-info-in-debugger?= nil) - (error "Command process buffer is not running") - ) - (if (realgud-sget 'cmdbuf-info 'in-debugger?) - (funcall send-command-fn process command) - (error "Command buffer doesn't think a debugger is running") - ) - )) - (error "Can't find command process buffer") - ))) - -(defun realgud-send-command-invisible (command-str) - (realgud-send-command command-str (function realgud-send-command-process))) - - -(defun realgud-expand-format (fmt-str &optional opt-str opt-buffer) - "Expands commands format characters inside FMT-STRING using values -from the debugging session. OPT-STR is an optional string. -Some %-escapes in the string arguments are expanded. These are: - - %f -- Name without directory of current source file. - %F -- Name without directory or extension of current source file. - %x -- Name of current source file. - %X -- Expanded name of current source file. - %d -- Directory of current source file. - %l -- Number of current source line. - %p -- Numeric prefix argument converted to a string - If no prefix argument %p is the null string. - %c -- Fully qualified class name derived from the expression - surrounding point. - %s -- value of opt-str. - -" - (let* ((buffer (or opt-buffer (current-buffer))) - (srcbuf (realgud-get-srcbuf buffer)) - (src-file-name (and srcbuf (buffer-file-name srcbuf))) - result) - (while (and fmt-str - (let ((case-fold-search nil)) - (string-match "\\([^%]*\\)%\\([dfFlpxXs]\\)" fmt-str))) - (let* ((key-str (match-string 2 fmt-str)) - (key (string-to-char key-str))) - (setq result - (concat - result (match-string 1 fmt-str) - (cond - ((eq key ?d) - (or (and src-file-name - (file-name-directory src-file-name)) - "*source-file-not-found-for-%d")) - ((eq key ?f) - (or (and src-file-name - (file-name-nondirectory src-file-name)) - "*source-file-not-found-for-%f*")) - ((eq key ?F) - (or (and src-file-name - (file-name-sans-extension - (file-name-nondirectory src-file-name))) - "*source-file-not-found-for-%F")) - ((eq key ?l) - (if srcbuf - (with-current-buffer srcbuf - (int-to-string - (save-restriction - (widen) - (+ (count-lines (point-min) (point)) - (if (bolp) 1 0))))) - "source-buffer-not-found-for-%l")) - ((eq key ?x) - (or (and src-file-name src-file-name) - "*source-file-not-found-for-%x")) - ((eq key ?X) - (or (and src-file-name (expand-file-name src-file-name)) - "*source-file-not-found-for-%X")) - ;; ((eq key ?e) - ;; (gud-find-expr)) - ;; ((eq key ?a) - ;; (gud-read-address)) - ;; ((eq key ?c) - ;; (gud-find-class srcbuf)) - ((eq key ?p) (if opt-str (int-to-string opt-str) "")) - ((eq key ?s) opt-str) - (t key))))) - (setq fmt-str (substring fmt-str (match-end 2)))) - ;; There might be text left in FMT-STR when the loop ends. - (concat result fmt-str))) - -(defun realgud-command (fmt &optional arg no-record? frame-switch? realgud-prompts?) - "Sends a command to the process associated with the command -buffer of the current buffer. A bit of checking is done before -sending the command to make sure that we can find a command -buffer, and that it has a running process associated with it. - -FMT is a string which may contain format characters that are -expanded. See `realgud-expand-format' for a list of the format -characters and their meanings. - -If NO-RECORD? is set, the command won't be recorded in the -position history. This is often done in status and information -gathering or frame setting commands and is generally *not* done -in commands that continue execution. - -If FRAME-SWITCH? is set, the fringe overlay array icon is set to -indicate the depth of the frame. - -If REALGUD-PROMPTS? is set, then then issuing the command will cause a -debugger prompt. -" - (interactive "sCommand (may contain format chars): ") - (let* ((command-str (realgud-expand-format fmt arg)) - (cmd-buff (realgud-get-cmdbuf)) - ) - (unless cmd-buff - (error "Can't find command buffer for buffer %s" (current-buffer))) - - ;; Display the expanded command in the message area unless the - ;; current buffer is the command buffer. - (unless (realgud-cmdbuf?) - (message "Command: %s" command-str)) - - (with-current-buffer cmd-buff - (let* ((process (get-buffer-process cmd-buff)) - (last-output-end (point-marker)) - (in-srcbuf? (realgud-sget 'cmdbuf-info 'in-srcbuf?)) - ) - (unless process - (error "Can't find process for command buffer %s" cmd-buff)) - (unless (eq 'run (process-status process)) - (error "Process %s isn't running; status %s" process - (process-status process))) - - (realgud-cmdbuf-info-no-record?= no-record?) - (realgud-cmdbuf-info-frame-switch?= frame-switch?) - - ;; Down the line we may handle prompting in a more - ;; sophisticated way. But for now, we handle this by forcing - ;; display of the command buffer. - (if realgud-prompts? (realgud-window-cmd-undisturb-src nil 't)) - - (realgud-send-command command-str (function realgud-send-command-comint)) - - ;; Wait for the process-mark to change before changing variables - ;; that effect the hook processing. - (while (and (eq 'run (process-status process)) - (equal last-output-end (process-mark process))) - (sit-for 0)) - - ;; Reset temporary hook-processing variables to their default state. - (realgud-cmdbuf-info-no-record?= nil) - (realgud-cmdbuf-info-frame-switch?= nil) - )))) - -(provide-me "realgud-") diff --git a/packages/realgud/realgud/common/shortkey.el b/packages/realgud/realgud/common/shortkey.el deleted file mode 100644 index 812f89005..000000000 --- a/packages/realgud/realgud/common/shortkey.el +++ /dev/null @@ -1,218 +0,0 @@ -;;; Copyright (C) 2010-2015 Rocky Bernstein -(require 'load-relative) -(require-relative-list '("custom" "helper" "key" "lochist" "loc" "menu") - "realgud-") -(require-relative-list '("buffer/command" "buffer/helper" "buffer/source") - "realgud-buffer-") - -(eval-when-compile - (defvar realgud:tool-bar-map) ;; Fully defined in track-mode -) - - -(declare-function realgud-cmdbuf? 'realgud-buffer-command) -(declare-function realgud:debugger-name-transform 'realgud-helper) -(declare-function realgud-get-cmdbuf 'realgud-buffer-helper) -(declare-function realgud:loc-follow 'realgud-loc) -(declare-function realgud-loc-hist-item-at 'realgud-lochist) -(declare-function realgud-cmdbuf-loc-hist 'realgud-command) -(declare-function realgud-populate-debugger-menu 'realgud-menu) -(declare-function realgud-populate-common-keys 'realgud-key) -(declare-function realgud-populate-src-buffer-map-plain 'realgud-key) -(declare-function realgud-srcbuf-info-short-key?=, 'realgud-source) -(declare-function realgud-srcbuf-info-was-read-only?= 'realgud-source) -(declare-function realgud-srcbuf? 'realgud-buffer-source) - -;; (defvar realgud::tool-bar-map) ;; fully defined in track-mode.el - -(defvar realgud:shortkey-mode-map - (let ((map (make-sparse-keymap))) - (suppress-keymap map) - (realgud-populate-debugger-menu map) - (realgud-populate-common-keys map) - (realgud-populate-src-buffer-map-plain map) - (define-key map "1" 'realgud-goto-arrow1) - (define-key map "2" 'realgud-goto-arrow2) - (define-key map "3" 'realgud-goto-arrow3) - (define-key map "4" 'realgud:goto-loc-hist-4) - (define-key map "5" 'realgud:goto-loc-hist-5) - (define-key map "6" 'realgud:goto-loc-hist-6) - (define-key map "7" 'realgud:goto-loc-hist-7) - (define-key map "8" 'realgud:goto-loc-hist-8) - (define-key map "9" 'realgud:goto-loc-hist-9) - (define-key map "b" 'realgud:cmd-break) - (define-key map "c" 'realgud:cmd-continue) - (define-key map "e" 'realgud:cmd-eval-region) - (define-key map "U" 'realgud:cmd-until) - - ;; FIXME: these can go to a common routine - (define-key map "<" 'realgud:cmd-newer-frame) - (define-key map ">" 'realgud:cmd-older-frame) - (define-key map "d" 'realgud:cmd-newer-frame) - (define-key map "u" 'realgud:cmd-older-frame) - (define-key map "l" 'realgud-recenter-arrow) - (define-key map "C" 'realgud-window-cmd-undisturb-src) - (define-key map "I" 'realgud:cmdbuf-info-describe) - (define-key map "S" 'realgud-window-src-undisturb-cmd) - - (define-key map "R" 'realgud:cmd-restart) - (define-key map "!" 'realgud:cmd-shell) - (define-key map [insert] 'realgud-short-key-mode) - (define-key map [(control x)(control q)] 'realgud-short-key-mode) - map) - "Keymap used in `realgud-short-key-mode'.") - -;; Implementation note: This is the mode that does all the work, it's -;; local to the buffer that is affected. -(define-minor-mode realgud-short-key-mode - "Minor mode with short keys for source buffers for the `dbgr' debugger. -The buffer is read-only when the minor mode is active. - -\\{realgud:shortkey-mode-map}" - :group 'realgud - :global nil - :init-value nil - :lighter " ShortKeys" - :keymap realgud:shortkey-mode-map - ;; executed on activation/deactivation: - (realgud-short-key-mode-setup realgud-short-key-mode)) - -(defun realgud-get-short-key-mode-map (cmdbuf) - (when (realgud-cmdbuf? cmdbuf) - (with-current-buffer cmdbuf - (let* ((info realgud-cmdbuf-info) - (debugger-name - (realgud:debugger-name-transform - (realgud-cmdbuf-info-debugger-name info))) - (keymap-symbol - (intern - (replace-regexp-in-string - "\\." "" - (concat debugger-name "-short-key-mode-map")))) - (keymap (eval keymap-symbol)) - ) - (cond ((keymapp keymap) keymap) - ('t nil)) - )) - )) - -(defun realgud-short-key-mode-setup (mode-on?) - "Called when entering or leaving `realgud-short-key-mode'. Variable -MODE-ON? a boolean which specifies if we are going into or out of this mode." - (if (realgud-srcbuf?) - (let* ((cmdbuf (realgud-get-cmdbuf)) - (shortkey-keymap (realgud-get-short-key-mode-map cmdbuf)) - ) - - ;; If there's a shortkey keymap that is custom - ;; for this debugger mode, use it. - (when shortkey-keymap - (cond - (mode-on? - (set (make-local-variable 'tool-bar-map) realgud:tool-bar-map) - (use-local-map shortkey-keymap)) - ('t - (kill-local-variable 'realgud:tool-bar-map) - (use-local-map nil)) - )) - - ;; Ensure action only is performed when the state actually is toggled. - ;; or when not read-only - (when (or (not buffer-read-only) - (not (eq (realgud-sget 'srcbuf-info 'short-key?) mode-on?))) - ;; Save the current state, so we can determine when the - ;; state is toggled in the future. - (when (not (eq (realgud-sget 'srcbuf-info 'short-key?) mode-on?)) - (realgud-srcbuf-info-short-key?= mode-on?) - (setq realgud-short-key-mode mode-on?) - (if mode-on? - ;; mode is being turned on. - (progn - (realgud-srcbuf-info-was-read-only?= buffer-read-only) - - ;; If there's a shortkey keymap that is custom - ;; for this debugger mode, use it. - (if shortkey-keymap (use-local-map shortkey-keymap)) - - (local-set-key [m-insert] 'realgud-short-key-mode) - (when realgud-srcbuf-lock (setq buffer-read-only t)) - (run-mode-hooks 'realgud-short-key-mode-hook)) - ;; mode is being turned off: restore read-only state. - (setq buffer-read-only - (realgud-sget 'srcbuf-info 'was-read-only?)))) - ;; (with-current-buffer-safe cmdbuf - ;; (realgud-cmdbuf-info-src-shortkey?= mode-on?) - ;; (realgud-cmdbuf-info-in-srcbuf?= mode-on?) - ;; ) - )) - (progn - (setq realgud-short-key-mode nil) - (error "buffer %s does not seem to be attached to a debugger" - (buffer-name))))) - -(defun realgud-short-key-mode-off () - "Turn off `realgud-short-key-mode' in all buffers." - (interactive) - (save-excursion - (dolist (buf (buffer-list)) - (set-buffer buf) - (when realgud-short-key-mode - (realgud-short-key-mode-setup 0))))) - -(defun realgud-populate-src-buffer-map (map) - "Bind all common keys and menu used in the dbgr src buffers. -This includes the keys bound to `realgud-key-prefix' (typically C-x -C-a)." - (realgud-populate-src-buffer-map-plain map) - (realgud-populate-common-keys map) - (let ((prefix-map (make-sparse-keymap))) - (realgud-populate-debugger-menu map) - (realgud-populate-src-buffer-map-plain prefix-map) - (define-key map realgud-key-prefix prefix-map))) - -(defun realgud:goto-loc-hist(num) - "Go to position nth from the newest position." - (let ((cmdbuf (realgud-get-cmdbuf))) - (if cmdbuf - (let* ((loc-hist (realgud-cmdbuf-loc-hist cmdbuf)) - (loc (realgud-loc-hist-item-at loc-hist (- num))) - (loc-marker (realgud-loc-marker loc))) - (realgud:loc-follow loc-marker)) - ;; else - (message "No command buffer associated with this buffer") - ))) - - -(defun realgud:goto-loc-hist-4 () - "Go to position 4th from the newest position." - (interactive "") - (realgud:goto-loc-hist 4)) - -(defun realgud:goto-loc-hist-5 () - "Go to position 5th from the newest position." - (interactive "") - (realgud:goto-loc-hist 5)) - -(defun realgud:goto-loc-hist-6 () - (interactive "") - (realgud:goto-loc-hist 6)) - -(defun realgud:goto-loc-hist-7 () - "Go to position 7th from the newest position." - (interactive "") - (realgud:goto-loc-hist 7)) - -(defun realgud:goto-loc-hist-8 () - "Go to position 8th from the newest position." - (interactive "") - (realgud:goto-loc-hist 8)) - -(defun realgud:goto-loc-hist-9 () - "Go to position 9th from the newest position." - (interactive "") - (realgud:goto-loc-hist 9)) - -(provide-me "realgud-") - -;;; Local variables: -;;; End: diff --git a/packages/realgud/realgud/common/track-mode.el b/packages/realgud/realgud/common/track-mode.el deleted file mode 100644 index 0f25ab831..000000000 --- a/packages/realgud/realgud/common/track-mode.el +++ /dev/null @@ -1,205 +0,0 @@ -;;; Copyright (C) 2010-2015 Rocky Bernstein -;;; tracks shell output - -(eval-when-compile (require 'cl)) -(require 'shell) - -(require 'load-relative) -(require-relative-list - '("core" "helper" "track" "loc" "lochist" "file" - "fringe" "window" "regexp" "menu" "backtrace-mode" - "send" "shortkey") "realgud-") - -(require-relative-list '("buffer/command") "realgud-buffer-") - -;; FIXME figure out if I can put this in something like a header file. -(declare-function realgud-fringe-erase-history-arrows 'realgud-buffer-command) -(declare-function realgud:track-set-debugger 'realgud-track) -(declare-function realgud-populate-debugger-menu 'realgud-menu) -(declare-function realgud-cmdbuf-info-divert-output?= - 'realgud-buffer-command) -(declare-function realgud-cmdbuf-info-prior-prompt-regexp= - 'realgud-buffer-command) -(declare-function realgud-cmdbuf-info-set? - 'realgud-buffer-command) - - -(defvar realgud-track-mode-map - (let ((map (copy-keymap shell-mode-map))) - (realgud-populate-debugger-menu map) - (define-key map [M-right] 'realgud-track-hist-newest) - (define-key map [M-down] 'realgud-track-hist-newer) - (define-key map [M-up] 'realgud-track-hist-older) - (define-key map [M-print] 'realgud-track-hist-older) - (define-key map [M-S-down] 'realgud-track-hist-newest) - (define-key map [M-S-up] 'realgud-track-hist-oldest) - (define-key map "\C-cS" 'realgud-window-src-undisturb-cmd) - map) - "Keymap used in `realgud-track-minor-mode'.") - -(defvar realgud:tool-bar-map - (let ((map (make-sparse-keymap))) - (dolist (x '((realgud:cmd-break . "gud/break") - ;; (realgud:cmd-remove . "gud/remove") - ;; (realgud:cmd-print . "gud/print") - ;; (realgud:cmd-pstar . "gud/pstar") - ;; (realgud:cmd-pp . "gud/pp") - ;; (realgud:cmd-watch . "gud/watch") - (realgud:cmd-restart . "gud/run") - ;; (realgud:cmd-go . "gud/go") - ;; (realgud:cmd-stop-subjob . "gud/stop") - (realgud:cmd-continue . "gud/cont") - (realgud:cmd-until . "gud/until") - (realgud:cmd-next . "gud/next") - (realgud:cmd-step . "gud/step") - (realgud:cmd-finish . "gud/finish") - ;; (realgud:cmd-nexti . "gud/nexti") - ;; (realgud:cmd-stepi . "gud/stepi") - (realgud:cmd-older-frame . "gud/up") - (realgud:cmd-newer-frame . "gud/down") - (realgud:cmdbuf-info-describe . "info")) - map) - (tool-bar-local-item-from-menu - (car x) (cdr x) map realgud-track-mode-map))) - "toolbar use when `realgud' interface is active" - ) - -(define-minor-mode realgud-track-mode - "Minor mode for tracking debugging inside a process shell." - :init-value nil - :global nil - :group 'realgud - - :lighter - (:eval (progn - (concat " " - (if (realgud-cmdbuf-info-set?) - (realgud-sget 'cmdbuf-info 'debugger-name) - "dbgr??")))) - - :keymap realgud-track-mode-map - ;; Setup/teardown - (realgud-track-mode-setup realgud-track-mode) - ) - -;; FIXME: this should have been picked up by require'ing track. -(defvar realgud-track-divert-string) - -(defun realgud-track-mode-setup (mode-on?) - "Called when entering or leaving `realgud-track-mode'. Variable -MODE-ON is a boolean which specifies if we are going into or out -of this mode." - (if mode-on? - (let ((process (get-buffer-process (current-buffer)))) - (unless process - (setq realgud-track-mode nil) - (error "Can't find a process for buffer %s" (current-buffer))) - - (setq realgud-track-divert-string "") - (setq realgud-track-mode 't) - - ;; FIXME: save and chain process-sentinel via - ;; (process-sentinel (get-buffer-process (current-buffer))) - (set-process-sentinel process 'realgud-term-sentinel) - (unless (and (realgud-cmdbuf-info-set?) - (realgud-sget 'cmdbuf-info 'debugger-name)) - (call-interactively 'realgud:track-set-debugger)) - (if (boundp 'comint-last-output-start) - (progn - (realgud-cmdbuf-info-prior-prompt-regexp= comint-prompt-regexp) - (realgud-cmdbuf-info-divert-output?= nil) - (let* ((regexp-hash - (and (realgud-cmdbuf-info? realgud-cmdbuf-info) - (realgud-sget 'cmdbuf-info 'regexp-hash))) - (prompt-pat (and regexp-hash - (gethash "prompt" regexp-hash)))) - (if prompt-pat - (setq comint-prompt-regexp - (realgud-loc-pat-regexp prompt-pat))))) - (set-marker comint-last-output-start (point))) - - (set (make-local-variable 'tool-bar-map) realgud:tool-bar-map) - (add-hook 'comint-output-filter-functions - 'realgud-track-comint-output-filter-hook) - (add-hook 'eshell-output-filter-functions - 'realgud-track-eshell-output-filter-hook) - (run-mode-hooks 'realgud-track-mode-hook)) - ;; else - (progn - (if (and (boundp 'comint-last-output-start) realgud-cmdbuf-info) - (setq comint-prompt-regexp - (realgud-sget 'cmdbuf-info 'prior-prompt-regexp)) - ) - (kill-local-variable 'realgud:tool-bar-map) - (realgud-fringe-erase-history-arrows) - (remove-hook 'comint-output-filter-functions - 'realgud-track-comint-output-filter-hook) - (remove-hook 'eshell-output-filter-functions - 'realgud-track-eshell-output-filter-hook) - (let* ((cmd-process (get-buffer-process (current-buffer))) - (status (if cmd-process - (list (propertize (format ":%s" - (process-status cmd-process)) - 'face 'debugger-running)) - "")) - ) - (setq mode-line-process status) - ;; Force mode line redisplay soon. - (force-mode-line-update) - ;; FIXME: This is a workaround. Without this, we comint doesn't - ;; process commands - (unless (member 'comint-mode minor-mode-list) (comint-mode)) - ) - - ;; FIXME: restore/unchain old process sentinels. - ) - ) - ) - -;; For name == "trepan", produces: -;; (defvar trepan-track-mode nil -;; "Non-nil if using trepan track-mode ... " -;; (defvar trepan-track-mode-map (make-sparse-keymap)) -;; (defvar trepan-short-key-mode-map (make-sparse-keymap)) -;; (set-keymap-parent trepan-short-key-mode-map realgud-short-key-mode-map) -(defmacro realgud-track-mode-vars (name) - `(progn - (defvar ,(intern (concat name "-track-mode")) nil - ,(format "Non-nil if using %s-track-mode as a minor mode of some other mode. -Use the command `%s-track-mode' to toggle or set this variable." name name)) - (defvar ,(intern (concat name "-track-mode-map")) (make-sparse-keymap) - ,(format "Keymap used in `%s-track-mode'." name)) - (defvar ,(intern (concat name "-short-key-mode-map")) (make-sparse-keymap)) - )) - -;; FIXME: The below could be a macro? I have a hard time getting -;; macros right. -(defun realgud-track-mode-body(name) - "Used in by custom debuggers: pydbgr, trepan, gdb, etc. NAME is -the name of the debugger which is used to preface variables." - (realgud:track-set-debugger name) - (funcall (intern (concat "realgud-define-" name "-commands"))) - (if (intern (concat name "-track-mode")) - (progn - (setq realgud-track-mode 't) - (run-mode-hooks (intern (concat name "-track-mode-hook")))) - (progn - (setq realgud-track-mode nil) - ))) - -(defun realgud:track-mode-disable() - "Disable the debugger track-mode hook" - (interactive "") - (if realgud-track-mode - (setq realgud-track-mode nil) - (message "Debugger is not in track mode"))) - -(defun realgud:track-mode-enable() - "Enable the debugger track-mode hook" - (interactive "") - (if realgud-track-mode - (message "Debugger track mode is already enabled.") - (setq realgud-track-mode t)) - ) - -(provide-me "realgud-") diff --git a/packages/realgud/realgud/common/track.el b/packages/realgud/realgud/common/track.el deleted file mode 100644 index 2ddfc73ed..000000000 --- a/packages/realgud/realgud/common/track.el +++ /dev/null @@ -1,678 +0,0 @@ -;;; Copyright (C) 2011-2015 Rocky Bernstein -(declare-function realgud:terminate &optional cmdbuf) - -(defconst realgud-track-char-range 10000 - "Max number of characters from end of buffer to search for stack entry.") - -;; Shell process buffers that we can hook into: -(require 'esh-mode) -(require 'comint) - -(require 'load-relative) -(require-relative-list - '("core" "file" "fringe" - "helper" "init" "loc" "lochist" - "regexp" "shortkey" "window" - "bp" - ) "realgud-") - -(require-relative-list - '("buffer/command" "buffer/helper" "buffer/source") "realgud-buffer-") - -(defcustom realgud-short-key-on-tracing? nil -"If non-nil, set short-key mode for any source buffer that is traced into" - :type 'symbolp - :group 'realgud) - -(declare-function fn-p-to-fn?-alias 'realgud-helper) -(declare-function realgud-bp-add-info 'realgud-bp) -(declare-function realgud-bp-del-info 'realgud-bp) -(declare-function realgud-cmdbuf-add-srcbuf 'realgud-buffer-command) -(declare-function realgud-cmdbuf-debugger-name 'realgud-buffer-command) -(declare-function realgud-cmdbuf-info-bp-list= 'realgud-buffer-command) -(declare-function realgud-cmdbuf-info-divert-output?= 'realgud-buffer-command) -(declare-function realgud-cmdbuf-info-in-debugger? 'realgud-buffer-command) -(declare-function realgud-cmdbuf-info-in-debugger?= 'realgud-buffer-command) -(declare-function realgud-cmdbuf-info-last-input-end= 'realgud-buffer-command) -(declare-function realgud-cmdbuf-init 'realgud-buffer-command) -(declare-function realgud-cmdbuf-loc-hist 'realgud-buffer-command) -(declare-function realgud-cmdbuf-mode-line-update 'realgud-buffer-command) -(declare-function realgud-cmdbuf-mode-line-update 'realgud-buffer-command) -(declare-function realgud-cmdbuf-pat 'realgud-buffer-command) -(declare-function realgud-cmdbuf? 'realgud-buffer-command) -(declare-function realgud-cmdbuf-info-in-srcbuf?= 'realgud-buffer-command) -(declare-function realgud:debugger-name-transform 'realgud-helper) -(declare-function realgud:terminate 'realgud-core) -(declare-function realgud:file-loc-from-line 'realgud-file) -(declare-function realgud-fringe-history-set 'realgud-fringe) -(declare-function realgud-get-cmdbuf 'realgud-buffer-command) -(declare-function realgud-get-srcbuf-from-cmdbuf 'realgud-buffer-helper) -(declare-function realgud-loc-goto 'realgud-loc) -(declare-function realgud-loc-hist-add 'realgud-lochist) -(declare-function realgud-loc-hist-index 'realgud-lochist) -(declare-function realgud-loc-hist-item 'realgud-lochist) -(declare-function realgud-loc? 'realgud-loc) -(declare-function realgud-short-key-mode-setup 'realgud-shortkey) -(declare-function realgud-srcbuf-init-or-update 'realgud-source) -(declare-function realgud-srcbuf-loc-hist 'realgud-source) -(declare-function realgud-window-src 'realgud-window) -(declare-function realgud-window-src-undisturb-cmd 'realgud-window) -(declare-function realgud-window-update-position 'realgud-window) - -(make-variable-buffer-local (defvar realgud-track-mode)) -(fn-p-to-fn?-alias 'realgud-loc-p) - -(defvar realgud-track-divert-string) - -(defun realgud-track-comint-output-filter-hook(text) - "An output-filter hook custom for comint shells. Find -location/s, if any, and run the action(s) associated with -finding a new location/s. The parameter TEXT appears because it -is part of the comint-output-filter-functions API. Instead we use -marks set in buffer-local variables to extract text" - - ;; Instead of trying to piece things together from partial text - ;; (which can be almost useless depending on Emacs version), we - ;; monitor to the point where we have the next dbgr prompt, and then - ;; check all text from comint-last-input-end to process-mark. - - ;; FIXME: Add unwind-protect? - (if (and realgud-track-mode (realgud-cmdbuf? (current-buffer))) - (let* ((cmd-buff (current-buffer)) - (cmd-mark (point-marker)) - (curr-proc (get-buffer-process cmd-buff)) - (cmdbuf-last-output-end - (realgud-cmdbuf-info-last-input-end realgud-cmdbuf-info)) - (last-output-end (process-mark curr-proc)) - (last-output-start (max comint-last-input-end - (- last-output-end realgud-track-char-range)))) - ;; Sometimes we get called twice and the second time nothing - ;; changes. Guard against this. - (unless (= last-output-start last-output-end) - (unless (= last-output-end cmdbuf-last-output-end) - (setq last-output-start (max last-output-start - cmdbuf-last-output-end)) - ) - ;; Done with using old command buffer's last-input-end. - ;; Update that for next time. - (realgud-cmdbuf-info-last-input-end= last-output-start) - (realgud:track-from-region last-output-start - last-output-end cmd-mark cmd-buff - 't 't)) - ) - ) - ) - -(defun realgud-track-eshell-output-filter-hook() - "An output-filter hook custom for eshell shells. Find -location(s), if any, and run the action(s) associated with We use -marks set in buffer-local variables to extract text" - - ;; FIXME: Add unwind-protect? - (if realgud-track-mode - (lexical-let* ((cmd-buff (current-buffer)) - (cmd-mark (point-marker)) - (loc (realgud:track-from-region eshell-last-output-start - eshell-last-output-end cmd-mark))) - (realgud-track-loc-action loc cmd-buff 't))) - ) - -(defun realgud-track-term-output-filter-hook(text) - "An output-filter hook custom for ansi-term shells. Find -location/s, if any, and run the action(s) associated with -finding a new location/s. The parameter TEXT appears because it -is part of the comint-output-filter-functions API. Instead we use -marks set in buffer-local variables to extract text" - (if (and realgud-track-mode (realgud-cmdbuf? (current-buffer))) - (realgud-track-loc text (point-marker)) - )) - -(defun realgud:track-from-region(from to &optional cmd-mark opt-cmdbuf - shortkey-on-tracing? no-warn-if-no-match?) - "Find and position a buffer at the location found in the marked region. - -You might want to use this function interactively after marking a -region in a debugger-tracked shell buffer (see `realgud-track-mode') -or a more dedicated debugger command buffer. - -The marked region location should match the regexp found in the -buffer-local variable `realgud-cmdbuf-info' structure under the -field loc-regexp. You can see what this is by -evaluating (realgud-cmdbuf-info-loc-regexp realgud-cmdbuf-info)" - - (interactive "r") - (if (> from to) (psetq to from from to)) - (let* ((text (buffer-substring-no-properties from to)) - (loc (realgud-track-loc text cmd-mark)) - ;; If we see a selected frame number, it is stored - ;; in frame-num. Otherwise, nil. - (frame-num) - (text-sans-loc) - (bp-loc) - (cmdbuf (or opt-cmdbuf (current-buffer))) - ) - (if (realgud-cmdbuf? cmdbuf) - (if (not (equal "" text)) - (with-current-buffer cmdbuf - (if (realgud-sget 'cmdbuf-info 'divert-output?) - (realgud-track-divert-prompt text cmdbuf to)) - ;; FIXME: instead of these fixed filters, - ;; put into a list and iterate over that. - (realgud-track-termination? text) - (setq text-sans-loc (or (realgud-track-loc-remaining text) text)) - (setq frame-num (realgud-track-selected-frame text) text) - (setq bp-loc (realgud-track-bp-loc text-sans-loc cmd-mark cmdbuf)) - (if bp-loc - (let ((src-buffer (realgud-loc-goto bp-loc))) - (realgud-cmdbuf-add-srcbuf src-buffer cmdbuf) - (with-current-buffer src-buffer - (realgud-bp-add-info bp-loc) - ))) - (if loc - (let ((selected-frame - (or (not frame-num) - (eq frame-num (realgud-cmdbuf-pat "top-frame-num"))))) - (realgud-track-loc-action loc cmdbuf (not selected-frame) - shortkey-on-tracing?) - (realgud-cmdbuf-info-in-debugger?= 't) - (realgud-cmdbuf-mode-line-update) - ) - (progn - (setq bp-loc (realgud-track-bp-delete text-sans-loc cmd-mark cmdbuf)) - (if bp-loc - (let ((src-buffer (realgud-loc-goto bp-loc))) - (realgud-cmdbuf-add-srcbuf src-buffer cmdbuf) - (with-current-buffer src-buffer - (realgud-bp-del-info bp-loc) - )))) - ) - ) - ) - ;; else - (error "Buffer %s is not a debugger command buffer" cmdbuf)) - ) - ) - -(defun realgud-track-hist-fn-internal(fn) - "Update both command buffer and a source buffer to reflect the -selected location in the location history. If we started in a -command buffer, we stay in a command buffer. Moving inside a -command buffer always shows the corresponding source -file. However it is possible in shortkey mode to show only the -source code window, even the commmand buffer is updated albeit -unshown." - - (let ((cmdbuf (realgud-get-cmdbuf (current-buffer)))) - (if cmdbuf - (let* ((loc-hist (realgud-cmdbuf-loc-hist cmdbuf)) - (window (selected-window)) - (position (funcall fn loc-hist)) - (stay-in-cmdbuf? - (or (eq (current-buffer) cmdbuf) - (with-current-buffer cmdbuf - (not (realgud-sget 'cmdbuf-info 'in-srcbuf?))))) - (loc (realgud-loc-hist-item loc-hist)) - (srcbuf (realgud-get-srcbuf-from-cmdbuf cmdbuf loc)) - ) - (set-buffer (realgud-loc-goto loc)) - - ;; Make sure command buffer is updated - (realgud-window-update-position cmdbuf - (realgud-loc-cmd-marker loc)) - - ;; FIXME turn into fn. combine with realgud-track-loc-action. - (if stay-in-cmdbuf? - (let ((cmd-window (realgud-window-src-undisturb-cmd srcbuf))) - (if cmd-window (select-window cmd-window))) - (realgud-window-src srcbuf) - ) - - ;; Make sure source buffer is updated - (realgud-window-update-position srcbuf - (realgud-loc-marker loc)) - - (message "history position %s line %s" - (realgud-loc-hist-index loc-hist) - (realgud-loc-line-number loc)) - (select-window window))) - )) - -;; FIXME: Can we dry code more via a macro? -(defun realgud-track-hist-newer() - (interactive) - (realgud-track-hist-fn-internal 'realgud-loc-hist-newer)) - -(defun realgud-track-hist-newest() - (interactive) - (realgud-track-hist-fn-internal 'realgud-loc-hist-newest)) - -(defun realgud-track-hist-older() - (interactive) - (realgud-track-hist-fn-internal 'realgud-loc-hist-older)) - -(defun realgud-track-hist-oldest() - (interactive) - (realgud-track-hist-fn-internal 'realgud-loc-hist-oldest)) - -(defun realgud-track-loc-action (loc cmdbuf &optional not-selected-frame - shortkey-on-tracing?) - "If loc is valid, show loc and do whatever actions we do for -encountering a new loc." - (if (realgud-loc? loc) - (let* - ((cmdbuf-loc-hist (realgud-cmdbuf-loc-hist cmdbuf)) - (cmdbuf-local-overlay-arrow? - (with-current-buffer cmdbuf - (local-variable-p 'overlay-arrow-variable-list))) - (stay-in-cmdbuf? - (with-current-buffer cmdbuf - (not (realgud-sget 'cmdbuf-info 'in-srcbuf?)))) - (shortkey-mode? - (with-current-buffer cmdbuf - (realgud-sget 'cmdbuf-info 'src-shortkey?))) - (srcbuf) - (srcbuf-loc-hist) - ) - - (setq srcbuf (realgud-loc-goto loc)) - (realgud-srcbuf-init-or-update srcbuf cmdbuf) - (setq srcbuf-loc-hist (realgud-srcbuf-loc-hist srcbuf)) - (realgud-cmdbuf-add-srcbuf srcbuf cmdbuf) - - (with-current-buffer srcbuf - (realgud-short-key-mode-setup - (and shortkey-on-tracing? - (or realgud-short-key-on-tracing? shortkey-mode?)) - )) - - ;; Do we need to go back to the process/command buffer because other - ;; output-filter hooks run after this may assume they are in that - ;; buffer? If so, we may have to use set-buffer rather than - ;; switch-to-buffer in some cases. - (set-buffer cmdbuf) - - (unless (realgud-sget 'cmdbuf-info 'no-record?) - (realgud-loc-hist-add srcbuf-loc-hist loc) - (realgud-loc-hist-add cmdbuf-loc-hist loc) - (realgud-fringe-history-set cmdbuf-loc-hist cmdbuf-local-overlay-arrow?) - ) - - ;; FIXME turn into fn. combine with realgud-track-hist-fn-internal - (if stay-in-cmdbuf? - (let ((cmd-window (realgud-window-src-undisturb-cmd srcbuf))) - (with-current-buffer srcbuf - (if (and (boundp 'realgud-overlay-arrow1) - (markerp realgud-overlay-arrow1)) - (progn - ;; Doesn't work - ;; (if not-selected-frame - ;; (set-fringe-bitmap-face 'hollow-right-triangle - ;; 'realgud-overlay-arrow1) - ;; ; else - ;; (set-fringe-bitmap-face 'realgud-right-triangle1 - ;; 'realgud-overlay-arrow1) - ;; ) - (realgud-window-update-position srcbuf realgud-overlay-arrow1))) - ) - (if cmd-window (select-window cmd-window))) - ; else - (with-current-buffer srcbuf - (realgud-window-src srcbuf) - (realgud-window-update-position srcbuf realgud-overlay-arrow1)) - ;; reset 'in-srcbuf' to allow the command buffer to keep point focus - ;; when used directly. 'in-srcbuf' is set 't' early in the stack - ;; (prior to common command code, e.g. this) when any command is run - ;; from a source buffer - (with-current-buffer cmdbuf - (realgud-cmdbuf-info-in-srcbuf?= nil)) - ) - )) - ) - -(defun realgud-track-loc(text cmd-mark &optional opt-regexp opt-file-group - opt-line-group no-warn-on-no-match? - opt-ignore-file-re) - "Do regular-expression matching to find a file name and line number inside -string TEXT. If we match, we will turn the result into a realgud-loc struct. -Otherwise return nil." - - ;; NOTE: realgud-cmdbuf-info is a buffer variable local to the process running - ;; the debugger. It contains a realgud-cmdbuf-info "struct". In that struct are - ;; the fields loc-regexp, file-group, and line-group. By setting the - ;; the fields of realgud-cmdbuf-info appropriately we can accomodate a family - ;; of debuggers -- one at a time -- for the buffer process. - - (if (realgud-cmdbuf?) - (let - ((loc-regexp (or opt-regexp - (realgud-sget 'cmdbuf-info 'loc-regexp))) - (file-group (or opt-file-group - (realgud-sget 'cmdbuf-info 'file-group))) - (line-group (or opt-line-group - (realgud-sget 'cmdbuf-info 'line-group))) - (text-group (realgud-sget 'cmdbuf-info 'text-group)) - (ignore-file-re (or opt-ignore-file-re - (realgud-sget 'cmdbuf-info 'ignore-file-re))) - (callback-loc-fn (realgud-sget 'cmdbuf-info 'callback-loc-fn)) - ) - (if loc-regexp - (if (string-match loc-regexp text) - (let* ((filename (match-string file-group text)) - (line-str (match-string line-group text)) - (source-str (and text-group - (match-string text-group text))) - (lineno (string-to-number (or line-str "1")))) - (when source-str - (setq source-str (ansi-color-filter-apply - source-str))) - (cond (callback-loc-fn - (funcall callback-loc-fn text - filename lineno source-str - ignore-file-re cmd-mark)) - ('t - (unless line-str - (message "line number not found -- using 1")) - (if (and filename lineno) - (realgud:file-loc-from-line filename lineno - cmd-mark - source-str nil - ignore-file-re) - ;; else - nil))))) - ;; else - (and (message - (concat "Buffer variable for regular expression pattern not" - " given and not passed as a parameter")) nil))) - ;; else - (and (message "Current buffer %s is not a debugger command buffer" - (current-buffer)) nil) - ) - ) - -(defun realgud-track-bp-loc(text &optional cmd-mark cmdbuf ignore-file-re) - "Do regular-expression matching to find a file name and line number inside -string TEXT. If we match, we will turn the result into a realgud-loc struct. -Otherwise return nil. CMD-MARK is set in the realgud-loc object created. -" - - ; NOTE: realgud-cmdbuf-info is a buffer variable local to the process - ; running the debugger. It contains a realgud-cmdbuf-info "struct". In - ; that struct is the regexp hash to match positions. By setting the - ; the fields of realgud-cmdbuf-info appropriately we can accomodate a - ; family of debuggers -- one at a time -- for the buffer process. - - (setq cmdbuf (or cmdbuf (current-buffer))) - (with-current-buffer cmdbuf - (if (realgud-cmdbuf?) - (let* ((loc-pat (realgud-cmdbuf-pat "brkpt-set"))) - (if loc-pat - (let ((bp-num-group (realgud-loc-pat-num loc-pat)) - (loc-regexp (realgud-loc-pat-regexp loc-pat)) - (file-group (realgud-loc-pat-file-group loc-pat)) - (line-group (realgud-loc-pat-line-group loc-pat)) - (text-group (realgud-loc-pat-text-group loc-pat)) - (ignore-file-re (realgud-loc-pat-ignore-file-re loc-pat)) - ) - (if loc-regexp - (if (string-match loc-regexp text) - (let* ((bp-num (match-string bp-num-group text)) - (filename (match-string file-group text)) - (line-str (match-string line-group text)) - (source-str (and text-group (match-string text-group text))) - (lineno (string-to-number (or line-str "1"))) - ) - (unless line-str - (message "line number not found -- using 1")) - (if (and filename lineno) - (let ((loc-or-error - (realgud:file-loc-from-line - filename lineno - cmd-mark - source-str - (string-to-number bp-num) - ignore-file-re - ))) - (if (stringp loc-or-error) - (progn - (message loc-or-error) - ;; set to return nil - nil) - ;; else - (progn - ;; Add breakpoint to list of breakpoints - (realgud-cmdbuf-info-bp-list= - (cons loc-or-error (realgud-sget 'cmdbuf-info 'bp-list))) - ;; Set to return location - loc-or-error))) - nil))) - nil)) - nil)) - (and (message "Current buffer %s is not a debugger command buffer" - (current-buffer)) nil) - ) - ) -) - -(defun realgud-track-bp-delete(text &optional cmd-mark cmdbuf ignore-file-re) - "Do regular-expression matching see if a breakpoint has been delete inside -string TEXT. If we match, we will return the location of the breakpoint found -from in command buffer. Otherwise nil is returned." - - ; NOTE: realgud-cmdbuf-info is a buffer variable local to the process - ; running the debugger. It contains a realgud-cmdbuf-info "struct". In - ; that struct is the regexp hash to match positions. By setting the - ; the fields of realgud-cmdbuf-info appropriately we can accomodate a - ; family of debuggers -- one at a time -- for the buffer process. - - (setq cmdbuf (or cmdbuf (current-buffer))) - (with-current-buffer cmdbuf - (if (realgud-cmdbuf?) - (let* ((loc-pat (realgud-cmdbuf-pat "brkpt-del")) - (found-loc nil) - ) - (if loc-pat - (let ((bp-num-group (realgud-loc-pat-num loc-pat)) - (loc-regexp (realgud-loc-pat-regexp loc-pat)) - (loc)) - (if (and loc-regexp (string-match loc-regexp text)) - (let* ((bp-num (string-to-number (match-string bp-num-group text))) - (info realgud-cmdbuf-info) - (bp-list (realgud-cmdbuf-info-bp-list info)) - ) - (while (and (not found-loc) (setq loc (car-safe bp-list))) - (setq bp-list (cdr bp-list)) - (if (eq (realgud-loc-num loc) bp-num) - (progn - (setq found-loc loc) - ;; Remove loc from breakpoint list - (realgud-cmdbuf-info-bp-list= - (remove loc (realgud-cmdbuf-info-bp-list info)))) - )) - ;; return the location: - found-loc) - nil)) - nil)) - (and (message "Current buffer %s is not a debugger command buffer" - (current-buffer)) nil) - ) - ) -) - -(defun realgud-track-loc-remaining(text) - "Return the portion of TEXT starting with the part after the -loc-regexp pattern" - (if (realgud-cmdbuf?) - (let* ((loc-pat (realgud-cmdbuf-pat "loc")) - (loc-regexp (realgud-loc-pat-regexp loc-pat)) - ) - (if loc-regexp - (if (string-match loc-regexp text) - (substring text (match-end 0)) - nil) - nil)) - nil) - ) - -(defun realgud-track-selected-frame(text) - "Return a selected frame number found in TEXT or nil if none found." - (if (realgud-cmdbuf?) - (let ((selected-frame-pat (realgud-cmdbuf-pat "selected-frame")) - (frame-num-regexp) - ) - (if (and selected-frame-pat - (setq frame-num-regexp (realgud-loc-pat-regexp - selected-frame-pat))) - (if (string-match frame-num-regexp text) - (let ((frame-num-group (realgud-loc-pat-num selected-frame-pat))) - (string-to-number (match-string frame-num-group text))) - nil) - nil)) - nil) - ) - - -(defun realgud-track-termination?(text) - "Return 't and call `realgud:terminate' we we have a termination message" - (if (realgud-cmdbuf?) - (let ((termination-re (realgud-cmdbuf-pat "termination")) - ) - (if (and termination-re (string-match termination-re text)) - (progn - (realgud:terminate (current-buffer)) - 't) - nil) - ) - ) - ) - -(defun realgud-track-divert-prompt(text cmdbuf to) - "Return a cons node of the part before the prompt-regexp and the part - after the prompt-regexp-prompt. If not found return nil." - (with-current-buffer cmdbuf - ;; (message "+++3 %s, buf: %s" text (buffer-name)) - (if (realgud-cmdbuf?) - (let* ((prompt-pat (realgud-cmdbuf-pat "prompt")) - (prompt-regexp (realgud-loc-pat-regexp prompt-pat)) - ) - (if prompt-regexp - (if (string-match prompt-regexp text) - (progn - (setq realgud-track-divert-string - (substring text 0 (match-beginning 0))) - ;; We've got desired output, so reset divert output. - (realgud-cmdbuf-info-divert-output?= nil) - (cond ((search-backward-regexp prompt-regexp) - (kill-region realgud-last-output-start (point)) - (goto-char (point-max))) - ('t (kill-region realgud-last-output-start to))) - ) - )) - ) - ) - ) - ) - -(defun realgud-goto-line-for-loc-pat (pt &optional opt-realgud-loc-pat) - "Display the location mentioned in line described by -PT. OPT-REALGUD-LOC-PAT is used to get regular-expresion pattern -matching information. If not supplied we use the current buffer's \"location\" -pattern found via realgud-cmdbuf information. nil is returned if we can't -find a location. non-nil if we can find a location. -" - (interactive "d") - (save-excursion - (goto-char pt) - (let* - ((cmdbuf (current-buffer)) - (cmd-mark (point-marker)) - (curr-proc (get-buffer-process cmdbuf)) - (start (line-beginning-position)) - (end (line-end-position)) - (loc-pat (or opt-realgud-loc-pat (realgud-cmdbuf-pat "loc"))) - (loc) - ) - (unless (and loc-pat (realgud-loc-pat-p loc-pat)) - (error "Can't find location information for %s" cmdbuf)) - (setq loc (realgud-track-loc (buffer-substring-no-properties start end) - cmd-mark - (realgud-loc-pat-regexp loc-pat) - (realgud-loc-pat-file-group loc-pat) - (realgud-loc-pat-line-group loc-pat) - nil - (realgud-loc-pat-ignore-file-re loc-pat) - )) - (if (stringp loc) - (message loc) - (if loc (or (realgud-track-loc-action loc cmdbuf) 't) - nil)) - )) - ) - -(defun realgud:track-set-debugger (debugger-name) - "Set debugger name and information associated with that debugger for -the buffer process. This info is returned or nil if we can't find a -debugger with that information" - ;; FIXME: turn in to fn which can be used by realgud-backtrack-set-debugger - (interactive - (list (completing-read "Debugger name: " realgud-pat-hash))) - - (let ((regexp-hash (gethash debugger-name realgud-pat-hash)) - (command-hash (gethash debugger-name realgud-command-hash)) - (transform-name debugger-name) - ) - (unless regexp-hash - (setq transform-name (realgud:debugger-name-transform debugger-name)) - (setq regexp-hash (gethash transform-name realgud-pat-hash)) - (setq command-hash (gethash transform-name realgud-command-hash)) - ) - (if regexp-hash - (let* ((prefix (realgud:debugger-name-transform debugger-name)) - (mode-name (concat " " (capitalize prefix) "-Track")) - (specific-track-mode (intern (concat prefix "-track-mode"))) - ) - (realgud-cmdbuf-init (current-buffer) transform-name regexp-hash - command-hash) - (if (and (not (eval specific-track-mode)) - (functionp specific-track-mode)) - (funcall specific-track-mode 't)) - ) - (progn - (message "I don't have %s listed as a debugger." debugger-name) - nil) - ))) - -;; FIXME: need better name for this and next fn. -(defun realgud-goto-line-for-pt-and-type (pt type pat-hash) - "Display the location mentioned for PT given type PAT-HASH indexed TYPE." - (realgud-goto-line-for-loc-pat pt (gethash type pat-hash))) - - -(defun realgud-goto-line-for-pt (pt pattern-key) - "Display the location mentioned by a backtrace line (e.g. Ruby $!) -described by PT." - (interactive "d") - (unless (realgud-cmdbuf?) - (error "You need to be in a debugger command buffer to run this")) - (let* ((debugger-name (realgud-cmdbuf-debugger-name)) - (debugger-pat-hash (gethash debugger-name realgud-pat-hash))) - (realgud-goto-line-for-pt-and-type pt pattern-key debugger-pat-hash) - ) - ) - -(defun realgud:goto-debugger-backtrace-line (pt) - "Display the location mentioned by the debugger backtrace line -described by PT." - (interactive "d") - (unless (realgud-goto-line-for-pt pt "debugger-backtrace") - (message "Didn't match a debugger backtrace location.") - )) - -(defun realgud:goto-lang-backtrace-line (pt) - "Display the location mentioned by the programming-language backtrace line -described by PT." - (interactive "d") - (unless (realgud-goto-line-for-pt pt "lang-backtrace") - (message "Didn't match a programming-language backtrace location.") - )) - -(provide-me "realgud-") diff --git a/packages/realgud/realgud/common/utils.el b/packages/realgud/realgud/common/utils.el deleted file mode 100644 index aede64032..000000000 --- a/packages/realgud/realgud/common/utils.el +++ /dev/null @@ -1,18 +0,0 @@ -(require 'load-relative) - -(defun realgud:strip (str) - "Remove leading and tailing whitespace from STR." - (while (string-match "\\`\n+\\|^\\s-+\\|\\s-+$\\|\n+\\'" - str) - (setq str (replace-match "" t t str))) - str) - -;; From http://rosettacode.org/wiki/Flatten_a_list#Emacs_Lisp -(defun realgud:flatten (mylist) - (cond - ((null mylist) nil) - ((atom mylist) (list mylist)) - (t - (append (realgud:flatten (car mylist)) (realgud:flatten (cdr mylist)))))) - -(provide-me "realgud-") diff --git a/packages/realgud/realgud/common/window.el b/packages/realgud/realgud/common/window.el deleted file mode 100644 index d7d083bc1..000000000 --- a/packages/realgud/realgud/common/window.el +++ /dev/null @@ -1,167 +0,0 @@ -;;; Copyright (C) 2010, 2014-2015 Rocky Bernstein -(require 'load-relative) -(require-relative-list '("helper") "realgud-") -(require-relative-list '("buffer/helper") "realgud-buffer-") - -(declare-function realgud:backtrace-init 'realgud-buffer-helper) -(declare-function realgud-get-backtrace-buf 'realgud-buffer-helper) -(declare-function realgud-get-cmdbuf 'realgud-buffer-helper) -(declare-function realgud-get-srcbuf 'realgud-buffer-helper) -(declare-function buffer-killed? 'realgud-helper) - -(declare-function one-window-p(bool)) - -(defun realgud-window-update-position (buffer marker) - "Update BUFFER to position specified with MARKER. -We assume MARKER points inside BUFFER" - (with-current-buffer buffer - (goto-char marker) - (let ((window (get-buffer-window buffer))) - (if window (set-window-point window marker)) - ))) - - -(defun realgud-window-src ( &optional opt-buffer ) - "Make sure the source buffer is displayed in a window -We don't care if the command buffer is also displayed. -See also `realgud-window-src-undisturb-cmd'" - (let* ((buffer (or opt-buffer (current-buffer))) - (src-buffer (realgud-get-srcbuf buffer)) - (src-window (get-buffer-window src-buffer 'visible)) - (window (selected-window))) - (if src-buffer - (unless (and src-window (not (window-minibuffer-p))) - (set-window-buffer window src-buffer)) - ) - )) - -(defun realgud-window-src-undisturb-cmd ( &optional opt-buffer ) - "Make sure the source buffers is displayed in windows without -disturbing the command window if it is also displayed. Returns -the command window -See also `realgud-window-src'" - (interactive) - (let* ((buffer (or opt-buffer (current-buffer))) - (src-buffer (realgud-get-srcbuf buffer)) - (src-window (get-buffer-window src-buffer)) - (cmd-buffer (realgud-get-cmdbuf buffer)) - (cmd-window (get-buffer-window cmd-buffer)) - (window (selected-window)) - ) - (if src-buffer - (unless src-window - (setq src-window - (if (eq window cmd-window) - ;; FIXME: generalize what to do here. - (if (one-window-p 't) - (split-window) - (next-window window 'no-minibuf)) - window)) - (set-window-buffer src-window src-buffer)) - ) - (select-window src-window) - cmd-window) - ) - -(defun realgud-window-cmd-undisturb-src ( &optional opt-buffer switch?) - "Make sure the source buffer is displayed in windows without -disturbing the command window if it is also displayed. Returns -the source window. -See also `realgud-window-src'" - (interactive) - (let* ((buffer (or opt-buffer (current-buffer))) - (src-buffer (realgud-get-srcbuf buffer)) - (src-window (get-buffer-window src-buffer)) - (cmd-buffer (realgud-get-cmdbuf buffer)) - (cmd-window (get-buffer-window cmd-buffer)) - (window (selected-window)) - ) - (when cmd-buffer - (unless cmd-window - (setq cmd-window - (if (eq window src-window) - ;; FIXME: generalize what to do here. - (if (one-window-p 't) - (split-window) - (next-window window 'no-minibuf)) - window)) - (set-window-buffer cmd-window cmd-buffer) - ) - (if switch? - (and (select-window cmd-window) - (switch-to-buffer cmd-buffer))) - - ) - (select-window cmd-window) - src-window) - ) - -(defun realgud:window-bt-undisturb-src ( &optional opt-buffer switch?) - "Make sure the backtrace buffer is displayed in windows without -disturbing the source window if it is also displayed. Returns -the source window -See also `realgud-window-src'" - (interactive) - (let* ((buffer (or opt-buffer (current-buffer))) - (src-buffer (realgud-get-srcbuf buffer)) - (src-window (get-buffer-window src-buffer)) - (cmd-buffer (realgud-get-cmdbuf buffer)) - (cmd-window (get-buffer-window cmd-buffer)) - (bt-buffer (realgud-get-backtrace-buf cmd-buffer)) - (bt-window (get-buffer-window bt-buffer)) - (window (selected-window)) - ) - (when cmd-buffer - (unless bt-window - (setq bt-window - (if (eq window src-window) - ;; FIXME: generalize what to do here. - (if (one-window-p 't) - (split-window) - (next-window window 'no-minibuf)) - window)) - (set-window-buffer bt-window bt-buffer) - ) - (if switch? - (and (select-window bt-window) - (switch-to-buffer bt-buffer))) - - ) - src-window) - ) - -(defun realgud:window-bt() - "Refresh backtrace information and display that in a buffer" - (interactive) - (with-current-buffer-safe (realgud-get-cmdbuf) - (realgud:backtrace-init) - (realgud:window-bt-undisturb-src) - ) - ) - - -;; (defun realgud-window-src-and-cmd ( &optional opt-buffer ) -;; "Make sure the source buffers is displayed in windows without -;; disturbing the command window if it is also displayed. Returns -;; the command window -;; See also `realgud-window-src-window'" -;; (interactive) -;; (let* ((buffer (or opt-buffer (current-buffer))) -;; (src-buffer (realgud-get-srcbuf buffer)) -;; (src-window (get-buffer-window src-buffer)) -;; (cmd-buffer (realgud-get-cmdbuf buffer)) -;; (cmd-window (get-buffer-window cmd-buffer)) -;; (window (selected-window)) -;; ) -;; (if src-buffer -;; (unless src-window -;; (setq src-window -;; (if (eq window cmd-window) -;; (if (one-window-p 't) (split-window) (next-window window)) -;; window)) -;; (set-window-buffer src-window src-buffer)) -;; ) -;; cmd-window) -;; ) - -(provide-me "realgud-") diff --git a/packages/realgud/realgud/debugger/Makefile.am b/packages/realgud/realgud/debugger/Makefile.am deleted file mode 100644 index 89ef7d99b..000000000 --- a/packages/realgud/realgud/debugger/Makefile.am +++ /dev/null @@ -1,8 +0,0 @@ -SUBDIRS = \ - bashdb gdb gub jdb kshdb nodejs \ - pdb perldb pydb pydbgr rdebug remake \ - trepan trepan2 trepan3k trepan.pl trepanx trepan8 \ - zshdb -EXTRA_DIST = common.mk - -.PHONY: check all diff --git a/packages/realgud/realgud/debugger/bashdb/Makefile.am b/packages/realgud/realgud/debugger/bashdb/Makefile.am deleted file mode 100644 index 23f8a8fa2..000000000 --- a/packages/realgud/realgud/debugger/bashdb/Makefile.am +++ /dev/null @@ -1 +0,0 @@ -include ../common.mk diff --git a/packages/realgud/realgud/debugger/bashdb/bashdb.el b/packages/realgud/realgud/debugger/bashdb/bashdb.el deleted file mode 100644 index d8d10a910..000000000 --- a/packages/realgud/realgud/debugger/bashdb/bashdb.el +++ /dev/null @@ -1,67 +0,0 @@ -;;; Copyright (C) 2011, 2013-2015 Rocky Bernstein -;; `bashdb' Main interface to bashdb via Emacs -(require 'list-utils) -(require 'load-relative) -(require-relative-list '("../../common/helper") "realgud-") -(require-relative-list '("../../common/run") "realgud:") -(require-relative-list '("core" "track-mode") "realgud:bashdb-") - -;; This is needed, or at least the docstring part of it is needed to -;; get the customization menu to work in Emacs 24. -(defgroup realgud:bashdb nil - "The realgud interface to bashdb" - :group 'realgud - :version "24.3") - -;; ------------------------------------------------------------------- -;; User-definable variables -;; - -(defcustom realgud:bashdb-command-name - ;;"bashdb --emacs 3" - "bashdb" - "File name for executing the bash debugger and command options. -This should be an executable on your path, or an absolute file name." - :type 'string - :group 'realgud:bashdb) - -;; ------------------------------------------------------------------- -;; The end. -;; - -(declare-function bashdb-track-mode 'realgud-bashdb-track-mode) -(declare-function bashdb-query-cmdline 'realgud:bashdb-core) -(declare-function bashdb-parse-cmd-args 'realgud:bashdb-core) -(declare-function realgud:run-debugger 'realgud:run) - -;;;###autoload -(defun realgud:bashdb (&optional opt-cmd-line no-reset) - "Invoke the bashdb shell debugger and start the Emacs user interface. - -String OPT-CMD-LINE specifies how to run bash. You will be prompted -for a command line is one isn't supplied. - -OPT-CMD-LINE is treated like a shell string; arguments are -tokenized by `split-string-and-unquote'. The tokenized string is -parsed by `bashdb-parse-cmd-args' and path elements found by that -are expanded using `realgud:expand-file-name-if-exists'. - -Normally, command buffers are reused when the same debugger is -reinvoked inside a command buffer with a similar command. If we -discover that the buffer has prior command-buffer information and -NO-RESET is nil, then that information which may point into other -buffers and source buffers which may contain marks and fringe or -marginal icons is reset. See `loc-changes-clear-buffer' to clear -fringe and marginal icons. -" - (interactive) - (realgud:run-debugger "bashdb" - 'bashdb-query-cmdline - 'bashdb-parse-cmd-args - 'realgud:bashdb-minibuffer-history - opt-cmd-line no-reset) - ) - -(defalias 'bashdb 'realgud:bashdb) - -(provide-me "realgud-") diff --git a/packages/realgud/realgud/debugger/bashdb/core.el b/packages/realgud/realgud/debugger/bashdb/core.el deleted file mode 100644 index c02d6b367..000000000 --- a/packages/realgud/realgud/debugger/bashdb/core.el +++ /dev/null @@ -1,184 +0,0 @@ -;;; Copyright (C) 2010-2011, 2014-2015 Rocky Bernstein -(eval-when-compile (require 'cl)) - -(require 'load-relative) -(require 'list-utils) -(require-relative-list '("../../common/track" "../../common/core") - "realgud-") -(require-relative-list '("init") "realgud:bashdb-") - -(declare-function realgud:expand-file-name-if-exists 'realgud-core) -(declare-function realgud-parse-command-arg 'realgud-core) -(declare-function realgud-query-cmdline 'realgud-core) -(declare-function realgud-suggest-invocation 'realgud-core) - -;; FIXME: I think the following could be generalized and moved to -;; realgud-... probably via a macro. -(defvar realgud:bashdb-minibuffer-history nil - "minibuffer history list for the command `realgud:bashdb'.") - -(easy-mmode-defmap bashdb-minibuffer-local-map - '(("\C-i" . comint-dynamic-complete-filename)) - "Keymap for minibuffer prompting of bashdb startup command." - :inherit minibuffer-local-map) - -;; FIXME: I think this code and the keymaps and history -;; variable chould be generalized, perhaps via a macro. -(defun bashdb-query-cmdline (&optional opt-debugger) - (realgud-query-cmdline - 'bashdb-suggest-invocation - bashdb-minibuffer-local-map - 'realgud:bashdb-minibuffer-history - opt-debugger)) - -;;; FIXME: DRY this with other *-parse-cmd-args routines -(defun bashdb-parse-cmd-args (orig-args) - "Parse command line ORIG-ARGS for the annotate level and name of script to debug. - -ORIG-ARGS should contain a tokenized list of the command line to run. - -We return the a list containing: -* the command processor (e.g. bash) and it's arguments if any - a list of strings -* the name of the debugger given (e.g. bashdb) and its arguments - a list of strings -* the script name and its arguments - list of strings -* whether the annotate or emacs option was given ('-A', '--annotate' or '--emacs) - a boolean - -The script name and options mentioning paths are file expanded - -For example for the following input - (map 'list 'symbol-name - '(bash --norc bashdb -l . --emacs ./gcd.sh a b)) - -we might return: - ((\"bash\" \"--norc\") (\"bashdb\" \"-l\" \"/tmp\" \"--emacs\") (\"/tmp/gcd.sh\" \"a\" \"b\") t) - -Note that path elements have been expanded via `realgud:expand-file-name-if-exists'. -" - - ;; Parse the following kind of pattern: - ;; [bash bash-options] bashdb bashdb-options script-name script-options - (let ( - (args orig-args) - (pair) ;; temp return from - ;; bash doesn't have any optional two-arg options - (bash-opt-two-args '()) - (bash-two-args '("o" "c")) - - ;; One dash is added automatically to the below, so - ;; h is really -h and -host is really --host. - (bashdb-two-args '("A" "-annotate" "l" "-library" - "c" "-command" "-t" "-tty" - "x" "-eval-command")) - (bashdb-opt-two-args '()) - (interp-regexp - (if (member system-type (list 'windows-nt 'cygwin 'msdos)) - "^bash*\\(.exe\\)?$" - "^bash*$")) - (bashdb-two-arg-name) - (debugger-flag nil) ;; 't if "bash --debugger" given - - ;; Things returned - (script-name nil) - (debugger-name nil) - (interpreter-args '()) - (debugger-args '()) - (script-args '()) - (annotate-p nil)) - - (if (not (and args)) - ;; Got nothing: return '(nil, nil) - (list interpreter-args debugger-args script-args annotate-p) - ;; else - ;; Strip off optional "bash" or "bash4" etc. - (when (string-match interp-regexp - (file-name-sans-extension - (file-name-nondirectory (car args)))) - (setq interpreter-args (list (pop args))) - - ;; Strip off bash-specific options - (while (and args - (string-match "^-" (car args))) - (setq pair (realgud-parse-command-arg - args bash-two-args bash-opt-two-args)) - (if (equal "--debugger" (caar pair)) - (setq debugger-flag 't)) - (nconc interpreter-args (car pair)) - (setq args (cadr pair)))) - - ;; Remove "bashdb" from "bashdb --bashdb-options script - ;; --script-options" - (unless debugger-flag - (setq debugger-name (file-name-sans-extension - (file-name-nondirectory (car args)))) - (unless (string-match "^bashdb$" debugger-name) - (message - "Expecting debugger name `%s' to be `bashdb'" - debugger-name)) - (setq debugger-args (list (pop args))) - ) - - ;; Skip to the first non-option argument. - (while (and args (not script-name)) - (let ((arg (car args))) - (cond - ;; Annotation or emacs option with level number. - ((member arg '("--annotate" "-A" "--emacs")) - (setq annotate-p t) - (nconc debugger-args (list (pop args)))) - ;; Combined annotation and level option. - ((string-match "^--annotate=[0-9]" arg) - (nconc debugger-args (list (pop args)) ) - (setq annotate-p t)) - ;; Library option - ((member arg '("--library" "-l")) - (setq arg (pop args)) - (nconc debugger-args - (list arg (realgud:expand-file-name-if-exists - (pop args))))) - ;; Other options with arguments. - ((string-match "^-" arg) - (setq pair (realgud-parse-command-arg - args bashdb-two-args bashdb-opt-two-args)) - (nconc debugger-args (car pair)) - (setq args (cadr pair))) - ;; Anything else must be the script to debug. - (t (setq script-name (realgud:expand-file-name-if-exists arg)) - (setq script-args (cons script-name (cdr args)))) - ))) - (list interpreter-args debugger-args script-args annotate-p)))) - -;; To silence Warning: reference to free variable -(defvar realgud:bashdb-command-name) - -(defun bashdb-suggest-invocation (debugger-name) - "Suggest a bashdb command invocation via `realgud-suggest-invocaton'" - (realgud-suggest-invocation realgud:bashdb-command-name - realgud:bashdb-minibuffer-history - "sh" "\\.\\(?:ba\\)?sh$" - realgud:bashdb-command-name)) - -(defun bashdb-reset () - "Bashdb cleanup - remove debugger's internal buffers (frame, -breakpoints, etc.)." - (interactive) - ;; (bashdb-breakpoint-remove-all-icons) - (dolist (buffer (buffer-list)) - (when (string-match "\\*bashdb-[a-z]+\\*" (buffer-name buffer)) - (let ((w (get-buffer-window buffer))) - (when w - (delete-window w))) - (kill-buffer buffer)))) - -;; (defun bashdb-reset-keymaps() -;; "This unbinds the special debugger keys of the source buffers." -;; (interactive) -;; (setcdr (assq 'bashdb-debugger-support-minor-mode minor-mode-map-alist) -;; bashdb-debugger-support-minor-mode-map-when-deactive)) - - -(defun realgud:bashdb-customize () - "Use `customize' to edit the settings of the `bashdb' debugger." - (interactive) - (customize-group 'realgud:bashdb)) - -(provide-me "realgud:bashdb-") diff --git a/packages/realgud/realgud/debugger/bashdb/init.el b/packages/realgud/realgud/debugger/bashdb/init.el deleted file mode 100644 index c8e4559df..000000000 --- a/packages/realgud/realgud/debugger/bashdb/init.el +++ /dev/null @@ -1,75 +0,0 @@ -;;; Copyright (C) 2010-2011, 2015 Rocky Bernstein -;;; Regular expressions for Bash shell debugger: bashdb - -(eval-when-compile (require 'cl)) - -(require 'load-relative) -(require-relative-list '("../../common/regexp" - "../../common/loc" - "../../common/init") - "realgud-") -(require-relative-list '("../../lang/posix-shell") "realgud-lang-") - -(defvar realgud:bashdb-pat-hash) -(declare-function make-realgud-loc-pat (realgud-loc)) - -(defvar realgud:bashdb-pat-hash (make-hash-table :test 'equal) - "Hash key is the what kind of pattern we want to match: -backtrace, prompt, etc. The values of a hash entry is a -realgud-loc-pat struct") - -;; Regular expression that describes a bashdb location generally shown -;; before a command prompt. -;; For example: -;; (/etc/init.d/apparmor:35): -(setf (gethash "loc" realgud:bashdb-pat-hash) realgud:POSIX-debugger-loc-pat) - -;; Regular expression that describes a bashdb command prompt -;; For example: -;; bashdb<10> -;; bashdb<(5)> -;; bashdb<<1>> -(setf (gethash "prompt" realgud:bashdb-pat-hash) - (make-realgud-loc-pat - :regexp "^bashdb[<]+[(]*\\([0-9]+\\)[)]*[>]+ " - :num 1 - )) - -;; Regular expression that describes a "breakpoint set" line -(setf (gethash "brkpt-set" realgud:bashdb-pat-hash) - realgud:POSIX-debugger-brkpt-set-pat) - -;; Regular expression that describes a debugger "delete" (breakpoint) response. -;; For example: -;; Removed 1 breakpoint(s). -(setf (gethash "brkpt-del" realgud:bashdb-pat-hash) - realgud:POSIX-debugger-brkpt-del-pat) - -;; Regular expression that describes a debugger "backtrace" command line. -;; For example: -;; ->0 in file `../bashdb/test/example/subshell.sh' at line 6 -;; ##1 source("../bashdb/shell.sh") called from file `/bin/bashdb' at line 140 -;; ##2 main() called from file `/bin/bashdb' at line 0 -(setf (gethash "debugger-backtrace" realgud:bashdb-pat-hash) - realgud:POSIX-debugger-backtrace-pat) - -;; Regular expression for a termination message. -(setf (gethash "termination" realgud:bashdb-pat-hash) - "^bashdb: That's all, folks...\n") - -(setf (gethash "font-lock-keywords" realgud:bashdb-pat-hash) - realgud:POSIX-debugger-font-lock-keywords) - -(setf (gethash "bashdb" realgud-pat-hash) realgud:bashdb-pat-hash) - -(defvar realgud:bashdb-command-hash (make-hash-table :test 'equal) - "Hash key is command name like 'quit' and the value is - the bashdb command to use, like 'quit!'") - -(setf (gethash "bashdb" realgud-command-hash) realgud:bashdb-command-hash) - -(setf (gethash "clear" realgud:bashdb-command-hash) "clear %l") -(setf (gethash "quit" realgud:bashdb-command-hash) "quit!") -(setf (gethash "until" realgud:bashdb-command-hash) "continue %l") - -(provide-me "realgud:bashdb-") diff --git a/packages/realgud/realgud/debugger/bashdb/track-mode.el b/packages/realgud/realgud/debugger/bashdb/track-mode.el deleted file mode 100644 index de4478d1d..000000000 --- a/packages/realgud/realgud/debugger/bashdb/track-mode.el +++ /dev/null @@ -1,59 +0,0 @@ -;;; Copyright (C) 2012-2015 Rocky Bernstein -;;; Bash Debugger tracking in a comint buffer. - -(eval-when-compile (require 'cl)) -(require 'load-relative) -(require-relative-list '( - "../../common/cmds" - "../../common/menu" - "../../common/track" - "../../common/track-mode" - ) - "realgud-") -(require-relative-list '("core" "init") "realgud:bashdb-") -(require-relative "../../lang/posix-shell" nil "realgud-lang-") - -(declare-function realgud-track-mode 'realgud-track-mode) -(declare-function realgud-track-mode-hook 'realgud-track-mode) -(declare-function realgud-track-mode-setup 'realgud-track-mode) -(declare-function realgud:track-set-debugger 'realgud-track-mode) -(declare-function realgud-posix-shell-populate-command-keys - 'realgud-lang-posix-shell) - -(realgud-track-mode-vars "bashdb") - -(defun bashdb-track-mode-hook() - (if bashdb-track-mode - (progn - (use-local-map bashdb-track-mode-map) - (message "using bashdb mode map") - ) - (message "bashdb track-mode-hook disable called")) -) - -(define-minor-mode bashdb-track-mode - "Minor mode for tracking bashdb source locations inside a process shell via realgud. bashdb is a Bash debugger. See URL `http://bashdb.sf.net'. - -If called interactively with no prefix argument, the mode is toggled. A prefix argument, captured as ARG, enables the mode if the argument is positive, and disables it otherwise. - -\\{bashdb-track-mode-map}" - :init-value nil - ;; :lighter " bashdb" ;; mode-line indicator from realgud-track is sufficient. - ;; The minor mode bindings. - :global nil - :group 'realgud:bashdb - :keymap bashdb-track-mode-map - - (realgud:track-set-debugger "bashdb") - (if bashdb-track-mode - (progn - (realgud-track-mode-setup 't) - (bashdb-track-mode-hook)) - (progn - (setq realgud-track-mode nil) - )) -) - -(define-key bashdb-short-key-mode-map "T" 'realgud:cmd-backtrace) - -(provide-me "realgud:bashdb-") diff --git a/packages/realgud/realgud/debugger/common.mk b/packages/realgud/realgud/debugger/common.mk deleted file mode 100644 index b09deeb9c..000000000 --- a/packages/realgud/realgud/debugger/common.mk +++ /dev/null @@ -1,3 +0,0 @@ -include $(top_srcdir)/common.mk - -lispdir = @lispdir_realgud@/debugger/$(notdir $(subdir)) diff --git a/packages/realgud/realgud/debugger/gdb/Makefile.am b/packages/realgud/realgud/debugger/gdb/Makefile.am deleted file mode 100644 index 23f8a8fa2..000000000 --- a/packages/realgud/realgud/debugger/gdb/Makefile.am +++ /dev/null @@ -1 +0,0 @@ -include ../common.mk diff --git a/packages/realgud/realgud/debugger/gdb/core.el b/packages/realgud/realgud/debugger/gdb/core.el deleted file mode 100644 index 98f80ac2e..000000000 --- a/packages/realgud/realgud/debugger/gdb/core.el +++ /dev/null @@ -1,202 +0,0 @@ -;;; Copyright (C) 2010, 2013-2014 Rocky Bernstein -(eval-when-compile (require 'cl)) - -(require 'load-relative) -(require-relative-list '("../../common/track" - "../../common/core" - "../../common/lang") - "realgud-") - -(declare-function realgud:expand-file-name-if-exists 'realgud-core) -(declare-function realgud-lang-mode? 'realgud-lang) -(declare-function realgud-parse-command-arg 'realgud-core) -(declare-function realgud-query-cmdline 'realgud-core) - -;; FIXME: I think the following could be generalized and moved to -;; realgud-... probably via a macro. -(defvar realgud:gdb-minibuffer-history nil - "minibuffer history list for the command `gdb'.") - -(easy-mmode-defmap realgud:gdb-minibuffer-local-map - '(("\C-i" . comint-dynamic-complete-filename)) - "Keymap for minibuffer prompting of gud startup command." - :inherit minibuffer-local-map) - -;; FIXME: I think this code and the keymaps and history -;; variable chould be generalized, perhaps via a macro. -(defun realgud:gdb-query-cmdline (&optional opt-debugger) - (realgud-query-cmdline - 'realgud:gdb-suggest-invocation - realgud:gdb-minibuffer-local-map - 'realgud:gdb-minibuffer-history - opt-debugger)) - -(defun realgud:gdb-parse-cmd-args (orig-args) - "Parse command line ARGS for the annotate level and name of script to debug. - -ORIG_ARGS should contain a tokenized list of the command line to run. - -We return the a list containing -* the name of the debugger given (e.g. gdb) and its arguments - a list of strings -* nil (a placehoder in other routines of this ilk for a debugger -* the script name and its arguments - list of strings -* whether the annotate or emacs option was given ('-A', '--annotate' or '--emacs) - a boolean - -For example for the following input - (map 'list 'symbol-name - '(gdb --tty /dev/pts/1 -cd ~ --emacs ./gcd.py a b)) - -we might return: - ((\"gdb\" \"--tty\" \"/dev/pts/1\" \"-cd\" \"home/rocky\' \"--emacs\") nil \"(/tmp/gcd.py a b\") 't\") - -Note that path elements have been expanded via `expand-file-name'. -" - - ;; Parse the following kind of pattern: - ;; gdb gdb-options script-name script-options - (let ( - (args orig-args) - (pair) ;; temp return from - - ;; One dash is added automatically to the below, so - ;; h is really -h and -host is really --host. - (gdb-two-args '("x" "-command" "b" "-exec" - "cd" "-pid" "-core" "-directory" - "-annotate" - "se" "-symbols" "-tty")) - ;; gdb doesn't optionsl 2-arg options. - (gdb-opt-two-args '()) - - ;; Things returned - (script-name nil) - (debugger-name nil) - (debugger-args '()) - (script-args '()) - (annotate-p nil)) - - (if (not (and args)) - ;; Got nothing: return '(nil nil nil nil) - (list debugger-args nil script-args annotate-p) - ;; else - (progn - - ;; Remove "gdb" from "gdb --gdb-options script - ;; --script-options" - (setq debugger-name (file-name-sans-extension - (file-name-nondirectory (car args)))) - (unless (string-match "^gdb.*" debugger-name) - (message - "Expecting debugger name `%s' to be `gdb'" - debugger-name)) - (setq debugger-args (list (pop args))) - - ;; Skip to the first non-option argument. - (while (and args (not script-name)) - (let ((arg (car args))) - (cond - ;; Annotation or emacs option with level number. - ((or (member arg '("--annotate" "-A")) - (equal arg "--emacs")) - (setq annotate-p t) - (nconc debugger-args (list (pop args) (pop args)))) - ;; Combined annotation and level option. - ((string-match "^--annotate=[0-9]" arg) - (nconc debugger-args (list (pop args) (pop args)) ) - (setq annotate-p t)) - ;; path-argument ooptions - ((member arg '("-cd" )) - (setq arg (pop args)) - (nconc debugger-args - (list arg (realgud:expand-file-name-if-exists - (pop args))))) - ;; Options with arguments. - ((string-match "^-" arg) - (setq pair (realgud-parse-command-arg - args gdb-two-args gdb-opt-two-args)) - (nconc debugger-args (car pair)) - (setq args (cadr pair))) - ;; Anything else must be the script to debug. - (t (setq script-name arg) - (setq script-args args)) - ))) - (list debugger-args nil script-args annotate-p))))) - -(defvar realgud:gdb-command-name) - -(defun realgud:gdb-executable (file-name) -"Return a priority for wehther file-name is likely we can run gdb on" - (let ((output (shell-command-to-string (format "file %s" file-name)))) - (cond - ((string-match "ASCII" output) 2) - ((string-match "ELF" output) 7) - ((string-match "executable" output) 6) - ('t 5)))) - - -(defun realgud:gdb-suggest-invocation (&optional debugger-name) - "Suggest a gdb command invocation. Here is the priority we use: -* an executable file with the name of the current buffer stripped of its extension -* any executable file in the current directory with no extension -* the last invocation in gdb:minibuffer-history -* any executable in the current directory -When all else fails return the empty string." - (let* ((file-list (directory-files default-directory)) - (priority 2) - (best-filename nil) - (try-filename (file-name-base (or (buffer-file-name) "gdb")))) - (when (member try-filename (directory-files default-directory)) - (setq best-filename try-filename) - (setq priority (+ (realgud:gdb-executable try-filename) 2))) - - ;; FIXME: I think a better test would be to look for - ;; c-mode in the buffer that have a corresponding executable - (while (and (setq try-filename (car-safe file-list)) (< priority 8)) - (setq file-list (cdr file-list)) - (if (and (file-executable-p try-filename) - (not (file-directory-p try-filename))) - (if (equal try-filename (file-name-sans-extension try-filename)) - (progn - (setq best-filename try-filename) - (setq priority (1+ (realgud:gdb-executable best-filename)))) - ;; else - (progn - (setq best-filename try-filename) - (setq priority (realgud:gdb-executable best-filename)) - )) - )) - (if (< priority 8) - (cond - (realgud:gdb-minibuffer-history - (car realgud:gdb-minibuffer-history)) - ((equal priority 7) - (concat "gdb " best-filename)) - (t "gdb ")) - ;; else - (concat "gdb " best-filename)) - )) - -(defun realgud:gdb-reset () - "Gdb cleanup - remove debugger's internal buffers (frame, -breakpoints, etc.)." - (interactive) - ;; (gdb-breakpoint-remove-all-icons) - (dolist (buffer (buffer-list)) - (when (string-match "\\*gdb-[a-z]+\\*" (buffer-name buffer)) - (let ((w (get-buffer-window buffer))) - (when w - (delete-window w))) - (kill-buffer buffer)))) - -;; (defun gdb-reset-keymaps() -;; "This unbinds the special debugger keys of the source buffers." -;; (interactive) -;; (setcdr (assq 'gdb-debugger-support-minor-mode minor-mode-map-alist) -;; gdb-debugger-support-minor-mode-map-when-deactive)) - - -(defun realgud:gdb-customize () - "Use `customize' to edit the settings of the `realgud:gdb' debugger." - (interactive) - (customize-group 'realgud:gdb)) - -(provide-me "realgud:gdb-") diff --git a/packages/realgud/realgud/debugger/gdb/gdb.el b/packages/realgud/realgud/debugger/gdb/gdb.el deleted file mode 100644 index 3f2994afd..000000000 --- a/packages/realgud/realgud/debugger/gdb/gdb.el +++ /dev/null @@ -1,81 +0,0 @@ -;;; Copyright (C) 2010-2011, 2014-2015 Rocky Bernstein -;; `realgud:gdb' Main interface to gdb via Emacs -(require 'cl) -(require 'list-utils) -(require 'load-relative) -(require-relative-list '("../../common/helper" "../../common/utils") - "realgud-") -(require-relative-list '("core" "track-mode") "realgud:gdb-") - -;; This is needed, or at least the docstring part of it is needed to -;; get the customization menu to work in Emacs 24. -(defgroup realgud:gdb nil - "The realgud interface to gdb" - :group 'realgud - :version "24.1") - -;; ------------------------------------------------------------------- -;; User definable variables -;; - -(defcustom realgud:gdb-command-name - ;;"gdb --emacs 3" - "gdb" - "File name for executing the and command options. -This should be an executable on your path, or an absolute file name." - :type 'string - :group 'realgud:gdb) - -(declare-function realgud:gdb-track-mode 'realgud:gdb-track-mode) -(declare-function realgud-command 'realgud:gdb-core) -(declare-function realgud:gdb-parse-cmd-args 'realgud:gdb-core) -(declare-function realgud:gdb-query-cmdline 'realgud:gdb-core) -(declare-function realgud:run-process 'realgud-core) -(declare-function realgud:flatten 'realgud-utils) - -;; ------------------------------------------------------------------- -;; The end. -;; - -;;;###autoload -(defun realgud:gdb (&optional opt-cmd-line no-reset) - "Invoke the gdb debugger and start the Emacs user interface. - -OPT-CMD-LINE is treated like a shell string; arguments are -tokenized by `split-string-and-unquote'. - -Normally, command buffers are reused when the same debugger is -reinvoked inside a command buffer with a similar command. If we -discover that the buffer has prior command-buffer information and -NO-RESET is nil, then that information which may point into other -buffers and source buffers which may contain marks and fringe or -marginal icons is reset. See `loc-changes-clear-buffer' to clear -fringe and marginal icons. -" - - (interactive) - (let* ((cmd-str (or opt-cmd-line (realgud:gdb-query-cmdline "gdb"))) - (cmd-args (split-string-and-unquote cmd-str)) - (parsed-args (realgud:gdb-parse-cmd-args cmd-args)) - (script-args (caddr parsed-args)) - (script-name (car script-args)) - (parsed-cmd-args - (cl-remove-if 'nil (realgud:flatten parsed-args))) - (cmd-buf (realgud:run-process realgud:gdb-command-name - script-name parsed-cmd-args - 'realgud:gdb-minibuffer-history - nil)) - ) - (if cmd-buf - (with-current-buffer cmd-buf - (realgud-command "set annotate 1" nil nil nil) - ) - ) - ) - ) - -(provide-me "realgud-") - -;; Local Variables: -;; byte-compile-warnings: (not cl-functions) -;; End: diff --git a/packages/realgud/realgud/debugger/gdb/init.el b/packages/realgud/realgud/debugger/gdb/init.el deleted file mode 100644 index fb45afc8c..000000000 --- a/packages/realgud/realgud/debugger/gdb/init.el +++ /dev/null @@ -1,103 +0,0 @@ -;;; Copyright (C) 2010-2011, 2014 Rocky Bernstein -;;; gdb debugger - -(eval-when-compile (require 'cl)) - -(require 'load-relative) -(require-relative-list '("../../common/regexp" "../../common/loc") "realgud-") - -(defvar realgud-pat-hash) -(declare-function make-realgud-loc-pat (realgud-loc)) - -(defvar realgud:gdb-pat-hash (make-hash-table :test 'equal) - "hash key is the what kind of pattern we want to match: -backtrace, prompt, etc. the values of a hash entry is a -realgud-loc-pat struct") - -(declare-function make-realgud-loc "realgud-loc" (a b c d e f)) - -(defconst realgud:gdb-frame-file-regexp - "\\(.+\\):\\([0-9]+\\)") - -;; regular expression that describes a gdb location generally shown -;; before a command prompt. NOTE: we assume annotate 1! -(setf (gethash "loc" realgud:gdb-pat-hash) - (make-realgud-loc-pat - :regexp (format "^%s:\\([0-9]+\\):beg:0x\\([0-9a-f]+\\)" - realgud:gdb-frame-file-regexp) - :file-group 1 - :line-group 2 - :char-offset-group 3)) - -(setf (gethash "prompt" realgud:gdb-pat-hash) - (make-realgud-loc-pat - :regexp "^(gdb) " - )) - -;; regular expression that describes a "breakpoint set" line -(setf (gethash "brkpt-set" realgud:gdb-pat-hash) - (make-realgud-loc-pat - :regexp "^Breakpoint \\([0-9]+\\) at 0x\\([0-9a-f]*\\): file \\(.+\\), line \\([0-9]+\\).\n" - :num 1 - :file-group 3 - :line-group 4)) - -(defconst realgud:gdb-frame-start-regexp - "\\(?:^\\|\n\\)") - -(defconst realgud:gdb-frame-num-regexp - "#\\([0-9]+\\) ") - -;; Regular expression that describes a gdb "backtrace" command line. -;; For example: -;; #0 main (argc=2, argv=0xbffff564, envp=0xbffff570) at main.c:935 -;; #1 0xb7e9f4a5 in *__GI___strdup (s=0xbffff760 "/tmp/remake/remake") at strdup.c:42 -;; #2 0x080593ac in main (argc=2, argv=0xbffff5a4, envp=0xbffff5b0) -;; at main.c:952 -;; #46 0xb7f51b87 in vm_call_cfunc (th=0x804d188, reg_cfp=0xb7ba9e88, num=0, -;; recv=157798080, blockptr=0x0, me=0x80d12a0) at vm_insnhelper.c:410 - -(setf (gethash "debugger-backtrace" realgud:gdb-pat-hash) - (make-realgud-loc-pat - :regexp (concat realgud:gdb-frame-start-regexp - realgud:gdb-frame-num-regexp - "\\(?:.\\|\\(?:[\n] \\)\\)+[ ]+at " - realgud:gdb-frame-file-regexp - ) - :num 1 - :file-group 2 - :line-group 3) - ) - -(setf (gethash "font-lock-keywords" realgud:gdb-pat-hash) - '( - ;; #2 0x080593ac in main (argc=2, argv=0xbffff5a4, envp=0xbffff5b0) - ;; at main.c:952 - ("[ \n]+at \\(.*\\):\\([0-9]+\\)" - (1 realgud-file-name-face) - (2 realgud-line-number-face)) - - ;; The frame number and first type name, if present. - ;; E.g. =>#0 Makefile.in at /tmp/Makefile:216 - ;; ---^ - ( "#\\(?:^\\|\n\\)\\([0-9]+\\) " - (1 realgud-backtrace-number-face)) - )) - -(setf (gethash "gdb" realgud-pat-hash) realgud:gdb-pat-hash) - -(defvar realgud:gdb-command-hash (make-hash-table :test 'equal) - "Hash key is command name like 'continue' and the value is - the gdb command to use, like 'continue'") - -(setf (gethash "break" realgud:gdb-command-hash) "break %l") -(setf (gethash "clear" realgud:gdb-command-hash) "clear %l") -(setf (gethash "continue" realgud:gdb-command-hash) "continue") -(setf (gethash "quit" realgud:gdb-command-hash) "quit") -(setf (gethash "run" realgud:gdb-command-hash) "run") -(setf (gethash "step" realgud:gdb-command-hash) "step %p") -(setf (gethash "gdb" realgud-command-hash) realgud:gdb-command-hash) - -(setf (gethash "gdb" realgud-pat-hash) realgud:gdb-pat-hash) - -(provide-me "realgud:gdb-") diff --git a/packages/realgud/realgud/debugger/gdb/track-mode.el b/packages/realgud/realgud/debugger/gdb/track-mode.el deleted file mode 100644 index 1c298988d..000000000 --- a/packages/realgud/realgud/debugger/gdb/track-mode.el +++ /dev/null @@ -1,54 +0,0 @@ -;;; Copyright (C) 2010, 2012, 2014 Rocky Bernstein -;;; gdb tracking a comint or eshell buffer. - -(eval-when-compile (require 'cl)) -(require 'load-relative) -(require-relative-list '( - "../../common/cmds" - "../../common/menu" - "../../common/track" - "../../common/track-mode" - ) - "realgud-") -(require-relative-list '("core" "init") "realgud:gdb-") - -(realgud-track-mode-vars "realgud:gdb") - -(declare-function realgud-track-mode 'realgud-track-mode) -(declare-function realgud:track-mode-hook 'realgud-track-mode) -(declare-function realgud-track-mode-setup 'realgud-track-mode) -(declare-function realgud:track-set-debugger 'realgud-track-mode) - -(define-key realgud:gdb-track-mode-map - (kbd "C-c !b") 'realgud:goto-debugger-backtrace-line) - -(defun realgud:gdb-track-mode-hook() - (use-local-map realgud:gdb-track-mode-map) - (message "realgud:gdb track-mode-hook called") -) - -(define-minor-mode realgud:gdb-track-mode - "Minor mode for tracking gdb inside a process shell via realgud. - -If called interactively with no prefix argument, the mode is toggled. A prefix argument, captured as ARG, enables the mode if the argument is positive, and disables it otherwise. - -Key bindings: -\\{realgud:gdb-track-mode-map} -" - :init-value nil - ;; :lighter " gdb" ;; mode-line indicator from realgud-track is sufficient. - ;; The minor mode bindings. - :global nil - :group 'realgud:gdb - :keymap realgud:gdb-track-mode-map - (if realgud:gdb-track-mode - (progn - (realgud:track-set-debugger "gdb") - (realgud:gdb-track-mode-hook) - (realgud:track-mode-enable)) - (progn - (setq realgud-track-mode nil) - )) -) - -(provide-me "realgud:gdb-") diff --git a/packages/realgud/realgud/debugger/gub/Makefile.am b/packages/realgud/realgud/debugger/gub/Makefile.am deleted file mode 100644 index 23f8a8fa2..000000000 --- a/packages/realgud/realgud/debugger/gub/Makefile.am +++ /dev/null @@ -1 +0,0 @@ -include ../common.mk diff --git a/packages/realgud/realgud/debugger/gub/core.el b/packages/realgud/realgud/debugger/gub/core.el deleted file mode 100644 index a2a63d517..000000000 --- a/packages/realgud/realgud/debugger/gub/core.el +++ /dev/null @@ -1,175 +0,0 @@ -;;; Copyright (C) 2013-2014 Rocky Bernstein -(eval-when-compile (require 'cl)) - -(require 'load-relative) -(require-relative-list '("../../common/track" "../../common/lang" - "../../common/core") "realgud-") -(require-relative-list '("init") "realgud:gub-") - -(declare-function realgud-query-cmdline 'realgud-core) -(declare-function realgud-suggest-invocation 'realgud-core) -(declare-function realgud-lang-mode? 'realgud-lang) - -;; FIXME: I think the following could be generalized and moved to -;; realgud-... probably via a macro. -(defvar realgud:gub-minibuffer-history nil - "minibuffer history list for the command `gub'.") - -(easy-mmode-defmap gub-minibuffer-local-map - '(("\C-i" . comint-dynamic-complete-filename)) - "Keymap for minibuffer prompting of gud startup command." - :inherit minibuffer-local-map) - -;; FIXME: I think this code and the keymaps and history -;; variable chould be generalized, perhaps via a macro. -(defun gub-query-cmdline (&optional opt-debugger) - (realgud-query-cmdline - 'gub-suggest-invocation - gub-minibuffer-local-map - 'realgud:gub-minibuffer-history - opt-debugger)) - -(defun gub-parse-cmd-args (orig-args) - "Parse command line ARGS for the name of script to debug and its args. - -ARGS should contain a tokenized list of the command line to run. - -We return the a list containing - -- the command processor (e.g. gub.sh) and it's arguments if any - a list of strings -For example for the following input - \'./gub.sh --gub=\"-I\" -- ./gcd.go a b\' - -we might return: - (gub (\"-gub=-I\") (./gcd.rb a b)) - -NOTE: the above should have each item listed in quotes. -" - - (let ( - (args orig-args) - (interp-regexp ".*\\(^gub\.sh\\|tortoise\\)$") - - ;; Things returned - (gub-name "gub.sh") - (gub-args '()) - (go-prog-and-args '()) - ) - - (if (not (and args)) - ;; Got nothing - (list gub-name gub-args go-prog-and-args) - ;; else - ;; Strip off "gub.sh" - (when (string-match interp-regexp - (file-name-nondirectory (car args))) - (setq gub-name (pop args)) - ) - - ;; parse options - (while args - (let ((arg (pop args))) - (cond - ((string-match "^-[-]?gub=" arg) - (setq gub-args (nconc gub-args (list arg)))) - - ((string-match "^-run" arg) - (setq gub-args (nconc gub-args (list arg)))) - - ((string-match "^-interp=SS" arg) - (setq gub-args (nconc gub-args (list arg)))) - - ((equal arg "--")) ;; Ignore - - ;; Anything else add to gub-args - ('t (setq go-prog-and-args (nconc go-prog-and-args (list arg)))) - )))) - (list gub-name gub-args go-prog-and-args) - )) - -(defconst realgud:gub-auto-suffix-regexp - "\\.go$" - "Go file suffix" -) - -(defun gub-suggest-file-priority(filename) - (let ((priority 2) - (is-not-directory) - ) - (if (realgud-lang-mode? filename "go") - (progn - (if (string-match realgud:gub-auto-suffix-regexp filename) - (setq priority 5) - (setq priority 7)) - )) - priority - ) -) - -;; To silence Warning: reference to free variable -(defvar realgud:gub-command-name) - -(defun gub-suggest-invocation (debugger-name) - "Suggest a command invocation via `realgud-suggest-invocaton'" - (realgud-suggest-invocation realgud:gub-command-name - realgud:gub-minibuffer-history - "go" "\\.go$")) - -;; Convert a command line as would be typed normally to run a script -;; into one that invokes an Emacs-enabled debugging session. -;; "--debugger" in inserted as the first switch. - -(defun realgud:gub-massage-args (command-line) - (let* ((new-args (list "--debugger")) - (args (split-string-and-unquote command-line)) - (program (car args)) - (seen-e nil) - (shift (lambda () - (setq new-args (cons (car args) new-args)) - (setq args (cdr args))))) - - ;; Pass all switches and -e scripts through. - (while (and args - (string-match "^-" (car args)) - (not (equal "-" (car args))) - (not (equal "--" (car args)))) - (funcall shift)) - - (if (or (not args) - (string-match "^-" (car args))) - (error "Can't use stdin as the script to debug")) - ;; This is the program name. - (funcall shift) - - (while args - (funcall shift)) - - (nreverse new-args) - ) - ) - -(defun gub-reset () - "Gub cleanup - remove debugger's internal buffers (frame, -breakpoints, etc.)." - (interactive) - ;; (gub-breakpoint-remove-all-icons) - (dolist (buffer (buffer-list)) - (when (string-match "\\*gub-[a-z]+\\*" (buffer-name buffer)) - (let ((w (get-buffer-window buffer))) - (when w - (delete-window w))) - (kill-buffer buffer)))) - -;; (defun gub-reset-keymaps() -;; "This unbinds the special debugger keys of the source buffers." -;; (interactive) -;; (setcdr (assq 'gub-debugger-support-minor-mode minor-mode-map-alist) -;; gub-debugger-support-minor-mode-map-when-deactive)) - - -(defun realgud:gub-customize () - "Use `customize' to edit the settings of the `gub' debugger." - (interactive) - (customize-group 'realgud:gub)) - -(provide-me "realgud:gub-") diff --git a/packages/realgud/realgud/debugger/gub/gub.el b/packages/realgud/realgud/debugger/gub/gub.el deleted file mode 100644 index 2933d5276..000000000 --- a/packages/realgud/realgud/debugger/gub/gub.el +++ /dev/null @@ -1,67 +0,0 @@ -;;; Copyright (C) 2013-2015 Rocky Bernstein -;; `gub' Main interface to Go gub via Emacs -(require 'load-relative) -(require-relative-list '("../../common/helper") "realgud-") -(require-relative-list '("../../common/track") "realgud-") -(require-relative-list '("core" "track-mode") "realgud:gub-") -;; This is needed, or at least the docstring part of it is needed to -;; get the customization menu to work in Emacs 24. -(defgroup realgud:gub nil - "The realgud interface to the Go SSA interpreter debugger, gub" - :group 'realgud - :version "23.4") - -;; ------------------------------------------------------------------- -;; User definable variables -;; - -(defcustom realgud:gub-command-name - "tortoise -run -gub= -interp=SS --" - "File name for executing the Go SSA interpreter/debugger, gub, and command options. -This should be an executable on your path, or an absolute file name." - :type 'string - :group 'realgud:gub) - -(declare-function gub-query-cmdline 'realgud-gub-core) -(declare-function gub-parse-cmd-args 'realgud-gub-core) -(declare-function realgud:run-process 'realgud-core) - - -(defun realgud-gub-fn (&optional opt-command-line no-reset) - "See `realgud-gub' for details" - - (let* ((cmd-str (or opt-command-line (gub-query-cmdline "gub"))) - (cmd-args (split-string-and-unquote cmd-str)) - (parsed-args (gub-parse-cmd-args cmd-args)) - (gub-program (car parsed-args)) - (gub-args (cadr parsed-args)) - (go-prog-and-args (caddr parsed-args)) - (script-filename (car go-prog-and-args)) - (cmd-buf)) - (realgud:run-process gub-program script-filename cmd-args - 'gub-track-mode no-reset) - ) - ) - -;;;###autoload -(defun realgud-gub (&optional opt-command-line no-reset) - "Invoke the Go SSA debugger, gub and start the Emacs user interface. - -String COMMAND-LINE specifies how to run gub. - -Normally command buffers are reused when the same debugger is -reinvoked inside a command buffer with a similar command. If we -discover that the buffer has prior command-buffer information and -NO-RESET is nil, then that information which may point into other -buffers and source buffers which may contain marks and fringe or -marginal icons is reset." - - - (interactive) - (realgud-gub-fn opt-command-line no-reset) - ) - -(defalias 'gub 'realgud-gub) - -(provide-me "realgud-") -;;; gub.el ends here diff --git a/packages/realgud/realgud/debugger/gub/init.el b/packages/realgud/realgud/debugger/gub/init.el deleted file mode 100644 index 1a456aec2..000000000 --- a/packages/realgud/realgud/debugger/gub/init.el +++ /dev/null @@ -1,173 +0,0 @@ -;;; Copyright (C) 2013-2014 Rocky Bernstein -;;; Regular expressions for Go SSA debugger: gub - -(eval-when-compile (require 'cl)) - -(require 'load-relative) -(require-relative-list '("../../common/regexp" - "../../common/loc" - "../../common/init") - "realgud-") - -(defvar realgud-pat-hash) -(declare-function make-realgud-loc-pat (realgud-loc)) - -(defvar realgud:gub-pat-hash (make-hash-table :test 'equal) - "Hash key is the what kind of pattern we want to match: -backtrace, prompt, etc. The values of a hash entry is a -realgud-loc-pat struct") - -;; Regular expression that describes a gub location generally shown -;; before a command prompt. -;; For example: -;; interp/testdata/square.go:16:2-17 -(setf (gethash "loc" realgud:gub-pat-hash) - (make-realgud-loc-pat - :regexp - "\\(?:^\\|\n\\)\\(\\(?:[a-zA-Z]:\\)?[a-zA-Z0-9_/.\\\\][-a-zA-Z0-9_/.\\\\ ]*\\.go\\):\\([0-9]+\\)" - :file-group 1 - :line-group 2)) - -;; Regular expression that describes a Go backtrace line. -;; For example: -;; ssa-interp/interp/interp.go:202 (0x506c84) -;; visitInstr: *fr.get(instr.Addr).(*Value) = copyVal(fr.get(instr.Val)) -;; sa-interp/interp/interp.go:604 (0x50b5b1) -;; runFrame: switch visitInstr(fr, instr) { -(setf (gethash "lang-backtrace" realgud:gub-pat-hash) - (make-realgud-loc-pat - :regexp - "\\(?:^\\|\n\\)\\(\\(?:[a-zA-Z]:\\)?[a-zA-Z0-9_/.\\\\][-a-zA-Z0-9_/.\\\\]*\\.go\\):\\([0-9]+\\)" - :file-group 1 - :line-group 2)) - - -;; Regular expression that describes a gub location generally shown -;; before a command prompt. -;; For example: -;; gub[1]: -;; gub[1@3]: -(setf (gethash "prompt" realgud:gub-pat-hash) - (make-realgud-loc-pat - :regexp "^gub\\[\\([0-9]+\\)\\(?:@\\([0-9]+\\)\\)?\\]: " - :num 1 - )) - -;; Regular expression that describes a "breakpoint set" line -(setf (gethash "brkpt-set" realgud:gub-pat-hash) - (make-realgud-loc-pat - :regexp "^ Breakpoint \\([0-9]+\\) set\\(?:in function \\) at \\([a-zA-Z0-9_/.\\\\][-a-zA-Z0-9_/.\\\\ ]*\\.go\\):\\([0-9]+\\)" - :num 1 - :file-group 2 - :line-group 3)) - -;; Regular expression that describes a debugger "delete" (breakpoint) response. -;; For example: -;; Deleted breakpoint 1. -(setf (gethash "brkpt-del" realgud:gub-pat-hash) - (make-realgud-loc-pat - :regexp "^ Deleted breakpoint \\([0-9]+\\)\n" - :num 1)) - -;; Regular expression describes general location. In contrast to loc -;; which triggers automatically, we bind this to a key like C-c !s -;; For example: -;; interp/testdata/square.go:16:2-17 -; ^^^^^^ spaces -(setf (gethash "general-location" realgud:gub-pat-hash) - (make-realgud-loc-pat - :regexp - "\\(?:^\\|\n\\)[ \t]*\\(\\(?:[a-zA-Z]:\\)?[a-zA-Z0-9_/.\\\\][-a-zA-Z0-9_/.\\\\ ]*\\.go\\):\\([0-9]+\\)" - :file-group 1 - :line-group 2)) - -(defconst realgud:gub-selected-frame-arrow "=>" -"String that describes which frame is selected in a debugger -backtrace listing.") -(defconst realgud:gub-frame-arrow (format "\\(%s\\| \\)" - realgud:gub-selected-frame-arrow)) -(defconst realgud:gub-frame-num-regexp " #\\([0-9]+\\) ") - -(defconst realgud:gub-frame-file-regexp " at \\(.*\\):\\([0-9]+\\)") - - -;; Regular expression that describes a debugger "backtrace" command line. -;; For example: -;; => #0 square(n) -;; #1 main() -(setf (gethash "debugger-backtrace" realgud:gub-pat-hash) - (make-realgud-loc-pat - :regexp (concat "^" - realgud:gub-frame-arrow - realgud:gub-frame-num-regexp - "\\(.*\\)" - realgud:gub-frame-file-regexp - ) - :num 2 - :file-group 4 - :line-group 5) - ) - -(setf (gethash "selected-frame-indicator" realgud:gub-pat-hash) - realgud:gub-selected-frame-arrow) - -;; Regular expression that describes a Go backtrace line -;; For example: -;; /usr/local/go/src/pkg/runtime/panic.c:482 (0x805c956) -;; ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-^^^----------- -(setf (gethash "lang-backtrace" realgud:gub-pat-hash) - (make-realgud-loc-pat - :regexp "^\\(/.+\\):\\([0-9]+\\) \\((0x[0-9a-f]+)\\)?$" - :file-group 1 - :line-group 2)) - -;; Regular expression that describes a Go runtime panic -;; For example: -;; /tmp/github.com/rocky/ssa-interp/eval/selectorexpr.go:18 +0x9f -;;^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-^^------ -(setf (gethash "panic-backtrace" realgud:gub-pat-hash) - (make-realgud-loc-pat - :regexp "^[ \t]*\\(/.+\\):\\([0-9]+\\) \\(+0x[0-9a-f]+\\)?$" - :file-group 1 - :line-group 2)) - -;; Regular expression for a termination message. -(setf (gethash "termination" realgud:gub-pat-hash) - "^gub: That's all, folks...\n") - -(setf (gethash "font-lock-keywords" realgud:gub-pat-hash) - '( - ;; File name and line number - ;; E.g. =>#0 Makefile.in at /tmp/Makefile:216 - ;; ---^^^^^^^^^^^^^-^^^ - (" at \\(.*\\):\\([0-9]+\\)" - (1 realgud-file-name-face) - (2 realgud-line-number-face)) - - ;; The frame number and first type name, if present. - ;; E.g. =>#0 Makefile.in at /tmp/Makefile:216 - ;; ---^ - ("#\\([0-9]+\\) " - (1 realgud-backtrace-number-face)) - )) - -(setf (gethash "gub" realgud-pat-hash) realgud:gub-pat-hash) - -(defvar realgud:gub-command-hash (make-hash-table :test 'equal) - "Hash key is command name like 'quit' and the value is - the gub command to use, like 'q'") - -(setf (gethash "backtrace" realgud:gub-command-hash) "backtrace") -(setf (gethash "break" realgud:gub-command-hash) "break %l") -(setf (gethash "continue" realgud:gub-command-hash) "continue") -;;(setf (gethash "eval" realgud:gub-command-hash) "x %s") -(setf (gethash "quit" realgud:gub-command-hash) "quit") -(setf (gethash "restart" realgud:gub-command-hash) "R") -(setf (gethash "run" realgud:gub-command-hash) "R") -(setf (gethash "step" realgud:gub-command-hash) "step") -(setf (gethash "next" realgud:gub-command-hash) "next") -(setf (gethash "until" realgud:gub-command-hash) "until %l") -(setf (gethash "gub" realgud-command-hash) realgud:gub-command-hash) - - -(provide-me "realgud:gub-") diff --git a/packages/realgud/realgud/debugger/gub/track-mode.el b/packages/realgud/realgud/debugger/gub/track-mode.el deleted file mode 100644 index 2b60c6ee9..000000000 --- a/packages/realgud/realgud/debugger/gub/track-mode.el +++ /dev/null @@ -1,78 +0,0 @@ -;;; Copyright (C) 2013-2015 Rocky Bernstein -;;; Golang SSA gub tracking a comint buffer. - -(eval-when-compile (require 'cl)) -(require 'load-relative) -(require-relative-list '( - "../../common/cmds" - "../../common/menu" - "../../common/track" - "../../common/track-mode" - ) - "realgud-") -(require-relative-list '("core" "init") "realgud:gub-") - -(realgud-track-mode-vars "gub") - -(declare-function realgud-goto-line-for-pt 'realgud-track-mode) -(declare-function realgud-track-mode 'realgud-track-mode) -(declare-function realgud:track-set-debugger 'realgud-track-mode) -(declare-function realgud-track-mode-setup 'realgud-track-mode) - -(defun realgud:gub-goto-location (pt) - "Display the location mentioned in a location -described by PT." - (interactive "d") - (realgud-goto-line-for-pt pt "general-location")) - - -(defun realgud:gub-goto-panic-location (pt) - "Display the location mentioned in a location -described by PT." - (interactive "d") - (realgud-goto-line-for-pt pt "panic-backtrace")) - - -(define-key gub-track-mode-map - (kbd "C-c !!") 'realgud:goto-lang-backtrace-line) -(define-key gub-track-mode-map - (kbd "C-c !b") 'realgud:goto-debugger-backtrace-line) -(define-key gub-track-mode-map - (kbd "C-c !s") 'realgud:gub-goto-location) -(define-key gub-track-mode-map - (kbd "C-c !p") 'realgud:gub-goto-panic-location) - -(defun gub-track-mode-hook() - (if gub-track-mode - (progn - (use-local-map gub-track-mode-map) - (message "using gub mode map") - ) - (message "gub track-mode-hook disable called")) -) - -(define-minor-mode gub-track-mode - "Minor mode for tracking gub source locations inside a process shell via realgud. gub is a Go language debugger. - -If called interactively with no prefix argument, the mode is toggled. A prefix argument, captured as ARG, enables the mode if the argument is positive, and disables it otherwise. - -\\{gub-track-mode-map} -" - :init-value nil - ;; :lighter " gub" ;; mode-line indicator from realgud-track is sufficient. - ;; The minor mode bindings. - :global nil - :group 'realgud:gub - :keymap gub-track-mode-map - - (realgud:track-set-debugger "gub") - (if gub-track-mode - (progn - (realgud-track-mode-setup 't) - (gub-track-mode-hook)) - (progn - (setq realgud-track-mode nil) - )) -) - -(provide-me "realgud:gub-") diff --git a/packages/realgud/realgud/debugger/jdb/Makefile.am b/packages/realgud/realgud/debugger/jdb/Makefile.am deleted file mode 100644 index 9a343a513..000000000 --- a/packages/realgud/realgud/debugger/jdb/Makefile.am +++ /dev/null @@ -1 +0,0 @@ -include $(srcdir)/../common.mk diff --git a/packages/realgud/realgud/debugger/jdb/README b/packages/realgud/realgud/debugger/jdb/README deleted file mode 100644 index d37044a22..000000000 --- a/packages/realgud/realgud/debugger/jdb/README +++ /dev/null @@ -1,2 +0,0 @@ -Supporting JDB is going to be a mess. -Consider using something else. Eclipse anyone? diff --git a/packages/realgud/realgud/debugger/jdb/backtrack-mode.el b/packages/realgud/realgud/debugger/jdb/backtrack-mode.el deleted file mode 100644 index 1de8386cd..000000000 --- a/packages/realgud/realgud/debugger/jdb/backtrack-mode.el +++ /dev/null @@ -1,63 +0,0 @@ -;;; Copyright (C) 2014 Rocky Bernstein - -;;; Mode for parsing various kinds of backtraces found in Java - -(eval-when-compile (require 'cl)) -(require 'load-relative) -(require-relative-list '( - "../../common/cmds" - "../../common/menu" - "../../common/track-mode" - "../../common/backtrack-mode" - ) - "realgud-") -(require-relative-list '("core" "init") "realgud:jdb-") -(require-relative-list '("../../lang/ruby") "realgud-lang-") - -(realgud-backtrack-mode-vars "jdb") -(set-keymap-parent jdb-backtrack-mode-map realgud-backtrack-mode-map) - -(declare-function realgud-backtrack-mode 'realgud-common-backtrack-mode) -(declare-function realgud-backtrack-set-debugger 'realgud-common-backtrack-mode) -(declare-function realgud-goto-line-for-pt 'realgud-common-backtrack-mode) -(declare-function realgud:ruby-populate-command-keys 'realgud-lang-ruby) - -(defun realgud:jdb-goto-control-frame-line (pt) - "Display the location mentioned by a control-frame line -described by PT." - (interactive "d") - (realgud-goto-line-for-pt pt "control-frame")) - -(realgud:ruby-populate-command-keys jdb-backtrack-mode-map) -(define-key jdb-backtrack-mode-map - (kbd "C-c !c") 'realgud:jdb-goto-control-frame-line) - -(define-minor-mode jdb-backtrack-mode - "Minor mode for tracking ruby debugging inside a file which may not have process shell." - :init-value nil - ;; :lighter " jdb" ;; mode-line indicator from realgud-track is sufficient. - ;; The minor mode bindings. - :global nil - :group 'realgud:jdb - :keymap jdb-backtrack-mode-map - - (realgud-backtrack-set-debugger "jdb") - (if jdb-backtrack-mode - (progn - (realgud-backtrack-mode 't) - (run-mode-hooks (intern (jdb-backtrack-mode-hook)))) - (progn - (realgud-backtrack-mode nil) - )) -) - -(defun jdb-backtrack-mode-hook() - (if jdb-backtrack-mode - (progn - (use-local-map jdb-backtrack-mode-map) - (message "using jdb mode map") - ) - (message "jdb backtrack-mode-hook disable called")) -) - -(provide-me "realgud:jdb-") diff --git a/packages/realgud/realgud/debugger/jdb/core.el b/packages/realgud/realgud/debugger/jdb/core.el deleted file mode 100644 index d4d96e96b..000000000 --- a/packages/realgud/realgud/debugger/jdb/core.el +++ /dev/null @@ -1,185 +0,0 @@ -;;; Copyright (C) 2014 Rocky Bernstein -(eval-when-compile (require 'cl)) - -;; We use gud to handle the classpath-to-filename mapping -(require 'gud) -(require 'compile) ;; for compilation-find-file - -(require 'load-relative) -(require-relative-list '("../../common/track" - "../../common/core" - "../../common/file" - "../../common/lang") - "realgud-") -(require-relative-list '("init") "realgud:jdb-") - -(declare-function gud-find-source 'gud) - -(declare-function realgud:strip 'realgud) -(declare-function realgud:expand-file-name-if-exists 'realgud-core) -(declare-function realgud-parse-command-arg 'realgud-core) -(declare-function realgud-query-cmdline 'realgud-core) -(declare-function realgud-suggest-invocation 'realgud-core) -(declare-function realgud:file-loc-from-line 'realgud-file) - -;; FIXME: I think the following could be generalized and moved to -;; realgud-... probably via a macro. -(defvar realgud:jdb-minibuffer-history nil - "minibuffer history list for the command `realgud:jdb'.") - -(easy-mmode-defmap jdb-minibuffer-local-map - '(("\C-i" . comint-dynamic-complete-filename)) - "Keymap for minibuffer prompting of gud startup command." - :inherit minibuffer-local-map) - -;; FIXME: I think this code and the keymaps and history -;; variable chould be generalized, perhaps via a macro. -(defun realgud:jdb-query-cmdline (&optional opt-debugger) - (realgud-query-cmdline - 'jdb-suggest-invocation - jdb-minibuffer-local-map - 'realgud:jdb-minibuffer-history - opt-debugger)) - -(defun realgud:jdb-dot-to-slash (str) - "Change '.' to '/' in STR but chop off from the last . to the end. For example -ca.mgcill.rocky.snpEff.main => ca/mcgill/rocky/snpEff" - ;;(setq str (replace-regexp-in-string "\\([^\\.]+\\.\\)[^\\.]+$" "\\1" str)) - ;;(setq str (replace-regexp-in-string "\\.$" "" str)) - (setq str (replace-regexp-in-string "\\." "/" str)) - str) - -(defvar realgud:jdb-file-remap (make-hash-table :test 'equal) - "How to remap Java files in jdb when we otherwise can't find in - the filesystem. The hash key is the file string we saw, and the - value is associated filesystem string presumably in the - filesystem") - -(defun realgud:jdb-find-file(filename) - "A find-file specific for java/jdb. We use `gdb-jdb-find-source' to map a -name to a filename. Failing that we can add on .java to the name. Failing that -we will prompt for a mapping and save that in `realgud:jdb-file-remap' when -that works." - (let* ((transformed-file) - (stripped-filename (realgud:strip filename)) - (gud-jdb-filename (gud-jdb-find-source stripped-filename)) - ) - (cond - ((and gud-jdb-filename (file-exists-p gud-jdb-filename)) - gud-jdb-filename) - ((file-exists-p (setq transformed-file (concat stripped-filename ".java"))) - transformed-file) - ('t - (if (gethash stripped-filename realgud:jdb-file-remap) - (let ((remapped-filename)) - (setq remapped-filename (gethash stripped-filename realgud:jdb-file-remap)) - (if (file-exists-p remapped-filename) - remapped-filename - ;; else - (and (remhash filename realgud-file-remap) nil))) - ;; else - (let ((remapped-filename) - (guess-filename (realgud:jdb-dot-to-slash filename))) - (setq remapped-filename - (buffer-file-name - (compilation-find-file (point-marker) guess-filename - nil "%s.java"))) - (when (and remapped-filename (file-exists-p remapped-filename)) - (puthash stripped-filename remapped-filename realgud:jdb-file-remap) - remapped-filename - )) - )) - )) - ) - -(defun realgud:jdb-loc-fn-callback(text filename lineno source-str - ignore-file-re cmd-mark) - (realgud:file-loc-from-line filename lineno - cmd-mark source-str nil - ignore-file-re 'realgud:jdb-find-file)) - -(defun realgud:jdb-parse-cmd-args (orig-args) - "Parse command line ARGS for the annotate level and name of script to debug. - -ORIG-ARGS should contain a tokenized list of the command line to run. - -We return the a list containing - -* the command debugger (e.g. jdb) - -* debugger command rguments if any - a list of strings - -* the script name and its arguments - list of strings - -For example for the following input - '(\"jdb\" \"-classpath . ./TestMe.java a b\")) - -we might return: - (\"jdb\" nil \"TestMe\")) - -Note that the script name path has been expanded via `expand-file-name'. -" - - ;; Parse the following kind of pattern: - ;; [ruby ruby-options] jdb jdb-options script-name script-options - (let ( - (args orig-args) - (interp-regexp - (if (member system-type (list 'windows-nt 'cygwin 'msdos)) - "^jdb*\\(.exe\\)?$" - "^jdb*$")) - (jdb-name) - ;; - ;; One dash is added automatically to the below, so - ;; attach is really -attach - (jdb-two-args '("attach" "sourcepath" "classpath" "dbgtrace")) - - ;; Things returned - (debugger-args '()) - (program-args '())) - - (if (not (and args)) - ;; Got nothing: return '(nil nil nil) - (list jdb-name nil debugger-args program-args) - ;; else - ;; Strip off optional "jdb" or "jdb.exe" etc. - (when (string-match interp-regexp (car args)) - (setq jdb-name (car args)) - (setq program-args (nconc program-args (cdr args)))) - - (list jdb-name debugger-args program-args)))) - -;; To silence Warning: reference to free variable -(defvar realgud:jdb-command-name) - -(defun jdb-suggest-invocation (debugger-name) - "Suggest a jdb command invocation via `realgud-suggest-invocaton'" - (realgud-suggest-invocation realgud:jdb-command-name - realgud:jdb-minibuffer-history - "java" "\\.java$" "jdb")) - -(defun jdb-reset () - "Jdb cleanup - remove debugger's internal buffers (frame, -breakpoints, etc.)." - (interactive) - ;; (jdb-breakpoint-remove-all-icons) - (dolist (buffer (buffer-list)) - (when (string-match "\\*jdb-[a-z]+\\*" (buffer-name buffer)) - (let ((w (get-buffer-window buffer))) - (when w - (delete-window w))) - (kill-buffer buffer)))) - -;; (defun jdb-reset-keymaps() -;; "This unbinds the special debugger keys of the source buffers." -;; (interactive) -;; (setcdr (assq 'jdb-debugger-support-minor-mode minor-mode-map-alist) -;; jdb-debugger-support-minor-mode-map-when-deactive)) - - -(defun realgud:jdb-customize () - "Use `customize' to edit the settings of the `jdb' debugger." - (interactive) - (customize-group 'realgud:jdb)) - -(provide-me "realgud:jdb-") diff --git a/packages/realgud/realgud/debugger/jdb/file.el b/packages/realgud/realgud/debugger/jdb/file.el deleted file mode 100644 index 635d8442c..000000000 --- a/packages/realgud/realgud/debugger/jdb/file.el +++ /dev/null @@ -1,228 +0,0 @@ -;; Association list of fully qualified class names (package + class name) -;; and their source files. -(defvar gud-jdb-class-source-alist nil - "Association list of fully qualified class names and source files.") - -;; This is used to hold a source file during analysis. -(defvar gud-jdb-analysis-buffer nil) - -(defvar gud-jdb-classpath-string nil - "Holds temporary classpath values.") - -(defun gud-jdb-build-source-files-list (path extn) - "Return a list of java source files (absolute paths). -PATH gives the directories in which to search for files with -extension EXTN. Normally EXTN is given as the regular expression - \"\\.java$\" ." - (apply 'nconc (mapcar (lambda (d) - (when (file-directory-p d) - (directory-files d t extn nil))) - path))) - -;; Move point past whitespace. -(defun gud-jdb-skip-whitespace () - (skip-chars-forward " \n\r\t\014")) - -;; Move point past a "// " type of comment. -(defun gud-jdb-skip-single-line-comment () - (end-of-line)) - -;; Move point past a "/* */" or "/** */" type of comment. -(defun gud-jdb-skip-traditional-or-documentation-comment () - (forward-char 2) - (catch 'break - (while (not (eobp)) - (if (eq (following-char) ?*) - (progn - (forward-char) - (if (not (eobp)) - (if (eq (following-char) ?/) - (progn - (forward-char) - (throw 'break nil))))) - (forward-char))))) - -;; Move point past any number of consecutive whitespace chars and/or comments. -(defun gud-jdb-skip-whitespace-and-comments () - (gud-jdb-skip-whitespace) - (catch 'done - (while t - (cond - ((looking-at "//") - (gud-jdb-skip-single-line-comment) - (gud-jdb-skip-whitespace)) - ((looking-at "/\\*") - (gud-jdb-skip-traditional-or-documentation-comment) - (gud-jdb-skip-whitespace)) - (t (throw 'done nil)))))) - -;; Move point past things that are id-like. The intent is to skip regular -;; id's, such as class or interface names as well as package and interface -;; names. -(defun gud-jdb-skip-id-ish-thing () - (skip-chars-forward "^ /\n\r\t\014,;{")) - -;; Move point past a string literal. -(defun gud-jdb-skip-string-literal () - (forward-char) - (while (not (cond - ((eq (following-char) ?\\) - (forward-char)) - ((eq (following-char) ?\042)))) - (forward-char)) - (forward-char)) - -;; Move point past a character literal. -(defun gud-jdb-skip-character-literal () - (forward-char) - (while - (progn - (if (eq (following-char) ?\\) - (forward-char 2)) - (not (eq (following-char) ?\'))) - (forward-char)) - (forward-char)) - -;; Move point past the following block. There may be (legal) cruft before -;; the block's opening brace. There must be a block or it's the end of life -;; in petticoat junction. -(defun gud-jdb-skip-block () - - ;; Find the beginning of the block. - (while - (not (eq (following-char) ?{)) - - ;; Skip any constructs that can harbor literal block delimiter - ;; characters and/or the delimiters for the constructs themselves. - (cond - ((looking-at "//") - (gud-jdb-skip-single-line-comment)) - ((looking-at "/\\*") - (gud-jdb-skip-traditional-or-documentation-comment)) - ((eq (following-char) ?\042) - (gud-jdb-skip-string-literal)) - ((eq (following-char) ?\') - (gud-jdb-skip-character-literal)) - (t (forward-char)))) - - ;; Now at the beginning of the block. - (forward-char) - - ;; Skip over the body of the block as well as the final brace. - (let ((open-level 1)) - (while (not (eq open-level 0)) - (cond - ((looking-at "//") - (gud-jdb-skip-single-line-comment)) - ((looking-at "/\\*") - (gud-jdb-skip-traditional-or-documentation-comment)) - ((eq (following-char) ?\042) - (gud-jdb-skip-string-literal)) - ((eq (following-char) ?\') - (gud-jdb-skip-character-literal)) - ((eq (following-char) ?{) - (setq open-level (+ open-level 1)) - (forward-char)) - ((eq (following-char) ?}) - (setq open-level (- open-level 1)) - (forward-char)) - (t (forward-char)))))) - -;; Find the package and class definitions in Java source file FILE. Assumes -;; that FILE contains a legal Java program. BUF is a scratch buffer used -;; to hold the source during analysis. -(defun gud-jdb-analyze-source (buf file) - (let ((l nil)) - (set-buffer buf) - (insert-file-contents file nil nil nil t) - (goto-char 0) - (catch 'abort - (let ((p "")) - (while (progn - (gud-jdb-skip-whitespace) - (not (eobp))) - (cond - - ;; Any number of semi's following a block is legal. Move point - ;; past them. Note that comments and whitespace may be - ;; interspersed as well. - ((eq (following-char) ?\073) - (forward-char)) - - ;; Move point past a single line comment. - ((looking-at "//") - (gud-jdb-skip-single-line-comment)) - - ;; Move point past a traditional or documentation comment. - ((looking-at "/\\*") - (gud-jdb-skip-traditional-or-documentation-comment)) - - ;; Move point past a package statement, but save the PackageName. - ((looking-at "package") - (forward-char 7) - (gud-jdb-skip-whitespace-and-comments) - (let ((s (point))) - (gud-jdb-skip-id-ish-thing) - (setq p (concat (buffer-substring s (point)) ".")) - (gud-jdb-skip-whitespace-and-comments) - (if (eq (following-char) ?\073) - (forward-char)))) - - ;; Move point past an import statement. - ((looking-at "import") - (forward-char 6) - (gud-jdb-skip-whitespace-and-comments) - (gud-jdb-skip-id-ish-thing) - (gud-jdb-skip-whitespace-and-comments) - (if (eq (following-char) ?\073) - (forward-char))) - - ;; Move point past the various kinds of ClassModifiers. - ((looking-at "public") - (forward-char 6)) - ((looking-at "abstract") - (forward-char 8)) - ((looking-at "final") - (forward-char 5)) - - ;; Move point past a ClassDeclaration, but save the class - ;; Identifier. - ((looking-at "class") - (forward-char 5) - (gud-jdb-skip-whitespace-and-comments) - (let ((s (point))) - (gud-jdb-skip-id-ish-thing) - (setq - l (nconc l (list (concat p (buffer-substring s (point))))))) - (gud-jdb-skip-block)) - - ;; Move point past an interface statement. - ((looking-at "interface") - (forward-char 9) - (gud-jdb-skip-block)) - - ;; Anything else means the input is invalid. - (t - (message "Error parsing file %s." file) - (throw 'abort nil)))))) - l)) - -(defun gud-jdb-build-class-source-alist-for-file (file) - (mapcar - (lambda (c) - (cons c file)) - (gud-jdb-analyze-source gud-jdb-analysis-buffer file))) - -;; Return an alist of fully qualified classes and the source files -;; holding their definitions. SOURCES holds a list of all the source -;; files to examine. -(defun gud-jdb-build-class-source-alist (sources) - (setq gud-jdb-analysis-buffer (get-buffer-create " *gud-jdb-scratch*")) - (prog1 - (apply - 'nconc - (mapcar - 'gud-jdb-build-class-source-alist-for-file - sources)) - (kill-buffer gud-jdb-analysis-buffer) - (setq gud-jdb-analysis-buffer nil))) diff --git a/packages/realgud/realgud/debugger/jdb/init.el b/packages/realgud/realgud/debugger/jdb/init.el deleted file mode 100644 index 8962af186..000000000 --- a/packages/realgud/realgud/debugger/jdb/init.el +++ /dev/null @@ -1,204 +0,0 @@ -;;; Copyright (C) 2014 Rocky Bernstein -(eval-when-compile (require 'cl)) - -(require 'load-relative) -(require-relative-list '("../../common/regexp" - "../../common/loc" - "../../common/init") - "realgud-") - -;; (require-relative-list '("../../lang/java") "realgud-lang-") - -(defvar realgud-pat-hash) -(declare-function make-realgud-loc-pat (realgud-loc)) - -(defconst realgud:jdb-identifier "[A-Za-z_][A-Za-z0-9_.]+" -"Regexp string that matches a Java identifier possily with class -name. For example java.lang.Class.getDeclaredMethods") - -(defvar realgud:jdb-pat-hash (make-hash-table :test 'equal) - "Hash key is the what kind of pattern we want to match: -backtrace, prompt, etc. The values of a hash entry is a -realgud-loc-pat struct") - -(setf (gethash "loc-callback-fn" realgud:jdb-pat-hash) 'realgud:jdb-loc-fn-callback) - -;; Regular expression that describes a jdb location generally shown -;; before a command prompt. For example: -;; Breakpoint hit: "thread=main", TestMe.main(), line=7 bci=0 -;; Step completed: "thread=main", TestMe.(), line=15 bci=0 - -(setf (gethash "loc" realgud:jdb-pat-hash) - (make-realgud-loc-pat - :regexp "\\(?:Breakpoint hit\\|Step completed\\): \"thread=.+\", \\(.+\\)?[.]\\(.+\\)(), line=\\([0-9]+\\) bci=\\([0-9]+\\)\\(?:\n\\([0-9]+\\)\\(.*\\)\\)?" - :file-group 1 - :line-group 3 - :text-group 6)) - -;; Regular expression that describes a jdb command prompt -;; For example: -;; main[1] -;; main[2] -;; > -;; FIXME: I think the pattern is thread-name[stack-level] -;; Here, we only deal with main. -(setf (gethash "prompt" realgud:jdb-pat-hash) - (make-realgud-loc-pat - :regexp "^\\(?:main\\[\\([0-9]+\\)\\]\\|>\\) " - :num 1 - )) - -;; Regular expression that describes a Java syntax error line. -;; (setf (gethash "syntax-error" realgud:jdb-pat-hash) -;; realgud-java-syntax-error-pat) - -;; Regular expression that describes a Java backtrace line. -;; For example: -;; [1] ca.snpEffect.commandLine.SnpEff.run (SnpEff.java:7) -(setf (gethash "lang-backtrace" realgud:jdb-pat-hash) - (make-realgud-loc-pat - ;; FIXME: use realgud:jdb-identifier - :regexp "^\\(?:[ ]*[\\[0-9\\]+]\\) \\([A-Za-z_.][A-Za-z0-9.]+\\) (\\([A-Za-z_.][A-Za-z0-9.]+\\):\\([0-9]+\\))" - :file-group 1 - :line-group 2)) - -;; Regular expression that describes a "breakpoint set" line. -;; For example: -;; Set breakpoint TestMe:7 -(setf (gethash "brkpt-set" realgud:jdb-pat-hash) - (make-realgud-loc-pat - :regexp "^Set breakpoint \\(.+\\):\\([0-9]+\\)" - :num 1 - :line-group 2)) - -;; Regular expression that describes a debugger "delete" (breakpoint) response. -;; For example: -;; Removed: breakpoint TestMe:7 -(setf (gethash "brkpt-del" realgud:jdb-pat-hash) - (make-realgud-loc-pat - :regexp "^Removed breakpoint \\(.+\\):\\([0-9]+\\)\n" - :line-group 1)) - -(defconst realgud:jdb-selected-frame-indicator "-->" -"String that describes which frame is selected in a debugger -backtrace listing.") - -(defconst realgud:jdb-frame-file-regexp - "[ \t\n]+in file \\([^ \n]+\\)") - -(defconst realgud:jdb-debugger-name "jdb" "Name of debugger") - -;; Top frame number -(setf (gethash "top-frame-num" realgud:jdb-pat-hash) 0) - -;; Regular expression that describes a debugger "selected" frame in in -;; a frame-motion command. -;; For example: -;; --> #1 TOP Object# in file /usr/local/bin/irb at line 9 -(setf (gethash "selected-frame" realgud:jdb-pat-hash) - (make-realgud-loc-pat - :regexp - (format "^%s #\\([0-9]+\\) .*%s" - realgud:jdb-selected-frame-indicator - realgud:jdb-frame-file-regexp) - :num 1)) - -;; Regular expression that describes a jdb backtrace line. -;; For example: -;; [1] TestMe.main (TestMe.java:7) -;; [2] java.lang.Class.privateGetDeclaredMethods (Class.java:2,570) -;; [3] java.lang.Class.getMethod0 (Class.java:2,813) -;; [4] java.lang.Class.getMethod (Class.java:1,663) -;; [5] sun.launcher.LauncherHelper.getMainMethod (LauncherHelper.java:494) -;; [6] sun.launcher.LauncherHelper.checkAndLoadMain (LauncherHelper.java:486) -(setf (gethash "debugger-backtrace" realgud:jdb-pat-hash) - (make-realgud-loc-pat - :regexp "^\\(?:[\t ]*[\\[[0-9]+\\] \\)\\([A-Za-z_.][A-Za-z0-9.]+\\):\\([0-9]+\\)" - :file-group 1 - :line-group 2)) - -(setf (gethash "font-lock-keywords" realgud:jdb-pat-hash) - '( - ;; The frame number and first type name, if present. - ;; FIXME: use realgud:jdb-identifier - ("^\\(-->\\| \\)? #\\([0-9]+\\) \\([A-Z]+\\) *\\([A-Z_][a-zA-Z0-9_]*\\)[#]\\([a-zA-Z_][a-zA-Z_[0-9]]*\\)?" - (2 realgud-backtrace-number-face) - (3 font-lock-keyword-face) ; e.g. METHOD, TOP - (4 font-lock-constant-face) ; e.g. Object - (5 font-lock-function-name-face nil t)) ; t means optional - ;; Instruction sequence - ("<\\(.+\\)>" - (1 font-lock-variable-name-face)) - ;; "::Type", which occurs in class name of function and in parameter list. - ;; Parameter sequence - ("(\\(.+\\))" - (1 font-lock-variable-name-face)) - ;; "::Type", which occurs in class name of function and in parameter list. - ("::\\([a-zA-Z_][a-zA-Z0-9_]*\\)" - (1 font-lock-type-face)) - ;; File name. - ("[ \t]+in file \\([^ ]+*\\)" - (1 realgud-file-name-face)) - ;; Line number. - ("[ \t]+at line \\([0-9]+\\)$" - (1 realgud-line-number-face)) - ;; Function name. - ("\\<\\([a-zA-Z_][a-zA-Z0-9_]*\\)\\.\\([a-zA-Z_][a-zA-Z0-9_]*\\)" - (1 font-lock-type-face) - (2 font-lock-function-name-face)) - ;; (jdb-frames-match-current-line - ;; (0 jdb-frames-current-frame-face append)) - )) - -;; (setf (gethash "font-lock-keywords" realgud:jdb-pat-hash) -;; '( -;; ;; The frame number and first type name, if present. -;; ((concat realgud:jdb-frame-start-regexp " " -;; realgud:jdb-frame-num-regexp " " -;; "\\([A-Z]+\\) *\\([A-Z_][a-zA-Z0-9_]*\\)[#]\\([a-zA-Z_][a-zA-Z_[0-9]]*\\)?") -;; (2 realgud-backtrace-number-face) -;; (3 font-lock-keyword-face) ; e.g. METHOD, TOP -;; (4 font-lock-constant-face) ; e.g. Object -;; (5 font-lock-function-name-face nil t)) ; t means optional -;; ;; Instruction sequence -;; ("<\\(.+\\)>" -;; (1 font-lock-variable-name-face)) -;; ;; "::Type", which occurs in class name of function and in -;; ;; parameter list. Parameter sequence -;; ("(\\(.+\\))" -;; (1 font-lock-variable-name-face)) -;; ;; "::Type", which occurs in class name of function and in -;; ;; parameter list. -;; ("::\\([a-zA-Z_][a-zA-Z0-9_]*\\)" -;; (1 font-lock-type-face)) -;; ;; File name. -;; (realgud:jdb-frame-file-regexp (1 realgud-file-name-face)) -;; ;; Line number. -;; (realgud:jdb-frame-line-regexp (1 realgud-line-number-face)) -;; ;; Function name. -;; ("\\<\\([a-zA-Z_][a-zA-Z0-9_]*\\)\\.\\([a-zA-Z_][a-zA-Z0-9_]*\\)" -;; (1 font-lock-type-face) -;; (2 font-lock-function-name-face)) -;; ;; (jdb-frames-match-current-line -;; ;; (0 jdb-frames-current-frame-face append)) -;; )) - -(setf (gethash realgud:jdb-debugger-name realgud-pat-hash) realgud:jdb-pat-hash) - -(defvar realgud:jdb-command-hash (make-hash-table :test 'equal) - "Hash key is command name like 'quit' and the value is - the jdb command to use, like 'quit!'") - -(setf (gethash realgud:jdb-debugger-name - realgud-command-hash) realgud:jdb-command-hash) - -(setf (gethash "backtrace" realgud:jdb-command-hash) "where") -(setf (gethash "break" realgud:jdb-command-hash) "stop at %c:%l") -(setf (gethash "clear" realgud:jdb-command-hash) "clear %c:%l") -(setf (gethash "continue" realgud:jdb-command-hash) "cont") -(setf (gethash "finish" realgud:jdb-command-hash) "step up") -(setf (gethash "up" realgud:jdb-command-hash) "up\C-Mwhere") -(setf (gethash "down" realgud:jdb-command-hash) "down\C-Mwhere") - - -(provide-me "realgud:jdb-") diff --git a/packages/realgud/realgud/debugger/jdb/jdb.el b/packages/realgud/realgud/debugger/jdb/jdb.el deleted file mode 100644 index c85621eb0..000000000 --- a/packages/realgud/realgud/debugger/jdb/jdb.el +++ /dev/null @@ -1,98 +0,0 @@ -;;; Copyright (C) 2014-2015 Rocky Bernstein -;; `jdb' Main interface to jdb via Emacs - -(require 'gud) ;; For class-path and source-path handling -(require 'cl) - -(require 'load-relative) -(require-relative-list '("../../common/run") "realgud:") -(require-relative-list '("../../common/helper" "../../common/utils") - "realgud-") -(require-relative-list '("core" "track-mode") "realgud:jdb-") - -(declare-function realgud:jdb-query-cmdline 'realgud:jdb-core) -(declare-function realgud:jdb-parse-cmd-args 'realgud:jdb-core) -(declare-function realgud:run-process 'realgud:core) -(declare-function realgud:flatten 'realgud-utils) - - -;; This is needed, or at least the docstring part of it is needed to -;; get the customization menu to work in Emacs 24. -(defgroup realgud:jdb nil - "The realgud interface to the Java's jdb debugger" - :group 'java - :group 'realgud - :version "24.1") - -;; ------------------------------------------------------------------- -;; User-definable variables -;; - -(defcustom realgud:jdb-command-name - ;;"jdb --emacs 3" - "jdb" - "File name for executing the Java debugger and command options. -This should be an executable on your path, or an absolute file name." - :type 'string - :group 'realgud:jdb) - -;;;###autoload -(defun realgud:jdb (&optional opt-cmd-line no-reset) - "Invoke the Java jdb debugger and start the Emacs user interface. - -String OPT-CMD-LINE is treated like a shell string; arguments are -tokenized by `split-string-and-unquote'. The tokenized string is -parsed by `jdb-parse-cmd-args' and path elements found by that -are expanded using `expand-file-name'. - -Normally, command buffers are reused when the same debugger is -reinvoked inside a command buffer with a similar command. If we -discover that the buffer has prior command-buffer information and -NO-RESET is nil, then that information which may point into other -buffers and source buffers which may contain marks and fringe or -marginal icons is reset. See `loc-changes-clear-buffer' to clear -fringe and marginal icons. -" - (interactive) - - (setq gud-jdb-classpath nil) - (setq gud-jdb-sourcepath nil) - ;; Set gud-jdb-classpath from the CLASSPATH environment variable, - ;; if CLASSPATH is set. - (setq gud-jdb-classpath-string (or (getenv "CLASSPATH") ".")) - (if gud-jdb-classpath-string - (setq gud-jdb-classpath - (gud-jdb-parse-classpath-string gud-jdb-classpath-string))) - - (setq gud-jdb-class-source-alist - (gud-jdb-build-class-source-alist - (setq gud-jdb-source-files - (gud-jdb-build-source-files-list gud-jdb-directories - "\\.java$")))) - (fset 'gud-jdb-find-source 'gud-jdb-find-source-file) - - - ;; reset for future invocations - (setq gud-jdb-classpath-string nil) - - (let* ( - (cmd-str (or opt-cmd-line (realgud:jdb-query-cmdline "jdb"))) - (cmd-args (split-string-and-unquote cmd-str)) - (parsed-args (realgud:jdb-parse-cmd-args cmd-args)) - (script-args (caddr parsed-args)) - (script-name (car script-args)) - (parsed-cmd-args - (cl-remove-if 'nil (realgud:flatten parsed-args))) - ) - (realgud:run-process "jdb" script-name parsed-cmd-args - 'jdb-track-mode-hook - 'realgud:jdb-minibuffer-history no-reset) - ) - ) - -(defalias 'jdb 'realgud:jdb) -(provide-me "realgud-") - -;; Local Variables: -;; byte-compile-warnings: (not cl-functions) -;; End: diff --git a/packages/realgud/realgud/debugger/jdb/track-mode.el b/packages/realgud/realgud/debugger/jdb/track-mode.el deleted file mode 100644 index d7922b772..000000000 --- a/packages/realgud/realgud/debugger/jdb/track-mode.el +++ /dev/null @@ -1,80 +0,0 @@ -;;; Copyright (C) 2015 Rocky Bernstein -;;; Java "jdb" Debugger tracking a comint or eshell buffer. - -(eval-when-compile (require 'cl)) -(require 'load-relative) -(require-relative-list '( - "../../common/cmds" - "../../common/menu" - "../../common/track" - "../../common/track-mode" - ) - "realgud-") -(require-relative-list '("core" "init") "realgud:jdb-") -(require-relative-list '("../../lang/ruby") "realgud-lang-") - -(declare-function realgud-track-mode 'realgud-track-mode) -(declare-function realgud-track-mode-hook 'realgud-track-mode) -(declare-function realgud-track-mode-setup 'realgud-track-mode) -(declare-function realgud:track-set-debugger 'realgud-track-mode) -(declare-function realgud-goto-line-for-pt 'realgud-track-mode) - -(realgud-track-mode-vars "realgud:jdb") -;;(defvaralias 'jdb-short-key-mode-map 'realgud:jdb-short-key-mode-map) -;;(defvaralias 'jdb-track-mode 'realgud:track-mode) - -(define-key realgud-track-mode-map - (kbd "C-c !!") 'realgud:goto-lang-backtrace-line) -(define-key realgud-track-mode-map - (kbd "C-c !b") 'realgud:goto-debugger-backtrace-line) - -(defun realgud:jdb-goto-control-frame-line (pt) - "Display the location mentioned by a control-frame line -described by PT." - (interactive "d") - (realgud-goto-line-for-pt pt "control-frame")) - -(defun realgud:jdb-goto-syntax-error-line (pt) - "Display the location mentioned in a Syntax error line -described by PT." - (interactive "d") - (realgud-goto-line-for-pt pt "syntax-error")) - -(define-key realgud:jdb-track-mode-map - (kbd "C-c !c") 'realgud:jdb-goto-control-frame-line) -(define-key realgud:jdb-track-mode-map - (kbd "C-c !s") 'realgud:jdb-goto-syntax-error-line) - -(defun realgud:jdb-track-mode-hook() - (if realgud:jdb-track-mode - (progn - (use-local-map realgud:jdb-track-mode-map) - (message "using realgud:jdb-track-mode-map")) - ;; else - (progn - (setq realgud-track-mode nil) - )) -) - -(define-minor-mode realgud:jdb-track-mode - "Minor mode for tracking jdb source locations inside a process shell via realgud. jdb is a Ruby debugger. - -If called interactively with no prefix argument, the mode is toggled. A prefix argument, captured as ARG, enables the mode if the argument is positive, and disables it otherwise. -" - :init-value nil - ;; :lighter " jdb" ;; mode-line indicator from realgud-track is sufficient. - ;; The minor mode bindings. - :global nil - :group 'realgud:jdb - :keymap realgud:jdb-track-mode-map - (realgud:track-set-debugger "jdb") - (if realgud:jdb-track-mode - (progn - (realgud-track-mode-setup 't) - (realgud:jdb-track-mode-hook)) - (progn - (setq realgud-track-mode nil) - )) -) - -(provide-me "realgud:jdb-") diff --git a/packages/realgud/realgud/debugger/kshdb/Makefile.am b/packages/realgud/realgud/debugger/kshdb/Makefile.am deleted file mode 100644 index 23f8a8fa2..000000000 --- a/packages/realgud/realgud/debugger/kshdb/Makefile.am +++ /dev/null @@ -1 +0,0 @@ -include ../common.mk diff --git a/packages/realgud/realgud/debugger/kshdb/core.el b/packages/realgud/realgud/debugger/kshdb/core.el deleted file mode 100644 index 445dd977f..000000000 --- a/packages/realgud/realgud/debugger/kshdb/core.el +++ /dev/null @@ -1,169 +0,0 @@ -;;; Copyright (C) 2010, 2014-2015 Rocky Bernstein -(eval-when-compile (require 'cl)) - -(require 'load-relative) -(require-relative-list '("../../common/track" "../../common/core") "realgud-") -(require-relative-list '("init") "realgud:kshdb-") - -(declare-function realgud:expand-file-name-if-exists 'realgud-core) -(declare-function realgud-parse-command-arg 'realgud-core) -(declare-function realgud-query-cmdline 'realgud-core) -(declare-function realgud-suggest-invocation 'realgud-core) - -;; FIXME: I think the following could be generalized and moved to -;; realgud-... probably via a macro. -(defvar realgud:kshdb-minibuffer-history nil - "minibuffer history list for the command `kshdb'.") - -(easy-mmode-defmap kshdb-minibuffer-local-map - '(("\C-i" . comint-dynamic-complete-filename)) - "Keymap for minibuffer prompting of gud startup command." - :inherit minibuffer-local-map) - -;; FIXME: I think this code and the keymaps and history -;; variable chould be generalized, perhaps via a macro. -(defun kshdb-query-cmdline (&optional opt-debugger) - (realgud-query-cmdline - 'kshdb-suggest-invocation - kshdb-minibuffer-local-map - 'realgud:kshdb-minibuffer-history - opt-debugger)) - -;;; FIXME: DRY this with other *-parse-cmd-args routines -(defun kshdb-parse-cmd-args (orig-args) - "Parse command line ARGS for the annotate level and name of script to debug. - -ARGS should contain a tokenized list of the command line to run. - -We return the a list containing -- the command processor (e.g. kshdb) and it's arguments if any - a list of strings -- the name of the debugger given (e.g. kshdb) and its arguments - a list of strings -- the script name and its arguments - list of strings -- whether the annotate or emacs option was given ('-A', '--annotate' or '--emacs) - a boolean - -For example for the following input - (map 'list 'symbol-name - '(ksh -W -C /tmp kshdb --emacs ./gcd.rb a b)) - -we might return: - ((ksh -W -C) (kshdb --emacs) (./gcd.rb a b) 't) - -NOTE: the above should have each item listed in quotes. -" - - ;; Parse the following kind of pattern: - ;; [ksh ksh-options] kshdb kshdb-options script-name script-options - (let ( - (args orig-args) - (pair) ;; temp return from - ;; ksh doesn't have any optional two-arg options - (ksh-opt-two-args '()) - (ksh-two-args '("o" "c")) - - ;; One dash is added automatically to the below, so - ;; h is really -h and -host is really --host. - (kshdb-two-args '("A" "-annotate" "l" "-library" - "-highlight" "-no-highlight" - "c" "-command" "-t" "-tty" - "x" "-eval-command")) - (kshdb-opt-two-args '()) - (interp-regexp - (if (member system-type (list 'windows-nt 'cygwin 'msdos)) - "^ksh*\\(.exe\\)?$" - "^ksh*$")) - - ;; Things returned - (script-name nil) - (debugger-name nil) - (interpreter-args '()) - (debugger-args '()) - (script-args '()) - (annotate-p nil)) - - (if (not (and args)) - ;; Got nothing: return '(nil, nil) - (list interpreter-args debugger-args script-args annotate-p) - ;; else - ;; Strip off optional "ruby" or "ruby182" etc. - (when (string-match interp-regexp - (file-name-sans-extension - (file-name-nondirectory (car args)))) - (setq interpreter-args (list (pop args))) - - ;; Strip off Ruby-specific options - (while (and args - (string-match "^-" (car args))) - (setq pair (realgud-parse-command-arg - args ksh-two-args ksh-opt-two-args)) - (nconc interpreter-args (car pair)) - (setq args (cadr pair)))) - - ;; Remove "kshdb" from "kshdb --kshdb-options script - ;; --script-options" - (setq debugger-name (file-name-sans-extension - (file-name-nondirectory (car args)))) - (unless (string-match "^kshdb$" debugger-name) - (message - "Expecting debugger name `%s' to be `kshdb'" - debugger-name)) - (setq debugger-args (list (pop args))) - - ;; Skip to the first non-option argument. - (while (and args (not script-name)) - (let ((arg (car args))) - (cond - ;; Annotation or emacs option with level number. - ((or (member arg '("--annotate" "-A")) - (equal arg "--emacs")) - (setq annotate-p t) - (nconc debugger-args (list (pop args)))) - ;; Combined annotation and level option. - ((string-match "^--annotate=[0-9]" arg) - (nconc debugger-args (list (pop args)) ) - (setq annotate-p t)) - ;; Options with arguments. - ((string-match "^-" arg) - (setq pair (realgud-parse-command-arg - args kshdb-two-args kshdb-opt-two-args)) - (nconc debugger-args (car pair)) - (setq args (cadr pair))) - ;; Anything else must be the script to debug. - (t (setq script-name (realgud:expand-file-name-if-exists arg)) - (setq script-args (cons script-name (cdr args)))) - ))) - (list interpreter-args debugger-args script-args annotate-p)))) - -;;To silence Warning: reference to free variable -(defvar realgud:kshdb-command-name) - -(defun kshdb-suggest-invocation (debugger-name) - "Suggest a kshdb command invocation via `realgud-suggest-invocaton'" - (realgud-suggest-invocation realgud:kshdb-command-name - realgud:kshdb-minibuffer-history - "sh" "\\.\\(?:k\\)?sh$")) - -(defun kshdb-reset () - "Kshdb cleanup - remove debugger's internal buffers (frame, -breakpoints, etc.)." - (interactive) - ;; (kshdb-breakpoint-remove-all-icons) - (dolist (buffer (buffer-list)) - (when (string-match "\\*kshdb-[a-z]+\\*" (buffer-name buffer)) - (let ((w (get-buffer-window buffer))) - (when w - (delete-window w))) - (kill-buffer buffer)))) - -;; (defun kshdb-reset-keymaps() -;; "This unbinds the special debugger keys of the source buffers." -;; (interactive) -;; (setcdr (assq 'kshdb-debugger-support-minor-mode minor-mode-map-alist) -;; kshdb-debugger-support-minor-mode-map-when-deactive)) - - -(defun realgud:kshdb-customize () - "Use `customize' to edit the settings of the `kshdb' debugger." - (interactive) - (customize-group 'realgud:kshdb)) - -(provide-me "realgud:kshdb-") diff --git a/packages/realgud/realgud/debugger/kshdb/init.el b/packages/realgud/realgud/debugger/kshdb/init.el deleted file mode 100644 index ff5c9d070..000000000 --- a/packages/realgud/realgud/debugger/kshdb/init.el +++ /dev/null @@ -1,115 +0,0 @@ -;;; Copyright (C) 2010, 2011 Rocky Bernstein Regular -;;; expressions for Korn shell debugger: kshdb - -(eval-when-compile (require 'cl)) - -(require 'load-relative) -(require-relative-list '("../../common/regexp" - "../../common/loc" - "../../common/init") - "realgud-") -(require-relative-list '("../../lang/posix-shell") "realgud-lang-") - -(defvar realgud-pat-hash) -(declare-function make-realgud-loc-pat (realgud-loc)) - -(defvar realgud:kshdb-pat-hash (make-hash-table :test 'equal) - "Hash key is the what kind of pattern we want to match: -backtrace, prompt, etc. The values of a hash entry is a -realgud-loc-pat struct") - -;; Regular expression that describes a kshdb location generally shown -;; before a command prompt. -;; For example: -;; (/etc/init.d/apparmor:35): -(setf (gethash "loc" realgud:kshdb-pat-hash) - (make-realgud-loc-pat - :regexp "\\(^\\|\n\\)(\\([^:]+\\):\\([0-9]*\\))" - :file-group 2 - :line-group 3)) - -;; For example: -;; kshdb<10> -;; kshdb<(5)> -;; kshdb<<1>> -(setf (gethash "prompt" realgud:kshdb-pat-hash) - (make-realgud-loc-pat - :regexp "^kshdb[<]+[(]*\\([0-9]+\\)[)]*[>]+ " - :num 1 - )) - -;; Regular expression that describes a "breakpoint set" line -(setf (gethash "brkpt-set" realgud:kshdb-pat-hash) - (make-realgud-loc-pat - :regexp "^Breakpoint \\([0-9]+\\) set in file \\(.+\\), line \\([0-9]+\\).\n" - :num 1 - :file-group 2 - :line-group 3)) - -;; Regular expression that describes a debugger "delete" (breakpoint) response. -;; For example: -;; Removed 1 breakpoint(s). -(setf (gethash "brkpt-del" realgud:kshdb-pat-hash) - (make-realgud-loc-pat - :regexp "^Removed \\([0-9]+\\) breakpoints(s).\n" - :num 1)) - -;; Regular expression that describes a debugger "backtrace" command line. -;; For example: -;; ->0 in file `/etc/apparmor/fns' at line 24 -;; ##1 /etc/apparmor/fns called from file `/etc/init.d/apparmor' at line 35 -;; ##2 /etc/init.d/apparmor called from file `/usr/bin/kshdb' at line 129 -(setf (gethash "debugger-backtrace" realgud:kshdb-pat-hash) - (make-realgud-loc-pat - :regexp (concat realgud-shell-frame-start-regexp - realgud-shell-frame-num-regexp "[ ]?" - "\\(.*\\)" - realgud-shell-frame-file-regexp - "\\(?:" realgud-shell-frame-line-regexp "\\)?" - ) - :num 2 - :file-group 4 - :line-group 5) - ) - -;; Regular expression that for a termination message. -(setf (gethash "termination" realgud:kshdb-pat-hash) - "^kshdb: That's all, folks...\n") - -(setf (gethash "font-lock-keywords" realgud:kshdb-pat-hash) - '( - ;; The frame number and first type name, if present. - ;; E.g. ->0 in file `/etc/init.d/apparmor' at line 35 - ;; --^- - ("^\\(->\\|##\\)\\([0-9]+\\) " - (2 realgud-backtrace-number-face)) - - ;; File name. - ;; E.g. ->0 in file `/etc/init.d/apparmor' at line 35 - ;; ---------^^^^^^^^^^^^^^^^^^^^- - ("[ \t]+\\(in\\|from\\) file `\\(.+\\)'" - (2 realgud-file-name-face)) - - ;; File name. - ;; E.g. ->0 in file `/etc/init.d/apparmor' at line 35 - ;; --------^^ - ;; Line number. - ("[ \t]+at line \\([0-9]+\\)$" - (1 realgud-line-number-face)) - ;; (trepan-frames-match-current-line - ;; (0 trepan-frames-current-frame-face append)) - )) - -(setf (gethash "kshdb" realgud-pat-hash) realgud:kshdb-pat-hash) - -(defvar realgud:kshdb-command-hash (make-hash-table :test 'equal) - "Hash key is command name like 'quit' and the value is - the trepan command to use, like 'quit!'") - -;; (setf (gethash "quit" realgud:kshdb-command-hash) "quit!") -(setf (gethash "kshdb" realgud-command-hash realgud:kshdb-command-hash)) - -(setf (gethash "kshdb" realgud-pat-hash) realgud:kshdb-pat-hash) -(setf (gethash "clear" realgud:kshdb-command-hash) "clear %l") - -(provide-me "realgud:kshdb-") diff --git a/packages/realgud/realgud/debugger/kshdb/kshdb.el b/packages/realgud/realgud/debugger/kshdb/kshdb.el deleted file mode 100644 index 9c5763780..000000000 --- a/packages/realgud/realgud/debugger/kshdb/kshdb.el +++ /dev/null @@ -1,62 +0,0 @@ -;;; Copyright (C) 2011, 2014-2015 Rocky Bernstein -;; `kshdb' Main interface to kshdb via Emacs -(require 'load-relative) -(require-relative-list '("../../common/helper") "realgud-") -(require-relative-list '("../../common/track") "realgud-") -(require-relative-list '("core" "track-mode") "realgud:kshdb-") -;; This is needed, or at least the docstring part of it is needed to -;; get the customization menu to work in Emacs 24. -(defgroup realgud:kshdb nil - "The realgud interface to the Korn shell debugger, kshdb" - :group 'realgud - :version "24.1") - -;; ------------------------------------------------------------------- -;; User definable variables -;; - -(defcustom realgud:kshdb-command-name - ;;"kshdb --emacs 3" - "kshdb" - "File name for executing the kshdb and its command options. -This should be an executable on your path, or an absolute file name." - :type 'string - :group 'realgud:kshdb) - -(declare-function kshdb-track-mode (bool)) -(declare-function kshdb-query-cmdline 'realgud:kshdb-core) -(declare-function kshdb-parse-cmd-args 'realgud:kshdb-core) -(declare-function realgud:run-process 'realgud-run) - -;; ------------------------------------------------------------------- -;; The end. -;; - -;;;###autoload -(defun realgud:kshdb (&optional opt-command-line no-reset) - "Invoke the Korn shell debugger, kshdb, and start the Emacs user interface. - -String COMMAND-LINE specifies how to run kshdb. - -Normally command buffers are reused when the same debugger is -reinvoked inside a command buffer with a similar command. If we -discover that the buffer has prior command-buffer information and -NO-RESET is nil, then that information which may point into other -buffers and source buffers which may contain marks and fringe or -marginal icons is reset." - (interactive) - (let* ((cmd-str (or opt-command-line (kshdb-query-cmdline "kshdb"))) - (cmd-args (split-string-and-unquote cmd-str)) - (parsed-args (kshdb-parse-cmd-args cmd-args)) - (script-args (cdr cmd-args)) - (script-name (car script-args)) - (cmd-buf)) - (realgud:run-process "kshdb" script-name cmd-args - 'realgud:kshdb-minibuffer-history - no-reset) - )) - -(defalias 'kshdb 'realgud:kshdb) -(provide-me "realgud-") - -;;; kshdb.el ends here diff --git a/packages/realgud/realgud/debugger/kshdb/track-mode.el b/packages/realgud/realgud/debugger/kshdb/track-mode.el deleted file mode 100644 index b4d4678eb..000000000 --- a/packages/realgud/realgud/debugger/kshdb/track-mode.el +++ /dev/null @@ -1,58 +0,0 @@ -;;; Copyright (C) 2012, 2014-2015 Rocky Bernstein -;;; "kshdb" Debugger tracking a comint or eshell buffer. - -(eval-when-compile (require 'cl)) -(require 'load-relative) -(require-relative-list '( - "../../common/cmds" - "../../common/menu" - "../../common/track" - "../../common/track-mode" - ) - "realgud-") -(require-relative-list '("core" "init") "realgud:kshdb-") - -(declare-function realgud:track-set-debugger 'realgud-track-mode) -(declare-function realgud-track-mode-setup 'realgud-track-mode) -(declare-function realgud-posix-shell-populate-command-keys - 'realgud-lang-posix-shell) - -(realgud-track-mode-vars "kshdb") -(realgud-posix-shell-populate-command-keys kshdb-track-mode-map) - -(declare-function realgud-track-mode(bool)) - -(defun kshdb-track-mode-hook() - (if kshdb-track-mode - (progn - (use-local-map kshdb-track-mode-map) - (message "using kshdb mode map") - ) - (message "kshdb track-mode-hook disable called")) -) - -(define-minor-mode kshdb-track-mode - "Minor mode for tracking kshdb source locations inside a process shell via realgud. kshdb is a Korn Shell debugger. - -If called interactively with no prefix argument, the mode is toggled. A prefix argument, captured as ARG, enables the mode if the argument is positive, and disables it otherwise. - -\\{kshdb-track-mode-map} -" - :init-value nil - ;; :lighter " kshdb" ;; mode-line indicator from realgud-track is sufficient. - ;; The minor mode bindings. - :global nil - :group 'kshdb - :keymap kshdb-track-mode-map - - (realgud:track-set-debugger "kshdb") - (if kshdb-track-mode - (progn - (realgud-track-mode 't) - (kshdb-track-mode-hook)) - (progn - (realgud-track-mode nil) - )) -) - -(provide-me "realgud:kshdb-") diff --git a/packages/realgud/realgud/debugger/nodejs/Makefile.am b/packages/realgud/realgud/debugger/nodejs/Makefile.am deleted file mode 100644 index 23f8a8fa2..000000000 --- a/packages/realgud/realgud/debugger/nodejs/Makefile.am +++ /dev/null @@ -1 +0,0 @@ -include ../common.mk diff --git a/packages/realgud/realgud/debugger/nodejs/core.el b/packages/realgud/realgud/debugger/nodejs/core.el deleted file mode 100644 index 9cc5aa287..000000000 --- a/packages/realgud/realgud/debugger/nodejs/core.el +++ /dev/null @@ -1,153 +0,0 @@ -;;; Copyright (C) 2014 Rocky Bernstein -(eval-when-compile (require 'cl)) - -(require 'load-relative) -(require-relative-list '("../../common/track" "../../common/core") - "realgud-") -(require-relative-list '("init") "realgud:nodejs-") - -(declare-function realgud:expand-file-name-if-exists 'realgud-core) -(declare-function realgud-parse-command-arg 'realgud-core) -(declare-function realgud-query-cmdline 'realgud-core) -(declare-function realgud-suggest-invocation 'realgud-core) - -;; FIXME: I think the following could be generalized and moved to -;; realgud-... probably via a macro. -(defvar realgud:nodejs-minibuffer-history nil - "minibuffer history list for the command `nodejs'.") - -(easy-mmode-defmap realgud:nodejs-minibuffer-local-map - '(("\C-i" . comint-dynamic-complete-filename)) - "Keymap for minibuffer prompting of nodejs startup command." - :inherit minibuffer-local-map) - -;; FIXME: I think this code and the keymaps and history -;; variable chould be generalized, perhaps via a macro. -(defun nodejs-query-cmdline (&optional opt-debugger) - (realgud-query-cmdline - 'realgud:nodejs-suggest-invocation - realgud:nodejs-minibuffer-local-map - 'realgud:nodejs-minibuffer-history - opt-debugger)) - -;;; FIXME: DRY this with other *-parse-cmd-args routines -(defun nodejs-parse-cmd-args (orig-args) - "Parse command line ORIG-ARGS for the annotate level and name of script to debug. - -ORIG-ARGS should contain a tokenized list of the command line to run. - -We return the a list containing -* the name of the debugger given (e.g. nodejs) and its arguments - a list of strings -* the script name and its arguments - list of strings -* whether the annotate or emacs option was given ('-A', '--annotate' or '--emacs) - a boolean - -For example for the following input: - (map 'list 'symbol-name - '(node --interactive --debugger-port 5858 /tmp nodejs ./gcd.js a b)) - -we might return: - ((\"node\" \"--interactive\" \"--debugger-port\" \"5858\") nil (\"/tmp/gcd.js\" \"a\" \"b\")) - -Note that path elements have been expanded via `expand-file-name'. -" - - ;; Parse the following kind of pattern: - ;; node nodejs-options script-name script-options - (let ( - (args orig-args) - (pair) ;; temp return from - (node-two-args '("-debugger_port" "C" "D" "i" "l" "m" "-module" "x")) - ;; node doesn't have any optional two-arg options - (node-opt-two-args '()) - - ;; One dash is added automatically to the below, so - ;; h is really -h and -debugger_port is really --debugger_port. - (nodejs-two-args '("-debugger_port")) - (nodejs-opt-two-args '()) - - ;; Things returned - (script-name nil) - (debugger-name nil) - (interpreter-args '()) - (script-args '()) - ) - (if (not (and args)) - ;; Got nothing: return '(nil, nil, nil) - (list interpreter-args nil script-args) - ;; else - (progn - ;; Remove "nodejs" (or "nodemon" or "node") from invocation like: - ;; nodejs --nodejs-options script --script-options - (setq debugger-name (file-name-sans-extension - (file-name-nondirectory (car args)))) - (unless (string-match "^node\\(?:js\\|mon\\)$" debugger-name) - (message - "Expecting debugger name `%s' to be `node', `nodemon', or `nodejs'" - debugger-name)) - (setq interpreter-args (list (pop args))) - - ;; Skip to the first non-option argument. - (while (and args (not script-name)) - (let ((arg (car args))) - (cond - ((equal "debug" arg) - (nconc interpreter-args (list arg)) - (setq args (cdr args)) - ) - - ;; Options with arguments. - ((string-match "^-" arg) - (setq pair (realgud-parse-command-arg - args nodejs-two-args nodejs-opt-two-args)) - (nconc interpreter-args (car pair)) - (setq args (cadr pair))) - ;; Anything else must be the script to debug. - (t (setq script-name (realgud:expand-file-name-if-exists arg)) - (setq script-args (cons script-name (cdr args)))) - ))) - (list interpreter-args nil script-args))) - )) - -;; To silence Warning: reference to free variable -(defvar realgud:nodejs-command-name) - -(defun realgud:nodejs-suggest-invocation (debugger-name) - "Suggest a nodejs command invocation via `realgud-suggest-invocaton'" - (realgud-suggest-invocation realgud:nodejs-command-name - realgud:nodejs-minibuffer-history - "js" "\\.js$")) - -(defun realgud:nodejs-remove-ansi-shmutz() - "Remove ASCII escape sequences that node.js 'decorates' in -prompts and interactive output with" - (add-to-list - 'comint-preoutput-filter-functions - (lambda (output) - (replace-regexp-in-string "\033\\[[0-9]+[GKJ]" "" output))) - ) - -(defun realgud:nodejs-reset () - "Nodejs cleanup - remove debugger's internal buffers (frame, -breakpoints, etc.)." - (interactive) - ;; (nodejs-breakpoint-remove-all-icons) - (dolist (buffer (buffer-list)) - (when (string-match "\\*nodejs-[a-z]+\\*" (buffer-name buffer)) - (let ((w (get-buffer-window buffer))) - (when w - (delete-window w))) - (kill-buffer buffer)))) - -;; (defun nodejs-reset-keymaps() -;; "This unbinds the special debugger keys of the source buffers." -;; (interactive) -;; (setcdr (assq 'nodejs-debugger-support-minor-mode minor-mode-map-alist) -;; nodejs-debugger-support-minor-mode-map-when-deactive)) - - -(defun realgud:nodejs-customize () - "Use `customize' to edit the settings of the `nodejs' debugger." - (interactive) - (customize-group 'realgud:nodejs)) - -(provide-me "realgud:nodejs-") diff --git a/packages/realgud/realgud/debugger/nodejs/init.el b/packages/realgud/realgud/debugger/nodejs/init.el deleted file mode 100644 index 66ad72575..000000000 --- a/packages/realgud/realgud/debugger/nodejs/init.el +++ /dev/null @@ -1,125 +0,0 @@ -;;; Copyright (C) 2014 Rocky Bernstein -;;; Regular expressions for nodejs Javascript debugger. - -(eval-when-compile (require 'cl)) - -(require 'load-relative) -(require-relative-list '("../../common/regexp" - "../../common/loc" - "../../common/init") - "realgud-") -(require-relative-list '("../../lang/posix-shell") "realgud-lang-") - -(defvar realgud:nodejs-pat-hash) -(declare-function make-realgud-loc-pat (realgud-loc)) - -(defvar realgud:nodejs-pat-hash (make-hash-table :test 'equal) - "Hash key is the what kind of pattern we want to match: -backtrace, prompt, etc. The values of a hash entry is a -realgud-loc-pat struct") - -(defvar realgud:nodejs-term-escape "[[0-9]+[GKJ]" - "Escape sequence regular expression pattern nodejs often puts in around prompts") - -;; Regular expression that describes a nodejs location generally shown -;; before a command prompt. -;; For example: -;; break in /home/indutny/Code/git/indutny/myscript.js:1 -(setf (gethash "loc" realgud:nodejs-pat-hash) - (make-realgud-loc-pat - :regexp (format - "\\(?:%s\\)*break in \\([^:]+\\):\\([0-9]*\\)" - realgud:nodejs-term-escape) - :file-group 1 - :line-group 2)) - -;; Regular expression that describes a nodejs command prompt -;; For example: -;; debug> -(setf (gethash "prompt" realgud:nodejs-pat-hash) - (make-realgud-loc-pat - :regexp (format "^\\(?:%s\\)*debug> " realgud:nodejs-term-escape) - )) - -;; Regular expression that describes a "breakpoint set" line -;; * 4 var count = 0; -(setf (gethash "brkpt-set" realgud:nodejs-pat-hash) - (make-realgud-loc-pat - :regexp "^[*] \\([0-9]+\\) " - :line-group 1)) - -;; Regular expression that describes a debugger "delete" (breakpoint) response. -;; For example: -;; Removed 1 breakpoint(s). -(setf (gethash "brkpt-del" realgud:nodejs-pat-hash) - (make-realgud-loc-pat - :regexp "^Removed \\([0-9]+\\) breakpoint(s).\n" - :num 1)) - -;; Regular expression that describes a debugger "backtrace" command line. -;; For example: -;; #0 module.js:380:17 -;; #1 dbgtest.js:3:9 -;; #2 Module._compile module.js:456:26 -;; #3 Module._extensions..js module.js:474:10 -;; #4 Module.load module.js:356:32 -;; #5 Module._load module.js:312:12 -;; #6 Module.runMain module.js:497:10 -; ;#7 timers.js:110:15 - -;; (setf (gethash "debugger-backtrace" realgud:nodejs-pat-hash) -;; (make-realgud-loc-pat -;; :regexp (concat realgud-shell-frame-start-regexp -;; realgud-shell-frame-num-regexp "[ ]?" -;; "\\(.*\\)" -;; realgud-shell-frame-file-regexp -;; "\\(?:" realgud-shell-frame-line-regexp "\\)?" -;; ) -;; :num 2 -;; :file-group 4 -;; :line-group 5) -;; ) - -;; ;; Regular expression that for a termination message. -;; (setf (gethash "termination" realgud:nodejs-pat-hash) -;; "^nodejs: That's all, folks...\n") - -(setf (gethash "font-lock-keywords" realgud:nodejs-pat-hash) - '( - ;; The frame number and first type name, if present. - ;; E.g. ->0 in file `/etc/init.d/apparmor' at line 35 - ;; --^- - ("^\\(->\\|##\\)\\([0-9]+\\) " - (2 realgud-backtrace-number-face)) - - ;; File name. - ;; E.g. ->0 in file `/etc/init.d/apparmor' at line 35 - ;; ---------^^^^^^^^^^^^^^^^^^^^- - ("[ \t]+\\(in\\|from\\) file `\\(.+\\)'" - (2 realgud-file-name-face)) - - ;; File name. - ;; E.g. ->0 in file `/etc/init.d/apparmor' at line 35 - ;; --------^^ - ;; Line number. - ("[ \t]+at line \\([0-9]+\\)$" - (1 realgud-line-number-face)) - )) - -(setf (gethash "nodejs" realgud-pat-hash) realgud:nodejs-pat-hash) - -(defvar realgud:nodejs-command-hash (make-hash-table :test 'equal) - "Hash key is command name like 'finish' and the value is - the nodejs command to use, like 'out'") - -(setf (gethash "nodejs" realgud-command-hash realgud:nodejs-command-hash)) - -(setf (gethash "backtrace" realgud:nodejs-command-hash) "T") -(setf (gethash "continue" realgud:nodejs-command-hash) "cont") -(setf (gethash "quit" realgud:nodejs-command-hash) "quit") -(setf (gethash "finish" realgud:nodejs-command-hash) "out") -(setf (gethash "shell" realgud:nodejs-command-hash) "repl") -(setf (gethash "step" realgud:nodejs-command-hash) "step") -(setf (gethash "next" realgud:nodejs-command-hash) "next") - -(provide-me "realgud:nodejs-") diff --git a/packages/realgud/realgud/debugger/nodejs/nodejs.el b/packages/realgud/realgud/debugger/nodejs/nodejs.el deleted file mode 100644 index 23b7a381a..000000000 --- a/packages/realgud/realgud/debugger/nodejs/nodejs.el +++ /dev/null @@ -1,75 +0,0 @@ -;;; Copyright (C) 2014-2015 Rocky Bernstein -;; `nodejs' Main interface to nodejs debugger via Emacs -(require 'list-utils) -(require 'load-relative) -(require-relative-list '("../../common/helper") "realgud-") -(require-relative-list '("../../common/run") "realgud:") -(require-relative-list '("core" "track-mode") "realgud:nodejs-") - -(declare-function realgud:nodejs-remove-ansi-shmutz 'realgud-core) -(declare-function realgud:run-debugger 'realgud:run) - -;; This is needed, or at least the docstring part of it is needed to -;; get the customization menu to work in Emacs 24. -(defgroup realgud:nodejs nil - "The realgud interface to the nodejs debugger" - :group 'realgud - :version "24.1") - -;; ------------------------------------------------------------------- -;; User-definable variables -;; - -(defcustom realgud:nodejs-command-name - "node debug" - "File name for executing the Javascript debugger and command options. -This should be an executable on your path, or an absolute file name." - :type 'string - :group 'realgud:nodejs) - -;; ------------------------------------------------------------------- -;; The end. -;; - -(declare-function nodejs-track-mode 'realgud-nodejs-track-mode) -(declare-function nodejs-query-cmdline 'realgud:nodejs-core) -(declare-function nodejs-parse-cmd-args 'realgud:nodejs-core) -(declare-function realgud:run-process 'realgud:run) - -;;;###autoload -(defun realgud:nodejs (&optional opt-cmd-line no-reset) - "Invoke the nodejs shell debugger and start the Emacs user interface. - -String OPT-CMD-LINE specifies how to run nodejs. - -OPT-CMD-LINE is treated like a shell string; arguments are -tokenized by `split-string-and-unquote'. The tokenized string is -parsed by `nodejs-parse-cmd-args' and path elements found by that -are expanded using `realgud:expand-file-name-if-exists'. - -Normally, command buffers are reused when the same debugger is -reinvoked inside a command buffer with a similar command. If we -discover that the buffer has prior command-buffer information and -NO-RESET is nil, then that information which may point into other -buffers and source buffers which may contain marks and fringe or -marginal icons is reset. See `loc-changes-clear-buffer' to clear -fringe and marginal icons. -" - (interactive) - (let ((cmd-buf - (realgud:run-debugger "nodejs" - 'nodejs-query-cmdline 'nodejs-parse-cmd-args - 'realgud:nodejs-minibuffer-history - opt-cmd-line no-reset))) - (if cmd-buf - (with-current-buffer cmd-buf - ;; FIXME should allow customization whether to do or not - ;; and also only do if hook is not already there. - (realgud:nodejs-remove-ansi-shmutz) - ) - ))) - -;; There is already a nodejs command in `nodejs-repl'. -;; (defalias 'nodejs 'realgud:nodejs) - -(provide-me "realgud-") diff --git a/packages/realgud/realgud/debugger/nodejs/track-mode.el b/packages/realgud/realgud/debugger/nodejs/track-mode.el deleted file mode 100644 index bc8c30433..000000000 --- a/packages/realgud/realgud/debugger/nodejs/track-mode.el +++ /dev/null @@ -1,82 +0,0 @@ -;;; Copyright (C) 2014-2015 Rocky Bernstein -;;; nodejs tracking a comint buffer. - -(eval-when-compile (require 'cl)) -(require 'load-relative) -(require-relative-list '( - "../../common/cmds" - "../../common/menu" - "../../common/track" - "../../common/track-mode" - ) - "realgud-") -(require-relative-list '("core" "init") "realgud:nodejs-") - -(declare-function realgud:cmd-remap 'realgud-cmds) -(declare-function realgud:track-set-debugger 'realgud-track-mode) -(declare-function realgud-track-mode-setup 'realgud-track-mode) - -(realgud-track-mode-vars "nodejs") - -(declare-function realgud-track-mode(bool)) - -(defun nodejs-track-mode-hook() - (if nodejs-track-mode - (progn - (use-local-map nodejs-track-mode-map) - (message "using nodejs mode map") - ) - (message "nodejs track-mode-hook disable called")) -) - -(define-minor-mode nodejs-track-mode - "Minor mode for tracking nodejs source locations inside a nodejs shell via realgud. - -If called interactively with no prefix argument, the mode is toggled. A prefix argument, captured as ARG, enables the mode if the argument is positive, and disables it otherwise. - -\\{nodejs-track-mode-map}" - :init-value nil - ;; :lighter " nodejs" ;; mode-line indicator from realgud-track is sufficient. - ;; The minor mode bindings. - :global nil - :group 'realgud:nodejs - - :keymap nodejs-track-mode-map - - (realgud:track-set-debugger "nodejs") - (realgud:nodejs-track-mode-internal) -) - -(defun realgud:nodejs-track-mode-internal (&optional arg) - (realgud:track-set-debugger "nodejs") - (if nodejs-track-mode - (progn - (realgud-track-mode-setup 't) - (nodejs-track-mode-hook)) - (progn - (setq realgud-track-mode nil) - )) - ) - -(defun realgud:nodejs-set-break(arg) - "Set a breakpoint at the current line" - (interactive "p") - (realgud:cmd-remap arg "break" "setBreakpoint('%X',%l)" "b") - ) - -;; ;; Debugger commands that nodejs doesn't have -;; (define-key nodejs-track-mode-map -;; [remap realgud:cmd-newer-frame] 'undefined) -;; (define-key nodejs-track-mode-map -;; [remap realgud:cmd-older-frame] 'undefined) -(define-key nodejs-short-key-mode-map - [remap realgud:cmd-step] 'realgud:cmd-step-no-arg) -(define-key nodejs-short-key-mode-map - [remap realgud:cmd-step] 'realgud:cmd-step-no-arg) -(define-key nodejs-short-key-mode-map - [remap realgud:cmd-next] 'realgud:cmd-next-no-arg) -(define-key nodejs-short-key-mode-map - [remap realgud:cmd-break] 'realgud:nodejs-set-break) -(define-key nodejs-short-key-mode-map "T" 'realgud:cmd-backtrace) - -(provide-me "realgud:nodejs-") diff --git a/packages/realgud/realgud/debugger/pdb/Makefile.am b/packages/realgud/realgud/debugger/pdb/Makefile.am deleted file mode 100644 index 23f8a8fa2..000000000 --- a/packages/realgud/realgud/debugger/pdb/Makefile.am +++ /dev/null @@ -1 +0,0 @@ -include ../common.mk diff --git a/packages/realgud/realgud/debugger/pdb/core.el b/packages/realgud/realgud/debugger/pdb/core.el deleted file mode 100644 index ac22040bf..000000000 --- a/packages/realgud/realgud/debugger/pdb/core.el +++ /dev/null @@ -1,161 +0,0 @@ -;;; Copyright (C) 2012-2014 Rocky Bernstein -(eval-when-compile (require 'cl)) - -(require 'load-relative) -(require-relative-list '("../../common/track" - "../../common/core" - "../../common/lang") - "realgud-") -(require-relative-list '("init") "realgud:pdb-") - - -(declare-function realgud-lang-mode? 'realgud-lang) -(declare-function realgud-parse-command-arg 'realgud-core) -(declare-function realgud-query-cmdline 'realgud-core) -(declare-function realgud-suggest-invocation 'realgud-core) - -;; FIXME: I think the following could be generalized and moved to -;; realgud-... probably via a macro. -(defvar realgud:pdb-minibuffer-history nil - "minibuffer history list for the command `pdb'.") - -(easy-mmode-defmap pdb-minibuffer-local-map - '(("\C-i" . comint-dynamic-complete-filename)) - "Keymap for minibuffer prompting of gud startup command." - :inherit minibuffer-local-map) - -;; FIXME: I think this code and the keymaps and history -;; variable chould be generalized, perhaps via a macro. -(defun pdb-query-cmdline (&optional opt-debugger) - (realgud-query-cmdline - 'pdb-suggest-invocation - pdb-minibuffer-local-map - 'realgud:pdb-minibuffer-history - opt-debugger)) - -(defun pdb-parse-cmd-args (orig-args) - "Parse command line ORIG-ARGS for the annotate level and name of script to debug. - -ORIG-ARGS should contain a tokenized list of the command line to run. - -We return the a list containing: -* the command processor (e.g. python) and it's arguments if any - a list of strings -* the name of the debugger given (e.g. pdb) and its arguments - a list of strings -* the script name and its arguments - list of strings -* whether the annotate or emacs option was given ('-A', '--annotate' or '--emacs) - a boolean - -For example for the following input: - (map 'list 'symbol-name - '(python2.6 -O -Qold ./gcd.py a b)) - -we might return: - ((\"python2.6\" \"-O\" \"-Qold\") (\"pdb\") (\"/tmp/gcd.py\" \"a\" \"b\") nil) - -Note that the script name path has been expanded via `expand-file-name'. -" - - ;; Parse the following kind of pattern: - ;; [python python-options] pdb pdb-options script-name script-options - (let ( - (args orig-args) - (pair) ;; temp return from - (python-opt-two-args '()) - ;; Python doesn't have mandatory 2-arg options in our sense, - ;; since the two args can be run together, e.g. "-C/tmp" or "-C /tmp" - ;; - (python-two-args '()) - ;; pdb doesn't have any arguments - (pdb-two-args '()) - (pdb-opt-two-args '()) - (interp-regexp - (if (member system-type (list 'windows-nt 'cygwin 'msdos)) - "^python[-0-9.]*\\(.exe\\)?$" - "^python[-0-9.]*$")) - - ;; Things returned - (annotate-p nil) - (debugger-args '()) - (debugger-name nil) - (interpreter-args '()) - (script-args '()) - (script-name nil) - ) - - (if (not (and args)) - ;; Got nothing: return '(nil, nil) - (list interpreter-args debugger-args script-args annotate-p) - ;; else - ;; Strip off optional "python" or "python182" etc. - (when (string-match interp-regexp - (file-name-sans-extension - (file-name-nondirectory (car args)))) - (setq interpreter-args (list (pop args))) - - ;; Strip off Python-specific options - (while (and args - (string-match "^-" (car args))) - (setq pair (realgud-parse-command-arg - args python-two-args python-opt-two-args)) - (nconc interpreter-args (car pair)) - (setq args (cadr pair)))) - - ;; Remove "pdb" from "pdb --pdb-options script - ;; --script-options" - (setq debugger-name (file-name-sans-extension - (file-name-nondirectory (car args)))) - (unless (string-match "^\\(pdb\\|cli.py\\)$" debugger-name) - (message - "Expecting debugger name `%s' to be `pdb' or `cli.py'" - debugger-name)) - (setq debugger-args (list (pop args))) - - ;; Skip to the first non-option argument. - (while (and args (not script-name)) - (let ((arg (car args))) - (cond - ;; Options with arguments. - ((string-match "^-" arg) - (setq pair (realgud-parse-command-arg - args pdb-two-args pdb-opt-two-args)) - (nconc debugger-args (car pair)) - (setq args (cadr pair))) - ;; Anything else must be the script to debug. - (t (setq script-name (expand-file-name arg)) - (setq script-args (cons script-name (cdr args)))) - ))) - (list interpreter-args debugger-args script-args annotate-p)))) - -;; To silence Warning: reference to free variable -(defvar realgud:pdb-command-name) - -(defun pdb-suggest-invocation (debugger-name) - "Suggest a pdb command invocation via `realgud-suggest-invocaton'" - (realgud-suggest-invocation realgud:pdb-command-name - realgud:pdb-minibuffer-history - "python" "\\.py")) - -(defun pdb-reset () - "Pdb cleanup - remove debugger's internal buffers (frame, -breakpoints, etc.)." - (interactive) - ;; (pdb-breakpoint-remove-all-icons) - (dolist (buffer (buffer-list)) - (when (string-match "\\*pdb-[a-z]+\\*" (buffer-name buffer)) - (let ((w (get-buffer-window buffer))) - (when w - (delete-window w))) - (kill-buffer buffer)))) - -;; (defun pdb-reset-keymaps() -;; "This unbinds the special debugger keys of the source buffers." -;; (interactive) -;; (setcdr (assq 'pdb-debugger-support-minor-mode minor-mode-map-alist) -;; pdb-debugger-support-minor-mode-map-when-deactive)) - - -(defun realgud:pdb-customize () - "Use `customize' to edit the settings of the `pdb' debugger." - (interactive) - (customize-group 'realgud:pdb)) - -(provide-me "realgud:pdb-") diff --git a/packages/realgud/realgud/debugger/pdb/init.el b/packages/realgud/realgud/debugger/pdb/init.el deleted file mode 100644 index c45c55a10..000000000 --- a/packages/realgud/realgud/debugger/pdb/init.el +++ /dev/null @@ -1,99 +0,0 @@ -;;; Copyright (C) 2012 Rocky Bernstein -;;; Stock Python debugger pdb - -(eval-when-compile (require 'cl)) - -(require 'load-relative) -(require-relative-list '("../../common/regexp" - "../../common/loc" - "../../common/init") - "realgud-") -(require-relative-list '("../../lang/python") "realgud-lang-") - -(defvar realgud-pat-hash) -(declare-function make-realgud-loc-pat (realgud-loc)) - -(defvar realgud:pdb-pat-hash (make-hash-table :test 'equal) - "Hash key is the what kind of pattern we want to match: -backtrace, prompt, etc. The values of a hash entry is a -realgud-loc-pat struct") - -(declare-function make-realgud-loc "realgud-loc" (a b c d e f)) - -;; Regular expression that describes a pdb location generally shown -;; before a command prompt. -;; -;; Program-location lines look like this: -;; > /usr/bin/zonetab2pot.py(15)() -;; or MS Windows: -;; > c:\\mydirectory\\gcd.py(10) -(setf (gethash "loc" realgud:pdb-pat-hash) - (make-realgud-loc-pat - :regexp "^> \\(\\(?:[a-zA-Z]:\\)?[-a-zA-Z0-9_/.\\\\ ]+\\)(\\([0-9]+\\))" - :file-group 1 - :line-group 2)) - -(setf (gethash "prompt" realgud:pdb-pat-hash) - (make-realgud-loc-pat - :regexp "^[(]+Pdb[)]+ " - )) - -;; Regular expression that describes a Python backtrace line. -(setf (gethash "lang-backtrace" realgud:pdb-pat-hash) - realgud-python-backtrace-loc-pat) - -;; Regular expression that describes a "breakpoint set" line. For example: -;; Breakpoint 1 at /usr/bin/pdb:7 -(setf (gethash "brkpt-set" realgud:pdb-pat-hash) - (make-realgud-loc-pat - :regexp "^Breakpoint \\([0-9]+\\) at[ \t\n]+\\(.+\\):\\([0-9]+\\)\\(\n\\|$\\)" - :num 1 - :file-group 2 - :line-group 3)) - -;; Regular expression that describes a "delete breakpoint" line -(setf (gethash "brkpt-del" realgud:pdb-pat-hash) - (make-realgud-loc-pat - :regexp "^Deleted breakpoint \\([0-9]+\\)\n" - :num 1)) - -(setf (gethash "font-lock-keywords" realgud:pdb-pat-hash) - '( - ;; The frame number and first type name, if present. - ("^\\(->\\|##\\)\\([0-9]+\\) \\(\\)? *\\([a-zA-Z_][a-zA-Z0-9_]*\\)(\\(.+\\))?" - (2 realgud-backtrace-number-face) - (4 font-lock-function-name-face nil t)) ; t means optional. - - ;; Parameter sequence, E.g. gcd(a=3, b=5) - ;; ^^^^^^^^^ - ("(\\(.+\\))" - (1 font-lock-variable-name-face)) - - ;; File name. E.g file '/test/gcd.py' - ;; ------^^^^^^^^^^^^- - ("[ \t]+file '\\([^ ]+*\\)'" - (1 realgud-file-name-face)) - - ;; Line number. E.g. at line 28 - ;; ---------^^ - ("[ \t]+at line \\([0-9]+\\)$" - (1 realgud-line-number-face)) - - ;; Function name. - ("\\<\\([a-zA-Z_][a-zA-Z0-9_]*\\)\\.\\([a-zA-Z_][a-zA-Z0-9_]*\\)" - (1 font-lock-type-face) - (2 font-lock-function-name-face)) - ;; (pdb-frames-match-current-line - ;; (0 pdb-frames-current-frame-face append)) - )) - -(setf (gethash "pdb" realgud-pat-hash) realgud:pdb-pat-hash) - -(defvar realgud:pdb-command-hash (make-hash-table :test 'equal) - "Hash key is command name like 'shell' and the value is - the pdb command to use, like 'python'") - -(setf (gethash "shell" realgud:pdb-command-hash) "python") -(setf (gethash "pdb" realgud-command-hash) realgud:pdb-command-hash) - -(provide-me "realgud:pdb-") diff --git a/packages/realgud/realgud/debugger/pdb/pdb.el b/packages/realgud/realgud/debugger/pdb/pdb.el deleted file mode 100644 index 8f87e6389..000000000 --- a/packages/realgud/realgud/debugger/pdb/pdb.el +++ /dev/null @@ -1,64 +0,0 @@ -;;; Copyright (C) 2012, 2014 Rocky Bernstein -;; `pdb' Main interface to pdb via Emacs -(require 'load-relative) -(require-relative-list '("core" "track-mode") "realgud:pdb-") -(require-relative-list '("../../common/run") "realgud:") -(require-relative-list '("core" "track-mode") "realgud:pdb-") - -;; This is needed, or at least the docstring part of it is needed to -;; get the customization menu to work in Emacs 24. -(defgroup realgud:pdb nil - "The realgud interface to the Python pdb debugger" - :group 'realgud - :version "24.1") - -;; ------------------------------------------------------------------- -;; User-definable variables -;; - -(defcustom realgud:pdb-command-name - "pdb" - "File name for executing the stock Python debugger and command options. -This should be an executable on your path, or an absolute file name." - :type 'string - :group 'realgud:pdb) -;; ------------------------------------------------------------------- -;; The end. -;; - -(declare-function pdb-track-mode 'realgud:pdb-track) -(declare-function pdb-query-cmdline 'realgud:pdb-core) -(declare-function pdb-parse-cmd-args 'realgud:pdb-core) -(declare-function realgud:run-debugger 'realgud:run) - -;;;###autoload -(defun realgud:pdb (&optional opt-cmd-line no-reset) - "Invoke the pdb Python debugger and start the Emacs user interface. - -String OPT-CMD-LINE specifies how to run pdb. You will be prompted -for a command line is one isn't supplied. - -OPT-COMMAND-LINE is treated like a shell string; arguments are -tokenized by `split-string-and-unquote'. The tokenized string is -parsed by `pdb-parse-cmd-args' and path elements found by that -are expanded using `realgud:expand-file-name-if-exists'. - -Normally, command buffers are reused when the same debugger is -reinvoked inside a command buffer with a similar command. If we -discover that the buffer has prior command-buffer information and -NO-RESET is nil, then that information which may point into other -buffers and source buffers which may contain marks and fringe or -marginal icons is reset. See `loc-changes-clear-buffer' to clear -fringe and marginal icons. -" - (interactive) - (realgud:run-debugger "pdb" 'pdb-query-cmdline - 'pdb-parse-cmd-args - 'realgud:pdb-minibuffer-history - opt-cmd-line no-reset) - ) - - -(defalias 'pdb 'realgud:pdb) - -(provide-me "realgud-") diff --git a/packages/realgud/realgud/debugger/pdb/track-mode.el b/packages/realgud/realgud/debugger/pdb/track-mode.el deleted file mode 100644 index b1d602953..000000000 --- a/packages/realgud/realgud/debugger/pdb/track-mode.el +++ /dev/null @@ -1,59 +0,0 @@ -;;; Copyright (C) 2010, 2012-2015 Rocky Bernstein -;;; Python "pdb" Debugger tracking a comint buffer. - -(eval-when-compile (require 'cl)) -(require 'load-relative) -(require-relative-list '( - "../../common/cmds" - "../../common/menu" - "../../common/track" - "../../common/track-mode" - ) - "realgud-") -(require-relative-list '("core" "init") "realgud:pdb-") - -(realgud-track-mode-vars "pdb") - -(declare-function realgud-track-mode 'realgud-track-mode) -(declare-function realgud-track-mode-setup 'realgud-track-mode) -(declare-function realgud:track-set-debugger 'realgud-track-mode) -(declare-function realgud-python-populate-command-keys 'realgud-lang-python) - -(realgud-python-populate-command-keys pdb-track-mode-map) - -(defun pdb-track-mode-hook() - (if pdb-track-mode - (progn - (use-local-map pdb-track-mode-map) - (message "using pdb mode map") - ) - (message "pdb track-mode-hook disable called") - ) -) - -(define-minor-mode pdb-track-mode - "Minor mode for tracking pdb source locations inside a process shell via realgud. pdb is the stock Python debugger. - -If called interactively with no prefix argument, the mode is toggled. A prefix argument, captured as ARG, enables the mode if the argument is positive, and disables it otherwise. - -a process shell. - -\\{pdb-track-mode-map} -" - :init-value nil - ;; :lighter " pdb" ;; mode-line indicator from realgud-track is sufficient. - ;; The minor mode bindings. - :global nil - :group 'realgud:pdb - :keymap pdb-track-mode-map - (realgud:track-set-debugger "pdb") - (if pdb-track-mode - (progn - (realgud-track-mode-setup 't) - (pdb-track-mode-hook)) - (progn - (setq realgud-track-mode nil) - )) -) - -(provide-me "realgud:pdb-") diff --git a/packages/realgud/realgud/debugger/perldb/Makefile.am b/packages/realgud/realgud/debugger/perldb/Makefile.am deleted file mode 100644 index 23f8a8fa2..000000000 --- a/packages/realgud/realgud/debugger/perldb/Makefile.am +++ /dev/null @@ -1 +0,0 @@ -include ../common.mk diff --git a/packages/realgud/realgud/debugger/perldb/core.el b/packages/realgud/realgud/debugger/perldb/core.el deleted file mode 100644 index c18b27631..000000000 --- a/packages/realgud/realgud/debugger/perldb/core.el +++ /dev/null @@ -1,145 +0,0 @@ -;;; Copyright (C) 2011, 2013-2014 Rocky Bernstein -(eval-when-compile (require 'cl)) - -(require 'load-relative) -(require-relative-list '("../../common/track" - "../../common/core" - "../../common/lang") - "realgud-") -(require-relative-list '("init") "realgud:perldb-") - -(declare-function realgud-lang-mode? 'realgud-lang) -(declare-function realgud:expand-file-name-if-exists 'realgud-core) -(declare-function realgud-parse-command-arg 'realgud-core) -(declare-function realgud-query-cmdline 'realgud-core) -(declare-function realgud-suggest-invocation 'realgud-core) - -;; FIXME: I think the following could be generalized and moved to -;; realgud-... probably via a macro. -(defvar realgud:perldb-minibuffer-history nil - "minibuffer history list for the command `perldb'.") - -(easy-mmode-defmap realgud:perldb-minibuffer-local-map - '(("\C-i" . comint-dynamic-complete-filename)) - "Keymap for minibuffer prompting of perldb startup command." - :inherit minibuffer-local-map) - -;; FIXME: I think this code and the keymaps and history -;; variable chould be generalized, perhaps via a macro. -(defun realgud:perldb-query-cmdline (&optional opt-debugger) - (realgud-query-cmdline - 'realgud:perldb-suggest-invocation - realgud:perldb-minibuffer-local-map - 'realgud:perldb-minibuffer-history - opt-debugger)) - -;;; FIXME: DRY this with other *-parse-cmd-args routines -(defun realgud:perldb-parse-cmd-args (orig-args) - "Parse command line ARGS for the annotate level and name of script to debug. - -ORIG-ARGS should contain a tokenized list of the command line to run. - -We return the a list containing - -* the command processor (e.g. perl) and it's arguments if any - a - list of strings - -* the script name and its arguments - list of strings - -For example for the following input: - (map 'list 'symbol-name - '(perl -W -C /tmp -d ./gcd.pl a b)) - -we might return: - ((\"perl\" \"-W\" \"-C\" \"-d\") nil (\"/tmp/gcd.pl\" \"a\" \"b\")) - -Note that path elements have been expanded via `realgud:expand-file-name-if-exists'. -" - - ;; Parse the following kind of pattern: - ;; [perl perl-options] perldb perldb-options script-name script-options - (let ( - (args orig-args) - (pair) ;; temp return from - (perl-opt-two-args '("0" "C" "D" "i" "l" "m" "-module" "x")) - ;; Perl doesn't have mandatory 2-arg options in our sense, - ;; since the two args can be run together, e.g. "-C/tmp" or "-C /tmp" - ;; - (perl-two-args '()) - ;; One dash is added automatically to the below, so - ;; h is really -h and -host is really --host. - (perldb-two-args '("e" "E")) - (perldb-opt-two-args '()) - (interp-regexp - (if (member system-type (list 'windows-nt 'cygwin 'msdos)) - "^perl\\(?:5[0-9.]*\\)\\(.exe\\)?$" - "^perl\\(?:5[0-9.]*\\)?$")) - - ;; Things returned - (script-name nil) - (debugger-name nil) - (interpreter-args '()) - (script-args '()) - ) - - (if (not (and args)) - ;; Got nothing - (list interpreter-args nil script-args) - ;; else - ;; Remove "perl" or "perl5.10.1" etc. - (when (string-match interp-regexp - (file-name-sans-extension - (file-name-nondirectory (car args)))) - (setq interpreter-args (list (pop args))) - - ;; Skip to the first non-option argument - (while (and args (not script-name)) - (let ((arg (car args))) - (cond - ;; Options with arguments. - ((string-match "^-" (car args)) - (setq pair (realgud-parse-command-arg - args perl-two-args perl-opt-two-args)) - (nconc interpreter-args (car pair)) - (setq args (cadr pair))) - ;; Anything else must be the script to debug. - (t (setq script-name (realgud:expand-file-name-if-exists arg)) - (setq script-args (cons script-name (cdr args)))) - ))) - (list interpreter-args nil script-args))) - )) - -; # To silence Warning: reference to free variable -(defvar realgud:perldb-command-name) - -(defun realgud:perldb-suggest-invocation (debugger-name) - "Suggest a perldb command invocation via `realgud-suggest-invocaton'" - (realgud-suggest-invocation realgud:perldb-command-name - realgud:perldb-minibuffer-history - "perl" "\\.pl$")) - -(defun realgud:perldb-reset () - "Perldb cleanup - remove debugger's internal buffers (frame, -breakpoints, etc.)." - (interactive) - ;; (perldb-breakpoint-remove-all-icons) - (dolist (buffer (buffer-list)) - (when (string-match "\\*perldb-[a-z]+\\*" (buffer-name buffer)) - (let ((w (get-buffer-window buffer))) - (when w - (delete-window w))) - (kill-buffer buffer)))) - -;; (defun perldb-reset-keymaps() -;; "This unbinds the special debugger keys of the source buffers." -;; (interactive) -;; (setcdr (assq 'perldb-debugger-support-minor-mode minor-mode-map-alist) -;; perldb-debugger-support-minor-mode-map-when-deactive)) - - -(defun realgud:perldb-customize () - "Use `customize' to edit the settings of the `perldb' debugger." - (interactive) - (customize-group 'realgud:perldb)) - -(provide-me "realgud:perldb-") diff --git a/packages/realgud/realgud/debugger/perldb/init.el b/packages/realgud/realgud/debugger/perldb/init.el deleted file mode 100644 index 1ccf1681b..000000000 --- a/packages/realgud/realgud/debugger/perldb/init.el +++ /dev/null @@ -1,97 +0,0 @@ -;;; Copyright (C) 2011, 2014-2015 Rocky Bernstein -;;; Stock Perl debugger perldb - -(eval-when-compile (require 'cl)) - -(require 'load-relative) -(require-relative-list '("../../common/regexp" "../../common/loc") "realgud-") -(require-relative-list '("../../lang/perl") "realgud-lang-") - -(defvar realgud-pat-hash) -(declare-function make-realgud-loc-pat (realgud-loc)) - -(defvar realgud:perldb-pat-hash (make-hash-table :test 'equal) - "Hash key is the what kind of pattern we want to match: -lang-backtrace, prompt, etc. The values of a hash entry is a -realgud-loc-pat struct") - -(declare-function make-realgud-loc "realgud-loc" (a b c d e f)) - -;; Regular expression that describes a perldb location generally shown -;; before a command prompt. We include matching the source text so we -;; can save that. -;; -;; Program-location lines look like this: -;; File::Basename::dirname(/usr/share/perl/5.16.0/File/Basename.pm:284): -;; 284: my $path = shift; -;; -;; main::(/usr/bin/latex2html:102): -;; or MS Windows: -;; ??? -(setf (gethash "loc" realgud:perldb-pat-hash) - (make-realgud-loc-pat - :regexp "\\(?:CODE(0x[0-9a-h]+)\\)?(\\(.+\\):\\(\[0-9]+\\)):\\(?:\n[0-9]+:\t\\(.*?\\)\n\\)?" - :file-group 1 - :line-group 2 - :text-group 3)) - -;; perldb debugger prompt. -;; Examples: -;; DB<4> -;; [pid=6489->6502] DB<1> -;; -(setf (gethash "prompt" realgud:perldb-pat-hash) - (make-realgud-loc-pat - :regexp "\\(?:\\[pid=[0-9]+->[0-9]+\\]\\)? DB<\\([0-9]+\\)> " - :num 1 - )) - -;; Regular expression that describes a Perl debugger backtrace line. -;; $ = main::top_navigation_panel called from file `./latex2html' line 7400 -;; $ = main::BEGIN() called from file `(eval 19)[/usr/bin/latex2html:126]' line 2 -(setf (gethash "debugger-backtrace" realgud:perldb-pat-hash) - (make-realgud-loc-pat - :regexp "\s+called from file `\\(.+\\)' line \\([0-9]+\\)" - :file-group 1 - :line-group 2)) - -;; Regular expression that describes location in a Perl errmsg -(setf (gethash "perl-errmsg" realgud:perldb-pat-hash) - realgud-perl-errmsg-loc-pat) - -;; Regular expression that describes a Perl Carp backtrace line. -;; at /tmp/foo.pl line 7 -;; main::__ANON__('Illegal division by zero at /tmp/foo.pl line 4.\x{a}') called at /tmp/foo.pl line 4 -;; main::foo(3) called at /tmp/foo.pl line 8 -(setf (gethash "lang-backtrace" realgud:perldb-pat-hash) - realgud-perl-carp-loc-pat) - -(defvar realgud:perldb-command-hash (make-hash-table :test 'equal) - "Hash key is command name like 'quit' and the value is - the perldb command to use, like 'q'") - -(setf (gethash "font-lock-keywords" realgud:perldb-pat-hash) - '( - ("\s+called from file `\\(.+\\)' line \\([0-9]+\\)" - (1 realgud-file-name-face) - (2 realgud-line-number-face)) - )) - - -(setf (gethash "perldb" realgud-pat-hash) realgud:perldb-pat-hash) -(setf (gethash "perl5db" realgud-pat-hash) realgud:perldb-pat-hash) - -(setf (gethash "backtrace" realgud:perldb-command-hash) "T") -(setf (gethash "break" realgud:perldb-command-hash) "b %l") -(setf (gethash "clear" realgud:perldb-command-hash) "B %l") -(setf (gethash "continue" realgud:perldb-command-hash) "c") -(setf (gethash "eval" realgud:perldb-command-hash) "x %s") -(setf (gethash "quit" realgud:perldb-command-hash) "q") -(setf (gethash "restart" realgud:perldb-command-hash) "R") -(setf (gethash "run" realgud:perldb-command-hash) "R") -(setf (gethash "step" realgud:perldb-command-hash) "s") -(setf (gethash "next" realgud:perldb-command-hash) "n") -(setf (gethash "until" realgud:perldb-command-hash) "c %l") -(setf (gethash "perldb" realgud-command-hash) realgud:perldb-command-hash) - -(provide-me "realgud:perldb-") diff --git a/packages/realgud/realgud/debugger/perldb/perldb.el b/packages/realgud/realgud/debugger/perldb/perldb.el deleted file mode 100644 index 6d5bcf4eb..000000000 --- a/packages/realgud/realgud/debugger/perldb/perldb.el +++ /dev/null @@ -1,64 +0,0 @@ -;;; Copyright (C) 2011, 2014-2015 Rocky Bernstein -;; `perldb' Main interface to perl debugger via Emacs -(require 'load-relative) -(require-relative-list '("../../common/helper") "realgud-") -(require-relative-list '("../../common/run") "realgud:") -(require-relative-list '("core" "track-mode") "realgud:perldb-") - -(declare-function realgud:run-debugger 'realgud:run) - -;; This is needed, or at least the docstring part of it is needed to -;; get the customization menu to work in Emacs 24. -(defgroup realgud:perldb nil - "The realgud interface to the Perl debugger, perldb" - :group 'realgud - :version "24.1") - -;; ------------------------------------------------------------------- -;; User-definable variables -;; - -(defcustom realgud:perldb-command-name - "perl -d" - "Option to needed to run the Perl debugger" - :type 'string - :group 'realgud:perldb) - -;; ------------------------------------------------------------------- -;; The end. -;; - -(declare-function perldb-track-mode (bool)) -(declare-function realgud:perldb-query-cmdline 'realgud:perldb-core) -(declare-function realgud:perldb-parse-cmd-args 'realgud:perldb-core) - -;;;###autoload -(defun realgud:perldb (&optional opt-cmd-line no-reset) - "Invoke the Perl debugger and start the Emacs user interface. - -String OPT-CMD-LINE specifies how to run nodejs. - -OPT-CMD-LINE is treated like a shell string; arguments are -tokenized by `split-string-and-unquote'. The tokenized string is -parsed by `perldb-parse-cmd-args' and path elements found by that -are expanded using `realgud:expand-file-name-if-exists'. - -Normally, command buffers are reused when the same debugger is -reinvoked inside a command buffer with a similar command. If we -discover that the buffer has prior command-buffer information and -NO-RESET is nil, then that information which may point into other -buffers and source buffers which may contain marks and fringe or -marginal icons is reset. See `loc-changes-clear-buffer' to clear -fringe and marginal icons. -" - (interactive) - (realgud:run-debugger "perldb" - 'realgud:perldb-query-cmdline - 'realgud:perldb-parse-cmd-args - 'realgud:perldb-minibuffer-history - opt-cmd-line no-reset)) - -(defalias 'perl5db 'realgud:perldb) -;; (defalias 'perldb 'realgud:perldb) - -(provide-me "realgud-") diff --git a/packages/realgud/realgud/debugger/perldb/track-mode.el b/packages/realgud/realgud/debugger/perldb/track-mode.el deleted file mode 100644 index 336c7e6a6..000000000 --- a/packages/realgud/realgud/debugger/perldb/track-mode.el +++ /dev/null @@ -1,72 +0,0 @@ -;;; Copyright (C) 2011-2015 Rocky Bernstein -;;; Stock Perl Debugger "perldb5" tracking a comint or eshell buffer. - -(eval-when-compile (require 'cl)) -(require 'load-relative) -(require-relative-list '( - "../../common/cmds" - "../../common/menu" - "../../common/track" - "../../common/track-mode" - ) - "realgud-") -(require-relative-list '("core" "init") "realgud:perldb-") -(require-relative-list '("../../lang/perl") "realgud-lang-") - -(realgud-track-mode-vars "perldb") - -(declare-function realgud:cmd-remap 'realgud-cmds) -(declare-function realgud-perl-populate-command-keys - 'realgud:perldb) -(declare-function realgud-track-mode 'realgud-track-mode) -(declare-function realgud-track-mode-setup realgud-track-mode) -(declare-function realgud:track-set-debugger 'realgud-track-mode) - -(realgud-perl-populate-command-keys perldb-track-mode-map ) - -(defun perldb-track-mode-hook() - (if perldb-track-mode - (progn - (use-local-map perldb-track-mode-map) - (message "using perldb mode map") - ) - (message "perldb track-mode-hook disable called")) -) - -(define-minor-mode perldb-track-mode - "Minor mode for tracking perl5db source locations inside a process shell via realgud. perl5db is the stock Perl debugger. - -If called interactively with no prefix argument, the mode is toggled. A prefix argument, captured as ARG, enables the mode if the argument is positive, and disables it otherwise. - -\\{perldb-track-mode-map} -" - :init-value nil - ;; :lighter " perldb" ;; mode-line indicator from realgud-track is sufficient. - ;; The minor mode bindings. - :global nil - :group 'realgud:perldb - :keymap perldb-track-mode-map - - (realgud:track-set-debugger "perldb") - (if perldb-track-mode - (progn - (realgud-track-mode-setup 't) - (perldb-track-mode-hook)) - (progn - (setq realgud-track-mode nil) - )) -) - -(defun realgud:perldb-backtrace(arg) - (interactive "p") - (realgud:cmd-remap arg "backtrace" "T" "T") -) - -;; Perldb doesn't have stack switching commands. -(define-key perldb-short-key-mode-map - [remap realgud:cmd-newer-frame] 'undefined) -(define-key perldb-short-key-mode-map - [remap realgud:cmd-older-frame] 'undefined) -(define-key perldb-short-key-mode-map "T" 'realgud:perldb-backtrace) - -(provide-me "realgud:perldb-") diff --git a/packages/realgud/realgud/debugger/pydb/Makefile.am b/packages/realgud/realgud/debugger/pydb/Makefile.am deleted file mode 100644 index 23f8a8fa2..000000000 --- a/packages/realgud/realgud/debugger/pydb/Makefile.am +++ /dev/null @@ -1 +0,0 @@ -include ../common.mk diff --git a/packages/realgud/realgud/debugger/pydb/core.el b/packages/realgud/realgud/debugger/pydb/core.el deleted file mode 100644 index 19fbc1e3f..000000000 --- a/packages/realgud/realgud/debugger/pydb/core.el +++ /dev/null @@ -1,160 +0,0 @@ -;;; Copyright (C) 2012 Rocky Bernstein -(eval-when-compile (require 'cl)) - -(require 'load-relative) -(require-relative-list '("../../common/track" - "../../common/core" - "../../common/lang") - "realgud-") -(require-relative-list '("init") "realgud:pydb-") - - -(declare-function realgud-lang-mode? 'realgud-lang) -(declare-function realgud-parse-command-arg 'realgud-core) -(declare-function realgud-query-cmdline 'realgud-core) -(declare-function realgud-suggest-invocation 'realgud-core) - -;; FIXME: I think the following could be generalized and moved to -;; realgud-... probably via a macro. -(defvar realgud:pydb-minibuffer-history nil - "minibuffer history list for the command `pydb'.") - -(easy-mmode-defmap pydb-minibuffer-local-map - '(("\C-i" . comint-dynamic-complete-filename)) - "Keymap for minibuffer prompting of gud startup command." - :inherit minibuffer-local-map) - -;; FIXME: I think this code and the keymaps and history -;; variable chould be generalized, perhaps via a macro. -(defun pydb-query-cmdline (&optional opt-debugger) - (realgud-query-cmdline - 'pydb-suggest-invocation - pydb-minibuffer-local-map - 'realgud:pydb-minibuffer-history - opt-debugger)) - -(defun pydb-parse-cmd-args (orig-args) - "Parse command line ARGS for the annotate level and name of script to debug. - -ARGS should contain a tokenized list of the command line to run. - -We return the a list containing -- the command processor (e.g. python) and it's arguments if any - a list of strings -- the name of the debugger given (e.g. pydb) and its arguments - a list of strings -- the script name and its arguments - list of strings -- whether the annotate or emacs option was given ('-A', '--annotate' or '--emacs) - a boolean - -For example for the following input - (map 'list 'symbol-name - '(python2.6 -O -Qold ./gcd.py a b)) - -we might return: - ((python2.6 -O -Qold) (pydb) (./gcd.py a b) 't) - -NOTE: the above should have each item listed in quotes. -" - - ;; Parse the following kind of pattern: - ;; [python python-options] pydb pydb-options script-name script-options - (let ( - (args orig-args) - (pair) ;; temp return from - (python-opt-two-args '()) - ;; Python doesn't have mandatory 2-arg options in our sense, - ;; since the two args can be run together, e.g. "-C/tmp" or "-C /tmp" - ;; - (python-two-args '()) - ;; pydb doesn't have any arguments - (pydb-two-args '()) - (pydb-opt-two-args '()) - (interp-regexp - (if (member system-type (list 'windows-nt 'cygwin 'msdos)) - "^python[-0-9.]*\\(.exe\\)?$" - "^python[-0-9.]*$")) - - ;; Things returned - (annotate-p nil) - (debugger-args '()) - (debugger-name nil) - (interpreter-args '()) - (script-args '()) - (script-name nil) - ) - - (if (not (and args)) - ;; Got nothing: return '(nil, nil) - (list interpreter-args debugger-args script-args annotate-p) - ;; else - ;; Strip off optional "python" or "python182" etc. - (when (string-match interp-regexp - (file-name-sans-extension - (file-name-nondirectory (car args)))) - (setq interpreter-args (list (pop args))) - - ;; Strip off Python-specific options - (while (and args - (string-match "^-" (car args))) - (setq pair (realgud-parse-command-arg - args python-two-args python-opt-two-args)) - (nconc interpreter-args (car pair)) - (setq args (cadr pair)))) - - ;; Remove "pydb" from "pydb --pydb-options script - ;; --script-options" - (setq debugger-name (file-name-sans-extension - (file-name-nondirectory (car args)))) - (unless (string-match "^\\(pydb\\|cli.py\\)$" debugger-name) - (message - "Expecting debugger name `%s' to be `pydb' or `cli.py'" - debugger-name)) - (setq debugger-args (list (pop args))) - - ;; Skip to the first non-option argument. - (while (and args (not script-name)) - (let ((arg (car args))) - (cond - ;; Options with arguments. - ((string-match "^-" arg) - (setq pair (realgud-parse-command-arg - args pydb-two-args pydb-opt-two-args)) - (nconc debugger-args (car pair)) - (setq args (cadr pair))) - ;; Anything else must be the script to debug. - (t (setq script-name arg) - (setq script-args args)) - ))) - (list interpreter-args debugger-args script-args annotate-p)))) - -;; To silence Warning: reference to free variable -(defvar realgud:pydb-command-name) - -(defun pydb-suggest-invocation (debugger-name) - "Suggest a pydb command invocation via `realgud-suggest-invocaton'" - (realgud-suggest-invocation realgud:pydb-command-name - realgud:pydb-minibuffer-history - "python" "\\.py")) - -(defun pydb-reset () - "Pydb cleanup - remove debugger's internal buffers (frame, -breakpoints, etc.)." - (interactive) - ;; (pydb-breakpoint-remove-all-icons) - (dolist (buffer (buffer-list)) - (when (string-match "\\*pydb-[a-z]+\\*" (buffer-name buffer)) - (let ((w (get-buffer-window buffer))) - (when w - (delete-window w))) - (kill-buffer buffer)))) - -;; (defun pydb-reset-keymaps() -;; "This unbinds the special debugger keys of the source buffers." -;; (interactive) -;; (setcdr (assq 'pydb-debugger-support-minor-mode minor-mode-map-alist) -;; pydb-debugger-support-minor-mode-map-when-deactive)) - - -(defun realgud:pydb-customize () - "Use `customize' to edit the settings of the `pydb' debugger." - (interactive) - (customize-group 'realgud:pydb)) -(provide-me "realgud:pydb-") diff --git a/packages/realgud/realgud/debugger/pydb/init.el b/packages/realgud/realgud/debugger/pydb/init.el deleted file mode 100644 index e5a6a17a9..000000000 --- a/packages/realgud/realgud/debugger/pydb/init.el +++ /dev/null @@ -1,99 +0,0 @@ -;;; Copyright (C) 2012 Rocky Bernstein -;;; Stock Python debugger pydb - -(eval-when-compile (require 'cl)) - -(require 'load-relative) -(require-relative-list '("../../common/regexp" - "../../common/loc" - "../../common/init") - "realgud-") -(require-relative-list '("../../lang/python") "realgud-lang-") - -(defvar realgud-pat-hash) -(declare-function make-realgud-loc-pat (realgud-loc)) - -(defvar realgud:pydb-pat-hash (make-hash-table :test 'equal) - "Hash key is the what kind of pattern we want to match: -backtrace, prompt, etc. The values of a hash entry is a -realgud-loc-pat struct") - -(declare-function make-realgud-loc "realgud-loc" (a b c d e f)) - -;; Regular expression that describes a pydb location generally shown -;; before a command prompt. -;; -;; Program-location lines look like this: -;; > /usr/bin/zonetab2pot.py(15)() -;; or MS Windows: -;; > c:\\mydirectory\\gcd.py(10) -(setf (gethash "loc" realgud:pydb-pat-hash) - (make-realgud-loc-pat - :regexp "^(\\(\\(?:[a-zA-Z]:\\)?[-a-zA-Z0-9_/.\\\\ ]+\\):\\([0-9]+\\))" - :file-group 1 - :line-group 2)) - -(setf (gethash "prompt" realgud:pydb-pat-hash) - (make-realgud-loc-pat - :regexp "^[(]+Pydb[)]+ " - )) - -;; Regular expression that describes a Python backtrace line. -(setf (gethash "lang-backtrace" realgud:pydb-pat-hash) - realgud-python-backtrace-loc-pat) - -;; Regular expression that describes a "breakpoint set" line. For example: -;; Breakpoint 1 at /usr/bin/pydb:7 -(setf (gethash "brkpt-set" realgud:pydb-pat-hash) - (make-realgud-loc-pat - :regexp "^Breakpoint \\([0-9]+\\) at[ \t\n]+\\(.+\\):\\([0-9]+\\)\\(\n\\|$\\)" - :num 1 - :file-group 2 - :line-group 3)) - -;; Regular expression that describes a "delete breakpoint" line -(setf (gethash "brkpt-del" realgud:pydb-pat-hash) - (make-realgud-loc-pat - :regexp "^Deleted breakpoint \\([0-9]+\\)\n" - :num 1)) - -(setf (gethash "font-lock-keywords" realgud:pydb-pat-hash) - '( - ;; The frame number and first type name, if present. - ("^\\(->\\|##\\)\\([0-9]+\\) \\(\\)? *\\([a-zA-Z_][a-zA-Z0-9_]*\\)(\\(.+\\))?" - (2 realgud-backtrace-number-face) - (4 font-lock-function-name-face nil t)) ; t means optional. - - ;; Parameter sequence, E.g. gcd(a=3, b=5) - ;; ^^^^^^^^^ - ("(\\(.+\\))" - (1 font-lock-variable-name-face)) - - ;; File name. E.g file '/test/gcd.py' - ;; ------^^^^^^^^^^^^- - ("[ \t]+file '\\([^ ]+*\\)'" - (1 realgud-file-name-face)) - - ;; Line number. E.g. at line 28 - ;; ---------^^ - ("[ \t]+at line \\([0-9]+\\)$" - (1 realgud-line-number-face)) - - ;; Function name. - ("\\<\\([a-zA-Z_][a-zA-Z0-9_]*\\)\\.\\([a-zA-Z_][a-zA-Z0-9_]*\\)" - (1 font-lock-type-face) - (2 font-lock-function-name-face)) - ;; (pydb-frames-match-current-line - ;; (0 pydb-frames-current-frame-face append)) - )) - -(setf (gethash "pydb" realgud-pat-hash) realgud:pydb-pat-hash) - -(defvar realgud:pydb-command-hash (make-hash-table :test 'equal) - "Hash key is command name like 'shell' and the value is - the pydb command to use, like 'python'") - -(setf (gethash "shell" realgud:pydb-command-hash) "python") -(setf (gethash "pydb" realgud-command-hash) realgud:pydb-command-hash) - -(provide-me "realgud:pydb-") diff --git a/packages/realgud/realgud/debugger/pydb/pydb.el b/packages/realgud/realgud/debugger/pydb/pydb.el deleted file mode 100644 index 2dd8f9744..000000000 --- a/packages/realgud/realgud/debugger/pydb/pydb.el +++ /dev/null @@ -1,63 +0,0 @@ -;;; Copyright (C) 2012, 2014 Rocky Bernstein -;; `pydb' Main interface to pydb via Emacs -(require 'load-relative) -(require-relative-list '("../../common/helper") "realgud-") -(require-relative-list '("../../common/run") "realgud:") -(require-relative-list '("core" "track-mode") "realgud:pydb-") - -(declare-function pydb-query-cmdline 'realgud:pydb-core) -(declare-function pydb-parse-cmd-args 'realgud:pydb-core) -(declare-function realgud:run-debugger 'realgud:run) - -;; This is needed, or at least the docstring part of it is needed to -;; get the customization menu to work in Emacs 24. -(defgroup realgud:pydb nil - "The realgud interface to the Python pydb debugger" - :group 'realgud - :group 'python - :version "24.1") - -;; ------------------------------------------------------------------- -;; User-definable variables -;; - -(defcustom realgud:pydb-command-name - "pydb" - "File name for executing the stock Python debugger and command options. -This should be an executable on your path, or an absolute file name." - :type 'string - :group 'realgud:pydb) - -(declare-function pydb-track-mode (bool)) - -;; ------------------------------------------------------------------- -;; The end. -;; - -;;;###autoload -(defun realgud:pydb (&optional opt-cmd-line no-reset) - "Invoke the pydb Python debugger and start the Emacs user interface. - -OPT-COMMAND-LINE is treated like a shell string; arguments are -tokenized by `split-string-and-unquote'. The tokenized string is -parsed by `pydb-parse-cmd-args' and path elements found by that -are expanded using `realgud:expand-file-name-if-exists'. - -Normally, command buffers are reused when the same debugger is -reinvoked inside a command buffer with a similar command. If we -discover that the buffer has prior command-buffer information and -NO-RESET is nil, then that information which may point into other -buffers and source buffers which may contain marks and fringe or -marginal icons is reset. See `loc-changes-clear-buffer' to clear -fringe and marginal icons. -" - (interactive) - (realgud:run-debugger "pydb" 'pydb-query-cmdline 'pydb-parse-cmd-args - 'realgud:pydb-minibuffer-history - opt-cmd-line no-reset) - ) - - -(defalias 'pydb 'realgud:pydb) - -(provide-me "realgud-") diff --git a/packages/realgud/realgud/debugger/pydb/track-mode.el b/packages/realgud/realgud/debugger/pydb/track-mode.el deleted file mode 100644 index cf8dab3d8..000000000 --- a/packages/realgud/realgud/debugger/pydb/track-mode.el +++ /dev/null @@ -1,58 +0,0 @@ -;;; Copyright (C) 2010, 2012, 2014-2015 Rocky Bernstein -;;; Python "pydb" Debugger tracking a comint -;;; or eshell buffer. - -(eval-when-compile (require 'cl)) -(require 'load-relative) -(require-relative-list '( - "../../common/cmds" - "../../common/menu" - "../../common/track" - "../../common/track-mode" - ) - "realgud-") -(require-relative-list '("core" "init") "realgud:pydb-") - -(realgud-track-mode-vars "pydb") - -(declare-function realgud-track-mode 'realgud-track-mode) -(declare-function realgud-track-mode-setup 'realgud-track-mode) -(declare-function realgud:track-set-debugger 'realgud-track-mode) -(declare-function realgud-python-populate-command-keys 'realgud-lang-python) - -(realgud-python-populate-command-keys pydb-track-mode-map) - -(defun pydb-track-mode-hook() - (if pydb-track-mode - (progn - (use-local-map pydb-track-mode-map) - (message "using pydb mode map") - ) - (message "pydb track-mode-hook disable called") - ) -) - -(define-minor-mode pydb-track-mode - "Minor mode for tracking pydb source locations inside a process shell via realgud. pydb is a Python debugger. - -If called interactively with no prefix argument, the mode is toggled. A prefix argument, captured as ARG, enables the mode if the argument is positive, and disables it otherwise. - -\\{pydb-track-mode-map} -" - :init-value nil - ;; :lighter " pydb" ;; mode-line indicator from realgud-track is sufficient. - ;; The minor mode bindings. - :global nil - :group 'realgud:pydb - :keymap pydb-track-mode-map - (realgud:track-set-debugger "pydb") - (if pydb-track-mode - (progn - (realgud-track-mode-setup 't) - (pydb-track-mode-hook)) - (progn - (setq realgud-track-mode nil) - )) -) - -(provide-me "realgud:pydb-") diff --git a/packages/realgud/realgud/debugger/pydbgr/Makefile.am b/packages/realgud/realgud/debugger/pydbgr/Makefile.am deleted file mode 100644 index 23f8a8fa2..000000000 --- a/packages/realgud/realgud/debugger/pydbgr/Makefile.am +++ /dev/null @@ -1 +0,0 @@ -include ../common.mk diff --git a/packages/realgud/realgud/debugger/pydbgr/core.el b/packages/realgud/realgud/debugger/pydbgr/core.el deleted file mode 100644 index 91246403a..000000000 --- a/packages/realgud/realgud/debugger/pydbgr/core.el +++ /dev/null @@ -1,172 +0,0 @@ -;;; Copyright (C) 2010, 2013 Rocky Bernstein -(eval-when-compile (require 'cl)) - -(require 'load-relative) -(require-relative-list '("../../common/track" - "../../common/core" - "../../common/lang") - "realgud-") -(require-relative-list '("init") "realgud-pydbgr-") - -(declare-function realgud-lang-mode? 'realgud-lang) -(declare-function realgud-parse-command-arg 'realgud-core) -(declare-function realgud-query-cmdline 'realgud-core) -(declare-function realgud-suggest-invocation 'realgud-core) - -;; FIXME: I think the following could be generalized and moved to -;; realgud-... probably via a macro. -(defvar realgud:pydbgr-minibuffer-history nil - "minibuffer history list for the command `pydbgr'.") - -(easy-mmode-defmap pydbgr-minibuffer-local-map - '(("\C-i" . comint-dynamic-complete-filename)) - "Keymap for minibuffer prompting of gud startup command." - :inherit minibuffer-local-map) - -;; FIXME: I think this code and the keymaps and history -;; variable chould be generalized, perhaps via a macro. -(defun pydbgr-query-cmdline (&optional opt-debugger) - (realgud-query-cmdline - 'pydbgr-suggest-invocation - pydbgr-minibuffer-local-map - 'realgud:pydbgr-minibuffer-history - opt-debugger)) - -(defun pydbgr-parse-cmd-args (orig-args) - "Parse command line ARGS for the annotate level and name of script to debug. - -ARGS should contain a tokenized list of the command line to run. - -We return the a list containing -- the command processor (e.g. python) and it's arguments if any - a list of strings -- the name of the debugger given (e.g. pydbgr) and its arguments - a list of strings -- the script name and its arguments - list of strings -- whether the annotate or emacs option was given ('-A', '--annotate' or '--emacs) - a boolean - -For example for the following input - (map 'list 'symbol-name - '(python2.6 -O -Qold --emacs ./gcd.py a b)) - -we might return: - ((python2.6 -O -Qold) (pydbgr --emacs) (./gcd.py a b) 't) - -NOTE: the above should have each item listed in quotes. -" - - ;; Parse the following kind of pattern: - ;; [python python-options] pydbgr pydbgr-options script-name script-options - (let ( - (args orig-args) - (pair) ;; temp return from - (python-opt-two-args '("c" "m" "Q" "W")) - ;; Python doesn't have mandatory 2-arg options in our sense, - ;; since the two args can be run together, e.g. "-C/tmp" or "-C /tmp" - ;; - (python-two-args '()) - ;; One dash is added automatically to the below, so - ;; h is really -h and -host is really --host. - (pydbgr-two-args '("x" "-command" "e" "-execute" - "o" "-output" "t" "-target" - "a" "-annotate")) - (pydbgr-opt-two-args '()) - (interp-regexp - (if (member system-type (list 'windows-nt 'cygwin 'msdos)) - "^python[-0-9.]*\\(.exe\\)?$" - "^python[-0-9.]*$")) - - ;; Things returned - (annotate-p nil) - (debugger-args '()) - (debugger-name nil) - (interpreter-args '()) - (script-args '()) - (script-name nil) - ) - - (if (not (and args)) - ;; Got nothing: return '(nil, nil) - (list interpreter-args debugger-args script-args annotate-p) - ;; else - ;; Strip off optional "python" or "python182" etc. - (when (string-match interp-regexp - (file-name-sans-extension - (file-name-nondirectory (car args)))) - (setq interpreter-args (list (pop args))) - - ;; Strip off Python-specific options - (while (and args - (string-match "^-" (car args))) - (setq pair (realgud-parse-command-arg - args python-two-args python-opt-two-args)) - (nconc interpreter-args (car pair)) - (setq args (cadr pair)))) - - ;; Remove "pydbgr" from "pydbgr --pydbgr-options script - ;; --script-options" - (setq debugger-name (file-name-sans-extension - (file-name-nondirectory (car args)))) - (unless (string-match "^\\(pydbgr\\|cli.py\\)$" debugger-name) - (message - "Expecting debugger name `%s' to be `pydbgr' or `cli.py'" - debugger-name)) - (setq debugger-args (list (pop args))) - - ;; Skip to the first non-option argument. - (while (and args (not script-name)) - (let ((arg (car args))) - (cond - ;; Annotation or emacs option with level number. - ((or (member arg '("--annotate" "-A")) - (equal arg "--emacs")) - (setq annotate-p t) - (nconc debugger-args (list (pop args)))) - ;; Combined annotation and level option. - ((string-match "^--annotate=[0-9]" arg) - (nconc debugger-args (list (pop args)) ) - (setq annotate-p t)) - ;; Options with arguments. - ((string-match "^-" arg) - (setq pair (realgud-parse-command-arg - args pydbgr-two-args pydbgr-opt-two-args)) - (nconc debugger-args (car pair)) - (setq args (cadr pair))) - ;; Anything else must be the script to debug. - (t (setq script-name arg) - (setq script-args args)) - ))) - (list interpreter-args debugger-args script-args annotate-p)))) - -;; To silence Warning: reference to free variable -(defvar realgud:pydbgr-command-name) - -(defun pydbgr-suggest-invocation (debugger-name) - "Suggest a pydbgr command invocation via `realgud-suggest-invocaton'" - (realgud-suggest-invocation realgud:pydbgr-command-name - realgud:pydbgr-minibuffer-history - "python" "\\.py")) - -(defun pydbgr-reset () - "Pydbgr cleanup - remove debugger's internal buffers (frame, -breakpoints, etc.)." - (interactive) - ;; (pydbgr-breakpoint-remove-all-icons) - (dolist (buffer (buffer-list)) - (when (string-match "\\*pydbgr-[a-z]+\\*" (buffer-name buffer)) - (let ((w (get-buffer-window buffer))) - (when w - (delete-window w))) - (kill-buffer buffer)))) - -;; (defun pydbgr-reset-keymaps() -;; "This unbinds the special debugger keys of the source buffers." -;; (interactive) -;; (setcdr (assq 'pydbgr-debugger-support-minor-mode minor-mode-map-alist) -;; pydbgr-debugger-support-minor-mode-map-when-deactive)) - - -(defun realgud:pydbgr-customize () - "Use `customize' to edit the settings of the `pydbgr' debugger." - (interactive) - (customize-group 'realgud:pydbgr)) - -(provide-me "realgud-pydbgr-") diff --git a/packages/realgud/realgud/debugger/pydbgr/init.el b/packages/realgud/realgud/debugger/pydbgr/init.el deleted file mode 100644 index 5778fc878..000000000 --- a/packages/realgud/realgud/debugger/pydbgr/init.el +++ /dev/null @@ -1,99 +0,0 @@ -;;; Copyright (C) 2010-2012 Rocky Bernstein -;;; pydbgr: Python 2.5 but less than 3K - -(eval-when-compile (require 'cl)) - -(require 'load-relative) -(require-relative-list '("../../common/regexp" - "../../common/loc" - "../../common/init") - "realgud-") -(require-relative-list '("../../lang/python") "realgud-lang-") - -(defvar realgud-pat-hash) -(declare-function make-realgud-loc-pat (realgud-loc)) - -(defvar realgud-pydbgr-pat-hash (make-hash-table :test 'equal) - "Hash key is the what kind of pattern we want to match: -backtrace, prompt, etc. The values of a hash entry is a -realgud-loc-pat struct") - -(declare-function make-realgud-loc "realgud-loc" (a b c d e f)) - -;; Regular expression that describes a pydbgr location generally shown -;; before a command prompt. -;; -;; For example: -;; (/usr/bin/zonetab2pot.py:15): -;; (/usr/bin/zonetab2pot.py:15 remapped ): -;; or MS Windows: -;; (c:\\mydirectory\\gcd.py:10): -(setf (gethash "loc" realgud-pydbgr-pat-hash) - (make-realgud-loc-pat - :regexp "^(\\(\\(?:[a-zA-Z]:\\)?[-a-zA-Z0-9_/.\\\\ ]+\\):\\([0-9]+\\)\\(?: remapped .*\\)?)" - :file-group 1 - :line-group 2)) - -(setf (gethash "prompt" realgud-pydbgr-pat-hash) - (make-realgud-loc-pat - :regexp "^(Pydbgr) " - )) - -;; Regular expression that describes a Python backtrace line. -(setf (gethash "lang-backtrace" realgud-pydbgr-pat-hash) - realgud-python-backtrace-loc-pat) - -;; Regular expression that describes a "breakpoint set" line -(setf (gethash "brkpt-set" realgud-pydbgr-pat-hash) - (make-realgud-loc-pat - :regexp "^Breakpoint \\([0-9]+\\) set at line \\([0-9]+\\)[ \t\n]+of file \\(.+\\)\\(\n\\|$\\)" - :num 1 - :file-group 3 - :line-group 2)) - -;; Regular expression that describes a "delete breakpoint" line -(setf (gethash "brkpt-del" realgud-pydbgr-pat-hash) - (make-realgud-loc-pat - :regexp "^Deleted breakpoint \\([0-9]+\\)\n" - :num 1)) - -(setf (gethash "font-lock-keywords" realgud-pydbgr-pat-hash) - '( - ;; The frame number and first type name, if present. - ("^\\(->\\|##\\)\\([0-9]+\\) \\(\\)? *\\([a-zA-Z_][a-zA-Z0-9_]*\\)(\\(.+\\))?" - (2 realgud-backtrace-number-face) - (4 font-lock-function-name-face nil t)) ; t means optional. - - ;; Parameter sequence, E.g. gcd(a=3, b=5) - ;; ^^^^^^^^^ - ("(\\(.+\\))" - (1 font-lock-variable-name-face)) - - ;; File name. E.g file '/test/gcd.py' - ;; ------^^^^^^^^^^^^- - ("[ \t]+file '\\([^ ]+*\\)'" - (1 realgud-file-name-face)) - - ;; Line number. E.g. at line 28 - ;; ---------^^ - ("[ \t]+at line \\([0-9]+\\)$" - (1 realgud-line-number-face)) - - ;; Function name. - ("\\<\\([a-zA-Z_][a-zA-Z0-9_]*\\)\\.\\([a-zA-Z_][a-zA-Z0-9_]*\\)" - (1 font-lock-type-face) - (2 font-lock-function-name-face)) - ;; (pydbgr-frames-match-current-line - ;; (0 pydbgr-frames-current-frame-face append)) - )) - -(setf (gethash "pydbgr" realgud-pat-hash) realgud-pydbgr-pat-hash) - -(defvar realgud-pydbgr-command-hash (make-hash-table :test 'equal) - "Hash key is command name like 'shell' and the value is - the pydbgr command to use, like 'python'") - -(setf (gethash "shell" realgud-pydbgr-command-hash) "python") -(setf (gethash "pydbgr" realgud-command-hash) realgud-pydbgr-command-hash) - -(provide-me "realgud-pydbgr-") diff --git a/packages/realgud/realgud/debugger/pydbgr/pydbgr.el b/packages/realgud/realgud/debugger/pydbgr/pydbgr.el deleted file mode 100644 index c0dba9541..000000000 --- a/packages/realgud/realgud/debugger/pydbgr/pydbgr.el +++ /dev/null @@ -1,64 +0,0 @@ -;;; Copyright (C) 2010-2012, 2014 Rocky Bernstein -;; `pydbgr' Main interface to pydbgr via Emacs -(require 'load-relative) -(require-relative-list '("../../common/helper" - "../../common/track") "realgud-") -(require-relative-list '("core" "track-mode") "realgud-pydbgr-") - -;; This is needed, or at least the docstring part of it is needed to -;; get the customization menu to work in Emacs 24. -(defgroup realgud:pydbgr nil - "The realgud interface to the Python pydbgr debugger" - :group 'realgud - :group 'python - :version "24.1") - -(declare-function pydbgr-query-cmdline 'realgud-pydbgr-core) -(declare-function pydbgr-parse-cmd-args 'realgud-pydbgr-core) -(declare-function pydbgr-track-mode 'realgud:pydbgr-track-mode) -(declare-function realgud:run-debugger 'realgud:run) - -;; ------------------------------------------------------------------- -;; User-definable variables -;; - -(defcustom realgud:pydbgr-command-name - ;;"pydbgr --emacs 3" - "pydbgr" - "File name for executing the Python debugger and command options. -This should be an executable on your path, or an absolute file name." - :type 'string - :group 'realgud:pydbgr) - -;; ------------------------------------------------------------------- -;; The end. -;; - -;;;###autoload -(defun realgud-pydbgr (&optional opt-cmd-line no-reset) - "Invoke the pydbgr Python debugger and start the Emacs user interface. - -String OPT-CMD-LINE is treated like a shell string; arguments are -tokenized by `split-string-and-unquote'. The tokenized string is -parsed by `pydbgr-parse-cmd-args' and path elements found by that -are expanded using `realgud:expand-file-name-if-exists'. - -Normally, command buffers are reused when the same debugger is -reinvoked inside a command buffer with a similar command. If we -discover that the buffer has prior command-buffer information and -NO-RESET is nil, then that information which may point into other -buffers and source buffers which may contain marks and fringe or -marginal icons is reset. See `loc-changes-clear-buffer' to clear -fringe and marginal icons. -" - (interactive) - (realgud:run-debugger "pydbgr" - 'pydbgr-query-cmdline - 'pydbgr-parse-cmd-args - 'realgud:pydbgr-minibuffer-history - opt-cmd-line no-reset) - ) - -(defalias 'pydbgr 'realgud-pydbgr) - -(provide-me "realgud-") diff --git a/packages/realgud/realgud/debugger/pydbgr/track-mode.el b/packages/realgud/realgud/debugger/pydbgr/track-mode.el deleted file mode 100644 index 6889c7ea8..000000000 --- a/packages/realgud/realgud/debugger/pydbgr/track-mode.el +++ /dev/null @@ -1,60 +0,0 @@ -;; Copyright (C) 2010, 2012-2015 Rocky Bernstein -;; -;; Python "pydbgr" Debugger tracking a comint buffer. - -(eval-when-compile (require 'cl)) -(require 'load-relative) -(require-relative-list '( - "../../common/cmds" - "../../common/menu" - "../../common/track" - "../../common/track-mode" - ) - "realgud-") - -(require-relative-list '("../../lang/python") "realgud-lang-") -(require-relative-list '("core" "init") "realgud-pydbgr-") - -(realgud-track-mode-vars "pydbgr") - -(declare-function realgud-track-mode 'realgud-track-mode) -(declare-function realgud-track-mode-setup 'realgud-track-mode) -(declare-function realgud:track-set-debugger 'realgud-track-mode) -(declare-function realgud-python-populate-command-keys 'realgud-lang-python) - -(realgud-python-populate-command-keys pydbgr-track-mode-map) - -(defun pydbgr-track-mode-hook() - (if pydbgr-track-mode - (progn - (use-local-map pydbgr-track-mode-map) - (message "using pydbgr mode map") - ) - (message "pydbgr track-mode-hook disable called") - ) -) - -(define-minor-mode pydbgr-track-mode - "Minor mode for tracking pydbgr source locations inside a process shelll via realgud. pydbgr is a Python debugger. See URL `https://code.google.com/p/pydbgr/'. - -If called interactively with no prefix argument, the mode is toggled. A prefix argument, captured as ARG, enables the mode if the argument is positive, and disables it otherwise. - -\\{pydbgr-track-mode-map} -" - :init-value nil - ;; :lighter " pydbgr" ;; mode-line indicator from realgud-track is sufficient. - ;; The minor mode bindings. - :global nil - :group 'realgud:pydbgr - :keymap pydbgr-track-mode-map - (realgud:track-set-debugger "pydbgr") - (if pydbgr-track-mode - (progn - (realgud-track-mode-setup 't) - (pydbgr-track-mode-hook)) - (progn - (setq realgud-track-mode nil) - )) -) - -(provide-me "realgud-pydbgr-") diff --git a/packages/realgud/realgud/debugger/rdebug/Makefile.am b/packages/realgud/realgud/debugger/rdebug/Makefile.am deleted file mode 100644 index 23f8a8fa2..000000000 --- a/packages/realgud/realgud/debugger/rdebug/Makefile.am +++ /dev/null @@ -1 +0,0 @@ -include ../common.mk diff --git a/packages/realgud/realgud/debugger/rdebug/core.el b/packages/realgud/realgud/debugger/rdebug/core.el deleted file mode 100644 index 6612a7d69..000000000 --- a/packages/realgud/realgud/debugger/rdebug/core.el +++ /dev/null @@ -1,165 +0,0 @@ -;;; Copyright (C) 2010, 2015 Rocky Bernstein -(eval-when-compile (require 'cl)) - -(require 'load-relative) -(require-relative-list '("../../common/track" - "../../common/core" - "../../common/lang") - "realgud-") -(require-relative-list '("init") "realgud-rdebug-") - -(declare-function realgud-lang-mode? 'realgud-lang) -(declare-function realgud-parse-command-arg 'realgud-core) -(declare-function realgud-query-cmdline 'realgud-core) -(declare-function realgud-suggest-invocation 'realgud-core) - -;; FIXME: I think the following could be generalized and moved to -;; realgud-... probably via a macro. -(defvar realgud:rdebug-minibuffer-history nil - "minibuffer history list for the command `rdebug'.") - -(easy-mmode-defmap rdebug-minibuffer-local-map - '(("\C-i" . comint-dynamic-complete-filename)) - "Keymap for minibuffer prompting of gud startup command." - :inherit minibuffer-local-map) - -;; FIXME: I think this code and the keymaps and history -;; variable chould be generalized, perhaps via a macro. -(defun rdebug-query-cmdline (&optional opt-debugger) - (realgud-query-cmdline - 'rdebug-suggest-invocation - rdebug-minibuffer-local-map - 'realgud:rdebug-minibuffer-history - opt-debugger)) - -(defun rdebug-parse-cmd-args (orig-args) - "Parse command line ARGS for the annotate level and name of script to debug. - -ARGS should contain a tokenized list of the command line to run. - -We return the a list containing -- the command processor (e.g. ruby) and it's arguments if any - a list of strings -- the name of the debugger given (e.g. rdebug) and its arguments - a list of strings -- the script name and its arguments - list of strings -- whether the annotate or emacs option was given ('-A', '--annotate' or '--emacs) - a boolean - -For example for the following input - (map 'list 'symbol-name - '(ruby1.9 -W -C /tmp rdebug --emacs ./gcd.rb a b)) - -we might return: - ((ruby1.9 -W -C) (rdebug --emacs) (./gcd.rb a b) 't) - -NOTE: the above should have each item listed in quotes. -" - - ;; Parse the following kind of pattern: - ;; [ruby ruby-options] rdebug rdebug-options script-name script-options - (let ( - (args orig-args) - (pair) ;; temp return from - (ruby-opt-two-args '("0" "C" "e" "E" "F" "i")) - ;; Ruby doesn't have mandatory 2-arg options in our sense, - ;; since the two args can be run together, e.g. "-C/tmp" or "-C /tmp" - ;; - (ruby-two-args '()) - ;; One dash is added automatically to the below, so - ;; h is really -h and -host is really --host. - (rdebug-two-args '("h" "-host" "p" "-port" - "I" "-include" "-r" "-require")) - (rdebug-opt-two-args '()) - - ;; Things returned - (script-name nil) - (debugger-name nil) - (interpreter-args '()) - (debugger-args '()) - (script-args '()) - (annotate-p nil)) - - (if (not (and args)) - ;; Got nothing: return '(nil, nil) - (list interpreter-args debugger-args script-args annotate-p) - ;; else - ;; Strip off optional "ruby" or "ruby182" etc. - (when (string-match "^ruby[-0-9]*$" - (file-name-sans-extension - (file-name-nondirectory (car args)))) - (setq interpreter-args (list (pop args))) - - ;; Strip off Ruby-specific options - (while (and args - (string-match "^-" (car args))) - (setq pair (realgud-parse-command-arg - args ruby-two-args ruby-opt-two-args)) - (nconc interpreter-args (car pair)) - (setq args (cadr pair)))) - - ;; Remove "rdebug" from "rdebug --rdebug-options script - ;; --script-options" - (setq debugger-name (file-name-sans-extension - (file-name-nondirectory (car args)))) - (unless (string-match "^rdebug$" debugger-name) - (message - "Expecting debugger name `%s' to be `rdebug'" - debugger-name)) - (setq debugger-args (list (pop args))) - - ;; Skip to the first non-option argument. - (while (and args (not script-name)) - (let ((arg (car args))) - (cond - ;; Annotation or emacs option with level number. - ((or (member arg '("--annotate" "-A")) - (equal arg "--emacs")) - (setq annotate-p t) - (nconc debugger-args (list (pop args)))) - ;; Combined annotation and level option. - ((string-match "^--annotate=[0-9]" arg) - (nconc debugger-args (list (pop args)) ) - (setq annotate-p t)) - ;; Options with arguments. - ((string-match "^-" arg) - (setq pair (realgud-parse-command-arg - args rdebug-two-args rdebug-opt-two-args)) - (nconc debugger-args (car pair)) - (setq args (cadr pair))) - ;; Anything else must be the script to debug. - (t (setq script-name arg) - (setq script-args args)) - ))) - (list interpreter-args debugger-args script-args annotate-p)))) - -(defvar realgud:rdebug-command-name) -(defun rdebug-suggest-invocation (debugger-name) - "Suggest a rdebug command invocation via `realgud-suggest-invocaton'" - (realgud-suggest-invocation realgud:rdebug-command-name - realgud:rdebug-minibuffer-history - "ruby" "\\.rb$" - realgud:rdebug-command-name)) - -(defun rdebug-reset () - "Rdebug cleanup - remove debugger's internal buffers (frame, -breakpoints, etc.)." - (interactive) - ;; (rdebug-breakpoint-remove-all-icons) - (dolist (buffer (buffer-list)) - (when (string-match "\\*rdebug-[a-z]+\\*" (buffer-name buffer)) - (let ((w (get-buffer-window buffer))) - (when w - (delete-window w))) - (kill-buffer buffer)))) - -;; (defun rdebug-reset-keymaps() -;; "This unbinds the special debugger keys of the source buffers." -;; (interactive) -;; (setcdr (assq 'rdebug-debugger-support-minor-mode minor-mode-map-alist) -;; rdebug-debugger-support-minor-mode-map-when-deactive)) - - -(defun realgud:rdebug-customize () - "Use `customize' to edit the settings of the `rdebug' debugger." - (interactive) - (customize-group 'realgud:rdebug)) - -(provide-me "realgud-rdebug-") diff --git a/packages/realgud/realgud/debugger/rdebug/init.el b/packages/realgud/realgud/debugger/rdebug/init.el deleted file mode 100644 index 3f0021f60..000000000 --- a/packages/realgud/realgud/debugger/rdebug/init.el +++ /dev/null @@ -1,135 +0,0 @@ -;;; Copyright (C) 2010, 2011 Rocky Bernstein -;;; Ruby 1.8 debugger: ruby-debug (rdebug) - -(eval-when-compile (require 'cl)) - -(require 'load-relative) -(require-relative-list '("../../common/regexp" "../../common/loc") "realgud-") -(require-relative-list '("../../lang/ruby") "realgud-lang-") - -(defvar realgud-pat-hash) -(declare-function make-realgud-loc-pat (realgud-loc)) - -(defvar realgud-rdebug-pat-hash (make-hash-table :test 'equal) - "Hash key is the what kind of pattern we want to match: -backtrace, prompt, etc. The values of a hash entry is a -realgud-loc-pat struct") - -;; Regular expression that describes a rdebug location generally shown -;; before a command prompt. -;; For example: -;; /usr/lib/ruby/1.8/rubygems/custom_require.rb:31 # in Emacs -;; /usr/bin/irb:12 -(setf (gethash "loc" realgud-rdebug-pat-hash) - (make-realgud-loc-pat - :regexp "\\(?:source \\)?\\(\\(?:[a-zA-Z]:\\)?\\(?:.+\\)\\):\\([0-9]+\\).*\\(?:\n\\|$\\)" - :file-group 1 - :line-group 2 - :ignore-file-re "(eval)" - )) - -;; Regular expression that describes a rdebug command prompt -;; For example: -;; (rdb:1) -(setf (gethash "prompt" realgud-rdebug-pat-hash) - (make-realgud-loc-pat - :regexp "^(rdb:[0-9]+) " - )) - -;; Regular expression that describes a Ruby backtrace line. -(setf (gethash "lang-backtrace" realgud-rdebug-pat-hash) - realgud-ruby-backtrace-loc-pat) - -;; Regular expression that describes a ruby $! backtrace -(setf (gethash "dollar-bang-backtrace" realgud-rdebug-pat-hash) - realgud-ruby-dollar-bang-loc-pat) - -;; Regular expression that describes a rdebug "breakpoint set" line -;; For example: -;; Breakpoint 1 file /test/gcd.rb, line 6 -;; -----------^------^^^^^^^^^^^^-------^ -(setf (gethash "brkpt-set" realgud-rdebug-pat-hash) - (make-realgud-loc-pat - :regexp "^Breakpoint \\([0-9]+\\) file \\(.+\\), line \\([0-9]+\\)\n" - :num 1 - :file-group 2 - :line-group 3)) - -(defconst realgud-rdebug-frame-file-line-regexp - "[ \t\n]+at line \\(.*\\):\\([0-9]+\\)$") - -(defconst realgud-rdebug-frame-start-regexp realgud:trepan-frame-start-regexp) -(defconst realgud-rdebug-frame-num-regexp realgud:trepan-frame-num-regexp) - -;; Regular expression that describes a Ruby $! string -(setf (gethash "dollar-bang" realgud-rdebug-pat-hash) - realgud-ruby-dollar-bang-loc-pat) - -;; Regular expression that describes a Ruby $! string -(setf (gethash "rails-backtrace" realgud-rdebug-pat-hash) - realgud-rails-backtrace-loc-pat) - -;; Regular expression that describes a debugger "backtrace" command line. -;; e.g. -;; --> #0 at line /usr/bin/irb:12 -;; #1 main.__script__ at /tmp/fact.rb:1 -;; #1 main.__script__ at /tmp/fact.rb:1 -;; #0 IRB.start(ap_path#String) at line /usr/lib/ruby/1.8/irb.rb:52 -(setf (gethash "debugger-backtrace" realgud-rdebug-pat-hash) - (make-realgud-loc-pat - :regexp (concat realgud-rdebug-frame-start-regexp " " - realgud-rdebug-frame-num-regexp - "\\(?: \\(?:\\(.+\\)(\\(.*\\))\\)\\)?" - realgud-rdebug-frame-file-line-regexp - ) - :num 2 - :file-group 5 - :line-group 6) - ) - -(setf (gethash "font-lock-keywords" realgud-rdebug-pat-hash) - '( - ;; Parameters and first type entry. E.g Object.gcd(a#Fixnum, b#Fixnum) - ;; ^-^^^^^^ ^-^^^^^^ - ("\\<\\([a-zA-Z_][a-zA-Z0-9_]*\\)#\\([a-zA-Z_][a-zA-Z0-9_]*\\)\\>" - (1 font-lock-variable-name-face) - (2 font-lock-constant-face)) - - ;; "::Type", which occurs in class name of function and in - ;; parameter list. - ("::\\([a-zA-Z_][a-zA-Z0-9_]*\\)" - (1 font-lock-type-face)) - - ;; The frame number and first type name, if present. - ;; E.g. --> #0 Object.gcd(a#Fixnum, b#Fixnum) - ;; -----^-^^^^^^.^^^ - ("^\\(-->\\)? *#\\([0-9]+\\) *\\(\\([a-zA-Z_][a-zA-Z0-9_]*\\)[.:]\\)?" - (2 realgud-backtrace-number-face) - (4 font-lock-constant-face nil t)) ; t means optional. - - ;; File name and line number. E.g. at line /test/gcd.rb:6 - ;; -------^^^^^^^^^^^^^-^ - ("at line \\(.*\\):\\([0-9]+\\)$" - (1 realgud-file-name-face) - (2 realgud-line-number-face)) - - ;; Function name. - ("\\<\\([a-zA-Z_][a-zA-Z0-9_]*\\)\\.\\([a-zA-Z_][a-zA-Z0-9_]*\\)" - (1 font-lock-type-face) - (2 font-lock-function-name-face)) - ;; (rdebug-frames-match-current-line - ;; (0 rdebug-frames-current-frame-face append)) - )) - - -(setf (gethash "rdebug" realgud-pat-hash) realgud-rdebug-pat-hash) - -(defvar realgud-rdebug-command-hash (make-hash-table :test 'equal) - "Hash key is command name like 'quit' and the value is - the trepanx command to use, like 'quit!'") - -(setf (gethash "quit" realgud-rdebug-command-hash) "quit!") -(setf (gethash "shell" realgud-rdebug-command-hash) "irb") -(setf (gethash "rdebug" realgud-command-hash) realgud-rdebug-command-hash) - -(provide-me "realgud-rdebug-") diff --git a/packages/realgud/realgud/debugger/rdebug/rdebug.el b/packages/realgud/realgud/debugger/rdebug/rdebug.el deleted file mode 100644 index 3a19fd662..000000000 --- a/packages/realgud/realgud/debugger/rdebug/rdebug.el +++ /dev/null @@ -1,115 +0,0 @@ -;;; Copyright (C) 2010-2011, 2014-2015 Rocky Bernstein -;; `rdebug' Main interface to rdebug via Emacs -(require 'load-relative) -(require-relative-list '("../../common/helper" - "../../common/track") "realgud-") -(require-relative-list '("core" "track-mode") "realgud-rdebug-") -;; This is needed, or at least the docstring part of it is needed to -;; get the customization menu to work in Emacs 24. -(defgroup realgud:rdebug nil - "The realgud interface to the Ruby debugger, rdebug" - :group 'realgud - :version "24.1") - -(declare-function rdebug-query-cmdline 'realgud-rdebug-core) -(declare-function rdebug-parse-cmd-args 'realgud-rdebug-core) -(declare-function realgud:run-debugger 'realgud:run) - -;; ------------------------------------------------------------------- -;; User definable variables -;; - -(defcustom realgud:rdebug-command-name - ;;"rdebug --emacs 3" - "rdebug" - "File name for executing the Ruby debugger and command options. -This should be an executable on your path, or an absolute file name." - :type 'string - :group 'realgud:rdebug) - -(declare-function rdebug-track-mode (bool)) - -;; ------------------------------------------------------------------- -;; The end. -;; - -(defun rdebug-get-script-name (args) - "Parse command line ARGS. - -ARGS is a list of strings containing the rdebug command name. We -return a list containing the script name, and whether the -annotate option was set is returned. - -Initially annotate should be set to nil. Argument ARGS contains -a tokenized list of the command line." - ;; Parse the following: - ;; - ;; [ruby ruby-options] rdebug rdebug-options script-name script-options - (and args - (let ((name nil) - (annotate-p nil)) - ;; Strip of optional "ruby" or "ruby182" etc. - (when (string-match "^ruby[0-9]*$" - (file-name-sans-extension - (file-name-nondirectory (car args)))) - (pop args) - (while (and args - (string-match "^-" (car args))) - (if (member (car args) '("-e" "-r" "-I" "-C" "-F" "-K")) - (pop args)) - (pop args))) - ;; Remove "rdebug" from "rdebug --rdebug-options script - ;; --script-options" - (pop args) - ;; Skip to the first non-option argument. - (while (and args - (not name)) - (let ((arg (pop args))) - (cond - ;; Annotation or emacs option with level number. - ((or (member arg '("--annotate" "-A")) - (equal arg "--emacs")) - (setq annotate-p t) - (pop args)) - ;; Combined annotation and level option. - ((string-match "^--annotate=[0-9]" arg) - (setq annotate-p t)) - ;; Options with arguments. - ((member arg '("-h" "--host" "-p" "--port" - "-I" "--include" "-r" "--require")) - (pop args)) - ((string-match "^-" arg) - nil) - (t - (setq name arg))))) - (and name - (list name annotate-p))))) - - -;;;###autoload -(defun realgud:rdebug (&optional opt-cmd-line no-reset) - "Invoke the rdebug Ruby debugger and start the Emacs user interface. - -String OPT-CMD-LINE is treated like a shell string; arguments are -tokenized by `split-string-and-unquote'. The tokenized string is -parsed by `trepan8-parse-cmd-args' and path elements found by that -are expanded using `realgud:expand-file-name-if-exists'. - -Normally, command buffers are reused when the same debugger is -reinvoked inside a command buffer with a similar command. If we -discover that the buffer has prior command-buffer information and -NO-RESET is nil, then that information which may point into other -buffers and source buffers which may contain marks and fringe or -marginal icons is reset. See `loc-changes-clear-buffer' to clear -fringe and marginal icons. -" - (interactive) - (realgud:run-debugger "rdebug" 'rdebug-query-cmdline - 'rdebug-parse-cmd-args - 'realgud:rdebug-minibuffer-history - opt-cmd-line no-reset) - ) - - -(defalias 'rdebug 'realgud:rdebug) -(provide-me "realgud-") diff --git a/packages/realgud/realgud/debugger/rdebug/track-mode.el b/packages/realgud/realgud/debugger/rdebug/track-mode.el deleted file mode 100644 index 61afa3ff0..000000000 --- a/packages/realgud/realgud/debugger/rdebug/track-mode.el +++ /dev/null @@ -1,63 +0,0 @@ -;;; Copyright (C) 2010, 2012, 2015 Rocky Bernstein -;;; Ruby "rdebug" Debugger tracking a comint or eshell buffer. - -(eval-when-compile (require 'cl)) -(require 'load-relative) -(require-relative-list '( - "../../common/cmds" - "../../common/menu" - "../../common/track" - "../../common/track-mode" - ) - "realgud-") -(require-relative-list '("core" "init") "realgud-rdebug-") -(require-relative-list '("../../lang/ruby") "realgud-lang-") - -(realgud-track-mode-vars "rdebug") - -(declare-function realgud:ruby-populate-command-keys 'realgud-track-lang-ruby) -(declare-function realgud-track-mode 'realgud-track-mode) -(declare-function realgud-track-mode-hook 'realgud-track-mode) -(declare-function realgud-track-mode-setup 'realgud-track-mode) -(declare-function realgud:track-set-debugger 'realgud-track-mode) - -(realgud:ruby-populate-command-keys rdebug-track-mode-map) - -(defun rdebug-track-mode-hook() - (if rdebug-track-mode - (progn - (use-local-map rdebug-track-mode-map) - (message "using rdebug mode map") - ) - (message "rdebug track-mode-hook disable called")) -) - -(define-minor-mode rdebug-track-mode - "Minor mode for tracking rdebug source locations inside a process shell via realgud. rdebug is a Ruby debugger. - -If called interactively with no prefix argument, the mode is toggled. A prefix argument, captured as ARG, enables the mode if the argument is positive, and disables it otherwise. - -\\{rdebug-track-mode-map} -" - :init-value nil - ;; :lighter " rdebug" ;; mode-line indicator from realgud-track is sufficient. - ;; The minor mode bindings. - :global nil - :group 'realgud:rdebug - :keymap rdebug-track-mode-map - (rdebug-track-mode-internal rdebug-track-mode) -) - -;; Broken out as a function for debugging -(defun rdebug-track-mode-internal (&optional arg) - (realgud:track-set-debugger "rdebug") - (if rdebug-track-mode - (progn - (realgud-track-mode-setup 't) - (rdebug-track-mode-hook)) - (progn - (setq realgud-track-mode nil) - )) -) - -(provide-me "realgud-rdebug-") diff --git a/packages/realgud/realgud/debugger/remake/Makefile.am b/packages/realgud/realgud/debugger/remake/Makefile.am deleted file mode 100644 index 23f8a8fa2..000000000 --- a/packages/realgud/realgud/debugger/remake/Makefile.am +++ /dev/null @@ -1 +0,0 @@ -include ../common.mk diff --git a/packages/realgud/realgud/debugger/remake/core.el b/packages/realgud/realgud/debugger/remake/core.el deleted file mode 100644 index a75572671..000000000 --- a/packages/realgud/realgud/debugger/remake/core.el +++ /dev/null @@ -1,253 +0,0 @@ -;;; Copyright (C) 2011, 2014-2015 Rocky Bernstein -(eval-when-compile (require 'cl)) - -(require 'load-relative) -(require-relative-list '("../../common/track" "../../common/core" "../../common/lang") - "realgud-") -(require-relative-list '("../../common/buffer/command") - "realgud-buffer-") -(require-relative-list '("init") "realgud:remake-") - -(declare-function realgud:expand-file-name-if-exists 'realgud-core) -(declare-function realgud-parse-command-arg 'realgud-core) -(declare-function realgud-query-cmdline 'realgud-core) -(declare-function realgud-suggest-invocation 'realgud-core) -(declare-function realgud-lang-mode? 'realgud-lang) -(declare-function realgud-cmdbuf-command-string - 'realgud-buffer-command) -(declare-function realgud-cmdbuf-debugger-name - 'realgud-buffer-command) -;; FIXME: I think the following could be generalized and moved to -;; realgud-... probably via a macro. -(defvar realgud:remake-minibuffer-history nil - "minibuffer history list for the command `remake'.") - -(easy-mmode-defmap remake-minibuffer-local-map - '(("\C-i" . comint-dynamic-complete-filename)) - "Keymap for minibuffer prompting of gud startup command." - :inherit minibuffer-local-map) - -;; FIXME: I think this code and the keymaps and history -;; variable chould be generalized, perhaps via a macro. -(defun remake-query-cmdline (&optional opt-debugger) - (realgud-query-cmdline - 'remake-suggest-invocation - remake-minibuffer-local-map - 'realgud:remake-minibuffer-history - opt-debugger)) - -(defun remake-parse-cmd-args (orig-args) - "Parse command line ARGS for the annotate level and name of script to debug. - -ARGS should contain a tokenized list of the command line to run. - -We return the a list containing - -- the command processor (e.g. make) -- the Makefile name -- command args (which includes the makefile name) - -For example for the following input - '(\"remake\" \"-x\" \"/tmp/Makefile\") - -we might return: - (\"remake\" \"/tmp/Makefile\" (\"-x\" \"/tmp/Makefile\")) - -" - - (let ( - (args orig-args) - (interp-regexp - (if (member system-type (list 'windows-nt 'cygwin 'msdos)) - "^\\(re\\)?make*\\(.exe\\)?$" - "^\\(re\\)?make*$")) - - ;; Things returned - (remake-name nil) - (makefile-name nil) - (remake-args '()) - ) - - (if (not (and args)) - ;; Got nothing - (list remake-name makefile-name remake-args) - ;; else - ;; Strip off "make" or "remake" etc. - (when (string-match interp-regexp - (file-name-sans-extension - (file-name-nondirectory (car args)))) - (setq remake-name (pop args)) - ) - - ;; parse options - (while args - (let ((arg (pop args))) - (cond - ;; ;; Annotation or emacs option with level number. - ;; ((or (member arg '("--annotate" "-A")) - ;; (equal arg "--emacs")) - ;; (setq annotate-p t) - ;; (nconc debugger-args (list (pop args)))) - ;; ;; Combined annotation and level option. - ;; ((string-match "^--annotate=[0-9]" arg) - ;; (nconc debugger-args (list (pop args)) ) - ;; (setq annotate-p t)) - - ((member arg '("--file" "--makefile" "-f")) - (setq remake-args (nconc remake-args (list arg))) - (setq makefile-name (realgud:expand-file-name-if-exists - (pop args))) - (setq remake-args (nconc remake-args - (list (format "%s" makefile-name))))) - - ;; Anything else add to remake-args - ('t (setq remake-args (nconc remake-args (list arg)))) - ))) - (list remake-name makefile-name remake-args)))) - -(defconst realgud:remake-auto-suffix-regexp - "\\.\\(am\\|in\\)$" - "Common automake and autoconf Makefile suffixes" -) - -(defconst realgud:remake-makefile-regexp - "\\(^[Mm]akefile$\\|\\.Makefile$\\|\\.mk\\)$" - "Regular expression matching common Makefile names" -) - -(defun remake-suggest-file-priority(filename) - (let ((priority 2) - (is-not-directory) - ) - (if (realgud-lang-mode? filename "makefile") - (progn - (if (string-match realgud:remake-makefile-regexp filename) - (setq priority 8) - (if (string-match realgud:remake-auto-suffix-regexp filename) - (setq priority 5) - (setq priority 7))) - )) - ;; The file isn't in a makefile-mode buffer, - ;; Check for an executable file with a .mk extension. - (if (setq is-not-directory (not (file-directory-p filename))) - (if (and (string-match realgud:remake-makefile-regexp filename)) - (if (< priority 6) - (progn - (setq priority 6))))) - priority - ) -) - -(defun remake-suggest-Makefile () - "Suggest a Makefile to debug. - -The first priority is given to the current buffer. If the major -mode matches GNUMakefile and doesn't end in .am or .in, then we -are done. If not, we'll set priority 2 (a low or easily -overridden priority) and we keep going. Then we will try files -in the default-directory. Of those that we are visiting we check -the major mode. There are demerits for a file ending in .in or -.am which are used by 'configure' and 'automake' respectively. - -If the current buffer isn't a success, we see if the file matches -REGEXP. These have priority 9, 8 or 7 depending on whether there -is a .in or .am sufifx and there is a REGEXP match'. Within a -given priority, we use the first one we find." - (let* ((file) - (file-list (directory-files default-directory)) - (priority 2) - (is-not-directory) - (result (buffer-file-name))) - (if (not (realgud-lang-mode? result "makefile")) - (progn - (while (and (setq file (car-safe file-list)) (< priority 8)) - (setq file-list (cdr file-list)) - (let ((try-priority (remake-suggest-file-priority file))) - (if (> try-priority priority) - (progn - (setq priority try-priority) - (setq result file))) - )) - )) - result) - ) - -;; To silence Warning: reference to free variable -(defvar realgud:remake-command-name) - -;; Note opt-debugger is not used. It has to be there because -;; realgud-suggest-invocation passes an argument. -(defun remake-suggest-invocation (&optional opt-debugger) - "Suggest a remake command invocation via `realgud-suggest-invocaton'" - - (let* ((buf (current-buffer)) - (debugger-name realgud:remake-command-name) - (cmd-str-cmdbuf (realgud-cmdbuf-command-string buf)) - ) - (cond - ((and cmd-str-cmdbuf (equal debugger-name (realgud-cmdbuf-debugger-name buf))) - cmd-str-cmdbuf) - ((and minibuffer-history (listp minibuffer-history)) - (car minibuffer-history)) - (t (concat debugger-name " --debugger -f " - (remake-suggest-Makefile))) - ))) - -;; Convert a command line as would be typed normally to run a script -;; into one that invokes an Emacs-enabled debugging session. -;; "--debugger" in inserted as the first switch. - -(defun realgud:remake-massage-args (command-line) - (let* ((new-args (list "--debugger")) - (args (split-string-and-unquote command-line)) - (program (car args)) - (seen-e nil) - (shift (lambda () - (setq new-args (cons (car args) new-args)) - (setq args (cdr args))))) - - ;; Pass all switches and -e scripts through. - (while (and args - (string-match "^-" (car args)) - (not (equal "-" (car args))) - (not (equal "--" (car args)))) - (funcall shift)) - - (if (or (not args) - (string-match "^-" (car args))) - (error "Can't use stdin as the script to debug")) - ;; This is the program name. - (funcall shift) - - (while args - (funcall shift)) - - (nreverse new-args) - ) - ) - -(defun remake-reset () - "Remake cleanup - remove debugger's internal buffers (frame, -breakpoints, etc.)." - (interactive) - ;; (remake-breakpoint-remove-all-icons) - (dolist (buffer (buffer-list)) - (when (string-match "\\*remake-[a-z]+\\*" (buffer-name buffer)) - (let ((w (get-buffer-window buffer))) - (when w - (delete-window w))) - (kill-buffer buffer)))) - -;; (defun remake-reset-keymaps() -;; "This unbinds the special debugger keys of the source buffers." -;; (interactive) -;; (setcdr (assq 'remake-debugger-support-minor-mode minor-mode-map-alist) -;; remake-debugger-support-minor-mode-map-when-deactive)) - - -(defun realgud:remake-customize () - "Use `customize' to edit the settings of the `remake' debugger." - (interactive) - (customize-group 'realgud:remake)) - -(provide-me "realgud:remake-") diff --git a/packages/realgud/realgud/debugger/remake/init.el b/packages/realgud/realgud/debugger/remake/init.el deleted file mode 100644 index d2888c183..000000000 --- a/packages/realgud/realgud/debugger/remake/init.el +++ /dev/null @@ -1,135 +0,0 @@ -;;; Copyright (C) 2011, 2014 Rocky Bernstein -;;; Regular expressions for GNU Make debugger: remake - -(eval-when-compile (require 'cl)) - -(require 'load-relative) -(require-relative-list '("../../common/regexp" - "../../common/loc" - "../../common/init") - "realgud-") - -(defvar realgud-pat-hash) -(declare-function make-realgud-loc-pat (realgud-loc)) - -(defvar realgud:remake-pat-hash (make-hash-table :test 'equal) - "Hash key is the what kind of pattern we want to match: -backtrace, prompt, etc. The values of a hash entry is a -realgud-loc-pat struct") - -;; Regular expression that describes a remake location generally shown -;; before a command prompt. -;; For example: -;; -- (emacs-dbgr/realgud/debugger/Makefile:168) -(setf (gethash "loc" realgud:remake-pat-hash) - (make-realgud-loc-pat - :regexp "\\(?:^\\|\n\\)\\(?:.. \\)?(\\(\\(?:[a-zA-Z]:\\)?[-a-zA-Z0-9_/.\\\\ ]+\\):\\([0-9]+\\))\\(?:\n\\(.*?\\)\n\\)?" - :file-group 1 - :line-group 2 - :text-group 3)) - -;; For example: -;; remake<10> -;; remake<<1>> -(setf (gethash "prompt" realgud:remake-pat-hash) - (make-realgud-loc-pat - :regexp "^remake[<]+\\([0-9]+\\)[>]+ " - :num 1 - )) - -;; Regular expression that describes a "breakpoint set" line -(setf (gethash "brkpt-set" realgud:remake-pat-hash) - (make-realgud-loc-pat - :regexp "^Breakpoint \\([0-9]+\\) on target \\([^:]*\\): file \\(.+\\), line \\([0-9]+\\).\n" - :num 1 - :file-group 3 - :line-group 4)) - -;; Regular expression that describes a debugger "delete" (breakpoint) response. -;; For example: -;; Removed 1 breakpoint(s). -(setf (gethash "brkpt-del" realgud:remake-pat-hash) - (make-realgud-loc-pat - :regexp "^Breakpoint \\([0-9]+\\) on target .* cleared\n" - :num 1)) - -(defconst realgud:remake-selected-frame-arrow "=>" -"String that describes which frame is selected in a debugger -backtrace listing.") -(defconst realgud:remake-frame-arrow (format "\\(%s\\| \\)" - realgud:remake-selected-frame-arrow)) -(defconst realgud:remake-frame-num-regexp - "#\\([0-9]+\\) ") - -(defconst realgud:remake-frame-file-regexp " at \\(.*\\):\\([0-9]+\\)") - -;; Regular expression that describes a remake "backtrace" command line. -;; For example: -;; #0 Makefile.in at /tmp/Makefile:216 -;; #1 Makefile at /tmp/Makefile:230 -(setf (gethash "lang-backtrace" realgud:remake-pat-hash) - (make-realgud-loc-pat - :regexp (concat "^" - realgud:remake-frame-num-regexp - "\\(.*\\)" - realgud:remake-frame-file-regexp - ) - :num 1 - :file-group 3 - :line-group 4) - ) - -;; Regular expression that describes a debugger "backtrace" command line. -;; For example: -;; =>#0 Makefile.in at /tmp/Makefile:216 -;; #1 Makefile at /tmp/Makefile:230 -(setf (gethash "debugger-backtrace" realgud:remake-pat-hash) - (make-realgud-loc-pat - :regexp (concat "^" - realgud:remake-frame-arrow - realgud:remake-frame-num-regexp - "\\(.*\\)" - realgud:remake-frame-file-regexp - ) - :num 2 - :file-group 4 - :line-group 5) - ) - -;; Regular expression that describes which frame is selected in -;; a debugger backtrace listing. -(setf (gethash "selected-frame-indicator" realgud:remake-pat-hash) - realgud:remake-selected-frame-arrow) - -;; Regular expression for a termination message. -(setf (gethash "termination" realgud:remake-pat-hash) - "^remake: That's all, folks...\n") - -(setf (gethash "font-lock-keywords" realgud:remake-pat-hash) - '( - ;; ;; File name and line number - ;; ;; E.g. =>#0 Makefile.in at /tmp/Makefile:216 - ;; ;; ----^^^^^^^^^^^^^^^^^ - (" at \\(.*\\):\\([0-9]+\\)" - (1 realgud-file-name-face) - (2 realgud-line-number-face)) - - ;; The frame number and first type name, if present. - ;; E.g. =>#0 Makefile.in at /tmp/Makefile:216 - ;; ---^ - ("#\\([0-9]+\\) " - (1 realgud-backtrace-number-face)) - )) - -(setf (gethash "remake" realgud-pat-hash) realgud:remake-pat-hash) - -(defvar realgud:remake-command-hash (make-hash-table :test 'equal) - "Hash key is command name like 'quit' and the value is - the remake command to use, like 'q'") - -(setf (gethash "break" realgud:remake-command-hash) "break %l") -(setf (gethash "eval" realgud:remake-command-hash) "expand %s") -(setf (gethash "remake" realgud-command-hash) realgud:remake-command-hash) - - -(provide-me "realgud:remake-") diff --git a/packages/realgud/realgud/debugger/remake/remake.el b/packages/realgud/realgud/debugger/remake/remake.el deleted file mode 100644 index bfb49acfc..000000000 --- a/packages/realgud/realgud/debugger/remake/remake.el +++ /dev/null @@ -1,71 +0,0 @@ -;;; Copyright (C) 2011, 2013-2015 Rocky Bernstein -;; `remake' Main interface to remake via Emacs -(require 'load-relative) -(require-relative-list '("../../common/helper") "realgud-") -(require-relative-list '("../../common/track") "realgud-") -(require-relative-list '("../../common/run") "realgud:") -(require-relative-list '("core" "track-mode") "realgud:remake-") -;; This is needed, or at least the docstring part of it is needed to -;; get the customization menu to work in Emacs 24. -(defgroup realgud:remake nil - "The realgud interface to the GNU Make debugger" - :group 'realgud - :group 'make - :version "24.1") - -(declare-function remake-query-cmdline 'realgud:remake-core) -(declare-function remake-parse-cmd-args 'realgud:remake-core) -(declare-function realgud:run-debugger 'realgud:run) -(declare-function realgud:run-process 'realgud:run) - -(defun realgud:remake-run-debugger (&optional opt-command-line - no-reset) - "Invoke the a debugger and start the Emacs user interface. - -String OPT-COMMAND-LINE specifies how to run DEBUGGER-NAME. You -will be prompted for a command line using QUERY-CMDLINE-FN is one -isn't supplied. - -OPT-COMMAND-LINE is treated like a shell string; arguments are -tokenized by `split-string-and-unquote'. The tokenized string is -parsed by PARSE-CMD-FN and path elements found by that -are expanded using `expand-file-name'. - -If successful, The command buffer of the debugger process is returned. -Otherwise nil is returned. -" - (let* ((cmd-str (or opt-command-line (remake-query-cmdline "remake"))) - (cmd-args (split-string-and-unquote cmd-str)) - (parsed-args (remake-parse-cmd-args cmd-args)) - (debugger (car parsed-args)) - (script-args (caddr parsed-args)) - (script-name (cadr parsed-args)) - ) - (realgud:run-process debugger script-name cmd-args - realgud:remake-minibuffer-history no-reset) - ) - ) - -;; ------------------------------------------------------------------- -;; User definable variables -;; - -(defcustom realgud:remake-command-name - ;;"remake --emacs 3" - "remake" - "File name for executing the GNU make debugger, remake, and command options. -This should be an executable on your path, or an absolute file name." - :type 'string - :group 'realgud:remake) - -;;;###autoload -(defun realgud:remake (&optional opt-cmd-line no-reset) - "See `realgud:remake' for details" - (interactive) - (realgud:remake-run-debugger opt-cmd-line no-reset) - ) - -(defalias 'remake 'realgud:remake) - -(provide-me "realgud-") -;;; remake.el ends here diff --git a/packages/realgud/realgud/debugger/remake/track-mode.el b/packages/realgud/realgud/debugger/remake/track-mode.el deleted file mode 100644 index b2b6b9788..000000000 --- a/packages/realgud/realgud/debugger/remake/track-mode.el +++ /dev/null @@ -1,63 +0,0 @@ -;;; Copyright (C) 2012, 2014-2015 Rocky Bernstein -;;; GNU Make Debugger tracking a comint buffer. - -(eval-when-compile (require 'cl)) -(require 'load-relative) -(require-relative-list '( - "../../common/cmds" - "../../common/menu" - "../../common/track" - "../../common/track-mode" - ) - "realgud-") -(require-relative-list '("core" "init") "realgud:remake-") - -(declare-function realgud:cmd-remap 'realgud-cmds) -(declare-function realgud:track-set-debugger 'realgud-track-mode) -(declare-function realgud-track-mode-setup 'realgud-track-mode) -(declare-function realgud:track-set-debugger 'realgud-track-mode) - -(realgud-track-mode-vars "remake") - -(define-key remake-track-mode-map - (kbd "C-c !!") 'realgud:goto-lang-backtrace-line) -(define-key remake-track-mode-map - (kbd "C-c !b") 'realgud:goto-debugger-backtrace-line) - -(defun remake-track-mode-hook() - (if remake-track-mode - (progn - (use-local-map remake-track-mode-map) - (message "using remake mode map") - ) - (message "remake track-mode-hook disable called")) -) - -(define-minor-mode remake-track-mode - "Minor mode for tracking remake source locations inside a process shell via realgud. remake is a GNU Make debugger. - -If called interactively with no prefix argument, the mode is toggled. A prefix argument, captured as ARG, enables the mode if the argument is positive, and disables it otherwise. - -\\{remake-track-mode-map} -" - "Minor mode for tracking ruby debugging inside a process shell." - :init-value nil - ;; :lighter " remake" ;; mode-line indicator from realgud-track is sufficient. - ;; The minor mode bindings. - :global nil - :group 'realgud:remake - :keymap remake-track-mode-map - - (realgud:track-set-debugger "remake") - (if remake-track-mode - (progn - (realgud-track-mode-setup 't) - (remake-track-mode-hook)) - (progn - (setq realgud-track-mode nil) - )) -) - -(define-key remake-short-key-mode-map "T" 'realgud:cmd-backtrace) - -(provide-me "realgud:remake-") diff --git a/packages/realgud/realgud/debugger/trepan.pl/Makefile.am b/packages/realgud/realgud/debugger/trepan.pl/Makefile.am deleted file mode 100644 index 9a343a513..000000000 --- a/packages/realgud/realgud/debugger/trepan.pl/Makefile.am +++ /dev/null @@ -1 +0,0 @@ -include $(srcdir)/../common.mk diff --git a/packages/realgud/realgud/debugger/trepan.pl/backtrack-mode.el b/packages/realgud/realgud/debugger/trepan.pl/backtrack-mode.el deleted file mode 100644 index 97dfff40e..000000000 --- a/packages/realgud/realgud/debugger/trepan.pl/backtrack-mode.el +++ /dev/null @@ -1,67 +0,0 @@ -;;; Copyright (C) 2011, 2014 Rocky Bernstein - -;;; Mode for parsing various kinds of backtraces found in Perl - -(eval-when-compile (require 'cl)) -(require 'load-relative) -(require-relative-list '( - "../../common/cmds" - "../../common/menu" - "../../common/track-mode" - "../../common/backtrack-mode" - ) - "realgud-") -(require-relative-list '("core" "init") "realgud:trepanpl-") -(require-relative-list '("../../lang/perl") "realgud-lang-") - -(declare-function realgud-goto-line-for-pt - 'realgud-track-mode) -(declare-function realgud-backtrack-set-debugger - 'realgud-common-backtrack-mode) -(declare-function realgud-perl-populate-command-keys - 'realgud-lang-perl) - -(realgud-backtrack-mode-vars "trepanpl") -(set-keymap-parent trepanpl-backtrack-mode-map realgud-backtrack-mode-map) - -(declare-function realgud-backtrack-mode(bool)) - -(defun realgud:trepanpl-goto-control-frame-line (pt) - "Display the location mentioned by a control-frame line -described by PT." - (interactive "d") - (realgud-goto-line-for-pt pt "control-frame")) - -(realgud-perl-populate-command-keys trepanpl-backtrack-mode-map) -(define-key trepanpl-backtrack-mode-map - (kbd "C-c !c") 'realgud:trepanpl-goto-control-frame-line) - -(define-minor-mode trepanpl-backtrack-mode - "Minor mode for tracking ruby debugging inside a file which may not have process shell." - :init-value nil - ;; :lighter " trepanpl" ;; mode-line indicator from realgud-track is sufficient. - ;; The minor mode bindings. - :global nil - :group 'realgud:trepanpl - :keymap trepanpl-backtrack-mode-map - - (realgud-backtrack-set-debugger "trepan.pl") - (if trepanpl-backtrack-mode - (progn - (realgud-backtrack-mode 't) - (run-mode-hooks (intern (trepanpl-backtrack-mode-hook)))) - (progn - (realgud-backtrack-mode nil) - )) -) - -(defun trepanpl-backtrack-mode-hook() - (if trepanpl-backtrack-mode - (progn - (use-local-map trepanpl-backtrack-mode-map) - (message "using trepanpl mode map") - ) - (message "trepan.pl backtrack-mode-hook disable called")) -) - -(provide-me "realgud:trepanpl-") diff --git a/packages/realgud/realgud/debugger/trepan.pl/core.el b/packages/realgud/realgud/debugger/trepan.pl/core.el deleted file mode 100644 index 1d3d18109..000000000 --- a/packages/realgud/realgud/debugger/trepan.pl/core.el +++ /dev/null @@ -1,168 +0,0 @@ -;;; Copyright (C) 2011-2012, 2014 Rocky Bernstein -(eval-when-compile (require 'cl)) - -(require 'load-relative) -(require-relative-list '("../../common/track" - "../../common/core" - "../../common/lang") - "realgud-") -(require-relative-list '("init") "realgud:trepanpl-") - -(declare-function realgud:expand-file-name-if-exists 'realgud-core) -(declare-function realgud-parse-command-arg 'realgud-core) -(declare-function realgud-query-cmdline 'realgud-core) -(declare-function realgud-suggest-invocation 'realgud-core) - -;; FIXME: I think the following could be generalized and moved to -;; realgud-... probably via a macro. -(defvar realgud:trepanpl-minibuffer-history nil - "minibuffer history list for the command `realgud:trepan.pl'.") - -(easy-mmode-defmap realgud:trepanpl-minibuffer-local-map - '(("\C-i" . comint-dynamic-complete-filename)) - "Keymap for minibuffer prompting of trepanpl startup command." - :inherit minibuffer-local-map) - -;; FIXME: I think this code and the keymaps and history -;; variable chould be generalized, perhaps via a macro. -(defun realgud:trepanpl-query-cmdline (&optional opt-debugger) - (realgud-query-cmdline - 'realgud:trepanpl-suggest-invocation - realgud:trepanpl-minibuffer-local-map - 'realgud:trepanpl-minibuffer-history - opt-debugger)) - -;;; FIXME: DRY this with other *-parse-cmd-args routines -(defun realgud:trepanpl-parse-cmd-args (orig-args) - "Parse command line ORIG-ARGS for the annotate level and name of script to debug. - -ORIG_ARGS should contain a tokenized list of the command line to run. - -We return the a list containing: -* the command processor (e.g. perl) and it's arguments if any - a list of strings -* the name of the debugger given (e.g. trepan.pl) and its arguments - a list of strings -* the script name and its arguments - list of strings - -For example for the following input: - (map 'list 'symbol-name - '(perl5.10 -w -I . trepan.pl --cd . ./gcd.pl a b)) - -we might return: - ((\"perl\" \"-w\" \"-I\" \"/tmp\") (\"trepan.pl\" \"cd\" \"/tmp\") (\"/tmp/gcd.pl\" \"a\" \"b\")) - -Note that the script name path has been expanded via `expand-file-name'. -" - - ;; Parse the following kind of pattern: - ;; [perl perl-options] trepanpl trepanpl-options script-name script-options - (let ( - (args orig-args) - (pair) ;; temp return from - (perl-opt-two-args '("0" "C" "D" "i" "I" "l" "m" "-module" "x")) - ;; Perl doesn't have mandatory 2-arg options in our sense, - ;; since the two args can be run together, e.g. "-C/tmp" or "-C /tmp" - ;; - (perl-two-args '()) - ;; One dash is added automatically to the below, so - ;; h is really -h and -host is really --host. - (trepanpl-two-args '("h" "-host" "p" "-port" - "I" "-include")) - (trepanpl-opt-two-args '()) - (interp-regexp - (if (member system-type (list 'windows-nt 'cygwin 'msdos)) - "^perl\\(?:5[0-9.]*\\)\\(.exe\\)?$" - "^perl\\(?:5[0-9.]*\\)?$")) - - ;; Things returned - (script-name nil) - (debugger-name nil) - (interpreter-args '()) - (debugger-args '()) - (script-args '()) - (annotate-p nil)) - - (if (not (and args)) - ;; Got nothing: return '(nil, nil) - (list interpreter-args debugger-args script-args annotate-p) - ;; else - ;; Strip off optional "perl" or "perl5.10.1" etc. - (when (string-match interp-regexp - (file-name-sans-extension - (file-name-nondirectory (car args)))) - (setq interpreter-args (list (pop args))) - - ;; Strip off optional "perl" or "perl5.10.1" etc. - (while (and args - (string-match "^-" (car args))) - (setq pair (realgud-parse-command-arg - args perl-two-args perl-opt-two-args)) - (nconc interpreter-args (car pair)) - (setq args (cadr pair)))) - - ;; Remove "trepan.pl" from "trepan.pl --trepan.pl-options script - ;; --script-options" - (setq debugger-name (file-name-nondirectory (car args))) - (unless (string-match "^trepan.pl$" debugger-name) - (message - "Expecting debugger name `%s' to be `trepan.pl'" - debugger-name)) - (setq debugger-args (list (pop args))) - - ;; Skip to the first non-option argument. - (while (and args (not script-name)) - (let ((arg (car args))) - (cond - ((member arg - '("--cmddir" "--batch" "--cd" "--include" "-I" "--module" "-M" - "-c" "--command")) - (setq arg (pop args)) - (nconc debugger-args - (list arg (expand-file-name (pop args))))) - ;; Other options with arguments. - ((string-match "^-" arg) - (setq pair (realgud-parse-command-arg - args trepanpl-two-args trepanpl-opt-two-args)) - (nconc debugger-args (car pair)) - (setq args (cadr pair))) - ;; Anything else must be the script to debug. - (t (setq script-name (realgud:expand-file-name-if-exists arg)) - (setq script-args (cons script-name (cdr args)))) - ))) - (list interpreter-args debugger-args script-args)) - )) - -; # To silence Warning: reference to free variable -(defvar realgud:trepanpl-command-name) - -(defun realgud:trepanpl-suggest-invocation (debugger-name) - "Suggest a trepanpl command invocation via `realgud-suggest-invocaton'" - (realgud-suggest-invocation realgud:trepanpl-command-name - realgud:trepanpl-minibuffer-history - "perl" "\\.pl$" "trepan.pl")) - -(defun realgud:trepanpl-reset () - "Trepanpl cleanup - remove debugger's internal buffers (frame, -breakpoints, etc.)." - (interactive) - ;; (trepanpl-breakpoint-remove-all-icons) - (dolist (buffer (buffer-list)) - (when (string-match "\\*trepanpl-[a-z]+\\*" (buffer-name buffer)) - (let ((w (get-buffer-window buffer))) - (when w - (delete-window w))) - (kill-buffer buffer)))) - -;; (defun trepanpl-reset-keymaps() -;; "This unbinds the special debugger keys of the source buffers." -;; (interactive) -;; (setcdr (assq 'trepanpl-debugger-support-minor-mode minor-mode-map-alist) -;; trepanpl-debugger-support-minor-mode-map-when-deactive)) - - -(defun realgud:trepanpl-customize () - "Use `customize' to edit the settings of the -`realgud:trepan.pl' debugger." - (interactive) - (customize-group 'realgud:trepanpl)) - -(provide-me "realgud:trepanpl-") diff --git a/packages/realgud/realgud/debugger/trepan.pl/init.el b/packages/realgud/realgud/debugger/trepan.pl/init.el deleted file mode 100644 index a00851e75..000000000 --- a/packages/realgud/realgud/debugger/trepan.pl/init.el +++ /dev/null @@ -1,219 +0,0 @@ -;;; Copyright (C) 2011-2012, 2014-2015 Rocky Bernstein -;;; Trepanning Perl debugger -(eval-when-compile (require 'cl)) - -(require 'load-relative) -(require-relative-list '("../../common/regexp" - "../../common/loc" - "../../common/init") - "realgud-") -(require-relative-list '("../../lang/perl") "realgud-lang-") - -(defvar realgud-pat-hash) -(declare-function make-realgud-loc-pat (realgud-loc)) - -(defvar realgud:trepanpl-pat-hash (make-hash-table :test 'equal) - "Hash key is the what kind of pattern we want to match: -backtrace, prompt, etc. The values of a hash entry is a -realgud-loc-pat struct") - -;; Regular expression that describes a trepan.pl location generally shown -;; before a command prompt. We include matching the source text so we -;; can save that. -;; -;; Program-location lines look like this: -;; -- File::Basename::(/usr/share/perl/5.14/File/Basename.pm:284 @0x8918b70) -;; my $dirname = dirname(__FILE__); -;; -;; or for an eval'd expression: -;; -- main::((eval 1189)[/tmp/test.pl:2] remapped /tmp/JLlH.pl:1 @0xadcbda0) -;; $x = 1 + 2; -;; -;; or at a function call without the Perl OpCode position or source text: -;; -> main::(example/gcd.pl:8) - -(setf (gethash "loc" realgud:trepanpl-pat-hash) - (make-realgud-loc-pat - :regexp ".. \\(?:.+::\\)?(\\(?:.+ \\(?:via\\|remapped\\) \\)?\\(.+\\):\\([0-9]+\\)\\(?: @0x[0-9a-f]+\\)?)\\(?:\n\\(.*?\\)\n\\)?" - :file-group 1 - :line-group 2 - :text-group 3 - :ignore-file-re realgud-perl-ignore-file-re) - ) - -;; Regular expression that describes a trepanpl command prompt -;; For example: -;; (trepanpl): -;; ((trepanpl)): -;; (trepanpl@main): -;; (trepanpl@55): -(setf (gethash "prompt" realgud:trepanpl-pat-hash) - (make-realgud-loc-pat - :regexp "^(+trepanpl\\(@[0-9]+\\|@main\\)?)+: " - )) - -(defconst realgud:trepanpl-frame-start-regexp - "\\(^\\|\n\\)\\(?:-->\\| \\) #") - -(defconst realgud:trepanpl-frame-num-regexp - "\\([0-9]+\\)") - -;; Regular expression that describes a Perl backtrace line. -;; For example: -;; --> #0 @ = File::Basename::fileparse('/usr/local/bin/trepan.pl') in -;; file `/usr/share/perl/5.18.2/File/Basename.pm' at line 107 -;; #1 @ = File::Basename::dirname('/usr/local/bin/trepan.pl') in -;; file `/usr/share/perl/5.18.2/File/Basename.pm' at line 294 -;; #2 file `/usr/local/bin/trepan.pl' at line 11 -(setf (gethash "debugger-backtrace" realgud:trepanpl-pat-hash) - (make-realgud-loc-pat - :regexp (concat - realgud:trepanpl-frame-start-regexp - realgud:trepanpl-frame-num-regexp - "\\(?: [$@] = .* in\\)?" - "[\n\t ]+?file `" - "\\(.*\\)' at line \\([0-9]+\\)") - :num 2 - :file-group 3 - :line-group 4 - :ignore-file-re realgud-perl-ignore-file-re) - ) - -;; Regular expression that describes location in a Perl errmsg -(setf (gethash "perl-errmsg" realgud:trepanpl-pat-hash) - realgud-perl-errmsg-loc-pat) - -;; Regular expression that describes a Perl Carp backtrace line. -;; at /tmp/foo.pl line 7 -;; main::__ANON__('Illegal division by zero at /tmp/foo.pl line 4.\x{a}') called at /tmp/foo.pl line 4 -;; main::foo(3) called at /tmp/foo.pl line 8 -(setf (gethash "lang-backtrace" realgud:trepanpl-pat-hash) - realgud-perl-carp-loc-pat) - -;; Regular expression that describes a "breakpoint set" line. -;; For example: -;; Breakpoint 1 set in (eval 1177)[/Eval.pm:94] at line 5" -;; Breakpoint 2 set in /tmp/File/Basename.pm at line 215 -(setf (gethash "brkpt-set" realgud:trepanpl-pat-hash) - (make-realgud-loc-pat - :regexp "^Breakpoint \\([0-9]+\\) set in[\n\t ]+\\(.+\\)[ \t\n]+at line \\([0-9]+\\)" - :num 1 - :file-group 2 - :line-group 3 - :ignore-file-re realgud-perl-ignore-file-re) - ) - -;; Regular expression that describes a debugger "delete" (breakpoint) response. -;; For example: -;; Deleted breakpoint 1. -(setf (gethash "brkpt-del" realgud:trepanpl-pat-hash) - (make-realgud-loc-pat - :regexp "^Deleted breakpoint \\([0-9]+\\)\n" - :num 1)) - -(defconst realgud:trepanpl-selected-frame-indicator "-->" -"String that describes which frame is selected in a debugger -backtrace listing.") - -(defconst realgud:trepanpl-frame-file-regexp - "[ \t\n]+in file \\([^ \n]+\\)") - -(defconst realgud:trepanpl-debugger-name "trepan.pl" "Name of debugger") - -;; Top frame number -(setf (gethash "top-frame-num" realgud:trepanpl-pat-hash) 0) - -;; Regular expression that describes a debugger "selected" frame in in -;; a frame-motion command. -;; For example: -;; --> #1 TOP Object# in file /usr/local/bin/ipl at line 9 -(setf (gethash "selected-frame" realgud:trepanpl-pat-hash) - (make-realgud-loc-pat - :regexp - (format "^%s #\\([0-9]+\\) .*%s" - realgud:trepanpl-selected-frame-indicator - realgud:trepanpl-frame-file-regexp) - :num 1)) - -;; Regular expression that for a termination message. -(setf (gethash "termination" realgud:trepanpl-pat-hash) - "^trepan.pl: That's all, folks...\n") - -(setf (gethash "font-lock-keywords" realgud:trepanpl-pat-hash) - '( - ;; The frame number and first type name, if present. - ("^\\(-->\\| \\)? #\\([0-9]+\\) \\([A-Z]+\\) *\\([A-Z_][a-zA-Z0-9_]*\\)[#]\\([a-zA-Z_][a-zA-Z_[0-9]]*\\)?" - (2 realgud-backtrace-number-face) - (3 font-lock-keyword-face) ; e.g. METHOD, TOP - (4 font-lock-constant-face) ; e.g. Object - (5 font-lock-function-name-face nil t)) ; t means optional - ;; Instruction sequence - ("<\\(.+\\)>" - (1 font-lock-variable-name-face)) - ;; "::Type", which occurs in class name of function and in parameter list. - ;; Parameter sequence - ("(\\(.+\\))" - (1 font-lock-variable-name-face)) - ;; "::Type", which occurs in class name of function and in parameter list. - ("::\\([a-zA-Z_][a-zA-Z0-9_]*\\)" - (1 font-lock-type-face)) - ;; File name. - ("[ \t]+in file \\([^ ]+*\\)" - (1 realgud-file-name-face)) - ;; Line number. - ("[ \t]+at line \\([0-9]+\\)$" - (1 realgud-line-number-face)) - ;; Function name. - ("\\<\\([a-zA-Z_][a-zA-Z0-9_]*\\)\\.\\([a-zA-Z_][a-zA-Z0-9_]*\\)" - (1 font-lock-type-face) - (2 font-lock-function-name-face)) - ;; (trepanpl-frames-match-current-line - ;; (0 trepanpl-frames-current-frame-face append)) - )) - -;; (setf (gethash "font-lock-keywords" realgud:trepanpl-pat-hash) -;; '( -;; ;; The frame number and first type name, if present. -;; ((concat realgud:trepanpl-frame-start-regexp " " -;; realgud:trepanpl-frame-num-regexp " " -;; "\\([A-Z]+\\) *\\([A-Z_][a-zA-Z0-9_]*\\)[#]\\([a-zA-Z_][a-zA-Z_[0-9]]*\\)?") -;; (2 realgud-backtrace-number-face) -;; (3 font-lock-keyword-face) ; e.g. METHOD, TOP -;; (4 font-lock-constant-face) ; e.g. Object -;; (5 font-lock-function-name-face nil t)) ; t means optional -;; ;; Instruction sequence -;; ("<\\(.+\\)>" -;; (1 font-lock-variable-name-face)) -;; ;; "::Type", which occurs in class name of function and in -;; ;; parameter list. Parameter sequence -;; ("(\\(.+\\))" -;; (1 font-lock-variable-name-face)) -;; ;; "::Type", which occurs in class name of function and in -;; ;; parameter list. -;; ("::\\([a-zA-Z_][a-zA-Z0-9_]*\\)" -;; (1 font-lock-type-face)) -;; ;; File name. -;; (realgud:trepanpl-frame-file-regexp (1 realgud-file-name-face)) -;; ;; Line number. -;; (realgud:trepanpl-frame-line-regexp (1 realgud-line-number-face)) -;; ;; Function name. -;; ("\\<\\([a-zA-Z_][a-zA-Z0-9_]*\\)\\.\\([a-zA-Z_][a-zA-Z0-9_]*\\)" -;; (1 font-lock-type-face) -;; (2 font-lock-function-name-face)) -;; ;; (trepanpl-frames-match-current-line -;; ;; (0 trepanpl-frames-current-frame-face append)) -;; )) - -(setf (gethash realgud:trepanpl-debugger-name realgud-pat-hash) realgud:trepanpl-pat-hash) - -(defvar realgud:trepanpl-command-hash (make-hash-table :test 'equal) - "Hash key is command name like 'quit' and the value is - the trepanpl command to use, like 'quit!'") - -(setf (gethash "break" realgud:trepanpl-command-hash) "break %x %l") -(setf (gethash "quit" realgud:trepanpl-command-hash) "quit!") -(setf (gethash "until" realgud:trepanpl-command-hash) "continue %l") -(setf (gethash realgud:trepanpl-debugger-name - realgud-command-hash) realgud:trepanpl-command-hash) - -(provide-me "realgud:trepanpl-") diff --git a/packages/realgud/realgud/debugger/trepan.pl/track-mode.el b/packages/realgud/realgud/debugger/trepan.pl/track-mode.el deleted file mode 100644 index 3fe2f09bb..000000000 --- a/packages/realgud/realgud/debugger/trepan.pl/track-mode.el +++ /dev/null @@ -1,74 +0,0 @@ -;;; Copyright (C) 2011-2014 Rocky Bernstein -;;; Perl trepanning Debugger tracking a comint buffer. - -(eval-when-compile (require 'cl)) -(require 'load-relative) -(require-relative-list '( - "../../common/cmds" - "../../common/menu" - "../../common/track" - "../../common/track-mode" - ) - "realgud-") -(require-relative-list '("core" "init") "realgud:trepanpl-") -(require-relative-list '("../../lang/perl") "realgud-lang-") - -(realgud-track-mode-vars "realgud:trepanpl") - -(declare-function realgud-goto-line-for-pt 'realgud-track-mode) -(declare-function realgud-track-mode 'realgud-track-mode) -(declare-function realgud-track-mode-setup 'realgud-track-mode) -(declare-function realgud:track-mode-hook 'realgud-track-mode) -(declare-function realgud:track-set-debugger 'realgud-track-mode) -(declare-function realgud-perl-populate-command-keys 'realgud-lang-perl) - - -(defun realgud:trepanpl-goto-syntax-error-line (pt) - "Display the location mentioned in a Syntax error line -described by PT." - (interactive "d") - (realgud-goto-line-for-pt pt "syntax-error")) - -(define-key realgud:trepanpl-track-mode-map - (kbd "C-c !s") 'realgud:trepanpl-goto-syntax-error-line) - -(realgud-perl-populate-command-keys realgud:trepanpl-track-mode-map) - -(defun realgud:trepanpl-track-mode-hook() - (if realgud:trepanpl-track-mode - (progn - (use-local-map realgud:trepanpl-track-mode-map) - (message "using trepanpl mode map") - ) - (message "trepan.pl track-mode-hook disable called")) -) - -(define-minor-mode realgud:trepanpl-track-mode - "Minor mode for tracking trepan.pl source locations inside a -process shell via realgud. trepan.pl is a Perl debugger see URL -`https://metacpan.org/pod/Devel::Trepan'. - -If called interactively with no prefix argument, the mode is -toggled. A prefix argument, captured as ARG, enables the mode if -the argument is positive, and disables it otherwise. -" - :init-value nil - ;; :lighter " trepanpl" ;; mode-line indicator from realgud-track is sufficient. - ;; The minor mode bindings. - :global nil - :group 'realgud:trepanpl - :keymap realgud:trepanpl-track-mode-map - - (realgud:track-set-debugger "trepan.pl") - (if realgud:trepanpl-track-mode - (progn - (realgud-track-mode-setup 't) - (realgud:trepanpl-track-mode-hook)) - (progn - (setq realgud-track-mode nil) - )) -) - -(define-key realgud:trepanpl-short-key-mode-map "T" 'realgud:cmd-backtrace) - -(provide-me "realgud:trepanpl-") diff --git a/packages/realgud/realgud/debugger/trepan.pl/trepanpl.el b/packages/realgud/realgud/debugger/trepan.pl/trepanpl.el deleted file mode 100644 index caf73926b..000000000 --- a/packages/realgud/realgud/debugger/trepan.pl/trepanpl.el +++ /dev/null @@ -1,65 +0,0 @@ -;;; Copyright (C) 2011, 2014 Rocky Bernstein -;; `trepanpl' Main interface to trepanpl via Emacs -(require 'load-relative) -(require-relative-list '("../../common/helper") "realgud-") -(require-relative-list '("../../common/track") "realgud-") -(require-relative-list '("../../common/run") "realgud:") -(require-relative-list '("core" "track-mode") "realgud:trepanpl-") - -;; This is needed, or at least the docstring part of it is needed to -;; get the customization menu to work in Emacs 24. -(defgroup realgud:trepanpl nil - "The realgud interface to the Perl \"trepanning\" debugger" - :group 'perl - :group 'realgud - :version "24.1") - -;; ------------------------------------------------------------------- -;; User definable variables -;; - -(defcustom realgud:trepanpl-command-name - "trepan.pl" - "File name for executing the Perl debugger and command options. -This should be an executable on your path, or an absolute file name." - :type 'string - :group 'realgud:trepanpl) - -;; ------------------------------------------------------------------- -;; The end. -;; - -(declare-function realgud:trepanpl-track-mode 'realgud-trepanpl-track) -(declare-function realgud:trepanpl-query-cmdline 'realgud-trepanpl-core) -(declare-function realgud:trepanpl-parse-cmd-args 'realgud-trepanpl-core) -(declare-function realgud:run-debugger 'realgud:run) - -;;;###autoload -(defun realgud:trepan.pl (&optional opt-cmd-line no-reset) - "Invoke the trepan.pl Perl debugger and start the Emacs user interface. - -String OPT-CMD-LINE specifies how to run trepan.pl. You will be prompted -for a command line is one isn't supplied. - -OPT-CMD-LINE is treated like a shell string; arguments are -tokenized by `split-string-and-unquote'. The tokenized string is -parsed by `realgud:trepanpl-parse-cmd-args' and path elements found by that -are expanded using `realgud:expand-file-name-if-exists'. - -Normally, command buffers are reused when the same debugger is -reinvoked inside a command buffer with a similar command. If we -discover that the buffer has prior command-buffer information and -NO-RESET is nil, then that information which may point into other -buffers and source buffers which may contain marks and fringe or -marginal icons is reset. See `loc-changes-clear-buffer' to clear -fringe and marginal icons. -" - (interactive) - (realgud:run-debugger "trepan.pl" 'realgud:trepanpl-query-cmdline - 'realgud:trepanpl-parse-cmd-args - 'realgud:trepanpl-minibuffer-history - opt-cmd-line no-reset)) - -(defalias 'trepan.pl 'realgud:trepan.pl) -(provide-me "realgud-") -;;; trepanpl.el ends here diff --git a/packages/realgud/realgud/debugger/trepan/Makefile.am b/packages/realgud/realgud/debugger/trepan/Makefile.am deleted file mode 100644 index 9a343a513..000000000 --- a/packages/realgud/realgud/debugger/trepan/Makefile.am +++ /dev/null @@ -1 +0,0 @@ -include $(srcdir)/../common.mk diff --git a/packages/realgud/realgud/debugger/trepan/backtrack-mode.el b/packages/realgud/realgud/debugger/trepan/backtrack-mode.el deleted file mode 100644 index 51a75ce37..000000000 --- a/packages/realgud/realgud/debugger/trepan/backtrack-mode.el +++ /dev/null @@ -1,63 +0,0 @@ -;;; Copyright (C) 2011, 2014 Rocky Bernstein - -;;; Mode for parsing various kinds of backtraces found in Ruby - -(eval-when-compile (require 'cl)) -(require 'load-relative) -(require-relative-list '( - "../../common/cmds" - "../../common/menu" - "../../common/track-mode" - "../../common/backtrack-mode" - ) - "realgud-") -(require-relative-list '("core" "init") "realgud:trepan-") -(require-relative-list '("../../lang/ruby") "realgud-lang-") - -(realgud-backtrack-mode-vars "trepan") -(set-keymap-parent trepan-backtrack-mode-map realgud-backtrack-mode-map) - -(declare-function realgud-backtrack-mode 'realgud-common-backtrack-mode) -(declare-function realgud-backtrack-set-debugger 'realgud-common-backtrack-mode) -(declare-function realgud-goto-line-for-pt 'realgud-common-backtrack-mode) -(declare-function realgud:ruby-populate-command-keys 'realgud-lang-ruby) - -(defun realgud:trepan-goto-control-frame-line (pt) - "Display the location mentioned by a control-frame line -described by PT." - (interactive "d") - (realgud-goto-line-for-pt pt "control-frame")) - -(realgud:ruby-populate-command-keys trepan-backtrack-mode-map) -(define-key trepan-backtrack-mode-map - (kbd "C-c !c") 'realgud:trepan-goto-control-frame-line) - -(define-minor-mode trepan-backtrack-mode - "Minor mode for tracking ruby debugging inside a file which may not have process shell." - :init-value nil - ;; :lighter " trepan" ;; mode-line indicator from realgud-track is sufficient. - ;; The minor mode bindings. - :global nil - :group 'realgud:trepan - :keymap trepan-backtrack-mode-map - - (realgud-backtrack-set-debugger "trepan") - (if trepan-backtrack-mode - (progn - (realgud-backtrack-mode 't) - (run-mode-hooks (intern (trepan-backtrack-mode-hook)))) - (progn - (realgud-backtrack-mode nil) - )) -) - -(defun trepan-backtrack-mode-hook() - (if trepan-backtrack-mode - (progn - (use-local-map trepan-backtrack-mode-map) - (message "using trepan mode map") - ) - (message "trepan backtrack-mode-hook disable called")) -) - -(provide-me "realgud:trepan-") diff --git a/packages/realgud/realgud/debugger/trepan/core.el b/packages/realgud/realgud/debugger/trepan/core.el deleted file mode 100644 index 269af1e8a..000000000 --- a/packages/realgud/realgud/debugger/trepan/core.el +++ /dev/null @@ -1,236 +0,0 @@ -;;; Copyright (C) 2010, 2012, 2014-2015 Rocky Bernstein -(eval-when-compile (require 'cl)) - -(require 'compile) ;; for compilation-find-file -(require 'load-relative) -(require-relative-list '("../../common/track" - "../../common/core" - "../../common/lang") - "realgud-") -(require-relative-list '("init") "realgud:trepan-") - -(declare-function realgud:strip 'realgud) -(declare-function realgud:expand-file-name-if-exists 'realgud-core) -(declare-function realgud-parse-command-arg 'realgud-core) -(declare-function realgud-query-cmdline 'realgud-core) -(declare-function realgud-suggest-invocation 'realgud-core) -(declare-function realgud:file-loc-from-line 'realgud-file) - -;; FIXME: I think the following could be generalized and moved to -;; realgud-... probably via a macro. -(defvar realgud:trepan-minibuffer-history nil - "minibuffer history list for the command `realgud:trepan'.") - -(easy-mmode-defmap trepan-minibuffer-local-map - '(("\C-i" . comint-dynamic-complete-filename)) - "Keymap for minibuffer prompting of gud startup command." - :inherit minibuffer-local-map) - -(defvar realgud:trepan-file-remap (make-hash-table :test 'equal) - "How to remap Python files in trepan when we otherwise can't - find in the filesystem. The hash key is the file string we saw, - and the value is associated filesystem string presumably in the - filesystem") - -;; FIXME: this code could be generalized and put in a common place. -(defun realgud:trepan-find-file(filename) - "A find-file specific for trepan. We strip off trailing -blanks. Failing that we will prompt for a mapping and save that -in variable `realgud:trepan-file-remap' when that works. In the -future, we may also consult RUBYPATH." - (let* ((transformed-file) - (stripped-filename (realgud:strip filename)) - ;; (ignore-file-re) - ) - (cond - ((file-exists-p filename) filename) - ((file-exists-p stripped-filename) stripped-filename) - ;; ((string-match ((ignore-file-re filename) - ;; (message "tracking ignored for psuedo-file: %s" filename) nil) - ('t - ;; FIXME search RUBYLIB if not absolute file? - (if (gethash filename realgud-file-remap) - (let ((remapped-filename)) - (setq remapped-filename (gethash filename realgud:trepan-file-remap)) - (if (file-exists-p remapped-filename) - remapped-filename - ;; else - (and (remhash filename realgud-file-remap)) nil) - ;; else - (let ((remapped-filename)) - (setq remapped-filename - (buffer-file-name - (compilation-find-file (point-marker) stripped-filename - nil "%s.rb"))) - (when (and remapped-filename (file-exists-p remapped-filename)) - (puthash filename remapped-filename realgud-file-remap) - remapped-filename - )) - )) - )) - )) - -(defun realgud:trepan-loc-fn-callback(text filename lineno source-str - ignore-file-re cmd-mark) - (realgud:file-loc-from-line filename lineno - cmd-mark source-str nil nil - 'realgud:trepan-find-file)) - -;; FIXME: I think this code and the keymaps and history -;; variable chould be generalized, perhaps via a macro. -(defun realgud:trepan-query-cmdline (&optional opt-debugger) - (realgud-query-cmdline - 'trepan-suggest-invocation - trepan-minibuffer-local-map - 'realgud:trepan-minibuffer-history - opt-debugger)) - -(defun realgud:trepan-parse-cmd-args (orig-args) - "Parse command line ARGS for the annotate level and name of script to debug. - -ORIG-ARGS should contain a tokenized list of the command line to run. - -We return the a list containing - -* the command processor (e.g. ruby) and it's arguments if any - a - list of strings - -* the name of the debugger given (e.g. trepan) and its arguments - - a list of strings - -* the script name and its arguments - list of strings - -* whether the annotate or emacs option was given ('-A', - '--annotate' or '--emacs) - a boolean - -For example for the following input - (map 'list 'symbol-name - '(ruby1.9 -W -C /tmp trepan --emacs ./gcd.rb a b)) - -we might return: - ((ruby1.9 -W -C) (trepan --emacs) (./gcd.rb a b) 't) - -Note that the script name path has been expanded via `expand-file-name'. -" - - ;; Parse the following kind of pattern: - ;; [ruby ruby-options] trepan trepan-options script-name script-options - (let ( - (args orig-args) - (pair) ;; temp return from - (ruby-opt-two-args '("0" "C" "e" "E" "F" "i")) - ;; Ruby doesn't have mandatory 2-arg options in our sense, - ;; since the two args can be run together, e.g. "-C/tmp" or "-C /tmp" - ;; - (ruby-two-args '()) - ;; One dash is added automatically to the below, so - ;; h is really -h and -host is really --host. - (trepan-two-args '("h" "-host" "p" "-port" - "I" "-include" "-r" "-require")) - (trepan-opt-two-args '()) - (interp-regexp - (if (member system-type (list 'windows-nt 'cygwin 'msdos)) - "^ruby[-0-9]*\\(.exe\\)?$" - "^ruby[-0-9]*$")) - - ;; Things returned - (script-name nil) - (debugger-name nil) - (interpreter-args '()) - (debugger-args '()) - (script-args '()) - (annotate-p nil)) - - (if (not (and args)) - ;; Got nothing: return '(nil, nil) - (list interpreter-args debugger-args script-args annotate-p) - ;; else - ;; Strip off optional "ruby" or "ruby182" etc. - (when (string-match interp-regexp - (file-name-sans-extension - (file-name-nondirectory (car args)))) - (setq interpreter-args (list (pop args))) - - ;; Strip off Ruby-specific options - (while (and args - (string-match "^-" (car args))) - (setq pair (realgud-parse-command-arg - args ruby-two-args ruby-opt-two-args)) - (nconc interpreter-args (car pair)) - (setq args (cadr pair)))) - - ;; Remove "trepan" from "trepan --trepan-options script - ;; --script-options" - (setq debugger-name (file-name-sans-extension - (file-name-nondirectory (car args)))) - (unless (string-match "^trepan$" debugger-name) - (message - "Expecting debugger name `%s' to be `trepan'" - debugger-name)) - (setq debugger-args (list (pop args))) - - ;; Skip to the first non-option argument. - (while (and args (not script-name)) - (let ((arg (car args))) - (cond - ;; Annotation or emacs option with level number. - ((or (member arg '("--annotate" "-A")) - (equal arg "--emacs")) - (setq annotate-p t) - (nconc debugger-args (list (pop args)))) - ;; Combined annotation and level option. - ((string-match "^--annotate=[0-9]" arg) - (nconc debugger-args (list (pop args)) ) - (setq annotate-p t)) - ;; path-argument options - ((member arg '("--include" "-I" "--require" "-I")) - (setq arg (pop args)) - (nconc debugger-args - (list arg (realgud:expand-file-name-if-exists - (pop args))))) - ;; Options with arguments. - ((string-match "^-" arg) - (setq pair (realgud-parse-command-arg - args trepan-two-args trepan-opt-two-args)) - (nconc debugger-args (car pair)) - (setq args (cadr pair))) - ;; Anything else must be the script to debug. - (t (setq script-name (realgud:expand-file-name-if-exists arg)) - (setq script-args (cons script-name (cdr args)))) - ))) - (list interpreter-args debugger-args script-args annotate-p)))) - -;; To silence Warning: reference to free variable -(defvar realgud:trepan-command-name) - -(defun trepan-suggest-invocation (debugger-name) - "Suggest a trepan command invocation via `realgud-suggest-invocaton'" - (realgud-suggest-invocation realgud:trepan-command-name - realgud:trepan-minibuffer-history - "ruby" "\\.rb$" "trepan")) - -(defun trepan-reset () - "Trepan cleanup - remove debugger's internal buffers (frame, -breakpoints, etc.)." - (interactive) - ;; (trepan-breakpoint-remove-all-icons) - (dolist (buffer (buffer-list)) - (when (string-match "\\*trepan-[a-z]+\\*" (buffer-name buffer)) - (let ((w (get-buffer-window buffer))) - (when w - (delete-window w))) - (kill-buffer buffer)))) - -;; (defun trepan-reset-keymaps() -;; "This unbinds the special debugger keys of the source buffers." -;; (interactive) -;; (setcdr (assq 'trepan-debugger-support-minor-mode minor-mode-map-alist) -;; trepan-debugger-support-minor-mode-map-when-deactive)) - - -(defun realgud:trepan-customize () - "Use `customize' to edit the settings of the `trepan' debugger." - (interactive) - (customize-group 'realgud:trepan)) - -(provide-me "realgud:trepan-") diff --git a/packages/realgud/realgud/debugger/trepan/init.el b/packages/realgud/realgud/debugger/trepan/init.el deleted file mode 100644 index 2da793ef8..000000000 --- a/packages/realgud/realgud/debugger/trepan/init.el +++ /dev/null @@ -1,218 +0,0 @@ -;;; Copyright (C) 2010, 2014-2015 Rocky Bernstein -(eval-when-compile (require 'cl)) - -(require 'load-relative) -(require-relative-list '("../../common/regexp" - "../../common/loc" - "../../common/init") - "realgud-") -(require-relative-list '("../../lang/ruby") "realgud-lang-") - -(defvar realgud-pat-hash) -(declare-function make-realgud-loc-pat (realgud-loc)) - -(defvar realgud:trepan-pat-hash (make-hash-table :test 'equal) - "Hash key is the what kind of pattern we want to match: -backtrace, prompt, etc. The values of a hash entry is a -realgud-loc-pat struct") - -(setf (gethash "loc-callback-fn" realgud:trepan-pat-hash) 'realgud:trepan-loc-fn-callback) - -;; Regular expression that describes a trepan location generally shown -;; before a command prompt. -;; For example: -;; -- (/tmp/linecache.rb:64) -;; C> (/tmp/eval.rb:2) -(setf (gethash "loc" realgud:trepan-pat-hash) - (make-realgud-loc-pat - :regexp ".. (\\(?:.+ \\(?:via\\|remapped\\) \\)?\\(.+\\):\\([0-9]+\\)\\(?: @[0-9]+\\)?)\\(?:\n\\(.*?\\)\n\\)?" - :file-group 1 - :line-group 2 - :text-group 3 - :ignore-file-re "(eval: .*)" - )) - -;; Regular expression that describes a trepan command prompt -;; For example: -;; (trepan): -;; ((trepan)): -;; (trepan@main): -;; (trepan@55): -(setf (gethash "prompt" realgud:trepan-pat-hash) - (make-realgud-loc-pat - :regexp "^(+trepan\\(@[0-9]+\\|@main\\)?)+: " - )) - -;; Regular expression that describes a Ruby YARV 1.9 syntax error line. -(setf (gethash "syntax-error" realgud:trepan-pat-hash) - realgud-ruby-YARV-syntax-error-pat) - -;; Regular expression that describes a Ruby YARV 1.9 backtrace line. -;; For example: -;; :29:in `require' -;; :29:in `require' -;; /tmp/Rakefile:50:in `' -;; from /usr/lib/ruby/gems/rspec/compatibility.rb:6:in `const_missing' -(setf (gethash "lang-backtrace" realgud:trepan-pat-hash) - (make-realgud-loc-pat - :regexp "^\\(?:[\t]from \\)?\\([^:]+\\):\\([0-9]+\\)\\(?:in `.*'\\)?" - :file-group 1 - :line-group 2)) - -;; Regular expression that describes a ruby $! backtrace -(setf (gethash "dollar-bang-backtrace" realgud:trepan-pat-hash) - realgud-ruby-dollar-bang-loc-pat) - -;; Regular expression that describes a "breakpoint set" line. -;; For example: -;; Breakpoint 1 set at VM offset 2 of instruction sequence "require", -;; line 29 in file . -;; Breakpoint 2 set at VM offset 29 of instruction sequence "", -;; line 64 in file /src/external-vcs/linecache/trunk/lib/linecache.rb. -(setf (gethash "brkpt-set" realgud:trepan-pat-hash) - (make-realgud-loc-pat - :regexp "^Breakpoint \\([0-9]+\\) set at .*[\n\t ]+line \\([0-9]+\\)[ \t\n]+in file \\(.+\\)." - :num 1 - :file-group 3 - :line-group 2)) - -;; Regular expression that describes a debugger "delete" (breakpoint) response. -;; For example: -;; Deleted breakpoint 1. -(setf (gethash "brkpt-del" realgud:trepan-pat-hash) - (make-realgud-loc-pat - :regexp "^Deleted breakpoint \\([0-9]+\\).\n" - :num 1)) - -(defconst realgud:trepan-selected-frame-indicator "-->" -"String that describes which frame is selected in a debugger -backtrace listing.") - -(defconst realgud:trepan-frame-file-regexp - "[ \t\n]+in file \\([^ \n]+\\)") - -(defconst realgud:trepan-debugger-name "trepan" "Name of debugger") - -;; Top frame number -(setf (gethash "top-frame-num" realgud:trepan-pat-hash) 0) - -;; Regular expression that describes a debugger "selected" frame in in -;; a frame-motion command. -;; For example: -;; --> #1 TOP Object# in file /usr/local/bin/irb at line 9 -(setf (gethash "selected-frame" realgud:trepan-pat-hash) - (make-realgud-loc-pat - :regexp - (format "^%s #\\([0-9]+\\) .*%s" - realgud:trepan-selected-frame-indicator - realgud:trepan-frame-file-regexp) - :num 1)) - -(setf (gethash "control-frame" realgud:trepan-pat-hash) - (make-realgud-loc-pat - :regexp "^c:\\([0-9]+\\) p:\\([0-9]+\\) s:\\([0-9]+\\) b:\\([0-9]+\\) l:\\([0-9a-f]+\\) d:\\([0-9a-f]+\\) \\([A-Z]+\\) \\(.+\\):\\([0-9]+\\)" - :file-group 8 - :line-group 9)) - -;; Regular expression that describes a Ruby $! string -(setf (gethash "dollar-bang" realgud:trepan-pat-hash) - realgud-ruby-dollar-bang-loc-pat) - -;; Regular expression that describes debugger "backtrace" command line. -;; e.g. -;; --> #0 METHOD Object#require(path) in file at line 28 -;; #1 TOP Object# in file /tmp/linecache.rb -(setf (gethash "debugger-backtrace" realgud:trepan-pat-hash) - (make-realgud-loc-pat - :regexp (concat realgud:trepan-frame-start-regexp " " - realgud:trepan-frame-num-regexp " " - "\\([A-Z]+\\) *\\([A-Z_][a-zA-Z0-9_]*\\)[#]\\(.*\\)" - realgud:trepan-frame-file-regexp - "\\(?:" realgud:trepan-frame-line-regexp "\\)?" - ) - :num 2 - :file-group 6 - :line-group 7) - ) - -;; Regular expression that for a termination message. -(setf (gethash "termination" realgud:trepan-pat-hash) - "^trepan: That's all, folks...\n") - -(setf (gethash "font-lock-keywords" realgud:trepan-pat-hash) - '( - ;; The frame number and first type name, if present. - ("^\\(-->\\| \\)? #\\([0-9]+\\) \\([A-Z]+\\) *\\([A-Z_][a-zA-Z0-9_]*\\)[#]\\([a-zA-Z_][a-zA-Z_[0-9]]*\\)?" - (2 realgud-backtrace-number-face) - (3 font-lock-keyword-face) ; e.g. METHOD, TOP - (4 font-lock-constant-face) ; e.g. Object - (5 font-lock-function-name-face nil t)) ; t means optional - ;; Instruction sequence - ("<\\(.+\\)>" - (1 font-lock-variable-name-face)) - ;; "::Type", which occurs in class name of function and in parameter list. - ;; Parameter sequence - ("(\\(.+\\))" - (1 font-lock-variable-name-face)) - ;; "::Type", which occurs in class name of function and in parameter list. - ("::\\([a-zA-Z_][a-zA-Z0-9_]*\\)" - (1 font-lock-type-face)) - ;; File name. - ("[ \t]+in file \\([^ ]+*\\)" - (1 realgud-file-name-face)) - ;; Line number. - ("[ \t]+at line \\([0-9]+\\)$" - (1 realgud-line-number-face)) - ;; Function name. - ("\\<\\([a-zA-Z_][a-zA-Z0-9_]*\\)\\.\\([a-zA-Z_][a-zA-Z0-9_]*\\)" - (1 font-lock-type-face) - (2 font-lock-function-name-face)) - ;; (trepan-frames-match-current-line - ;; (0 trepan-frames-current-frame-face append)) - )) - -;; (setf (gethash "font-lock-keywords" realgud:trepan-pat-hash) -;; '( -;; ;; The frame number and first type name, if present. -;; ((concat realgud:trepan-frame-start-regexp " " -;; realgud:trepan-frame-num-regexp " " -;; "\\([A-Z]+\\) *\\([A-Z_][a-zA-Z0-9_]*\\)[#]\\([a-zA-Z_][a-zA-Z_[0-9]]*\\)?") -;; (2 realgud-backtrace-number-face) -;; (3 font-lock-keyword-face) ; e.g. METHOD, TOP -;; (4 font-lock-constant-face) ; e.g. Object -;; (5 font-lock-function-name-face nil t)) ; t means optional -;; ;; Instruction sequence -;; ("<\\(.+\\)>" -;; (1 font-lock-variable-name-face)) -;; ;; "::Type", which occurs in class name of function and in -;; ;; parameter list. Parameter sequence -;; ("(\\(.+\\))" -;; (1 font-lock-variable-name-face)) -;; ;; "::Type", which occurs in class name of function and in -;; ;; parameter list. -;; ("::\\([a-zA-Z_][a-zA-Z0-9_]*\\)" -;; (1 font-lock-type-face)) -;; ;; File name. -;; (realgud:trepan-frame-file-regexp (1 realgud-file-name-face)) -;; ;; Line number. -;; (realgud:trepan-frame-line-regexp (1 realgud-line-number-face)) -;; ;; Function name. -;; ("\\<\\([a-zA-Z_][a-zA-Z0-9_]*\\)\\.\\([a-zA-Z_][a-zA-Z0-9_]*\\)" -;; (1 font-lock-type-face) -;; (2 font-lock-function-name-face)) -;; ;; (trepan-frames-match-current-line -;; ;; (0 trepan-frames-current-frame-face append)) -;; )) - -(setf (gethash realgud:trepan-debugger-name realgud-pat-hash) realgud:trepan-pat-hash) - -(defvar realgud:trepan-command-hash (make-hash-table :test 'equal) - "Hash key is command name like 'quit' and the value is - the trepan command to use, like 'quit!'") - -(setf (gethash "quit" realgud:trepan-command-hash) "quit!") -(setf (gethash "shell" realgud:trepan-command-hash) "irb") -(setf (gethash realgud:trepan-debugger-name - realgud-command-hash) realgud:trepan-command-hash) - -(provide-me "realgud:trepan-") diff --git a/packages/realgud/realgud/debugger/trepan/track-mode.el b/packages/realgud/realgud/debugger/trepan/track-mode.el deleted file mode 100644 index b4b2ddff2..000000000 --- a/packages/realgud/realgud/debugger/trepan/track-mode.el +++ /dev/null @@ -1,82 +0,0 @@ -;;; Copyright (C) 2010, 2012-2015 Rocky Bernstein -;;; Ruby "trepan" Debugger tracking a comint or eshell buffer. - -(eval-when-compile (require 'cl)) -(require 'load-relative) -(require-relative-list '( - "../../common/cmds" - "../../common/menu" - "../../common/track" - "../../common/track-mode" - ) - "realgud-") -(require-relative-list '("core" "init") "realgud:trepan-") -(require-relative-list '("../../lang/ruby") "realgud-lang-") - -(declare-function realgud-track-mode 'realgud-track-mode) -(declare-function realgud-track-mode-hook 'realgud-track-mode) -(declare-function realgud-track-mode-setup 'realgud-track-mode) -(declare-function realgud:track-set-debugger 'realgud-track-mode) -(declare-function realgud-goto-line-for-pt 'realgud-track-mode) - -(realgud-track-mode-vars "trepan") - -(define-key realgud-track-mode-map - (kbd "C-c !!") 'realgud:goto-lang-backtrace-line) -(define-key realgud-track-mode-map - (kbd "C-c !b") 'realgud:goto-debugger-backtrace-line) - -(declare-function realgud:ruby-populate-command-keys 'realgud-lang-ruby) - -(defun realgud:trepan-goto-control-frame-line (pt) - "Display the location mentioned by a control-frame line -described by PT." - (interactive "d") - (realgud-goto-line-for-pt pt "control-frame")) - -(defun realgud:trepan-goto-syntax-error-line (pt) - "Display the location mentioned in a Syntax error line -described by PT." - (interactive "d") - (realgud-goto-line-for-pt pt "syntax-error")) - -(realgud:ruby-populate-command-keys trepan-track-mode-map) - -(define-key trepan-track-mode-map - (kbd "C-c !c") 'realgud:trepan-goto-control-frame-line) -(define-key trepan-track-mode-map - (kbd "C-c !s") 'realgud:trepan-goto-syntax-error-line) - -(defun trepan-track-mode-hook() - (if trepan-track-mode - (progn - (use-local-map trepan-track-mode-map) - (message "using trepan mode map") - ) - (message "trepan track-mode-hook disable called")) -) - -(define-minor-mode trepan-track-mode - "Minor mode for tracking trepan source locations inside a process shell via realgud. trepan is a Ruby debugger. - -If called interactively with no prefix argument, the mode is toggled. A prefix argument, captured as ARG, enables the mode if the argument is positive, and disables it otherwise. - -\\{trepan-track-mode-map} -" - :init-value nil - ;; :lighter " trepan" ;; mode-line indicator from realgud-track is sufficient. - ;; The minor mode bindings. - :global nil - :group 'realgud:trepan - :keymap trepan-track-mode-map - (realgud:track-set-debugger "trepan") - (if trepan-track-mode - (progn - (realgud-track-mode-setup 't) - (trepan-track-mode-hook)) - (progn - (setq realgud-track-mode nil) - )) -) - -(provide-me "realgud:trepan-") diff --git a/packages/realgud/realgud/debugger/trepan/trepan.el b/packages/realgud/realgud/debugger/trepan/trepan.el deleted file mode 100644 index b62417d94..000000000 --- a/packages/realgud/realgud/debugger/trepan/trepan.el +++ /dev/null @@ -1,58 +0,0 @@ -;;; Copyright (C) 2010-2011, 2013-2015 Rocky Bernstein -;; `trepan' Main interface to trepan via Emacs -(require 'load-relative) -(require-relative-list '("../../common/helper") "realgud-") -(require-relative-list '("../../common/run") "realgud:") -(require-relative-list '("core" "track-mode") "realgud:trepan-") - -(declare-function realgud:trepan-query-cmdline 'realgud:trepan-core) -(declare-function realgud:trepan-parse-cmd-args 'realgud:trepan-core) -(declare-function realgud:run-debugger 'realgud:run) - -;; This is needed, or at least the docstring part of it is needed to -;; get the customization menu to work in Emacs 24. -(defgroup realgud:trepan nil - "The realgud interface to the Ruby 1.9.2 1.9.3 \"trepanning\" debugger" - :group 'ruby - :group 'realgud - :version "24.1") - -;; ------------------------------------------------------------------- -;; User-definable variables -;; - -(defcustom realgud:trepan-command-name - ;;"trepan --emacs 3" - "trepan" - "File name for executing the Ruby debugger and command options. -This should be an executable on your path, or an absolute file name." - :type 'string - :group 'realgud:trepan) - -;;;###autoload -(defun realgud:trepan (&optional opt-cmd-line no-reset) - "Invoke the trepan Ruby debugger and start the Emacs user interface. - -String OPT-CMD-LINE is treated like a shell string; arguments are -tokenized by `split-string-and-unquote'. The tokenized string is -parsed by `trepan-parse-cmd-args' and path elements found by that -are expanded using `expand-file-name'. - -Normally, command buffers are reused when the same debugger is -reinvoked inside a command buffer with a similar command. If we -discover that the buffer has prior command-buffer information and -NO-RESET is nil, then that information which may point into other -buffers and source buffers which may contain marks and fringe or -marginal icons is reset. See `loc-changes-clear-buffer' to clear -fringe and marginal icons. -" - (interactive) - (realgud:run-debugger "trepan" 'realgud:trepan-query-cmdline - 'realgud:trepan-parse-cmd-args - 'realgud:trepan-minibuffer-history - opt-cmd-line no-reset) - ) - -(defalias 'trepan 'realgud:trepan) -(provide-me "realgud-") -;;; trepan.el ends here diff --git a/packages/realgud/realgud/debugger/trepan2/Makefile.am b/packages/realgud/realgud/debugger/trepan2/Makefile.am deleted file mode 100644 index 23f8a8fa2..000000000 --- a/packages/realgud/realgud/debugger/trepan2/Makefile.am +++ /dev/null @@ -1 +0,0 @@ -include ../common.mk diff --git a/packages/realgud/realgud/debugger/trepan2/core.el b/packages/realgud/realgud/debugger/trepan2/core.el deleted file mode 100644 index 260793582..000000000 --- a/packages/realgud/realgud/debugger/trepan2/core.el +++ /dev/null @@ -1,227 +0,0 @@ -;;; Copyright (C) 2010, 2014-2015 Rocky Bernstein -(eval-when-compile (require 'cl)) - -(require 'compile) ;; for compilation-find-file -(require 'load-relative) -(require-relative-list '("../../common/track" - "../../common/core" - "../../common/file" - "../../common/lang") - "realgud-") -(require-relative-list '("init") "realgud:trepan2-") - -(declare-function realgud:strip 'realgud) -(declare-function realgud:expand-file-name-if-exists 'realgud-core) -(declare-function realgud-parse-command-arg 'realgud-core) -(declare-function realgud-query-cmdline 'realgud-core) -(declare-function realgud-suggest-invocation 'realgud-core) -(declare-function realgud:file-loc-from-line 'realgud-file) - -;; FIXME: I think the following could be generalized and moved to -;; realgud-... probably via a macro. -(defvar realgud:trepan2-minibuffer-history nil - "minibuffer history list for the command `realgud:trepan2'.") - -(easy-mmode-defmap trepan2-minibuffer-local-map - '(("\C-i" . comint-dynamic-complete-filename)) - "Keymap for minibuffer prompting of gud startup command." - :inherit minibuffer-local-map) - -(defvar realgud:trepan2-file-remap (make-hash-table :test 'equal) - "How to remap Python files in trepan2 when we otherwise can't - find in the filesystem. The hash key is the file string we saw, - and the value is associated filesystem string presumably in the - filesystem") - -;; FIXME: this code could be generalized and put in a common place. -(defun realgud:trepan2-find-file(filename) - "A find-file specific for python/trepan. We strip off trailing -blanks. Failing that we will prompt for a mapping and save that -in variable `realgud:trepan2-file-remap' when that works. In the future, -we may also consult PYTHONPATH." - (let* ((transformed-file) - (stripped-filename (realgud:strip filename)) - (ignore-file-re realgud-python-ignore-file-re) - ) - (cond - ((file-exists-p filename) filename) - ((file-exists-p stripped-filename) stripped-filename) - ((string-match ignore-file-re filename) - (message "tracking ignored for psuedo-file: %s" filename) nil) - ('t - ;; FIXME search PYTHONPATH if not absolute file - (if (gethash filename realgud-file-remap) - (let ((remapped-filename)) - (setq remapped-filename (gethash filename realgud:trepan2-file-remap)) - (if (file-exists-p remapped-filename) - remapped-filename - ;; else - (and (remhash filename realgud-file-remap)) nil) - ;; else - (let ((remapped-filename)) - (setq remapped-filename - (buffer-file-name - (compilation-find-file (point-marker) stripped-filename - nil "%s.py"))) - (when (and remapped-filename (file-exists-p remapped-filename)) - (puthash filename remapped-filename realgud-file-remap) - remapped-filename - )) - )) - )) - )) - -(defun realgud:trepan2-loc-fn-callback(text filename lineno source-str - ignore-file-re cmd-mark) - (realgud:file-loc-from-line filename lineno - cmd-mark source-str nil nil - 'realgud:trepan2-find-file)) - -;; FIXME: I think this code and the keymaps and history -;; variable chould be generalized, perhaps via a macro. -(defun trepan2-query-cmdline (&optional opt-debugger) - (realgud-query-cmdline - 'trepan2-suggest-invocation - trepan2-minibuffer-local-map - 'realgud:trepan2-minibuffer-history - opt-debugger)) - -(defun trepan2-parse-cmd-args (orig-args) - "Parse command line ARGS for the annotate level and name of script to debug. - -ORIG-ARGS should contain a tokenized list of the command line to run. - -We return the a list containing -- the command processor (e.g. python) and it's arguments if any - a list of strings -- the name of the debugger given (e.g. trepan2) and its arguments - a list of strings -- the script name and its arguments - list of strings -- whether the annotate or emacs option was given ('-A', '--annotate' or '--emacs) - a boolean - -For example for the following input - (map 'list 'symbol-name - '(python2.6 -O -Qold --emacs ./gcd.py a b)) - -we might return: - ((python2.6 -O -Qold) (trepan2 --emacs) (./gcd.py a b) 't) - -NOTE: the above should have each item listed in quotes. -" - - ;; Parse the following kind of pattern: - ;; [python python-options] trepan2 trepan2-options script-name script-options - (let ( - (args orig-args) - (pair) ;; temp return from - (python-opt-two-args '("c" "m" "Q" "W")) - ;; Python doesn't have mandatory 2-arg options in our sense, - ;; since the two args can be run together, e.g. "-C/tmp" or "-C /tmp" - ;; - (python-two-args '()) - ;; One dash is added automatically to the below, so - ;; h is really -h and -host is really --host. - (trepan2-two-args '("x" "-command" "e" "-execute" - "o" "-output" "t" "-target" - "a" "-annotate")) - (trepan2-opt-two-args '()) - (interp-regexp - (if (member system-type (list 'windows-nt 'cygwin 'msdos)) - "^python[-0-9.]*\\(.exe\\)?$" - "^python[-0-9.]*$")) - - ;; Things returned - (annotate-p nil) - (debugger-args '()) - (debugger-name nil) - (interpreter-args '()) - (script-args '()) - (script-name nil) - ) - - (if (not (and args)) - ;; Got nothing: return '(nil, nil) - (list interpreter-args debugger-args script-args annotate-p) - ;; else - ;; Strip off optional "python" or "python182" etc. - (when (string-match interp-regexp - (file-name-sans-extension - (file-name-nondirectory (car args)))) - (setq interpreter-args (list (pop args))) - - ;; Strip off Python-specific options - (while (and args - (string-match "^-" (car args))) - (setq pair (realgud-parse-command-arg - args python-two-args python-opt-two-args)) - (nconc interpreter-args (car pair)) - (setq args (cadr pair)))) - - ;; Remove "trepan2" from "trepan2 --trepan2-options script - ;; --script-options" - (setq debugger-name (file-name-sans-extension - (file-name-nondirectory (car args)))) - (unless (string-match "^\\(trepan2\\|cli.py\\)$" debugger-name) - (message - "Expecting debugger name `%s' to be `trepan2' or `cli.py'" - debugger-name)) - (setq debugger-args (list (pop args))) - - ;; Skip to the first non-option argument. - (while (and args (not script-name)) - (let ((arg (car args))) - (cond - ;; Annotation or emacs option with level number. - ((or (member arg '("--annotate" "-A")) - (equal arg "--emacs")) - (setq annotate-p t) - (nconc debugger-args (list (pop args)))) - ;; Combined annotation and level option. - ((string-match "^--annotate=[0-9]" arg) - (nconc debugger-args (list (pop args)) ) - (setq annotate-p t)) - ;; Options with arguments. - ((string-match "^-" arg) - (setq pair (realgud-parse-command-arg - args trepan2-two-args trepan2-opt-two-args)) - (nconc debugger-args (car pair)) - (setq args (cadr pair))) - ;; Anything else must be the script to debug. - (t (setq script-name (realgud:expand-file-name-if-exists arg)) - (setq script-args (cons script-name (cdr args)))) - ))) - (list interpreter-args debugger-args script-args annotate-p)))) - -;; To silence Warning: reference to free variable -(defvar realgud:trepan2-command-name) - -(defun trepan2-suggest-invocation (debugger-name) - "Suggest a trepan2 command invocation via `realgud-suggest-invocaton'" - (realgud-suggest-invocation realgud:trepan2-command-name - realgud:trepan2-minibuffer-history - "python" "\\.py" - realgud:trepan2-command-name)) - -(defun trepan2-reset () - "Trepan2 cleanup - remove debugger's internal buffers (frame, -breakpoints, etc.)." - (interactive) - ;; (trepan2-breakpoint-remove-all-icons) - (dolist (buffer (buffer-list)) - (when (string-match "\\*trepan2-[a-z]+\\*" (buffer-name buffer)) - (let ((w (get-buffer-window buffer))) - (when w - (delete-window w))) - (kill-buffer buffer)))) - -;; (defun trepan2-reset-keymaps() -;; "This unbinds the special debugger keys of the source buffers." -;; (interactive) -;; (setcdr (assq 'trepan2-debugger-support-minor-mode minor-mode-map-alist) -;; trepan2-debugger-support-minor-mode-map-when-deactive)) - - -(defun realgud:trepan2-customize () - "Use `customize' to edit the settings of the `trepan2' debugger." - (interactive) - (customize-group 'realgud:trepan2)) - -(provide-me "realgud:trepan2-") diff --git a/packages/realgud/realgud/debugger/trepan2/init.el b/packages/realgud/realgud/debugger/trepan2/init.el deleted file mode 100644 index 87d130642..000000000 --- a/packages/realgud/realgud/debugger/trepan2/init.el +++ /dev/null @@ -1,81 +0,0 @@ -;;; Copyright (C) 2010-2012, 2014-2015 Rocky Bernstein -;;; trepan2: Python 2.5 but less than 3K - -(eval-when-compile (require 'cl)) - -(require 'load-relative) -(require-relative-list '("../../common/regexp" - "../../common/loc" - "../../common/init") - "realgud-") -(require-relative-list '("../../lang/python") "realgud-lang-") - -(defvar realgud-pat-hash) -(declare-function make-realgud-loc-pat (realgud-loc)) - -(defvar realgud:trepan2-pat-hash (make-hash-table :test 'equal) - "Hash key is the what kind of pattern we want to match: -backtrace, prompt, etc. The values of a hash entry is a -realgud-loc-pat struct") - -(declare-function make-realgud-loc 'realgud-loc) - -(setf (gethash "loc-callback-fn" realgud:trepan2-pat-hash) 'realgud:trepan2-loc-fn-callback) - -;; Regular expression that describes a trepan2 location generally shown -;; before a command prompt. -;; -;; For example: -;; (/usr/bin/zonetab2pot.py:15): -;; (/usr/bin/zonetab2pot.py:15 remapped ): -;; or MS Windows: -;; (c:\\mydirectory\\gcd.py:10): -(setf (gethash "loc" realgud:trepan2-pat-hash) - realgud:python-trepan-loc-pat) - -(setf (gethash "prompt" realgud:trepan2-pat-hash) - (make-realgud-loc-pat - :regexp "^(trepan2) " - )) - -;; Regular expression that describes a trepan2 backtrace line. -;; For example: -;; ->0 get_distribution(dist='trepan==0.3.9') -;; called from file '/python2.7/dist-packages/pkg_res.py' at line 341 -;; ##1 load_entry_point(dist='tr=0.3.9', group='console_scripts', name='tr') -;; called from file '/python2.7/dist-packages/pkg_res.py' at line 351 -;; ##2 exec() - -(setf (gethash "debugger-backtrace" realgud:trepan2-pat-hash) - realgud:python-trepan-backtrace-pat) - -;; Regular expression that describes a Python backtrace line. -(setf (gethash "lang-backtrace" realgud:trepan2-pat-hash) - realgud-python-backtrace-loc-pat) - -;; Regular expression that describes a "breakpoint set" line -(setf (gethash "brkpt-set" realgud:trepan2-pat-hash) - realgud:python-trepan-brkpt-set-pat) - -;; Regular expression that describes a "delete breakpoint" line -(setf (gethash "brkpt-del" realgud:trepan2-pat-hash) - realgud:python-trepan-brkpt-del-pat) - -;; Regular expression for a termination message. -(setf (gethash "termination" realgud:trepan2-pat-hash) - "^trepan2: That's all, folks...\n") - -(setf (gethash "font-lock-keywords" realgud:trepan2-pat-hash) - realgud:python-debugger-font-lock-keywords) - -(setf (gethash "trepan2" realgud-pat-hash) realgud:trepan2-pat-hash) - -(defvar realgud:trepan2-command-hash (make-hash-table :test 'equal) - "Hash key is command name like 'shell' and the value is - the trepan2 command to use, like 'python'") - -(setf (gethash "shell" realgud:trepan2-command-hash) "python") -(setf (gethash "until" realgud:trepan2-command-hash) "continue %l") -(setf (gethash "trepan2" realgud-command-hash) realgud:trepan2-command-hash) - -(provide-me "realgud:trepan2-") diff --git a/packages/realgud/realgud/debugger/trepan2/track-mode.el b/packages/realgud/realgud/debugger/trepan2/track-mode.el deleted file mode 100644 index 5a7947c08..000000000 --- a/packages/realgud/realgud/debugger/trepan2/track-mode.el +++ /dev/null @@ -1,63 +0,0 @@ -;; Copyright (C) 2010, 2012-2015 Rocky Bernstein -;; -;; Python "trepan2" Debugger tracking in a comint buffer. - -(eval-when-compile (require 'cl)) -(require 'load-relative) -(require-relative-list '( - "../../common/cmds" - "../../common/menu" - "../../common/track" - "../../common/track-mode" - ) - "realgud-") -(require-relative-list '("core" "init") "realgud:trepan2-") -(require-relative-list '("../../lang/python") "realgud-lang-") - -(declare-function realgud-track-mode 'realgud-track-mode) -(declare-function realgud-track-mode-hook 'realgud-track-mode) -(declare-function realgud-track-mode-setup 'realgud-track-mode) -(declare-function realgud:track-set-debugger 'realgud-track-mode) -(declare-function realgud-python-populate-command-keys 'realgud-lang-python) - -(realgud-track-mode-vars "trepan2") - -(realgud-python-populate-command-keys trepan2-track-mode-map) - -(defun trepan2-track-mode-hook() - (if trepan2-track-mode - (progn - (use-local-map trepan2-track-mode-map) - (message "using trepan2 mode map") - ) - (message "trepan2 track-mode-hook disable called") - ) -) - -(define-minor-mode trepan2-track-mode - "Minor mode for tracking trepan2 source locations inside a process shell via realgud. trepan2 is a Python debugger. See URL `https://github.com/rocky/emacs-dbgr/rocky/python2-trepan/'. - -If called interactively with no prefix argument, the mode is toggled. A prefix argument, captured as ARG, enables the mode if the argument is positive, and disables it otherwise. - -\\{trepan2-track-mode-map} -" - :init-value nil - ;; :lighter " trepan2" ;; mode-line indicator from realgud-track is sufficient. - ;; The minor mode bindings. - :global nil - :group 'realgud:trepan2 - :keymap trepan2-track-mode-map - - (realgud:track-set-debugger "trepan2") - (if trepan2-track-mode - (progn - (realgud-track-mode-setup 't) - (trepan2-track-mode-hook)) - (progn - (setq realgud-track-mode nil) - )) -) - -(define-key trepan2-short-key-mode-map "T" 'realgud:cmd-backtrace) - -(provide-me "realgud:trepan2-") diff --git a/packages/realgud/realgud/debugger/trepan2/trepan2.el b/packages/realgud/realgud/debugger/trepan2/trepan2.el deleted file mode 100644 index 5bd8eb103..000000000 --- a/packages/realgud/realgud/debugger/trepan2/trepan2.el +++ /dev/null @@ -1,66 +0,0 @@ -;;; Copyright (C) 2010-2012, 2014-2015 Rocky Bernstein -;; `trepan2' Main interface to trepan2 via Emacs -(require 'load-relative) -(require-relative-list '("../../common/helper") "realgud-") -(require-relative-list '("../../common/run") "realgud:") -(require-relative-list '("core" "track-mode") "realgud:trepan2-") - -;; This is needed, or at least the docstring part of it is needed to -;; get the customization menu to work in Emacs 24. -(defgroup realgud:trepan2 nil - "The realgud interface to the Python trepan2 debugger" - :group 'realgud - :group 'python - :version "24.2") - -(declare-function trepan2-query-cmdline 'realgud:trepan2-core) -(declare-function trepan2-parse-cmd-args 'realgud:trepan2-core) -(declare-function trepan2-track-mode 'realgud:pydbgr-track-mode) -(declare-function realgud:run-debugger 'realgud:run) - -;; ------------------------------------------------------------------- -;; User-definable variables -;; - -(defcustom realgud:trepan2-command-name - ;;"trepan2 --emacs 3" - "trepan2" - "File name for executing the Python debugger and command options. -This should be an executable on your path, or an absolute file name." - :type 'string - :group 'realgud:trepan2) - - -;; ------------------------------------------------------------------- -;; The end. -;; - -;;;###autoload -(defun realgud:trepan2 (&optional opt-cmd-line no-reset) - "Invoke the trepan2 Python debugger and start the Emacs user interface. - -String OPT-CMD-LINE is treated like a shell string; arguments are -tokenized by `split-string-and-unquote'. The tokenized string is -parsed by `trepan2-parse-cmd-args' and path elements found by that -are expanded using `realgud:expand-file-name-if-exists'. - -Normally, command buffers are reused when the same debugger is -reinvoked inside a command buffer with a similar command. If we -discover that the buffer has prior command-buffer information and -NO-RESET is nil, then that information which may point into other -buffers and source buffers which may contain marks and fringe or -marginal icons is reset. See `loc-changes-clear-buffer' to clear -fringe and marginal icons. -" - (interactive) - (realgud:run-debugger "trepan2" - 'trepan2-query-cmdline - 'trepan2-parse-cmd-args - 'realgud:trepan2-minibuffer-history - opt-cmd-line no-reset) - ) - - -(defalias 'trepan2 'realgud:trepan2) - -(provide-me "realgud-") diff --git a/packages/realgud/realgud/debugger/trepan3k/Makefile.am b/packages/realgud/realgud/debugger/trepan3k/Makefile.am deleted file mode 100644 index 23f8a8fa2..000000000 --- a/packages/realgud/realgud/debugger/trepan3k/Makefile.am +++ /dev/null @@ -1 +0,0 @@ -include ../common.mk diff --git a/packages/realgud/realgud/debugger/trepan3k/core.el b/packages/realgud/realgud/debugger/trepan3k/core.el deleted file mode 100644 index 6198e1f0a..000000000 --- a/packages/realgud/realgud/debugger/trepan3k/core.el +++ /dev/null @@ -1,173 +0,0 @@ -;;; Copyright (C) 2010, 2013-2015 Rocky Bernstein -(eval-when-compile (require 'cl)) - -(require 'load-relative) -(require-relative-list '("../../common/track" - "../../common/core" - "../../common/lang") - "realgud-") -(require-relative-list '("init") "realgud:trepan3k-") - -(declare-function realgud:expand-file-name-if-exists 'realgud-core) -(declare-function realgud-parse-command-arg 'realgud-core) -(declare-function realgud-query-cmdline 'realgud-core) -(declare-function realgud-suggest-invocation 'realgud-core) - -;; FIXME: I think the following could be generalized and moved to -;; realgud-... probably via a macro. -(defvar realgud:trepan3k-minibuffer-history nil - "minibuffer history list for the command `realgud:trepan3k'.") - -(easy-mmode-defmap trepan3k-minibuffer-local-map - '(("\C-i" . comint-dynamic-complete-filename)) - "Keymap for minibuffer prompting of gud startup command." - :inherit minibuffer-local-map) - -;; FIXME: I think this code and the keymaps and history -;; variable chould be generalized, perhaps via a macro. -(defun trepan3k-query-cmdline (&optional opt-debugger) - (realgud-query-cmdline - 'trepan3k-suggest-invocation - trepan3k-minibuffer-local-map - 'realgud-trepan3k-minibuffer-history - opt-debugger)) - -(defun trepan3k-parse-cmd-args (orig-args) - "Parse command line ARGS for the annotate level and name of script to debug. - -ARGS should contain a tokenized list of the command line to run. - -We return the a list containing -- the command processor (e.g. python) and it's arguments if any - a list of strings -- the name of the debugger given (e.g. trepan3k) and its arguments - a list of strings -- the script name and its arguments - list of strings -- whether the annotate or emacs option was given ('-A', '--annotate' or '--emacs) - a boolean - -For example for the following input - (map 'list 'symbol-name - '(python2.6 -O -Qold --emacs ./gcd.py a b)) - -we might return: - ((python2.6 -O -Qold) (trepan3k --emacs) (./gcd.py a b) 't) - -NOTE: the above should have each item listed in quotes. -" - - ;; Parse the following kind of pattern: - ;; [python python-options] trepan3k trepan3k-options script-name script-options - (let ( - (args orig-args) - (pair) ;; temp return from - (python-opt-two-args '("c" "m" "Q" "W")) - ;; Python doesn't have mandatory 2-arg options in our sense, - ;; since the two args can be run together, e.g. "-C/tmp" or "-C /tmp" - ;; - (python-two-args '()) - ;; One dash is added automatically to the below, so - ;; h is really -h and -host is really --host. - (trepan3k-two-args '("x" "-command" "e" "-execute" - "o" "-output" "t" "-target" - "a" "-annotate")) - (trepan3k-opt-two-args '()) - (interp-regexp - (if (member system-type (list 'windows-nt 'cygwin 'msdos)) - "^python[-0-9.]*\\(.exe\\)?$" - "^python[-0-9.]*$")) - - ;; Things returned - (annotate-p nil) - (debugger-args '()) - (debugger-name nil) - (interpreter-args '()) - (script-args '()) - (script-name nil) - ) - - (if (not (and args)) - ;; Got nothing: return '(nil, nil) - (list interpreter-args debugger-args script-args annotate-p) - ;; else - ;; Strip off optional "python" or "python182" etc. - (when (string-match interp-regexp - (file-name-sans-extension - (file-name-nondirectory (car args)))) - (setq interpreter-args (list (pop args))) - - ;; Strip off Python-specific options - (while (and args - (string-match "^-" (car args))) - (setq pair (realgud-parse-command-arg - args python-two-args python-opt-two-args)) - (nconc interpreter-args (car pair)) - (setq args (cadr pair)))) - - ;; Remove "trepan3k" from "trepan3k --trepan3k-options script - ;; --script-options" - (setq debugger-name (file-name-sans-extension - (file-name-nondirectory (car args)))) - (unless (string-match "^\\(trepan3k\\|cli.py\\)$" debugger-name) - (message - "Expecting debugger name `%s' to be `trepan3k' or `cli.py'" - debugger-name)) - (setq debugger-args (list (pop args))) - - ;; Skip to the first non-option argument. - (while (and args (not script-name)) - (let ((arg (car args))) - (cond - ;; Annotation or emacs option with level number. - ((or (member arg '("--annotate" "-A")) - (equal arg "--emacs")) - (setq annotate-p t) - (nconc debugger-args (list (pop args)))) - ;; Combined annotation and level option. - ((string-match "^--annotate=[0-9]" arg) - (nconc debugger-args (list (pop args)) ) - (setq annotate-p t)) - ;; Options with arguments. - ((string-match "^-" arg) - (setq pair (realgud-parse-command-arg - args trepan3k-two-args trepan3k-opt-two-args)) - (nconc debugger-args (car pair)) - (setq args (cadr pair))) - ;; Anything else must be the script to debug. - (t (setq script-name (realgud:expand-file-name-if-exists arg)) - (setq script-args (cons script-name (cdr args)))) - ))) - (list interpreter-args debugger-args script-args annotate-p)))) - -;; To silence Warning: reference to free variable -(defvar realgud:trepan3k-command-name) - -(defun trepan3k-suggest-invocation (debugger-name) - "Suggest a trepan3k command invocation via `realgud-suggest-invocaton'" - (realgud-suggest-invocation realgud:trepan3k-command-name - realgud:trepan3k-minibuffer-history - "python" "\\.py" - realgud:trepan3k-command-name)) - -(defun trepan3k-reset () - "Trepan3k cleanup - remove debugger's internal buffers (frame, -breakpoints, etc.)." - (interactive) - ;; (trepan3k-breakpoint-remove-all-icons) - (dolist (buffer (buffer-list)) - (when (string-match "\\*trepan3k-[a-z]+\\*" (buffer-name buffer)) - (let ((w (get-buffer-window buffer))) - (when w - (delete-window w))) - (kill-buffer buffer)))) - -;; (defun trepan3k-reset-keymaps() -;; "This unbinds the special debugger keys of the source buffers." -;; (interactive) -;; (setcdr (assq 'trepan3k-debugger-support-minor-mode minor-mode-map-alist) -;; trepan3k-debugger-support-minor-mode-map-when-deactive)) - - -(defun realgud:trepan3k-customize () - "Use `customize' to edit the settings of the `trepan3k' debugger." - (interactive) - (customize-group 'realgud:trepan3k)) - -(provide-me "realgud:trepan3k-") diff --git a/packages/realgud/realgud/debugger/trepan3k/init.el b/packages/realgud/realgud/debugger/trepan3k/init.el deleted file mode 100644 index 6a6b6326f..000000000 --- a/packages/realgud/realgud/debugger/trepan3k/init.el +++ /dev/null @@ -1,79 +0,0 @@ -;;; Copyright (C) 2010-2015 Rocky Bernstein -;;; trepan3k: Python 3.2 and beyond - -(eval-when-compile (require 'cl)) - -(require 'load-relative) -(require-relative-list '("../../common/regexp" - "../../common/loc" - "../../common/init") - "realgud-") -(require-relative-list '("../../lang/python") "realgud-lang-") - -(defvar realgud-pat-hash) -(declare-function make-realgud-loc-pat (realgud-loc)) - -(defvar realgud:trepan3k-pat-hash (make-hash-table :test 'equal) - "Hash key is the what kind of pattern we want to match: -backtrace, prompt, etc. The values of a hash entry is a -realgud-loc-pat struct") - -(declare-function make-realgud-loc 'realgud-loc) - -;; Regular expression that describes a trepan3k location generally shown -;; before a command prompt. -;; -;; For example: -;; (/usr/bin/zonetab2pot.py:15): -;; (/usr/bin/zonetab2pot.py:15 remapped ): -;; or MS Windows: -;; (c:\\mydirectory\\gcd.py:10): -(setf (gethash "loc" realgud:trepan3k-pat-hash) - realgud:python-trepan-loc-pat) - -(setf (gethash "prompt" realgud:trepan3k-pat-hash) - (make-realgud-loc-pat - :regexp "^(trepan3k) " - )) - -;; Regular expression that describes a trepan3k backtrace line. -;; For example: -;; ->0 get_distribution(dist='trepan==0.3.9') -;; called from file '/python2.7/dist-packages/pkg_res.py' at line 341 -;; ##1 load_entry_point(dist='tr=0.3.9', group='console_scripts', name='tr') -;; called from file '/python2.7/dist-packages/pkg_res.py' at line 351 -;; ##2 exec() - -(setf (gethash "debugger-backtrace" realgud:trepan3k-pat-hash) - realgud:python-trepan-backtrace-pat) - -;; Regular expression that describes a Python backtrace line. -(setf (gethash "lang-backtrace" realgud:trepan3k-pat-hash) - realgud-python-backtrace-loc-pat) - -;; Regular expression that describes a "breakpoint set" line -(setf (gethash "brkpt-set" realgud:trepan3k-pat-hash) - realgud:python-trepan-brkpt-set-pat) - -;; Regular expression that describes a "delete breakpoint" line -(setf (gethash "brkpt-del" realgud:trepan3k-pat-hash) - realgud:python-trepan-brkpt-del-pat) - -;; Regular expression for a termination message. -(setf (gethash "termination" realgud:trepan3k-pat-hash) - "^trepan3k: That's all, folks...\n") - -(setf (gethash "font-lock-keywords" realgud:trepan3k-pat-hash) - realgud:python-debugger-font-lock-keywords) - -(setf (gethash "trepan3k" realgud-pat-hash) realgud:trepan3k-pat-hash) - -(defvar realgud:trepan3k-command-hash (make-hash-table :test 'equal) - "Hash key is command name like 'shell' and the value is - the trepan3k command to use, like 'python'") - -(setf (gethash "shell" realgud:trepan3k-command-hash) "python") -(setf (gethash "until" realgud-command-hash) "continue %l") -(setf (gethash "trepan3k" realgud-command-hash) realgud:trepan3k-command-hash) - -(provide-me "realgud:trepan3k-") diff --git a/packages/realgud/realgud/debugger/trepan3k/track-mode.el b/packages/realgud/realgud/debugger/trepan3k/track-mode.el deleted file mode 100644 index fb5fe7793..000000000 --- a/packages/realgud/realgud/debugger/trepan3k/track-mode.el +++ /dev/null @@ -1,63 +0,0 @@ -;;; Copyright (C) 2010, 2012-2015 Rocky Bernstein -;;; Python "trepan3k" Debugger tracking a comint buffer. - -(eval-when-compile (require 'cl)) -(require 'load-relative) -(require-relative-list '( - "../../common/cmds" - "../../common/menu" - "../../common/track" - "../../common/track-mode" - ) - "realgud-") -(require-relative-list '("core" "init") "realgud:trepan3k-") -(require-relative-list '("../../lang/python") "realgud-lang-") - -(declare-function realgud-track-mode 'realgud-track-mode) -(declare-function realgud-track-mode-hook 'realgud-track-mode) -(declare-function realgud-track-mode-setup 'realgud-track-mode) -(declare-function realgud:track-set-debugger 'realgud-track-mode) -(declare-function realgud-python-populate-command-keys 'realgud-lang-python) - -(realgud-track-mode-vars "trepan3k") - -(declare-function realgud-track-mode(bool)) - -(realgud-python-populate-command-keys trepan3k-track-mode-map) - -(defun trepan3k-track-mode-hook() - (if trepan3k-track-mode - (progn - (use-local-map trepan3k-track-mode-map) - (message "using trepan3k mode map") - ) - (message "trepan3k track-mode-hook disable called") - ) -) - -(define-minor-mode trepan3k-track-mode - "Minor mode for tracking trepan3k source locations inside a process shell via realgud. trepan3k is a Python debugger. See URL `http://code.google.com/p/python3-trepan/'. - -If called interactively with no prefix argument, the mode is toggled. A prefix argument, captured as ARG, enables the mode if the argument is positive, and disables it otherwise. - -\\{trepan3k-track-mode-map} -" - :init-value nil - ;; :lighter " trepan3k" ;; mode-line indicator from realgud-track is sufficient. - ;; The minor mode bindings. - :global nil - :group 'realgud:trepan3k - :keymap trepan3k-track-mode-map - (realgud:track-set-debugger "trepan3k") - (if trepan3k-track-mode - (progn - (realgud-track-mode-setup 't) - (trepan3k-track-mode-hook)) - (progn - (setq realgud-track-mode nil) - )) -) - -(define-key trepan3k-short-key-mode-map "T" 'realgud:cmd-backtrace) - -(provide-me "realgud:trepan3k-") diff --git a/packages/realgud/realgud/debugger/trepan3k/trepan3k.el b/packages/realgud/realgud/debugger/trepan3k/trepan3k.el deleted file mode 100644 index 945bbb059..000000000 --- a/packages/realgud/realgud/debugger/trepan3k/trepan3k.el +++ /dev/null @@ -1,66 +0,0 @@ -;;; Copyright (C) 2010-2014 Rocky Bernstein -;; `trepan3k' Main interface to trepan3k via Emacs -(require 'load-relative) -(require-relative-list '("../../common/helper") "realgud-") -(require-relative-list '("../../common/run") "realgud:") -(require-relative-list '("core" "track-mode") "realgud:trepan3k-") - -;; This is needed, or at least the docstring part of it is needed to -;; get the customization menu to work in Emacs 24. -(defgroup realgud:trepan3k nil - "The realgud interface to the Python debugger, trepan3k" - :group 'realgud - :group 'python - :version "24.1") - -(declare-function trepan3k-query-cmdline 'realgud:trepan3k-core) -(declare-function trepan3k-parse-cmd-args 'realgud:trepan3k-core) -(declare-function realgud:run-debugger 'realgud:run) - -;; ------------------------------------------------------------------- -;; User-definable variables -;; - -(defcustom realgud:trepan3k-command-name - ;;"trepan3k --emacs 3" - "trepan3k" - "File name for executing the Python debugger and command options. -This should be an executable on your path, or an absolute file name." - :type 'string - :group 'realgud:trepan3k) - -(declare-function trepan3k-track-mode (bool)) - -;; ------------------------------------------------------------------- -;; The end. -;; - -;;;###autoload -(defun realgud:trepan3k (&optional opt-cmd-line no-reset) - "Invoke the trepan3k Python debugger and start the Emacs user interface. - -String OPT-CMD-LINE is treated like a shell string; arguments are -tokenized by `split-string-and-unquote'. The tokenized string is -parsed by `trepan2-parse-cmd-args' and path elements found by that -are expanded using `realgud:expand-file-name-if-exists'. - -Normally, command buffers are reused when the same debugger is -reinvoked inside a command buffer with a similar command. If we -discover that the buffer has prior command-buffer information and -NO-RESET is nil, then that information which may point into other -buffers and source buffers which may contain marks and fringe or -marginal icons is reset. See `loc-changes-clear-buffer' to clear -fringe and marginal icons. -" - (interactive) - (realgud:run-debugger "trepan3k" - 'trepan3k-query-cmdline - 'trepan3k-parse-cmd-args - 'realgud:trepan3k-minibuffer-history - opt-cmd-line no-reset) - ) - - -(defalias 'trepan3k 'realgud:trepan3k) - -(provide-me "realgud-") diff --git a/packages/realgud/realgud/debugger/trepan8/Makefile.am b/packages/realgud/realgud/debugger/trepan8/Makefile.am deleted file mode 100644 index 23f8a8fa2..000000000 --- a/packages/realgud/realgud/debugger/trepan8/Makefile.am +++ /dev/null @@ -1 +0,0 @@ -include ../common.mk diff --git a/packages/realgud/realgud/debugger/trepan8/core.el b/packages/realgud/realgud/debugger/trepan8/core.el deleted file mode 100644 index 6c8e876fc..000000000 --- a/packages/realgud/realgud/debugger/trepan8/core.el +++ /dev/null @@ -1,167 +0,0 @@ -;;; Copyright (C) 2010-2011, 2014 Rocky Bernstein -(eval-when-compile (require 'cl)) - -(require 'load-relative) - -(require-relative-list '("../../common/track" - "../../common/core" - "../../common/lang") - "realgud-") -(require-relative-list '("init") "realgud:trepan8-") - -(declare-function realgud:expand-file-name-if-exists 'realgud-core) -(declare-function realgud-parse-command-arg 'realgud-core) -(declare-function realgud-query-cmdline 'realgud-core) -(declare-function realgud-suggest-invocation 'realgud-core) - -;; FIXME: I think the following could be generalized and moved to -;; realgud-... probably via a macro. -(defvar realgud:trepan8-minibuffer-history nil - "minibuffer history list for the command `realgud:trepan8'.") - -(easy-mmode-defmap trepan8-minibuffer-local-map - '(("\C-i" . comint-dynamic-complete-filename)) - "Keymap for minibuffer prompting of gud startup command." - :inherit minibuffer-local-map) - -;; FIXME: I think this code and the keymaps and history -;; variable chould be generalized, perhaps via a macro. -(defun trepan8-query-cmdline (&optional opt-debugger) - (realgud-query-cmdline - 'trepan8-suggest-invocation - trepan8-minibuffer-local-map - 'realgud:trepan8-minibuffer-history - opt-debugger)) - -(defun trepan8-parse-cmd-args (orig-args) - "Parse command line ARGS for the annotate level and name of script to debug. - -ARGS should contain a tokenized list of the command line to run. - -We return the a list containing -* the command processor (e.g. ruby) and it's arguments if any - a list of strings -* the name of the debugger given (e.g. trepan8) and its arguments - a list of strings -* the script name and its arguments - list of strings -* whether the annotate or emacs option was given ('-A', '--annotate' or '--emacs) - a boolean - -For example for the following input - (map 'list 'symbol-name - '(ruby1.9 -W -C /tmp trepan8 --emacs ./gcd.rb a b)) - -we might return: - ((ruby1.9 -W -C) (trepan8 --emacs) (./gcd.rb a b) 't) - -Note that the script name path has been expanded via `expand-file-name'. -" - - ;; Parse the following kind of pattern: - ;; [ruby ruby-options] trepan8 trepan8-options script-name script-options - (let ( - (args orig-args) - (pair) ;; temp return from - (ruby-opt-two-args '("0" "C" "e" "E" "F" "i")) - ;; Ruby doesn't have mandatory 2-arg options in our sense, - ;; since the two args can be run together, e.g. "-C/tmp" or "-C /tmp" - ;; - (ruby-two-args '()) - ;; One dash is added automatically to the below, so - ;; h is really -h and -host is really --host. - (trepan8-two-args '("h" "-host" "p" "-port" - "I" "-include" "-r" "-require")) - (trepan8-opt-two-args '()) - - ;; Things returned - (script-name nil) - (debugger-name nil) - (interpreter-args '()) - (debugger-args '()) - (script-args '()) - (annotate-p nil)) - - (if (not (and args)) - ;; Got nothing: return '(nil, nil) - (list interpreter-args debugger-args script-args annotate-p) - ;; else - ;; Strip off optional "ruby" or "ruby182" etc. - (when (string-match "^ruby[-0-9]*$" - (file-name-sans-extension - (file-name-nondirectory (car args)))) - (setq interpreter-args (list (pop args))) - - ;; Strip off Ruby-specific options - (while (and args - (string-match "^-" (car args))) - (setq pair (realgud-parse-command-arg - args ruby-two-args ruby-opt-two-args)) - (nconc interpreter-args (car pair)) - (setq args (cadr pair)))) - - ;; Remove "trepan8" from "trepan8 --trepan8-options script - ;; --script-options" - (setq debugger-name (file-name-sans-extension - (file-name-nondirectory (car args)))) - (unless (string-match "^trepan8$" debugger-name) - (message - "Expecting debugger name `%s' to be `trepan8'" - debugger-name)) - (setq debugger-args (list (pop args))) - - ;; Skip to the first non-option argument. - (while (and args (not script-name)) - (let ((arg (car args))) - (cond - ;; Annotation or emacs option with level number. - ((or (member arg '("--annotate" "-A")) - (equal arg "--emacs")) - (setq annotate-p t) - (nconc debugger-args (list (pop args)))) - ;; Combined annotation and level option. - ((string-match "^--annotate=[0-9]" arg) - (nconc debugger-args (list (pop args)) ) - (setq annotate-p t)) - ;; Options with arguments. - ((string-match "^-" arg) - (setq pair (realgud-parse-command-arg - args trepan8-two-args trepan8-opt-two-args)) - (nconc debugger-args (car pair)) - (setq args (cadr pair))) - ;; Anything else must be the script to debug. - (t (setq script-name (realgud:expand-file-name-if-exists arg)) - (setq script-args (cons script-name (cdr args)))) - ))) - (list interpreter-args debugger-args script-args annotate-p)))) - -;; To silence Warning: reference to free variable -(defvar realgud:trepan8-command-name) - -(defun trepan8-suggest-invocation (debugger-name) - "Suggest a trepan8 command invocation via `realgud-suggest-invocaton'" - (realgud-suggest-invocation realgud:trepan8-command-name - realgud:trepan8-minibuffer-history - "ruby" "\\.rb$")) - -(defun trepan8-reset () - "Trepan8 cleanup - remove debugger's internal buffers (frame, -breakpoints, etc.)." - (interactive) - ;; (trepan8-breakpoint-remove-all-icons) - (dolist (buffer (buffer-list)) - (when (string-match "\\*trepan8-[a-z]+\\*" (buffer-name buffer)) - (let ((w (get-buffer-window buffer))) - (when w - (delete-window w))) - (kill-buffer buffer)))) - -;; (defun trepan8-reset-keymaps() -;; "This unbinds the special debugger keys of the source buffers." -;; (interactive) -;; (setcdr (assq 'trepan8-debugger-support-minor-mode minor-mode-map-alist) -;; trepan8-debugger-support-minor-mode-map-when-deactive)) - - -(defun realgud:trepan8-customize () - "Use `customize' to edit the settings of the `trepan8' debugger." - (interactive) - (customize-group 'realgud:trepan8)) - -(provide-me "realgud:trepan8-") diff --git a/packages/realgud/realgud/debugger/trepan8/init.el b/packages/realgud/realgud/debugger/trepan8/init.el deleted file mode 100644 index a6ba3d403..000000000 --- a/packages/realgud/realgud/debugger/trepan8/init.el +++ /dev/null @@ -1,140 +0,0 @@ -;;; Copyright (C) 2010, 2011 Rocky Bernstein -(eval-when-compile (require 'cl)) - -(require 'load-relative) -(require-relative-list '("../../common/regexp" "../../common/loc") "realgud-") -(require-relative-list '("../../lang/ruby") "realgud-lang-") - -(defvar realgud-pat-hash) -(declare-function make-realgud-loc-pat (realgud-loc)) - -(defvar realgud:trepan8-pat-hash (make-hash-table :test 'equal) - "Hash key is the what kind of pattern we want to match: -backtrace, prompt, etc. The values of a hash entry is a -realgud-loc-pat struct") - -;; Regular expression that describes a trepan8 location generally shown -;; before a command prompt. -;; For example: -;; -> (/tmp/fact.rb:1) -;; -- (kernel/common/scope.rb:134 remapped /tmp/scope.rb:134) -(setf (gethash "loc" realgud:trepan8-pat-hash) - (make-realgud-loc-pat - :regexp ".. (\\(?:.+ \\(?:via\\|remapped\\) \\)?\\(.+\\):\\([0-9]+\\)\\(?: @[0-9]+\\)?)" - :file-group 1 - :line-group 2)) - -;; Regular expression that describes a trepan8 command prompt -;; For example: -;; (trepan8): -;; ((trepan8)): -(setf (gethash "prompt" realgud:trepan8-pat-hash) - (make-realgud-loc-pat - :regexp "^(+trepan8\\(@[0-9]+\\|@main\\)?)+: " - )) - -;; Regular expression that describes a MRI 1.8 Ruby backtrace line. -(setf (gethash "lang-backtrace" realgud:trepan8-pat-hash) - realgud-ruby-backtrace-loc-pat) - -;; Regular expression that describes a ruby $! backtrace -(setf (gethash "dollar-bang-backtrace" realgud:trepan8-pat-hash) - realgud-ruby-dollar-bang-loc-pat) - -;; Regular expression that describes a "breakpoint set" line -;; For example: -;; Set breakpoint 1: /tmp/fact.rb:1 (@0) -(setf (gethash "brkpt-set" realgud:trepan8-pat-hash) - (make-realgud-loc-pat - :regexp "^Set breakpoint \\([0-9]+\\): .+ at \\(.+\\):\\([0-9]+\\) (@[0-9]+)" - :num 1 - :file-group 2 - :line-group 3)) - -;; Regular expression that describes a debugger "delete" (breakpoint) response. -;; For example:' -;; Deleted breakpoint 1. -(setf (gethash "brkpt-del" realgud:trepan8-pat-hash) - (make-realgud-loc-pat - :regexp "^Deleted breakpoint \\([0-9]+\\).\n" - :num 1)) - -;; Regular expression that describes a Ruby $! string -(setf (gethash "dollar-bang" realgud:trepan8-pat-hash) - realgud-ruby-dollar-bang-loc-pat) - -(setf (gethash "trepan8" realgud-pat-hash) realgud:trepan8-pat-hash) - -(defconst realgud:trepan8-frame-file-line-regexp - " at \\(.*\\):\\([0-9]+\\)$") - -(defconst realgud:trepan8-frame-start-regexp realgud:trepan-frame-start-regexp) -(defconst realgud:trepan8-frame-num-regexp realgud:trepan-frame-start-regexp) - -;; Regular expression that describes a debugger "backtrace" command line. -;; e.g. -;; --> #0 at line /usr/bin/irb:12 -;; #1 main.__script__ at /tmp/fact.rb:1 -;; #1 main.__script__ at /tmp/fact.rb:1 -;; #0 IRB.start(ap_path#String) at line /usr/lib/ruby/1.8/irb.rb:52 -(setf (gethash "debugger-backtrace" realgud:trepan8-pat-hash) - (make-realgud-loc-pat - :regexp (concat realgud:trepan8-frame-start-regexp " " - realgud:trepan8-frame-num-regexp - "\\(?: \\(?:\\(.+\\)(\\(.*\\))\\)\\)?" - realgud:trepan8-frame-file-line-regexp - ) - :num 2 - :file-group 5 - :line-group 6) - ) - -;; Regular expression that for a termination message. -(setf (gethash "termination" realgud:trepan8-pat-hash) - "^trepan8: That's all, folks...\n") - -(setf (gethash "font-lock-keywords" realgud:trepan8-pat-hash) - '( - ;; Parameters and first type entry. E.g Object.gcd(a#Fixnum, b#Fixnum) - ;; ^-^^^^^^ ^-^^^^^^ - ("\\<\\([a-zA-Z_][a-zA-Z0-9_]*\\)#\\([a-zA-Z_][a-zA-Z0-9_]*\\)\\>" - (1 font-lock-variable-name-face) - (2 font-lock-constant-face)) - - ;; "::Type", which occurs in class name of function and in - ;; parameter list. - ("::\\([a-zA-Z_][a-zA-Z0-9_]*\\)" - (1 font-lock-type-face)) - - ;; The frame number and first type name, if present. - ;; E.g. --> #0 Object.gcd(a#Fixnum, b#Fixnum) - ;; -----^-^^^^^^.^^^ - ("^\\(-->\\)? *#\\([0-9]+\\) *\\(\\([a-zA-Z_][a-zA-Z0-9_]*\\)[.:]\\)?" - (2 realgud-backtrace-number-face) - (4 font-lock-constant-face nil t)) ; t means optional. - - ;; File name and line number. E.g. at line /test/gcd.rb:6 - ;; -------^^^^^^^^^^^^^-^ - ("at line \\(.*\\):\\([0-9]+\\)$" - (1 realgud-file-name-face) - (2 realgud-line-number-face)) - - ;; Function name. - ("\\<\\([a-zA-Z_][a-zA-Z0-9_]*\\)\\.\\([a-zA-Z_][a-zA-Z0-9_]*\\)" - (1 font-lock-type-face) - (2 font-lock-function-name-face)) - ;; (trepan-frames-match-current-line - ;; (0 trepan-frames-current-frame-face append)) - )) - -(setf (gethash "trepan8" realgud-pat-hash) realgud:trepan8-pat-hash) - -(defvar realgud:trepan8-command-hash (make-hash-table :test 'equal) - "Hash key is command name like 'quit' and the value is - the trepan8 command to use, like 'quit!'") - -(setf (gethash "quit" realgud:trepan8-command-hash) "quit!") -(setf (gethash "shell" realgud:trepan8-command-hash) "irb") -(setf (gethash "trepan8" realgud-command-hash) realgud:trepan8-command-hash) - -(provide-me "realgud:trepan8-") diff --git a/packages/realgud/realgud/debugger/trepan8/track-mode.el b/packages/realgud/realgud/debugger/trepan8/track-mode.el deleted file mode 100644 index 93e057cd1..000000000 --- a/packages/realgud/realgud/debugger/trepan8/track-mode.el +++ /dev/null @@ -1,57 +0,0 @@ -;;; Copyright (C) 2010-2011, 2014-2015 Rocky Bernstein -;;; Ruby "trepan8" Debugger tracking a comint buffer. - -(eval-when-compile (require 'cl)) -(require 'load-relative) -(require-relative-list '( - "../../common/cmds" - "../../common/menu" - "../../common/track" - "../../common/track-mode" - ) - "realgud-") -(require-relative-list '("core" "init") "realgud:trepan8-") -(require-relative-list '("../../lang/ruby") "realgud-lang-") - -(realgud-track-mode-vars "trepan8") - -(declare-function realgud-track-mode 'realgud-track-mode) -(declare-function realgud-track-mode-hook 'realgud-track-mode) -(declare-function realgud-track-mode-setup 'realgud-track-mode) -(declare-function realgud:track-set-debugger 'realgud-track-mode) -(declare-function realgud:ruby-populate-command-keys 'realgud-lang-ruby) - -(realgud:ruby-populate-command-keys trepan8-track-mode-map) - -(define-key trepan8-track-mode-map - (kbd "C-c !!") 'realgud:ruby-goto-dollar-bang-line) - -(defun trepan8-track-mode-hook() - (use-local-map trepan8-track-mode-map) - (message "trepan8 track-mode-hook called") -) -(define-minor-mode trepan8-track-mode - "Minor mode for tracking trepan8 source locations inside a process shell via realgud. trepan8 is a Ruby debugger for version 1.8. - -If called interactively with no prefix argument, the mode is toggled. A prefix argument, captured as ARG, enables the mode if the argument is positive, and disables it otherwise. - -\\{trepan8-track-mode-map} -" - :init-value nil - ;; :lighter " trepan8" ;; mode-line indicator from realgud-track is sufficient. - ;; The minor mode bindings. - :global nil - :group 'realgud:trepan8 - :keymap trepan8-track-mode-map - - (realgud:track-set-debugger "trepan8") - (if trepan8-track-mode - (progn - (realgud-track-mode 't) - (trepan8-track-mode-hook)) - (progn - (realgud-track-mode nil) - )) -) - -(provide-me "realgud:trepan8-") diff --git a/packages/realgud/realgud/debugger/trepan8/trepan8.el b/packages/realgud/realgud/debugger/trepan8/trepan8.el deleted file mode 100644 index 8f96c6ede..000000000 --- a/packages/realgud/realgud/debugger/trepan8/trepan8.el +++ /dev/null @@ -1,62 +0,0 @@ -;;; Copyright (C) 2010-2011, 2015 Rocky Bernstein -;; `trepan8' Main interface to trepan8 via Emacs -(require 'load-relative) -(require-relative-list '("../../common/helper") "realgud-") -(require-relative-list '("../../common/run") "realgud:") -(require-relative-list '("core" "track-mode") "realgud:trepan8-") - -(declare-function trepan8-query-cmdline 'realgud:trepan8-core) -(declare-function trepan8-parse-cmd-args 'realgud:trepan8-core) -(declare-function realgud:run-debugger 'realgud:run) - -;; This is needed, or at least the docstring part of it is needed to -;; get the customization menu to work in Emacs 24. -(defgroup realgud:trepan8 nil - "The reagud interface toe th Ruby \"trepanning\" debugger for Ruby 1.8" - :group 'ruby - :group 'realgud - :version "23.4") - -;; ------------------------------------------------------------------- -;; User-definable variables -;; - -(defcustom realgud:trepan8-command-name - ;;"trepan8 --emacs 3" - "trepan8" - "File name for executing the Ruby debugger and command options. -This should be an executable on your path, or an absolute file name." - :type 'string - :group 'realgud:trepan8) - -;; ------------------------------------------------------------------- -;; The end. -;; - -;;;###autoload -(defun realgud:trepan8 (&optional opt-cmd-line no-reset) - "Invoke the trepan8 Ruby debugger and start the Emacs user interface. - -String OPT-CMD-LINE is treated like a shell string; arguments are -tokenized by `split-string-and-unquote'. The tokenized string is -parsed by `trepan8-parse-cmd-args' and path elements found by that -are expanded using `realgud:expand-file-name-if-exists'. - -Normally, command buffers are reused when the same debugger is -reinvoked inside a command buffer with a similar command. If we -discover that the buffer has prior command-buffer information and -NO-RESET is nil, then that information which may point into other -buffers and source buffers which may contain marks and fringe or -marginal icons is reset. See `loc-changes-clear-buffer' to clear -fringe and marginal icons. -" - (interactive) - (realgud:run-debugger "trepan8" 'trepan8-query-cmdline - 'trepan8-parse-cmd-args - 'realgud:trepan8-minibuffer-history - opt-cmd-line no-reset) - ) - -(defalias 'trepan8 'realgud:trepan8) - -(provide-me "realgud-") diff --git a/packages/realgud/realgud/debugger/trepanx/Makefile.am b/packages/realgud/realgud/debugger/trepanx/Makefile.am deleted file mode 100644 index 23f8a8fa2..000000000 --- a/packages/realgud/realgud/debugger/trepanx/Makefile.am +++ /dev/null @@ -1 +0,0 @@ -include ../common.mk diff --git a/packages/realgud/realgud/debugger/trepanx/core.el b/packages/realgud/realgud/debugger/trepanx/core.el deleted file mode 100644 index f00d301aa..000000000 --- a/packages/realgud/realgud/debugger/trepanx/core.el +++ /dev/null @@ -1,166 +0,0 @@ -;;; Copyright (C) 2010, 2014 Rocky Bernstein -(eval-when-compile (require 'cl)) - -(require 'load-relative) - -(require-relative-list '("../../common/track" - "../../common/core" - "../../common/lang") - "realgud-") -(require-relative-list '("init") "realgud:trepanx-") - -(declare-function realgud-parse-command-arg 'realgud-core) -(declare-function realgud-query-cmdline 'realgud-core) -(declare-function realgud-suggest-invocation 'realgud-core) - -;; FIXME: I think the following could be generalized and moved to -;; realgud-... probably via a macro. -(defvar realgud:trepanx-minibuffer-history nil - "minibuffer history list for the command `realgud:trepanx'.") - -(easy-mmode-defmap trepanx-minibuffer-local-map - '(("\C-i" . comint-dynamic-complete-filename)) - "Keymap for minibuffer prompting of gud startup command." - :inherit minibuffer-local-map) - -;; FIXME: I think this code and the keymaps and history -;; variable chould be generalized, perhaps via a macro. -(defun trepanx-query-cmdline (&optional opt-debugger) - (realgud-query-cmdline - 'trepanx-suggest-invocation - trepanx-minibuffer-local-map - 'realgud:trepanx-minibuffer-history - opt-debugger)) - -(defun trepanx-parse-cmd-args (orig-args) - "Parse command line ARGS for the annotate level and name of script to debug. - -ARGS should contain a tokenized list of the command line to run. - -We return the a list containing -- the command processor (e.g. ruby) and it's arguments if any - a list of strings -- the name of the debugger given (e.g. trepanx) and its arguments - a list of strings -- the script name and its arguments - list of strings -- whether the annotate or emacs option was given ('-A', '--annotate' or '--emacs) - a boolean - -For example for the following input - (map 'list 'symbol-name - '(ruby1.9 -W -C /tmp trepanx --emacs ./gcd.rb a b)) - -we might return: - ((ruby1.9 -W -C) (trepanx --emacs) (./gcd.rb a b) 't) - -NOTE: the above should have each item listed in quotes. -" - - ;; Parse the following kind of pattern: - ;; [ruby ruby-options] trepanx trepanx-options script-name script-options - (let ( - (args orig-args) - (pair) ;; temp return from - (ruby-opt-two-args '("0" "C" "e" "E" "F" "i")) - ;; Ruby doesn't have mandatory 2-arg options in our sense, - ;; since the two args can be run together, e.g. "-C/tmp" or "-C /tmp" - ;; - (ruby-two-args '()) - ;; One dash is added automatically to the below, so - ;; h is really -h and -host is really --host. - (trepanx-two-args '("h" "-host" "p" "-port" - "I" "-include" "-r" "-require")) - (trepanx-opt-two-args '()) - - ;; Things returned - (script-name nil) - (debugger-name nil) - (interpreter-args '()) - (debugger-args '()) - (script-args '()) - (annotate-p nil)) - - (if (not (and args)) - ;; Got nothing: return '(nil, nil) - (list interpreter-args debugger-args script-args annotate-p) - ;; else - ;; Strip off optional "ruby" or "ruby182" etc. - (when (string-match "^ruby[-0-9]*$" - (file-name-sans-extension - (file-name-nondirectory (car args)))) - (setq interpreter-args (list (pop args))) - - ;; Strip off Ruby-specific options - (while (and args - (string-match "^-" (car args))) - (setq pair (realgud-parse-command-arg - args ruby-two-args ruby-opt-two-args)) - (nconc interpreter-args (car pair)) - (setq args (cadr pair)))) - - ;; Remove "trepanx" from "trepanx --trepanx-options script - ;; --script-options" - (setq debugger-name (file-name-sans-extension - (file-name-nondirectory (car args)))) - (unless (string-match "^trepanx$" debugger-name) - (message - "Expecting debugger name `%s' to be `trepanx'" - debugger-name)) - (setq debugger-args (list (pop args))) - - ;; Skip to the first non-option argument. - (while (and args (not script-name)) - (let ((arg (car args))) - (cond - ;; Annotation or emacs option with level number. - ((or (member arg '("--annotate" "-A")) - (equal arg "--emacs")) - (setq annotate-p t) - (nconc debugger-args (list (pop args)))) - ;; Combined annotation and level option. - ((string-match "^--annotate=[0-9]" arg) - (nconc debugger-args (list (pop args)) ) - (setq annotate-p t)) - ;; Options with arguments. - ((string-match "^-" arg) - (setq pair (realgud-parse-command-arg - args trepanx-two-args trepanx-opt-two-args)) - (nconc debugger-args (car pair)) - (setq args (cadr pair))) - ;; Anything else must be the script to debug. - (t (setq script-name arg) - (setq script-args args)) - ))) - (list interpreter-args debugger-args script-args annotate-p)))) - -;; To silence Warning: reference to free variable -(defvar realgud:trepanx-command-name) - -(defun trepanx-suggest-invocation (debugger-name) - "Suggest a trepanx command invocation via `realgud-suggest-invocaton'" - (realgud-suggest-invocation realgud:trepanx-command-name - realgud:trepanx-minibuffer-history - "ruby" "\\.rb$" "trepanx")) - -(defun trepanx-reset () - "Trepanx cleanup - remove debugger's internal buffers (frame, -breakpoints, etc.)." - (interactive) - ;; (trepanx-breakpoint-remove-all-icons) - (dolist (buffer (buffer-list)) - (when (string-match "\\*trepanx-[a-z]+\\*" (buffer-name buffer)) - (let ((w (get-buffer-window buffer))) - (when w - (delete-window w))) - (kill-buffer buffer)))) - -;; (defun trepanx-reset-keymaps() -;; "This unbinds the special debugger keys of the source buffers." -;; (interactive) -;; (setcdr (assq 'trepanx-debugger-support-minor-mode minor-mode-map-alist) -;; trepanx-debugger-support-minor-mode-map-when-deactive)) - - -(defun realgud:trepanx-customize () - "Use `customize' to edit the settings of the `trepanx' debugger." - (interactive) - (customize-group 'realgud:trepanx)) - -(provide-me "realgud:trepanx-") diff --git a/packages/realgud/realgud/debugger/trepanx/init.el b/packages/realgud/realgud/debugger/trepanx/init.el deleted file mode 100644 index 9f0338569..000000000 --- a/packages/realgud/realgud/debugger/trepanx/init.el +++ /dev/null @@ -1,143 +0,0 @@ -;;; Copyright (C) 2010-2011, 2014 Rocky Bernstein -(eval-when-compile (require 'cl)) - -(require 'load-relative) -(require-relative-list '("../../common/regexp" "../../common/loc") "realgud-") -(require-relative-list '("../../lang/ruby") "realgud-lang-") - -(defvar realgud-pat-hash) -(declare-function make-realgud-loc-pat (realgud-loc)) - -(defvar realgud:trepanx-pat-hash (make-hash-table :test 'equal) - "Hash key is the what kind of pattern we want to match: -backtrace, prompt, etc. The values of a hash entry is a -realgud-loc-pat struct") - -;; Regular expression that describes a trepanx location generally shown -;; before a command prompt. -;; For example: -;; -> (/tmp/fact.rb:1) -;; -- (kernel/common/scope.rb:134 remapped /tmp/scope.rb:134) -(setf (gethash "loc" realgud:trepanx-pat-hash) - (make-realgud-loc-pat - :regexp ".. (\\(?:.+ \\(?:via\\|remapped\\) \\)?\\(.+\\):\\([0-9]+\\)\\(?: @[0-9]+\\)?)" - :file-group 1 - :line-group 2)) - -;; Regular expression that describes a trepanx command prompt -;; For example: -;; (trepanx): -;; ((trepanx)): -(setf (gethash "prompt" realgud:trepanx-pat-hash) - (make-realgud-loc-pat - :regexp "^(+trepanx\\(@[0-9]+\\|@main\\)?)+: " - )) - -;; Regular expression that describes a Rubinius backtrace line. -(setf (gethash "lang-backtrace" realgud:trepanx-pat-hash) - realgud-rubinius-backtrace-loc-pat) - -;; Regular expression that describes a ruby $! backtrace -(setf (gethash "dollar-bang-backtrace" realgud:trepanx-pat-hash) - realgud-ruby-dollar-bang-loc-pat) - -;; Regular expression that describes a Rubinius X-agent backtrace -;; line. -(setf (gethash "rubinius-backtrace-Xagent" realgud:trepanx-pat-hash) - realgud-rubinius-Xagent-backtrace-loc-pat) - -;; Regular expression that describes a "breakpoint set" line -;; For example: -;; Set breakpoint 1: /tmp/fact.rb:1 (@0) -(setf (gethash "brkpt-set" realgud:trepanx-pat-hash) - (make-realgud-loc-pat - :regexp "^Set breakpoint \\([0-9]+\\): .+ at \\(.+\\):\\([0-9]+\\) (@[0-9]+)" - :num 1 - :file-group 2 - :line-group 3)) - -;; Regular expression that describes a debugger "delete" (breakpoint) response. -;; For example:' -;; Deleted breakpoint 1. -(setf (gethash "brkpt-del" realgud:trepanx-pat-hash) - (make-realgud-loc-pat - :regexp "^Deleted breakpoint \\([0-9]+\\).\n" - :num 1)) - -;; Regular expression that describes a Ruby $! string -(setf (gethash "dollar-bang" realgud:trepanx-pat-hash) - realgud-ruby-dollar-bang-loc-pat) - -(setf (gethash "trepanx" realgud-pat-hash) realgud:trepanx-pat-hash) - -(defconst realgud:trepanx-frame-file-line-regexp - " at \\(.*\\):\\([0-9]+\\)$") - -(defconst realgud:trepanx-frame-start-regexp realgud:trepan-frame-start-regexp) -(defconst realgud:trepanx-frame-num-regexp realgud:trepan-frame-start-regexp) - -;; Regular expression that describes a debugger "backtrace" command line. -;; e.g. -;; --> #0 Rubinius::Scope#my_method at kernel/common/variable_scope.rb:134 -;; #1 main.__script__ at /tmp/fact.rb:1 -(setf (gethash "debugger-backtrace" realgud:trepanx-pat-hash) - (make-realgud-loc-pat - :regexp (concat realgud:trepanx-frame-start-regexp " " - realgud:trepanx-frame-num-regexp " " - "\\([A-Z_][a-zA-Z0-9_:]*\\)[#.]\\(.*\\)" - realgud:trepanx-frame-file-line-regexp - ) - :num 2 - :file-group 6 - :line-group 7) - ) - -;; Regular expression that for a termination message. -(setf (gethash "termination" realgud:trepanx-pat-hash) - "^trepanx: That's all, folks...\n") - -(setf (gethash "font-lock-keywords" realgud:trepanx-pat-hash) - '( - ;; File name and line number. E.g. at /test/gcd.rb:6 - ;; ---^^^^^^^^^^^^-^ - (" at \\(.*\\):\\([0-9]+\\)$" - (1 realgud-file-name-face) - (2 realgud-line-number-face)) - - ;; The frame number and first type name, if present. - ("^\\(-->\\| \\)? #\\([0-9]+\\) \\([a-zA-Z_][a-zA-Z0-9_]*\\).*\\(\\([#.]\\)?\\([a-zA-Z_][a-zA-Z_[0-9]]*\\)?\\)?" - (2 realgud-backtrace-number-face) - (3 font-lock-constant-face) ; e.g. Object - (6 font-lock-function-name-face nil t)) ; t means optional - - ;; The frame number and first type name, if present. - ("^ +\\([0-9]+\\) *\\([a-zA-Z_][a-zA-Z0-9_]*\\).*\\(\\([#.]\\)?\\([a-zA-Z_][a-zA-Z_[0-9]]*\\)?\\)?" - (1 realgud-backtrace-number-face) - (2 font-lock-constant-face) ; e.g. Object - (5 font-lock-function-name-face nil t)) ; t means optional - ;; Parameter sequence - ("(\\(.+\\))" - (1 font-lock-variable-name-face)) - ;; "::Type", which occurs in class name of function and in parameter list. - ("::\\([a-zA-Z_][a-zA-Z0-9_]*\\)" - (1 font-lock-type-face)) - - ;; Function name. - ("\\<\\([a-zA-Z_][a-zA-Z0-9_]*\\)\\.\\([a-zA-Z_][a-zA-Z0-9_]*\\)" - (1 font-lock-type-face) - (2 font-lock-function-name-face)) - ;; (trepan-frames-match-current-line - ;; (0 trepan-frames-current-frame-face append)) - )) - -(setf (gethash "trepanx" realgud-pat-hash) realgud:trepanx-pat-hash) - -(defvar realgud:trepanx-command-hash (make-hash-table :test 'equal) - "Hash key is command name like 'quit' and the value is - the trepanx command to use, like 'quit!'") - -(setf (gethash "quit" realgud:trepanx-command-hash) "quit!") -(setf (gethash "shell" realgud:trepanx-command-hash) "irb") -(setf (gethash "trepanx" realgud-command-hash) realgud:trepanx-command-hash) - -(provide-me "realgud:trepanx-") diff --git a/packages/realgud/realgud/debugger/trepanx/track-mode.el b/packages/realgud/realgud/debugger/trepanx/track-mode.el deleted file mode 100644 index 9a3603249..000000000 --- a/packages/realgud/realgud/debugger/trepanx/track-mode.el +++ /dev/null @@ -1,61 +0,0 @@ -;;; Copyright (C) 2010, 2012-2014 Rocky Bernstein -;;; Ruby "trepanx" Debugger tracking a comint or eshell buffer. - -(eval-when-compile (require 'cl)) -(require 'load-relative) -(require-relative-list '( - "../../common/cmds" - "../../common/menu" - "../../common/track" - "../../common/track-mode" - ) - "realgud-") -(require-relative-list '("core" "init") "realgud:trepanx-") -(require-relative-list '("../../lang/ruby") "realgud-lang-") - -(realgud-track-mode-vars "trepanx") - -(declare-function realgud-track-mode(bool)) - -(declare-function realgud:ruby-populate-command-keys 'realgud-lang-ruby) -(declare-function realgud-track-mode 'realgud-track-mode) -(declare-function realgud-track-mode-hook 'realgud-track-mode) -(declare-function realgud-track-mode-setup 'realgud-track-mode) -(declare-function realgud:track-set-debugger 'realgud-track-mode) - -(realgud:ruby-populate-command-keys trepanx-track-mode-map) - -(define-key trepanx-track-mode-map - (kbd "C-c !x") 'realgud:rubinius-goto-Xagent-backtrace-line) -(define-key trepanx-track-mode-map - (kbd "C-c !!") 'realgud:ruby-goto-dollar-bang-line) - -(defun trepanx-track-mode-hook() - (use-local-map trepanx-track-mode-map) - (message "trepanx track-mode-hook called") -) -(define-minor-mode trepanx-track-mode - "Minor mode for tracking trepanx source locations inside a process shell via realgud. trepanx is a Rubinius Ruby debugger. - -If called interactively with no prefix argument, the mode is toggled. A prefix argument, captured as ARG, enables the mode if the argument is positive, and disables it otherwise. - -\\{trepanx-track-mode-map}" - - :init-value nil - ;; :lighter " trepanx" ;; mode-line indicator from realgud-track is sufficient. - ;; The minor mode bindings. - :global nil - :group 'realgud:trepanx - :keymap trepanx-track-mode-map - - (realgud:track-set-debugger "trepanx") - (if trepanx-track-mode - (progn - (realgud-track-mode-setup 't) - (trepanx-track-mode-hook)) - (progn - (setq realgud-track-mode nil) - )) -) - -(provide-me "realgud:trepanx-") diff --git a/packages/realgud/realgud/debugger/trepanx/trepanx.el b/packages/realgud/realgud/debugger/trepanx/trepanx.el deleted file mode 100644 index ede316384..000000000 --- a/packages/realgud/realgud/debugger/trepanx/trepanx.el +++ /dev/null @@ -1,64 +0,0 @@ -;;; Copyright (C) 2010-2011, 2014-2015 Rocky Bernstein -;; `trepanx' Main interface to trepanx via Emacs -(require 'load-relative) -(require-relative-list '("../../common/helper") "realgud-") -(require-relative-list '("../../common/track") "realgud-") -(require-relative-list '("core" "track-mode") "realgud:trepanx-") - -(declare-function trepanx-query-cmdline 'realgud:trepanx-core) -(declare-function trepanx-parse-cmd-args 'realgud:trepanx-core) -(declare-function realgud:run-process 'realgud-run) - -;; This is needed, or at least the docstring part of it is needed to -;; get the customization menu to work in Emacs 24. -(defgroup realgud:trepanx nil - "The realgud interface to the Rubinius \"trepanning\" debugger" - :group 'ruby - :group 'realgud - :version "23.1") - -;; ------------------------------------------------------------------- -;; User definable variables -;; - -(defcustom realgud:trepanx-command-name - ;;"trepanx --emacs 3" - "trepanx" - "File name for executing the Ruby debugger and command options. -This should be an executable on your path, or an absolute file name." - :type 'string - :group 'realgud:trepanx) - -;; ------------------------------------------------------------------- -;; The end. -;; - -;;;###autoload -(defun realgud:trepanx (&optional opt-command-line no-reset) - "Invoke the trepanx Ruby debugger and start the Emacs user interface. - -String COMMAND-LINE specifies how to run trepanx. - -Normally command buffers are reused when the same debugger is -reinvoked inside a command buffer with a similar command. If we -discover that the buffer has prior command-buffer information and -NO-RESET is nil, then that information which may point into other -buffers and source buffers which may contain marks and fringe or -marginal icons is reset." - (interactive) - (let* ( - (cmd-str (or opt-command-line (trepanx-query-cmdline "trepanx"))) - (cmd-args (split-string-and-unquote cmd-str)) - (parsed-args (trepanx-parse-cmd-args cmd-args)) - (script-args (cdr cmd-args)) - (script-name (car script-args)) - (cmd-buf)) - (realgud:run-process "trepanx" script-name cmd-args - 'realgud:trepanx-minibuffer-history - no-reset) - ) - ) - -(defalias 'trepanx 'realgud:trepanx) - -(provide-me "realgud-") diff --git a/packages/realgud/realgud/debugger/zshdb/Makefile.am b/packages/realgud/realgud/debugger/zshdb/Makefile.am deleted file mode 100644 index 23f8a8fa2..000000000 --- a/packages/realgud/realgud/debugger/zshdb/Makefile.am +++ /dev/null @@ -1 +0,0 @@ -include ../common.mk diff --git a/packages/realgud/realgud/debugger/zshdb/core.el b/packages/realgud/realgud/debugger/zshdb/core.el deleted file mode 100644 index b07423ae1..000000000 --- a/packages/realgud/realgud/debugger/zshdb/core.el +++ /dev/null @@ -1,176 +0,0 @@ -;;; Copyright (C) 2010-2011, 2014-2015 Rocky Bernstein -(eval-when-compile (require 'cl)) - -(require 'load-relative) -(require-relative-list '("../../common/track" "../../common/core") - "realgud-") -(require-relative-list '("init") "realgud:zshdb-") - -(declare-function realgud:expand-file-name-if-exists 'realgud-core) -(declare-function realgud-parse-command-arg 'realgud-core) -(declare-function realgud-query-cmdline 'realgud-core) -(declare-function realgud-suggest-invocation 'realgud-core) -(declare-function realgud-lang-mode? 'realgud-lang) - -;; FIXME: I think the following could be generalized and moved to -;; realgud-... probably via a macro. -(defvar realgud:zshdb-minibuffer-history nil - "minibuffer history list for the command `realgud:zshdb'.") - -(easy-mmode-defmap zshdb-minibuffer-local-map - '(("\C-i" . comint-dynamic-complete-filename)) - "Keymap for minibuffer prompting of zshdb startup command." - :inherit minibuffer-local-map) - -;; FIXME: I think this code and the keymaps and history -;; variable chould be generalized, perhaps via a macro. -(defun zshdb-query-cmdline (&optional opt-debugger) - (realgud-query-cmdline - 'zshdb-suggest-invocation - zshdb-minibuffer-local-map - 'realgud:zshdb-minibuffer-history - opt-debugger)) - -;;; FIXME: DRY this with other *-parse-cmd-args routines -(defun zshdb-parse-cmd-args (orig-args) - "Parse command line ORIG-ARGS for the annotate level and name of script to debug. - -ORIG-ARGS should contain a tokenized list of the command line to run. - -We return the a list containing -* the command processor (e.g. zshdb) and it's arguments if any - a list of strings -* the name of the debugger given (e.g. zshdb) and its arguments - a list of strings -* the script name and its arguments - list of strings -* whether the annotate or emacs option was given ('-A', '--annotate' or '--emacs) - a boolean - -For example for the following input - (map 'list 'symbol-name - '(zsh -b /usr/local/bin/zshdb -A -L . ./gcd.sh a b)) - -we might return: - ((\"zsh\" \"-b\") (\"/usr/local/bin/zshdb\" \"-A\") (\"-L\" \"/tmp\" \"/tmp/gcd.sh\" \"a\" \"b\") 't) - -Note that path elements have been expanded via `realgud:expand-file-name-if-exists'. -" - - ;; Parse the following kind of pattern: - ;; [zsh zsh-options] zshdb zshdb-options script-name script-options - (let ( - (args orig-args) - (pair) ;; temp return from - ;; zsh doesn't have any optional two-arg options - (zsh-opt-two-args '()) - (zsh-two-args '("o" "c")) - - ;; One dash is added automatically to the below, so - ;; h is really -h and -host is really --host. - (zshdb-two-args '("A" "-annotate" "l" "-library" - "c" "-command" "-t" "-tty" - "x" "-eval-command")) - (zshdb-opt-two-args '()) - (interp-regexp - (if (member system-type (list 'windows-nt 'cygwin 'msdos)) - "^zsh*\\(.exe\\)?$" - "^zsh*$")) - - ;; Things returned - (script-name nil) - (debugger-name nil) - (interpreter-args '()) - (debugger-args '()) - (script-args '()) - (annotate-p nil)) - - (if (not (and args)) - ;; Got nothing: return '(nil, nil) - (list interpreter-args debugger-args script-args annotate-p) - ;; else - ;; Strip off optional "zsh" or "zsh.exe" etc. - (when (string-match interp-regexp - (file-name-sans-extension - (file-name-nondirectory (car args)))) - (setq interpreter-args (list (pop args))) - - ;; Strip off zsh-specific options - (while (and args - (string-match "^-" (car args))) - (setq pair (realgud-parse-command-arg - args zsh-two-args zsh-opt-two-args)) - (nconc interpreter-args (car pair)) - (setq args (cadr pair)))) - - ;; Remove "zshdb" from "zshdb --zshdb-options script - ;; --script-options" - (setq debugger-name (file-name-sans-extension - (file-name-nondirectory (car args)))) - (unless (string-match "^zshdb$" debugger-name) - (message - "Expecting debugger name `%s' to be `zshdb'" - debugger-name)) - (setq debugger-args (list (pop args))) - - ;; Skip to the first non-option argument. - (while (and args (not script-name)) - (let ((arg (car args))) - (cond - ;; Annotation or emacs option with level number. - ((or (member arg '("--annotate" "-A")) - (equal arg "--emacs")) - (setq annotate-p t) - (nconc debugger-args (list (pop args)))) - ;; Combined annotation and level option. - ((string-match "^--annotate=[0-9]" arg) - (nconc debugger-args (list (pop args)) ) - (setq annotate-p t)) - ;; Library option - ((member arg '("--library" "-l")) - (setq arg (pop args)) - (nconc debugger-args - (list arg (realgud:expand-file-name-if-exists - (pop args))))) - ;; Other options with arguments. - ((string-match "^-" arg) - (setq pair (realgud-parse-command-arg - args zshdb-two-args zshdb-opt-two-args)) - (nconc debugger-args (car pair)) - (setq args (cadr pair))) - ;; Anything else must be the script to debug. - (t (setq script-name (realgud:expand-file-name-if-exists arg)) - (setq script-args (cons script-name (cdr args)))) - ))) - (list interpreter-args debugger-args script-args annotate-p)))) - -;; To silence Warning: reference to free variable -(defvar realgud:zshdb-command-name) - -(defun zshdb-suggest-invocation (debugger-name) - "Suggest a zshdb command invocation via `realgud-suggest-invocaton'" - (realgud-suggest-invocation realgud:zshdb-command-name - realgud:zshdb-minibuffer-history - "sh" "\\.\\(?:z\\)?sh$")) - -(defun zshdb-reset () - "Zshdb cleanup - remove debugger's internal buffers (frame, -breakpoints, etc.)." - (interactive) - ;; (zshdb-breakpoint-remove-all-icons) - (dolist (buffer (buffer-list)) - (when (string-match "\\*zshdb-[a-z]+\\*" (buffer-name buffer)) - (let ((w (get-buffer-window buffer))) - (when w - (delete-window w))) - (kill-buffer buffer)))) - -;; (defun zshdb-reset-keymaps() -;; "This unbinds the special debugger keys of the source buffers." -;; (interactive) -;; (setcdr (assq 'zshdb-debugger-support-minor-mode minor-mode-map-alist) -;; zshdb-debugger-support-minor-mode-map-when-deactive)) - - -(defun realgud:zshdb-customize () - "Use `customize' to edit the settings of the `zshdb' debugger." - (interactive) - (customize-group 'realgud:zshdb)) - -(provide-me "realgud:zshdb-") diff --git a/packages/realgud/realgud/debugger/zshdb/init.el b/packages/realgud/realgud/debugger/zshdb/init.el deleted file mode 100644 index 493110597..000000000 --- a/packages/realgud/realgud/debugger/zshdb/init.el +++ /dev/null @@ -1,75 +0,0 @@ -;;; Copyright (C) 2010, 2014-2015 Rocky Bernstein -;;; Regular expressions for Z shell debugger: zshdb - -(eval-when-compile (require 'cl)) - -(require 'load-relative) -(require-relative-list '("../../common/regexp" - "../../common/loc" - "../../common/init") - "realgud-") -(require-relative-list '("../../lang/posix-shell") "realgud-lang-") - -(defvar realgud:zshdb-pat-hash) -(declare-function make-realgud-loc-pat (realgud-loc)) - -(defvar realgud:zshdb-pat-hash (make-hash-table :test 'equal) - "Hash key is the what kind of pattern we want to match: -backtrace, prompt, etc. The values of a hash entry is a -realgud-loc-pat struct") - -;; Regular expression that describes a zshdb location generally shown -;; before a command prompt. -;; For example: -;; (/etc/init.d/apparmor:35): -(setf (gethash "loc" realgud:zshdb-pat-hash) realgud:POSIX-debugger-loc-pat) - -;; Regular expression that describes a zshdb command prompt -;; For example: -;; zshdb<10> -;; zshdb<(5)> -;; zshdb<<1>> -(setf (gethash "prompt" realgud:zshdb-pat-hash) - (make-realgud-loc-pat - :regexp "^zshdb[<]+[(]*\\([0-9]+\\)[)]*[>]+ " - :num 1 - )) - -;; Regular expression that describes a "breakpoint set" line. -(setf (gethash "brkpt-set" realgud:zshdb-pat-hash) - realgud:POSIX-debugger-brkpt-set-pat) - -;; Regular expression that describes a debugger "delete" (breakpoint) response. -;; For example: -;; Removed 1 breakpoint(s). -(setf (gethash "brkpt-del" realgud:zshdb-pat-hash) - realgud:POSIX-debugger-brkpt-del-pat) - -;; Regular expression that describes a debugger "backtrace" command line. -;; For example: -;; ->0 in file `/etc/apparmor/fns' at line 24 -;; ##1 /etc/apparmor/fns called from file `/etc/init.d/apparmor' at line 35 -;; ##2 /etc/init.d/apparmor called from file `/usr/bin/zshdb' at line 129 -(setf (gethash "debugger-backtrace" realgud:zshdb-pat-hash) - realgud:POSIX-debugger-backtrace-pat) - -;; Regular expression that for a termination message. -(setf (gethash "termination" realgud:zshdb-pat-hash) - "^zshdb: That's all, folks...\n") - -(setf (gethash "font-lock-keywords" realgud:zshdb-pat-hash) - realgud:POSIX-debugger-font-lock-keywords) - -(setf (gethash "zshdb" realgud-pat-hash) realgud:zshdb-pat-hash) - -(defvar realgud:zshdb-command-hash (make-hash-table :test 'equal) - "Hash key is command name like 'quit' and the value is - the zshdb command to use, like 'quit!'") - -(setf (gethash "zshdb" realgud-command-hash) realgud:zshdb-command-hash) - -(setf (gethash "clear" realgud:zshdb-command-hash) "clear %l") -(setf (gethash "quit" realgud:zshdb-command-hash) "quit") -(setf (gethash "until" realgud:zshdb-command-hash) "continue %l") - -(provide-me "realgud:zshdb-") diff --git a/packages/realgud/realgud/debugger/zshdb/track-mode.el b/packages/realgud/realgud/debugger/zshdb/track-mode.el deleted file mode 100644 index fa2ffe5d3..000000000 --- a/packages/realgud/realgud/debugger/zshdb/track-mode.el +++ /dev/null @@ -1,63 +0,0 @@ -;;; Copyright (C) 2012, 2014-2015 Rocky Bernstein -;;; "zshdb" Debugger tracking a comint buffer. - -(eval-when-compile (require 'cl)) -(require 'load-relative) -(require-relative-list '( - "../../common/cmds" - "../../common/menu" - "../../common/track" - "../../common/track-mode" - ) - "realgud-") -(require-relative-list '("core" "init") "realgud:zshdb-") -(require-relative "../../lang/posix-shell" nil "realgud-lang-") - -(declare-function realgud:cmd-remap 'realgud-cmds) -(declare-function realgud:track-set-debugger 'realgud-track-mode) -(declare-function realgud-track-mode-setup 'realgud-track-mode) -(declare-function realgud-posix-shell-populate-command-keys - 'realgud-lang-posix-shell) - -(realgud-track-mode-vars "zshdb") -(realgud-posix-shell-populate-command-keys zshdb-track-mode-map) - -(declare-function realgud-track-mode(bool)) - - -(defun zshdb-track-mode-hook() - (if zshdb-track-mode - (progn - (use-local-map zshdb-track-mode-map) - (message "using zshdb mode map") - ) - (message "zshdb track-mode-hook disable called")) -) - -(define-minor-mode zshdb-track-mode - "Minor mode for tracking zshdb source locations inside a process shell via realgud. zshdb is a zsh debugger. - -If called interactively with no prefix argument, the mode is toggled. A prefix argument, captured as ARG, enables the mode if the argument is positive, and disables it otherwise. - -\\{zshdb-track-mode-map} -" - :init-value nil - ;; :lighter " zshdb" ;; mode-line indicator from realgud-track is sufficient. - ;; The minor mode bindings. - :global nil - :group 'realgud:zshdb - :keymap zshdb-track-mode-map - - (realgud:track-set-debugger "zshdb") - (if zshdb-track-mode - (progn - (realgud-track-mode-setup 't) - (zshdb-track-mode-hook)) - (progn - (setq realgud-track-mode nil) - )) -) - -(define-key zshdb-short-key-mode-map "T" 'realgud:cmd-backtrace) - -(provide-me "realgud:zshdb-") diff --git a/packages/realgud/realgud/debugger/zshdb/zshdb.el b/packages/realgud/realgud/debugger/zshdb/zshdb.el deleted file mode 100644 index 34a73bc6e..000000000 --- a/packages/realgud/realgud/debugger/zshdb/zshdb.el +++ /dev/null @@ -1,73 +0,0 @@ -;;; Copyright (C) 2011, 2014-2015 Rocky Bernstein -;; `zshdb' Main interface to zshdb via Emacs -(require 'list-utils) -(require 'load-relative) -(require-relative-list '("../../common/helper") "realgud-") -(require-relative-list '("../../common/track") "realgud-") -(require-relative-list '("../../common/run") "realgud:") -(require-relative-list '("core" "track-mode") "realgud:zshdb-") - -(declare-function zshdb-track-mode (bool)) -(declare-function zshdb-query-cmdline 'realgud:zshdb-core) -(declare-function zshdb-parse-cmd-args 'realgud:zshdb-core) - -;; This is needed, or at least the docstring part of it is needed to -;; get the customization menu to work in Emacs 24. -(defgroup realgud:zshdb nil - "The realgud interface to the Zsh debugger, zshdb" - :group 'realgud - :version "24.1") - -;; ------------------------------------------------------------------- -;; User definable variables -;; - -(defcustom realgud:zshdb-command-name - ;;"zshdb --emacs 3" - "zshdb" - "File name for executing the zshdb and its command options. -This should be an executable on your path, or an absolute file name." - :type 'string - :group 'realgud:zshdb) - -(declare-function zshdb-track-mode (bool)) - -;; ------------------------------------------------------------------- -;; The end. -;; - -(declare-function zshdb-track-mode 'realgud-zshdb-track-mode) -(declare-function zshdb-query-cmdline 'realgud:zshdb-core) -(declare-function zshdb-parse-cmd-args 'realgud:zshdb-core) -(declare-function realgud:run-debugger 'realgud:run) - -; ### FIXME: DRY with other top-level routines -;;;###autoload -(defun realgud:zshdb (&optional opt-cmd-line no-reset) - "Invoke the zshdb Z-shell debugger and start the Emacs user interface. - -String OPT-CMD-LINE specifies how to run zshdb. - -OPT-CMD-LINE is treated like a shell string; arguments are -tokenized by `split-string-and-unquote'. The tokenized string is -parsed by `zshdb-parse-cmd-args' and path elements found by that -are expanded using `realgud:expand-file-name-if-exists'. - -Normally, command buffers are reused when the same debugger is -reinvoked inside a command buffer with a similar command. If we -discover that the buffer has prior command-buffer information and -NO-RESET is nil, then that information which may point into other -buffers and source buffers which may contain marks and fringe or -marginal icons is reset. See `loc-changes-clear-buffer' to clear -fringe and marginal icons. -" - (interactive) - (realgud:run-debugger realgud:zshdb-command-name 'zshdb-query-cmdline - 'zshdb-parse-cmd-args - 'realgud:zshdb-minibuffer-history - opt-cmd-line no-reset) - ) - -(defalias 'zshdb 'realgud:zshdb) - -(provide-me "realgud-") diff --git a/packages/realgud/realgud/lang/Makefile.am b/packages/realgud/realgud/lang/Makefile.am deleted file mode 100644 index a6f5e4cd3..000000000 --- a/packages/realgud/realgud/lang/Makefile.am +++ /dev/null @@ -1,5 +0,0 @@ -lispdir = @lispdir_realgud@/$(notdir $(subdir)) -lisp_files := $(wildcard *.el) -lisp_LISP = $(lisp_files) -EXTRA_DIST = $(lisp_files) -MOSTLYCLEANFILES = *.elc diff --git a/packages/realgud/realgud/lang/perl.el b/packages/realgud/realgud/lang/perl.el deleted file mode 100644 index 41a17607c..000000000 --- a/packages/realgud/realgud/lang/perl.el +++ /dev/null @@ -1,54 +0,0 @@ -;;; Copyright (C) 2011, 2014 Rocky Bernstein -;;; Common Perl constants and regular expressions. -(eval-when-compile (require 'cl)) - -(require 'load-relative) -(require-relative-list '("../common/regexp" "../common/loc" "../common/track") - "realgud-") - -(declare-function realgud-goto-line-for-pt 'realgud-track) - -;; Regular expression that describes a Perl Carp backtrace line. -;; at /tmp/foo.pl line 7 -;; main::__ANON__('Illegal division by zero at /tmp/foo.pl line 4.\x{a}') called at /tmp/foo.pl line 4 -;; main::foo(3) called at /tmp/foo.pl line 8 -(defconst realgud-perl-carp-loc-pat - (make-realgud-loc-pat - :regexp (concat - "\\(?:^\\| -\\)" - "\\(?:[ \t]+\\(?:\\|.* called \\)at \\(.*\\) line \\([0-9]+\\)\\)") - :file-group 1 - :line-group 2) - "A realgud-loc-pat struct that describes a line used in a Carp message" ) - -(defconst realgud-perl-errmsg-loc-pat - (make-realgud-loc-pat - :regexp (concat - " at \\(.+\\) line \\([0-9]+\\).$") - :file-group 1 - :line-group 2) - "A realgud-loc-pat struct that describes a line used in an error message" ) - -;; Regular expression that pseudo-files in caller. For example: -;; (eval 1006)[../example/eval.pl:5] -(defconst realgud-perl-ignore-file-re "(eval [0-9]+)\\(\\[.+\\]\\)?" - "Regular expression that pseudo-files of caller()") - -;; FIXME: there is probably a less redundant way to do the following -;; FNS. -(defun realgud:perl-goto-errmsg-line (pt) - "Display the location mentioned by the Perl error message described by PT." - (interactive "d") - (realgud-goto-line-for-pt pt "perl-errmsg")) - -(defun realgud-perl-populate-command-keys (&optional map) - "Bind the debugger function key layout used by many debuggers. - -\\{realgud-example-map-standard}" - (define-key map (kbd "C-c !b") 'realgud:goto-debugger-backtrace-line) - (define-key map (kbd "C-c !!") 'realgud:goto-lang-backtrace-line) - (define-key map (kbd "C-c !e") 'realgud:perl-goto-errmsg-line) - ) - -(provide-me "realgud-lang-") diff --git a/packages/realgud/realgud/lang/posix-shell.el b/packages/realgud/realgud/lang/posix-shell.el deleted file mode 100644 index a3fdc7e35..000000000 --- a/packages/realgud/realgud/lang/posix-shell.el +++ /dev/null @@ -1,124 +0,0 @@ -;;; Copyright (C) 2010-2011, 2015 Rocky Bernstein -;;; -;;; Common POSIX-Shell like constants and regular expressions. -;;; Actually a lot of this is not about POSIX shell as it is about the -;;; common-ness of bashdb, zshdb, and kshdb. But since those are the -;;; *only* debuggers I know of for POSIX shells, it's not too much of -;;; a stretch to think of this as for all "shell". -(eval-when-compile (require 'cl)) - -(require 'load-relative) -(require-relative-list '("../common/regexp" "../common/loc" - "../common/track" "../common/send") - "realgud-") - -(defconst realgud-shell-backtrace-loc-pat - (make-realgud-loc-pat - :regexp "^[ \t]+from \\([^:]+\\):\\([0-9]+\\)\\(?: in `.*'\\)?" - :file-group 1 - :line-group 2) - "A realgud-loc-pat struct that describes a Shell backtrace (or -traceback) line." ) - -(defconst realgud-shell-frame-start-regexp - "\\(?:^\\|\n\\)\\(->\\|##\\)") - -(defconst realgud-shell-frame-num-regexp - "\\([0-9]+\\)") - -(defconst realgud-shell-frame-file-regexp - "[ \t\n]+\\(?:in\\|from\\) file `\\(.+\\)'") - -(defconst realgud-shell-frame-line-regexp - "[ \t\n]+at line \\([0-9]+\\)\\(?:\n\\|$\\)") - -(defun realgud-posix-shell-populate-command-keys (&optional map) - "Bind the debugger function key layout used by many debuggers. - -\\{realgud-example-map-standard}" - (define-key map (kbd "C-c !b") 'realgud:goto-debugger-backtrace-line) - (define-key map (kbd "C-c !!") 'realgud:goto-lang-backtrace-line) - ) - - -;; Patterns common to the my POSIX shell debuggers - -(defconst realgud:python-trepan-frame-start-regexp - "\\(?:^\\|\n\\)\\(->\\|##\\)") - -(defconst realgud:python-trepan-frame-num-regexp - "\\([0-9]+\\)") - -;; Regular expression that describes a bashdb/zshdb location generally shown -;; before a command prompt. -;; For example: -;; (/etc/init.d/apparmor:35): -(defconst realgud:POSIX-debugger-loc-pat - (make-realgud-loc-pat - :regexp "\\(?:^\\|\n\\)(\\([^:]+\\):\\([0-9]*\\)):\\(?:\n\\(.+\\)\\)?" - :file-group 1 - :line-group 2 - :text-group 3) - "A realgud-loc-pat struct that describes a POSIX shell debugger - location line.") - -;; Regular expression that describes a debugger "backtrace" command line. -;; For example: -;; ->0 in file `/etc/apparmor/fns' at line 24 -;; ##1 /etc/apparmor/fns called from file `/etc/init.d/apparmor' at line 35 -;; ##2 /etc/init.d/apparmor called from file `/usr/bin/zshdb' at line 129 -(defconst realgud:POSIX-debugger-backtrace-pat - (make-realgud-loc-pat - :regexp (concat realgud-shell-frame-start-regexp - realgud-shell-frame-num-regexp "[ ]?" - "\\(.*\\)" - realgud-shell-frame-file-regexp - "\\(?:" realgud-shell-frame-line-regexp "\\)?" - ) - :num 2 - :file-group 4 - :line-group 5) - "A realgud-loc-pat struct that describes a Python trepan - backtrace location line." ) - -;; Regular expression that describes a "breakpoint set" line -(defconst realgud:POSIX-debugger-brkpt-set-pat - (make-realgud-loc-pat - :regexp "^Breakpoint \\([0-9]+\\) set in file \\(.+\\), line \\([0-9]+\\).\n" - :num 1 - :file-group 2 - :line-group 3)) - -;; Regular expression that describes a debugger "delete" (breakpoint) response. -;; For example: -;; Removed 1 breakpoint(s). -(defconst realgud:POSIX-debugger-brkpt-del-pat - (make-realgud-loc-pat - :regexp "^Removed \\([0-9]+\\) breakpoint(s).\n" - :num 1)) - -(defconst realgud:POSIX-debugger-font-lock-keywords - '( - ;; The frame number and first type name, if present. - ;; E.g. ->0 in file `/etc/init.d/apparmor' at line 35 - ;; --^- - ("^\\(->\\|##\\)\\([0-9]+\\) " - (2 realgud-backtrace-number-face)) - - ;; File name. - ;; E.g. ->0 in file `/etc/init.d/apparmor' at line 35 - ;; ---------^^^^^^^^^^^^^^^^^^^^- - ("[ \t]+\\(in\\|from\\) file `\\(.+\\)'" - (2 realgud-file-name-face)) - - ;; File name. - ;; E.g. ->0 in file `/etc/init.d/apparmor' at line 35 - ;; --------^^ - ;; Line number. - ("[ \t]+at line \\([0-9]+\\)$" - (1 realgud-line-number-face)) - ;; (trepan-frames-match-current-line - ;; (0 trepan-frames-current-frame-face append)) - )) - -(provide-me "realgud-lang-") diff --git a/packages/realgud/realgud/lang/python.el b/packages/realgud/realgud/lang/python.el deleted file mode 100644 index d94fb3542..000000000 --- a/packages/realgud/realgud/lang/python.el +++ /dev/null @@ -1,126 +0,0 @@ -;;; Copyright (C) 2011, 2014-2015 Rocky Bernstein -;;; Common Python constants and regular expressions. -(eval-when-compile (require 'cl)) - -(require 'load-relative) -(require-relative-list '("../common/regexp" "../common/loc" "../common/track") - "realgud-") - -(defconst realgud-python-backtrace-loc-pat - (make-realgud-loc-pat - :regexp "^[ \t]+File \"\\(.+\\)\", line \\([0-9]+\\)" - :file-group 1 - :line-group 2) - "A realgud-loc-pat struct that describes a Python backtrace (or -traceback) line." ) - -;; Regular expression that pseudo-files in caller. For example: -;; -(defconst realgud-python-ignore-file-re "" - "Regular expression that pseudo-files of caller()") - -(defun realgud-python-populate-command-keys (&optional map) - "Bind the debugger function key layout used by many debuggers. - -\\{realgud-example-map-standard}" - (define-key map (kbd "C-c !b") 'realgud:goto-debugger-backtrace-line) - (define-key map (kbd "C-c !!") 'realgud:goto-lang-backtrace-line) - ) - - -;; Things common to the trepan Python debuggers - -(defconst realgud:python-trepan-frame-start-regexp - "\\(?:^\\|\n\\)\\(->\\|##\\)") - -(defconst realgud:python-trepan-frame-num-regexp - "\\([0-9]+\\)") - -;; Regular expression that describes a trepan2/3k location generally shown -;; before a command prompt. -;; -;; For example: -;; (/usr/bin/zonetab2pot.py:15): -;; (/usr/bin/zonetab2pot.py:15 remapped ): -;; or MS Windows: -;; (c:\\mydirectory\\gcd.py:10): - -(defconst realgud:python-trepan-loc-pat - (make-realgud-loc-pat - :regexp "^(\\(\\(?:[a-zA-Z]:\\)?[-a-zA-Z0-9_/.\\\\ ]+\\):\\([0-9]+\\)\\(?: remapped .*?\\)?): \\(?:\\)?\\(?:\n.. [0-9]+ \\(.*?\\)\n\\)?" - :file-group 1 - :line-group 2 - :text-group 3 - :ignore-file-re realgud-python-ignore-file-re) - "A realgud-loc-pat struct that describes a Python trepan - location line." ) - -;; Regular expression that describes a trepan2/3k backtrace line. -;; For example: -;; ->0 get_distribution(dist='trepan==0.3.9') -;; called from file '/python2.7/dist-packages/pkg_res.py' at line 341 -;; ##1 load_entry_point(dist='tr=0.3.9', group='console_scripts', name='tr') -;; called from file '/python2.7/dist-packages/pkg_res.py' at line 351 -;; ##2 exec() - -(defconst realgud:python-trepan-backtrace-pat - (make-realgud-loc-pat - :regexp (concat - realgud:python-trepan-frame-start-regexp - realgud:python-trepan-frame-num-regexp "[ ]" - "\\(?:.*?)\\)\\(?:[\n\t ]+?\\)" - "\\(?:called from file \\)?'\\([^:]+?\\)' at line \\([0-9]+\\)") - :num 2 - :file-group 3 - :line-group 4 - :ignore-file-re realgud-python-ignore-file-re) - "A realgud-loc-pat struct that describes a Python trepan - backtrace location line." ) - -;; Regular expression that describes a "breakpoint set" line -(defconst realgud:python-trepan-brkpt-set-pat - (make-realgud-loc-pat - :regexp "^Breakpoint \\([0-9]+\\) set at line \\([0-9]+\\)[ \t\n]+of file \\(.+\\)\\(\n\\|$\\)" - :num 1 - :file-group 3 - :line-group 2)) - -;; Regular expression that describes a debugger "delete" (breakpoint) response. -(defconst realgud:python-trepan-brkpt-del-pat - (make-realgud-loc-pat - :regexp "^Deleted breakpoint \\([0-9]+\\)\n" - :num 1)) - -(defconst realgud:python-debugger-font-lock-keywords - '( - ;; The frame number and first type name, if present. - ("^\\(->\\|##\\)\\([0-9]+\\) \\(\\)? *\\([a-zA-Z_][a-zA-Z0-9_]*\\)(\\(.+\\))?" - (2 realgud-backtrace-number-face) - (4 font-lock-function-name-face nil t)) ; t means optional. - - ;; Parameter sequence, E.g. gcd(a=3, b=5) - ;; ^^^^^^^^^ - ("(\\(.+\\))" - (1 font-lock-variable-name-face)) - - ;; File name. E.g file '/test/gcd.py' - ;; ------^^^^^^^^^^^^- - ("[ \t]+file '\\([^ ]+*\\)'" - (1 realgud-file-name-face)) - - ;; Line number. E.g. at line 28 - ;; ---------^^ - ("[ \t]+at line \\([0-9]+\\)$" - (1 realgud-line-number-face)) - - ;; Function name. - ("\\<\\([a-zA-Z_][a-zA-Z0-9_]*\\)\\.\\([a-zA-Z_][a-zA-Z0-9_]*\\)" - (1 font-lock-type-face) - (2 font-lock-function-name-face)) - ;; (trepan2-frames-match-current-line - ;; (0 trepan2-frames-current-frame-face append)) - )) - - - -(provide-me "realgud-lang-") diff --git a/packages/realgud/realgud/lang/ruby.el b/packages/realgud/realgud/lang/ruby.el deleted file mode 100644 index aa1ffa47f..000000000 --- a/packages/realgud/realgud/lang/ruby.el +++ /dev/null @@ -1,108 +0,0 @@ -;;; Copyright (C) 2010, 2014 Rocky Bernstein -;;; Common Ruby constants and regular expressions. -(eval-when-compile (require 'cl)) - -(require 'load-relative) -(require-relative-list '("../common/regexp" "../common/loc" "../common/track") - "realgud-") - -(declare-function realgud-goto-line-for-pt 'realgud-track) - -(defconst realgud-rails-backtrace-loc-pat - (make-realgud-loc-pat - :regexp "^\\([^:]+\\):\\([0-9]+\\)\\(?:[:]in `.*'\\)?" - :file-group 1 - :line-group 2) - "A realgud-loc-pat struct that describes a Rails backtrace (or -traceback) line." ) - -;; Regular expression that describes a Ruby YARV 1.9 syntax error line. -;; SyntaxError: /tmp/columnize.rb:270: syntax error, unexpected $end, ... -(defconst realgud-ruby-YARV-syntax-error-pat - (make-realgud-loc-pat - :regexp "^SyntaxError: \\([^:]+\\):\\([0-9]+\\): syntax error" - :file-group 1 - :line-group 2) - "A realgud-loc-pat struct that describes a Ruby YARV syntax error message") - -(defconst realgud-ruby-backtrace-loc-pat - (make-realgud-loc-pat - :regexp "^[ \t]+from \\([^:]+\\):\\([0-9]+\\)\\(?: in `.*'\\)?" - :file-group 1 - :line-group 2) - "A realgud-loc-pat struct that describes a Ruby backtrace (or -traceback) line." ) - -(defconst realgud-rubinius-backtrace-loc-pat - (make-realgud-loc-pat - :regexp "^\\(?:\\[0;3[1-4]m\\)?[ \t]+.* at \\([^:]+\\):\\([0-9]+\\)" - :file-group 1 - :line-group 2) - "A realgud-loc-pat struct that describes a Rubinius backtrace (or -traceback) line." ) - -(defconst realgud-rubinius-Xagent-backtrace-loc-pat - (make-realgud-loc-pat - :regexp "^\\(?:\\[0;3[1-4]m\\)?0x[a-f0-9]\\{8\\}: .* in \\([^:]+\\):\\([0-9]+\\) ([+][0-9]+)" - :file-group 1 - :line-group 2) - "A realgud-loc-pat struct that describes a Rubinius Xagent backtrace (or -traceback) line." ) - -(defconst realgud-ruby-dollar-bang-loc-pat - (make-realgud-loc-pat - :regexp "^[ \t]*[[]?\\(.+\\):\\([0-9]+\\):in `.*'" - :file-group 1 - :line-group 2) - "A realgud-loc-pat that struct that describes a Ruby $! string." -) - -;; FIXME: there is probably a less redundant way to do the following -;; FNS. -(defun realgud:rails-goto-backtrace-line (pt) - "Display the location mentioned by the Rails backtrace line -described by PT." - (interactive "d") - (realgud-goto-line-for-pt pt "rails-backtrace")) - -(defun realgud:rubinius-goto-Xagent-backtrace-line (pt) - "Display the location mentioned by the Rubinius Xagent- backtrace line -described by PT." - (interactive "d") - (realgud-goto-line-for-pt pt "rubinius-backtrace-Xagent")) - -(defun realgud:ruby-goto-backtrace-line (pt) - "Display the location mentioned by the Ruby backtrace line -described by PT." - (interactive "d") - (realgud-goto-line-for-pt pt "lang-backtrace")) - -(defun realgud:ruby-goto-dollar-bang-line (pt) - "Display the location mentioned by the Ruby backtrace line -described by PT." - (interactive "d") - (realgud-goto-line-for-pt pt "dollar-bang-backtrace")) - -(defun realgud:ruby-populate-command-keys (&optional map) - "Bind the debugger function key layout used by many debuggers. - -\\{realgud-example-map-standard}" - (define-key map (kbd "C-c !l") 'realgud:goto-lang-backtrace-line) - (define-key map (kbd "C-c !!") 'realgud:ruby-goto-dollar-bang-line) - (define-key map (kbd "C-c !b") 'realgud:goto-debugger-backtrace-line) - (define-key map (kbd "C-c !r") 'realgud:rails-goto-backtrace-line) - ) - - -;; Some things common to all trepan debuggers (Rubinius and Ruby 1.9.2) -(defconst realgud:trepan-frame-start-regexp - "\\(?:^\\|\n\\)\\(-->\\| \\)") - -(defconst realgud:trepan-frame-num-regexp - "#\\([0-9]+\\)") - -(defconst realgud:trepan-frame-line-regexp - "[ \t\n]+at line \\([0-9]+\\)\\(?:\n\\|$\\)") - - -(provide-me "realgud-lang-") diff --git a/packages/realgud/test/.gitignore b/packages/realgud/test/.gitignore deleted file mode 100644 index a350eb7af..000000000 --- a/packages/realgud/test/.gitignore +++ /dev/null @@ -1,4 +0,0 @@ -/*.elc -/*~ -/Makefile -/Makefile.in diff --git a/packages/realgud/test/Makefile.am b/packages/realgud/test/Makefile.am deleted file mode 100644 index c0e7edede..000000000 --- a/packages/realgud/test/Makefile.am +++ /dev/null @@ -1,69 +0,0 @@ -include $(top_srcdir)/common.mk - -PHONY=check test all check-elget test-elget help -EXTRA_DIST += gcd.py gcd.rb gdb - -#: overall help on running the make targets -help: - @echo "The main function of this Makefile is to facilitate running tests." - @echo - @echo "To run all of the tests, use targets \"test\", \"check\" or \"check-short\"." - @echo "For example:" - @echo - @echo " make check" - @echo "or:" - @echo " make check-short" - @echo - @echo "The -short target uses a filter written in Ruby to remove extreanous output." - @echo - @echo "To run a specific test like test-srcbuf.el, change \".el\" to" - @echo "\".run\". For example:" - @echo - @echo " make test-srcbuf.run" - @echo - @echo "Tests can also be run via the Emacs el-get package and this loads dependent emacs " - @echo "package, like load-relative. To do this, use targets, \"check-elget\"," - @echo "\"test-elget\", or \"check-short-elget\"." - @echo - @echo "To run a specific test like test-srcbuf.el via el-get change \".el\"" - @echo "to \".elrun\" For example:" - @echo - @echo " make test-srcbuf.elrun" - - -#: same thing as "check" -test: check - -#: same thing as "check-elget" -test-elget: check-elget - -test_files := $(wildcard test-*.el) - -CHECK_FILES = $(notdir $(test_files:.el=.run)) -EL_GET_CHECK_FILES = $(notdir $(test_files:.el=.elrun)) - -#: Run all tests -check: $(CHECK_FILES) - -#: Run all tests via el-get -check-elget: $(EL_GET_CHECK_FILES) - -#: Run all tests with minimum verbosity -check-short: - $(MAKE) check 2>&1 | ruby ../make-check-filter.rb - -#: Run all tests with minimum verbosity via el-get -check-short-elget: - $(MAKE) check-elget 2>&1 | ruby ../make-check-filter.rb - -test-%.run: - (cd $(top_srcdir)/test && $(EMACS) --batch --no-site-file --no-splash --load $(@:.run=.el)) - -#: Run tests using el-get to specify external Lisp dependencies -test-%.elrun: - (cd $(top_srcdir)/test && $(EMACS) --batch --no-site-file --no-splash --load ../el-get-install.el --load $(@:.elrun=.el)) - -# Whatever it is you want to do, it should be forwarded to the -# to top-level directories -# %: -# $(MAKE) -C .. $@ diff --git a/packages/realgud/test/bt-helper.el b/packages/realgud/test/bt-helper.el deleted file mode 100644 index f003c77d9..000000000 --- a/packages/realgud/test/bt-helper.el +++ /dev/null @@ -1,46 +0,0 @@ -(require 'test-simple) -(require 'font-lock) - -(load-file "../realgud/common/buffer/command.el") -(load-file "../realgud/common/buffer/backtrace.el") -(load-file "../realgud/common/backtrace-mode.el") - -(declare-function realgud-backtrace-mode 'realgud-backtrace-mode) -(declare-function realgud-cmdbuf-init 'realgud-buffer-command) - -(eval-when-compile - (defvar temp-cmdbuf) - (defvar temp-bt) - (defvar realgud-pat-hash) -) - -(defun setup-bt-vars(debugger-name) - "Sets up globals temp-cmdbuf and temp-bt with command buffer -for DEBUGGER-NAME" - (setq temp-cmdbuf (generate-new-buffer "*cmdbuf-test*")) - (setq temp-bt (generate-new-buffer "*bt-test*")) - (with-current-buffer temp-cmdbuf - (switch-to-buffer temp-cmdbuf) - (realgud-cmdbuf-init temp-cmdbuf debugger-name - (gethash debugger-name realgud-pat-hash)) - - (switch-to-buffer nil) - )) - - -(defun setup-bt(debugger-name string) - "Sets up globals temp-cmdbuf and temp-bt with command buffer -for DEBUGGER-NAME and initializes it to STRING" - (setup-bt-vars debugger-name) - (with-current-buffer temp-bt - (realgud-backtrace-mode temp-cmdbuf) - (goto-char (point-min)) - (setq buffer-read-only nil) - (insert string) - (font-lock-fontify-buffer) - (goto-char (point-min)) - ) - temp-bt -) - -(provide 'realgud-bt-helper) diff --git a/packages/realgud/test/gcd.js b/packages/realgud/test/gcd.js deleted file mode 100644 index 6d7ce3258..000000000 --- a/packages/realgud/test/gcd.js +++ /dev/null @@ -1,47 +0,0 @@ -//!/usr/bin/env node -var util = require("util"); -require("console"); - -function ask(question, format, callback) { - var stdin = process.stdin, stdout = process.stdout; - - stdin.resume(); - stdout.write(question + ": "); - - stdin.once('data', function(data) { - data = data.toString().trim(); - - if (format.test(data)) { - callback(data); - } else { - stdout.write("It should match: "+ format +"\n"); - ask(question, format, callback); - } - }); -} - -// GCD. We assume positive numbers -function gcd(a, b) { - // Make: a <= b - if (a > b) { - var temp = a; - a = b; - b = temp; - } - - if (a <= 0) { return null }; - - if (a == 1 || b-a == 0) { - return a; - } - return gcd(b-a, a); -} - -var a=24; - -ask("GCD of 24 and", /^\d+$/, function(b_str) { - var b = parseInt(b_str, 10); - console.log(util.format("The GCD of %d and %d is %d", a, b, - gcd(a, b))); - process.exit(); -}); diff --git a/packages/realgud/test/gcd.pl b/packages/realgud/test/gcd.pl deleted file mode 100644 index df476a891..000000000 --- a/packages/realgud/test/gcd.pl +++ /dev/null @@ -1,21 +0,0 @@ -#!/usr/bin/env perl -use strict; -use warnings; - -# GCD. We assume positive numbers -sub gcd($$); -sub gcd($$) -{ - my ($a, $b) = @_; - # Make: a <= b - ($a, $b) = ($b, $a) if ($a > $b); - - return undef if $a <= 0; - return $a if ($a == 1) or ($b-$a == 0); - return gcd($b-$a, $a); -} - -die sprintf "Need two integer arguments, got %d", scalar(@ARGV) unless - @ARGV == 2; -my ($a, $b) = @ARGV[0,1]; -printf "The GCD of %d and %d is %d\n", $a, $b, gcd($a, $b); diff --git a/packages/realgud/test/gcd.py b/packages/realgud/test/gcd.py deleted file mode 100755 index e64f28420..000000000 --- a/packages/realgud/test/gcd.py +++ /dev/null @@ -1,41 +0,0 @@ -#!/usr/bin/python -"""Greatest Common Divisor - -Some characterstics of this program used for testing check_args() does -not have a 'return' statement. - -check_args() raises an uncaught exception when given the wrong number -of parameters. - -""" -import sys - -def check_args(): - if len(sys.argv) != 3: - # Rather than use sys.exit let's just raise an error - raise Exception("Need to give two numbers") - for i in range(2): - try: - sys.argv[i+1] = int(sys.argv[i+1]) - except ValueError: - print("** Expecting an integer, got: %s" % repr(sys.argv[i])) - sys.exit(2) - -def gcd(a,b): - """ GCD. We assume positive numbers""" - - # Make: a <= b - if a > b: - (a, b) = (b, a) - - if a <= 0: - return None - if a == 1 or b-a == 0: - return a - return gcd(b-a, a) - -if __name__=='__main__': - check_args() - - (a, b) = sys.argv[1:3] - print("The GCD of %d and %d is %d" % (a, b, gcd(a, b))) diff --git a/packages/realgud/test/gcd.rb b/packages/realgud/test/gcd.rb deleted file mode 100755 index c780a3131..000000000 --- a/packages/realgud/test/gcd.rb +++ /dev/null @@ -1,19 +0,0 @@ -#!/usr/bin/env ruby - -# GCD. We assume positive numbers -def gcd(a, b) - # Make: a <= b - if a > b - a, b = [b, a] - end - - return nil if a <= 0 - - if a == 1 or b-a == 0 - return a - end - return gcd(b-a, a) -end - -a, b = ARGV[0..1].map {|arg| arg.to_i} -puts "The GCD of %d and %d is %d" % [a, b, gcd(a, b)] diff --git a/packages/realgud/test/gcd.sh b/packages/realgud/test/gcd.sh deleted file mode 100755 index 497f33bc1..000000000 --- a/packages/realgud/test/gcd.sh +++ /dev/null @@ -1,25 +0,0 @@ -#!/usr/bin/env bash -# Greatest Common Divisor in POSIX shell using Euclid's algorithm. On -# return, variable gcd_value is set and is the gcd of parameters $1 -# and $2. The GCD of a negative number is the same as the GCD of its -# absolute value, since a negative number is -1 times its positive -# value. Negative numbers are set when there is an error; -1 is set -# when the wrong number of parameters are given. -gcd() { - typeset -i a=$1 - typeset -i b=$2 - if (( a > b )) ; then - a=$b - b=$1 - fi - if (( a == 1 || (b-a) == 0)) ; then - gcd_value=$a - return 0 - fi - typeset -i c - ((c=b-a)) - gcd $c $a -} - -gcd $1 $2 -echo $gcd_value diff --git a/packages/realgud/test/gdb/bar.sh b/packages/realgud/test/gdb/bar.sh deleted file mode 100755 index 6c961d1e9..000000000 --- a/packages/realgud/test/gdb/bar.sh +++ /dev/null @@ -1,2 +0,0 @@ -#!/bin/sh -echo This Should get selected 3rd diff --git a/packages/realgud/test/gdb/baz b/packages/realgud/test/gdb/baz deleted file mode 100755 index e69de29bb..000000000 diff --git a/packages/realgud/test/gdb/baz.c b/packages/realgud/test/gdb/baz.c deleted file mode 100644 index e69de29bb..000000000 diff --git a/packages/realgud/test/gdb/foo b/packages/realgud/test/gdb/foo deleted file mode 100755 index e69de29bb..000000000 diff --git a/packages/realgud/test/gdb/foo.c b/packages/realgud/test/gdb/foo.c deleted file mode 100644 index e69de29bb..000000000 diff --git a/packages/realgud/test/gdb/test2/bar.sh b/packages/realgud/test/gdb/test2/bar.sh deleted file mode 100755 index 6c961d1e9..000000000 --- a/packages/realgud/test/gdb/test2/bar.sh +++ /dev/null @@ -1,2 +0,0 @@ -#!/bin/sh -echo This Should get selected 3rd diff --git a/packages/realgud/test/gdb/test2/baz.c b/packages/realgud/test/gdb/test2/baz.c deleted file mode 100644 index e69de29bb..000000000 diff --git a/packages/realgud/test/node_modules/gcd.js/gcd.js b/packages/realgud/test/node_modules/gcd.js/gcd.js deleted file mode 100644 index 6d7ce3258..000000000 --- a/packages/realgud/test/node_modules/gcd.js/gcd.js +++ /dev/null @@ -1,47 +0,0 @@ -//!/usr/bin/env node -var util = require("util"); -require("console"); - -function ask(question, format, callback) { - var stdin = process.stdin, stdout = process.stdout; - - stdin.resume(); - stdout.write(question + ": "); - - stdin.once('data', function(data) { - data = data.toString().trim(); - - if (format.test(data)) { - callback(data); - } else { - stdout.write("It should match: "+ format +"\n"); - ask(question, format, callback); - } - }); -} - -// GCD. We assume positive numbers -function gcd(a, b) { - // Make: a <= b - if (a > b) { - var temp = a; - a = b; - b = temp; - } - - if (a <= 0) { return null }; - - if (a == 1 || b-a == 0) { - return a; - } - return gcd(b-a, a); -} - -var a=24; - -ask("GCD of 24 and", /^\d+$/, function(b_str) { - var b = parseInt(b_str, 10); - console.log(util.format("The GCD of %d and %d is %d", a, b, - gcd(a, b))); - process.exit(); -}); diff --git a/packages/realgud/test/node_modules/gcd.js/package.json b/packages/realgud/test/node_modules/gcd.js/package.json deleted file mode 100644 index 06a4cee3d..000000000 --- a/packages/realgud/test/node_modules/gcd.js/package.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "name": "emacs-dbgr", - "private": false, - "version": "1.0.0", - "description": "Debugging is going to be realgud.", - "repository": "https://github.com/rocky/emacs-dbgr", - "dependencies": {}, - "devDependencies": {}, - "scripts": { - "start": "node --debug gcd.js" - } -} diff --git a/packages/realgud/test/regexp-helper.el b/packages/realgud/test/regexp-helper.el deleted file mode 100644 index 01dc7d2cf..000000000 --- a/packages/realgud/test/regexp-helper.el +++ /dev/null @@ -1,50 +0,0 @@ -(require 'test-simple) -(load-file "../realgud/common/buffer/command.el") - -(eval-when-compile - (defvar helper-bps) - (defvar helper-loc) - (defvar helper-tb) - (defvar prompt-pat) -) - -(declare-function realgud-loc-pat-regexp 'realgud-backtrace-mode) -(declare-function realgud-cmdbuf-info-loc-regexp 'realgud-buffer-command) -(declare-function test-simple-start 'test-simple) - - -(defun setup-regexp-vars(pat-hash) - (setq helper-bps (gethash "brkpt-set" pat-hash)) - (setq helper-loc (gethash "loc" pat-hash)) - (setq helper-tb (gethash "lang-backtrace" pat-hash)) -) - -(defun loc-match(text var) - "Match TEXT against regexp field VAR" - (string-match (realgud-loc-pat-regexp var) text) -) - -(defun bp-loc-match(text) - (string-match (realgud-loc-pat-regexp helper-bps) text) -) - -(defun tb-loc-match(text) - (string-match (realgud-loc-pat-regexp helper-tb) text) -) - -(defun cmdbuf-loc-match(text dbgr) - "Match TEXT against cmdbuf-info-loc field VAR" - (string-match (realgud-cmdbuf-info-loc-regexp dbgr) text) - ) - -(defun prompt-match(prompt-str &optional num-str fmt-str) - (unless fmt-str (setq fmt-str "debugger prompt %s")) - (assert-equal 0 (string-match (realgud-loc-pat-regexp prompt-pat) - prompt-str) - (format fmt-str prompt-str)) - (cond (num-str - (assert-equal num-str (substring prompt-str - (match-beginning 1) (match-end 1)))) - ('t 't)) - ) -(provide 'realgud-regexp-helper) diff --git a/packages/realgud/test/test-bashdb.el b/packages/realgud/test/test-bashdb.el deleted file mode 100644 index 09d066fc0..000000000 --- a/packages/realgud/test/test-bashdb.el +++ /dev/null @@ -1,57 +0,0 @@ -(require 'test-simple) -(require 'load-relative) -(load-file "../realgud/debugger/bashdb/bashdb.el") -(load-file "../realgud/debugger/bashdb/core.el") -(load-file "../realgud/common/core.el") -(load-file "../realgud/common/lang.el") - -(declare-function realgud:expand-file-name-if-exists 'realgud-core) - -(eval-when-compile - (defvar test:run-process-save) - (defvar realgud:bashdb-minibuffer-history) - ) - -(declare-function bashdb-parse-cmd-args 'realgud:bashdb) -(declare-function bashdb-suggest-invocation 'realgud:bzshdb) -(declare-function realgud:bashdb 'realgud:bashdb) -(declare-function __FILE__ 'load-relative) - -(test-simple-start) -(make-local-variable 'realgud:bashdb-minibuffer-history) -(setq realgud:bashdb-minibuffer-history nil) - -;; Save value realgud:run-process and change it to something we want -(setq test:run-process-save (symbol-function 'realgud:run-process)) -(defun realgud:run-process(debugger-name script-filename cmd-args - minibuf-history - &optional no-reset) - "Fake realgud:run-process used in testing" - (note - (format "%s %s %s" debugger-name script-filename cmd-args)) - (assert-equal "bashdb" debugger-name "debugger name gets passed") - (let ((expanded-name - (realgud:expand-file-name-if-exists "./gcd.sh"))) - (assert-equal expanded-name script-filename "file name check") - (assert-equal (list "-l" (expand-file-name ".") expanded-name "3" "5") - (cdr cmd-args) "command args listified") - )) - -(note "bashdb-parse-cmd-args") -(assert-equal (list nil '("bashdb") - (list (realgud:expand-file-name-if-exists "foo")) nil) - (bashdb-parse-cmd-args '("bashdb" "foo"))) -(assert-equal (list nil '("bashdb") - (list (realgud:expand-file-name-if-exists "program.sh") - "foo") nil) - (bashdb-parse-cmd-args - '("bashdb" "program.sh" "foo"))) -(with-current-buffer (find-file "gcd.sh") - (shell-script-mode) - (assert-matches "bashdb .*gcd.sh$" (bashdb-suggest-invocation "bashdb"))) - -(realgud:bashdb "bashdb -l . ./gcd.sh 3 5") -;; Restore the old value of realgud:run-process -(fset 'realgud:run-process test:run-process-save) - -(end-tests) diff --git a/packages/realgud/test/test-bp.el b/packages/realgud/test/test-bp.el deleted file mode 100644 index de90f7453..000000000 --- a/packages/realgud/test/test-bp.el +++ /dev/null @@ -1,56 +0,0 @@ -(require 'test-simple) -(require 'load-relative) -(load-file "../realgud/common/bp.el") -(declare-function realgud-bp-remove-icons 'realgud-bp) - -(eval-when-compile - (defvar temp-srcbuf) -) - - -(test-simple-start) - -(note "breakpoints") - -(set (make-local-variable 'temp-srcbuf) - (generate-new-buffer "*srcbuf-test*")) -(with-current-buffer temp-srcbuf - (insert "abc\ndef\n") - (note "breakpoint reset") - (realgud-bp-remove-icons (point-min) (point-max)) - (assert-equal 0 (length (overlays-in (point-min) (point-max))) - "Should not have any breakpoints in buffer") - ) - ;; (note "breakpoint set") - ;; (realgud-bp-put-icon (point-min) 't 1 temp-srcbuf) - ;; (realgud-bp-put-icon (point-max) nil 2 temp-srcbuf) - ;; (assert-equal 2 (length (overlays-in (point-min) (point-max))) - ;; (format - ;; "Should find breakpoints in buffer %s" - ;; temp-srcbuf)) - ;; (let* ((ov-list (overlays-in (point-min) (point-min))) - ;; (ov (car-safe ov-list)) - ;; (before-string) - ;; ) - ;; (assert-equal 1 (length ov-list) - ;; "Should find 1 breakpoint at (point-min)") - ;; (setq before-string (overlay-get ov 'before-string)) - ;; (assert-equal 1 (get-text-property 0 'realgud-bptno before-string) - ;; "Should find breakpoint number 1 in overlay's before-string") - ;; (assert-equal t (get-text-property 0 'enabled before-string) - ;; "Breakpoint 1 should be enabled") - ;; ) - ;; (let* ((ov-list (overlays-in (point-max) (point-max))) - ;; (ov (car-safe ov-list)) - ;; (before-string) - ;; ) - ;; (assert-equal 1 (length ov-list) - ;; "Should find 1 breakpoint at (point-max)") - ;; (setq before-string (overlay-get ov 'before-string)) - ;; (assert-equal 2 (get-text-property 0 'realgud-bptno before-string) - ;; "Should find breakpoint number 1 in overlay's before-string") - ;; (assert-equal nil (get-text-property 0 'enabled before-string) - ;; "Breakpoint 1 should be disabled") - ;; ) - -(end-tests) diff --git a/packages/realgud/test/test-bt-pdb.el b/packages/realgud/test/test-bt-pdb.el deleted file mode 100644 index 55939a4b8..000000000 --- a/packages/realgud/test/test-bt-pdb.el +++ /dev/null @@ -1,42 +0,0 @@ -(require 'test-simple) -(require 'load-relative) -(load-file "./bt-helper.el") -(load-file "../realgud/debugger/pdb/init.el") - -(declare-function setup-bt 'realgud-bt-helper) -(declare-function __FILE__ 'load-relative) - -(test-simple-start) - -(eval-when-compile - (defvar temp-bt) -) - - -(setq temp-bt - (setup-bt "pdb" - "->0 gcd(a=3, b=5) called from file '/test/gcd.py' at line 28 -##1 execfile() file '/test/gcd.py' at line 41 -")) - -(with-current-buffer temp-bt - (switch-to-buffer temp-bt) - (goto-char (point-min)) - (dolist (pair - '( - ("->" . realgud-backtrace-number ) - ("gc" . font-lock-function-name-face ) - ("(" . font-lock-variable-name-face ) - ("/test" . realgud-file-name) - ("2" . realgud-line-number) - ("##" . realgud-backtrace-number) - ("/test" . realgud-file-name) - ("4" . realgud-line-number) - )) - (search-forward (car pair)) - (assert-eql (cdr pair) - (get-text-property (point) 'face)) - ) - ) - -(end-tests) diff --git a/packages/realgud/test/test-bt-pydb.el b/packages/realgud/test/test-bt-pydb.el deleted file mode 100644 index 3419359ae..000000000 --- a/packages/realgud/test/test-bt-pydb.el +++ /dev/null @@ -1,41 +0,0 @@ -(require 'test-simple) -(require 'load-relative) -(load-file "./bt-helper.el") -(load-file "../realgud/debugger/pydb/init.el") - -(declare-function setup-bt 'realgud-bt-helper) -(declare-function __FILE__ 'load-relative) - -(test-simple-start) - -(eval-when-compile - (defvar temp-bt) -) - -(setq temp-bt - (setup-bt "pydb" - "->0 gcd(a=3, b=5) called from file '/test/gcd.py' at line 28 -##1 execfile() file '/test/gcd.py' at line 41 -")) - -(with-current-buffer temp-bt - (switch-to-buffer temp-bt) - (goto-char (point-min)) - (dolist (pair - '( - ("->" . realgud-backtrace-number ) - ("gc" . font-lock-function-name-face ) - ("(" . font-lock-variable-name-face ) - ("/test" . realgud-file-name) - ("2" . realgud-line-number) - ("##" . realgud-backtrace-number) - ("/test" . realgud-file-name) - ("4" . realgud-line-number) - )) - (search-forward (car pair)) - (assert-eql (cdr pair) - (get-text-property (point) 'face)) - ) - ) - -(end-tests) diff --git a/packages/realgud/test/test-bt-pydbgr.el b/packages/realgud/test/test-bt-pydbgr.el deleted file mode 100644 index 50cc5ff74..000000000 --- a/packages/realgud/test/test-bt-pydbgr.el +++ /dev/null @@ -1,40 +0,0 @@ -(require 'test-simple) -(require 'load-relative) -(load-file "./bt-helper.el") -(load-file "../realgud/debugger/pydbgr/init.el") - -(declare-function setup-bt 'realgud-bt-helper) -(declare-function __FILE__ 'load-relative) - -(test-simple-start) - -(eval-when-compile - (defvar temp-bt) -) - -(setq temp-bt - (setup-bt "pydbgr" - "->0 gcd(a=3, b=5) called from file '/test/gcd.py' at line 28 -##1 execfile() file '/test/gcd.py' at line 41 -")) - -(with-current-buffer temp-bt - (switch-to-buffer temp-bt) - (goto-char (point-min)) - (dolist (pair - '( - ("->" . realgud-backtrace-number ) - ("gc" . font-lock-function-name-face ) - ("(" . font-lock-variable-name-face ) - ("/test" . realgud-file-name) - ("2" . realgud-line-number) - ("##" . realgud-backtrace-number) - ("/test" . realgud-file-name) - ("4" . realgud-line-number) - )) - (search-forward (car pair)) - (assert-equal (cdr pair) - (get-text-property (point) 'face)) - ) - ) -(end-tests) diff --git a/packages/realgud/test/test-bt-rdebug.el b/packages/realgud/test/test-bt-rdebug.el deleted file mode 100644 index aebd737cc..000000000 --- a/packages/realgud/test/test-bt-rdebug.el +++ /dev/null @@ -1,44 +0,0 @@ -(require 'test-simple) -(require 'load-relative) -(load-file "./bt-helper.el") -(load-file "../realgud/debugger/rdebug/init.el") - -(declare-function setup-bt 'realgud-bt-helper) -(declare-function __FILE__ 'load-relative) - -(test-simple-start) - -(eval-when-compile - (defvar temp-bt) -) - -(setq temp-bt - (setup-bt "rdebug" - "--> #0 Object.gcd(a#Fixnum, b#Fixnum) - at line /test/gcd.rb:6 - #1 at line /test/gcd.rb:19 -")) - -(with-current-buffer temp-bt - (switch-to-buffer temp-bt) - (goto-char (point-min)) - (dolist (pair - '( - ("#" . realgud-backtrace-number ) - ("Objec" . font-lock-constant-face ) - ("gc" . font-lock-function-name-face ) - ("(" . font-lock-variable-name-face ) - ("Fixnu" . font-lock-constant-face ) - ("/test" . realgud-file-name) - (":" . realgud-line-number) - ("#" . realgud-backtrace-number) - ("/test" . realgud-file-name) - (":" . realgud-line-number) - )) - (search-forward (car pair)) - (assert-equal (cdr pair) - (get-text-property (point) 'face)) - ) - ) - -(end-tests) diff --git a/packages/realgud/test/test-bt-trepan.el b/packages/realgud/test/test-bt-trepan.el deleted file mode 100644 index fe9cf1be3..000000000 --- a/packages/realgud/test/test-bt-trepan.el +++ /dev/null @@ -1,46 +0,0 @@ -(require 'test-simple) -(require 'load-relative) -(load-file "./bt-helper.el") -(load-file "../realgud/debugger/trepan/init.el") - -(declare-function setup-bt 'realgud-bt-helper) -(declare-function __FILE__ 'load-relative) - -(test-simple-start) - -(eval-when-compile - (defvar temp-bt) -) - -(setq temp-bt - (setup-bt "trepan" - "--> #0 METHOD Object#gcd(a, b) in file /test/gcd.rb at line 4 - #1 TOP Object# in file /test/gcd.rb - at line 19 -")) - -(with-current-buffer temp-bt - (switch-to-buffer temp-bt) - (goto-char (point-min)) - (dolist (pair - '( - ("#" . realgud-backtrace-number ) - ("METHO" . font-lock-keyword-face ) - ("Objec" . font-lock-constant-face ) - ("#" . font-lock-function-name-face ) - ("(" . font-lock-variable-name-face ) - ("/test" . realgud-file-name) - ("line " . realgud-line-number) - ("#" . realgud-backtrace-number) - ("Objec" . font-lock-constant-face ) - ("0 gcd(a=3, b=5) called from file '/test/gcd.py' at line 28 -##1 execfile() file '/test/gcd.py' at line 41 -")) - -(with-current-buffer temp-bt - (switch-to-buffer temp-bt) - (goto-char (point-min)) - (dolist (pair - '( - ("->" . realgud-backtrace-number ) - ("gc" . font-lock-function-name-face ) - ("(" . font-lock-variable-name-face ) - ("/test" . realgud-file-name) - ("2" . realgud-line-number) - ("##" . realgud-backtrace-number) - ("/test" . realgud-file-name) - ("4" . realgud-line-number) - )) - (search-forward (car pair)) - (assert-equal (cdr pair) - (get-text-property (point) 'face)) - ) - ) -(end-tests) diff --git a/packages/realgud/test/test-bt-trepan3k.el b/packages/realgud/test/test-bt-trepan3k.el deleted file mode 100644 index 4959a07bb..000000000 --- a/packages/realgud/test/test-bt-trepan3k.el +++ /dev/null @@ -1,40 +0,0 @@ -(require 'test-simple) -(require 'load-relative) -(load-file "./bt-helper.el") -(load-file "../realgud/debugger/trepan2/init.el") - -(declare-function setup-bt 'realgud-bt-helper) -(declare-function __FILE__ 'load-relative) - -(test-simple-start) - -(eval-when-compile - (defvar temp-bt) -) - -(setq temp-bt - (setup-bt "trepan2" - "->0 gcd(a=3, b=5) called from file '/test/gcd.py' at line 28 -##1 execfile() file '/test/gcd.py' at line 41 -")) - -(with-current-buffer temp-bt - (switch-to-buffer temp-bt) - (goto-char (point-min)) - (dolist (pair - '( - ("->" . realgud-backtrace-number ) - ("gc" . font-lock-function-name-face ) - ("(" . font-lock-variable-name-face ) - ("/test" . realgud-file-name) - ("2" . realgud-line-number) - ("##" . realgud-backtrace-number) - ("/test" . realgud-file-name) - ("4" . realgud-line-number) - )) - (search-forward (car pair)) - (assert-equal (cdr pair) - (get-text-property (point) 'face)) - ) - ) -(end-tests) diff --git a/packages/realgud/test/test-bt-trepanx.el b/packages/realgud/test/test-bt-trepanx.el deleted file mode 100644 index 4ad94f75c..000000000 --- a/packages/realgud/test/test-bt-trepanx.el +++ /dev/null @@ -1,46 +0,0 @@ -(require 'test-simple) -(require 'load-relative) -(load-file "./bt-helper.el") -(load-file "../realgud/debugger/trepanx/init.el") - -(declare-function setup-bt 'realgud-bt-helper) -(declare-function __FILE__ 'load-relative) - -(test-simple-start) - -(eval-when-compile - (defvar temp-bt) -) - -(setq temp-bt - (setup-bt "trepanx" - " 0 Trepanning(Object)#debug_program(dbgr, ruby_path, program_to_debug) at /foo.rb:10 - 3 main.__script__ at /bin/trepan:19 - 4 Kernel(Object)#load(name) at kernel/common/kernel.rb:678 - 5 main.__script__ at /home/rocky-rvm/.rvm/gems/rbx-head/bin/trepan:19 -")) - -(with-current-buffer temp-bt - (switch-to-buffer temp-bt) - (goto-char (point-min)) - (dolist (pair - '( - (" " . realgud-backtrace-number ) - ("Trepan" . font-lock-constant-face ) - ("Objec" . font-lock-variable-name-face ) - ("#" . font-lock-variable-name-face ) - ("(" . font-lock-variable-name-face ) - ("/foo" . realgud-file-name) - ("1" . realgud-line-number) - (" " . realgud-backtrace-number) - ("mai" . font-lock-constant-face ) - ("/bin" . realgud-file-name) - ("1" . realgud-line-number) - )) - (search-forward (car pair)) - (assert-equal (cdr pair) - (get-text-property (point) 'face)) - ) - ) - -(end-tests) diff --git a/packages/realgud/test/test-bt-zshdb.el b/packages/realgud/test/test-bt-zshdb.el deleted file mode 100644 index fcec317c2..000000000 --- a/packages/realgud/test/test-bt-zshdb.el +++ /dev/null @@ -1,35 +0,0 @@ -(require 'test-simple) -(require 'load-relative) -(load-file "./bt-helper.el") -(load-file "../realgud/debugger/zshdb/init.el") - -(declare-function setup-bt 'realgud-bt-helper) -(declare-function __FILE__ 'load-relative) - -(test-simple-start) - -(eval-when-compile - (defvar temp-bt) -) - -(setq temp-bt - (setup-bt "zshdb" - "->0 in file `/test/autogen.sh' at line 2 -##1 /test/autogen.sh called from file `/usr/local/bin/zshdb' at line 121 -")) -(with-current-buffer temp-bt - (switch-to-buffer temp-bt) - (goto-char (point-min)) - (dolist (pair - '( - ("->" . realgud-backtrace-number ) - ("/test" . realgud-file-name) - ("line " . realgud-line-number) - )) - (search-forward (car pair)) - (assert-equal (cdr pair) - (get-text-property (point) 'face)) - ) - ) - -(end-tests) diff --git a/packages/realgud/test/test-buf-bt.el b/packages/realgud/test/test-buf-bt.el deleted file mode 100644 index 074f8b9cd..000000000 --- a/packages/realgud/test/test-buf-bt.el +++ /dev/null @@ -1,24 +0,0 @@ -(require 'load-relative) -(require 'test-simple) -(require 'font-lock) - - -(load-file "../realgud/common/buffer/command.el") -(load-file "../realgud/common/buffer/backtrace.el") - -(declare-function realgud-get-buffer-base-name 'realgud-command) - -(test-simple-start) - -(note "realgud-buffer-backtrace") - -(assert-equal "abc" (realgud-get-buffer-base-name "*abc*") - "remove buffer stars") - -(assert-equal "abc" (realgud-get-buffer-base-name "abc") - "no buffer stars") - -(assert-equal "abc" (realgud-get-buffer-base-name "*abc shell*") - "remove buffer stars and shell") - -(end-tests) diff --git a/packages/realgud/test/test-buf-cmd.el b/packages/realgud/test/test-buf-cmd.el deleted file mode 100644 index fc17a06a9..000000000 --- a/packages/realgud/test/test-buf-cmd.el +++ /dev/null @@ -1,48 +0,0 @@ -(require 'test-simple) -(load-file "../realgud/common/buffer/command.el") -(load-file "../realgud/debugger/trepan/init.el") -(declare-function realgud-cmdbuf-init 'realgud-buffer-command) - -(test-simple-start) - -(eval-when-compile - (defvar temp-cmdbuf) - (defvar realgud-pat-hash) - (defvar realgud-cmdbuf-info) -) - -(assert-nil (realgud-cmdbuf? (current-buffer)) - "realgud-cmdbuf? before init") - -(assert-equal nil (realgud-cmdbuf-command-string (current-buffer)) - "realgud-cmdbuf-command-string - uninit") -(setq temp-cmdbuf (generate-new-buffer "*cmdbuf-test*")) -(assert-t (realgud-cmdbuf-init temp-cmdbuf "trepan" - (gethash "trepan" realgud-pat-hash)) - "realgud-cmdbuf-init") - -(with-current-buffer temp-cmdbuf - (switch-to-buffer temp-cmdbuf) - (realgud-cmdbuf-info-cmd-args= '("command" "args")) - (assert-equal "command args" - (realgud-cmdbuf-command-string temp-cmdbuf)) - (assert-equal "trepan" - (realgud-cmdbuf-debugger-name)) - (assert-equal nil - (realgud-cmdbuf-info-srcbuf-list - realgud-cmdbuf-info) - "srcbuf-list should start out nil") - (realgud-cmdbuf-add-srcbuf (current-buffer) temp-cmdbuf) - (assert-equal (list (current-buffer)) - (realgud-cmdbuf-info-srcbuf-list - realgud-cmdbuf-info) - "should have added one item to srcbuf-list") - (realgud-cmdbuf-add-srcbuf (current-buffer) temp-cmdbuf) - (assert-equal (list (current-buffer)) - (realgud-cmdbuf-info-srcbuf-list - realgud-cmdbuf-info) - "Second source buffer same as first; should have added still only one item.") - (switch-to-buffer nil) - ) - -(end-tests) diff --git a/packages/realgud/test/test-common-helper.el b/packages/realgud/test/test-common-helper.el deleted file mode 100644 index 8b33ab794..000000000 --- a/packages/realgud/test/test-common-helper.el +++ /dev/null @@ -1,28 +0,0 @@ -(require 'test-simple) -(load-file "../realgud/common/helper.el") - -(declare-function realgud-struct-field-setter 'realgud-helper) -(declare-function __FILE__ 'load-relative) - -(test-simple-start) - -(eval-when-compile - (defvar realgud-test-info) - (defvar realgud:debugger-name-transform) -) - -(defstruct realgud-test-info name) -(realgud-struct-field-setter "realgud-test-info" "name") - -(set (make-local-variable 'realgud-test-info) - (make-realgud-test-info :name "foo")) - -(note "setter macro works") -(assert-t (functionp 'realgud-test-info-name=)) -(assert-equal "foo" (realgud-test-info-name= "foo")) - -(note "realgud:debugger-name-transform") -(assert-equal "trepan" (realgud:debugger-name-transform "trepan")) -(assert-equal "realgud:gdb" (realgud:debugger-name-transform "gdb")) - -(end-tests) diff --git a/packages/realgud/test/test-core.el b/packages/realgud/test/test-core.el deleted file mode 100644 index 7acbc518f..000000000 --- a/packages/realgud/test/test-core.el +++ /dev/null @@ -1,93 +0,0 @@ -(require 'test-simple) -(eval-when-compile (defvar trepan-core)) - -(declare-function __FILE__ 'load-relative) -(setq trepan-core "../realgud/debugger/trepan/core.el") -(load-file "../realgud/common/core.el") - -(declare-function realgud:expand-file-name-if-exists 'realgud-core) -(declare-function realgud-parse-command-arg, 'realgud-core) -(declare-function realgud:trepan-parse-cmd-args 'realgud:trepan) - -;; We use a specific language to test core. Here we use trepan. -(load-file "../realgud/debugger/trepan/core.el") - -(test-simple-start) - -;; FIXME: Add a test of relgud-exec-shell where -;; we have two invocation of different files that canonicalize -;; to the same buffer. Make sure the buffers are distinct. -;; For example: bashdb /etc/profile should not match -;; bashdb /tmp/profile - -(note "realgud:expand-file-name-if-exists") - -(assert-equal (realgud:expand-file-name-if-exists "file-not-here") - "file-not-here" "no expansion when expanded file doesn't exist") - -(assert-equal (realgud:expand-file-name-if-exists ".") - (expand-file-name ".")) - -(note "realgud-parse-...") - -(lexical-let ((opt-two-args '("0" "C" "e" "E" "F" "i"))) - (assert-equal '(("-0" "a") nil) - (realgud-parse-command-arg '("-0" "a") '() opt-two-args) - "Two args found, none remain afterwards though.") - - (assert-equal - '(("-5") ("a" "-0")) - (realgud-parse-command-arg '("-5" "a" "-0") '() - opt-two-args) - "One arg not found.") - - (assert-equal - '((nil) nil) - (realgud-parse-command-arg '() '() opt-two-args) - "Degenerate case - no args" - ) - - (assert-equal - '(("--port" "123") ("bar")) - (realgud-parse-command-arg - '("--port" "123" "bar") '("-port") '()) - "two mandatory args" - ) - - (assert-equal - '(("/usr/bin/ruby1.9" "-W") ("trepan") ("foo") nil) - (realgud:trepan-parse-cmd-args - '("/usr/bin/ruby1.9" "-W" "trepan" "foo")) - "Separate Ruby with its arg from debugger and its arg.") - - (assert-equal - '(("ruby1.9" "-T3") ("trepan" "--port" "123") ("bar") nil) - (realgud:trepan-parse-cmd-args - '("ruby1.9" "-T3" "trepan" "--port" "123" "bar")) - "Ruby with two args and trepan with two args") - - (assert-equal - '(nil ("trepan" "--port" "1" "--annotate=3") - ("foo" "a") t) - (realgud:trepan-parse-cmd-args - '("trepan" "--port" "1" "--annotate=3" "foo" "a")) - "trepan with annotate args") - - (assert-equal - '(nil ("trepan" "--port" "123") - ("foo" "--emacs" "a") nil) - (realgud:trepan-parse-cmd-args - '("trepan" "--port" "123" "foo" "--emacs" "a")) - "trepan with --emacs in the wrong place") - - (assert-equal - '(("ruby" "-I/usr/lib/ruby") - ("trepan" "-h" "foo" "--emacs") - ("baz") t) - (realgud:trepan-parse-cmd-args - '("ruby" "-I/usr/lib/ruby" "trepan" "-h" "foo" - "--emacs" "baz")) - "trepan with emacs") - ) - -(end-tests) diff --git a/packages/realgud/test/test-file.el b/packages/realgud/test/test-file.el deleted file mode 100644 index 6f9de6838..000000000 --- a/packages/realgud/test/test-file.el +++ /dev/null @@ -1,125 +0,0 @@ -(require 'test-simple) -(load-file "../realgud/common/loc.el") -(load-file "../realgud/common/file.el") - -;; Note the below line number is tested so it must match what's listed -;; below. -(declare-function __FILE__ 'load-relative) - -(declare-function realgud:file-loc-from-line 'realgud-file) -(declare-function realgud:file-line-count 'realgud-file) -(declare-function realgud:file-column-from-string 'realgud-file) -(declare-function realgud-loc? 'realgud-loc) - -(declare-function realgud-loc-line-number 'realgud-loc) -(declare-function realgud-loc-column-number 'realgud-loc) -(declare-function realgud-loc-filename 'realgud-loc) - -(test-simple-start) - -(eval-when-compile - (defvar realgud-file-remap) - (defvar test-filename) - (defvar test-file-loc) - (defvar remap-filename) - (defvar old-compilation-find-file) -) - -(clrhash realgud-file-remap) - -(setq old-compilation-find-file (symbol-function 'compilation-find-file)) - -(setq test-filename (symbol-file 'test-simple)) - -(note "realgud:file-line-count") - -(assert-nil - (realgud:file-line-count "not-found-file") - "File not found") - -(assert-t (integerp (realgud:file-line-count test-filename)) - "File found") - - -(note "realgud:file-loc-from-line") - -(fset 'compilation-find-file (lambda(mark test-filename opt) - (get-buffer "*scratch*"))) - -(save-excursion - ;; NOTE: this calls compilation-find-file which prompts for a file - ;; (assert-equal - ;; "File named `not-found-file' not readable" - ;; (realgud:file-loc-from-line - ;; "not-found-file" 5 (make-marker)) - ;; ) - - (assert-t (stringp (realgud:file-loc-from-line test-filename 5.5)) - "invalid real line number") - - (assert-t (stringp (realgud:file-loc-from-line test-filename -1)) - "negative number") - - (note "realgud:file-loc-from-line information") - - (assert-t (stringp (realgud:file-loc-from-line test-filename 10001)) - "Line number too large for file") - - (setq test-file-loc (realgud:file-loc-from-line (__FILE__) 5 nil ";; Note")) - (assert-t (realgud-loc? test-file-loc) - "Ok loc creation - no cmd marker") - - (assert-t (realgud-loc? - (realgud:file-loc-from-line test-filename 30 (make-marker))) - "Ok loc creation - cmd marker") - - (assert-equal 5 (realgud-loc-line-number test-file-loc)) - - ;; FIXME: don't know why this fails in batch - ;; (assert-equal 0 (realgud-loc-column-number test-file-loc)) - - (assert-equal (__FILE__) (realgud-loc-filename test-file-loc)) - - (note "realgud:file-loc-from-line remapping") - - (setq remap-filename " bogus remap-filename.el") - - ;; (assert-equal - ;; (format "File named `%s' not readable" remap-filename) - ;; (realgud:file-loc-from-line - ;; remap-filename 5 (make-marker)) - ;; ) - ) - - -(puthash remap-filename test-filename realgud-file-remap) - -(assert-t (realgud-loc? - (realgud:file-loc-from-line remap-filename 30)) - "Ok loc creation with remap - no cmd marker") - -;; FIXME: don't know why this fails in batch -;; (assert-equal -;; 18 -;; (realgud:file-column-from-string (__FILE__) 7 "__FILE__") -;; "Should find string in file/line and get column" -;; ) - -(assert-nil - (realgud:file-column-from-string (__FILE__) 5 "__FILE__") - "Should not find string at this line in located file" - ) - -(assert-nil - (realgud:file-column-from-string (concat (__FILE__) "FOO") 7 "__FILE__") - "Should not find file" - ) - -(assert-nil - (realgud:file-column-from-string (__FILE__) 10000 "__FILE__") - "Should not find line in file at all" - ) - -(fset 'compilation-find-file old-compilation-find-file) - -(end-tests) diff --git a/packages/realgud/test/test-gdb.el b/packages/realgud/test/test-gdb.el deleted file mode 100644 index 4ee6796da..000000000 --- a/packages/realgud/test/test-gdb.el +++ /dev/null @@ -1,64 +0,0 @@ -(require 'test-simple) -(require 'load-relative) -(load-file "../realgud/common/buffer/command.el") -(load-file "../realgud/debugger/gdb/core.el") -(load-file "./regexp-helper.el") - -(eval-when-compile - (defvar realgud:gdb-minibuffer-history) - (defvar test:realgud-gdb-executable-save) - (defvar test:realgud-minibuffer-history-save) -) - -(declare-function realgud:gdb-suggest-invocation 'realgud:bashdb) -(declare-function __FILE__ 'require-relative) - -(test-simple-start) - -;; Save value realgud:run-process and change it to something we want -(setq test:realgud-gdb-executable-save (symbol-function 'realgud:gdb-executable)) -(setq test:realgud-minibuffer-history-save realgud:gdb-minibuffer-history) - -(defun realgud:gdb-executable (filename) - "Mock function for testing" - (cond ((equal filename "bar.sh") 7) - ((equal filename "foo") 8) - ((equal filename "baz") 8) - (t 3))) - -(setq realgud:gdb-minibuffer-history nil) - -(note "realgud:gdb-suggest-invocation") -(let ((my-directory (file-name-directory (__FILE__)))) - (save-excursion - (note "Test preference to buffer editing") - (setq default-directory - (concat my-directory "gdb")) - (find-file-literally "foo.c") - (assert-equal "gdb foo" (realgud:gdb-suggest-invocation) - "Should find file sans extension - foo") - (find-file-literally "baz.c") - (assert-equal "gdb baz" (realgud:gdb-suggest-invocation) - "Should find file sans extension - baz") - ) - (save-excursion - (note "Pick up non-sans executable") - (setq default-directory - (concat my-directory "gdb/test2")) - (assert-equal "gdb bar.sh" (realgud:gdb-suggest-invocation)) - (setq realgud:gdb-minibuffer-history '("gdb testing")) - (setq default-directory - (concat my-directory "gdb/test2")) - (assert-equal "gdb testing" (realgud:gdb-suggest-invocation) - "After setting minibuffer history - takes precidence") - ) - (setq default-directory my-directory) -) - -(end-tests) - -;; Restore the old values. -;; You might have to run the below if you run this interactively. -(fset 'realgud:gdb-executable test:realgud-gdb-executable-save) -(setq realgud:gdb-minibuffer-history test:realgud-minibuffer-history-save) -(setq default-directory (file-name-directory (__FILE__))) diff --git a/packages/realgud/test/test-gub-core.el b/packages/realgud/test/test-gub-core.el deleted file mode 100644 index 265c8488c..000000000 --- a/packages/realgud/test/test-gub-core.el +++ /dev/null @@ -1,19 +0,0 @@ -(require 'test-simple) -(load-file "../realgud/debugger/gub/core.el") - -(declare-function __FILE__ 'load-relative) -(declare-function gub-parse-cmd-args 'realgud-gub-core) - -(test-simple-start) - -(note "form(s) involving gub.sh shell script") -(assert-equal '("gub.sh" ("--gub=\"-I\"") ("./gcd.go" "3" "5")) - (gub-parse-cmd-args - '("gub.sh" "--gub=\"-I\"" "--" "./gcd.go" "3" "5"))) - -(note "form(s) involving underlying tortoise interpreter") -(assert-equal '("tortoise" ("-run" "-gub=" "-interp=SS") ("./gcd.go" "3" "5")) - (gub-parse-cmd-args - '("tortoise" "-run" "-gub=" "-interp=SS" "--" "./gcd.go" "3" "5"))) - -(end-tests) diff --git a/packages/realgud/test/test-jdb.el b/packages/realgud/test/test-jdb.el deleted file mode 100644 index 408b80833..000000000 --- a/packages/realgud/test/test-jdb.el +++ /dev/null @@ -1,15 +0,0 @@ -(require 'test-simple) -(require 'load-relative) -(load-file "../realgud/debugger/jdb/core.el") -(test-simple-start) - -(declare-function __FILE__ 'load-relative) -(declare-function realgud:jdb-parse-cmd-args 'realgud:jdb-core) -(declare-function realgud:jdb-dot-to-slash 'realgud:jdb-core) - -(assert-equal '("jdb" nil ("./TestMe.java")) - (realgud:jdb-parse-cmd-args '("jdb" "./TestMe.java"))) -(assert-equal "mcb/pcingola/SnpEff/main" - (realgud:jdb-dot-to-slash "mcb.pcingola.SnpEff.main")) - -(end-tests) diff --git a/packages/realgud/test/test-lang.el b/packages/realgud/test/test-lang.el deleted file mode 100644 index 0893b9935..000000000 --- a/packages/realgud/test/test-lang.el +++ /dev/null @@ -1,62 +0,0 @@ -(require 'test-simple) -(require 'load-relative) - -(eval-when-compile - (defvar elisp-file) - (defvar elisp-buffer) -) - -(set (make-local-variable 'elisp-file) - "../realgud/common/core.el") - -(load-file "../realgud/common/lang.el") -(test-simple-start) - -(declare-function realgud-suggest-lang-file 'realgud-lang) -(declare-function realgud:suggest-file-from-buffer 'realgud-lang) -(declare-function realgud-lang-mode? 'realgud-lang) -(declare-function __FILE__ 'load-relative) - -(note "realgud-lang-mode?") - -(assert-nil - (realgud-lang-mode? elisp-file "ruby") - "realgud-lang-mode? with Lisp file") - - -(save-excursion - (find-file "./gcd.rb") - (assert-t - (realgud-lang-mode? "./gcd.rb" "ruby") - "realgud-lang-mode? with Ruby file") - ) - - -(assert-equal "gcd.rb" - (realgud-suggest-lang-file "ruby" "\\.rb$") - "realgud-suggest-lang-file" - ) - -(assert-equal "default.bogus" - (realgud-suggest-lang-file "bogus" "\\.bogus$" "default.bogus") - "realgud-suggest-lang-file" - ) - -(assert-t (file-exists-p (realgud-suggest-lang-file "bogus" "\\.bogus$"))) - -(note "realgud:suggest-file-from-buffer") - - -(with-current-buffer - (setq elisp-buffer (find-file "./test-dbgr.el")) - (set (make-local-variable 'major-mode) - 'emacs-lisp-mode) - (message "set major mode to %s" major-mode) - ) -(assert-equal (buffer-file-name elisp-buffer) - (realgud:suggest-file-from-buffer - "emacs-lisp" - (list elisp-buffer)) - "realgud-lang-mode? with Lisp file") - -(end-tests) diff --git a/packages/realgud/test/test-loc-regexp-gub.el b/packages/realgud/test/test-loc-regexp-gub.el deleted file mode 100644 index bc44df829..000000000 --- a/packages/realgud/test/test-loc-regexp-gub.el +++ /dev/null @@ -1,60 +0,0 @@ -(require 'test-simple) -(require 'load-relative) -(load-file "./regexp-helper.el") -(load-file "../realgud/common/regexp.el") -(load-file "../realgud/debugger/gub/init.el") - -(declare-function realgud-cmdbuf-info-loc-regexp 'realgud-buffer-command) -(declare-function cmdbuf-loc-match 'realgud-regexp) -(declare-function realgud-loc-pat-regexp 'realgud-regexp) -(declare-function realgud-loc-pat-file-group 'realgud-regexp) -(declare-function realgud-loc-pat-line-group 'realgud-regexp) -(declare-function realgud-cmdbuf-info-file-group 'realgud-regexp) -(declare-function realgud-cmdbuf-info-line-group 'realgud-regexp) -(declare-function realgud-cmdbuf-info 'realgud-regexp) -(declare-function make-realgud-cmdbuf-info 'realgud-regexp) -(declare-function __FILE__ 'load-relative) - -(test-simple-start) - -(eval-when-compile - (defvar dbg-name) - (defvar realgud-pat-hash) - (defvar loc-pat) - (defvar test-dbgr) - (defvar test-text) -) - -;; Some setup usually done in setting up the buffer. -;; We customize this for the debugger trepan. Others may follow. -;; FIXME: encapsulate this. -(setq dbg-name "gub") -(setq loc-pat (gethash "loc" (gethash dbg-name realgud-pat-hash))) - -(setq test-dbgr (make-realgud-cmdbuf-info - :debugger-name dbg-name - :loc-regexp (realgud-loc-pat-regexp loc-pat) - :file-group (realgud-loc-pat-file-group loc-pat) - :line-group (realgud-loc-pat-line-group loc-pat))) - - -(setq test-text "interp/testdata/square.go:15:6") -(assert-t (numberp (cmdbuf-loc-match test-text test-dbgr)) "basic location") - -(note "extract file name") -(assert-equal 0 (cmdbuf-loc-match test-text test-dbgr)) -(assert-equal "interp/testdata/square.go" - (match-string (realgud-cmdbuf-info-file-group test-dbgr) - test-text)) - -(assert-equal "15" - (match-string - (realgud-cmdbuf-info-line-group test-dbgr) - test-text) "extract line number") - -(setq test-text " interp/testdata/square.go:15:6") -(assert-nil (numberp (cmdbuf-loc-match test-text test-dbgr)) - "location starts with blank") - - -(end-tests) diff --git a/packages/realgud/test/test-loc-regexp-trepan.el b/packages/realgud/test/test-loc-regexp-trepan.el deleted file mode 100644 index 84a63f2ed..000000000 --- a/packages/realgud/test/test-loc-regexp-trepan.el +++ /dev/null @@ -1,80 +0,0 @@ -(require 'test-simple) -(require 'load-relative) -(load-file "./regexp-helper.el") -(load-file "../realgud/common/regexp.el") -(load-file "../realgud/debugger/trepan/init.el") - -(declare-function realgud-cmdbuf-info-loc-regexp 'realgud-buffer-command) -(declare-function cmdbuf-loc-match 'realgud-regexp) -(declare-function realgud-loc-pat-regexp 'realgud-regexp) -(declare-function realgud-loc-pat-file-group 'realgud-regexp) -(declare-function realgud-loc-pat-line-group 'realgud-regexp) -(declare-function realgud-cmdbuf-info-file-group 'realgud-regexp) -(declare-function realgud-cmdbuf-info-line-group 'realgud-regexp) -(declare-function realgud-cmdbuf-info 'realgud-regexp) -(declare-function make-realgud-cmdbuf-info 'realgud-regexp) -(declare-function __FILE__ 'load-relative) - -(test-simple-start) - -(eval-when-compile - (defvar dbg-name) - (defvar realgud-pat-hash) - (defvar loc-pat) - (defvar test-dbgr) - (defvar test-text) -) - -;; Some setup usually done in setting up the buffer. -;; We customize this for the debugger trepan. Others may follow. -;; FIXME: encapsulate this. -(setq dbg-name "trepan") -(setq loc-pat (gethash "loc" (gethash dbg-name realgud-pat-hash))) - -(setq test-dbgr (make-realgud-cmdbuf-info - :debugger-name dbg-name - :loc-regexp (realgud-loc-pat-regexp loc-pat) - :file-group (realgud-loc-pat-file-group loc-pat) - :line-group (realgud-loc-pat-line-group loc-pat))) - -(setq test-text "-- (/usr/local/bin/irb:9 @2)") -(assert-t (numberp (cmdbuf-loc-match test-text test-dbgr)) "basic location") - -(note "extract file name") -(assert-equal 0 (cmdbuf-loc-match test-text test-dbgr)) -(assert-equal "/usr/local/bin/irb" - (match-string (realgud-cmdbuf-info-file-group test-dbgr) - test-text)) - -(assert-equal "9" - (match-string - (realgud-cmdbuf-info-line-group test-dbgr) - test-text) "extract line number") - -(setq test-text "-> (:28 remapped /usr/lib/ruby/gems/1.9.1/gems/data/custom_require.rb:28 @2)") -(assert-t (numberp (cmdbuf-loc-match test-text test-dbgr)) "remapped location") - -(assert-equal 0 (cmdbuf-loc-match test-text test-dbgr)) -(assert-equal "/usr/lib/ruby/gems/1.9.1/gems/data/custom_require.rb" - (match-string (realgud-cmdbuf-info-file-group test-dbgr) - test-text) "extract remapped file name") - -(assert-equal "28" - (match-string - (realgud-cmdbuf-info-line-group test-dbgr) - test-text) "extract remapped line number") - -(setq test-text "C> (/tmp/c-func.rb:2)") -(assert-t (numberp (cmdbuf-loc-match test-text test-dbgr)) "basic location for C fn") - -(assert-equal 0 (cmdbuf-loc-match test-text test-dbgr)) -(assert-equal "/tmp/c-func.rb" - (match-string (realgud-cmdbuf-info-file-group test-dbgr) - test-text) "extract file name for C fn") - -(assert-equal "2" - (match-string - (realgud-cmdbuf-info-line-group test-dbgr) - test-text) "extract line number for C fn") - -(end-tests) diff --git a/packages/realgud/test/test-loc-regexp-trepanpl.el b/packages/realgud/test/test-loc-regexp-trepanpl.el deleted file mode 100644 index bfaad7384..000000000 --- a/packages/realgud/test/test-loc-regexp-trepanpl.el +++ /dev/null @@ -1,125 +0,0 @@ -(load-file "./regexp-helper.el") -(load-file "../realgud/common/regexp.el") -(load-file "../realgud/debugger/trepan.pl/init.el") - -(declare-function realgud-cmdbuf-info-loc-regexp 'realgud-buffer-command) -(declare-function cmdbuf-loc-match 'realgud-regexp-helper) -(declare-function realgud-loc-pat-regexp 'realgud-regexp) -(declare-function realgud-loc-pat-file-group 'realgud-regexp) -(declare-function realgud-loc-pat-line-group 'realgud-regexp) -(declare-function realgud-cmdbuf-info-file-group 'realgud-regexp) -(declare-function realgud-cmdbuf-info-line-group 'realgud-regexp) -(declare-function realgud-cmdbuf-info 'realgud-regexp) -(declare-function make-realgud-cmdbuf-info 'realgud-regexp) -(declare-function realgud-loc-pat-num 'realgud-regexp) -(declare-function test-simple-start 'test-simple) -(declare-function assert-t 'test-simple) -(declare-function assert-equal 'test-simple) -(declare-function note 'test-simple) -(declare-function end-tests 'test-simple) - -(test-simple-start) - -(eval-when-compile - (defvar file-group) - (defvar frame-re) - (defvar line-group) - (defvar num-group) - (defvar test-pos) - (defvar dbg-name) - (defvar realgud-pat-hash) - (defvar loc-pat) - (defvar test-dbgr) - (defvar test-s1) - (defvar realgud-pat-bt) - (defvar realgud:trepanpl-pat-hash) -) - -; Some setup usually done in setting up the buffer. -; We customize this for the debugger trepan. Others may follow. -; FIXME: encapsulate this. -(setq dbg-name "trepan.pl") -(setq loc-pat (gethash "loc" (gethash dbg-name realgud-pat-hash))) - -(setq test-dbgr (make-realgud-cmdbuf-info - :debugger-name dbg-name - :loc-regexp (realgud-loc-pat-regexp loc-pat) - :file-group (realgud-loc-pat-file-group loc-pat) - :line-group (realgud-loc-pat-line-group loc-pat))) - - -(setq test-s1 "-- main::(../example/gcd.pl:18)") -(assert-t (numberp (cmdbuf-loc-match test-s1 test-dbgr)) "basic location") - -(assert-equal 0 (cmdbuf-loc-match test-s1 test-dbgr)) - -(note "extract location fields") -(assert-equal "../example/gcd.pl" - (match-string (realgud-cmdbuf-info-file-group test-dbgr) - test-s1)) - -(assert-equal "18" - (match-string - (realgud-cmdbuf-info-line-group test-dbgr) - test-s1) "extract line number") - - -(note "Test with hex location") -(setq test-s1 "-- File::Basename::(/usr/share/perl/5.14/File/Basename.pm:284 @0x8918b70)") -(assert-t (numberp (cmdbuf-loc-match test-s1 test-dbgr)) "basic location") -(assert-equal 0 (cmdbuf-loc-match test-s1 test-dbgr)) - -(assert-equal "/usr/share/perl/5.14/File/Basename.pm" - (match-string (realgud-cmdbuf-info-file-group test-dbgr) - test-s1)) - -(assert-equal "284" - (match-string - (realgud-cmdbuf-info-line-group test-dbgr) - test-s1) "extract line number") - - -(note "debugger-backtrace") -(setq realgud-pat-bt (gethash "debugger-backtrace" - realgud:trepanpl-pat-hash)) -(setq test-s1 - "--> #0 @ = File::Basename::fileparse('/usr/local/bin/trepan.pl') in - file `/usr/share/perl/5.18.2/File/Basename.pm' at line 107 - #1 @ = File::Basename::dirname('/usr/local/bin/trepan.pl') in - file `/usr/share/perl/5.18.2/File/Basename1.pm' at line 294 - #2 file `/usr/local/bin/trepan.pl' at line 11 -") -(setq frame-re (realgud-loc-pat-regexp realgud-pat-bt)) -(setq num-group (realgud-loc-pat-num realgud-pat-bt)) -(setq file-group (realgud-loc-pat-file-group realgud-pat-bt)) -(setq line-group (realgud-loc-pat-line-group realgud-pat-bt)) -(assert-equal 0 (string-match frame-re test-s1)) -(assert-equal "0" (substring test-s1 - (match-beginning num-group) - (match-end num-group))) -(assert-equal "/usr/share/perl/5.18.2/File/Basename.pm" - (substring test-s1 - (match-beginning file-group) - (match-end file-group))) -(assert-equal "107" - (substring test-s1 - (match-beginning line-group) - (match-end line-group))) -(setq test-pos (match-end 0)) - -(assert-equal 127 (string-match frame-re test-s1 test-pos)) -(assert-equal "1" (substring test-s1 - (match-beginning num-group) - (match-end num-group))) -(assert-equal "/usr/share/perl/5.18.2/File/Basename1.pm" - (substring test-s1 - (match-beginning file-group) - (match-end file-group))) -(assert-equal "294" - (substring test-s1 - (match-beginning line-group) - (match-end line-group))) -(setq test-pos (match-end 0)) -(assert-equal 254 test-pos) - -(end-tests) diff --git a/packages/realgud/test/test-loc-regexp-trepanx.el b/packages/realgud/test/test-loc-regexp-trepanx.el deleted file mode 100644 index a6006c78d..000000000 --- a/packages/realgud/test/test-loc-regexp-trepanx.el +++ /dev/null @@ -1,65 +0,0 @@ -(require 'test-simple) -(require 'load-relative) -(load-file "./regexp-helper.el") -(load-file "../realgud/common/regexp.el") -(load-file "../realgud/debugger/trepanx/init.el") - -(declare-function realgud-cmdbuf-info-loc-regexp 'realgud-buffer-command) -(declare-function cmdbuf-loc-match 'realgud-regexp) -(declare-function realgud-loc-pat-regexp 'realgud-regexp) -(declare-function realgud-loc-pat-file-group 'realgud-regexp) -(declare-function realgud-loc-pat-line-group 'realgud-regexp) -(declare-function realgud-cmdbuf-info-file-group 'realgud-regexp) -(declare-function realgud-cmdbuf-info-line-group 'realgud-regexp) -(declare-function realgud-cmdbuf-info 'realgud-regexp) -(declare-function make-realgud-cmdbuf-info 'realgud-regexp) -(declare-function __FILE__ 'require-relative) - -(test-simple-start) - -(eval-when-compile - (defvar dbg-name) - (defvar realgud-pat-hash) - (defvar loc-pat) - (defvar test-dbgr) - (defvar test-text) - (defvar xagent-pat) -) - -;; Some setup usually done in setting up the buffer. -;; We customize this for the debugger trepan. Others may follow. -;; FIXME: encapsulate this. -(setq dbg-name "trepanx") -(setq loc-pat (gethash "loc" (gethash dbg-name realgud-pat-hash))) -(setq xagent-pat (gethash "rubinius-backtrace-Xagent" (gethash dbg-name realgud-pat-hash))) - -(setq test-dbgr (make-realgud-cmdbuf-info - :debugger-name dbg-name - :loc-regexp (realgud-loc-pat-regexp loc-pat) - :file-group (realgud-loc-pat-file-group loc-pat) - :line-group (realgud-loc-pat-line-group loc-pat))) - - -(defun xagent-match(text) - (string-match (realgud-loc-pat-regexp xagent-pat) test-text) -) - -(setq test-text "-- (../rbx-trepanning/tmp/rbxtest.rb:7 @5)") -(assert-t (numberp (cmdbuf-loc-match test-text test-dbgr)) "basic location") - -(note "extract file name") -(setq test-text "-- (../rbx-trepanning/tmp/rbxtest.rb:7 @5)") -(assert-equal 0 (cmdbuf-loc-match test-text test-dbgr)) -(assert-equal "../rbx-trepanning/tmp/rbxtest.rb" - (match-string (realgud-cmdbuf-info-file-group test-dbgr) - test-text)) -(setq test-text "-- (../rbx-trepanning/tmp/rbxtest.rb:7 @5)") -(assert-equal "7" - (match-string - (realgud-cmdbuf-info-line-group test-dbgr) - test-text) "extract line number") - -(setq test-text "0xbfb63710: RakeFileUtils#ruby in /home/rocky-rvm/.rvm/gems/rbx-head/gems/rake-0.8.7/lib/rake.rb:1094 (+61)") -(assert-t (numberp (xagent-match test-text)) "basic xagent location") - -(end-tests) diff --git a/packages/realgud/test/test-loc.el b/packages/realgud/test/test-loc.el deleted file mode 100644 index 65665eff5..000000000 --- a/packages/realgud/test/test-loc.el +++ /dev/null @@ -1,60 +0,0 @@ -(require 'test-simple) -(load-file "../realgud/common/buffer/source.el") -(load-file "../realgud/common/loc.el") - -(declare-function __FILE__ 'load-relative) -(declare-function make-realgud-loc 'realgud-loc) -(declare-function realgud-loc-cmd-marker 'realgud-loc) -(declare-function realgud-loc-line-number 'realgud-loc) -(declare-function realgud-loc-marker 'realgud-loc) -(declare-function realgud-loc-marker= 'realgud-loc) - -(test-simple-start) - -(save-current-buffer - - ;; Below, we need to make sure current-buffer has an associated - ;; file with it. - (find-file (symbol-file 'test-simple)) - - (note "location field extraction") - (let* ((buff (current-buffer)) - (filename (buffer-file-name buff)) - (source-marker (point-marker)) - (cmd-marker (point-marker)) - (good-loc (make-realgud-loc - :filename filename - :line-number 5 - :marker source-marker - :cmd-marker cmd-marker - )) - (good-loc2 (make-realgud-loc - :filename filename - :line-number 6 - :marker source-marker - :cmd-marker cmd-marker - )) - ;; (good-loc3 (realgud-loc-current buff cmd-marker)) - ) - - (assert-equal 5 (realgud-loc-line-number good-loc) "line-number extraction") - - (assert-equal source-marker (realgud-loc-marker good-loc) - "source code marker extraction") - - - (assert-equal cmd-marker (realgud-loc-cmd-marker good-loc) - "command process marker extraction") - - - (realgud-loc-marker= good-loc2 source-marker) - (assert-equal source-marker (realgud-loc-marker good-loc2) - "marker set") - - )) - -(end-tests) - -; TODO: add test for debug-loc-goto, e.g. -;(realgud-loc-goto (realgud-loc-new "/tmp/bashdb.diff" 8)) -;(realgud-loc-goto (realgud-loc-new "/tmp/bashdb.diff" 8) 'other-window 1) diff --git a/packages/realgud/test/test-lochist.el b/packages/realgud/test/test-lochist.el deleted file mode 100644 index 5685e7415..000000000 --- a/packages/realgud/test/test-lochist.el +++ /dev/null @@ -1,107 +0,0 @@ -(require 'test-simple) -(load-file "../realgud/common/loc.el") -(load-file "../realgud/common/lochist.el") -(load-file "../realgud/common/buffer/helper.el") - -(declare-function __FILE__ 'load-relative) -(declare-function make-realgud-loc 'realgud-loc) -(declare-function make-realgud-loc-his 'realgud-loc) -(declare-function realgud-loc-hist-add 'realgud-lochist) -(declare-function realgud-loc-hist-ring 'realgud-lochist) -(declare-function realgud-loc-hist-item 'realgud-lochist) -(declare-function realgud-loc-hist-position 'realgud-lochist) -(declare-function realgud-loc-hist-index 'realgud-lochist) -(declare-function realgud-loc-hist-newest 'realgud-lochist) -(declare-function realgud-get-cmdbuf-from-srcbuf 'realgud-buffer-helper) - -(test-simple-start) - -;;; (defun setup() -;;; (lexical-let ((loc-hist (make-realgud-loc-hist)) -;;; (filename (buffer-file-name (current-buffer))) -;;; (loc (realgud-loc-current))) -;;; (realgud-loc-hist-add loc-hist loc))) -;;; ;; (message "aa ring-index %s" -;;; ;; (realgud-loc-hist-index loc-hist)))) - -;;; (setup) - - -;; FIXME: redo tests, so we don't have to almost duplicate and -;; dummy realgud-loc-current. -(defun realgud-loc-current(&optional source-buffer cmd-marker) - "Create a location object for the point in the current buffer. - If SOURCE-BUFFER is not given, take the current buffer as the - source buffer." - (interactive "") - (unless source-buffer - (setq source-buffer (current-buffer))) - ;;(unless (realgud-srcbuf? source-buffer) - ;; (error "%s is not a realgud source buffer" source-buffer)) - (unless cmd-marker - (setq cmd-marker - (realgud-get-cmdbuf-from-srcbuf source-buffer)) - ) - (with-current-buffer source-buffer - (let ((mark (point-marker)) - (text (realgud:buffer-line-no-props))) - (make-realgud-loc - :filename (buffer-file-name source-buffer) - :column-number (current-column) - :line-number (line-number-at-pos) - :source-text text - :marker mark - :cmd-marker cmd-marker - ) - ))) - - -(let ((saved-buffer (current-buffer))) - ; Below, we need to make sure current-buffer has an associated - ; file with it. - (find-file (symbol-file 'test-simple)) - - (note "location ring initialization and fields access") - (let* ((loc-hist (make-realgud-loc-hist)) - (source-buffer (current-buffer)) - (cmd-marker (point-marker)) - (filename (buffer-file-name (current-buffer))) - (loc (realgud-loc-current source-buffer cmd-marker))) - - (assert-t (ring-p (realgud-loc-hist-ring loc-hist)) - "get ring component for a new history ring") - - - (assert-equal -1 (realgud-loc-hist-position loc-hist) - "ring position for an empty history ring is -1") - - - (assert-nil (realgud-loc-hist-item loc-hist) - "get item for an empty history ring") - - (realgud-loc-hist-add loc-hist loc) - (assert-equal loc (realgud-loc-hist-item loc-hist) - "add an item to an empty history ring") - - - (assert-equal 1 (ring-length - (realgud-loc-hist-ring loc-hist)) - "One item in history ring") - - (assert-equal 1 (realgud-loc-hist-index loc-hist) - "ring index in history ring is 1") - - ;; (realgud-loc-hist-add loc-hist loc) - ;; (assert-equal 1 (ring-length - ;; (realgud-loc-hist-ring loc-hist) ) - ;; "duplicate item added is ignored") - - - (assert-equal 1 (realgud-loc-hist-index loc-hist) - "ring index in history ring after dup ignore is still 1") - - (assert-equal -1 (realgud-loc-hist-newest loc-hist) "Set to newest position") - - )) - -(end-tests) diff --git a/packages/realgud/test/test-nodejs.el b/packages/realgud/test/test-nodejs.el deleted file mode 100644 index b1b5953b4..000000000 --- a/packages/realgud/test/test-nodejs.el +++ /dev/null @@ -1,34 +0,0 @@ -(require 'test-simple) -(load-file "../realgud/debugger/nodejs/nodejs.el") - -(eval-when-compile (defvar test:run-process-save)) - -(declare-function nodejs-parse-cmd-args 'realgud:nodejs) -(declare-function nodejs 'realgud:nodejs) -(declare-function __FILE__ 'load-relative) - -(test-simple-start) - -;; Save value realgud:run-process and change it to something we want -(setq test:run-process-save (symbol-function 'realgud:run-process)) -(defun realgud:run-process(debugger-name script-filename cmd-args - minibuf-history &optional no-reset) - "Fake realgud:run-process used in testing" - (note - (format "%s %s %s" debugger-name script-filename cmd-args)) - (assert-equal "node" debugger-name "debugger name gets passed") - (let ((expanded-name (expand-file-name "./gcd.js"))) - (assert-equal expanded-name script-filename "file name check") - )) - -(note "nodejs-parse-cmd-args") -(assert-equal (list '("node" "debug") nil '("foo")) - (nodejs-parse-cmd-args '("node" "debug" "foo"))) - -;; FIXME: need to mock remove-ansi-schmutz in realgud:nodejs -;; (realgud:nodejs "node debug ./gcd.js 3 5") - -;; Restore the old value of realgud:run-process -(fset 'realgud:run-process test:run-process-save) - -(end-tests) diff --git a/packages/realgud/test/test-pdb.el b/packages/realgud/test/test-pdb.el deleted file mode 100644 index c511a953c..000000000 --- a/packages/realgud/test/test-pdb.el +++ /dev/null @@ -1,36 +0,0 @@ -(require 'test-simple) -(require 'load-relative) -(load-file "../realgud/debugger/pdb/pdb.el") - -(eval-when-compile (defvar test:run-process-save)) - -(declare-function pdb-parse-cmd-args 'realgud:pdb-core) -(declare-function realgud:pdb 'realgud:pdb) -(declare-function __FILE__ 'load-relative) - -(test-simple-start) - -;; Save value realgud:run-process and change it to something we want -(setq test:run-process-save (symbol-function 'realgud:run-process)) -(defun realgud:run-process(debugger-name script-filename cmd-args - minibuffer-histroy &optional no-reset) - "Fake realgud:run-process used in testing" - (note - (format "%s %s %s" debugger-name script-filename cmd-args)) - (assert-equal "pdb" debugger-name "debugger name gets passed") - (assert-equal (expand-file-name "./gcd.py") script-filename "file name check") - (assert-equal '("3" "5") (cddr cmd-args) "command args listified") - ) - -(note "pdb-parse-cmd-args") -(assert-equal (list nil '("pdb") (list (expand-file-name "foo")) nil) - (pdb-parse-cmd-args '("pdb" "foo"))) -(assert-equal (list nil '("pdb") (list (expand-file-name "program.py") "foo") nil) - (pdb-parse-cmd-args - '("pdb" "program.py" "foo"))) - -(realgud:pdb "pdb ./gcd.py 3 5") -;; Restore the old value of realgud:run-process -(fset 'realgud:run-process test:run-process-save) - -(end-tests) diff --git a/packages/realgud/test/test-perldb.el b/packages/realgud/test/test-perldb.el deleted file mode 100644 index 337dea149..000000000 --- a/packages/realgud/test/test-perldb.el +++ /dev/null @@ -1,23 +0,0 @@ -(require 'test-simple) -(load-file "../realgud/debugger/perldb/perldb.el") - -(declare-function realgud:perldb-parse-cmd-args 'realgud:perldb) -(declare-function realgud:perldb 'realgud:perldb) -(declare-function __FILE__ 'load-relative) - -(declare-function realgud-perldb-parse-cmd-args 'realgud-perldb) -(test-simple-start) - -(note "realgud:perldb-parse-cmd-args") -(assert-equal (list - '("perl" "-W" "-d") nil - (list (expand-file-name"gcd.rb") "a" "b")) - (realgud:perldb-parse-cmd-args - '("perl" "-W" "-d" "gcd.rb" "a" "b"))) -(assert-equal (list - '("perl5.10.1" "-C" "/tmp" "-d") nil - (list (expand-file-name "gcd.rb"))) - (realgud:perldb-parse-cmd-args - '("perl5.10.1" "-C" "/tmp" "-d" "gcd.rb"))) - -(end-tests) diff --git a/packages/realgud/test/test-pydb.el b/packages/realgud/test/test-pydb.el deleted file mode 100644 index c2ff3551e..000000000 --- a/packages/realgud/test/test-pydb.el +++ /dev/null @@ -1,15 +0,0 @@ -(require 'test-simple) -(require 'load-relative) -(load-file "../realgud/debugger/pydb/pydb.el") -(declare-function pydb-parse-cmd-args 'realgud:pydb) -(declare-function __FILE__ 'load-relative) - -(test-simple-start) - -(note "pydb-parse-cmd-args") -(assert-equal '(nil ("pydb") ("foo") nil) - (pydb-parse-cmd-args '("pydb" "foo"))) -(assert-equal '(nil ("pydb") ("program.py" "foo") nil) - (pydb-parse-cmd-args - '("pydb" "program.py" "foo"))) -(end-tests) diff --git a/packages/realgud/test/test-pydbgr.el b/packages/realgud/test/test-pydbgr.el deleted file mode 100644 index 6fc940d7c..000000000 --- a/packages/realgud/test/test-pydbgr.el +++ /dev/null @@ -1,35 +0,0 @@ -(require 'test-simple) -(require 'load-relative) -(load-file "../realgud/debugger/pydbgr/pydbgr.el") -(declare-function pydbgr-parse-cmd-args 'pydbgr-pdb) -(declare-function __FILE__ 'load-relative) - -(test-simple-start) - -(note "pydbgr-parse-cmd-args") - -(assert-equal '(nil ("pydbgr") ("foo") nil) - (pydbgr-parse-cmd-args '("pydbgr" "foo"))) -(assert-equal '(nil ("pydbgr" "-n") ("foo") nil) - (pydbgr-parse-cmd-args '("pydbgr" "-n" "foo"))) -(assert-equal '(nil ("pydbgr" "--annotate=1") ("foo") t) - (pydbgr-parse-cmd-args - '("pydbgr" "--annotate=1" "foo"))) -(assert-equal '(nil ("mypydbgr" "--annotate=1") ("foo") t) - (pydbgr-parse-cmd-args - '("mypydbgr" "--annotate=1" "foo"))) -(assert-equal '(("python") ("pydbgr" "--annotate") ("1" "foo") t) - (pydbgr-parse-cmd-args - '("python" "pydbgr" "--annotate" "1" "foo"))) -(assert-equal '(("/usr/bin/python") ("pydbgr" "--different") - ("foo") nil) - (pydbgr-parse-cmd-args - '("/usr/bin/python" "pydbgr" - "--different" "foo"))) -(assert-equal '(nil ("program.py") ("foo") nil) - (pydbgr-parse-cmd-args '("program.py" "foo"))) -(assert-equal '(nil ("pydbgr") ("program.py" "foo") nil) - (pydbgr-parse-cmd-args - '("pydbgr" "program.py" "foo"))) - -(end-tests) diff --git a/packages/realgud/test/test-rdebug.el b/packages/realgud/test/test-rdebug.el deleted file mode 100644 index 46b6a59d6..000000000 --- a/packages/realgud/test/test-rdebug.el +++ /dev/null @@ -1,42 +0,0 @@ -(require 'test-simple) -(require 'load-relative) -(load-file "../realgud/debugger/rdebug/rdebug.el") -(declare-function rdebug-get-script-name 'realgud-rdebug) -(declare-function __FILE__ 'load-relative) -(test-simple-start) - -(note "rdebug-get-script-name") -(assert-equal '("foo" nil) - (rdebug-get-script-name '("rdebug" "foo"))) -(assert-equal '("foo" nil) - (rdebug-get-script-name '("rdebug" "-m" "foo"))) -(assert-equal '("foo" t) - (rdebug-get-script-name - '("rdebug" "--emacs" "3" "foo"))) -(assert-equal '("foo" t) - (rdebug-get-script-name - '("myrdebug" "--annotate=1" "foo"))) -(assert-equal '("foo" t) - (rdebug-get-script-name - '("ruby" "rdebug" "--annotate" "1" "foo"))) -(assert-equal '("foo" nil) - (rdebug-get-script-name - '("/usr/bin/ruby19" "rdebug" - "--emacs-basic" "foo"))) -(assert-equal '("foo" nil) - (rdebug-get-script-name '("rdbg.rb" "foo"))) -(assert-equal '("rdbg.rb" nil) - (rdebug-get-script-name - '("rdebug" "rdbg.rb" "foo"))) -(assert-equal '("foo" t) - (rdebug-get-script-name - '("rdebug" "-A" "1" "foo"))) -(assert-equal '("foo" nil) - (rdebug-get-script-name - '("rdebug" "--include" "me" "-n" "foo"))) -(assert-equal '("foo" nil) - (rdebug-get-script-name - '("rdebug" "--server" "-d" "--host" - "localhost" "foo" "-1"))) - -(end-tests) diff --git a/packages/realgud/test/test-realgud.el b/packages/realgud/test/test-realgud.el deleted file mode 100644 index a4e557880..000000000 --- a/packages/realgud/test/test-realgud.el +++ /dev/null @@ -1,28 +0,0 @@ -(require 'test-simple) -(load-file "../realgud.el") - -(declare-function realgud:loaded-features 'realgud) -(declare-function realgud:unload-features 'realgud-regexp) -(declare-function __FILE__ 'load-relative) - -(test-simple-start) - -(eval-when-compile - (defvar test-realgud:features) -) - -(note "realgud") - -(note "realgud:loaded-features") -(set (make-local-variable 'test-realgud:features) (realgud:loaded-features)) -(dolist (feature '(realgud-trepan realgud-pydbgr - realgud-core)) - (assert-t (not (not (member feature test-realgud:features)))) ) - -(note "realgud-unload-features") -(load-file "../realgud.el") -(assert-nil (not (realgud:loaded-features))) -(assert-nil (not (realgud:unload-features))) -(realgud:loaded-features) - -(end-tests) diff --git a/packages/realgud/test/test-regexp-bashdb.el b/packages/realgud/test/test-regexp-bashdb.el deleted file mode 100644 index 0e7da4c49..000000000 --- a/packages/realgud/test/test-regexp-bashdb.el +++ /dev/null @@ -1,108 +0,0 @@ -(require 'test-simple) -(require 'load-relative) -(load-file "../realgud/debugger/bashdb/init.el") -(load-file "./regexp-helper.el") - -(declare-function loc-match 'realgud-helper) -(declare-function prompt-match 'regexp-helper) -(declare-function realgud-loc-pat-num 'realgud-regexp) -(declare-function realgud-loc-pat-regexp 'realgud-regexp) -(declare-function realgud-loc-pat-file-group 'realgud-regexp) -(declare-function realgud-loc-pat-line-group 'realgud-regexp) -(declare-function __FILE__ 'load-relative) - -(test-simple-start) - -(eval-when-compile - (defvar file-group) - (defvar frame-re) - (defvar line-group) - (defvar num-group) - (defvar test-pos) - (defvar prompt-pat) - (defvar realgud:bashdb-pat-hash) - (defvar realgud-pat-bt) - (defvar test-s1) - (defvar test-text) - (defvar brkpt-del) - (defvar bp-del-pat) -) - -(set (make-local-variable 'bp-del-pat) - (gethash "brkpt-del" realgud:bashdb-pat-hash)) - -(note "bashdb prompt matching") -(set (make-local-variable 'prompt-pat) - (gethash "prompt" realgud:bashdb-pat-hash)) -(prompt-match "bashdb<10> " "10") -(prompt-match "bashdb<(5)> " "5" "subshell prompt %s") -(prompt-match "bashdb<<1>> " "1" "nested debug prompt %s") - -(note "debugger-backtrace") -(setq realgud-pat-bt (gethash "debugger-backtrace" - realgud:bashdb-pat-hash)) -(setq test-s1 - "->0 in file `/etc/apparmor/functions' at line 24 -##1 source(\"/etc/apparmor/functions\") called from file `/etc/init.d/apparmor' at line 35 -##2 source(\"/etc/init.d/apparmor\") called from file `/usr/local/bin/bashdb' at line 140 -##3 main() called from file `/bin/bashdb' at line 0 -") -(setq frame-re (realgud-loc-pat-regexp realgud-pat-bt)) -(setq num-group (realgud-loc-pat-num realgud-pat-bt)) -(setq file-group (realgud-loc-pat-file-group realgud-pat-bt)) -(setq line-group (realgud-loc-pat-line-group realgud-pat-bt)) -(assert-equal 0 (string-match frame-re test-s1)) -(assert-equal "0" (substring test-s1 - (match-beginning num-group) - (match-end num-group))) -(assert-equal "/etc/apparmor/functions" - (substring test-s1 - (match-beginning file-group) - (match-end file-group))) -(assert-equal "24" - (substring test-s1 - (match-beginning line-group) - (match-end line-group))) -(setq test-pos (match-end 0)) - -(assert-equal 49 (string-match frame-re test-s1 test-pos)) -(assert-equal "1" (substring test-s1 - (match-beginning num-group) - (match-end num-group))) -(assert-equal "/etc/init.d/apparmor" - (substring test-s1 - (match-beginning file-group) - (match-end file-group))) -(assert-equal "35" - (substring test-s1 - (match-beginning line-group) - (match-end line-group))) -(setq test-pos (match-end 0)) -(assert-equal 138 (string-match frame-re test-s1 test-pos)) -(assert-equal "2" (substring test-s1 - (match-beginning num-group) - (match-end num-group))) -(assert-equal "/usr/local/bin/bashdb" - (substring test-s1 - (match-beginning file-group) - (match-end file-group))) -(assert-equal "140" - (substring test-s1 - (match-beginning line-group) - (match-end line-group))) -(setq test-pos (match-end 0)) -(assert-equal 226 (string-match frame-re test-s1 test-pos)) -(assert-equal "3" (substring test-s1 - (match-beginning num-group) - (match-end num-group))) -(assert-equal "/bin/bashdb" - (substring test-s1 - (match-beginning file-group) - (match-end file-group))) - -(note "breakpoint delete matching") -(setq test-text "Removed 1 breakpoint(s).\n") -(assert-t (numberp (loc-match test-text bp-del-pat)) "breakpoint delete matching") - - -(end-tests) diff --git a/packages/realgud/test/test-regexp-gdb.el b/packages/realgud/test/test-regexp-gdb.el deleted file mode 100644 index 1975982cd..000000000 --- a/packages/realgud/test/test-regexp-gdb.el +++ /dev/null @@ -1,108 +0,0 @@ -(require 'test-simple) -(require 'load-relative) -(load-file "../realgud/common/buffer/command.el") -(load-file "../realgud/debugger/gdb/init.el") -(load-file "./regexp-helper.el") - -(declare-function __FILE__ 'load-relative) - -(test-simple-start) - -(eval-when-compile - (defvar dbg-name) (defvar realgud-pat-hash) (defvar realgud-bt-hash) - (defvar loc-pat) (defvar prompt-pat) (defvar s1) - (defvar file-group) (defvar line-group) (defvar pos) - (defvar test-dbgr) (defvar test-text) -) - -; Some setup usually done in setting up the buffer. -; We customize this for this debugger. -; FIXME: encapsulate this. -(setq dbg-name "gdb") - -(setq loc-pat (gethash "loc" (gethash dbg-name realgud-pat-hash))) -(setq test-dbgr (make-realgud-cmdbuf-info - :debugger-name dbg-name - :loc-regexp (realgud-loc-pat-regexp loc-pat) - :file-group (realgud-loc-pat-file-group loc-pat) - :line-group (realgud-loc-pat-line-group loc-pat))) - -;; FIXME: we get a void variable somewhere in here when running -;; even though we define it in lexical-let. Dunno why. -;; setq however will workaround this. -(setq test-text "/home/rocky/c/ctest.c:80:2000:beg:0x8048748>") -(note "traceback location matching") - -(assert-t (numberp (cmdbuf-loc-match test-text test-dbgr)) "basic location") -(assert-equal "/home/rocky/c/ctest.c" - (match-string (realgud-cmdbuf-info-file-group test-dbgr) - test-text) "extract file name") -(assert-equal "80" - (match-string (realgud-cmdbuf-info-line-group test-dbgr) - test-text) "extract line number") -(note "debugger-backtrace") -(setq realgud-bt-pat (gethash "debugger-backtrace" - realgud:gdb-pat-hash)) -(setq s1 - "#0 main (argc=2, argv=0xbffff564, envp=0xbffff570) at main.c:935 -#1 0xb7e9f4a5 in *__GI___strdup (s=0xbffff760 \"/tmp/remake/remake\") at strdup.c:42 -#2 0x080593ac in main (argc=2, argv=0xbffff5a4, envp=0xbffff5b0) - at main.c:952 -#46 0xb7f51b87 in vm_call_cfunc (th=0x804d188, reg_cfp=0xb7ba9e88, num=0, - recv=157798080, blockptr=0x0, me=0x80d12a0) at vm_insnhelper.c:410 -") -(setq realgud-bt-re (realgud-loc-pat-regexp realgud-bt-pat)) -(setq file-group (realgud-loc-pat-file-group realgud-bt-pat)) -(setq line-group (realgud-loc-pat-line-group realgud-bt-pat)) -(assert-equal 0 (string-match realgud-bt-re s1)) -(assert-equal "main.c" - (substring s1 - (match-beginning file-group) - (match-end file-group))) -(assert-equal "935" - (substring s1 - (match-beginning line-group) - (match-end line-group))) - -(setq pos (match-end 0)) -(assert-equal 65 pos) -(assert-equal 65 (string-match realgud-bt-re s1 pos)) -(assert-equal "strdup.c" - (substring s1 - (match-beginning file-group) - (match-end file-group))) -(assert-equal "42" - (substring s1 - (match-beginning line-group) - (match-end line-group))) - -(setq pos (match-end 0)) -(assert-equal 149 pos) -(assert-equal 149 (string-match realgud-bt-re s1 pos)) -(assert-equal "main.c" - (substring s1 - (match-beginning file-group) - (match-end file-group))) -(assert-equal "952" - (substring s1 - (match-beginning line-group) - (match-end line-group))) - -(setq pos (match-end 0)) -(assert-equal 233 pos) -(assert-equal 233 (string-match realgud-bt-re s1 pos)) -(assert-equal "vm_insnhelper.c" - (substring s1 - (match-beginning file-group) - (match-end file-group))) -(assert-equal "410" - (substring s1 - (match-beginning line-group) - (match-end line-group))) - -(note "prompt") -(set (make-local-variable 'prompt-pat) - (gethash "prompt" realgud:gdb-pat-hash)) -(prompt-match "(gdb) ") - -(end-tests) diff --git a/packages/realgud/test/test-regexp-gub.el b/packages/realgud/test/test-regexp-gub.el deleted file mode 100644 index 206912539..000000000 --- a/packages/realgud/test/test-regexp-gub.el +++ /dev/null @@ -1,62 +0,0 @@ -(require 'test-simple) -(load-file "../realgud/common/buffer/command.el") -(load-file "../realgud/debugger/gub/init.el") -(load-file "./regexp-helper.el") - -(test-simple-start) - -(declare-function __FILE__ 'load-relative) - -(eval-when-compile - (defvar dbg-name) - (defvar realgud:gub-pat-hash) - (defvar panic-tb) - (defvar test-tb) - (defvar prompt-pat) - (defvar test-dbgr) - (defvar test-text) -) - -; Some setup usually done in setting up the buffer. -; We customize this for this debugger. -; FIXME: encapsulate this. -(setq dbg-name "gub") - -(note "gub prompt") -(set (make-local-variable 'prompt-pat) - (gethash "prompt" realgud:gub-pat-hash)) -(prompt-match "gub[0]: ") -(prompt-match "gub[20]: ") -(prompt-match "gub[32@5]: ") - -(setup-regexp-vars realgud:gub-pat-hash) -(set (make-local-variable 'test-tb) - (gethash "lang-backtrace" realgud:gub-pat-hash)) - -(note "go lang traceback") -(setq test-text "/usr/local/go/src/pkg/runtime/panic.c:482 (0x805c956)") - -(assert-t (numberp (tb-loc-match test-text)) "go traceback location") -(assert-equal "/usr/local/go/src/pkg/runtime/panic.c" - (match-string (realgud-loc-pat-file-group test-tb) - test-text) "extract traceback file name") -(assert-equal "482" - (match-string (realgud-loc-pat-line-group test-tb) - test-text) "extract traceback line number") - -(note "panic traceback") -(setq test-text " /tmp/github.com/rocky/ssa-interp/eval/selectorexpr.go:18 +0x9f") - -(set (make-local-variable 'panic-tb) - (gethash "panic-backtrace" realgud:gub-pat-hash)) - -(assert-t (numberp (string-match (realgud-loc-pat-regexp panic-tb) test-text)) - "go panic location") -(assert-equal "/tmp/github.com/rocky/ssa-interp/eval/selectorexpr.go" - (match-string (realgud-loc-pat-file-group test-tb) - test-text) "extract panic traceback file name") -(assert-equal "18" - (match-string (realgud-loc-pat-line-group test-tb) - test-text) "extract panic traceback line number") - -(end-tests) diff --git a/packages/realgud/test/test-regexp-jdb.el b/packages/realgud/test/test-regexp-jdb.el deleted file mode 100644 index 9b5005719..000000000 --- a/packages/realgud/test/test-regexp-jdb.el +++ /dev/null @@ -1,75 +0,0 @@ -(require 'test-simple) -(load-file "../realgud/common/buffer/command.el") -(load-file "../realgud/debugger/jdb/init.el") -(load-file "./regexp-helper.el") - -(declare-function __FILE__ 'load-relative) -(declare-function prompt-match 'regexp-helper) - -(eval-when-compile - (defvar dbg-name) (defvar realgud-pat-hash) (defvar loc-pat) - (defvar test-dbgr) (defvar test-text) (defvar prompt-pat) - (defvar realgud:jdb-pat-hash) -) - -(test-simple-start) - -(note "jdb prompt matching") -(set (make-local-variable 'prompt-pat) - (gethash "prompt" realgud:jdb-pat-hash)) -(prompt-match "main[1] " "1" "most common main prompt") -(prompt-match "main[2] " "2" "main prompt up a level") -(prompt-match "> " nil "no loc prompt") - - -; Some setup usually done in setting up the buffer. -; We customize this for this debugger. -; FIXME: encapsulate this. -(setq dbg-name "jdb") - -(setq loc-pat (gethash "loc" (gethash dbg-name realgud-pat-hash))) -(setq test-dbgr (make-realgud-cmdbuf-info - :debugger-name dbg-name - :loc-regexp (realgud-loc-pat-regexp loc-pat) - :file-group (realgud-loc-pat-file-group loc-pat) - :line-group (realgud-loc-pat-line-group loc-pat))) - -;; FIXME: we get a void variable somewhere in here when running -;; even though we define it in lexical-let. Dunno why. -;; setq however will workaround this. -(let ((text "Breakpoint hit: \"thread=main\", TestMe.main(), line=7 bci=0")) - - (note "traceback location matching") - - (assert-t (numberp (cmdbuf-loc-match text test-dbgr)) "breakpoint location") - (assert-equal "7" - (match-string (realgud-cmdbuf-info-line-group test-dbgr) - text) "extract line number from breakpoint")) - -(let ((text "Step completed: \"thread=main\", TestMe.main(), line=71 bci=0")) - (assert-t (numberp (cmdbuf-loc-match text test-dbgr)) "breakpoint location") - (assert-equal "71" - (match-string (realgud-cmdbuf-info-line-group test-dbgr) - text) "extract line number from step")) - -;; (note "debugger-backtrace") -;; (setq realgud-bt-pat (gethash "debugger-backtrace" -;; realgud:jdb-pat-hash)) -;; (setq s1 -;; " [1] java.lang.Class.getDeclaredMethods0 (native method) -;; [2] java.lang.Class.privateGetDeclaredMethods (Class.java:2,570) -;; [3] java.lang.Class.getMethod0 (Class.java:2,813) -;; [4] java.lang.Class.getMethod (Class.java:1,663) -;; [5] sun.launcher.LauncherHelper.getMainMethod (LauncherHelper.java:494) -;; [6] sun.launcher.LauncherHelper.checkAndLoadMain (LauncherHelper.java:486) -;; ") -;; (setq realgud-bt-re (realgud-loc-pat-regexp realgud-bt-pat)) -;; (setq file-group (realgud-loc-pat-file-group realgud-bt-pat)) -;; (setq line-group (realgud-loc-pat-line-group realgud-bt-pat)) -;; (assert-equal 0 (string-match realgud-bt-re s1)) -;; (assert-equal "570" -;; (substring s1 -;; (match-beginning line-group) -;; (match-end line-group))) - -(end-tests) diff --git a/packages/realgud/test/test-regexp-nodejs.el b/packages/realgud/test/test-regexp-nodejs.el deleted file mode 100644 index c1f4064f9..000000000 --- a/packages/realgud/test/test-regexp-nodejs.el +++ /dev/null @@ -1,57 +0,0 @@ -(require 'test-simple) -(load-file "../realgud/debugger/nodejs/init.el") -(load-file "./regexp-helper.el") - -(declare-function realgud-cmdbuf-info-loc-regexp 'realgud-buffer-command) -(declare-function cmdbuf-loc-match 'realgud-regexp) -(declare-function loc-match 'realgud-helper) -(declare-function prompt-match 'regexp-helper) -(declare-function realgud-loc-pat-num 'realgud-regexp) -(declare-function realgud-loc-pat-regexp 'realgud-regexp) -(declare-function realgud-loc-pat-file-group 'realgud-regexp) -(declare-function realgud-loc-pat-line-group 'realgud-regexp) -(declare-function __FILE__ 'load-relative) - -(test-simple-start) - -(eval-when-compile - (defvar dbg-name) - (defvar loc-pat) - (defvar prompt-pat) - (defvar realgud:nodejs-pat-hash) - (defvar realgud-pat-hash) - (defvar test-dbgr) - (defvar test-text) -) - -(note "nodejs prompt matching") -(set (make-local-variable 'prompt-pat) - (gethash "prompt" realgud:nodejs-pat-hash)) -(prompt-match "debug> ") -(prompt-match "debug> connecting... ok") - -(note "nodejs location matching") -(setq dbg-name "nodejs") -(setq loc-pat (gethash "loc" (gethash dbg-name realgud-pat-hash))) - -(setq test-dbgr (make-realgud-cmdbuf-info - :debugger-name dbg-name - :loc-regexp (realgud-loc-pat-regexp loc-pat) - :file-group (realgud-loc-pat-file-group loc-pat) - :line-group (realgud-loc-pat-line-group loc-pat))) - -(setq test-text "break in test/fixtures/break-in-module/main.js:1\n") -(assert-t (numberp (cmdbuf-loc-match test-text test-dbgr)) "basic location") - -(string-match (realgud-cmdbuf-info-loc-regexp test-dbgr) test-text) -(assert-equal "test/fixtures/break-in-module/main.js" - (match-string (realgud-cmdbuf-info-file-group test-dbgr) - test-text)) - -(string-match (realgud-cmdbuf-info-loc-regexp test-dbgr) test-text) -(assert-equal "1" - (match-string - (realgud-cmdbuf-info-line-group test-dbgr) - test-text) "extract line number") - -(end-tests) diff --git a/packages/realgud/test/test-regexp-pdb.el b/packages/realgud/test/test-regexp-pdb.el deleted file mode 100644 index 7cf62b273..000000000 --- a/packages/realgud/test/test-regexp-pdb.el +++ /dev/null @@ -1,104 +0,0 @@ -(require 'test-simple) -(load-file "../realgud/debugger/pdb/init.el") -(load-file "./regexp-helper.el") - -(declare-function __FILE__ 'load-relative) -(declare-function prompt-match 'regexp-helper) - -(test-simple-start) - -(eval-when-compile - (defvar loc-pat) (defvar prompt-pat) (defvar realgud:pdb-pat-hash) - (defvar tb-pat) (defvar test-text) (defvar prompt-str) - (defvar bps-pat) -) - -(set (make-local-variable 'bps-pat) - (gethash "brkpt-set" realgud:pdb-pat-hash)) - -(set (make-local-variable 'loc-pat) - (gethash "loc" realgud:pdb-pat-hash)) - -(set (make-local-variable 'prompt-pat) - (gethash "prompt" realgud:pdb-pat-hash)) - -(set (make-local-variable 'tb-pat) - (gethash "lang-backtrace" realgud:pdb-pat-hash)) - -;; FIXME: we get a void variable somewhere in here when running -;; even though we define it in lexical-let. Dunno why. -;; setq however will workaround this. -(setq test-text - " File \"/usr/lib/python2.6/code.py\", line 281, in raw_input") -(note "traceback location matching") - -(assert-t (numberp (loc-match test-text tb-pat)) "basic traceback location") - -(assert-equal "/usr/lib/python2.6/code.py" - (match-string (realgud-loc-pat-file-group tb-pat) - test-text)) - -(setq test-text - " File \"/usr/lib/python2.6/code.py\", line 281, in raw_input") -(loc-match test-text tb-pat) -(assert-equal "281" - (match-string (realgud-loc-pat-line-group tb-pat) - test-text) "extract line number") - -(note "breakpoint location matching") - -(setq test-text "Breakpoint 1 at /src/git/code/gcd.py:13") -(assert-t (numberp (loc-match test-text bps-pat)) - "basic breakpoint location") - -(assert-equal "/src/git/code/gcd.py" - (match-string (realgud-loc-pat-file-group - bps-pat) - test-text) - "extract breakpoint file name") - - -(assert-equal "13" - (match-string (realgud-loc-pat-line-group - bps-pat) - test-text) "extract breakpoint line number") - -;; (set test-text "(c:\\working\\python\\helloworld.py:30): ") -;; -;; (assert-t (numberp (loc-match test-text loc-pat)) "MS DOS position location") -;; ;; -;; (assert-equal "c:\\working\\python\\helloworld.py" -;; (match-string (realgud-loc-pat-file-group loc-pat) -;; test-text) -;; (format "Failing file group is %s" -;; (realgud-loc-pat-file-group tb-pat)) -;; "extract file name") -;; (assert-equal "30" -;; (match-string (realgud-loc-pat-line-group loc-pat) -;; test-text) "extract line number") - -(setq test-text "> /usr/bin/ipython(24)") -(assert-t (numberp (loc-match test-text loc-pat)) "position location") -(assert-equal "/usr/bin/ipython" - (match-string (realgud-loc-pat-file-group loc-pat) - test-text) - (format "Failing file group is %s" - (realgud-loc-pat-file-group tb-pat))) -(assert-equal "24" - (match-string (realgud-loc-pat-line-group - loc-pat) - test-text) - "extract line number") - - -(note "prompt matching") -(set (make-local-variable 'prompt-str) "(Pdb) ") -(prompt-match prompt-str nil "debugger prompt: %s") -(setq prompt-str "((Pdb)) ") -(prompt-match prompt-str nil "nested debugger prompt: %s") -(setq prompt-str "Pdb) ") -(assert-nil (numberp (loc-match prompt-str prompt-pat)) - (format "%s %s" "invalid debugger prompt" - prompt-str)) - -(end-tests) diff --git a/packages/realgud/test/test-regexp-perldb.el b/packages/realgud/test/test-regexp-perldb.el deleted file mode 100644 index ef91b29fd..000000000 --- a/packages/realgud/test/test-regexp-perldb.el +++ /dev/null @@ -1,188 +0,0 @@ -(require 'test-simple) -(load-file "../realgud/common/buffer/command.el") -(load-file "../realgud/lang/perl.el") -(load-file "../realgud/debugger/perldb/init.el") -(load-file "./regexp-helper.el") - -(declare-function __FILE__ 'load-relative) -(declare-function prompt-match 'regexp-helper) -(declare-function cmdbuf-loc-match 'realgud-regexp) - -(test-simple-start) - -(eval-when-compile - (defvar dbg-name) - (defvar realgud:perldb-pat-hash) - (defvar realgud-pat-hash) - (defvar panic-tb) - (defvar loc-pat) - (defvar test-pos) - (defvar prompt-pat) - (defvar test-dbgr) - (defvar carp-bt-re) - (defvar file-group) - (defvar line-group) - (defvar test-text) - (defvar lang-bt-pat) - (defvar lang-bt-re) - (defvar realgud-bt-pat) - (defvar realgud-bt-re) - (defvar test-s1) - (defvar realgud-perl-ignore-file-re) -) - -; Some setup usually done in setting up the buffer. -; We customize this for this debugger. -; FIXME: encapsulate this. -(setq dbg-name "perldb") -(set (make-local-variable 'loc-pat) - (gethash "loc" (gethash dbg-name realgud-pat-hash))) -(set (make-local-variable 'prompt-pat) - (gethash "prompt" realgud:perldb-pat-hash)) - -(setq test-dbgr (make-realgud-cmdbuf-info - :debugger-name dbg-name - :loc-regexp (realgud-loc-pat-regexp loc-pat) - :file-group (realgud-loc-pat-file-group loc-pat) - :line-group (realgud-loc-pat-line-group loc-pat) - :text-group (realgud-loc-pat-text-group loc-pat) - )) - -(note "prompt") -(prompt-match " DB<2> " "2") -(prompt-match "[pid=6489->6502] DB<1> " "1") - -(assert-equal 0 (string-match realgud-perl-ignore-file-re - "(eval 1006)[../example/eval.pl:5]") - "perldb file ignore matching") - -(setq test-text "main::(/usr/bin/latex2html:102):") - -(assert-t (numberp (cmdbuf-loc-match test-text test-dbgr)) "basic location") -(assert-equal "/usr/bin/latex2html" - (match-string (realgud-cmdbuf-info-file-group test-dbgr) - test-text) - "extract file name") - -(setq test-text "File::Basename::dirname(/usr/share/perl/5.16.0/File/Basename.pm:284): -284: my $path = shift; -") - -(assert-t (numberp (cmdbuf-loc-match test-text test-dbgr)) - "location with source") -(assert-equal "/usr/share/perl/5.16.0/File/Basename.pm" - (match-string (realgud-cmdbuf-info-file-group test-dbgr) - test-text) - "extract file name when we have source text") -(assert-equal "284" - (match-string (realgud-cmdbuf-info-line-group test-dbgr) - test-text) - "extract line number when we have source text") -(assert-equal " my $path = shift;" - (match-string (realgud-cmdbuf-info-text-group test-dbgr) - test-text) - "extract source text") - -(setq test-text "main::((eval 6)[eval.pl:5]:2): $x = 2;") - -(assert-t (numberp (cmdbuf-loc-match test-text test-dbgr)) "eval location") -(assert-equal "(eval 6)[eval.pl:5]" - (match-string (realgud-cmdbuf-info-file-group test-dbgr) - test-text) - "extract file name") - -(assert-equal "2" - (match-string (realgud-cmdbuf-info-line-group test-dbgr) - test-text) "extract line number") - -(note "location for with CODE in it") -(setq test-text "main::CODE(0x9407ac8)(l2hconf.pm:6):") -(assert-t (numberp (cmdbuf-loc-match test-text test-dbgr))) -(assert-equal "l2hconf.pm" - (match-string (realgud-cmdbuf-info-file-group test-dbgr) - test-text)) -(assert-equal "6" - (match-string (realgud-cmdbuf-info-line-group test-dbgr) - test-text)) - -(note "debugger-backtrace") -(setq realgud-bt-pat (gethash "debugger-backtrace" - realgud:perldb-pat-hash)) -(setq test-s1 - "$ = main::top_navigation_panel called from file `./latex2html' line 7400 -p") -(setq realgud-bt-re (realgud-loc-pat-regexp realgud-bt-pat)) -(setq file-group (realgud-loc-pat-file-group realgud-bt-pat)) -(setq line-group (realgud-loc-pat-line-group realgud-bt-pat)) -(assert-equal 30 (string-match realgud-bt-re test-s1)) -(assert-equal "./latex2html" - (substring test-s1 - (match-beginning file-group) - (match-end file-group))) -(assert-equal "7400" - (substring test-s1 - (match-beginning line-group) - (match-end line-group))) - -(note "debugger-errmsg") -(setq realgud-bt-pat (gethash "perl-errmsg" - realgud:perldb-pat-hash)) -(setq test-s1 - "Use of uninitialized value $lines[0] in join or string at bin/../lib/LineCache.pm line 548.") -(setq realgud-bt-re (realgud-loc-pat-regexp realgud-bt-pat)) -(setq file-group (realgud-loc-pat-file-group realgud-bt-pat)) -(setq line-group (realgud-loc-pat-line-group realgud-bt-pat)) -(assert-equal 54 (string-match realgud-bt-re test-s1)) -(assert-equal "bin/../lib/LineCache.pm" - (substring test-s1 - (match-beginning file-group) - (match-end file-group))) -(assert-equal "548" - (substring test-s1 - (match-beginning line-group) - (match-end line-group))) - -(note "carp-backtrace") -(setq test-s1 - " at /tmp/foo.pl line 7 - main::__ANON__('Illegal division by zero at /tmp/foo.pl line 4.\x{a}') called at foo2.pl line 5 - main::foo(3) called at foo3.pl line 8 -") -(setq lang-bt-pat (gethash "lang-backtrace" - realgud:perldb-pat-hash)) -(setq carp-bt-re (realgud-loc-pat-regexp lang-bt-pat)) -(setq file-group (realgud-loc-pat-file-group lang-bt-pat)) -(setq line-group (realgud-loc-pat-line-group lang-bt-pat)) -(assert-equal 0 (string-match carp-bt-re test-s1)) -(assert-equal "/tmp/foo.pl" - (substring test-s1 - (match-beginning file-group) - (match-end file-group))) -(assert-equal "7" - (substring test-s1 - (match-beginning line-group) - (match-end line-group))) -(setq test-pos (match-end 0)) - -(assert-equal 22 (string-match carp-bt-re test-s1 test-pos)) -(assert-equal "foo2.pl" - (substring test-s1 - (match-beginning file-group) - (match-end file-group))) -(assert-equal "5" - (substring test-s1 - (match-beginning line-group) - (match-end line-group))) - -(setq test-pos (match-end 0)) -(assert-equal 119 (string-match carp-bt-re test-s1 test-pos)) -(assert-equal "foo3.pl" - (substring test-s1 - (match-beginning file-group) - (match-end file-group))) -(assert-equal "8" - (substring test-s1 - (match-beginning line-group) - (match-end line-group))) - -(end-tests) diff --git a/packages/realgud/test/test-regexp-pydb.el b/packages/realgud/test/test-regexp-pydb.el deleted file mode 100644 index 5af3f3685..000000000 --- a/packages/realgud/test/test-regexp-pydb.el +++ /dev/null @@ -1,94 +0,0 @@ -(require 'test-simple) -(load-file "../realgud/debugger/pydb/init.el") -(load-file "./regexp-helper.el") - -(test-simple-start) - - -(set (make-local-variable 'bps-pat) - (gethash "brkpt-set" realgud:pydb-pat-hash)) - -(set (make-local-variable 'loc-pat) - (gethash "loc" realgud:pydb-pat-hash)) - -(set (make-local-variable 'prompt-pat) - (gethash "prompt" realgud:pydb-pat-hash)) - -(set (make-local-variable 'tb-pat) - (gethash "lang-backtrace" realgud:pydb-pat-hash)) - -;; FIXME: we get a void variable somewhere in here when running -;; even though we define it in lexical-let. Dunno why. -;; setq however will workaround this. -(set (make-local-variable 'text) - " File \"/usr/lib/python2.6/code.py\", line 281, in raw_input") -(note "traceback location matching") - -(assert-t (numberp (loc-match text tb-pat)) "basic traceback location") - -(assert-equal "/usr/lib/python2.6/code.py" - (match-string (realgud-loc-pat-file-group tb-pat) - text) - (format "Failing file group is %s" - (realgud-loc-pat-file-group tb-pat) "extract file name")) - -(assert-equal "281" - (match-string (realgud-loc-pat-line-group tb-pat) - text) "extract line number") - -(note "breakpoint location matching") - -(setq text "Breakpoint 1 at /src/git/code/gcd.py:13") -(assert-t (numberp (loc-match text bps-pat)) "basic breakpoint location") - -(assert-equal "/src/git/code/gcd.py" - (match-string (realgud-loc-pat-file-group - bps-pat) - text) "extract breakpoint file name") - - -(assert-equal "13" - (match-string (realgud-loc-pat-line-group - bps-pat) - text) "extract breakpoint line number") - -;; (set text "(c:\\working\\python\\helloworld.py:30): ") -;; -;; (assert-t (numberp (loc-match text loc-pat)) "MS DOS position location") -;; ;; -;; (assert-equal "c:\\working\\python\\helloworld.py" -;; (match-string (realgud-loc-pat-file-group loc-pat) -;; text) -;; (format "Failing file group is %s" -;; (realgud-loc-pat-file-group tb-pat)) -;; "extract file name") -;; (assert-equal "30" -;; (match-string (realgud-loc-pat-line-group loc-pat) -;; text) "extract line number") - -;; (setq text "> /usr/bin/ipython(24)") -;; (assert-t (numberp (loc-match text loc-pat)) "position location") -;; (assert-equal "/usr/bin/ipython" -;; (match-string (realgud-loc-pat-file-group loc-pat) -;; text) -;; (format "Failing file group is %s" -;; (realgud-loc-pat-file-group tb-pat) -;; "extract file name")) -;; (assert-equal "24" -;; (match-string (realgud-loc-pat-line-group -;; loc-pat) -;; text) -;; "extract line number") - - -(note "prompt matching") -(set (make-local-variable 'prompt-str) "(Pydb) ") -(prompt-match prompt-str nil "debugger prompt: %s") -(setq prompt-str "((Pydb)) ") -(prompt-match prompt-str nil "nested debugger prompt: %s") -(setq prompt-str "Pydb) ") -(assert-nil (numberp (loc-match prompt-str prompt-pat)) - (format "%s %s" "invalid debugger prompt" - prompt-str)) - -(end-tests) diff --git a/packages/realgud/test/test-regexp-pydbgr.el b/packages/realgud/test/test-regexp-pydbgr.el deleted file mode 100644 index 40e2d81e5..000000000 --- a/packages/realgud/test/test-regexp-pydbgr.el +++ /dev/null @@ -1,73 +0,0 @@ -(load-file "./regexp-helper.el") -(load-file "../realgud/debugger/pydbgr/init.el") - -(test-simple-start) - -(setup-regexp-vars realgud-pydbgr-pat-hash) - -;; FIXME: we get a void variable somewhere in here when running -;; even though we define it in lexical-let. Dunno why. -;; setq however will workaround this. -(setq text " File \"/usr/lib/python2.6/code.py\", line 281, in raw_input") - -(note "traceback location matching") -(assert-t (numberp (loc-match text helper-tb)) "basic traceback location") -(assert-equal "/usr/lib/python2.6/code.py" - (match-string (realgud-loc-pat-file-group helper-tb) - text) - (format "Failing file group is %s" - (realgud-loc-pat-file-group helper-tb) "extract file name")) -(assert-equal "281" - (match-string (realgud-loc-pat-line-group helper-tb) - text) "extract line number") - -(note "breakpoint location matching") -(lexical-let ((text "Breakpoint 1 set at line 13 of file /src/git/code/gcd.py")) - (assert-t (numberp (loc-match text helper-bps)) "basic breakpoint location") - (assert-equal "/src/git/code/gcd.py" - (match-string (realgud-loc-pat-file-group helper-bps) - text) "extract breakpoint file name") - (assert-equal "13" - (match-string (realgud-loc-pat-line-group helper-bps) - text) "extract breakpoint line number") - ) - -(note "prompt matching") -(lexical-let ((text "(c:\\working\\python\\helloworld.py:30): ")) - (assert-t (numberp (loc-match text helper-loc)) "MS DOS position location") - (assert-equal "c:\\working\\python\\helloworld.py" - (match-string (realgud-loc-pat-file-group helper-loc) - text) - (format "Failing file group is %s" - (realgud-loc-pat-file-group helper-tb) "extract file name")) - (assert-equal "30" - (match-string (realgud-loc-pat-line-group helper-loc) - text) "extract line number") - - ) -(lexical-let ((text "(/usr/bin/ipython:24): ")) - (assert-t (numberp (loc-match text helper-loc)) "position location") - (assert-equal "/usr/bin/ipython" - (match-string (realgud-loc-pat-file-group helper-loc) - text) - (format "Failing file group is %s" - (realgud-loc-pat-file-group helper-tb) "extract file name")) - (assert-equal "24" - (match-string (realgud-loc-pat-line-group helper-loc) - text) "extract line number") - ) - -(lexical-let - ((text "(/tmp/eval_stringzDKTfr.py:1 remapped ): ")) - (assert-t (numberp (loc-match text helper-loc)) "position location") - (assert-equal "/tmp/eval_stringzDKTfr.py" - (match-string (realgud-loc-pat-file-group helper-loc) - text) - (format "Failing file group is %s" - (realgud-loc-pat-file-group helper-tb) "extract file name")) - (assert-equal "1" - (match-string (realgud-loc-pat-line-group helper-loc) - text) "extract line number") - ) - -(end-tests) diff --git a/packages/realgud/test/test-regexp-rdebug.el b/packages/realgud/test/test-regexp-rdebug.el deleted file mode 100644 index 2d79d9421..000000000 --- a/packages/realgud/test/test-regexp-rdebug.el +++ /dev/null @@ -1,41 +0,0 @@ -(require 'test-simple) -(load-file "../realgud/debugger/rdebug/init.el") -(load-file "./regexp-helper.el") - -(test-simple-start) - -(setup-regexp-vars realgud-rdebug-pat-hash) -(setq rails-bt (gethash "rails-backtrace" realgud-rdebug-pat-hash)) - -;; FIXME: we get a void variable somewhere in here when running -;; even though we define it in lexical-let. Dunno why. -;; setq however will workaround this. -(setq text " from /usr/local/bin/irb:12:in `
'") -(note "traceback location matching") -(lexical-let ((text " from /usr/local/bin/irb:12:in `
'")) - (assert-t (numberp (loc-match text helper-tb)) "basic traceback location") - (assert-equal "/usr/local/bin/irb" - (match-string (realgud-loc-pat-file-group helper-tb) - text) - "extract traceback file name") - (assert-equal "12" - (match-string (realgud-loc-pat-line-group helper-tb) - text) "extract traceback line number") - ) - -(lexical-let ((text "Breakpoint 1 file /usr/bin/irb, line 10\n")) - (assert-t (numberp (loc-match text helper-bps)) "basic breakpoint location") - (assert-equal "/usr/bin/irb" - (match-string (realgud-loc-pat-file-group helper-bps) - text) "extract breakpoint file name") - (assert-equal "10" - (match-string (realgud-loc-pat-line-group helper-bps) - text) "extract breakpoint line number") - ) - -(note "prompt") -(set (make-local-variable 'prompt-pat) - (gethash "prompt" realgud-rdebug-pat-hash)) -(prompt-match "(rdb:1) ") - -(end-tests) diff --git a/packages/realgud/test/test-regexp-remake.el b/packages/realgud/test/test-regexp-remake.el deleted file mode 100644 index ebe027a6c..000000000 --- a/packages/realgud/test/test-regexp-remake.el +++ /dev/null @@ -1,59 +0,0 @@ -(require 'test-simple) -(load-file "../realgud/debugger/remake/init.el") -(load-file "./regexp-helper.el") - -(test-simple-start) - -(set (make-local-variable 'prompt-pat) - (gethash "prompt" realgud:remake-pat-hash)) -(set (make-local-variable 'frame-pat) - (gethash "debugger-backtrace" realgud:remake-pat-hash)) - -(note "remake prompt") -(prompt-match "remake<10> " "10") -(prompt-match "remake<<1>> " "1" "recursive remake %s") - -(note "remake debugger-backtrace") -(setq s1 - "=>#0 Makefile.in at /tmp/Makefile:216 - #1 Makefile at /tmp/Makefile:230 -") - -(set (make-local-variable 'frame-re) - (realgud-loc-pat-regexp frame-pat)) -(set (make-local-variable 'num-group) - (realgud-loc-pat-num frame-pat)) -(set (make-local-variable 'file-group) - (realgud-loc-pat-file-group frame-pat)) -(set (make-local-variable 'line-group) - (realgud-loc-pat-line-group frame-pat)) - -(assert-equal 0 (string-match frame-re s1)) -(assert-equal "0" (substring s1 - (match-beginning num-group) - (match-end num-group))) -(assert-equal "/tmp/Makefile" - (substring s1 - (match-beginning file-group) - (match-end file-group))) -(assert-equal "216" - (substring s1 - (match-beginning line-group) - (match-end line-group))) -(set (make-local-variable 'pos) - (match-end 0)) - -(assert-equal 39 (string-match frame-re s1 pos)) -(assert-equal "1" (substring s1 - (match-beginning num-group) - (match-end num-group))) -(assert-equal "/tmp/Makefile" - (substring s1 - (match-beginning file-group) - (match-end file-group))) -(assert-equal "230" - (substring s1 - (match-beginning line-group) - (match-end line-group))) - -(end-tests) diff --git a/packages/realgud/test/test-regexp-ruby.el b/packages/realgud/test/test-regexp-ruby.el deleted file mode 100644 index 15aedbbb9..000000000 --- a/packages/realgud/test/test-regexp-ruby.el +++ /dev/null @@ -1,38 +0,0 @@ -;; Don't have a pat-hash for ruby, so we need something that pulls in -;; Ruby. -(load-file "./regexp-helper.el") -(load-file "../realgud/debugger/rdebug/init.el") - -(test-simple-start) - -(setq bt (gethash "rails-backtrace" realgud-rdebug-pat-hash)) - -;; FIXME: we get a void variable somewhere in here when running -;; even though we define it in lexical-let. Dunno why. -;; setq however will workaround this. -(setq text "/tmp/rails-2.3.5/lib/tasks/databases.rake:360") - -(lexical-let ((text "/tmp/rails-2.3.5/lib/tasks/databases.rake:360")) - - (assert-t (numberp (loc-match text bt)) "basic traceback location") - (assert-equal "/tmp/rails-2.3.5/lib/tasks/databases.rake" - (match-string (realgud-loc-pat-file-group bt) - text) "extract traceback file name") - (assert-equal "360" - (match-string (realgud-loc-pat-line-group bt) - text) "extract traceback line number") - ) - -(let ((text - "/tmp/gems/rake-0.8.7/lib/rake.rb:597:in `invoke_with_call_chain'")) - - (assert-t (numberp (loc-match text bt)) "traceback location with in") - (assert-equal "/tmp/gems/rake-0.8.7/lib/rake.rb" - (match-string (realgud-loc-pat-file-group bt) - text) "extract traceback file name 2") - (assert-equal "597" - (match-string (realgud-loc-pat-line-group bt) - text) "extract breakpoint line number 2") - ) - -(end-tests) diff --git a/packages/realgud/test/test-regexp-trepan.el b/packages/realgud/test/test-regexp-trepan.el deleted file mode 100644 index 1907380f9..000000000 --- a/packages/realgud/test/test-regexp-trepan.el +++ /dev/null @@ -1,121 +0,0 @@ -(require 'test-simple) -(load-file "../realgud/debugger/trepan/init.el") -(load-file "./regexp-helper.el") - -(test-simple-start) - -(set (make-local-variable 'bps-pat) - (gethash "brkpt-set" realgud:trepan-pat-hash)) -(set (make-local-variable 'dbg-bt-pat) - (gethash "debugger-backtrace" realgud:trepan-pat-hash)) -(set (make-local-variable 'prompt-pat) - (gethash "prompt" realgud:trepan-pat-hash)) -(set (make-local-variable 'lang-bt-pat) - (gethash "lang-backtrace" realgud:trepan-pat-hash)) -(set (make-local-variable 'ctrl-pat) - (gethash "control-frame" realgud:trepan-pat-hash)) - -;; FIXME: we get a void variable somewhere in here when running -;; even though we define it in lexical-let. Dunno why. -;; setq however will workaround this. -(set (make-local-variable 'text) - " from /usr/local/bin/irb:12:in `
'") - -(note "traceback location matching") - -(setq text " from /usr/local/bin/irb:12:in `
'") - -(assert-t (numberp (loc-match text lang-bt-pat)) - "basic traceback location") -(assert-equal "/usr/local/bin/irb" - (match-string (realgud-loc-pat-file-group lang-bt-pat) text) - "extract traceback file name") - -(assert-equal "12" - (match-string (realgud-loc-pat-line-group - lang-bt-pat) text) - "extract traceback line number") - -(note "debugger-backtrace") -(set (make-local-variable 's1) - "--> #0 METHOD Object#require(path) in file at line 28 - #1 TOP Object# in file /tmp/linecache.rb -") - -(set (make-local-variable 'frame-re) - (realgud-loc-pat-regexp dbg-bt-pat)) -(set (make-local-variable 'num-group) - (realgud-loc-pat-num dbg-bt-pat)) -(set (make-local-variable 'file-group) - (realgud-loc-pat-file-group dbg-bt-pat)) -(set (make-local-variable 'line-group) - (realgud-loc-pat-line-group dbg-bt-pat)) - -(assert-equal 0 (string-match frame-re s1)) -(assert-equal "0" (substring s1 - (match-beginning num-group) - (match-end num-group))) -(assert-equal "" - (substring s1 - (match-beginning file-group) - (match-end file-group))) -(assert-equal "28" - (substring s1 - (match-beginning line-group) - (match-end line-group))) -(setq pos (match-end 0)) - -(assert-equal 77 (string-match frame-re s1 pos)) -(assert-equal "1" (substring s1 - (match-beginning num-group) - (match-end num-group))) -(assert-equal "/tmp/linecache.rb" - (substring s1 - (match-beginning file-group) - (match-end file-group))) - -(note "prompt") -(prompt-match "(trepan): ") -(prompt-match "((trepan)): " nil "nested debugger prompt: %s") -(prompt-match "((trepan@55)): " "@55" "nested debugger prompt with addr: %s") -(prompt-match "((trepan@main)): " "@main" - "nested debugger prompt with method: %s") -(setq prompt-str "trepan:") -(assert-nil (loc-match prompt-str prompt-pat) - (format "invalid prompt %s" prompt-str)) - - -(note "control-frame") -(assert-equal 0 (loc-match - "c:0026 p:0181 s:0136 b:0136 l:000135 d:000135 METHOD /trepan-0.0.1/app/frame.rb:132 " - ctrl-pat) - ) -(assert-equal 0 (loc-match - "c:0030 p:0041 s:0144 b:0144 l:00226c d:00226c METHOD /gems/trepan-0.0.1/processor/eval.rb:15 " - ctrl-pat) - ) -(assert-equal 0 (loc-match - "c:0015 p:0139 s:0070 b:0070 l:000063 d:000069 BLOCK /gems/app/core.rb:121" - ctrl-pat) - ) - -(setq text "Breakpoint 1 set at VM offset 2 of instruction sequence \"\", - line 9 in file /usr/local/bin/irb. -") - - -(assert-t (numberp (loc-match text bps-pat)) - "basic breakpoint location") - - -(assert-equal "/usr/local/bin/irb" - (match-string (realgud-loc-pat-file-group - bps-pat) text) - "extract breakpoint file name") - -(assert-equal "9" - (match-string (realgud-loc-pat-line-group - bps-pat) text) - "extract breakpoint line number") - -(end-tests) diff --git a/packages/realgud/test/test-regexp-trepan2.el b/packages/realgud/test/test-regexp-trepan2.el deleted file mode 100644 index 2e3811d44..000000000 --- a/packages/realgud/test/test-regexp-trepan2.el +++ /dev/null @@ -1,164 +0,0 @@ -(require 'test-simple) -(require 'load-relative) -(load-file "./regexp-helper.el") -(load-file "../realgud/debugger/trepan2/init.el") - -(declare-function loc-match 'realgud-helper) -(declare-function prompt-match 'regexp-helper) -(declare-function realgud-loc-pat-num 'realgud-regexp) -(declare-function realgud-loc-pat-regexp 'realgud-regexp) -(declare-function realgud-loc-pat-file-group 'realgud-regexp) -(declare-function realgud-loc-pat-line-group 'realgud-regexp) -(declare-function __FILE__ 'load-relative) -(declare-function setup-regexp-vars 'regexp-helper) -(declare-function realgud-loc-pat-text-group 'realgud-trepan2-init) - - -(test-simple-start) - -(eval-when-compile - (defvar file-group) - (defvar frame-re) - (defvar line-group) - (defvar num-group) - (defvar test-pos) - (defvar test-s1) - (defvar helper-tb) - (defvar helper-bps) - (defvar prompt-pat) - (defvar realgud-pat-bt) - (defvar helper-loc) - (defvar realgud:trepan2-pat-hash) - (defvar trepan2-text) -) - -(note "prompt matching") - -(set (make-local-variable 'prompt-pat) - (gethash "prompt" realgud:trepan2-pat-hash)) - -(prompt-match "(trepan2) ") - -(setup-regexp-vars realgud:trepan2-pat-hash) - -(note "debugger-backtrace") -(setq realgud-pat-bt (gethash "debugger-backtrace" - realgud:trepan2-pat-hash)) -(setq test-s1 - "##0 gcd(a=3, b=5) called from file '/tmp/test/gcd.py' at line 31 -->1 exec() - '/tmp/test/gcd2.py' at line 41 -") -(setq frame-re (realgud-loc-pat-regexp realgud-pat-bt)) -(setq num-group (realgud-loc-pat-num realgud-pat-bt)) -(setq file-group (realgud-loc-pat-file-group realgud-pat-bt)) -(setq line-group (realgud-loc-pat-line-group realgud-pat-bt)) -(assert-equal 0 (string-match frame-re test-s1)) -(assert-equal "0" (substring test-s1 - (match-beginning num-group) - (match-end num-group))) -(assert-equal "/tmp/test/gcd.py" - (substring test-s1 - (match-beginning file-group) - (match-end file-group))) -(assert-equal "31" - (substring test-s1 - (match-beginning line-group) - (match-end line-group))) -(setq test-pos (match-end 0)) - -(assert-equal 64 (string-match frame-re test-s1 test-pos)) -(assert-equal "1" (substring test-s1 - (match-beginning num-group) - (match-end num-group))) -(assert-equal "/tmp/test/gcd2.py" - (substring test-s1 - (match-beginning file-group) - (match-end file-group))) -(assert-equal "41" - (substring test-s1 - (match-beginning line-group) - (match-end line-group))) -(setq test-pos (match-end 0)) -(assert-equal 120 test-pos) - -(setq helper-tb (gethash "lang-backtrace" realgud:trepan2-pat-hash)) - -(note "traceback location matching") -(setq test-s1 - " File \"/usr/lib/python2.6/code.py\", line 281, in raw_input") - -(assert-t (numberp (loc-match test-s1 helper-tb)) - "basic traceback location") - -(assert-equal "/usr/lib/python2.6/code.py" - (match-string (realgud-loc-pat-file-group helper-tb) - test-s1) - (format "extract file - failing file group is %s" - (realgud-loc-pat-file-group helper-tb))) -(assert-equal "281" - (match-string (realgud-loc-pat-line-group helper-tb) - test-s1) "extract line number") - -(note "breakpoint location matching") - -(setq test-s1 - "Breakpoint 1 set at line 13 of file /src/git/code/gcd.py") - -(assert-t (numberp (loc-match test-s1 helper-bps)) - "basic breakpoint location") -(assert-equal "/src/git/code/gcd.py" - (match-string (realgud-loc-pat-file-group helper-bps) - test-s1) "extract breakpoint file name") -(assert-equal "13" - (match-string (realgud-loc-pat-line-group helper-bps) - test-s1) - "extract breakpoint line number") -(setq test-s1 "(c:\\working\\python\\helloworld.py:30): ") -(assert-t (numberp (loc-match test-s1 helper-loc)) - "MS DOS position location") -(assert-equal "c:\\working\\python\\helloworld.py" - (match-string (realgud-loc-pat-file-group helper-loc) - test-s1) - (format "extract file - Failing file group is %s" - (realgud-loc-pat-file-group helper-tb))) -(assert-equal "30" - (match-string (realgud-loc-pat-line-group helper-loc) - test-s1) "extract line number") - -(setq test-s1 "(/usr/bin/ipython:24): ") -(assert-t (numberp (loc-match test-s1 helper-loc)) - "position location") -(assert-equal "/usr/bin/ipython" - (match-string (realgud-loc-pat-file-group helper-loc) - test-s1) - (format "extract-file - failing file group is %s" - (realgud-loc-pat-file-group helper-tb))) -(assert-equal "24" - (match-string (realgud-loc-pat-line-group helper-loc) - test-s1) - "extract line number") - -(setq test-s1 - "(/tmp/eval_stringzDKTfr.py:1 remapped ): ") -(assert-t (numberp (loc-match test-s1 helper-loc)) "position location") -(assert-equal "/tmp/eval_stringzDKTfr.py" - (match-string (realgud-loc-pat-file-group helper-loc) - test-s1) - (format "extract-file name - failing file group is %s" - (realgud-loc-pat-file-group helper-tb))) -(assert-equal "1" - (match-string (realgud-loc-pat-line-group helper-loc) - test-s1) "extract line number") - -(note "source text") - -(setq test-s1 - "(/usr/local/bin/trepan2:4): \n-- 4 import sys\n(trepan2) ") -(assert-t (numberp (loc-match test-s1 helper-loc)) "source location") -(assert-equal - "import sys" - (match-string (realgud-loc-pat-text-group helper-loc) - test-s1) "extract source text") - -(end-tests) diff --git a/packages/realgud/test/test-regexp-trepan3k.el b/packages/realgud/test/test-regexp-trepan3k.el deleted file mode 100644 index aedda29f8..000000000 --- a/packages/realgud/test/test-regexp-trepan3k.el +++ /dev/null @@ -1,164 +0,0 @@ -(require 'test-simple) -(require 'load-relative) -(load-file "./regexp-helper.el") -(load-file "../realgud/debugger/trepan3k/init.el") - -(declare-function loc-match 'realgud-helper) -(declare-function prompt-match 'regexp-helper) -(declare-function realgud-loc-pat-num 'realgud-regexp) -(declare-function realgud-loc-pat-regexp 'realgud-regexp) -(declare-function realgud-loc-pat-file-group 'realgud-regexp) -(declare-function realgud-loc-pat-line-group 'realgud-regexp) -(declare-function __FILE__ 'load-relative) -(declare-function setup-regexp-vars 'regexp-helper) -(declare-function realgud-loc-pat-text-group 'realgud-trepan3k-init) - - -(test-simple-start) - -(eval-when-compile - (defvar file-group) - (defvar frame-re) - (defvar line-group) - (defvar num-group) - (defvar test-pos) - (defvar test-s1) - (defvar helper-tb) - (defvar helper-bps) - (defvar prompt-pat) - (defvar realgud-pat-bt) - (defvar helper-loc) - (defvar realgud:trepan3k-pat-hash) - (defvar trepan3k-text) -) - -(note "prompt matching") - -(set (make-local-variable 'prompt-pat) - (gethash "prompt" realgud:trepan3k-pat-hash)) - -(prompt-match "(trepan3k) ") - -(setup-regexp-vars realgud:trepan3k-pat-hash) - -(note "debugger-backtrace") -(setq realgud-pat-bt (gethash "debugger-backtrace" - realgud:trepan3k-pat-hash)) -(setq test-s1 - "##0 gcd(a=3, b=5) called from file '/tmp/test/gcd.py' at line 31 -->1 exec() - '/tmp/test/gcd2.py' at line 41 -") -(setq frame-re (realgud-loc-pat-regexp realgud-pat-bt)) -(setq num-group (realgud-loc-pat-num realgud-pat-bt)) -(setq file-group (realgud-loc-pat-file-group realgud-pat-bt)) -(setq line-group (realgud-loc-pat-line-group realgud-pat-bt)) -(assert-equal 0 (string-match frame-re test-s1)) -(assert-equal "0" (substring test-s1 - (match-beginning num-group) - (match-end num-group))) -(assert-equal "/tmp/test/gcd.py" - (substring test-s1 - (match-beginning file-group) - (match-end file-group))) -(assert-equal "31" - (substring test-s1 - (match-beginning line-group) - (match-end line-group))) -(setq test-pos (match-end 0)) - -(assert-equal 64 (string-match frame-re test-s1 test-pos)) -(assert-equal "1" (substring test-s1 - (match-beginning num-group) - (match-end num-group))) -(assert-equal "/tmp/test/gcd2.py" - (substring test-s1 - (match-beginning file-group) - (match-end file-group))) -(assert-equal "41" - (substring test-s1 - (match-beginning line-group) - (match-end line-group))) -(setq test-pos (match-end 0)) -(assert-equal 120 test-pos) - -(setq helper-tb (gethash "lang-backtrace" realgud:trepan3k-pat-hash)) - -(note "traceback location matching") -(setq test-s1 - " File \"/usr/lib/python2.6/code.py\", line 281, in raw_input") - -(assert-t (numberp (loc-match test-s1 helper-tb)) - "basic traceback location") - -(assert-equal "/usr/lib/python2.6/code.py" - (match-string (realgud-loc-pat-file-group helper-tb) - test-s1) - (format "extract file - failing file group is %s" - (realgud-loc-pat-file-group helper-tb))) -(assert-equal "281" - (match-string (realgud-loc-pat-line-group helper-tb) - test-s1) "extract line number") - -(note "breakpoint location matching") - -(setq test-s1 - "Breakpoint 1 set at line 13 of file /src/git/code/gcd.py") - -(assert-t (numberp (loc-match test-s1 helper-bps)) - "basic breakpoint location") -(assert-equal "/src/git/code/gcd.py" - (match-string (realgud-loc-pat-file-group helper-bps) - test-s1) "extract breakpoint file name") -(assert-equal "13" - (match-string (realgud-loc-pat-line-group helper-bps) - test-s1) - "extract breakpoint line number") -(setq test-s1 "(c:\\working\\python\\helloworld.py:30): ") -(assert-t (numberp (loc-match test-s1 helper-loc)) - "MS DOS position location") -(assert-equal "c:\\working\\python\\helloworld.py" - (match-string (realgud-loc-pat-file-group helper-loc) - test-s1) - (format "extract file - Failing file group is %s" - (realgud-loc-pat-file-group helper-tb))) -(assert-equal "30" - (match-string (realgud-loc-pat-line-group helper-loc) - test-s1) "extract line number") - -(setq test-s1 "(/usr/bin/ipython:24): ") -(assert-t (numberp (loc-match test-s1 helper-loc)) - "position location") -(assert-equal "/usr/bin/ipython" - (match-string (realgud-loc-pat-file-group helper-loc) - test-s1) - (format "extract-file - failing file group is %s" - (realgud-loc-pat-file-group helper-tb))) -(assert-equal "24" - (match-string (realgud-loc-pat-line-group helper-loc) - test-s1) - "extract line number") - -(setq test-s1 - "(/tmp/eval_stringzDKTfr.py:1 remapped ): ") -(assert-t (numberp (loc-match test-s1 helper-loc)) "position location") -(assert-equal "/tmp/eval_stringzDKTfr.py" - (match-string (realgud-loc-pat-file-group helper-loc) - test-s1) - (format "extract-file name - failing file group is %s" - (realgud-loc-pat-file-group helper-tb))) -(assert-equal "1" - (match-string (realgud-loc-pat-line-group helper-loc) - test-s1) "extract line number") - -(note "source text") - -(setq test-s1 - "(/usr/local/bin/trepan3k:4): \n-- 4 import sys\n(trepan3k) ") -(assert-t (numberp (loc-match test-s1 helper-loc)) "source location") -(assert-equal - "import sys" - (match-string (realgud-loc-pat-text-group helper-loc) - test-s1) "extract source text") - -(end-tests) diff --git a/packages/realgud/test/test-regexp-trepanpl.el b/packages/realgud/test/test-regexp-trepanpl.el deleted file mode 100644 index b09ea2247..000000000 --- a/packages/realgud/test/test-regexp-trepanpl.el +++ /dev/null @@ -1,86 +0,0 @@ -(require 'test-simple) -(require 'load-relative) -(load-file "../realgud/debugger/trepan.pl/init.el") -(load-file "./regexp-helper.el") - -(eval-when-compile - (defvar realgud:trepanpl-pat-hash) - (defvar prompt-str) - (defvar test-dbgr) - (defvar carp-bt-re) - (defvar file-group) - (defvar line-group) - (defvar test-text) - (defvar dbg-bt-pat) - (defvar bps-pat) - (defvar realgud-bt-pat) - (defvar realgud-perl-ignnore-file-re) -) -(declare-function __FILE__ 'load-relative) - -(test-simple-start) - -(set (make-local-variable 'helper-bps) - (gethash "brkpt-set" realgud:trepanpl-pat-hash)) -(set (make-local-variable 'prompt) - (gethash "prompt" realgud:trepanpl-pat-hash)) -(set (make-local-variable 'helper-tb) - (gethash "lang-backtrace" realgud:trepanpl-pat-hash)) - - -(note "prompt matching") -(set (make-local-variable 'prompt-pat) - (gethash "prompt" realgud:trepanpl-pat-hash)) -(prompt-match "(trepanpl): ") -(prompt-match "((trepanpl)): " nil "nested debugger prompt: %s") -(setq prompt-str "trepanpl:") -(assert-nil (loc-match prompt-str prompt-pat) - (format "invalid prompt %s" prompt-str)) - -(setq test-text "Breakpoint 2 set in /tmp/File/Basename.pm at line 215") - -(assert-t (numberp (bp-loc-match test-text)) - "basic breakpoint location") -(assert-equal "/tmp/File/Basename.pm" - (match-string (realgud-loc-pat-file-group helper-bps) - test-text) - "extract breakpoint file name" - ) -(assert-equal "215" - (match-string (realgud-loc-pat-line-group helper-bps) - test-text) - "extract breakpoint line number" - ) - -(setq test-text "Breakpoint 1 set in (eval 1177)[/Eval.pm:94] at line 5") -(assert-t (numberp (bp-loc-match test-text)) "eval breakpoint location") -(setq bps-pat - (gethash "brkpt-set" realgud:trepanpl-pat-hash)) -(setq dbg-bt-pat - (gethash "debugger-backtrace" realgud:trepanpl-pat-hash)) -(setq prompt-pat - (gethash "prompt" realgud:trepanpl-pat-hash)) -(setq lang-bt-pat - (gethash "lang-backtrace" realgud:trepanpl-pat-hash)) - -(note "prompt") -(prompt-match "(trepanpl): ") -(prompt-match "((trepanpl)): " nil "nested debugger prompt: %s") - -(setq test-text "Breakpoint 1 set in /tmp/gcd.pl at line 9") - -(assert-t (numberp (loc-match test-text bps-pat)) - "basic breakpoint location") - - -(assert-equal "/tmp/gcd.pl" - (match-string (realgud-loc-pat-file-group - bps-pat) test-text) - "extract breakpoint file name") - -(assert-equal "9" - (match-string (realgud-loc-pat-line-group - bps-pat) test-text) - "extract breakpoint line number") - -(end-tests) diff --git a/packages/realgud/test/test-regexp-trepanx.el b/packages/realgud/test/test-regexp-trepanx.el deleted file mode 100644 index 41bc9d669..000000000 --- a/packages/realgud/test/test-regexp-trepanx.el +++ /dev/null @@ -1,69 +0,0 @@ -(load-file "../realgud/debugger/trepanx/init.el") -(load-file "./regexp-helper.el") - -(test-simple-start) - -(set (make-local-variable 'helper-bps) - (gethash "brkpt-set" realgud:trepanx-pat-hash)) -(set (make-local-variable 'prompt) - (gethash "prompt" realgud:trepanx-pat-hash)) -(set (make-local-variable 'helper-tb) - (gethash "lang-backtrace" realgud:trepanx-pat-hash)) - -;; FIXME: we get a void variable somewhere in here when running -;; even though we define it in lexical-let. Dunno why. -;; setq however will workaround this. -(set (make-local-variable 'text) - "  Object#boom at tmp/boom.rb:2") - -(assert-t (numberp (tb-loc-match text)) - "basic traceback location") - -(assert-equal 0 (tb-loc-match text) - "match trepanx location") -(assert-equal "tmp/boom.rb" - (match-string (realgud-loc-pat-file-group helper-tb) - text) - "extract traceback file name") -(setq text - " { } in main.__script__ at /tmp/blam.rb:5") -(assert-equal 0 (tb-loc-match text) - "find a trepanx location") -(assert-equal "/tmp/blam.rb" - (match-string (realgud-loc-pat-file-group helper-tb) - text) - "extract traceback file name") - -(assert-equal "5" - (match-string (realgud-loc-pat-line-group helper-tb) - text) - "extract traceback line number") - -(note "prompt matching") -(set (make-local-variable 'prompt-pat) - (gethash "prompt" realgud:trepanx-pat-hash)) -(prompt-match "((trepanx)): " nil "nested debugger prompt: %s") -(prompt-match "((trepanx@55)): " - "@55" "nested debugger prompt with addr: %s") -(prompt-match "((trepanx@main)): " "@main" - "nested debugger prompt with method: %s") -(setq prompt-str "trepanx:") -(assert-nil (loc-match prompt-str prompt-pat) - (format "invalid prompt %s" prompt-str)) - -(setq text "Set breakpoint 1: __script__() at /bin/irb:2 (@0)") - -(assert-t (numberp (bp-loc-match text)) - "basic breakpoint location") -(assert-equal "/bin/irb" - (match-string (realgud-loc-pat-file-group helper-bps) - text) - "extract breakpoint file name" - ) -(assert-equal "2" - (match-string (realgud-loc-pat-line-group helper-bps) - text) - "extract breakpoint line number" - ) - -(end-tests) diff --git a/packages/realgud/test/test-regexp-zshdb.el b/packages/realgud/test/test-regexp-zshdb.el deleted file mode 100644 index 22d6e0361..000000000 --- a/packages/realgud/test/test-regexp-zshdb.el +++ /dev/null @@ -1,67 +0,0 @@ -(require 'test-simple) -(load-file "../realgud/debugger/zshdb/init.el") -(load-file "./regexp-helper.el") - -(test-simple-start) - -(setq prompt-pat (gethash "prompt" realgud:zshdb-pat-hash)) -(setq frame-pat (gethash "debugger-backtrace" realgud:zshdb-pat-hash)) - -(note "zshdb prompt matching") -(prompt-match "zshdb<10> " "10") -(prompt-match "zshdb<(5)> " "5" "subshell prompt %s") -(prompt-match "zshdb<<1>> " "1" "nested debug prompt %s") - -(note "zshdb frame matching") - -(note "debugger-backtrace") -(setq s1 - "->0 in file `/etc/apparmor/functions' at line 24 -##1 /etc/apparmor/functions called from file `/etc/init.d/apparmor' at line 35 -##2 /etc/init.d/apparmor called from file `/usr/local/bin/zshdb' at line 129 -") -(setq frame-re (realgud-loc-pat-regexp frame-pat)) -(setq num-group (realgud-loc-pat-num frame-pat)) -(setq file-group (realgud-loc-pat-file-group frame-pat)) -(setq line-group (realgud-loc-pat-line-group frame-pat)) -(assert-equal 0 (string-match frame-re s1)) -(assert-equal "0" (substring s1 - (match-beginning num-group) - (match-end num-group))) -(assert-equal "/etc/apparmor/functions" - (substring s1 - (match-beginning file-group) - (match-end file-group))) -(assert-equal "24" - (substring s1 - (match-beginning line-group) - (match-end line-group))) -(setq pos (match-end 0)) - -(assert-equal 49 (string-match frame-re s1 pos)) -(assert-equal "1" (substring s1 - (match-beginning num-group) - (match-end num-group))) -(assert-equal "/etc/init.d/apparmor" - (substring s1 - (match-beginning file-group) - (match-end file-group))) -(assert-equal "35" - (substring s1 - (match-beginning line-group) - (match-end line-group))) -(setq pos (match-end 0)) -(assert-equal 128 (string-match frame-re s1 pos)) -(assert-equal "2" (substring s1 - (match-beginning num-group) - (match-end num-group))) -(assert-equal "/usr/local/bin/zshdb" - (substring s1 - (match-beginning file-group) - (match-end file-group))) -(assert-equal "129" - (substring s1 - (match-beginning line-group) - (match-end line-group))) - -(end-tests) diff --git a/packages/realgud/test/test-regexp.el b/packages/realgud/test/test-regexp.el deleted file mode 100644 index 84e65e92a..000000000 --- a/packages/realgud/test/test-regexp.el +++ /dev/null @@ -1,74 +0,0 @@ -(require 'load-relative) -(require 'test-simple) -(load-file "../realgud/common/buffer/command.el") -(load-file "../realgud/debugger/trepan/init.el") -(load-file "./regexp-helper.el") - -(declare-function cmdbuf-loc-match 'realgud-regexp) -(declare-function make-realgud-cmdbuf-info 'realgud-regexp) -(declare-function realgud-cmdbuf-info 'realgud-regexp) -(declare-function realgud-cmdbuf-info-file-group 'realgud-regexp) -(declare-function realgud-cmdbuf-info-line-group 'realgud-regexp) -(declare-function realgud-loc-pat-file-group 'realgud-regexp) -(declare-function realgud-loc-pat-line-group 'realgud-regexp) -(declare-function realgud-loc-pat-regexp 'realgud-regexp) -(declare-function __FILE__ 'load-relative) - -(test-simple-start) - -(eval-when-compile - (defvar dbg-name) - (defvar realgud-pat-hash) - (defvar loc-pat) - (defvar test-dbgr) -) - -; Some setup usually done in setting up the buffer. -; We customize this for the debugger trepan. Others may follow. -; FIXME: encapsulate this. -(setq dbg-name "trepan") -(setq loc-pat (gethash "loc" (gethash dbg-name realgud-pat-hash))) - -(setq test-dbgr (make-realgud-cmdbuf-info - :debugger-name dbg-name - :loc-regexp (realgud-loc-pat-regexp loc-pat) - :file-group (realgud-loc-pat-file-group loc-pat) - :line-group (realgud-loc-pat-line-group loc-pat))) - - -(lexical-let ((text ".. (./dbgr.rb:73)") - (text2 "C> ((eval):1 via /tmp/eval2.rb:2)") - (text3 "-- (:28 remapped prelude.rb:28)") - (text4 "-- (/src/external-vcs/dbgrr/processor/command/info_subcmd/registers_subcmd/dfp.rb:2)\nrequire_relative %w(.. .. base subsubcmd)\n") - ) - - (assert-t (numberp (cmdbuf-loc-match text test-dbgr)) "basic location") - (assert-equal "./dbgr.rb" - (match-string (realgud-cmdbuf-info-file-group test-dbgr) - text) "extract file name") - (assert-equal "73" - (match-string (realgud-cmdbuf-info-line-group test-dbgr) - text) "extract line number") - (assert-t (numberp (cmdbuf-loc-match text4 test-dbgr)) "more complex location") - - - ;; Now try 'via' - (assert-t (numberp (cmdbuf-loc-match text2 test-dbgr)) "basic 'via' location") - (assert-equal "/tmp/eval2.rb" - (match-string (realgud-cmdbuf-info-file-group test-dbgr) - text2) - "extract via file name") - (assert-equal "2" (match-string (realgud-cmdbuf-info-line-group test-dbgr) - text2) - "extract via line number") - - ;; Now try remap - (assert-t (numberp (cmdbuf-loc-match text3 test-dbgr)) "basic 'via' location") - - ;; - (setq text "--> #0 METHOD Object#square(x) in file ./trepan.rb at line 73") - (assert-nil (numberp (cmdbuf-loc-match text test-dbgr)) "unmatched location") - - ) - -(end-tests) diff --git a/packages/realgud/test/test-remake-core.el b/packages/realgud/test/test-remake-core.el deleted file mode 100644 index b68fded86..000000000 --- a/packages/realgud/test/test-remake-core.el +++ /dev/null @@ -1,35 +0,0 @@ -(require 'test-simple) -(load-file "../realgud/debugger/remake/core.el") - -(declare-function __FILE__ 'load-relative) -(declare-function remake-parse-cmd-args 'realgud-remake-core) -(declare-function remake-suggest-Makefile 'realgud-remake-core) -(declare-function remake-suggest-file-priority 'realgud-remake-core) - -(test-simple-start) - -(assert-equal (list "remake" (expand-file-name "Makefile") - (list "-X" "-f" (expand-file-name "Makefile"))) - (remake-parse-cmd-args - '("remake" "-X" "-f" "Makefile")) - "remake-parse-cmd-args") - -(assert-equal "Makefile" (remake-suggest-Makefile) "remake-suggest-Makefile") - -(assert-equal 2 (remake-suggest-file-priority "foo") - "remake-file-suggest-priority") -(let ((buffer (get-file-buffer "Makefile.am"))) - (if buffer (kill-buffer buffer)) - (assert-equal 2 (remake-suggest-file-priority "Makefile.am")) - (setq buffer (find-file-noselect "Makefile.am")) - (assert-equal 5 (remake-suggest-file-priority "Makefile.am")) - (kill-buffer buffer) - (setq buffer (get-file-buffer "Makefile")) - (if buffer (kill-buffer buffer)) - (assert-equal 6 (remake-suggest-file-priority "Makefile")) - (setq buffer (find-file-noselect "Makefile")) - (assert-equal 8 (remake-suggest-file-priority "Makefile")) - (kill-buffer buffer) - ) - -(end-tests) diff --git a/packages/realgud/test/test-remake.el b/packages/realgud/test/test-remake.el deleted file mode 100644 index 9806a65d3..000000000 --- a/packages/realgud/test/test-remake.el +++ /dev/null @@ -1,34 +0,0 @@ -(require 'test-simple) -(load-file "../realgud/common/core.el") ;; for realgud-exec-shell -(load-file "../realgud/debugger/remake/remake.el") - -(eval-when-compile (defvar my-buf)) - -(declare-function realgud:remake 'realgud:remake) -(declare-function __FILE__ 'load-relative) - -(test-simple-start) - -(defun realgud-exec-shell (debugger-name script-filename program - &optional no-reset &rest args) - "Mock for realgud-exec-shell. We copy the part of the real realgud-exec-shell -file-name-directory that was failing" - (let ((cmdproc-buffer (get-buffer-create "foo")) - (starting-directory - (or (file-name-directory script-filename) - default-directory "./"))) - (start-process "my-process" cmdproc-buffer "sleep" "10000") - cmdproc-buffer - ) - ) - -(note "can deal with no Makefile name") -;; If realgud:remake is successful we switch buffers -(setq my-buf (current-buffer)) -;; FIXME: -;; (realgud:remake "remake --debugger") -;; (assert-t (not (eq (current-buffer) my-buf))) -;; (delete-process "foo") -;; (switch-to-buffer my-buf) - -(end-tests) diff --git a/packages/realgud/test/test-send.el b/packages/realgud/test/test-send.el deleted file mode 100644 index a395dddaf..000000000 --- a/packages/realgud/test/test-send.el +++ /dev/null @@ -1,58 +0,0 @@ -(require 'test-simple) - -(load-file "../realgud/common/send.el") -(load-file "../realgud/common/regexp.el") -(load-file "../realgud/debugger/trepan/init.el") - -(declare-function realgud-srcbuf-init 'realgud-buffer-source) -(test-simple-start) - -(eval-when-compile - (defvar temp-cmdbuf nil) - (defvar realgud-pat-hash) - (defvar file-name) -) - -(defun setup () - (setq temp-cmdbuf (generate-new-buffer "*cmdbuf-test*")) - (realgud-cmdbuf-init temp-cmdbuf "trepan" (gethash "trepan" realgud-pat-hash)) - (realgud-srcbuf-init (current-buffer) temp-cmdbuf) -) - -(defun tear-down() - (kill-buffer temp-cmdbuf) -) - -(dolist (str '("abc" "100%" "I feel %% today")) - (assert-equal str (realgud-expand-format str "format no expand characters"))) - - -(assert-equal "line 5" (realgud-expand-format "line %p" 5) - "format %l - with arg") -(assert-equal "line " (realgud-expand-format "line %p") - "format %l - without arg") - -(assert-equal "hi, rocky!" - (realgud-expand-format "h%s!" "i, rocky") - "format %s") - -(setup) -;; Current buffer is now set up as a source buffer -(setq file-name (buffer-file-name)) -(note "File formatting") -(if (and file-name (realgud-get-srcbuf (current-buffer))) - (dolist - (pair - (list - (cons "%d" (file-name-directory file-name)) - (cons "%x" file-name) - (cons "%X" (expand-file-name file-name)) - (cons "%f" "test-send.el") - (cons "%F" "test-send"))) - (assert-equal (cdr pair) (realgud-expand-format (car pair))))) -(tear-down) - - -(assert-raises error (realgud-command "testing")) - -(end-tests) diff --git a/packages/realgud/test/test-shortkey.el b/packages/realgud/test/test-shortkey.el deleted file mode 100644 index 65eab57f3..000000000 --- a/packages/realgud/test/test-shortkey.el +++ /dev/null @@ -1,37 +0,0 @@ -(require 'test-simple) -(require 'load-relative) -(load-file "../realgud/common/shortkey.el") -(load-file "../realgud/common/buffer/command.el") -(declare-function realgud-cmdbuf-init 'realgud-buffer-command) -(declare-function realgud-shortkey-mode-setup 'realgud-shortkey) -(declare-function realgud-get-short-key-mode-map 'realgud-shortkey) - -(eval-when-compile - (defvar temp-cmdbuf) - (defvar debugger-name) - (defvar realgud-pat-hash) - (defvar test-keymap) - (defvar nodejs-short-key-mode-map) -) - -(declare-function __FILE__ 'load-relative) - -(test-simple-start) - -(note "realgud-shortkey") -(assert-raises error (realgud-shortkey-mode-setup)) -(assert-nil (realgud-get-short-key-mode-map (current-buffer))) - -(note "realgud-get-short-key-mode-map") - -(setq temp-cmdbuf (generate-new-buffer "*cmdbuf-test*")) -(setq debugger-name "nodejs") -(load-file "../realgud/debugger/nodejs/nodejs.el") -(realgud-cmdbuf-init temp-cmdbuf debugger-name - (gethash debugger-name realgud-pat-hash)) -(setq test-keymap (realgud-get-short-key-mode-map temp-cmdbuf)) -(assert-t (keymapp test-keymap) - "realgud-get-short-key-mode-map returns keymap") -(assert-equal test-keymap nodejs-short-key-mode-map - "realgud-get-short-key-mode-map returns nodejs-short-key-mode-map") -(end-tests) diff --git a/packages/realgud/test/test-srcbuf.el b/packages/realgud/test/test-srcbuf.el deleted file mode 100644 index 9562a963b..000000000 --- a/packages/realgud/test/test-srcbuf.el +++ /dev/null @@ -1,69 +0,0 @@ -(require 'test-simple) -(load-file "../realgud/common/buffer/source.el") -(load-file "../realgud/common/buffer/command.el") -(load-file "../realgud/debugger/trepan/init.el") -(load-file "../realgud/debugger/trepan/track-mode.el") - -(declare-function realgud-cmdbuf-init 'realgud-buffer-command) -(declare-function realgud-srcbuf-init 'realgud-buffer-source) -(declare-function __FILE__ 'load-relative) - -(declare-function realgud-srcbuf? 'realgud-buffer-source) -(declare-function realgud-srcbuf-loc-p 'realgud-loc) -(declare-function realgud-srcbuf-info-debugger-name 'realgud-loc) -(declare-function realgud-srcbuf-info-cmdproc 'realgud-track) -(declare-function realgud-srcbuf-init-or-update 'realgud-track) - -(test-simple-start) - -(eval-when-compile - (defvar realgud-pat-hash) - (defvar realgud-srcbuf-info) - (defvar temp-srcbuf) - (defvar test-filename) -) - -(defvar temp-cmdbuf nil) -(defun tear-down() - (kill-buffer temp-cmdbuf) - (kill-buffer temp-srcbuf) -) - -(defun setup () - (setq temp-cmdbuf (generate-new-buffer "*cmdbuf-test*")) - (realgud-cmdbuf-init temp-cmdbuf "trepan" (gethash "trepan" realgud-pat-hash)) - (setq temp-srcbuf (find-file-noselect "./gcd.rb")) -) - -(assert-nil (realgud-srcbuf? (current-buffer)) "realgud-srcbuf? before init") -(setq realgud-srcbuf-info nil) -(assert-nil (realgud-srcbuf? (current-buffer)) - "realgud-srcbuf? before init - but nil") - -(note "realgud-srcbuf-init") -(setup) -(realgud-srcbuf-init temp-srcbuf temp-cmdbuf) - -(assert-t (realgud-srcbuf? temp-srcbuf) - "realgud-srcbuf? after init") - -(assert-equal temp-cmdbuf - (with-current-buffer temp-srcbuf - (realgud-srcbuf-info-cmdproc realgud-srcbuf-info))) - -(realgud-srcbuf-init-or-update temp-srcbuf temp-cmdbuf) -(assert-equal temp-cmdbuf - (with-current-buffer temp-srcbuf - (realgud-srcbuf-info-cmdproc realgud-srcbuf-info)) - "realgud-srcbuf-init-or-update - update") - -(kill-buffer temp-srcbuf) -(setq temp-srcbuf (find-file-noselect "./gcd.rb")) -(realgud-srcbuf-init-or-update temp-srcbuf temp-cmdbuf) -(assert-equal temp-cmdbuf - (with-current-buffer temp-srcbuf - (realgud-srcbuf-info-cmdproc realgud-srcbuf-info)) - "realgud-srcbuf-init-or-update - init") -(tear-down) - -(end-tests) diff --git a/packages/realgud/test/test-track-mode.el b/packages/realgud/test/test-track-mode.el deleted file mode 100644 index 66a0e38b9..000000000 --- a/packages/realgud/test/test-track-mode.el +++ /dev/null @@ -1,61 +0,0 @@ -(require 'test-simple) -(load-file "../realgud/debugger/trepan/trepan.el") -(load-file "../realgud/common/buffer/command.el") -(load-file "../realgud/common/track-mode.el") -(load-file "../realgud/common/backtrace-mode.el") - -(declare-function realgud-cmdbuf-init 'realgud-buffer-command) -(declare-function realgud-srcbuf-init 'realgud-buffer-source) -(declare-function __FILE__ 'load-relative) - -(test-simple-start) - -(defvar realgud-pat-hash) -(defvar temp-cmdbuf nil) - -(declare-function trepan-track-mode 'realgud:trepan) -(declare-function realgud-track-mode-vars 'realgud-track-mode) -(declare-function realgud-backtrace-mode 'realgud-backtrace-mode) - -(defun setup () - (setq temp-cmdbuf (generate-new-buffer "*cmdbuf-test*")) - ;; (start-process "test-track-mode" temp-cmdbuf nil) - (start-process "test-track-mode" temp-cmdbuf "/bin/sh") - - (realgud-cmdbuf-init temp-cmdbuf "trepan" (gethash "trepan" realgud-pat-hash)) - (with-current-buffer temp-cmdbuf - (trepan-track-mode 't)) - (realgud-srcbuf-init (current-buffer) temp-cmdbuf) -) - -(defun tear-down() - (kill-buffer temp-cmdbuf) -) - -(setup) - -;; Current buffer is now set up as a source buffer - -(with-current-buffer temp-cmdbuf - (switch-to-buffer temp-cmdbuf) - (dolist (fn '(realgud-track-hist-newest - realgud-track-hist-newer - realgud-track-hist-older - realgud-track-hist-oldest)) - (assert-nil (null (where-is-internal fn)) - (format "track-functions-mapped-to-keys %s" fn)) - ) - (switch-to-buffer nil) - ) - -(note "track-mode-vars") -(makunbound 'foo-track-mode) -(makunbound 'foo-track-mode-map) -(realgud-track-mode-vars "foo") -(dolist (var '("foo-track-mode-map" "foo-track-mode")) - (let ((var-sym (intern var))) - (assert-t (boundp var-sym)) - (assert-t (stringp (get var-sym 'variable-documentation))) - )) - -(end-tests) diff --git a/packages/realgud/test/test-track.el b/packages/realgud/test/test-track.el deleted file mode 100644 index 9a4d4896e..000000000 --- a/packages/realgud/test/test-track.el +++ /dev/null @@ -1,116 +0,0 @@ -(require 'test-simple) -(load-file "../realgud/common/track.el") -(load-file "../realgud/common/core.el") -(load-file "../realgud/common/loc.el") -(load-file "../realgud/debugger/trepan/core.el") -(load-file "../realgud/debugger/trepan/init.el") - -(declare-function __FILE__ 'load-relative) -(declare-function realgud-cmdbuf-init 'realgud-buffer-command) -(declare-function realgud-loc-filename 'realgud-loc) -(declare-function realgud-loc-p 'realgud-loc) -(declare-function realgud-loc-line-number 'realgud-loc) -(declare-function realgud:track-from-region 'realgud-track) -(declare-function realgud-track-loc 'realgud-track) -(declare-function realgud-track-loc-remaining 'realgud-track) -(declare-function realgud-track-selected-frame 'realgud-track) -(declare-function realgud-track-termination? 'realgud-track) - -(test-simple-start) - -(eval-when-compile - (defvar debugger-output) - (defvar line-number) - (defvar realgud-pat-hash) - (defvar test-filename) -) - -;; Some setup usually done in setting up the buffer. -;; We customize this for the debugger trepan. Others may follow. -;; FIXME: encapsulate this. -(makunbound 'realgud-cmdbuf-info) - -;; FIXME/WARNING the below is customized for trepan -(realgud-cmdbuf-init (current-buffer) "trepan" - (gethash "trepan" realgud-pat-hash)) - -(setq test-filename (symbol-file 'test-simple)) -(setq line-number 7) -(setq debugger-output (format "-> (%s:%d)\nrequire 'foo'\n(trepan):\n" - test-filename line-number)) -(lexical-let ((loc (realgud-track-loc debugger-output nil))) - (assert-t (realgud-loc-p loc) "loc extracted") - (assert-equal "(trepan):\n" - (realgud-track-loc-remaining debugger-output) - "loc-remaining") - (assert-equal test-filename (realgud-loc-filename loc) - "loc filename extracted") - (assert-equal line-number (realgud-loc-line-number loc) - "loc line-number extracted") - ) - -(note "realgud-track-selected-frame") -(setq debugger-output "up ---> #1 TOP Object# in file /usr/local/bin/irb at line 9 - (/usr/local/bin/irb:9 @11) -require irb' -") -(assert-equal 1 (realgud-track-selected-frame debugger-output)) - -(setq debugger-output " ---> #0 TOP Object# in file /usr/local/bin/irb at line 9 - (/usr/local/bin/irb:9 @11) -require irb' -") -(assert-equal 0 (realgud-track-selected-frame debugger-output)) - -(setq debugger-output " -<- (:38 remapped /usr/local/lib/ruby/gems/1.9.1/gems/trepanning-0.1.3.dev/data/custom_require.rb:38 @16) -R=> false -end -") -(assert-nil (realgud-track-selected-frame debugger-output)) - - -(note "realgud-track-termination?") -(setq debugger-output "-- (/usr/local/bin/irb:9 @2) -require 'irb' -") -(assert-nil (realgud-track-termination? debugger-output)) -(setq debugger-output "Really quit? (N/y) y -trepan: That's all, folks... -") -(assert-t (realgud-track-termination? debugger-output)) - - -;; (setq debugger-bp-output (format "Breakpoint %d set at line %d\n\tin file %s.\n" -;; bp-num line-number test-filename)) -;; (setq bp-loc (realgud-track-bp-loc debugger-bp-output nil)) -;; (setq bp-num 2) - -;; (specify "bp-loc extracted" -;; (message "output: %s" debugger-bp-output) -;; (message "bp-loc: %s" bp-loc) -;; (message "bp-num: %d" bp-num) -;; (assert-t (realgud-loc-p bp-loc)) -;; (assert-equal bp-num (realgud-loc-num bp-loc))) - -;; (specify "realgud-track-divert-prompt" -;; (realgud-cmdbuf-info-divert-output?= 't) -;; (setq realgud-track-divert-string "") -;; (setq text -;; "--> #0 TOP Object# in file /usr/local/bin/irb at line 9\n(trepan): ") -;; (setq realgud-last-output-start (point-max)) -;; (realgud-track-divert-prompt text (current-buffer) (point-max)) -;; (assert-equal "--> #0 TOP Object# in file /usr/local/bin/irb at line 9\n" -;; realgud-track-divert-string) -;; (assert-equal nil (realgud-sget 'cmdbuf-info 'divert-output?)) -;; ) - -(makunbound 'realgud-cmdbuf-info) -(assert-raises error - (realgud:track-from-region (point-min) - (point-max)) - "invalid cmdbuf") - -(end-tests) diff --git a/packages/realgud/test/test-trepan2.el b/packages/realgud/test/test-trepan2.el deleted file mode 100644 index 38e3532f0..000000000 --- a/packages/realgud/test/test-trepan2.el +++ /dev/null @@ -1,42 +0,0 @@ -(require 'test-simple) -(load-file "../realgud/debugger/trepan2/trepan2.el") -(load-file "../realgud/debugger/trepan2/core.el") -(load-file "../realgud.el") - -(declare-function trepan2-parse-cmd-args 'realgud:trepan2) -(declare-function realgud:trepan2-find-file 'realgud:trepan2-core) -(declare-function __FILE__ 'load-relative) - - -(test-simple-start) - -(note "trepan2-parse-cmd-args") - -(assert-equal '(nil ("trepan2") ("foo") nil) - (trepan2-parse-cmd-args '("trepan2" "foo"))) -(assert-equal '(nil ("trepan2" "-n") ("foo") nil) - (trepan2-parse-cmd-args '("trepan2" "-n" "foo"))) -(assert-equal '(("/usr/bin/python") ("trepan2" "--different") - ("foo") nil) - (trepan2-parse-cmd-args - '("/usr/bin/python" "trepan2" - "--different" "foo"))) -(assert-equal '(nil ("program.py") ("foo") nil) - (trepan2-parse-cmd-args '("program.py" "foo"))) -(assert-equal '(nil ("trepan2") ("program.py" "foo") nil) - (trepan2-parse-cmd-args - '("trepan2" "program.py" "foo"))) - -(note "realgud:trepan2-find-file") -(assert-nil (realgud:trepan2-find-file "") - "Should ignore psuedo file") - -(eval-when-compile - (defvar test-python-file)) - -(set (make-local-variable 'test-python-file) - (concat (file-name-directory (__FILE__)) "gcd.py")) -(assert-equal test-python-file (realgud:trepan2-find-file test-python-file) - "Should ignore psuedo file") - -(end-tests) diff --git a/packages/realgud/test/test-trepan3k.el b/packages/realgud/test/test-trepan3k.el deleted file mode 100644 index 1b3ffb1e9..000000000 --- a/packages/realgud/test/test-trepan3k.el +++ /dev/null @@ -1,34 +0,0 @@ -(require 'test-simple) -(load-file "../realgud/debugger/trepan3k/trepan3k.el") -(declare-function trepan3k-parse-cmd-args 'realgud:trepan3k) -(declare-function __FILE__ 'require-relative) - -(test-simple-start) - -(note "trepan3k-parse-cmd-args") - -(assert-equal '(nil ("trepan3k") ("foo") nil) - (trepan3k-parse-cmd-args '("trepan3k" "foo"))) -(assert-equal '(nil ("trepan3k" "-n") ("foo") nil) - (trepan3k-parse-cmd-args '("trepan3k" "-n" "foo"))) -(assert-equal '(nil ("trepan3k" "--annotate=1") ("foo") t) - (trepan3k-parse-cmd-args - '("trepan3k" "--annotate=1" "foo"))) -(assert-equal '(nil ("mytrepan3k" "--annotate=1") ("foo") t) - (trepan3k-parse-cmd-args - '("mytrepan3k" "--annotate=1" "foo"))) -(assert-equal '(("python") ("trepan3k" "--annotate") ("1" "foo") t) - (trepan3k-parse-cmd-args - '("python" "trepan3k" "--annotate" "1" "foo"))) -(assert-equal '(("/usr/bin/python") ("trepan3k" "--different") - ("foo") nil) - (trepan3k-parse-cmd-args - '("/usr/bin/python" "trepan3k" - "--different" "foo"))) -(assert-equal '(nil ("program.py") ("foo") nil) - (trepan3k-parse-cmd-args '("program.py" "foo"))) -(assert-equal '(nil ("trepan3k") ("program.py" "foo") nil) - (trepan3k-parse-cmd-args - '("trepan3k" "program.py" "foo"))) - -(end-tests) diff --git a/packages/realgud/test/test-trepanpl.el b/packages/realgud/test/test-trepanpl.el deleted file mode 100644 index 150fd03a9..000000000 --- a/packages/realgud/test/test-trepanpl.el +++ /dev/null @@ -1,47 +0,0 @@ -(require 'test-simple) -(load-file "../realgud/common/buffer/command.el") -(load-file "../realgud/debugger/trepan.pl/trepanpl.el") - -(eval-when-compile (defvar test:run-process-save)) - -(declare-function realgud:trepanpl-parse-cmd-args 'realgud:trepanpl) -(declare-function realgud:trepan.pl 'realgud:trepanpl) -(declare-function __FILE__ 'require-relative) - -(test-simple-start) - -;; Save value realgud:run-process and change it to something we want -(setq test:run-process-save (symbol-function 'realgud:run-process)) -(defun realgud:run-process(debugger-name script-filename cmd-args - minibuf-history - &optional no-reset) - "Fake realgud:run-process used in testing" - (note - (format "%s %s %s" debugger-name script-filename cmd-args)) - (assert-equal "trepan.pl" debugger-name "debugger name gets passed") - (let ((expanded-name (expand-file-name "./gcd.pl"))) - (assert-equal expanded-name script-filename "file name check") - (assert-equal (list "-I" (expand-file-name ".") expanded-name "3" "5") - (cdr cmd-args) "command args listified") - ) - nil ;; Make sure trepanpl doesn't try to do anything with cmdbuf - ) - -(note "realgud:trepanpl-parse-cmd-args") -(assert-equal (list nil '("trepan.pl") '("foo")) - (realgud:trepanpl-parse-cmd-args '("trepan.pl" "foo"))) -(assert-equal (list '("perl5.8") '("trepan.pl") '("foo")) - (realgud:trepanpl-parse-cmd-args '("perl5.8" "trepan.pl" "foo"))) -(assert-equal (list nil '("trepan.pl") '("program.pl" "foo")) - (realgud:trepanpl-parse-cmd-args - '("trepan.pl" "program.pl" "foo"))) -(assert-equal (list nil '("trepan.pl") (list (expand-file-name "gcd.pl") "foo")) - (realgud:trepanpl-parse-cmd-args - '("trepan.pl" "gcd.pl" "foo"))) - -(realgud:trepan.pl "trepanpl -I . ./gcd.pl 3 5") - -;; Restore the old value of realgud:run-process -(fset 'realgud:run-process test:run-process-save) - -(end-tests) diff --git a/packages/realgud/test/test-utils.el b/packages/realgud/test/test-utils.el deleted file mode 100644 index 318a2e7a8..000000000 --- a/packages/realgud/test/test-utils.el +++ /dev/null @@ -1,22 +0,0 @@ -(require 'test-simple) -(load-file "../realgud/common/utils.el") - -(declare-function realgud:flatten 'realgud-utils) -(declare-function realgud:strip 'realgud-regexp) -(declare-function __FILE__ 'load-relative) - -(test-simple-start) - -(eval-when-compile - (defvar test-realgud:features) -) - -(note "realgud:strip") -(assert-equal "abc" (realgud:strip "abc")) -(assert-equal "def" (realgud:strip "\n def\t ")) - -(note "realgud:flatten") -(assert-equal '(abc) (realgud:flatten '(abc))) -(assert-equal '(abc def h i j) (realgud:flatten '(abc (def (h) i) j))) - -(end-tests) diff --git a/packages/realgud/test/test-zshdb.el b/packages/realgud/test/test-zshdb.el deleted file mode 100644 index 2b392af84..000000000 --- a/packages/realgud/test/test-zshdb.el +++ /dev/null @@ -1,55 +0,0 @@ -(require 'test-simple) -(load-file "../realgud/debugger/zshdb/zshdb.el") -(load-file "../realgud/common/core.el") - -(declare-function realgud:expand-file-name-if-exists 'realgud-core) - -(eval-when-compile - (defvar test:run-process-save) - (defvar realgud:zshdb-minibuffer-history) - ) - -(declare-function zshdb-parse-cmd-args 'realgud:zshdb) -(declare-function zshdb-suggest-invocation 'realgud:zshdb) -(declare-function realgud:zshdb 'realgud:zshdb) -(declare-function __FILE__ 'require-relative) - -(test-simple-start) -(make-local-variable 'realgud:zshdb-minibuffer-history) -(setq realgud:zshdb-minibuffer-history nil) - -;; Save value realgud:run-process and change it to something we want -(setq test:run-process-save (symbol-function 'realgud:run-process)) -(defun realgud:run-process(debugger-name script-filename cmd-args - minibuf-history - &optional no-reset) - "Fake realgud:run-process used in testing" - (note - (format "%s %s %s" debugger-name script-filename cmd-args)) - (assert-equal "zshdb" debugger-name "debugger name gets passed") - (let ((expanded-name - (realgud:expand-file-name-if-exists "./gcd.sh"))) - (assert-equal expanded-name script-filename "file name check") - (assert-equal (list expanded-name "3" "5") - (cdr cmd-args) "command args listified") - )) - -(note "zshdb-parse-cmd-args") -(assert-equal (list nil '("zshdb") - (list (realgud:expand-file-name-if-exists "foo")) nil) - (zshdb-parse-cmd-args '("zshdb" "foo"))) -(assert-equal (list nil '("zshdb") - (list (realgud:expand-file-name-if-exists "program.sh") - "foo") nil) - (zshdb-parse-cmd-args - '("zshdb" "program.sh" "foo"))) - -(with-current-buffer (find-file "gcd.sh") - (shell-script-mode) - (assert-matches "zshdb .*gcd.sh$" (zshdb-suggest-invocation "zshdb"))) - -(realgud:zshdb "zshdb ./gcd.sh 3 5") -;; Restore the old value of realgud:run-process -(fset 'realgud:run-process test:run-process-save) - -(end-tests) diff --git a/packages/test-simple/.gitignore b/packages/test-simple/.gitignore deleted file mode 100644 index 0b383019f..000000000 --- a/packages/test-simple/.gitignore +++ /dev/null @@ -1,14 +0,0 @@ -*elc -*~ -/Makefile -/Makefile.in -/aclocal.m4 -/autom4te.cache -/config.log -/config.status -/configure -/elc-stamp -/install-sh -/missing -/script -/README diff --git a/packages/test-simple/.travis.yml b/packages/test-simple/.travis.yml deleted file mode 100644 index 9280a2034..000000000 --- a/packages/test-simple/.travis.yml +++ /dev/null @@ -1,8 +0,0 @@ -language: emacs - -install: - # Install emacs. - - "sudo apt-get install emacs23-nox" - -# run the tests -script: /bin/sh ./autogen.sh && make check diff --git a/packages/test-simple/AUTHORS b/packages/test-simple/AUTHORS deleted file mode 100644 index 772a53241..000000000 --- a/packages/test-simple/AUTHORS +++ /dev/null @@ -1,2 +0,0 @@ -Rocky Bernstein (rocky@gnu.org) adapted from Phil Hagelberg's behave.el - diff --git a/packages/test-simple/COPYING b/packages/test-simple/COPYING deleted file mode 100644 index 60549be51..000000000 --- a/packages/test-simple/COPYING +++ /dev/null @@ -1,340 +0,0 @@ - GNU GENERAL PUBLIC LICENSE - Version 2, June 1991 - - Copyright (C) 1989, 1991 Free Software Foundation, Inc. - 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The licenses for most software are designed to take away your -freedom to share and change it. By contrast, the GNU General Public -License is intended to guarantee your freedom to share and change free -software--to make sure the software is free for all its users. This -General Public License applies to most of the Free Software -Foundation's software and to any other program whose authors commit to -using it. (Some other Free Software Foundation software is covered by -the GNU Library General Public License instead.) You can apply it to -your programs, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -this service if you wish), that you receive source code or can get it -if you want it, that you can change the software or use pieces of it -in new free programs; and that you know you can do these things. - - To protect your rights, we need to make restrictions that forbid -anyone to deny you these rights or to ask you to surrender the rights. -These restrictions translate to certain responsibilities for you if you -distribute copies of the software, or if you modify it. - - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must give the recipients all the rights that -you have. You must make sure that they, too, receive or can get the -source code. And you must show them these terms so they know their -rights. - - We protect your rights with two steps: (1) copyright the software, and -(2) offer you this license which gives you legal permission to copy, -distribute and/or modify the software. - - Also, for each author's protection and ours, we want to make certain -that everyone understands that there is no warranty for this free -software. If the software is modified by someone else and passed on, we -want its recipients to know that what they have is not the original, so -that any problems introduced by others will not reflect on the original -authors' reputations. - - Finally, any free program is threatened constantly by software -patents. We wish to avoid the danger that redistributors of a free -program will individually obtain patent licenses, in effect making the -program proprietary. To prevent this, we have made it clear that any -patent must be licensed for everyone's free use or not licensed at all. - - The precise terms and conditions for copying, distribution and -modification follow. - - GNU GENERAL PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - - 0. This License applies to any program or other work which contains -a notice placed by the copyright holder saying it may be distributed -under the terms of this General Public License. The "Program", below, -refers to any such program or work, and a "work based on the Program" -means either the Program or any derivative work under copyright law: -that is to say, a work containing the Program or a portion of it, -either verbatim or with modifications and/or translated into another -language. (Hereinafter, translation is included without limitation in -the term "modification".) Each licensee is addressed as "you". - -Activities other than copying, distribution and modification are not -covered by this License; they are outside its scope. The act of -running the Program is not restricted, and the output from the Program -is covered only if its contents constitute a work based on the -Program (independent of having been made by running the Program). -Whether that is true depends on what the Program does. - - 1. You may copy and distribute verbatim copies of the Program's -source code as you receive it, in any medium, provided that you -conspicuously and appropriately publish on each copy an appropriate -copyright notice and disclaimer of warranty; keep intact all the -notices that refer to this License and to the absence of any warranty; -and give any other recipients of the Program a copy of this License -along with the Program. - -You may charge a fee for the physical act of transferring a copy, and -you may at your option offer warranty protection in exchange for a fee. - - 2. You may modify your copy or copies of the Program or any portion -of it, thus forming a work based on the Program, and copy and -distribute such modifications or work under the terms of Section 1 -above, provided that you also meet all of these conditions: - - a) You must cause the modified files to carry prominent notices - stating that you changed the files and the date of any change. - - b) You must cause any work that you distribute or publish, that in - whole or in part contains or is derived from the Program or any - part thereof, to be licensed as a whole at no charge to all third - parties under the terms of this License. - - c) If the modified program normally reads commands interactively - when run, you must cause it, when started running for such - interactive use in the most ordinary way, to print or display an - announcement including an appropriate copyright notice and a - notice that there is no warranty (or else, saying that you provide - a warranty) and that users may redistribute the program under - these conditions, and telling the user how to view a copy of this - License. (Exception: if the Program itself is interactive but - does not normally print such an announcement, your work based on - the Program is not required to print an announcement.) - -These requirements apply to the modified work as a whole. If -identifiable sections of that work are not derived from the Program, -and can be reasonably considered independent and separate works in -themselves, then this License, and its terms, do not apply to those -sections when you distribute them as separate works. But when you -distribute the same sections as part of a whole which is a work based -on the Program, the distribution of the whole must be on the terms of -this License, whose permissions for other licensees extend to the -entire whole, and thus to each and every part regardless of who wrote it. - -Thus, it is not the intent of this section to claim rights or contest -your rights to work written entirely by you; rather, the intent is to -exercise the right to control the distribution of derivative or -collective works based on the Program. - -In addition, mere aggregation of another work not based on the Program -with the Program (or with a work based on the Program) on a volume of -a storage or distribution medium does not bring the other work under -the scope of this License. - - 3. You may copy and distribute the Program (or a work based on it, -under Section 2) in object code or executable form under the terms of -Sections 1 and 2 above provided that you also do one of the following: - - a) Accompany it with the complete corresponding machine-readable - source code, which must be distributed under the terms of Sections - 1 and 2 above on a medium customarily used for software interchange; or, - - b) Accompany it with a written offer, valid for at least three - years, to give any third party, for a charge no more than your - cost of physically performing source distribution, a complete - machine-readable copy of the corresponding source code, to be - distributed under the terms of Sections 1 and 2 above on a medium - customarily used for software interchange; or, - - c) Accompany it with the information you received as to the offer - to distribute corresponding source code. (This alternative is - allowed only for noncommercial distribution and only if you - received the program in object code or executable form with such - an offer, in accord with Subsection b above.) - -The source code for a work means the preferred form of the work for -making modifications to it. For an executable work, complete source -code means all the source code for all modules it contains, plus any -associated interface definition files, plus the scripts used to -control compilation and installation of the executable. However, as a -special exception, the source code distributed need not include -anything that is normally distributed (in either source or binary -form) with the major components (compiler, kernel, and so on) of the -operating system on which the executable runs, unless that component -itself accompanies the executable. - -If distribution of executable or object code is made by offering -access to copy from a designated place, then offering equivalent -access to copy the source code from the same place counts as -distribution of the source code, even though third parties are not -compelled to copy the source along with the object code. - - 4. You may not copy, modify, sublicense, or distribute the Program -except as expressly provided under this License. Any attempt -otherwise to copy, modify, sublicense or distribute the Program is -void, and will automatically terminate your rights under this License. -However, parties who have received copies, or rights, from you under -this License will not have their licenses terminated so long as such -parties remain in full compliance. - - 5. You are not required to accept this License, since you have not -signed it. However, nothing else grants you permission to modify or -distribute the Program or its derivative works. These actions are -prohibited by law if you do not accept this License. Therefore, by -modifying or distributing the Program (or any work based on the -Program), you indicate your acceptance of this License to do so, and -all its terms and conditions for copying, distributing or modifying -the Program or works based on it. - - 6. Each time you redistribute the Program (or any work based on the -Program), the recipient automatically receives a license from the -original licensor to copy, distribute or modify the Program subject to -these terms and conditions. You may not impose any further -restrictions on the recipients' exercise of the rights granted herein. -You are not responsible for enforcing compliance by third parties to -this License. - - 7. If, as a consequence of a court judgment or allegation of patent -infringement or for any other reason (not limited to patent issues), -conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot -distribute so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you -may not distribute the Program at all. For example, if a patent -license would not permit royalty-free redistribution of the Program by -all those who receive copies directly or indirectly through you, then -the only way you could satisfy both it and this License would be to -refrain entirely from distribution of the Program. - -If any portion of this section is held invalid or unenforceable under -any particular circumstance, the balance of the section is intended to -apply and the section as a whole is intended to apply in other -circumstances. - -It is not the purpose of this section to induce you to infringe any -patents or other property right claims or to contest validity of any -such claims; this section has the sole purpose of protecting the -integrity of the free software distribution system, which is -implemented by public license practices. Many people have made -generous contributions to the wide range of software distributed -through that system in reliance on consistent application of that -system; it is up to the author/donor to decide if he or she is willing -to distribute software through any other system and a licensee cannot -impose that choice. - -This section is intended to make thoroughly clear what is believed to -be a consequence of the rest of this License. - - 8. If the distribution and/or use of the Program is restricted in -certain countries either by patents or by copyrighted interfaces, the -original copyright holder who places the Program under this License -may add an explicit geographical distribution limitation excluding -those countries, so that distribution is permitted only in or among -countries not thus excluded. In such case, this License incorporates -the limitation as if written in the body of this License. - - 9. The Free Software Foundation may publish revised and/or new versions -of the General Public License from time to time. Such new versions will -be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - -Each version is given a distinguishing version number. If the Program -specifies a version number of this License which applies to it and "any -later version", you have the option of following the terms and conditions -either of that version or of any later version published by the Free -Software Foundation. If the Program does not specify a version number of -this License, you may choose any version ever published by the Free Software -Foundation. - - 10. If you wish to incorporate parts of the Program into other free -programs whose distribution conditions are different, write to the author -to ask for permission. For software which is copyrighted by the Free -Software Foundation, write to the Free Software Foundation; we sometimes -make exceptions for this. Our decision will be guided by the two goals -of preserving the free status of all derivatives of our free software and -of promoting the sharing and reuse of software generally. - - NO WARRANTY - - 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY -FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN -OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES -PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED -OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS -TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE -PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, -REPAIR OR CORRECTION. - - 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR -REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, -INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING -OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED -TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY -YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER -PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE -POSSIBILITY OF SUCH DAMAGES. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Programs - - If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. - - To do so, attach the following notices to the program. It is safest -to attach them to the start of each source file to most effectively -convey the exclusion of warranty; and each file should have at least -the "copyright" line and a pointer to where the full notice is found. - - - Copyright (C) 19yy - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - - -Also add information on how to contact you by electronic and paper mail. - -If the program is interactive, make it output a short notice like this -when it starts in an interactive mode: - - Gnomovision version 69, Copyright (C) 19yy name of author - Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. - This is free software, and you are welcome to redistribute it - under certain conditions; type `show c' for details. - -The hypothetical commands `show w' and `show c' should show the appropriate -parts of the General Public License. Of course, the commands you use may -be called something other than `show w' and `show c'; they could even be -mouse-clicks or menu items--whatever suits your program. - -You should also get your employer (if you work as a programmer) or your -school, if any, to sign a "copyright disclaimer" for the program, if -necessary. Here is a sample; alter the names: - - Yoyodyne, Inc., hereby disclaims all copyright interest in the program - `Gnomovision' (which makes passes at compilers) written by James Hacker. - - , 1 April 1989 - Ty Coon, President of Vice - -This General Public License does not permit incorporating your program into -proprietary programs. If your program is a subroutine library, you may -consider it more useful to permit linking proprietary applications with the -library. If this is what you want to do, use the GNU Library General -Public License instead of this License. diff --git a/packages/test-simple/Carton b/packages/test-simple/Carton deleted file mode 100644 index b039f403d..000000000 --- a/packages/test-simple/Carton +++ /dev/null @@ -1,4 +0,0 @@ -(source "melpa" "http://melpa.milkbox.net/packages/") - -(package "test-simple" "0.2.1" - "Unit tests for GNU emacs that work interactively and in batch") diff --git a/packages/test-simple/ChangeLog b/packages/test-simple/ChangeLog deleted file mode 100644 index e69de29bb..000000000 diff --git a/packages/test-simple/INSTALL b/packages/test-simple/INSTALL deleted file mode 100644 index 20f78002d..000000000 --- a/packages/test-simple/INSTALL +++ /dev/null @@ -1,18 +0,0 @@ -This package is now installable from inside Emacs and melpa. - -We have an old-style GNU autoconf configuration as well and an install -script to pick that up from git sources. For this, you will need: - - * Emacs, of course. Version 23 or better - * _autoconf_ and _autoreconf_ to build the configure script. Usually _autoreconf_ comes with an "autoconf" package - * GNU Make -- or even better "remake":http//bashdb.sf.net/remake - -If you are feeling lucky, you can try running the install script from the github repository: - - $ bash < <( curl https://raw.github.com/rocky/emacs-test-simple/master/install-from-git.sh ) - -Otherwise: - - git clone http://github.com/rocky/emacs-test-simple - cd emacs-test-simple - ./configure && make && [sudo] make install diff --git a/packages/test-simple/Makefile.am b/packages/test-simple/Makefile.am deleted file mode 100644 index 524deb218..000000000 --- a/packages/test-simple/Makefile.am +++ /dev/null @@ -1,46 +0,0 @@ -# Note: This makefile include remake-style target comments. -# These comments before the targets start with #: -# remake --tasks to shows the targets and the comments - -GIT2CL ?= git2cl -RUBY ?= ruby - -lisp_files := $(wildcard *.el) -lisp_LISP = $(lisp_files) -test_files := $(wildcard test/*.el) - -EXTRA_DIST = $(lisp_files) $(test_files) README THANKS README.md COPYING - -CHECK_FILES = $(notdir $(test_files:.el=.run)) - - -check: $(test-files) - $(MAKE) -C test check - -README: README.textile - ln -s README.md README - -PHONY=check clean dist distclean test check-short check-terse install-short - -if MAINTAINER_MODE - -ChangeLog: - git log --pretty --numstat --summary | $(GIT2CL) > $@ - -ACLOCAL_AMFLAGS=-I . - -endif - -#: Run all tests -test: check - -check-short: - $(MAKE) -C test check 2>&1 | ruby make-check-filter.rb - -#: Run all tests without and show just the failure lines -check-terse: - $(MAKE) check 2>&1 | $(RUBY) make-check-filter.rb | grep failure - -#: Run "make install" -install-short: - $(MAKE) install 2>&1 | $(RUBY) make-check-filter.rb diff --git a/packages/test-simple/NEWS b/packages/test-simple/NEWS deleted file mode 100644 index f35d8264d..000000000 --- a/packages/test-simple/NEWS +++ /dev/null @@ -1,5 +0,0 @@ -1.0 -Initial Melpa release - -0.2 -Initial Release diff --git a/packages/test-simple/README.md b/packages/test-simple/README.md deleted file mode 100644 index 7a473b095..000000000 --- a/packages/test-simple/README.md +++ /dev/null @@ -1,71 +0,0 @@ -[![Build Status](https://travis-ci.org/rocky/emacs-test-simple.png)](https://travis-ci.org/rocky/emacs-test-simple) - -*test-simple.el* is : - -* Simple -- no need for context macros, enclosing specifications, or required test tags. But if you want, you still can add custom assert failure messages or add notes before a group of tests. -* Accomodates both interactive and non-interactive use: - * For interactive use one can use `eval-last-sexp`, `eval-region`, and `eval-buffer` - * For non-interactive use run as: `emacs --batch --no-site-file --no-splash --load ` - -I use this in my [Debugger front end](https://github.com/rocky/emacs-dbgr). - -Here is an example found in the [examples directory](https://github.com/rocky/emacs-test-simple/tree/master/test). - -In file `gcd.el`: - - (defun gcd(a b) - "Greatest Common Divisor of A and B" - ;; Make a < b - (if (> a b) - (let ((c a)) - (setq a b) - (setq b c))) - (cond - ((< a 0) nil) - ((or (= 0 (- b a)) (= a 1)) a) - (t (gcd (- b a) a)) - ) - ) - - -In file `test-gcd.el` in the same directory: - - (require 'test-simple) - (test-simple-start) ;; Zero counters and start the stop watch. - - ;; Use (load-file) below because we want to always to read the source. - ;; Also, we don't want no stinking compiled source. - (assert-t (load-file "./gcd.el") - "Can't load gcd.el - are you in the right directory?" ) - - (note "degenerate cases") - - (assert-nil (gcd 5 -1) "using positive numbers") - (assert-nil (gcd -4 1) "using positive numbers, switched order") - (assert-raises error (gcd "a" 32) - "Passing a string value should raise an error") - - (note "GCD computations") - (assert-equal 1 (gcd 3 5) "gcd(3,5)") - (assert-equal 8 (gcd 8 32) "gcd(8,32)") - - (end-tests) ;; Stop the clock and print a summary - -Edit (with Emacs of course) `test-gcd.el` and run `M-x eval-current-buffer` - -You should see in buffer `*test-simple*`: - - test-gcd.el - ...... - 0 failures in 6 assertions (0.002646 seconds) - -Now let's try from a command line: - - $ emacs --batch --no-site-file --no-splash --load test-gcd.el - Loading /src/external-vcs/emacs-test-simple/example/gcd.el (source)... - *scratch* - ...... - 0 failures in 6 assertions (0.000723 seconds) - -*Author:* Rocky Bernstein
-[![endorse](https://api.coderwall.com/rocky/endorsecount.png)](https://coderwall.com/rocky) diff --git a/packages/test-simple/THANKS b/packages/test-simple/THANKS deleted file mode 100644 index 4dae07db8..000000000 --- a/packages/test-simple/THANKS +++ /dev/null @@ -1 +0,0 @@ -Lars Andersen (expez) - Getting this packaged and put on to Melpa. diff --git a/packages/test-simple/autogen.sh b/packages/test-simple/autogen.sh deleted file mode 100755 index 5f00302bb..000000000 --- a/packages/test-simple/autogen.sh +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/sh -cp README.md README -autoreconf -vi && \ -autoconf && { - echo "Running configure with --enable-maintainer-mode $@" - ./configure --enable-maintainer-mode $@ -} diff --git a/packages/test-simple/common.mk b/packages/test-simple/common.mk deleted file mode 100644 index 26b632560..000000000 --- a/packages/test-simple/common.mk +++ /dev/null @@ -1,5 +0,0 @@ -short: - $(MAKE) 2>&1 >/dev/null | ruby $(top_srcdir)/make-check-filter.rb - -%.short: - $(MAKE) $(@:.short=) 2>&1 >/dev/null diff --git a/packages/test-simple/compute-lispdir.sh b/packages/test-simple/compute-lispdir.sh deleted file mode 100755 index dba43c9e0..000000000 --- a/packages/test-simple/compute-lispdir.sh +++ /dev/null @@ -1,46 +0,0 @@ -#!/bin/bash -# Figures out a reasonable --prefix -typeset -i rc=0 -typeset -i DEBUG=${DEBUG:-0} -EMACS_PROG=${EMACS_PROG:-emacs} -list=$($EMACS_PROG --batch --no-splash --eval '(message (substring (format "%s" load-path) 1 -1))' 2>&1) -rc=$? -if (( rc != 0 )) ; then - echo >&2 "Something went running $EMACS_PROG" - exit $rc -$cmd -fi -for dir in $list ; do - if [[ -d $dir ]] ; then - case $dir in - */emacs/site-lisp) - ((DEBUG)) && echo "site lisp: $dir" - echo "$dir" - exit 0 - ;; - esac - fi -done -for dir in $list ; do - if [[ -d $dir ]] ; then - case $dir in - */emacs/2[34]\.[0-9]/site-lisp) - ((DEBUG)) && echo "versioned site lisp: $dir" - echo "$dir" - exit 0 - ;; - esac - fi -done -for dir in $list ; do - if [[ -d $dir ]] ; then - case $dir in - */emacs/2[34]\.[0-9]/site-lisp) - ((DEBUG)) && echo "versioned site lisp: $dir" - echo "$dir" - exit 0 - ;; - esac - fi -done -exit 0 diff --git a/packages/test-simple/configure.ac b/packages/test-simple/configure.ac deleted file mode 100644 index ae0cbeea0..000000000 --- a/packages/test-simple/configure.ac +++ /dev/null @@ -1,44 +0,0 @@ -dnl FIXME: pick up from test-simple.el -AC_INIT(emacs-test-simple, 1.0,) -AC_CONFIG_SRCDIR(test-simple.el) -AM_INIT_AUTOMAKE([foreign]) -AM_MAINTAINER_MODE - -AC_PATH_PROG([EMACS], [emacs], [emacs]) -AC_MSG_NOTICE("Checking emacs version and prerequiste packages") -$EMACS -batch -q -no-site-file -eval \ - '(if (<= emacs-major-version 22) - (progn - (error "You need GNU Emacs 23 or better.") - (kill-emacs 1) - ) - )' -if test $? -ne 0 ; then - AC_MSG_ERROR([Can't continue until above error is corrected.]) -fi - -################################################################## -# See if --with-lispdir was set. If not, set it to a reasonable default -# based on where bash thinks bashdb is supposed to be installed. -################################################################## - -AM_MISSING_PROG(GIT2CL, git2cl, $missing_dir) - -# Check whether --with-lispdir was given. -if test "${with_lispdir+set}" = set -o "${prefix+set}" = set; then : -else - my_lispdir=$(EMACS_PROG=$EMACS $SH_PROG $(dirname $0)/compute-lispdir.sh) - if test "${my_lispdir+set}" = set; then : - with_lispdir=$my_lispdir - echo "'compute-lispdir.sh' lispdir install directory override: '$with_lispdir'" - fi -fi - -## -## Find out where to install the debugger emacs lisp files -## -AM_PATH_LISPDIR -AM_CONDITIONAL(INSTALL_EMACS_LISP, test "x$lispdir" != "x") - -AC_CONFIG_FILES([Makefile test/Makefile]) -AC_OUTPUT diff --git a/packages/test-simple/elisp-comp b/packages/test-simple/elisp-comp deleted file mode 100755 index ecc6b150b..000000000 --- a/packages/test-simple/elisp-comp +++ /dev/null @@ -1,94 +0,0 @@ -#!/bin/sh -# Copyright (C) 1995, 2000, 2003, 2004, 2005, 2009, 2010 Free Software -# Foundation, Inc. - -scriptversion=2010-02-06.18; # UTC - -# Franc,ois Pinard , 1995. -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2, or (at your option) -# any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . - -# As a special exception to the GNU General Public License, if you -# distribute this file as part of a program that contains a -# configuration script generated by Autoconf, you may include it under -# the same distribution terms that you use for the rest of that program. - -# This file is maintained in Automake, please report -# bugs to or send patches to -# . - -case $1 in - '') - echo "$0: No files. Try \`$0 --help' for more information." 1>&2 - exit 1; - ;; - -h | --h*) - cat <<\EOF -Usage: elisp-comp [--help] [--version] FILES... - -This script byte-compiles all `.el' files listed as FILES using GNU -Emacs, and put the resulting `.elc' files into the current directory, -so disregarding the original directories used in `.el' arguments. - -This script manages in such a way that all Emacs LISP files to -be compiled are made visible between themselves, in the event -they require or load-library one another. - -Report bugs to . -EOF - exit $? - ;; - -v | --v*) - echo "elisp-comp $scriptversion" - exit $? - ;; -esac - -if test -z "$EMACS" || test "$EMACS" = "t"; then - # Value of "t" means we are running in a shell under Emacs. - # Just assume Emacs is called "emacs". - EMACS=emacs -fi - -tempdir=elc.$$ - -# Cleanup the temporary directory on exit. -trap 'ret=$?; rm -rf "$tempdir" && exit $ret' 0 -do_exit='(exit $ret); exit $ret' -trap "ret=129; $do_exit" 1 -trap "ret=130; $do_exit" 2 -trap "ret=141; $do_exit" 13 -trap "ret=143; $do_exit" 15 - -mkdir $tempdir -cp "$@" $tempdir - -( - cd $tempdir - echo "(setq load-path (cons nil load-path))" > script - $EMACS -batch -q -l script -f batch-byte-compile *.el || exit $? - mv *.elc .. -) || exit $? - -(exit 0); exit 0 - -# Local Variables: -# mode: shell-script -# sh-indentation: 2 -# eval: (add-hook 'write-file-hooks 'time-stamp) -# time-stamp-start: "scriptversion=" -# time-stamp-format: "%:y-%02m-%02d.%02H" -# time-stamp-time-zone: "UTC" -# time-stamp-end: "; # UTC" -# End: diff --git a/packages/test-simple/example/gcd.el b/packages/test-simple/example/gcd.el deleted file mode 100644 index 9a1ac20c1..000000000 --- a/packages/test-simple/example/gcd.el +++ /dev/null @@ -1,13 +0,0 @@ -(defun gcd(a b) - "Greatest Common Divisor of A and B" - ;; Make a < b - (if (> a b) - (let ((c a)) - (setq a b) - (setq b c))) - (cond - ((< a 0) nil) - ((or (= 0 (- b a)) (= a 1)) a) - (t (gcd (- b a) a)) - ) -) diff --git a/packages/test-simple/example/test-gcd.el b/packages/test-simple/example/test-gcd.el deleted file mode 100644 index ce4ccae2d..000000000 --- a/packages/test-simple/example/test-gcd.el +++ /dev/null @@ -1,20 +0,0 @@ -(require 'test-simple) - -(test-simple-start) - -(assert-t (load-file "./gcd.el") - "Can't load gcd.el - are you in the right directory?" ) - -(note "degenereate cases") - -(assert-nil (gcd 5 -1) "using positive numbers") -(assert-nil (gcd -4 1) "using positive numbers, switched order") - -(note "GCD computations") -(assert-equal 1 (gcd 3 5) "gcd(3,5)") -(assert-equal 8 (gcd 8 32) "gcd(8,32)") - -(assert-raises error (gcd "a" 32) - "Passing a string value should raise an error") - -(end-tests) diff --git a/packages/test-simple/install-from-git.sh b/packages/test-simple/install-from-git.sh deleted file mode 100755 index 6034983e5..000000000 --- a/packages/test-simple/install-from-git.sh +++ /dev/null @@ -1,94 +0,0 @@ -#!/bin/bash -# This installs all emcs-test-simple and its prerequisites. If you are lucky -# you can just run this: -# -# bash ./install-from-git.sh -# -# However we do provide for some customization... -# -# 1. GIT PROTOCOL -# =============== -# -# If your "git clone" can't handle the "http" protocol, you might be -# able to use the "git" protocol. To do this set the GIT_PROTOCOL -# variable like this: -# -# GIT_PROTOCOL=git sh ./install-from-git.sh -# -# 2. configure options (e.g --prefix) -# ==================================== - -# If you want to customize configuration parameters, for example, -# choose where to install, you can pass configure options to this -# script. For example:# can pass configure options. -# -# sh ./install-from-git.sh --prefix=/tmp -# -# 3. TO "sudo" or not to "sudo"? -# ============================== -# If you are running as root on a *Nix-like box, then there's no problem. -# -# If you are not running as root, "sudo" might be invoked to install -# code. On systems that don't have a "sudo" command but need -# filesystem permission, then you get by with setting SUDO_CMD to "su root-c" -# For example: -# -# SUDO_CMD='su root -c' sh ./install-from-git.sh -# -# If you have sufficient filesystem permission (which is often the -# case on Windows or cygwin) then you might not need or want sudo. So -# here, set SUDO_CMD to a blank: -# -# SUDO_CMD=' ' sh ./install-from-git.sh -# -# -# To finish here is an invocation using all 3 above options: -# GIT_PROTOCOL='git' SUDO_CMD=' ' sh ./install-from-git.sh --prefix=/tmp - -GIT_PROTOCOL=${GIT_PROTOCOL:-http} - -run_cmd() { - echo "--- Running command: $@" - $@ - rc=$? - echo "--- $@ exit status is $?" - return $rc -} - -if (( $(id -u) != 0)) ; then - if [[ -z "$SUDO_CMD" ]] ; then - need_sudo='sudo' - if which $need_sudo >/dev/null 2>&1 ; then - try_cmd='' - else - need_sudo='su root -c' - try_cmd='su' - fi - else - need_sudo="$SUDO_CMD" - fi -else - need_sudo='' - try_cmd='' -fi - -for program in git make $try_cmd ; do - if ! which $program >/dev/null 2>&1 ; then - echo "Cant find program $program in $PATH" - exit 1 - fi -done - -for pkg in emacs-test-simple ; do - echo '******************************************' - echo Trying to install ${pkg}... - echo '******************************************' - run_cmd git clone ${GIT_PROTOCOL}://github.com/rocky/${pkg}.git - (cd $pkg && \ - run_cmd $SHELL ./autogen.sh && \ - run_cmd ./configure $@ && \ - run_cmd make && \ - run_cmd make check && \ - run_cmd $need_sudo make install - ) -done diff --git a/packages/test-simple/make-check-filter.rb b/packages/test-simple/make-check-filter.rb deleted file mode 100755 index daee7c99a..000000000 --- a/packages/test-simple/make-check-filter.rb +++ /dev/null @@ -1,21 +0,0 @@ -#!/usr/bin/env ruby -# Use this to cut out the crud from make check. -# Use like this: -# make check 2>&1 | ruby ../make-check-filter.rb -# See Makefile.am -pats = ["^(?:Loading", - 'make\[', - "Making check in", - '\(cd \.\.', - "make -C", - "Test-Unit", - "Fontifying", - '\s*$' - ].join('|') + ')' -# puts pats -skip_re = /#{pats}/ - -while gets() - next if $_ =~ skip_re - puts $_ -end diff --git a/packages/test-simple/test-simple.el b/packages/test-simple/test-simple.el deleted file mode 100644 index dde4badeb..000000000 --- a/packages/test-simple/test-simple.el +++ /dev/null @@ -1,336 +0,0 @@ -;;; test-simple.el --- Simple Unit Test Framework for Emacs Lisp -;; Rewritten from Phil Hagelberg's behave.el by rocky - -;; Copyright (C) 2010, 2012-2013, 2014 Rocky Bernstein - -;; Author: Rocky Bernstein -;; URL: http://github.com/rocky/emacs-test-simple -;; Keywords: unit-test -;; Version: 1.0 - -;; This file is NOT part of GNU Emacs. - -;; This program is free software: you can redistribute it and/or -;; modify it under the terms of the GNU General Public License as -;; published by the Free Software Foundation, either version 3 of the -;; License, or (at your option) any later version. - -;; This program is distributed in the hope that it will be useful, but -;; WITHOUT ANY WARRANTY; without even the implied warranty of -;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -;; General Public License for more details. - -;; You should have received a copy of the GNU General Public License -;; along with this program. If not, see -;; . - -;;; Commentary: - -;; test-simple.el is: -;; -;; * Simple. No need for -;; - context macros, -;; - enclosing specifications, -;; - required test tags. -;; -;; But if you want, you still can enclose tests in a local scope, -;; add customized assert failure messages, or add summary messages -;; before a group of tests. -;; -;; * Accomodates both interactive and non-interactive use. -;; - For interactive use, one can use `eval-last-sexp', `eval-region', -;; and `eval-buffer'. One can `edebug' the code. -;; - For non-interactive use, run: -;; emacs --batch --no-site-file --no-splash --load -;; -;; Here is an example using gcd.el found in the examples directory. -;; -;; (require 'test-simple) -;; (test-simple-start) ;; Zero counters and start the stop watch. -;; -;; ;; Use (load-file) below because we want to always to read the source. -;; ;; Also, we don't want no stinking compiled source. -;; (assert-t (load-file "./gcd.el") -;; "Can't load gcd.el - are you in the right directory?" ) -;; -;; (note "degenerate cases") -;; -;; (assert-nil (gcd 5 -1) "using positive numbers") -;; (assert-nil (gcd -4 1) "using positive numbers, switched order") -;; (assert-raises error (gcd "a" 32) -;; "Passing a string value should raise an error") -;; -;; (note "GCD computations") -;; (assert-equal 1 (gcd 3 5) "gcd(3,5)") -;; (assert-equal 8 (gcd 8 32) "gcd(8,32)") -;; (end-tests) ;; Stop the clock and print a summary -;; -;; Edit (with Emacs of course) test-gcd.el and run M-x eval-current-buffer -;; -;; You should see in buffer *test-simple*: -;; -;; test-gcd.el -;; ...... -;; 0 failures in 6 assertions (0.002646 seconds) -;; -;; Now let us try from a command line: -;; -;; $ emacs --batch --no-site-file --no-splash --load test-gcd.el -;; Loading /src/external-vcs/emacs-test-simple/example/gcd.el (source)... -;; *scratch* -;; ...... -;; 0 failures in 6 assertions (0.000723 seconds) - -;;; To do: - -;; Main issues: more expect predicates - -(require 'time-date) - -;;; Code: - -(eval-when-compile - (byte-compile-disable-warning 'cl-functions) - ;; Somehow disabling cl-functions causes the erroneous message: - ;; Warning: the function `reduce' might not be defined at runtime. - ;; FIXME: isolate, fix and/or report back to Emacs developers a bug - ;; (byte-compile-disable-warning 'unresolved) - (require 'cl) - ) -(require 'cl) - -(defvar test-simple-debug-on-error nil - "If non-nil raise an error on the first failure.") - -(defvar test-simple-verbosity 0 - "The greater the number the more verbose output.") - -(defstruct test-info - description ;; description of last group of tests - (assert-count 0) ;; total number of assertions run - (failure-count 0) ;; total number of failures seen - (start-time (current-time)) ;; Time run started - ) - -(defvar test-simple-info (make-test-info) - "Variable to store testing information for a buffer.") - -(defun note (description &optional test-info) - "Adds a name to a group of tests." - (if (getenv "USE_TAP") - (test-simple-msg (format "# %s" description) 't) - (if (> test-simple-verbosity 0) - (test-simple-msg (concat "\n" description) 't)) - (unless test-info - (setq test-info test-simple-info)) - (setf (test-info-description test-info) description) - )) - -;;;###autoload -(defmacro test-simple-start (&optional test-start-msg) - `(test-simple-clear nil - (or ,test-start-msg - (if (and (functionp '__FILE__) (__FILE__)) - (file-name-nondirectory (__FILE__)) - (buffer-name))) - )) - -;;;###autoload -(defun test-simple-clear (&optional test-info test-start-msg) - "Initializes and resets everything to run tests. You should run -this before running any assertions. Running more than once clears -out information from the previous run." - - (interactive) - - (unless test-info - (unless test-simple-info - (make-variable-buffer-local (defvar test-simple-info (make-test-info)))) - (setq test-info test-simple-info)) - - (setf (test-info-description test-info) "none set") - (setf (test-info-start-time test-info) (current-time)) - (setf (test-info-assert-count test-info) 0) - (setf (test-info-failure-count test-info) 0) - - (with-current-buffer (get-buffer-create "*test-simple*") - (let ((old-read-only inhibit-read-only)) - (setq inhibit-read-only 't) - (delete-region (point-min) (point-max)) - (if test-start-msg (insert (format "%s\n" test-start-msg))) - (setq inhibit-read-only old-read-only))) - (unless noninteractive - (message "Test-Simple: test information cleared"))) - -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; Assertion tests -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; - -(defmacro assert-raises (error-condition body &optional fail-message test-info) - (let ((fail-message (or fail-message - (format "assert-raises did not get expected %s" - error-condition)))) - (list 'condition-case nil - (list 'progn body - (list 'assert-t nil fail-message test-info)) - (list error-condition '(assert-t t))))) - -(defun assert-op (op expected actual &optional fail-message test-info) - "expectation is that ACTUAL should be equal to EXPECTED." - (unless test-info (setq test-info test-simple-info)) - (incf (test-info-assert-count test-info)) - (if (not (funcall op actual expected)) - (let* ((fail-message - (if fail-message - (format "Message: %s" fail-message) - "")) - (expect-message - (format "\n Expected: %s\n Got: %s" expected actual)) - (test-info-mess - (if (boundp 'test-info) - (test-info-description test-info) - "unset"))) - (add-failure (format "assert-%s" op) test-info-mess - (concat fail-message expect-message))) - (ok-msg fail-message))) - -(defun assert-equal (expected actual &optional fail-message test-info) - "expectation is that ACTUAL should be equal to EXPECTED." - (assert-op 'equal expected actual fail-message test-info)) - -(defun assert-eq (expected actual &optional fail-message test-info) - "expectation is that ACTUAL should be EQ to EXPECTED." - (assert-op 'eql expected actual fail-message test-info)) - -(defun assert-eql (expected actual &optional fail-message test-info) - "expectation is that ACTUAL should be EQL to EXPECTED." - (assert-op 'eql expected actual fail-message test-info)) - -(defun assert-matches (expected-regexp actual &optional fail-message test-info) - "expectation is that ACTUAL should match EXPECTED-REGEXP." - (unless test-info (setq test-info test-simple-info)) - (incf (test-info-assert-count test-info)) - (if (not (string-match expected-regexp actual)) - (let* ((fail-message - (if fail-message - (format "\n\tMessage: %s" fail-message) - "")) - (expect-message - (format "\tExpected Regexp: %s\n\tGot: %s" - expected-regexp actual)) - (test-info-mess - (if (boundp 'test-info) - (test-info-description test-info) - "unset"))) - (add-failure "assert-equal" test-info-mess - (concat expect-message fail-message))) - (progn (test-simple-msg ".") t))) - -(defun assert-t (actual &optional fail-message test-info) - "expectation is that ACTUAL is not nil." - (assert-nil (not actual) fail-message test-info "assert-t")) - -(defun assert-nil (actual &optional fail-message test-info assert-type) - "expectation is that ACTUAL is nil. FAIL-MESSAGE is an optional -additional message to be displayed. Since several assertions -funnel down to this one, ASSERT-TYPE is an optional type." - (unless test-info (setq test-info test-simple-info)) - (incf (test-info-assert-count test-info)) - (if actual - (let* ((fail-message - (if fail-message - (format "\n\tMessage: %s" fail-message) - "")) - (test-info-mess - (if (boundp 'test-simple-info) - (test-info-description test-simple-info) - "unset"))) - (add-failure "assert-nil" test-info-mess fail-message test-info)) - (ok-msg fail-message))) - -(defun add-failure(type test-info-msg fail-msg &optional test-info) - (unless test-info (setq test-info test-simple-info)) - (incf (test-info-failure-count test-info)) - (let ((failure-msg - (format "\nDescription: %s, type %s\n%s" test-info-msg type fail-msg)) - (old-read-only inhibit-read-only) - ) - (save-excursion - (not-ok-msg fail-msg) - (test-simple-msg failure-msg 't) - (unless noninteractive - (if test-simple-debug-on-error - (signal 'test-simple-assert-failed failure-msg) - ;;(message failure-msg) - ))))) - -(defun end-tests (&optional test-info) - "Give a tally of the tests run" - (interactive) - (unless test-info (setq test-info test-simple-info)) - (test-simple-describe-failures test-info) - (if noninteractive - (progn - (switch-to-buffer "*test-simple*") - (message "%s" (buffer-substring (point-min) (point-max))) - ) - (switch-to-buffer-other-window "*test-simple*") - )) - -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; Reporting -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; - -(defun test-simple-msg(msg &optional newline) - (switch-to-buffer "*test-simple*") - (let ((old-read-only inhibit-read-only)) - (setq inhibit-read-only 't) - (insert msg) - (if newline (insert "\n")) - (setq inhibit-read-only old-read-only) - (switch-to-buffer nil) - )) - -(defun ok-msg(fail-message &optional test-info) - (unless test-info (setq test-info test-simple-info)) - (let ((msg (if (getenv "USE_TAP") - (if (equal fail-message "") - (format "ok %d\n" (test-info-assert-count test-info)) - (format "ok %d - %s\n" - (test-info-assert-count test-info) - fail-message)) - "."))) - (test-simple-msg msg)) - 't) - -(defun not-ok-msg(fail-message &optional test-info) - (unless test-info (setq test-info test-simple-info)) - (let ((msg (if (getenv "USE_TAP") - (format "not ok %d\n" (test-info-assert-count test-info)) - "F"))) - (test-simple-msg msg)) - nil) - -(defun test-simple-summary-line(info) - (let* - ((failures (test-info-failure-count info)) - (asserts (test-info-assert-count info)) - (problems (concat (number-to-string failures) " failure" - (unless (= 1 failures) "s"))) - (tests (concat (number-to-string asserts) " assertion" - (unless (= 1 asserts) "s"))) - (elapsed-time (time-since (test-info-start-time info))) - ) - (if (getenv "USE_TAP") - (format "1..%d" asserts) - (format "\n%s in %s (%g seconds)" problems tests - (float-time elapsed-time)) - ))) - -(defun test-simple-describe-failures(&optional test-info) - (unless test-info (setq test-info test-simple-info)) - (goto-char (point-max)) - (test-simple-msg (test-simple-summary-line test-info))) - -(provide 'test-simple) -;;; test-simple.el ends here diff --git a/packages/test-simple/test/.gitignore b/packages/test-simple/test/.gitignore deleted file mode 100644 index b336cc7ce..000000000 --- a/packages/test-simple/test/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -/Makefile -/Makefile.in diff --git a/packages/test-simple/test/Makefile.am b/packages/test-simple/test/Makefile.am deleted file mode 100644 index cd8685048..000000000 --- a/packages/test-simple/test/Makefile.am +++ /dev/null @@ -1,29 +0,0 @@ -include $(top_srcdir)/common.mk - -PHONY=check test all -EXTRA_DIST=gcd.py gcd.rb - -all: - -#: same thing as "check" -test: check - -test_files := $(wildcard test-*.el) - -CHECK_FILES = $(notdir $(test_files:.el=.run)) - -#: Run all tests -check: $(CHECK_FILES) - -#: Run all tests with minimum verbosity -check-short: - $(MAKE) check 2>&1 | ruby ../make-check-filter.rb - -test-%.run: - (cd $(top_srcdir)/test && $(EMACS) --batch --no-site-file --no-splash --load $(@:.run=.el)) - -# Whatever it is you want to do, it should be forwarded to the -# to top-level directories -%: - $(MAKE) -C .. $@ - diff --git a/packages/test-simple/test/test-basic.el b/packages/test-simple/test/test-basic.el deleted file mode 100644 index 72cb5b352..000000000 --- a/packages/test-simple/test/test-basic.el +++ /dev/null @@ -1,13 +0,0 @@ -(require 'cl) -(load-file "../test-simple.el") -(test-simple-start "test-simple.el") - -(note "basic-tests") -(assert-t (memq 'test-simple features) "'test-simple provided") - -(assert-nil nil "assert-nil failure test") -(assert-nil nil "Knights if ni") -(assert-equal 5 (+ 1 4) "assert-equal") -(assert-raises error (error "you should not see this") "assert-raises") - -(end-tests) diff --git a/packages/test-simple/test/test-fns.el b/packages/test-simple/test/test-fns.el deleted file mode 100644 index c69028980..000000000 --- a/packages/test-simple/test/test-fns.el +++ /dev/null @@ -1,23 +0,0 @@ -(require 'cl) -(load-file "../test-simple.el") -(test-simple-clear) - -(setq test-info (make-test-info)) -(test-simple-clear test-info) - -(note "Initializing test information") -(assert-equal 0 (test-info-assert-count test-info) "Count zeroed") -(assert-equal 0 (test-info-failure-count test-info) "Failure zeroed") - -(note "Summary information") -(assert-matches "0 failures in 0 assertions" (test-simple-summary-line test-info) - "initial summary") -(incf (test-info-assert-count test-info)) -(incf (test-info-failure-count test-info)) -(assert-matches "1 failure in 1 assertion" (test-simple-summary-line test-info) - "handling singular correctly") -(incf (test-info-assert-count test-info)) -(assert-matches "1 failure in 2 assertions" (test-simple-summary-line test-info) - "back to plural for two assertions") - -(end-tests) diff --git a/packages/test-simple/test/test-no-clear.el b/packages/test-simple/test/test-no-clear.el deleted file mode 100644 index 5ac81a4c8..000000000 --- a/packages/test-simple/test/test-no-clear.el +++ /dev/null @@ -1,11 +0,0 @@ -(require 'cl) -(load-file "../test-simple.el") -;; We don't do this or test-simple-start -;; (test-simple-clear) - -(note "no-test-start") -(assert-t (memq 'test-simple features) "'test-simple provided") - -(assert-nil nil) - -(end-tests)