Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

deleting old tuareg files

  • Loading branch information...
commit 9a202f6ba9d3f919fa9a825ce03ea1e291bbc64b 1 parent 5d187aa
Steve Jenson authored
341 vendor/tuareg/COPYING
View
@@ -1,341 +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.
-
- <one line to give the program's name and a brief idea of what it does.>
- Copyright (C) 19yy <name of author>
-
- 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; see the file COPYING. 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.
-
- <signature of Ty Coon>, 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.
103 vendor/tuareg/HISTORY
View
@@ -1,103 +0,0 @@
-Tuareg Mode is a thoroughly rewritten derivative of Caml Mode 0.9.x:
---------------------------------------------------------------------
-
-First version -
- By Xavier Leroy <Xavier.Leroy@inria.fr>
- and Jerome Vouillon <Jerome.Vouillon@ens.fr>, 1993.
-Compilation interface -
- By Ian Zimmerman <itz@rahul.net>, 1996;
- Copyright � 1996 Ian Zimmerman, all rights reserved.
-First Font-Lock and XEmacs support -
- By Pierre Boulet <Pierre.Boulet@ens-lyon.fr>, 1996.
-First OCaml and OLabl version -
- By Jacques Garrigue <Jacques.Garrigue@kurims.kyoto-u.ac.jp>, 1996.
-
-New version for Objective Caml
- Extension to Objective Caml (and Labl) syntax (including literals
- and preserving compatibility with Camllight syntax) complete
- rewritting of Zimmerman's mode, especially comment detection
- and indentation, along with major improvement of
- indentation capabilities, new Font-Lock and
- Hilit19, compatibility over Emacs and XEmacs;
- By Albert Cohen <Albert.Cohen@prism.uvsq.fr>, 1997.
-
-Tuareg Mode history:
---------------------
-
-1.00 - January 8 1997 -
- First verion of Tuareg
- (previously known as Caml-Mode 0.9.2 -> 0.9.8).
-
-1.10 - From March 17 1997 to March 20 1997 -
- to First release of Tuareg
-1.12 Speed-up and fixes.
-
-1.20 - From March 23 1997 to July 28 1997 -
- to Support for symbol fontifying, adaptation of Font-Lock interface,
-1.27 Rewritting of a new Sym-Lock extension for Font-Lock (more powerful,
- polyvalent, and fitting dynamic customization). Suggestion and first
- adaptation by Chrstian Boos <boos@arthur.u-strasbg.fr>.
- Improved phrase detection. `C-M-h' and `C-c C-e' now detect
- both beginning and end of phrases ; `;;' is used, if present.
- Improved `tuareg-interactive' mode. Support for Font-Lock
- on toplevel inputs. Patchs for many phrase detection bugs.
- New option for `=' indentation, `match-string' optimized, and
- indentation of `;' sequences accelerated.
-
-1.30 - April 14 1998 -
- Major improvement of syntax parsing code (including proper handling
- of multi-line strings and speed-up). Strong speed-up of parenthesis
- parsing. A few indentation and phrase-related commands bugs corrected.
-1.31 - June 8 1998 -
- Lot of bugs corrected, new customization (more flexible and usable,
- with some examples). Minor Sym-Lock changes, indentation changes in
- some cases, simplified installation guidelines.
-1.32 - June 26 1998 -
- Only with XEmacs: Correct string/comment hiliting.
- A few bugs removed, especially in literal/comment detection.
- New customization features.
-1.33 - November 24 1998 -
- New support for OCaml 2.00 syntax (let module X=..., and {r with ...}).
- Indentation bug corrected for arrays, records and objects.
-1.34 - December 15 1998 -
- Bugs corrected in OCaml 2.00 syntax, added new indentation options
- for parentheses and = symbols.
-1.35 - January 13 1999 -
- Major improvement of interactive mode, thanks to contribution
- of Michel Quercia. Bug removal in phrase detection and comment
- indentation (paragraph and lines).
-1.36 - January 22 1999 -
- Navigation support for OCaml manual, library, and buffer-dependent
- definitions (adapted from original code by Michel Quercia). New
- commands, and next-error in toplevel by Claude March�.
-1.37 - May 18 2000 -
- Many improvements and extended support for OCaml 3.00 (like label
- hiliting). Improved FSF Emacs compatibility thanks to R�mi Vanicat.
- Corrected bugs in string/comment recognition (the last ones?).
-1.38 - September 19 2000 -
- Standard Customization interface, removal of most non-standard
- font-lock faces, string/comment hiliting for FSF Emacs
- eventually matches XEmacs performances; plus a lot of minor fixes.
-
-1.40 - June 26 2002 -
- Major update: FSF Emacs 21 compatibility (lazy Font-Lock support),
- new indentation features (e.g., smart comment justification styles),
- robust hiliting for declarations, many bugs corrected.
-1.41 - December 8 2003 -
- Indentation and hiliting features, many intermediate versions
- with minor bug fixes, support for caml-types.
-1.42 - November 5 2004 -
- MetaOCaml support, many bug fixes, major rewrite of hiliting code,
- many improvements and bug fixes to the indentation code,
- refactoring of some deprecated code (by Stefan Monnier).
-1.43 - November 21 2004 -
- Improved MetaOCaml support, phrase mark/evaluation fixes,
- many improvements to module indentation and marking, removed
- aggresive inlining after `=' and fixed related bugs.
-1.44 - December 29 2004 -
- Major fontification improvements, largely by Stefan Monnier.
- Many bug fixes related with the improvements in 1.42 and 1.43.
-1.45 - Planned for release in March 2005 -
- New symbol fontification, compatible with FSF Emacs, by
- Stefan Monnier. Initiation of a migration of the syntax cache to
- PPSS for comments and string.
171 vendor/tuareg/LISEZMOI
View
@@ -1,171 +0,0 @@
-DESCRIPTION :
-
- Cette archive contient des fichiers permettant de d'assister l'�dition du code
- Caml, de colorer les parties importantes du code, d'ex�cuter un toplevel Caml
- et d'ex�cuter le d�bogueur Caml avec GNU Emacs/XEmacs. Elle a �t� con�ue pour
- Objective Caml, mais elle supporte �galement le code Camllight.
-
-
-CONTENU :
-
- README Version anglaise de ce fichier;
- LISEZMOI Ce fichier;
- HISTORY Changements par rapport � la version pr�c�dente;
- tuareg.el Un mode majeur pour �diter du code Caml avec Emacs/XEmacs
- sym-lock.el Une extension permettant d'afficher les symboles sous
- XEmacs;
- camldebug.el Permet d'ex�cuter le d�bogueur Caml sous Emacs;
- append-tuareg.el Fichier de configuration pour une installation rapide;
- custom-tuareg.el Exemple de personnalisation de Tuareg.
-
-INSTALLATION :
-
- Si vous avez les droits d'�criture sur le r�pertoire �site-lisp� d'Emacs ou
- d'XEmacs, il vous suffit d'y copier les fichiers �tuareg.el�, �camldebug.el�
- et �sym-lock.el� (Sym-Lock ne fonctionnant qu'avec XEmacs).
-
- Sinon, choisissez un r�pertoire, par exemple �toto�, et copiez y les trois
- fichiers �tuareg.el�, �camldebug.el� et �sym-lock.el�. Ensuite, ajoutez la
- ligne suivante dans votre �.emacs� en rempla�ant �toto� par le chemin complet
- du r�pertoire choisi :
-
- (setq load-path (cons "toto" load-path))
-
-CONFIGURATION RAPIDE :
-
- Si vous n'�tes pas familier avec Emacs-Lisp, et que voulez utiliser
- Tuareg sans plus tarder, concat�nez (ou copiez) `append-tuareg.el' �
- votre fichier de configuration `.emacs'. Cela permet � XEmacs de
- charger automatiquement Tuareg et Sym-Lock.
-
- Pensez � modifier votre fichier de configuration `.emacs' � la main si vous
- avez d�j� install� Tuareg.
-
-CONFIGURATION MANUELLE :
-
- Ajoutez les lignes suivantes dans votre fichier `.emacs' :
-
- (setq auto-mode-alist (cons '("\\.ml\\w?" . tuareg-mode) auto-mode-alist))
- (autoload 'tuareg-mode "tuareg" "Mode majeur pour �diter du code Caml" t)
- (autoload 'camldebug "camldebug" "Ex�cuter le d�bogueur Caml" t)
-
- Le mode majeur Tuareg est charg� automatiquement lorsqu'on visite un fichier
- avec l'extension .ml, .mli, .mly, .mll, .mlp... ou manuellement en tapant
- M-x tuareg-mode. Cela permet � Emacs de reconna�tre correctement la
- syntaxe Caml.
-
- Si vous utilisez XEmacs, le mode mineur Font-Lock est utilis� conform�ment �
- vos param�tres de personnalisation.
-
- Dans Emacs, vous pouvez utiliser Font-Lock en rajoutant les lignes
- suivantes � votre fichier de configuration :
-
- (if (and (boundp 'window-system) window-system)
- (require 'font-lock))
-
- Avec XEmacs (et plus g�n�ralement, si vous avez des polices de
- taille variable et si la librairie `atomic-extents' est support�e),
- vous pouvez aussi utiliser Sym-Lock. Attention : les versions MULE
- (multilingues) de XEmacs ne permettent pas de combiner plusieurs
- polices avec des encodages diff�rents sur le m�me buffer, et ne
- supportent donc pas Sym-Lock. La configuration de Tuareg avec Sym-Lock
- est la suivante :
-
- (if (and (boundp 'window-system) window-system)
- (if (string-match "XEmacs" emacs-version)
- (if (not (and (boundp 'mule-x-win-initted) mule-x-win-initted))
- (require 'sym-lock))
- (require 'font-lock)))
-
-UTILISATION :
-
- Tuareg vous permet de compiler du code Caml � partir d'Emacs (en utilisant
- M-x compile) et de naviguer dans les erreurs (avec C-x `). En tapant C-x `,
- vous placez le curseur au d�but de la partie erron�e du programme, et la
- marque � la fin. Sous Emacs, le code en question est temporairement
- surlign�.
-
- M-x tuareg-run-caml lance un toplevel Caml dont les entr�es/sorties sont dans
- un buffer Emacs nomm� `*caml-toplevel*'. Vous pouvez alors utiliser toute la
- puissance d'Emacs pour �diter l'entr�e du toplevel Caml. Ce mode est bas� sur
- comint, donc vous b�n�ficiez de toutes les fonctionnalit�s de comint, y
- compris l'historique des commandes. Pour la personnalisation de Tuareg, vous
- pouvez utiliser `tuareg-interactive-mode-hook'.
-
- En tapant C-c C-e dans un buffer Caml, la fonction courante (contenant le
- curseur) est envoy�e au toplevel Caml, et y est �valu�e. Si vous tapez une de
- ces commandes avant M-x tuareg-run-caml, le toplevel d�marrera
- automatiquement.
-
- M-x camldebug FICHIER lance le d�bogueur camldebug sur le fichier ex�cutable
- FICHIER, avec des entr�es/sorties associ�es au buffer *camldebug-FICHIER*.
- Elle est similaire � la version d'avril 1996, avec quelques changements
- mineurs pour fonctionner avec XEmacs, Tuareg et OCaml. De plus, le paquetage
- `thingatpt' n'est plus requis.
-
-PERSONNALISATION
-
- L'outil standard de personnalisation d'Emacs peut-�tre utilis� pour modifier
- les options de Tuareg. Il est accessible � partir du menu Options et du
- sous-menu Customize de Tuareg.
-
- Vous pouvez �galement personnaliser l'apparence du code Caml en modifiant les
- variables list�es au d�but du fichier tuareg.el (il vaut mieux utiliser
- `tuareg-mode-hook' que d'�diter directement le fichier). Il suffit donc
- d'ajouter � votre fichier de configuration quelque chose du type :
-
- (add-hook 'tuareg-mode-hook
- '(lambda ()
- ... ; votre personnalisation
- ))
-
- `custom-tuareg.el' est un exemple de personnalisation standard. Vous
- pouvez le rajouter � votre `.emacs' ou l'utiliser comme un tutoriel.
-
-FONCTIONNALIT�S, BOGUES CONNUS :
-
- Consulter l'aide en ligne.
-
-REMERCIEMENTS
-
- Ian Zimmerman pour le mode pr�c�dent, l'interface de compilation et
- l'am�lioration du d�bogueur.
-
- Jacques Garrigue am�liora le mode de I. Zimmerman en l'adaptant � la syntaxe
- Objective Caml (et Labl). Bien que ce travail a �t� fait ind�pendamment, ses
- commentaires et son fichier de configuration ont �t� d'une grande aide.
-
- Michel Quercia pour ses remarques pertinentes, ses patches et ses
- contributions en emacs-lisp (compl�tes et pr�tes � fonctionner),
- sp�cialement pour le mode interactif Tuareg et pour les possibilit�s
- de navigation.
-
- Denis Barthou, Pierre Boulet, Jean-Christophe Filli�tre et R�mi Vanicat pour
- leurs tests intensifs, leurs suggestions et leur aide.
-
- Ralf Treinen pour la maintenance du paquetage Debian GNU/Linux.
-
- Toutes les personnes qui m'ont signal� des bogues, envoy� des
- commentaires et des patches. Le mode s'en serait arr�t� � la version
- 0.9.2 sans leur aide. Je remercie particuli�rement Eli Barzilay,
- Josh Berdine, Christian Boos, Carsten Clasohm, Yann Coscoy, Prakash
- Countcham, Alvarado Cuihtlauac, Erwan David, Gilles D�fourneaux,
- Philippe Esperet, Gilles Falcon, Tim Freeman, Alain Frisch,
- Christian Lindig, Claude March�, Charles Martin, Dave Mason, Stefan
- Monnier, Toby Moth, Jean-Yves Moyen, Alex Ott, Christopher Quinn,
- Ohad Rodeh, Rauli Ruohonen, Hendrik Tews, Christophe Troestler,
- Joseph Sudish, Mattias Waldau and John Whitley.
-
-COORDONN�ES :
-
- Le site officiel de Tuareg se trouve � l'adresse :
-
- http://www-rocq.inria.fr/~acohen/tuareg
-
- Vous pouvez signaler vos bogues, envoyer vos suggestions et
- encouragements, etc. � :
-
- Albert Cohen
- Charg� de Recherche - INRIA Futurs
-
- E-Mail : Albert.Cohen@inria.fr
12 vendor/tuareg/append-tuareg.el
View
@@ -1,12 +0,0 @@
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;; append-tuareg.el - Tuareg quick installation: Append this file to .emacs.
-
-(setq auto-mode-alist (cons '("\\.ml\\w?" . tuareg-mode) auto-mode-alist))
-(autoload 'tuareg-mode "tuareg" "Major mode for editing Caml code" t)
-(autoload 'camldebug "camldebug" "Run the Caml debugger" t)
-
-(if (and (boundp 'window-system) window-system)
- (when (string-match "XEmacs" emacs-version)
- (if (not (and (boundp 'mule-x-win-initted) mule-x-win-initted))
- (require 'sym-lock))
- (require 'font-lock)))
765 vendor/tuareg/camldebug.el
View
@@ -1,765 +0,0 @@
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;; camldebug.el - Run ocamldebug / camldebug under Emacs.
-;; Derived from gdb.el.
-
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;; Copying is covered by the GNU General Public License.
-;;
-;; 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.
-
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;; History
-;;
-;;itz 04-06-96 I pondered basing this on gud. The potential advantages
-;;were: automatic bugfix , keymaps and menus propagation.
-;;Disadvantages: gud is not so clean itself, there is little common
-;;functionality it abstracts (most of the stuff is done in the
-;;debugger specific parts anyway), and, most seriously, gud sees it
-;;fit to add C-x C-a bindings to the _global_ map, so there would be a
-;;conflict between camldebug and gdb, for instance. While it's OK to
-;;assume that a sane person doesn't use gdb and dbx at the same time,
-;;it's not so OK (IMHO) for gdb and camldebug.
-
-;;Albert Cohen 04-97: Patch for Tuareg support.
-;;Albert Cohen 05-98: A few patches and OCaml customization.
-;;Albert Cohen 09-98: XEmacs support and some improvements.
-;;Erwan Jahier and Albert Cohen 11-05: support for camldebug 3.09.
-
-(require 'comint)
-(require 'shell)
-(require 'tuareg)
-(require 'derived)
-
-;;; Variables.
-
-(defvar camldebug-last-frame)
-(defvar camldebug-delete-prompt-marker)
-(defvar camldebug-filter-accumulator nil)
-(defvar camldebug-last-frame-displayed-p)
-(defvar camldebug-filter-function)
-
-(defvar camldebug-prompt-pattern "^(\\(ocd\\|cdb\\)) *"
- "A regexp to recognize the prompt for camldebug.")
-
-(defvar camldebug-overlay-event nil
- "Overlay for displaying the current event.")
-(defvar camldebug-overlay-under nil
- "Overlay for displaying the current event.")
-(defvar camldebug-event-marker nil
- "Marker for displaying the current event.")
-
-(defvar camldebug-track-frame t
- "*If non-nil, always display current frame position in another window.")
-
-(cond
- ((and (fboundp 'make-overlay) window-system)
- (make-face 'camldebug-event)
- (make-face 'camldebug-underline)
- (if (not (face-differs-from-default-p 'camldebug-event))
- (invert-face 'camldebug-event))
- (if (not (face-differs-from-default-p 'camldebug-underline))
- (set-face-underline-p 'camldebug-underline t))
- (setq camldebug-overlay-event (make-overlay 1 1))
- (overlay-put camldebug-overlay-event 'face 'camldebug-event)
- (setq camldebug-overlay-under (make-overlay 1 1))
- (overlay-put camldebug-overlay-under 'face 'camldebug-underline))
- (t
- (setq camldebug-event-marker (make-marker))
- (setq overlay-arrow-string "=>")))
-
-;;; Camldebug mode.
-
-(define-derived-mode camldebug-mode comint-mode "Caml-Debugger"
-
- "Major mode for interacting with a Camldebug process.
-
-The following commands are available:
-
-\\{camldebug-mode-map}
-
-\\[camldebug-display-frame] displays in the other window
-the last line referred to in the camldebug buffer.
-
-\\[camldebug-step], \\[camldebug-back] and \\[camldebug-next], in the camldebug window,
-call camldebug to step, backstep or next and then update the other window
-with the current file and position.
-
-If you are in a source file, you may select a point to break
-at, by doing \\[camldebug-break].
-
-Commands:
-Many commands are inherited from comint mode.
-Additionally we have:
-
-\\[camldebug-display-frame] display frames file in other window
-\\[camldebug-step] advance one line in program
-C-x SPACE sets break point at current line."
-
- (mapcar 'make-local-variable
- '(camldebug-last-frame-displayed-p camldebug-last-frame
- camldebug-delete-prompt-marker camldebug-filter-function
- camldebug-filter-accumulator paragraph-start))
- (setq
- camldebug-last-frame nil
- camldebug-delete-prompt-marker (make-marker)
- camldebug-filter-accumulator ""
- camldebug-filter-function 'camldebug-marker-filter
- comint-prompt-regexp camldebug-prompt-pattern
- comint-dynamic-complete-functions (cons 'camldebug-complete
- comint-dynamic-complete-functions)
- paragraph-start comint-prompt-regexp
- camldebug-last-frame-displayed-p t)
- (make-local-variable 'shell-dirtrackp)
- (setq shell-dirtrackp t)
- (setq comint-input-sentinel 'shell-directory-tracker))
-
-;;; Keymaps.
-
-(defun camldebug-numeric-arg (arg)
- (and arg (prefix-numeric-value arg)))
-
-(defmacro def-camldebug (name key &optional doc args)
-
- "Define camldebug-NAME to be a command sending NAME ARGS and bound
-to KEY, with optional doc string DOC. Certain %-escapes in ARGS are
-interpreted specially if present. These are:
-
- %m module name of current module.
- %d directory of current source file.
- %c number of current character position
- %e text of the caml variable surrounding point.
-
- The `current' source file is the file of the current buffer (if
-we're in a caml buffer) or the source file current at the last break
-or step (if we're in the camldebug buffer), and the `current' module
-name is the filename stripped of any *.ml* suffixes (this assumes the
-usual correspondence between module and file naming is observed). The
-`current' position is that of the current buffer (if we're in a source
-file) or the position of the last break or step (if we're in the
-camldebug buffer).
-
-If a numeric is present, it overrides any ARGS flags and its string
-representation is simply concatenated with the COMMAND."
-
- (let* ((fun (intern (format "camldebug-%s" name))))
- (list 'progn
- (if doc
- (list 'defun fun '(arg)
- doc
- '(interactive "P")
- (list 'camldebug-call name args
- '(camldebug-numeric-arg arg))))
- (list 'define-key 'camldebug-mode-map
- (concat "\C-c" key)
- (list 'quote fun))
- (list 'define-key 'tuareg-mode-map
- (concat "\C-x\C-a" key)
- (list 'quote fun)))))
-
-(def-camldebug "step" "\C-s" "Step one source line with display.")
-(def-camldebug "run" "\C-r" "Run the program.")
-(def-camldebug "reverse" "\C-v" "Run the program in reverse.")
-(def-camldebug "last" "\C-l" "Go to latest time in execution history.")
-(def-camldebug "backtrace" "\C-t" "Print the call stack.")
-(def-camldebug "open" "\C-o" "Open the current module." "%m")
-(def-camldebug "close" "\C-c" "Close the current module." "%m")
-(def-camldebug "finish" "\C-f" "Finish executing current function.")
-(def-camldebug "print" "\C-p" "Print value of symbol at point." "%e")
-(def-camldebug "next" "\C-n" "Step one source line (skip functions)")
-(def-camldebug "up" "<" "Go up N stack frames (numeric arg) with display")
-(def-camldebug "down" ">" "Go down N stack frames (numeric arg) with display")
-(def-camldebug "break" "\C-b" "Set breakpoint at current line."
- "@ \"%m\" # %c")
-
-(defun camldebug-kill-filter (string)
- ;gob up stupid questions :-)
- (setq camldebug-filter-accumulator
- (concat camldebug-filter-accumulator string))
- (if (not (string-match "\\(.* \\)(y or n) "
- camldebug-filter-accumulator)) nil
- (setq camldebug-kill-output
- (cons t (match-string 1 camldebug-filter-accumulator)))
- (setq camldebug-filter-accumulator ""))
- (if (string-match comint-prompt-regexp camldebug-filter-accumulator)
- (let ((output (substring camldebug-filter-accumulator
- (match-beginning 0))))
- (setq camldebug-kill-output
- (cons nil (substring camldebug-filter-accumulator 0
- (1- (match-beginning 0)))))
- (setq camldebug-filter-accumulator "")
- output)
- ""))
-
-(def-camldebug "kill" "\C-k")
-
-(defun camldebug-kill ()
- "Kill the program."
- (interactive)
- (let ((camldebug-kill-output))
- (save-excursion
- (set-buffer current-camldebug-buffer)
- (let ((proc (get-buffer-process (current-buffer)))
- (camldebug-filter-function 'camldebug-kill-filter))
- (camldebug-call "kill")
- (while (not (and camldebug-kill-output
- (zerop (length camldebug-filter-accumulator))))
- (accept-process-output proc))))
- (if (not (car camldebug-kill-output))
- (error (cdr camldebug-kill-output))
- (sit-for 0 300)
- (camldebug-call-1 (if (y-or-n-p (cdr camldebug-kill-output)) "y" "n")))))
-;;FIXME: camldebug doesn't output the Hide marker on kill
-
-(defun camldebug-goto-filter (string)
- ;accumulate onto previous output
- (setq camldebug-filter-accumulator
- (concat camldebug-filter-accumulator string))
- (if (not (or (string-match (concat
- "\\(\n\\|\\`\\)[ \t]*\\([0-9]+\\)[ \t]+"
- camldebug-goto-position
- "-[0-9]+[ \t]*\\(before\\).*\n")
- camldebug-filter-accumulator)
- (string-match (concat
- "\\(\n\\|\\`\\)[ \t]*\\([0-9]+\\)[ \t]+[0-9]+-"
- camldebug-goto-position
- "[ \t]*\\(after\\).*\n")
- camldebug-filter-accumulator)))
- nil
- (setq camldebug-goto-output
- (match-string 2 camldebug-filter-accumulator))
- (setq camldebug-filter-accumulator
- (substring camldebug-filter-accumulator (1- (match-end 0)))))
- (if (not (string-match comint-prompt-regexp
- camldebug-filter-accumulator)) nil
- (setq camldebug-goto-output (or camldebug-goto-output 'fail))
- (setq camldebug-filter-accumulator ""))
- (if (string-match "\n\\(.*\\)\\'" camldebug-filter-accumulator)
- (setq camldebug-filter-accumulator
- (match-string 1 camldebug-filter-accumulator)))
- "")
-
-(def-camldebug "goto" "\C-g")
-(defun camldebug-goto (&optional time)
-
- "Go to the execution time TIME.
-
-Without TIME, the command behaves as follows: In the camldebug buffer,
-if the point at buffer end, goto time 0\; otherwise, try to obtain the
-time from context around point. In a caml mode buffer, try to find the
-time associated in execution history with the current point location.
-
-With a negative TIME, move that many lines backward in the camldebug
-buffer, then try to obtain the time from context around point."
-
- (interactive "P")
- (cond
- (time
- (let ((ntime (camldebug-numeric-arg time)))
- (if (>= ntime 0) (camldebug-call "goto" nil ntime)
- (save-selected-window
- (select-window (get-buffer-window current-camldebug-buffer))
- (save-excursion
- (if (re-search-backward "^Time : [0-9]+ - pc : [0-9]+ "
- nil t (- 1 ntime))
- (camldebug-goto nil)
- (error "I don't have %d times in my history"
- (- 1 ntime))))))))
- ((eq (current-buffer) current-camldebug-buffer)
- (let ((time (cond
- ((eobp) 0)
- ((save-excursion
- (beginning-of-line 1)
- (looking-at "^Time : \\([0-9]+\\) - pc : [0-9]+ "))
- (string-to-int (match-string 1)))
- ((string-to-int (camldebug-format-command "%e"))))))
- (camldebug-call "goto" nil time)))
- (t
- (let ((module (camldebug-module-name (buffer-file-name)))
- (camldebug-goto-position (int-to-string (1- (point))))
- (camldebug-goto-output) (address))
- ;get a list of all events in the current module
- (save-excursion
- (set-buffer current-camldebug-buffer)
- (let* ((proc (get-buffer-process (current-buffer)))
- (camldebug-filter-function 'camldebug-goto-filter))
- (camldebug-call-1 (concat "info events " module))
- (while (not (and camldebug-goto-output
- (zerop (length camldebug-filter-accumulator))))
- (accept-process-output proc))
- (setq address (if (eq camldebug-goto-output 'fail) nil
- (re-search-backward
- (concat "^Time : \\([0-9]+\\) - pc : "
- camldebug-goto-output
- " - module "
- module "$") nil t)
- (match-string 1)))))
- (if address (camldebug-call "goto" nil (string-to-int address))
- (error "No time at %s at %s" module camldebug-goto-position))))))
-
-
-(defun camldebug-delete-filter (string)
- (setq camldebug-filter-accumulator
- (concat camldebug-filter-accumulator string))
- (if (not (string-match
- (concat "\\(\n\\|\\`\\)[ \t]*\\([0-9]+\\)[ \t]+[0-9]+[ \t]*in "
- (regexp-quote camldebug-delete-file)
- ", character "
- camldebug-delete-position "\n")
- camldebug-filter-accumulator)) nil
- (setq camldebug-delete-output
- (match-string 2 camldebug-filter-accumulator))
- (setq camldebug-filter-accumulator
- (substring camldebug-filter-accumulator (1- (match-end 0)))))
- (if (not (string-match comint-prompt-regexp
- camldebug-filter-accumulator)) nil
- (setq camldebug-delete-output (or camldebug-delete-output 'fail))
- (setq camldebug-filter-accumulator ""))
- (if (string-match "\n\\(.*\\)\\'" camldebug-filter-accumulator)
- (setq camldebug-filter-accumulator
- (match-string 1 camldebug-filter-accumulator)))
- "")
-
-
-(def-camldebug "delete" "\C-d")
-
-(defun camldebug-delete (&optional arg)
- "Delete the breakpoint numbered ARG.
-
-Without ARG, the command behaves as follows: In the camldebug buffer,
-try to obtain the time from context around point. In a caml mode
-buffer, try to find the breakpoint associated with the current point
-location.
-
-With a negative ARG, look for the -ARGth breakpoint pattern in the
-camldebug buffer, then try to obtain the breakpoint info from context
-around point."
-
- (interactive "P")
- (cond
- (arg
- (let ((narg (camldebug-numeric-arg arg)))
- (if (> narg 0) (camldebug-call "delete" nil narg)
- (save-excursion
- (set-buffer current-camldebug-buffer)
- (if (re-search-backward "^Breakpoint [0-9]+ at [0-9]+ : file "
- nil t (- 1 narg))
- (camldebug-delete nil)
- (error "I don't have %d breakpoints in my history"
- (- 1 narg)))))))
- ((eq (current-buffer) current-camldebug-buffer)
- (let* ((bpline "^Breakpoint \\([0-9]+\\) at [0-9]+ : file ")
- (arg (cond
- ((eobp)
- (save-excursion (re-search-backward bpline nil t))
- (string-to-int (match-string 1)))
- ((save-excursion
- (beginning-of-line 1)
- (looking-at bpline))
- (string-to-int (match-string 1)))
- ((string-to-int (camldebug-format-command "%e"))))))
- (camldebug-call "delete" nil arg)))
- (t
- (let ((camldebug-delete-file
- (concat (camldebug-format-command "%m") ".ml"))
- (camldebug-delete-position (camldebug-format-command "%c")))
- (save-excursion
- (set-buffer current-camldebug-buffer)
- (let ((proc (get-buffer-process (current-buffer)))
- (camldebug-filter-function 'camldebug-delete-filter)
- (camldebug-delete-output))
- (camldebug-call-1 "info break")
- (while (not (and camldebug-delete-output
- (zerop (length
- camldebug-filter-accumulator))))
- (accept-process-output proc))
- (if (eq camldebug-delete-output 'fail)
- (error "No breakpoint in %s at %s"
- camldebug-delete-file
- camldebug-delete-position)
- (camldebug-call "delete" nil
- (string-to-int camldebug-delete-output)))))))))
-
-(defun camldebug-complete-filter (string)
- (setq camldebug-filter-accumulator
- (concat camldebug-filter-accumulator string))
- (while (string-match "\\(\n\\|\\`\\)\\(.+\\)\n"
- camldebug-filter-accumulator)
- (setq camldebug-complete-list
- (cons (match-string 2 camldebug-filter-accumulator)
- camldebug-complete-list))
- (setq camldebug-filter-accumulator
- (substring camldebug-filter-accumulator
- (1- (match-end 0)))))
- (if (not (string-match comint-prompt-regexp
- camldebug-filter-accumulator)) nil
- (setq camldebug-complete-list
- (or camldebug-complete-list 'fail))
- (setq camldebug-filter-accumulator ""))
- (if (string-match "\n\\(.*\\)\\'" camldebug-filter-accumulator)
- (setq camldebug-filter-accumulator
- (match-string 1 camldebug-filter-accumulator)))
- "")
-
-(defun camldebug-complete ()
-
- "Perform completion on the camldebug command preceding point."
-
- (interactive)
- (let* ((end (point))
- (command (save-excursion
- (beginning-of-line)
- (and (looking-at comint-prompt-regexp)
- (goto-char (match-end 0)))
- (buffer-substring (point) end)))
- (camldebug-complete-list nil) (command-word))
-
- ;; Find the word break. This match will always succeed.
- (string-match "\\(\\`\\| \\)\\([^ ]*\\)\\'" command)
- (setq command-word (match-string 2 command))
-
- ;itz 04-21-96 if we are trying to complete a word of nonzero
- ;length, chop off the last character. This is a nasty hack, but it
- ;works - in general, not just for this set of words: the comint
- ;call below will weed out false matches - and it avoids further
- ;mucking with camldebug's lexer.
- (if (> (length command-word) 0)
- (setq command (substring command 0 (1- (length command)))))
-
- (let ((camldebug-filter-function 'camldebug-complete-filter))
- (camldebug-call-1 (concat "complete " command))
- (set-marker camldebug-delete-prompt-marker nil)
- (while (not (and camldebug-complete-list
- (zerop (length camldebug-filter-accumulator))))
- (accept-process-output (get-buffer-process
- (current-buffer)))))
- (if (eq camldebug-complete-list 'fail)
- (setq camldebug-complete-list nil))
- (setq camldebug-complete-list
- (sort camldebug-complete-list 'string-lessp))
- (comint-dynamic-simple-complete command-word camldebug-complete-list)))
-
-(define-key camldebug-mode-map "\C-l" 'camldebug-refresh)
-(define-key camldebug-mode-map "\t" 'comint-dynamic-complete)
-(define-key camldebug-mode-map "\M-?" 'comint-dynamic-list-completions)
-
-(define-key tuareg-mode-map "\C-x " 'camldebug-break)
-
-
-(defvar current-camldebug-buffer nil)
-
-
-;;;###autoload
-(defvar camldebug-command-name "ocamldebug"
- "Pathname for executing Caml debugger.")
-
-;;;###autoload
-(defun camldebug (path)
- "Run camldebug on program FILE in buffer *camldebug-FILE*.
-The directory containing FILE becomes the initial working directory
-and source-file directory for camldebug. If you wish to change this, use
-the camldebug commands `cd DIR' and `directory'."
- (interactive "fRun camldebug on file: ")
- (setq path (expand-file-name path))
- (let ((file (file-name-nondirectory path)))
- (pop-to-buffer (concat "*camldebug-" file "*"))
- (setq default-directory (file-name-directory path))
- (message "Current directory is %s" default-directory)
- (setq camldebug-command-name
- (read-from-minibuffer "Caml debugguer to run: "
- camldebug-command-name))
- (make-comint (concat "camldebug-" file)
- (substitute-in-file-name camldebug-command-name)
- nil
- "-emacs" "-cd" default-directory path)
- (set-process-filter (get-buffer-process (current-buffer))
- 'camldebug-filter)
- (set-process-sentinel (get-buffer-process (current-buffer))
- 'camldebug-sentinel)
- (camldebug-mode)
- (camldebug-set-buffer)))
-
-(defun camldebug-set-buffer ()
- (if (eq major-mode 'camldebug-mode)
- (setq current-camldebug-buffer (current-buffer))
- (save-selected-window (pop-to-buffer current-camldebug-buffer))))
-
-;;; Filter and sentinel.
-
-(defun camldebug-marker-filter (string)
- (setq camldebug-filter-accumulator
- (concat camldebug-filter-accumulator string))
- (let ((output "") (begin))
- ;; Process all the complete markers in this chunk.
- (while (setq begin
- (string-match
- "\032\032\\(H\\|M\\(.+\\):\\(.+\\):\\(.+\\):\\(before\\|after\\)\\)\n"
- camldebug-filter-accumulator))
- (setq camldebug-last-frame
- (if (char-equal ?H (aref camldebug-filter-accumulator
- (1+ (1+ begin)))) nil
- (let ((isbefore
- (string= "before"
- (match-string 5 camldebug-filter-accumulator)))
- (startpos (string-to-int
- (match-string 3 camldebug-filter-accumulator)))
- (endpos (string-to-int
- (match-string 4 camldebug-filter-accumulator))))
- (list (match-string 2 camldebug-filter-accumulator)
- (if isbefore startpos endpos)
- isbefore
- startpos
- endpos
- )))
- output (concat output
- (substring camldebug-filter-accumulator
- 0 begin))
- ;; Set the accumulator to the remaining text.
- camldebug-filter-accumulator (substring
- camldebug-filter-accumulator
- (match-end 0))
- camldebug-last-frame-displayed-p nil))
-
- ;; Does the remaining text look like it might end with the
- ;; beginning of another marker? If it does, then keep it in
- ;; camldebug-filter-accumulator until we receive the rest of it. Since we
- ;; know the full marker regexp above failed, it's pretty simple to
- ;; test for marker starts.
- (if (string-match "\032.*\\'" camldebug-filter-accumulator)
- (progn
- ;; Everything before the potential marker start can be output.
- (setq output (concat output (substring camldebug-filter-accumulator
- 0 (match-beginning 0))))
-
- ;; Everything after, we save, to combine with later input.
- (setq camldebug-filter-accumulator
- (substring camldebug-filter-accumulator (match-beginning 0))))
-
- (setq output (concat output camldebug-filter-accumulator)
- camldebug-filter-accumulator ""))
-
- output))
-
-(defun camldebug-filter (proc string)
- (let ((output))
- (if (buffer-name (process-buffer proc))
- (let ((process-window))
- (save-excursion
- (set-buffer (process-buffer proc))
- ;; If we have been so requested, delete the debugger prompt.
- (if (marker-buffer camldebug-delete-prompt-marker)
- (progn
- (delete-region (process-mark proc)
- camldebug-delete-prompt-marker)
- (set-marker camldebug-delete-prompt-marker nil)))
- (setq output (funcall camldebug-filter-function string))
- ;; Don't display the specified file unless
- ;; (1) point is at or after the position where output appears
- ;; and (2) this buffer is on the screen.
- (setq process-window (and camldebug-track-frame
- (not camldebug-last-frame-displayed-p)
- (>= (point) (process-mark proc))
- (get-buffer-window (current-buffer))))
- ;; Insert the text, moving the process-marker.
- (comint-output-filter proc output))
- (if process-window
- (save-selected-window
- (select-window process-window)
- (camldebug-display-frame)))))))
-
-(defun camldebug-sentinel (proc msg)
- (cond ((null (buffer-name (process-buffer proc)))
- ;; buffer killed
- ;; Stop displaying an arrow in a source file.
- (camldebug-remove-current-event)
- (set-process-buffer proc nil))
- ((memq (process-status proc) '(signal exit))
- ;; Stop displaying an arrow in a source file.
- (camldebug-remove-current-event)
- ;; Fix the mode line.
- (setq mode-line-process
- (concat ": "
- (symbol-name (process-status proc))))
- (let* ((obuf (current-buffer)))
- ;; save-excursion isn't the right thing if
- ;; process-buffer is current-buffer
- (unwind-protect
- (progn
- ;; Write something in *compilation* and hack its mode line,
- (set-buffer (process-buffer proc))
- ;; Force mode line redisplay soon
- (set-buffer-modified-p (buffer-modified-p))
- (if (eobp)
- (insert ?\n mode-name " " msg)
- (save-excursion
- (goto-char (point-max))
- (insert ?\n mode-name " " msg)))
- ;; If buffer and mode line will show that the process
- ;; is dead, we can delete it now. Otherwise it
- ;; will stay around until M-x list-processes.
- (delete-process proc))
- ;; Restore old buffer, but don't restore old point
- ;; if obuf is the cdb buffer.
- (set-buffer obuf))))))
-
-
-(defun camldebug-refresh (&optional arg)
- "Fix up a possibly garbled display, and redraw the mark."
- (interactive "P")
- (camldebug-display-frame)
- (recenter arg))
-
-(defun camldebug-display-frame ()
- "Find, obey and delete the last filename-and-line marker from Caml debugger.
-The marker looks like \\032\\032FILENAME:CHARACTER\\n.
-Obeying it means displaying in another window the specified file and line."
- (interactive)
- (camldebug-set-buffer)
- (if (not camldebug-last-frame)
- (camldebug-remove-current-event)
- (camldebug-display-line (nth 0 camldebug-last-frame)
- (nth 3 camldebug-last-frame)
- (nth 4 camldebug-last-frame)
- (nth 2 camldebug-last-frame)))
- (setq camldebug-last-frame-displayed-p t))
-
-;; Make sure the file named TRUE-FILE is in a buffer that appears on the screen
-;; and that its character CHARACTER is visible.
-;; Put the mark on this character in that buffer.
-
-(defun camldebug-display-line (true-file schar echar kind)
- (let* ((pre-display-buffer-function nil) ; screw it, put it all in one screen
- (pop-up-windows t)
- (buffer (find-file-noselect true-file))
- (window (display-buffer buffer t))
- (spos) (epos) (pos))
- (save-excursion
- (set-buffer buffer)
- (save-restriction
- (widen)
- (setq spos (+ (point-min) schar))
- (setq epos (+ (point-min) echar))
- (setq pos (if kind spos epos))
- (camldebug-set-current-event spos epos (current-buffer) kind))
- (cond ((or (< pos (point-min)) (> pos (point-max)))
- (widen)
- (goto-char pos))))
- (set-window-point window pos)))
-
-;;; Events.
-
-(defun camldebug-remove-current-event ()
- (if (and (fboundp 'make-overlay) window-system)
- (progn
- (delete-overlay camldebug-overlay-event)
- (delete-overlay camldebug-overlay-under))
- (setq overlay-arrow-position nil)))
-
-(defun camldebug-set-current-event (spos epos buffer before)
- (if window-system
- (if before
- (progn
- (move-overlay camldebug-overlay-event spos (1+ spos) buffer)
- (move-overlay camldebug-overlay-under
- (+ spos 1) epos buffer))
- (move-overlay camldebug-overlay-event (1- epos) epos buffer)
- (move-overlay camldebug-overlay-under spos (- epos 1) buffer))
- (save-excursion
- (set-buffer buffer)
- (goto-char pos)
- (beginning-of-line)
- (move-marker camldebug-event-marker (point))
- (setq overlay-arrow-position camldebug-event-marker))))
-
-;;; Miscellaneous.
-
-(defun camldebug-module-name (filename)
- (substring filename (string-match "\\([^/]*\\)\\.ml$" filename) (match-end 1)))
-
-;;; The camldebug-call function must do the right thing whether its
-;;; invoking keystroke is from the camldebug buffer itself (via
-;;; major-mode binding) or a caml buffer. In the former case, we want
-;;; to supply data from camldebug-last-frame. Here's how we do it:
-
-(defun camldebug-format-command (str)
- (let* ((insource (not (eq (current-buffer) current-camldebug-buffer)))
- (frame (if insource nil camldebug-last-frame)) (result))
- (while (and str (string-match "\\([^%]*\\)%\\([mdcep]\\)" str))
- (let ((key (string-to-char (substring str (match-beginning 2))))
- (cmd (substring str (match-beginning 1) (match-end 1)))
- (subst))
- (setq str (substring str (match-end 2)))
- (cond
- ((eq key ?m)
- (setq subst (camldebug-module-name
- (if insource (buffer-file-name) (nth 0 frame)))))
- ((eq key ?d)
- (setq subst (file-name-directory
- (if insource (buffer-file-name) (nth 0 frame)))))
- ((eq key ?c)
- (setq subst (int-to-string
- (if insource (1- (point)) (nth 1 frame)))))
- ((eq key ?e)
- (setq subst (save-excursion
- (skip-chars-backward "_0-9A-Za-z\277-\377")
- (looking-at "[_0-9A-Za-z\277-\377]*")
- (match-string 0)))))
- (setq result (concat result cmd subst))))
- ;; There might be text left in STR when the loop ends.
- (concat result str)))
-
-(defun camldebug-call (command &optional fmt arg)
- "Invoke camldebug COMMAND displaying source in other window.
-
-Certain %-escapes in FMT are interpreted specially if present.
-These are:
-
- %m module name of current module.
- %d directory of current source file.
- %c number of current character position
- %e text of the caml variable surrounding point.
-
- The `current' source file is the file of the current buffer (if
-we're in a caml buffer) or the source file current at the last break
-or step (if we're in the camldebug buffer), and the `current' module
-name is the filename stripped of any *.ml* suffixes (this assumes the
-usual correspondence between module and file naming is observed). The
-`current' position is that of the current buffer (if we're in a source
-file) or the position of the last break or step (if we're in the
-camldebug buffer).
-
-If ARG is present, it overrides any FMT flags and its string
-representation is simply concatenated with the COMMAND."
-
- ;; Make sure debugger buffer is displayed in a window.
- (camldebug-set-buffer)
- (message "Command: %s" (camldebug-call-1 command fmt arg)))
-
-(defun camldebug-call-1 (command &optional fmt arg)
-
- ;; Record info on the last prompt in the buffer and its position.
- (save-excursion
- (set-buffer current-camldebug-buffer)
- (goto-char (process-mark (get-buffer-process current-camldebug-buffer)))
- (let ((pt (point)))
- (beginning-of-line)
- (if (looking-at comint-prompt-regexp)
- (set-marker camldebug-delete-prompt-marker (point)))))
- (let ((cmd (cond
- (arg (concat command " " (int-to-string arg)))
- (fmt (camldebug-format-command
- (concat command " " fmt)))
- (command))))
- (process-send-string (get-buffer-process current-camldebug-buffer)
- (concat cmd "\n"))
- cmd))
-
-
-(provide 'camldebug)
37 vendor/tuareg/custom-tuareg.el
View
@@ -1,37 +0,0 @@
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;; custom-tuareg.el - Tuareg customization example: Append this file to .emacs.
-
-;; Here is an example of Tuareg variables customization:
-
-(add-hook 'tuareg-mode-hook
- '(lambda ()
- (setq tuareg-lazy-= t)
- ; indent `=' like a standard keyword
- (setq tuareg-lazy-paren t)
- ; indent [({ like standard keywords
- (setq tuareg-in-indent 0)
- ; no indentation after `in' keywords
- (auto-fill-mode 1)
- ; turn on auto-fill minor mode
- (if (featurep 'sym-lock) ; Sym-Lock customization only
- (setq sym-lock-mouse-face-enabled nil))
- ; turn off special face under mouse
- ))
-
-;; If you use Sym-Lock, you could also add some customization code after the
-;; `(require 'sym-lock)' in your `.emacs'
-
-(if (featurep 'sym-lock)
- (setq tuareg-sym-lock-keywords
- '(("<-" 0 1 172 nil) ("->" 0 1 174 nil)
- ;; (":=" 0 1 220 nil)
- ("<=" 0 1 163 nil) (">=" 0 1 179 nil)
- ("<>" 0 1 185 nil) ("==" 0 1 186 nil)
- ("||" 0 1 218 nil) ("&&" 0 1 217 nil)
- ("[^*]\\(\\*\\ nil)\\." 1 8 180 nil)
- ("\\(/\\ nil)\\." 1 3 184 nil)
- ;; (":>" 0 1 202 nil)
- ;; (";;" 0 1 191 nil)
- ("\\<_\\>" 0 3 188 nil) ("\\<sqrt\\>" 0 3 214 nil)
- ("\\<unit\\>" 0 3 198 nil) ("\\<fun\\>" 0 3 108 nil)
- ("\\<or\\>" 0 3 218 nil) ("\\<not\\>" 0 3 216 nil))))
355 vendor/tuareg/sym-lock.el
View
@@ -1,355 +0,0 @@
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;; sym-lock.el - Extension of Font-Lock mode for symbol fontification.
-
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;; Copyright © 1997-2004 Albert Cohen, all rights reserved.
-;; Copying is covered by the GNU General Public License.
-;;
-;; 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.
-
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;; History
-;;
-;; first prototype by wg <wg@cs.tu-berlin.de> 5-96
-;; tweaked by Steve Dunham <dunham@gdl.msu.edu> 5-96
-;; rewritten and enhanced by Albert Cohen <Albert.Cohen@inria.fr> 3-97
-;; new symbol-face format and ergonomy improvement 2-98
-;; major step towards portability and customization 5-98
-;; removed bug with multiple appends in hook by 3-99
-;; removed use-fonts check (due to incomatibilities) 9-00
-;; new after-change/pre-idle policy 6-01
-;; disable M$ Windows (symbol font problem) and fixed movement bug
-;; (incompatibile atomic-extents and paren) 8-01
-;; check for the availability of a symbol font 1-02
-;; patch size inference and use the upper bound (of <= sizes) 1-02
-;; support for custom replacement faces (e.g., for the lambda symbol) 10-04
-
-;; look at the symbol font? check out: xfd -fn '-adobe-symbol-*--14-*'
-
-(require 'cl)
-(require 'font-lock)
-(require 'atomic-extents)
-
-(defvar sym-lock-sym-count 0
- "Counter for internal symbols.")
-
-(defvar sym-lock-ext-start nil "Temporary for atomicization.")
-(make-variable-buffer-local 'sym-lock-ext-start)
-(defvar sym-lock-ext-end nil "Temporary for atomicization.")
-(make-variable-buffer-local 'sym-lock-ext-end)
-
-(defvar sym-lock-font-size nil
- "Default size for Sym-Lock symbol font.")
-(make-variable-buffer-local 'sym-lock-font-size)
-(put 'sym-lock-font-size 'permanent-local t)
-
-(defvar sym-lock-keywords nil
- "Similar to `font-lock-keywords'.")
-(make-variable-buffer-local 'sym-lock-keywords)
-(put 'sym-lock-keywords 'permanent-local t)
-
-(defvar sym-lock-enabled nil
- "Sym-Lock switch.")
-(make-variable-buffer-local 'sym-lock-enabled)
-(put 'sym-lock-enabled 'permanent-local t)
-
-(defvar sym-lock-color (face-foreground 'default)
- "*Sym-Lock default color in `font-lock-use-colors' mode.")
-(make-variable-buffer-local 'sym-lock-color)
-(put 'sym-lock-color 'permanent-local t)
-
-(defvar sym-lock-mouse-face-enabled t
- "Mouse face switch.")
-(make-variable-buffer-local 'sym-lock-mouse-face-enabled)
-(put 'sym-lock-mouse-face-enabled 'permanent-local t)
-
-(defun sym-lock-gen-symbol (&optional prefix)
- "Generate a new internal symbol."
- ;; where is the standard function to do this ?
- (setq sym-lock-sym-count (+ sym-lock-sym-count 1))
- (intern (concat "sym-lock-gen-" (or prefix "")
- (int-to-string sym-lock-sym-count))))
-
-(defun sym-lock-make-symbols-atomic (&optional begin end)
- "Function to make symbol faces atomic."
- (if sym-lock-enabled
- (map-extents
- (lambda (extent maparg)
- (let ((face (extent-face extent)) (ext))
- (if (and face (setq ext (face-property face 'sym-lock-remap)))
- (progn
- (if (numberp ext)
- (set-extent-endpoints
- extent (- (extent-start-position extent) ext)
- (extent-end-position extent)))
- (if ext
- (progn
- (if sym-lock-mouse-face-enabled
- (set-extent-property extent 'mouse-face
- 'default))
- (set-extent-property extent 'atomic t)
- (set-extent-property extent 'start-open t))))))
- nil)
- (current-buffer)
- (if begin (save-excursion (goto-char begin) (beginning-of-line) (point))
- (point-min))
- (if end (save-excursion (goto-char end) (end-of-line) (point))
- (point-max))
- nil nil)))
-
-(defun sym-lock-compute-font-size ()
- "Computes the size of the \"better\" symbol font."
- (let ((num (face-height 'default))
- (size) (minsize)
- (lf (list-fonts "-adobe-symbol-medium-r-normal--*")))
- (setq minsize 8)
- (while lf
- (string-match "-[^-]*-[^-]*-[^-]*-[^-]*-[^-]*-[^-]*-\\([^-]*\\)-.*"
- (car lf))
- (setq size (string-to-number (substring (car lf)
- (match-beginning 1)
- (match-end 1))))
- (if (and (<= size num) (> size minsize))
- (setq minsize size))
- (setq lf (cdr lf)))
- minsize))
-
-(defun sym-lock-enable ()
- "Enable Sym-Lock on this buffer."
- (interactive)
- (if (not (and (fboundp 'console-type)
- (or (eq (console-type) 'x)
- (eq (console-type) 'gtk))
- (sym-lock-look-for-symbol-font)))
- (setq sym-lock-enabled nil)
- ;; X-Window with symbol font
- (if (not sym-lock-keywords)
- (error "No Sym-Lock keywords defined!")
- (setq sym-lock-enabled t)
- (if font-lock-mode
- (progn
- (setq font-lock-keywords nil) ; Font-Lock explicit-defaults bug!
- (font-lock-set-defaults t)
- (font-lock-fontify-buffer)))
- (message "Sym-Lock enabled."))))
-
-(defun sym-lock-disable ()
- "Disable Sym-Lock on this buffer."
- (interactive)
- (if (not sym-lock-keywords)
- (error "No Sym-Lock keywords defined!")
- (setq sym-lock-enabled nil)
- (if font-lock-mode
- (progn
- (setq font-lock-keywords nil) ; Font-Lock explicit-defaults bug!
- (font-lock-set-defaults t)
- (font-lock-fontify-buffer)))
- (message "Sym-Lock disabled.")))
-
-(defvar sym-lock-font-name
- (concat "-adobe-symbol-medium-r-normal--"
- (if sym-lock-font-size sym-lock-font-size
- (number-to-string (sym-lock-compute-font-size)))
- "-*-*-*-p-*-adobe-fontspecific")
- "Name of the font used by Sym-Lock.")
-(make-variable-buffer-local 'sym-lock-font-name)
-(put 'sym-lock-font-name 'permanent-local t)
-
-;;(make-face 'sym-lock-adobe-symbol-face "Face for Sym-Lock symbols")
-;;(set-face-property 'sym-lock-adobe-symbol-face 'font sym-lock-font-name)
-
-(defun sym-lock-look-for-symbol-font ()
- "Returns whether there is a symbol font registred in the font server,
- and sets sym-lock-enabled to false if not."
- (if (list-fonts sym-lock-font-name)
- t
- (setq sym-lock-enabled nil)
- nil))
-
-(defun sym-lock-set-foreground ()
- "Set foreground color of Sym-Lock faces."
- (if (and (boundp 'sym-lock-defaults) sym-lock-defaults)
- (let ((l (car sym-lock-defaults))
- (color (face-foreground 'default) sym-lock-color))
- (if (and (consp l) (eq (car l) 'quote)) (setq l (eval l)))
- (if (symbolp l) (setq l (eval l)))
- (dolist (c l)
- (setq c (nth 2 c))
- (if (consp c) (setq c (eval c)))
- (if (string-match "-adobe-symbol-medium-r-normal-"
- (font-name (face-font c)))
- (set-face-foreground c color))))))
-
-(defun sym-lock-remap-face (pat pos obj atomic face)
- "Make a temporary face which remaps the POS char of PAT to the
-given OBJ under the symbol face and all other characters to
-the empty string. OBJ may either be a string or a character."
- (let* ((name (sym-lock-gen-symbol "face"))
- (table (make-display-table))
- (tface (make-face name "sym-lock-remap-face" t)))
- (fillarray table "")
- (aset table (string-to-char (substring pat (1- pos) pos))
- (if (stringp obj) obj (make-string 1 obj)))
- (if face
- (set-face-parent tface face)
- (set-face-foreground tface sym-lock-color)
- (set-face-property tface 'font sym-lock-font-name))
- (set-face-property tface 'display-table table)
- (set-face-property tface 'sym-lock-remap atomic) ; mark it
- tface
- ;; return face value and not face name
- ;; the temporary face would be otherwise GCed
- ))
-
-(defvar sym-lock-clear-face
- (let* ((name (sym-lock-gen-symbol "face"))
- (table (make-display-table))
- (tface (make-face name "sym-lock-remap-face" t)))
- (fillarray table "")
- (set-face-property tface 'display-table table)
- (set-face-property tface 'sym-lock-remap 1) ; mark it
- tface
- ;; return face value and not face name
- ;; the temporary face would be otherwise GCed
- ))
-
-(defun sym-lock (fl)
- "Create font-lock table entries from a list of (PAT NUM POS OBJ) where
-PAT (at NUM) is substituted by OBJ under the symbol face. The face's extent
-will become atomic."
- (if (not (and (fboundp 'console-type)
- (or (eq (console-type) 'x)
- (eq (console-type) 'gtk))))
- (setq sym-lock-enabled nil)
- ;; X-Window
- (if (sym-lock-look-for-symbol-font)
- (progn
- (message "Computing Sym-Lock faces...")
- (setq sym-lock-keywords (sym-lock-rec fl))
- (setq sym-lock-enabled t)
- (message "Computing Sym-Lock faces... done.")))
- ;; ugly hack to make atomic keywords traversable when
- ;; paren-highlighting is also using post-command-hook...
- ;; it moves atomic-extents post-command-hook to the front
- (remove-hook 'post-command-hook 'atomic-extent-post-hook)
- (add-hook 'post-command-hook 'atomic-extent-post-hook)))
-
-(defun sym-lock-rec (fl)
- (let ((f (car fl)))
- (if f (let* ((pat (car f))
- (pos (caddr f))
- (c (substring pat (1- pos) pos)))
- (if (or (string-match c (substring pat pos (length pat)))
- (string-match c (substring pat 0 (1- pos))))
- (cons (apply 'sym-lock-atom f)
- (cons (apply 'sym-lock-face f)
- (sym-lock-rec (cdr fl))))
- (cons (apply 'sym-lock-atom-face f)
- (sym-lock-rec (cdr fl))))))))
-
-(defun sym-lock-atom-face (pat num pos obj face &optional override)
- "Define an entry for the font-lock table which substitutes PAT (at NUM) by
-OBJ under the symbol face. The face extent WILL become atomic."
- (list pat num (sym-lock-remap-face pat pos obj t face) override))
-
-(defun sym-lock-face (pat num pos obj face &optional override)
- "Define an entry for the font-lock table which substitutes PAT (at NUM) by
-OBJ under symbol face. The face extent will NOT become
-atomic."
- (list (concat "\\(" (substring pat 0 pos) "\\)"
- (substring pat pos (length pat)))
- (1+ num) (sym-lock-remap-face pat pos obj nil face) override))
-
-(defun sym-lock-atom (pat num pos obj face &optional override)
- "Define an entry for the font lock table which substitutes PAT (at NUM) by
-a void face. To build the atom, the face extent will be reshaped from
-\"begin_point\"-1 to \"end_point\"."
- (list (concat (substring pat 0 pos) "\\("
- (substring pat pos (length pat)) "\\)")
- (1+ num) sym-lock-clear-face override))
-
-(defun sym-lock-after-change-function (beg end old-len)
- (when sym-lock-enabled
- (setq sym-lock-ext-start (if sym-lock-ext-start
- (min beg sym-lock-ext-start) beg))
- (setq sym-lock-ext-end (if sym-lock-ext-end
- (max end sym-lock-ext-end) end))))
-
-(defun sym-lock-pre-idle-hook-last ()
- (if sym-lock-enabled
- (condition-case nil
- (when (and sym-lock-enabled sym-lock-ext-start)
- (sym-lock-make-symbols-atomic sym-lock-ext-start sym-lock-ext-end)
- (setq sym-lock-ext-start nil)
- (setq sym-lock-ext-end nil))
- (error (warn "Error caught in `sym-lock-pre-idle-hook-last'")))))
-
-(add-hook 'font-lock-after-fontify-buffer-hook
- 'sym-lock-make-symbols-atomic)
-
-(defun sym-lock-mouse-face-enable ()
- "Enable special face for symbols under mouse."
- (interactive)
- (setq sym-lock-mouse-face-enabled t)
- (if sym-lock-enabled
- (font-lock-fontify-buffer)))
-
-(defun sym-lock-mouse-face-disable ()
- "Disable special face for symbols under mouse."
- (interactive)
- (setq sym-lock-mouse-face-enabled nil)
- (if sym-lock-enabled
- (font-lock-fontify-buffer)))
-
-(defun sym-lock-font-lock-hook ()
- "Function called by `font-lock-mode' for initialization purposes."
- (add-hook 'after-change-functions 'sym-lock-after-change-function)
- (add-hook 'pre-idle-hook 'sym-lock-pre-idle-hook-last t)
- (if (and (featurep 'sym-lock) sym-lock-enabled
- font-lock-defaults (boundp 'sym-lock-keywords))
- (progn
- (sym-lock-patch-keywords)
- (sym-lock-set-foreground))))
-
-(defun font-lock-set-defaults (&optional explicit-defaults)
- (when
- (and
- (featurep 'font-lock)
- (if font-lock-auto-fontify
- (not (memq major-mode font-lock-mode-disable-list))
- (memq major-mode font-lock-mode-enable-list))
- (font-lock-set-defaults-1 explicit-defaults)
- (sym-lock-patch-keywords))
- (turn-on-font-lock)))
-
-(defun sym-lock-patch-keywords ()
- (if (and font-lock-keywords sym-lock-enabled
- (boundp 'sym-lock-keywords)
- (listp (car font-lock-keywords))
- (listp (cdar font-lock-keywords))
- (listp (cddar font-lock-keywords))
- (or (listp (caddar font-lock-keywords))
- (not (string-match
- "sym-lock"
- (symbol-name
- (face-name (cadr (cdar font-lock-keywords))))))))
- (setq font-lock-keywords (append sym-lock-keywords
- font-lock-keywords))) t)
-
-(add-menu-button '("Options" "Syntax Highlighting")
- ["Sym-Lock"
- (if sym-lock-enabled (sym-lock-disable) (sym-lock-enable))
- :style toggle :selected sym-lock-enabled
- :active sym-lock-keywords] "Automatic")
-
-(add-hook 'font-lock-mode-hook 'sym-lock-font-lock-hook)
-
-(provide 'sym-lock)
Please sign in to comment.
Something went wrong with that request. Please try again.