Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

slime as submodule + ignore slime protocol version diffs

  • Loading branch information...
commit ab7f14fe9e0b5ce9812d778efd0aeeb6a4ca5ee1 1 parent c438c77
@mpenet authored
Showing with 4 additions and 51,748 deletions.
  1. +3 −0  .gitmodules
  2. +1 −0  elisp/slime
  3. +0 −7 elisp/slime-2010-09-17/.cvsignore
  4. +0 −19,886 elisp/slime-2010-09-17/ChangeLog
  5. +0 −158 elisp/slime-2010-09-17/HACKING
  6. +0 −181 elisp/slime-2010-09-17/NEWS
  7. +0 −95 elisp/slime-2010-09-17/PROBLEMS
  8. +0 −48 elisp/slime-2010-09-17/README
  9. +0 −3,017 elisp/slime-2010-09-17/contrib/ChangeLog
  10. +0 −30 elisp/slime-2010-09-17/contrib/README
  11. +0 −467 elisp/slime-2010-09-17/contrib/bridge.el
  12. +0 −133 elisp/slime-2010-09-17/contrib/inferior-slime.el
  13. +0 −300 elisp/slime-2010-09-17/contrib/slime-asdf.el
  14. +0 −344 elisp/slime-2010-09-17/contrib/slime-autodoc.el
  15. +0 −34 elisp/slime-2010-09-17/contrib/slime-banner.el
  16. +0 −237 elisp/slime-2010-09-17/contrib/slime-c-p-c.el
  17. +0 −165 elisp/slime-2010-09-17/contrib/slime-clipboard.el
  18. +0 −182 elisp/slime-2010-09-17/contrib/slime-compiler-notes-tree.el
  19. +0 −179 elisp/slime-2010-09-17/contrib/slime-editing-commands.el
  20. +0 −147 elisp/slime-2010-09-17/contrib/slime-enclosing-context.el
  21. +0 −20 elisp/slime-2010-09-17/contrib/slime-fancy-inspector.el
  22. +0 −31 elisp/slime-2010-09-17/contrib/slime-fancy.el
  23. +0 −352 elisp/slime-2010-09-17/contrib/slime-fontifying-fu.el
  24. +0 −587 elisp/slime-2010-09-17/contrib/slime-fuzzy.el
  25. +0 −79 elisp/slime-2010-09-17/contrib/slime-highlight-edits.el
  26. +0 −44 elisp/slime-2010-09-17/contrib/slime-hyperdoc.el
  27. +0 −1,167 elisp/slime-2010-09-17/contrib/slime-indentation.el
  28. +0 −70 elisp/slime-2010-09-17/contrib/slime-mdot-fu.el
  29. +0 −29 elisp/slime-2010-09-17/contrib/slime-media.el
  30. +0 −31 elisp/slime-2010-09-17/contrib/slime-motd.el
  31. +0 −131 elisp/slime-2010-09-17/contrib/slime-mrepl.el
  32. +0 −247 elisp/slime-2010-09-17/contrib/slime-package-fu.el
  33. +0 −440 elisp/slime-2010-09-17/contrib/slime-parse.el
  34. +0 −11 elisp/slime-2010-09-17/contrib/slime-presentation-streams.el
  35. +0 −844 elisp/slime-2010-09-17/contrib/slime-presentations.el
  36. +0 −143 elisp/slime-2010-09-17/contrib/slime-references.el
  37. +0 −1,927 elisp/slime-2010-09-17/contrib/slime-repl.el
  38. +0 −32 elisp/slime-2010-09-17/contrib/slime-sbcl-exts.el
  39. +0 −38 elisp/slime-2010-09-17/contrib/slime-scheme.el
  40. +0 −44 elisp/slime-2010-09-17/contrib/slime-scratch.el
  41. +0 −32 elisp/slime-2010-09-17/contrib/slime-snapshot.el
  42. +0 −220 elisp/slime-2010-09-17/contrib/slime-sprof.el
  43. +0 −107 elisp/slime-2010-09-17/contrib/slime-tramp.el
  44. +0 −98 elisp/slime-2010-09-17/contrib/slime-typeout-frame.el
  45. +0 −97 elisp/slime-2010-09-17/contrib/slime-xref-browser.el
  46. +0 −1,555 elisp/slime-2010-09-17/contrib/swank-arglists.lisp
  47. +0 −214 elisp/slime-2010-09-17/contrib/swank-asdf.lisp
  48. +0 −291 elisp/slime-2010-09-17/contrib/swank-c-p-c.lisp
  49. +0 −69 elisp/slime-2010-09-17/contrib/swank-clipboard.lisp
  50. +0 −869 elisp/slime-2010-09-17/contrib/swank-fancy-inspector.lisp
  51. +0 −625 elisp/slime-2010-09-17/contrib/swank-fuzzy.lisp
  52. +0 −995 elisp/slime-2010-09-17/contrib/swank-goo.goo
  53. +0 −16 elisp/slime-2010-09-17/contrib/swank-hyperdoc.lisp
  54. +0 −86 elisp/slime-2010-09-17/contrib/swank-ikarus.ss
  55. +0 −46 elisp/slime-2010-09-17/contrib/swank-indentation.lisp
  56. +0 −998 elisp/slime-2010-09-17/contrib/swank-jolt.k
  57. +0 −2,174 elisp/slime-2010-09-17/contrib/swank-kawa.scm
  58. +0 −176 elisp/slime-2010-09-17/contrib/swank-larceny.scm
  59. +0 −85 elisp/slime-2010-09-17/contrib/swank-listener-hooks.lisp
  60. +0 −23 elisp/slime-2010-09-17/contrib/swank-media.lisp
  61. +0 −862 elisp/slime-2010-09-17/contrib/swank-mit-scheme.scm
  62. +0 −66 elisp/slime-2010-09-17/contrib/swank-motd.lisp
  63. +0 −62 elisp/slime-2010-09-17/contrib/swank-package-fu.lisp
  64. +0 −320 elisp/slime-2010-09-17/contrib/swank-presentation-streams.lisp
  65. +0 −237 elisp/slime-2010-09-17/contrib/swank-presentations.lisp
  66. +0 −416 elisp/slime-2010-09-17/contrib/swank-r6rs.scm
  67. +0 −54 elisp/slime-2010-09-17/contrib/swank-sbcl-exts.lisp
  68. +0 −68 elisp/slime-2010-09-17/contrib/swank-snapshot.lisp
  69. +0 −141 elisp/slime-2010-09-17/contrib/swank-sprof.lisp
  70. +0 −385 elisp/slime-2010-09-17/contrib/swank.rb
  71. +0 −15 elisp/slime-2010-09-17/doc/.cvsignore
  72. +0 −9 elisp/slime-2010-09-17/doc/CVS/Entries
  73. +0 −1  elisp/slime-2010-09-17/doc/CVS/Repository
  74. +0 −1  elisp/slime-2010-09-17/doc/CVS/Root
  75. +0 −108 elisp/slime-2010-09-17/doc/Makefile
  76. BIN  elisp/slime-2010-09-17/doc/slime-refcard.pdf
  77. +0 −123 elisp/slime-2010-09-17/doc/slime-refcard.tex
  78. +0 −995 elisp/slime-2010-09-17/doc/slime-small.eps
  79. BIN  elisp/slime-2010-09-17/doc/slime-small.pdf
  80. +0 −3,326 elisp/slime-2010-09-17/doc/slime.texi
  81. +0 −21 elisp/slime-2010-09-17/doc/texinfo-tabulate.awk
  82. +0 −1,742 elisp/slime-2010-09-17/hyperspec.el
  83. +0 −1,227 elisp/slime-2010-09-17/metering.lisp
  84. +0 −17 elisp/slime-2010-09-17/mkdist.sh
  85. +0 −523 elisp/slime-2010-09-17/nregex.lisp
  86. +0 −332 elisp/slime-2010-09-17/sbcl-pprint-patch.lisp
  87. +0 −44 elisp/slime-2010-09-17/slime-autoloads.el
Sorry, we could not display the entire diff because it was too big.
View
3  .gitmodules
@@ -10,3 +10,6 @@
[submodule "elisp/elein"]
path = elisp/elein
url = https://github.com/remvee/elein.git
+[submodule "elisp/slime"]
+ path = elisp/slime
+ url = https://github.com/technomancy/slime.git
1  elisp/slime
@@ -0,0 +1 @@
+Subproject commit c27dd18db765c005bbdac9044b8ab513805e7e75
View
7 elisp/slime-2010-09-17/.cvsignore
@@ -1,7 +0,0 @@
-*.x86f
-*.fasl
-*.dfsl
-*.lx64fsl
-*.elc
-_darcs
-.DS_Store
View
19,886 elisp/slime-2010-09-17/ChangeLog
0 additions, 19,886 deletions not shown
View
158 elisp/slime-2010-09-17/HACKING
@@ -1,158 +0,0 @@
-* The SLIME Hacker's Handbook -*- outline -*-
-
-* Lisp code file structure
-
-The Lisp code is organised into these files:
-
- swank-backend.lisp:
- Definition of the interface to non-portable features.
- Stand-alone.
-
- swank-<cmucl|...>.lisp:
- Backend implementation for a specific Common Lisp system.
- Uses swank-backend.lisp.
-
- swank.lisp:
- The top-level server program, built from the other components.
- Uses swank-backend.lisp as an interface to the actual backends.
-
- slime.el:
- The Superior Lisp Inferior Mode for Emacs, i.e. the Emacs frontend
- that the user actually interacts with and that connects to the
- SWANK server to send expressions to, and retrieve information from
- the running Common Lisp system.
-
- contrib/*.lisp:
- Lisp related code for add-ons to SLIME that are maintained by
- their respective authors. Consult contrib/README for more
- information.
-
-* ChangeLog
-
-For each change we make an entry in the ChangeLog file. This is
-typically done using the command `add-change-log-entry-other-window'
-(C-x 4 a). The message can be automatically extracted from the
-ChangeLog to use in a CVS commit message by pressing C-c C-a in a
-vc-mode or pcl-cvs commit buffer.
-
-ChangeLog diffs are automatically sent to the slime-devel mailing list
-each day as a sort of digest summary of the slime-cvs list.
-
-There are good tips on writing ChangeLog entries in the GNU Coding Standards:
- http://www.gnu.org/prep/standards/html_node/Style-of-Change-Logs.html#Style-of-Change-Logs
-
-For information about Emacs's ChangeLog support see the `Change Log'
-and `Change Logs and VC' nodes of the Emacs manual:
- http://www.gnu.org/software/emacs/manual/html_node/emacs/Change-Log.html#Change-Log
- http://www.gnu.org/software/emacs/manual/html_node/emacs/Change-Logs-and-VC.html#Change-Logs-and-VC
-
-
-* Sending Patches
-
-If you would like to send us improvements you can create a patch with
-C-x v = in the buffer or manually with 'cvs diff -u'. It's helpful if
-you also include a ChangeLog entry describing your change.
-
-* Test Suite
-
-The Elisp code includes a command `slime-run-tests' to run a test
-suite. This can give a pretty good sanity-check for your changes.
-
-Some backends do not pass the full test suite because of missing
-features. In these cases the test suite is still useful to ensure that
-changes don't introduce new errors. CMUCL historically passes the full
-test suite so it makes a good sanity check for fundamental changes
-(e.g. to the protocol).
-
-Running the test suite, adding new cases, and increasing the number of
-cases that backends support are all very good for karma.
-
-
-* Source code layout
-
-We use a special source file layout to take advantage of some fancy
-Emacs features: outline-mode and "narrowing".
-
-** Outline structure
-
-Our source files have a hierarchical structure using comments like
-these:
-
- ;;;; Heading
- ;;;;; Subheading
- ... etc
-
-We do this as a nice way to structure the program. We try to keep each
-(sub)section small enough to fit in your head: typically around 50-200
-lines of code each. Each section usually begins with a brief
-introduction, followed by its highest-level functions, followed by
-their subroutines. This is a pleasing shape for a source file to have.
-
-Of course the comments mean something to Emacs too. One handy usage is
-to bring up a hyperlinked "table of contents" for the source file
-using this command:
-
- (defun show-outline-structure ()
- "Show the outline-mode structure of the current buffer."
- (interactive)
- (occur (concat "^" outline-regexp)))
-
-Another is to use `outline-minor-mode' to fold away certain parts of
-the buffer. See the `Outline Mode' section of the Emacs manual for
-details about that.
-
-(This file is also formatted for outline mode. If you're reading in
-Emacs you can play around e.g. by pressing `C-c C-d' right now.)
-
-** Pagebreak characters (^L)
-
-We partition source files into chunks using pagebreak characters. Each
-chunk is a substantial piece of code that can be considered in
-isolation, that could perhaps be a separate source file if we were
-fanatical about small source files (rather than big ones!)
-
-The page breaks usually go in the same place as top-level outline-mode
-headings, but they don't have to. They're flexible.
-
-In the old days, when slime.el was less than 100 pages long, these
-page breaks were helpful when printing it out to read. Now they're
-useful for something else: narrowing.
-
-You can use `C-x n p' (narrow-to-page) to "zoom in" on a
-pagebreak-delimited section of the file as if it were a separate
-buffer in itself. You can then use `C-x n w' (widen) to "zoom out" and
-see the whole file again. This is tremendously helpful for focusing
-your attention on one part of the program as if it were its own file.
-
-(This file contains some page break characters. If you're reading in
-Emacs you can press `C-x n p' to narrow to this page, and then later
-`C-x n w' to make the whole buffer visible again.)
-
-
-* Coding style
-
-We like the fact that each function in SLIME will fit on a single
-screen (80x20), and would like to preserve this property! Beyond that
-we're not dogmatic :-)
-
-In early discussions we all made happy noises about the advice in
-Norvig and Pitman's _Tutorial on Good Lisp Programming Style_:
- http://www.norvig.com/luv-slides.ps
-
-For Emacs Lisp, we try to follow the _Tips and Conventions_ in
-Appendix D of the GNU Emacs Lisp Reference Manual (see Info file
-`elisp', node `Tips').
-
-We use Emacs conventions for docstrings: the first line should be a
-complete sentence to make the output of `apropos' look good. We also
-use imperative verbs.
-
-The biggest problem with SLIME's code base is feature creep. Keep in
-mind that the Right Thing isn't always the Smart Thing. If you can't
-find an elegant solution to a problem then you're probably solving the
-wrong problem. It's often a good idea to simplify the problem and to
-ignore rarely needed cases.
-
-Remember that to rewrite a program better is the sincerest form of
-code appreciation. When you can see a way to rewrite a part of SLIME
-better, please do so!
View
181 elisp/slime-2010-09-17/NEWS
@@ -1,181 +0,0 @@
-* SLIME News -*- outline -*-
-
-* 3.0 (not released yet)
-
-** REPL no longer loaded by default
-SLIME has a REPL which communicates exclusively over SLIME's socket.
-This REPL is no longer loaded by default. The default REPL is now the
-one by the Lisp implementation in the *inferior-lisp* buffer. The
-simplest way to enable the old REPL is:
-
- (slime-setup '(slime-repl))
-
-** Precise source tracking in Clozure CL
-Recent versions of the CCL compiler support source-location tracking.
-This makes the sldb-show-source command much more useful and M-. works
-better too.
-
-** Environment variables for Lisp process
-slime-lisp-implementations can be used to specify a list of strings to
-augment the process environment of the Lisp process. E.g.:
-
- (sbcl-cvs
- ("/home/me/sbcl-cvs/src/runtime/sbcl"
- "--core" "/home/me/sbcl-cvs/output/sbcl.core")
- :env ("SBCL_HOME=/home/me/sbcl-cvs/contrib/"))
-
-** Removed Features
-Some of the more esoteric features, like presentations or fuzzy
-completion, are no longer enabled by default. A new directory
-"contrib/" contains the code for these packages. To use them, you
-must make some changes to your ~/.emacs. For details see, section
-"Contributed Packages" in the manual.
-
-** Stepper
-Juho Snellman implemented stepping commands for SBCL.
-
-** Completions
-SLIME can now complete keywords and character names (like #\newline).
-
-* 2.0 (April 2006)
-
-** In-place macro expansion
-Marco Baringer wrote a new minor mode to incrementally expand macros.
-
-** Improved arglist display
-SLIME now recognizes `make-instance' calls and displays the correct
-arglist if the classname is present. Similarly, for `defmethod' forms
-SLIME displays the arguments of the generic function.
-
-** Persistent REPL history
-SLIME now saves the command history from REPL buffers in a file and
-reloads it for newly created REPL buffers.
-
-** Scieneer Common Lisp
-Douglas Crosher added support for Scieneer Common Lisp.
-
-** SBCL
-Various improvements to make SLIME work well with current SBCL versions.
-
-** Corman Common Lisp
-Espen Wiborg added support for Corman Common Lisp.
-
-** Presentations
-A new feature which associates objects in Lisp with their textual
-represetation in Emacs. The text is clickable and operations on the
-associated object can be invoked from a pop-up menu.
-
-** Security
-SLIME has now a simple authentication mechanism: if the file
-~/.slime-secret exists we verify that Emacs and Lisp can access it.
-Since both parties have access to the same file system, we assume that
-we can trust each other.
-
-* 1.2 (March 2005)
-
-** New inspector
-The lisp side now returns a specially formated list of "things" to
-format which are then passed to emacs and rendered in the inspector
-buffer. Things can be either text, recursivly inspectable values, or
-functions to call. The new inspector has much better support CLOS
-objects and methods.
-
-** Unicode
-It's now possible to send non-ascii characters to Emacs, if the
-communication channel is configured properly. See the variable
-`slime-net-coding-system'.
-
-** Arglist lookup while debugging
-Previously, arglist lookup was disabled while debugging. This
-restriction was removed.
-
-** Extended tracing command
-It's now possible to trace individual a single methods or all methods
-of a generic function. Also tracing can be restricted to situations
-in which the traced function is called from a specific function.
-
-** M-x slime-browse-classes
-A simple class browser was added.
-
-** FASL files
-The fasl files for different Lisp/OS/hardware combinations are now
-placed in different directories.
-
-** Many other small improvements and bugfixes
-
-* 1.0 (September 2004)
-
-** slime-interrupt
-The default key binding for slime-interrupt is now C-c C-b.
-
-** sldb-inspect-condition
-In SLDB 'C' is now bound to sldb-inspect-condition.
-
-** More Menus
-SLDB and the REPL have now pull-down menus.
-
-** Global debugger hook.
-A new configurable *global-debugger* to control whether
-swank-debugger-hook should be installed globally is available. True by
-default.
-
-** When you call sldb-eval-in-frame with a prefix argument, the result is
-now inserted in the REPL buffer.
-
-** Compile function
-For Allegro M-. works now for functions compiled with C-c C-c.
-
-** slime-edit-definition
-Better support for Allegro: works now for different type of
-definitions not only. So M-. now works for e.g. classes in Allegro.
-
-** SBCL 0.8.13
-SBCL 0.8.12 is no longer supported. Support for 0.8.12 was broken for
-for some time now.
-
-* 1.0 beta (August 2004)
-
-** autodoc global variables
-The slime-autodoc-mode will now automatically show the value of a
-global variable at point.
-
-** Customize group
-The customize group is expanded and better-organised.
-
-** slime-interactive-eval
-Interactive-eval commands now print their results to the REPL when
-given a prefix argument.
-
-** slime-conservative-indentation
-New Elisp variable. Non-nil means that we exclude def* and with-* from
-indentation-learning. The default is t.
-
-** (slime-setup)
-New function to streamline setup in ~/.emacs
-
-** Modeline package
-The package name in the modeline is now updated on an idle timer. The
-message should now be more meaningful when moving around in files
-containing multiple IN-PACKAGE forms.
-
-** XREF bugfix
-The XREF commands did not find symbols in the right package.
-
-** REPL prompt
-The package name in the REPL's prompt is now abbreviated to the last
-`.'-delimited token, e.g. MY.COMPANY.PACKAGE would be PACKAGE. This
-can be disabled by setting SWANK::*AUTO-ABBREVIATE-DOTTED-PACKAGES* to
-NIL.
-
-** CMUCL source cache
-The source cache is now populated on `first-change-hook'. This makes
-M-. work accurately in more file modification scenarios.
-
-** SBCL compiler errors
-Detect compiler errors and make some noise. Previously certain
-problems (e.g. reader-errors) could slip by quietly.
-
-* 1.0 alpha (June 2004)
-
-The first preview release of SLIME.
-
View
95 elisp/slime-2010-09-17/PROBLEMS
@@ -1,95 +0,0 @@
-Known problems with SLIME -*- outline -*-
-
-* Common to all backends
-
-** Caution: network security
-The `M-x slime' command has Lisp listen on a TCP socket and wait for
-Emacs to connect, which typically takes on the order of one second. If
-someone else were to connect to this socket then they could use the
-SLIME protocol to control the Lisp process.
-
-The listen socket is bound on the loopback interface in all Lisps that
-support this. This way remote hosts are unable to connect.
-
-** READ-CHAR-NO-HANG is broken
-
-READ-CHAR-NO-HANG doesn't work properly for slime-input-streams. Due
-to the way we request input from Emacs it's not possible to repeatedly
-poll for input. To get any input you have to call READ-CHAR (or a
-function which calls READ-CHAR).
-
-* Backend-specific problems
-
-** CMUCL
-
-The default communication style :SIGIO is reportedly unreliable with
-certain libraries (like libSDL) and certain platforms (like Solaris on
-Sparc). It generally works very well on x86 so it remains the default.
-
-** SBCL
-
-The latest released version of SBCL at the time of packaging should
-work. Older or newer SBCLs may or may not work. Do not use
-multithreading with unpatched 2.4 Linux kernels. There are also
-problems with kernel versions 2.6.5 - 2.6.10.
-
-The (v)iew-source command in the debugger can only locate exact source
-forms for code compiled at (debug 2) or higher. The default level is
-lower and SBCL itself is compiled at a lower setting. Thus only
-defun-granularity is available with default policies.
-
-The XREF commands are not implemented.
-
-** OpenMCL
-
-We support OpenMCL 0.14.3.
-
-The XREF commands are not available.
-
-** LispWorks
-
-On Windows, SLIME hangs when calling foreign functions or certain
-other functions. The reason for this problem is unknown.
-
-We only support latin1 encoding. (Unicode wouldn't be hard to add.)
-
-** Allegro CL
-
-Interrupting Allegro with C-c C-b can be slow. This is caused by the
-a relatively large process-quantum: 2 seconds by default. Allegro
-responds much faster if mp:*default-process-quantum* is set to 0.1.
-
-** CLISP
-
-We require version 2.33.2 or higher. We also require socket support, so
-you may have to start CLISP with "clisp -K full".
-
-Under Windows, interrupting (with C-c C-b) doesn't work. Emacs sends
-a SIGINT signal, but the signal is either ignored or CLISP exits
-immediately.
-
-Function arguments and local variables aren't displayed properly in
-the backtrace. Changes to CLISP's C code are needed to fix this
-problem. Interpreted code is usually easer to debug.
-
-M-. (find-definition) only works if the fasl file is in the same
-directory as the source file.
-
-The arglist doesn't include the proper names only "fake symbols" like
-`arg1'.
-
-** Armed Bear Common Lisp
-
-The ABCL support is still new and experimental.
-
-** Corman Common Lisp
-
-We require version 2.51 or higher, with several patches (available at
-http://www.grumblesmurf.org/lisp/corman-patches).
-
-The only communication style currently supported is NIL.
-
-Interrupting (with C-c C-b) doesn't work.
-
-The tracing, stepping and XREF commands are not implemented along with
-some debugger functionality.
View
48 elisp/slime-2010-09-17/README
@@ -1,48 +0,0 @@
-Overview.
-----------------------------------------
-
- SLIME is the Superior Lisp Interaction Mode for Emacs. It is
- implemented in two main parts: the Emacs Lisp side (slime.el), and
- the support library for the Common Lisp (swank.lisp and swank-*.lisp)
-
- For a real description, see the manual in doc/
-
-Quick setup instructions
-------------------------
-
- Add this to your ~/.emacs file and fill in the appropriate filenames:
-
- (add-to-list 'load-path "~/hacking/lisp/slime/") ; your SLIME directory
- (setq inferior-lisp-program "/opt/sbcl/bin/sbcl") ; your Lisp system
- (require 'slime)
- (slime-setup)
-
- Make sure your `inferior-lisp-program' is set to a compatible
- version of Lisp.
-
- The function `slime-setup' can also load additional, contributed
- packages ("contribs"). The most-often used package is
- slime-fancy.el, which primarily installs a popular set of other
- contributed packages. It includes a better REPL, and many more nice
- features. To load it, change the bare (slime-setup) form above to
- (slime-setup '(slime-fancy)).
-
- Use `M-x' slime to fire up and connect to an inferior Lisp.
- SLIME will now automatically be available in your Lisp source
- buffers.
-
-Licence.
-----------------------------------------
-
- SLIME is free software. All files, unless explicitly stated
- otherwise, are public domain.
-
-Contact.
-----------------------------------------
-
- Questions and comments are best directed to the mailing list:
- http://common-lisp.net/mailman/listinfo/slime-devel
-
- The mailing list archive is also available on Gmane:
- http://news.gmane.org/gmane.lisp.slime.devel
-
View
3,017 elisp/slime-2010-09-17/contrib/ChangeLog
0 additions, 3,017 deletions not shown
View
30 elisp/slime-2010-09-17/contrib/README
@@ -1,30 +0,0 @@
-This directory contains source code which may be useful to some Slime
-users. *.el files are Emacs Lisp source and *.lisp files contain
-Common Lisp source code. If not otherwise stated in the file itself,
-the files are placed in the Public Domain.
-
-The components in this directory are more or less detached from the
-rest of Slime. They are essentially "add-ons". But Slime can also be
-used without them. The code is maintained by the respective authors.
-
-To use the packages here, you should add this directory to your Emacs
-load-path, require the contrib, and call the contrib's init function to
-enable the functionality that's provided by the respective contrib.
-
-E.g. for fuzzy completion add this to your .emacs:
-
- (add-to-list 'load-path "<this-directory>")
- (add-hook 'slime-load-hook (lambda () (require 'slime-fuzzy)
- (slime-fuzzy-init)))
-
-Alternatively, you can use the `slime-setup' function which takes a
-list of contrib names, and which loads and enables them automatically
-for you:
-
- (slime-setup '(slime-fancy slime-asdf slime-tramp ...))
-
-
-Finally, the contrib `slime-fancy' is specially noteworthy, as it
-represents a meta-contrib that'll load a bunch of commonly used
-contribs. Look into `slime-fancy.el' to find out which.
-
View
467 elisp/slime-2010-09-17/contrib/bridge.el
@@ -1,467 +0,0 @@
-;;; -*-Emacs-Lisp-*-
-;;;%Header
-;;; Bridge process filter, V1.0
-;;; Copyright (C) 1991 Chris McConnell, ccm@cs.cmu.edu
-;;;
-;;; Send mail to ilisp@cons.org if you have problems.
-;;;
-;;; Send mail to majordomo@cons.org if you want to be on the
-;;; ilisp mailing list.
-
-;;; This file is part of GNU Emacs.
-
-;;; GNU Emacs is distributed in the hope that it will be useful,
-;;; but WITHOUT ANY WARRANTY. No author or distributor
-;;; accepts responsibility to anyone for the consequences of using it
-;;; or for whether it serves any particular purpose or works at all,
-;;; unless he says so in writing. Refer to the GNU Emacs General Public
-;;; License for full details.
-
-;;; Everyone is granted permission to copy, modify and redistribute
-;;; GNU Emacs, but only under the conditions described in the
-;;; GNU Emacs General Public License. A copy of this license is
-;;; supposed to have been given to you along with GNU Emacs so you
-;;; can know your rights and responsibilities. It should be in a
-;;; file named COPYING. Among other things, the copyright notice
-;;; and this notice must be preserved on all copies.
-
-;;; Send any bugs or comments. Thanks to Todd Kaufmann for rewriting
-;;; the process filter for continuous handlers.
-
-;;; USAGE: M-x install-bridge will add a process output filter to the
-;;; current buffer. Any output that the process does between
-;;; bridge-start-regexp and bridge-end-regexp will be bundled up and
-;;; passed to the first handler on bridge-handlers that matches the
-;;; output using string-match. If bridge-prompt-regexp shows up
-;;; before bridge-end-regexp, the bridge will be cancelled. If no
-;;; handler matches the output, the first symbol in the output is
-;;; assumed to be a buffer name and the rest of the output will be
-;;; sent to that buffer's process. This can be used to communicate
-;;; between processes or to set up two way interactions between Emacs
-;;; and an inferior process.
-
-;;; You can write handlers that process the output in special ways.
-;;; See bridge-send-handler for the default handler. The command
-;;; hand-bridge is useful for testing. Keep in mind that all
-;;; variables are buffer local.
-
-;;; YOUR .EMACS FILE:
-;;;
-;;; ;;; Set up load path to include bridge
-;;; (setq load-path (cons "/bridge-directory/" load-path))
-;;; (autoload 'install-bridge "bridge" "Install a process bridge." t)
-;;; (setq bridge-hook
-;;; '(lambda ()
-;;; ;; Example options
-;;; (setq bridge-source-insert nil) ;Don't insert in source buffer
-;;; (setq bridge-destination-insert nil) ;Don't insert in dest buffer
-;;; ;; Handle copy-it messages yourself
-;;; (setq bridge-handlers
-;;; '(("copy-it" . my-copy-handler)))))
-
-;;; EXAMPLE:
-;;; # This pipes stdin to the named buffer in a Unix shell
-;;; alias devgnu '(echo -n "\!* "; cat -; echo -n "")'
-;;;
-;;; ls | devgnu *scratch*
-
-(eval-when-compile
- (require 'cl))
-
-;;;%Parameters
-(defvar bridge-hook nil
- "Hook called when a bridge is installed by install-hook.")
-
-(defvar bridge-start-regexp ""
- "*Regular expression to match the start of a process bridge in
-process output. It should be followed by a buffer name, the data to
-be sent and a bridge-end-regexp.")
-
-(defvar bridge-end-regexp ""
- "*Regular expression to match the end of a process bridge in process
-output.")
-
-(defvar bridge-prompt-regexp nil
- "*Regular expression for detecting a prompt. If there is a
-comint-prompt-regexp, it will be initialized to that. A prompt before
-a bridge-end-regexp will stop the process bridge.")
-
-(defvar bridge-handlers nil
- "Alist of (regexp . handler) for handling process output delimited
-by bridge-start-regexp and bridge-end-regexp. The first entry on the
-list whose regexp matches the output will be called on the process and
-the delimited output.")
-
-(defvar bridge-source-insert t
- "*T to insert bridge input in the source buffer minus delimiters.")
-
-(defvar bridge-destination-insert t
- "*T for bridge-send-handler to insert bridge input into the
-destination buffer minus delimiters.")
-
-(defvar bridge-chunk-size 512
- "*Long inputs send to comint processes are broken up into chunks of
-this size. If your process is choking on big inputs, try lowering the
-value.")
-
-;;;%Internal variables
-(defvar bridge-old-filter nil
- "Old filter for a bridged process buffer.")
-
-(defvar bridge-string nil
- "The current output in the process bridge.")
-
-(defvar bridge-in-progress nil
- "The current handler function, if any, that bridge passes strings on to,
-or nil if none.")
-
-(defvar bridge-leftovers nil
- "Because of chunking you might get an incomplete bridge signal - start but the end is in the next packet. Save the overhanging text here.")
-
-(defvar bridge-send-to-buffer nil
- "The buffer that the default bridge-handler (bridge-send-handler) is
-currently sending to, or nil if it hasn't started yet. Your handler
-function can use this variable also.")
-
-(defvar bridge-last-failure ()
- "Last thing that broke the bridge handler. First item is function call
-(eval'able); last item is error condition which resulted. This is provided
-to help handler-writers in their debugging.")
-
-;;;%Utilities
-(defun bridge-insert (output)
- "Insert process OUTPUT into the current buffer."
- (if output
- (let* ((buffer (current-buffer))
- (process (get-buffer-process buffer))
- (mark (process-mark process))
- (window (selected-window))
- (at-end nil))
- (if (eq (window-buffer window) buffer)
- (setq at-end (= (point) mark))
- (setq window (get-buffer-window buffer)))
- (save-excursion
- (goto-char mark)
- (insert output)
- (set-marker mark (point)))
- (if window
- (progn
- (if at-end (goto-char mark))
- (if (not (pos-visible-in-window-p (point) window))
- (let ((original (selected-window)))
- (save-excursion
- (select-window window)
- (recenter '(center))
- (select-window original)))))))))
-
-;;;
-;(defun bridge-send-string (process string)
-; "Send PROCESS the contents of STRING as input.
-;This is equivalent to process-send-string, except that long input strings
-;are broken up into chunks of size comint-input-chunk-size. Processes
-;are given a chance to output between chunks. This can help prevent processes
-;from hanging when you send them long inputs on some OS's."
-; (let* ((len (length string))
-; (i (min len bridge-chunk-size)))
-; (process-send-string process (substring string 0 i))
-; (while (< i len)
-; (let ((next-i (+ i bridge-chunk-size)))
-; (accept-process-output)
-; (process-send-string process (substring string i (min len next-i)))
-; (setq i next-i)))))
-
-;;;
-(defun bridge-call-handler (handler proc string)
- "Funcall HANDLER on PROC, STRING carefully. Error is caught if happens,
-and user is signaled. State is put in bridge-last-failure. Returns t if
-handler executed without error."
- (let ((inhibit-quit nil)
- (failed nil))
- (condition-case err
- (funcall handler proc string)
- (error
- (ding)
- (setq failed t)
- (message "bridge-handler \"%s\" failed %s (see bridge-last-failure)"
- handler err)
- (setq bridge-last-failure
- `((funcall ',handler ',proc ,string)
- "Caused: "
- ,err))))
- (not failed)))
-
-;;;%Handlers
-(defun bridge-send-handler (process input)
- "Send PROCESS INPUT to the buffer name found at the start of the
-input. The input after the buffer name is sent to the buffer's
-process if it has one. If bridge-destination-insert is T, the input
-will be inserted into the buffer. If it does not have a process, it
-will be inserted at the end of the buffer."
- (if (null input)
- (setq bridge-send-to-buffer nil) ; end of bridge
- (let (buffer-and-start buffer-name dest to)
- ;; if this is first time, get the buffer out of the first line
- (cond ((not bridge-send-to-buffer)
- (setq buffer-and-start (read-from-string input)
- buffer-name (format "%s" (car (read-from-string input)))
- dest (get-buffer buffer-name)
- to (get-buffer-process dest)
- input (substring input (cdr buffer-and-start)))
- (setq bridge-send-to-buffer dest))
- (t
- (setq buffer-name bridge-send-to-buffer
- dest (get-buffer buffer-name)
- to (get-buffer-process dest)
- )))
- (if dest
- (let ((buffer (current-buffer)))
- (if bridge-destination-insert
- (unwind-protect
- (progn
- (set-buffer dest)
- (if to
- (bridge-insert process input)
- (goto-char (point-max))
- (insert input)))
- (set-buffer buffer)))
- (if to
- ;; (bridge-send-string to input)
- (process-send-string to input)
- ))
- (error "%s is not a buffer" buffer-name)))))
-
-;;;%Filter
-(defun bridge-filter (process output)
- "Given PROCESS and some OUTPUT, check for the presence of
-bridge-start-regexp. Everything prior to this will be passed to the
-normal filter function or inserted in the buffer if it is nil. The
-output up to bridge-end-regexp will be sent to the first handler on
-bridge-handlers that matches the string. If no handlers match, the
-input will be sent to bridge-send-handler. If bridge-prompt-regexp is
-encountered before the bridge-end-regexp, the bridge will be cancelled."
- (let ((inhibit-quit t)
- (match-data (match-data))
- (buffer (current-buffer))
- (process-buffer (process-buffer process))
- (case-fold-search t)
- (start 0) (end 0)
- function
- b-start b-start-end b-end)
- (set-buffer process-buffer) ;; access locals
-
- ;; Handle bridge messages that straddle a packet by prepending
- ;; them to this packet.
-
- (when bridge-leftovers
- (setq output (concat bridge-leftovers output))
- (setq bridge-leftovers nil))
-
- (setq function bridge-in-progress)
-
- ;; How it works:
- ;;
- ;; start, end delimit the part of string we are interested in;
- ;; initially both 0; after an iteration we move them to next string.
-
- ;; b-start, b-end delimit part of string to bridge (possibly whole string);
- ;; this will be string between corresponding regexps.
-
- ;; There are two main cases when we come into loop:
-
- ;; bridge in progress
- ;;0 setq b-start = start
- ;;1 setq b-end (or end-pattern end)
- ;;4 process string
- ;;5 remove handler if end found
-
- ;; no bridge in progress
- ;;0 setq b-start if see start-pattern
- ;;1 setq b-end if bstart to (or end-pattern end)
- ;;2 send (substring start b-start) to normal place
- ;;3 find handler (in b-start, b-end) if not set
- ;;4 process string
- ;;5 remove handler if end found
-
- ;; equivalent sections have the same numbers here;
- ;; we fold them together in this code.
-
- (block bridge-filter
- (unwind-protect
- (while (< end (length output))
-
- ;;0 setq b-start if find
- (setq b-start
- (cond (bridge-in-progress
- (setq b-start-end start)
- start)
- ((string-match bridge-start-regexp output start)
- (setq b-start-end (match-end 0))
- (match-beginning 0))
- (t nil)))
- ;;1 setq b-end
- (setq b-end
- (if b-start
- (let ((end-seen (string-match bridge-end-regexp
- output b-start-end)))
- (if end-seen (setq end (match-end 0)))
-
- end-seen)))
-
- ;; Detect and save partial bridge messages
- (when (and b-start b-start-end (not b-end))
- (setq bridge-leftovers (substring output b-start))
- )
-
- (if (and b-start (not b-end))
- (setq end b-start)
- (if (not b-end)
- (setq end (length output))))
-
- ;;1.5 - if see prompt before end, remove current
- (if (and b-start b-end)
- (let ((prompt (string-match bridge-prompt-regexp
- output b-start-end)))
- (if (and prompt (<= (match-end 0) b-end))
- (setq b-start nil ; b-start-end start
- b-end start
- end (match-end 0)
- bridge-in-progress nil
- ))))
-
- ;;2 send (substring start b-start) to old filter, if any
- (when (not (equal start (or b-start end))) ; don't bother on empty string
- (let ((pass-on (substring output start (or b-start end))))
- (if bridge-old-filter
- (let ((old bridge-old-filter))
- (store-match-data match-data)
- (funcall old process pass-on)
- ;; if filter changed, re-install ourselves
- (let ((new (process-filter process)))
- (if (not (eq new 'bridge-filter))
- (progn (setq bridge-old-filter new)
- (set-process-filter process 'bridge-filter)))))
- (set-buffer process-buffer)
- (bridge-insert pass-on))))
-
- (if (and b-start-end (not b-end))
- (return-from bridge-filter t) ; when last bit has prematurely ending message, exit early.
- (progn
- ;;3 find handler (in b-start, b-end) if none current
- (if (and b-start (not bridge-in-progress))
- (let ((handlers bridge-handlers))
- (while (and handlers (not function))
- (let* ((handler (car handlers))
- (m (string-match (car handler) output b-start-end)))
- (if (and m (< m b-end))
- (setq function (cdr handler))
- (setq handlers (cdr handlers)))))
- ;; Set default handler if none
- (if (null function)
- (setq function 'bridge-send-handler))
- (setq bridge-in-progress function)))
- ;;4 process strin
- (if function
- (let ((ok t))
- (if (/= b-start-end b-end)
- (let ((send (substring output b-start-end b-end)))
- ;; also, insert the stuff in buffer between
- ;; iff bridge-source-insert.
- (if bridge-source-insert (bridge-insert send))
- ;; call handler on string
- (setq ok (bridge-call-handler function process send))))
- ;;5 remove handler if end found
- ;; if function removed then tell it that's all
- (if (or (not ok) (/= b-end end)) ;; saw end before end-of-string
- (progn
- (bridge-call-handler function process nil)
- ;; have to remove function too for next time around
- (setq function nil
- bridge-in-progress nil)
- ))
- ))
-
- ;; continue looping, in case there's more string
- (setq start end))
- ))
- ;; protected forms: restore buffer, match-data
- (set-buffer buffer)
- (store-match-data match-data)
- ))))
-
-
-;;;%Interface
-(defun install-bridge ()
- "Set up a process bridge in the current buffer."
- (interactive)
- (if (not (get-buffer-process (current-buffer)))
- (error "%s does not have a process" (buffer-name (current-buffer)))
- (make-local-variable 'bridge-start-regexp)
- (make-local-variable 'bridge-end-regexp)
- (make-local-variable 'bridge-prompt-regexp)
- (make-local-variable 'bridge-handlers)
- (make-local-variable 'bridge-source-insert)
- (make-local-variable 'bridge-destination-insert)
- (make-local-variable 'bridge-chunk-size)
- (make-local-variable 'bridge-old-filter)
- (make-local-variable 'bridge-string)
- (make-local-variable 'bridge-in-progress)
- (make-local-variable 'bridge-send-to-buffer)
- (make-local-variable 'bridge-leftovers)
- (setq bridge-string nil bridge-in-progress nil
- bridge-send-to-buffer nil)
- (if (boundp 'comint-prompt-regexp)
- (setq bridge-prompt-regexp comint-prompt-regexp))
- (let ((process (get-buffer-process (current-buffer))))
- (if process
- (if (not (eq (process-filter process) 'bridge-filter))
- (progn
- (setq bridge-old-filter (process-filter process))
- (set-process-filter process 'bridge-filter)))
- (error "%s does not have a process"
- (buffer-name (current-buffer)))))
- (run-hooks 'bridge-hook)
- (message "Process bridge is installed")))
-
-;;;
-(defun reset-bridge ()
- "Must be called from the process's buffer. Removes any active bridge."
- (interactive)
- ;; for when things get wedged
- (if bridge-in-progress
- (unwind-protect
- (funcall bridge-in-progress (get-buffer-process
- (current-buffer))
- nil)
- (setq bridge-in-progress nil))
- (message "No bridge in progress.")))
-
-;;;
-(defun remove-bridge ()
- "Remove bridge from the current buffer."
- (interactive)
- (let ((process (get-buffer-process (current-buffer))))
- (if (or (not process) (not (eq (process-filter process) 'bridge-filter)))
- (error "%s has no bridge" (buffer-name (current-buffer)))
- ;; remove any bridge-in-progress
- (reset-bridge)
- (set-process-filter process bridge-old-filter)
- (funcall bridge-old-filter process bridge-string)
- (message "Process bridge is removed."))))
-
-;;;% Utility for testing
-(defun hand-bridge (start end)
- "With point at bridge-start, sends bridge-start + string +
-bridge-end to bridge-filter. With prefix, use current region to send."
- (interactive "r")
- (let ((p0 (if current-prefix-arg (min start end)
- (if (looking-at bridge-start-regexp) (point)
- (error "Not looking at bridge-start-regexp"))))
- (p1 (if current-prefix-arg (max start end)
- (if (re-search-forward bridge-end-regexp nil t)
- (point) (error "Didn't see bridge-end-regexp")))))
-
- (bridge-filter (get-buffer-process (current-buffer))
- (buffer-substring-no-properties p0 p1))
- ))
-
-(provide 'bridge)
View
133 elisp/slime-2010-09-17/contrib/inferior-slime.el
@@ -1,133 +0,0 @@
-;;; inferior-slime.el --- Minor mode with Slime keys for comint buffers
-;;
-;; Author: Luke Gorrie <luke@synap.se>
-;; License: GNU GPL (same license as Emacs)
-;;
-;;; Installation:
-;;
-;; Add something like this to your .emacs:
-;;
-;; (add-to-list 'load-path "<directory-of-this-file>")
-;; (add-hook 'slime-load-hook (lambda () (require 'inferior-slime)))
-;; (add-hook 'inferior-lisp-mode-hook (lambda () (inferior-slime-mode 1)))
-
-(define-minor-mode inferior-slime-mode
- "\\<slime-mode-map>\
-Inferior SLIME mode: The Inferior Superior Lisp Mode for Emacs.
-
-This mode is intended for use with `inferior-lisp-mode'. It provides a
-subset of the bindings from `slime-mode'.
-
-\\{inferior-slime-mode-map}"
- nil
- nil
- ;; Fake binding to coax `define-minor-mode' to create the keymap
- '((" " 'undefined)))
-
-(add-to-list 'minor-mode-alist
- '(inferior-slime-mode
- (" Inf-Slime" slime-state-name)))
-
-(defun inferior-slime-return ()
- "Handle the return key in the inferior-lisp buffer.
-The current input should only be sent if a whole expression has been
-entered, i.e. the parenthesis are matched.
-
-A prefix argument disables this behaviour."
- (interactive)
- (if (or current-prefix-arg (inferior-slime-input-complete-p))
- (comint-send-input)
- (insert "\n")
- (inferior-slime-indent-line)))
-
-(defun inferior-slime-indent-line ()
- "Indent the current line, ignoring everything before the prompt."
- (interactive)
- (save-restriction
- (let ((indent-start
- (save-excursion
- (goto-char (process-mark (get-buffer-process (current-buffer))))
- (let ((inhibit-field-text-motion t))
- (beginning-of-line 1))
- (point))))
- (narrow-to-region indent-start (point-max)))
- (lisp-indent-line)))
-
-(defun inferior-slime-input-complete-p ()
- "Return true if the input is complete in the inferior lisp buffer."
- (slime-input-complete-p (process-mark (get-buffer-process (current-buffer)))
- (point-max)))
-
-(defun inferior-slime-closing-return ()
- "Send the current expression to Lisp after closing any open lists."
- (interactive)
- (goto-char (point-max))
- (save-restriction
- (narrow-to-region (process-mark (get-buffer-process (current-buffer)))
- (point-max))
- (while (ignore-errors (save-excursion (backward-up-list 1) t))
- (insert ")")))
- (comint-send-input))
-
-(defun inferior-slime-change-directory (directory)
- "Set default-directory in the *inferior-lisp* buffer to DIRECTORY."
- (let* ((proc (slime-process))
- (buffer (and proc (process-buffer proc))))
- (when buffer
- (with-current-buffer buffer
- (cd-absolute directory)))))
-
-(defun inferior-slime-init-keymap ()
- (let ((map inferior-slime-mode-map))
- (set-keymap-parent map slime-parent-map)
- (slime-define-keys map
- ([return] 'inferior-slime-return)
- ([(control return)] 'inferior-slime-closing-return)
- ([(meta control ?m)] 'inferior-slime-closing-return)
- ("\t" 'slime-indent-and-complete-symbol)
- (" " 'slime-space))))
-
-(inferior-slime-init-keymap)
-
-(defun inferior-slime-hook-function ()
- (inferior-slime-mode 1))
-
-(defun inferior-slime-switch-to-repl-buffer ()
- (switch-to-buffer (process-buffer (slime-inferior-process))))
-
-(defun inferior-slime-show-transcript (string)
- (remove-hook 'comint-output-filter-functions
- 'inferior-slime-show-transcript t)
- (with-current-buffer (process-buffer (slime-inferior-process))
- (let ((window (display-buffer (current-buffer) t)))
- (set-window-point window (point-max)))))
-
-(defun inferior-slime-start-transcript ()
- (let ((proc (slime-inferior-process)))
- (when proc
- (with-current-buffer (process-buffer proc)
- (add-hook 'comint-output-filter-functions
- 'inferior-slime-show-transcript
- nil t)))))
-
-(defun inferior-slime-stop-transcript ()
- (let ((proc (slime-inferior-process)))
- (when proc
- (with-current-buffer (process-buffer (slime-inferior-process))
- (run-with-timer 0.2 nil
- (lambda (buffer)
- (with-current-buffer buffer
- (remove-hook 'comint-output-filter-functions
- 'inferior-slime-show-transcript t)))
- (current-buffer))))))
-
-(defun inferior-slime-init ()
- (add-hook 'slime-inferior-process-start-hook 'inferior-slime-hook-function)
- (add-hook 'slime-change-directory-hooks 'inferior-slime-change-directory)
- (add-hook 'slime-transcript-start-hook 'inferior-slime-start-transcript)
- (add-hook 'slime-transcript-stop-hook 'inferior-slime-stop-transcript)
- (def-slime-selector-method ?r
- "SLIME Read-Eval-Print-Loop."
- (process-buffer (slime-inferior-process))))
-
-(provide 'inferior-slime)
View
300 elisp/slime-2010-09-17/contrib/slime-asdf.el
@@ -1,300 +0,0 @@
-
-(define-slime-contrib slime-asdf
- "ASDF support."
- (:authors "Daniel Barlow <dan@telent.net>"
- "Marco Baringer <mb@bese.it>"
- "Edi Weitz <edi@agharta.de>"
- "Stas Boukarev <stassats@gmail.com>"
- "Tobias C Rittweiler <tcr@freebits.de>")
- (:license "GPL")
- (:slime-dependencies slime-repl)
- (:swank-dependencies swank-asdf)
- (:on-load
- (add-to-list 'slime-edit-uses-xrefs :depends-on t)
- (define-key slime-who-map [?d] 'slime-who-depends-on)))
-
-;;; NOTE: `system-name' is a predefined variable in Emacs. Try to
-;;; avoid it as local variable name.
-
-;;; Utilities
-
-(defvar slime-system-history nil
- "History list for ASDF system names.")
-
-(defun slime-read-system-name (&optional prompt
- default-value
- determine-default-accurately)
- "Read a system name from the minibuffer, prompting with PROMPT.
-If no `default-value' is given, one is tried to be determined: if
-`determine-default-accurately' is true, by an RPC request which
-grovels through all defined systems; if it's not true, by looking
-in the directory of the current buffer."
- (let* ((completion-ignore-case nil)
- (prompt (or prompt "System"))
- (system-names (slime-eval `(swank:list-asdf-systems)))
- (default-value (or default-value
- (if determine-default-accurately
- (slime-determine-asdf-system (buffer-file-name)
- (slime-current-package))
- (slime-find-asd-file (or default-directory
- (buffer-file-name))
- system-names))))
- (prompt (concat prompt (if default-value
- (format " (default `%s'): " default-value)
- ": "))))
- (completing-read prompt (slime-bogus-completion-alist system-names)
- nil nil nil
- 'slime-system-history default-value)))
-
-
-
-(defun slime-find-asd-file (directory system-names)
- "Tries to find an ASDF system definition file in the
-`directory' and returns it if it's in `system-names'."
- (let ((asd-files
- (directory-files (file-name-directory directory) nil "\.asd$")))
- (loop for system in asd-files
- for candidate = (file-name-sans-extension system)
- when (find candidate system-names :test #'string-equal)
- do (return candidate))))
-
-(defun slime-determine-asdf-system (filename buffer-package)
- "Try to determine the asdf system that `filename' belongs to."
- (slime-eval `(swank:asdf-determine-system ,(slime-to-lisp-filename filename)
- ,buffer-package)))
-
-(defun slime-who-depends-on-rpc (system)
- (slime-eval `(swank:who-depends-on ,system)))
-
-(defcustom slime-asdf-collect-notes t
- "Collect and display notes produced by the compiler.
-
-See also `slime-highlight-compiler-notes' and `slime-compilation-finished-hook'.")
-
-(defun slime-asdf-operation-finished-function (system)
- (if slime-asdf-collect-notes
- #'slime-compilation-finished
- (lexical-let ((system system))
- (lambda (result)
- (let (slime-highlight-compiler-notes
- slime-compilation-finished-hook)
- (slime-compilation-finished result))))))
-
-(defun slime-oos (system operation &rest keyword-args)
- "Operate On System."
- (slime-save-some-lisp-buffers)
- (slime-display-output-buffer)
- (message "Performing ASDF %S%s on system %S"
- operation (if keyword-args (format " %S" keyword-args) "")
- system)
- (slime-repl-shortcut-eval-async
- `(swank:operate-on-system-for-emacs ,system ',operation ,@keyword-args)
- (slime-asdf-operation-finished-function system)))
-
-
-;;; Interactive functions
-
-(defun slime-load-system (&optional system)
- "Compile and load an ASDF system.
-
-Default system name is taken from first file matching *.asd in current
-buffer's working directory"
- (interactive (list (slime-read-system-name)))
- (slime-oos system 'load-op))
-
-(defun slime-open-system (name &optional load)
- "Open all files in an ASDF system."
- (interactive (list (slime-read-system-name)))
- (when (or load
- (and (called-interactively-p)
- (not (slime-eval `(swank:asdf-system-loaded-p ,name)))
- (y-or-n-p "Load it? ")))
- (slime-load-system name))
- (slime-eval-async
- `(swank:asdf-system-files ,name)
- (lambda (files)
- (when files
- (let ((files (mapcar 'slime-from-lisp-filename
- (nreverse files))))
- (find-file-other-window (car files))
- (mapc 'find-file (cdr files)))))))
-
-(defun slime-browse-system (name)
- "Browse files in an ASDF system using Dired."
- (interactive (list (slime-read-system-name)))
- (slime-eval-async `(swank:asdf-system-directory ,name)
- (lambda (directory)
- (when directory
- (dired (slime-from-lisp-filename directory))))))
-
-(if (fboundp 'rgrep)
- (defun slime-rgrep-system (sys-name regexp)
- "Run `rgrep' on the base directory of an ASDF system."
- (interactive (progn (grep-compute-defaults)
- (list (slime-read-system-name nil nil t)
- (grep-read-regexp))))
- (rgrep regexp "*.lisp"
- (slime-from-lisp-filename
- (slime-eval `(swank:asdf-system-directory ,sys-name)))))
- (defun slime-rgrep-system ()
- (interactive)
- (error "This command is only supported on GNU Emacs >21.x.")))
-
-(if (boundp 'multi-isearch-next-buffer-function)
- (defun slime-isearch-system (sys-name)
- "Run `isearch-forward' on the files of an ASDF system."
- (interactive (list (slime-read-system-name nil nil t)))
- (let* ((files (mapcar 'slime-from-lisp-filename
- (slime-eval `(swank:asdf-system-files ,sys-name))))
- (multi-isearch-next-buffer-function
- (lexical-let*
- ((buffers-forward (mapcar #'find-file-noselect files))
- (buffers-backward (reverse buffers-forward)))
- #'(lambda (current-buffer wrap)
- ;; Contrarily to the the docstring of
- ;; `multi-isearch-next-buffer-function', the first
- ;; arg is not necessarily a buffer. Report sent
- ;; upstream. (2009-11-17)
- (setq current-buffer (or current-buffer (current-buffer)))
- (let* ((buffers (if isearch-forward
- buffers-forward
- buffers-backward)))
- (if wrap
- (car buffers)
- (second (memq current-buffer buffers))))))))
- (isearch-forward)))
- (defun slime-isearch-system ()
- (interactive)
- (error "This command is only supported on GNU Emacs >23.1.x.")))
-
-(defun slime-read-query-replace-args (format-string &rest format-args)
- (let* ((minibuffer-setup-hook (slime-minibuffer-setup-hook))
- (minibuffer-local-map slime-minibuffer-map)
- (common (query-replace-read-args (apply #'format format-string
- format-args)
- t t)))
- (list (nth 0 common) (nth 1 common) (nth 2 common))))
-
-(defun slime-query-replace-system (name from to &optional delimited)
- "Run `query-replace' on an ASDF system."
- (interactive (let ((system (slime-read-system-name nil nil t)))
- (cons system (slime-read-query-replace-args
- "Query replace throughout `%s'" system))))
- (condition-case c
- ;; `tags-query-replace' actually uses `query-replace-regexp'
- ;; internally.
- (tags-query-replace (regexp-quote from) to delimited
- '(mapcar 'slime-from-lisp-filename
- (slime-eval `(swank:asdf-system-files ,name))))
- (error
- ;; Kludge: `tags-query-replace' does not actually return but
- ;; signals an unnamed error with the below error
- ;; message. (<=23.1.2, at least.)
- (unless (string-equal (error-message-string c) "All files processed")
- (signal (car c) (cdr c))) ; resignal
- t)))
-
-(defun slime-query-replace-system-and-dependents
- (name from to &optional delimited)
- "Run `query-replace' on an ASDF system and all the systems
-depending on it."
- (interactive (let ((system (slime-read-system-name nil nil t)))
- (cons system (slime-read-query-replace-args
- "Query replace throughout `%s'+dependencies"
- system))))
- (slime-query-replace-system name from to delimited)
- (dolist (dep (slime-who-depends-on-rpc name))
- (when (y-or-n-p (format "Descend into system `%s'? " dep))
- (slime-query-replace-system dep from to delimited))))
-
-(defun slime-delete-system-fasls (name)
- "Delete FASLs produced by compiling a system."
- (interactive (list (slime-read-system-name)))
- (slime-repl-shortcut-eval-async
- `(swank:delete-system-fasls ,name)
- 'message))
-
-(defun slime-reload-system (system)
- "Reload an ASDF system without reloading its dependencies."
- (interactive (list (slime-read-system-name)))
- (slime-save-some-lisp-buffers)
- (slime-display-output-buffer)
- (message "Performing ASDF LOAD-OP on system %S" system)
- (slime-repl-shortcut-eval-async
- `(swank:reload-system ,system)
- (slime-asdf-operation-finished-function system)))
-
-(defun slime-who-depends-on (system-name)
- (interactive (list (slime-read-system-name)))
- (slime-xref :depends-on system-name))
-
-(defun slime-save-system (system)
- "Save files belonging to an ASDF system."
- (interactive (list (slime-read-system-name)))
- (slime-eval-async
- `(swank:asdf-system-files ,system)
- (lambda (files)
- (dolist (file files)
- (let ((buffer (get-file-buffer (slime-from-lisp-filename file))))
- (when buffer
- (with-current-buffer buffer
- (save-buffer buffer)))))
- (message "Done."))))
-
-
-;;; REPL shortcuts
-
-(defslime-repl-shortcut slime-repl-load/force-system ("force-load-system")
- (:handler (lambda ()
- (interactive)
- (slime-oos (slime-read-system-name) 'load-op :force t)))
- (:one-liner "Recompile and load an ASDF system."))
-
-(defslime-repl-shortcut slime-repl-load-system ("load-system")
- (:handler (lambda ()
- (interactive)
- (slime-oos (slime-read-system-name) 'load-op)))
- (:one-liner "Compile (as needed) and load an ASDF system."))
-
-(defslime-repl-shortcut slime-repl-test/force-system ("force-test-system")
- (:handler (lambda ()
- (interactive)
- (slime-oos (slime-read-system-name) 'test-op :force t)))
- (:one-liner "Compile (as needed) and force test an ASDF system."))
-
-(defslime-repl-shortcut slime-repl-test-system ("test-system")
- (:handler (lambda ()
- (interactive)
- (slime-oos (slime-read-system-name) 'test-op)))
- (:one-liner "Compile (as needed) and test an ASDF system."))
-
-(defslime-repl-shortcut slime-repl-compile-system ("compile-system")
- (:handler (lambda ()
- (interactive)
- (slime-oos (slime-read-system-name) 'compile-op)))
- (:one-liner "Compile (but not load) an ASDF system."))
-
-(defslime-repl-shortcut slime-repl-compile/force-system
- ("force-compile-system")
- (:handler (lambda ()
- (interactive)
- (slime-oos (slime-read-system-name) 'compile-op :force t)))
- (:one-liner "Recompile (but not load) an ASDF system."))
-
-(defslime-repl-shortcut slime-repl-open-system ("open-system")
- (:handler 'slime-open-system)
- (:one-liner "Open all files in an ASDF system."))
-
-(defslime-repl-shortcut slime-repl-browse-system ("browse-system")
- (:handler 'slime-browse-system)
- (:one-liner "Browse files in an ASDF system using Dired."))
-
-(defslime-repl-shortcut slime-repl-delete-system-fasls ("delete-system-fasls")
- (:handler 'slime-delete-system-fasls)
- (:one-liner "Delete FASLs of an ASDF system."))
-
-(defslime-repl-shortcut slime-repl-reload-system ("reload-system")
- (:handler 'slime-reload-system)
- (:one-liner "Recompile and load an ASDF system."))
-
-(provide 'slime-asdf)
View
344 elisp/slime-2010-09-17/contrib/slime-autodoc.el
@@ -1,344 +0,0 @@
-
-(define-slime-contrib slime-autodoc
- "Show fancy arglist in echo area."
- (:gnu-emacs-only t)
- (:license "GPL")
- (:authors "Luke Gorrie <luke@bluetail.com>"
- "Lawrence Mitchell <wence@gmx.li>"
- "Matthias Koeppe <mkoeppe@mail.math.uni-magdeburg.de>"
- "Tobias C. Rittweiler <tcr@freebits.de>")
- (:slime-dependencies slime-parse)
- (:swank-dependencies swank-arglists)
- (:on-load
- (dolist (h '(slime-mode-hook slime-repl-mode-hook sldb-mode-hook))
- (add-hook h 'slime-autodoc-maybe-enable)))
- (:on-unload
- ;; FIXME: This doesn't disable eldoc-mode in existing buffers.
- (setq slime-echo-arglist-function 'slime-show-arglist)
- (dolist (h '(slime-mode-hook slime-repl-mode-hook sldb-mode-hook))
- (remove-hook h 'slime-autodoc-maybe-enable))))
-
-(defun slime-autodoc-maybe-enable ()
- (when slime-use-autodoc-mode
- (slime-autodoc-mode 1)
- (setq slime-echo-arglist-function
- (lambda ()
- (if slime-autodoc-mode
- (eldoc-message (slime-autodoc))
- (slime-show-arglist))))))
-
-(defcustom slime-use-autodoc-mode t
- "When non-nil always enable slime-autodoc-mode in slime-mode.")
-
-(defcustom slime-autodoc-use-multiline-p nil
- "If non-nil, allow long autodoc messages to resize echo area display."
- :type 'boolean
- :group 'slime-ui)
-
-(defcustom slime-autodoc-delay 0.3
- "*Delay before autodoc messages are fetched and displayed, in seconds."
- :type 'number
- :group 'slime-ui)
-
-(defcustom slime-autodoc-accuracy-depth 10
- "Number of paren levels that autodoc takes into account for
- context-sensitive arglist display (local functions. etc)")
-
-
-
-(defun slime-arglist (name)
- "Show the argument list for NAME."
- (interactive (list (slime-read-symbol-name "Arglist of: " t)))
- (let ((arglist (slime-retrieve-arglist name)))
- (if (eq arglist :not-available)
- (error "Arglist not available")
- (message "%s" (slime-fontify-string arglist)))))
-
-(defun slime-retrieve-arglist (name)
- (let ((name (etypecase name
- (string name)
- (symbol (symbol-name name)))))
- (slime-eval `(swank:autodoc '(,name ,slime-cursor-marker)))))
-
-
-;;;; Autodocs (automatic context-sensitive help)
-
-(defun slime-make-autodoc-rpc-form ()
- "Return a cache key and a swank form."
- (let* ((levels slime-autodoc-accuracy-depth)
- (buffer-form (slime-parse-form-upto-point levels)))
- (when buffer-form
- (values buffer-form
- `(swank:autodoc ',buffer-form
- :print-right-margin
- ,(window-width (minibuffer-window)))))))
-
-(defun slime-autodoc-global-at-point ()
- "Return the global variable name at point, if any."
- (when-let (name (slime-symbol-at-point))
- (and (slime-global-variable-name-p name) name)))
-
-(defcustom slime-global-variable-name-regexp "^\\(.*:\\)?\\([*+]\\).+\\2$"
- "Regexp used to check if a symbol name is a global variable.
-
-Default value assumes +this+ or *that* naming conventions."
- :type 'regexp
- :group 'slime)
-
-(defun slime-global-variable-name-p (name)
- "Is NAME a global variable?
-Globals are recognised purely by *this-naming-convention*."
- (and (< (length name) 80) ; avoid overflows in regexp matcher
- (string-match slime-global-variable-name-regexp name)))
-
-
-;;;; Autodoc cache
-
-(defvar slime-autodoc-last-buffer-form nil)
-(defvar slime-autodoc-last-autodoc nil)
-
-(defun slime-get-cached-autodoc (buffer-form)
- "Return the cached autodoc documentation for `buffer-form', or nil."
- (when (equal buffer-form slime-autodoc-last-buffer-form)
- slime-autodoc-last-autodoc))
-
-(defun slime-store-into-autodoc-cache (buffer-form autodoc)
- "Update the autodoc cache for SYMBOL with DOCUMENTATION.
-Return DOCUMENTATION."
- (setq slime-autodoc-last-buffer-form buffer-form)
- (setq slime-autodoc-last-autodoc autodoc))
-
-
-;;;; Formatting autodoc
-
-(defun slime-format-autodoc (doc multilinep)
- (let ((doc (slime-fontify-string doc)))
- (if multilinep
- doc
- (slime-oneliner (replace-regexp-in-string "[ \n\t]+" " " doc)))))
-
-(defun slime-fontify-string (string)
- "Fontify STRING as `font-lock-mode' does in Lisp mode."
- (with-current-buffer (get-buffer-create (slime-buffer-name :fontify 'hidden))
- (erase-buffer)
- (unless (eq major-mode 'lisp-mode)
- ;; Just calling (lisp-mode) will turn slime-mode on in that buffer,
- ;; which may interfere with this function
- (setq major-mode 'lisp-mode)
- (lisp-mode-variables t))
- (insert string)
- (let ((font-lock-verbose nil))
- (font-lock-fontify-buffer))
- (goto-char (point-min))
- (when (re-search-forward "===> \\(\\(.\\|\n\\)*\\) <===" nil t)
- (let ((highlight (match-string 1)))
- ;; Can't use (replace-match highlight) here -- broken in Emacs 21
- (delete-region (match-beginning 0) (match-end 0))
- (slime-insert-propertized '(face highlight) highlight)))
- (buffer-substring (point-min) (point-max))))
-
-
-;;;; slime-autodoc-mode
-
-(defun* slime-autodoc (&optional (multilinep slime-autodoc-use-multiline-p)
- cache-multiline)
- "Returns the cached arglist information as string, or nil.
-If it's not in the cache, the cache will be updated asynchronously."
- (interactive)
- (save-excursion
- ;; Save match data just in case. This is automatically run in
- ;; background, so it'd be rather disastrous if it touched match
- ;; data.
- (save-match-data
- (unless (if (fboundp 'slime-repl-inside-string-or-comment-p)
- (slime-repl-inside-string-or-comment-p)
- (slime-inside-string-or-comment-p))
- (multiple-value-bind (cache-key retrieve-form)
- (slime-make-autodoc-rpc-form)
- (let* (cached
- (multilinep (or (slime-autodoc-multiline-cached (car cache-key))
- multilinep)))
- (slime-autodoc-cache-multiline (car cache-key) cache-multiline)
- (cond
- ((not cache-key) nil)
- ((setq cached (slime-get-cached-autodoc cache-key))
- (slime-format-autodoc cached multilinep))
- (t
- ;; If nothing is in the cache, we first decline (by
- ;; returning nil), and fetch the arglist information
- ;; asynchronously.
- (slime-eval-async retrieve-form
- (lexical-let ((cache-key cache-key)
- (multilinep multilinep))
- (lambda (doc)
- (unless (eq doc :not-available)
- (slime-store-into-autodoc-cache cache-key doc)
- ;; Now that we've got our information,
- ;; get it to the user ASAP.
- (eldoc-message
- (slime-format-autodoc doc multilinep))))))
- nil))))))))
-
-(defvar slime-autodoc-cache-car nil)
-
-(defun slime-autodoc-multiline-cached (cache-key)
- (equal cache-key
- slime-autodoc-cache-car))
-
-(defun slime-autodoc-cache-multiline (cache-key cache-new-p)
- (cond (cache-new-p
- (setq slime-autodoc-cache-car
- cache-key))
- ((not (equal cache-key
- slime-autodoc-cache-car))
- (setq slime-autodoc-cache-car nil))))
-
-(defun slime-autodoc-manually ()
- "Like slime-autodoc, but when called twice,
-or after slime-autodoc was already automatically called,
-display multiline arglist"
- (interactive)
- (eldoc-message (slime-autodoc (or slime-autodoc-use-multiline-p
- slime-autodoc-mode)
- t)))
-
-(make-variable-buffer-local (defvar slime-autodoc-mode nil))
-
-(defun slime-autodoc-mode (&optional arg)
- (interactive (list (or current-prefix-arg 'toggle)))
- (make-local-variable 'eldoc-documentation-function)
- (make-local-variable 'eldoc-idle-delay)
- (make-local-variable 'eldoc-minor-mode-string)
- (setq eldoc-documentation-function 'slime-autodoc)
- (setq eldoc-idle-delay slime-autodoc-delay)
- (setq eldoc-minor-mode-string " Autodoc")
- (setq slime-autodoc-mode (eldoc-mode arg))
- (when (interactive-p)
- (message (format "Slime autodoc mode %s."
- (if slime-autodoc-mode "enabled" "disabled")))))
-
-(defadvice eldoc-display-message-no-interference-p
- (after slime-autodoc-message-ok-p)
- (when slime-autodoc-mode
- (setq ad-return-value
- (and ad-return-value
- ;; Display arglist only when the minibuffer is
- ;; inactive, e.g. not on `C-x C-f'.
- (not (active-minibuffer-window))
- ;; Display arglist only when inferior Lisp will be able
- ;; to cope with the request.
- (slime-background-activities-enabled-p)))
- (slime-bind-keys slime-doc-map t '((?A slime-autodoc-manually))))
- ad-return-value)
-
-
-;;;; Initialization
-
-
-
-;;;; Test cases
-
-(defun slime-check-autodoc-at-point (arglist)
- (let ((slime-autodoc-use-multiline-p nil))
- (slime-test-expect (format "Autodoc in `%s' (at %d) is as expected"
- (buffer-string) (point))
- arglist
- (slime-eval (second (slime-make-autodoc-rpc-form)))
- 'equal)))
-
-(def-slime-test autodoc.1
- (buffer-sexpr wished-arglist &optional skip-trailing-test-p)
- ""
- '(
- ;; Test basics
- ("(swank::emacs-connected*HERE*" "(emacs-connected)")
- ("(swank::emacs-connected *HERE*" "(emacs-connected)")
- ("(swank::create-socket*HERE*" "(create-socket host port)")
- ("(swank::create-socket *HERE*" "(create-socket ===> host <=== port)")
- ("(swank::create-socket foo *HERE*" "(create-socket host ===> port <===)")
-
- ;; Test that autodoc differentiates between exported and unexported symbols.
- ("(swank:create-socket*HERE*" :not-available)
-
- ;; Test if cursor is on non-existing required parameter
- ("(swank::create-socket foo bar *HERE*" "(create-socket host port)")
-
- ;; Test cursor in front of opening parenthesis
- ("(swank::with-struct *HERE*(foo. x y) *struct* body1)"
- "(with-struct (conc-name &rest names) obj &body body)"
- t)
-
- ;; Test variable content display
- ("(progn swank::default-server-port*HERE*" "DEFAULT-SERVER-PORT => 4005")
-
- ;; Test that "variable content display" is not triggered for trivial constants.
- ("(swank::create-socket t*HERE*" "(create-socket ===> host <=== port)")
- ("(swank::create-socket :foo*HERE*" "(create-socket ===> host <=== port)")
-
- ;; Test with syntactic sugar
- ("#'(lambda () (swank::create-socket*HERE*" "(create-socket host port)")
- ("`(lambda () ,(swank::create-socket*HERE*" "(create-socket host port)")
- ("(remove-if #'(lambda () (swank::create-socket*HERE*" "(create-socket host port)")
- ("`(remove-if #'(lambda () ,@(swank::create-socket*HERE*" "(create-socket host port)")
-
- ;; Test &optional
- ("(swank::symbol-status foo *HERE*"
- "(symbol-status symbol &optional ===> (package (symbol-package symbol)) <===)")
-
- ;; Test context-sensitive autodoc (DEFMETHOD)
- ("(defmethod swank::arglist-dispatch (*HERE*"
- "(defmethod arglist-dispatch (===> operator <=== arguments) &body body)")
- ("(defmethod swank::arglist-dispatch :before (*HERE*"
- "(defmethod arglist-dispatch :before (===> operator <=== arguments) &body body)")
-
- ;; Test context-sensitive autodoc (APPLY)
- ("(apply 'swank::eval-for-emacs*HERE*"
- "(apply 'eval-for-emacs &optional form buffer-package id &rest args)")
- ("(apply #'swank::eval-for-emacs*HERE*"
- "(apply #'eval-for-emacs &optional form buffer-package id &rest args)")
- ("(apply 'swank::eval-for-emacs foo *HERE*"
- "(apply 'eval-for-emacs &optional form ===> buffer-package <=== id &rest args)")
- ("(apply #'swank::eval-for-emacs foo *HERE*"
- "(apply #'eval-for-emacs &optional form ===> buffer-package <=== id &rest args)")
-
- ;; Test context-sensitive autodoc (ERROR, CERROR)
- ("(error 'simple-condition*HERE*"
- "(error 'simple-condition &rest arguments &key format-arguments format-control)")
- ("(cerror \"Foo\" 'simple-condition*HERE*"
- "(cerror \"Foo\" 'simple-condition &rest arguments &key format-arguments format-control)")
-
- ;; Test &KEY and nested arglists
- ("(swank::with-retry-restart (:msg *HERE*"
- "(with-retry-restart (&key ===> (msg \"Retry.\") <===) &body body)")
- ("(swank::start-server \"/tmp/foo\" :coding-system *HERE*"
- "(start-server port-file &key (style swank:*communication-style*) (dont-close swank:*dont-close*) ===> (coding-system swank::*coding-system*) <===)")
-
- ;; Test declarations and type specifiers
- ("(declare (string *HERE*"
- "(declare (string &rest ===> variables <===))")
- ("(declare ((string *HERE*"
- "(declare ((string &optional ===> size <===) &rest variables))")
- ("(declare (type (string *HERE*"
- "(declare (type (string &optional ===> size <===) &rest variables))")
-
- ;; Test local functions
- ("(flet ((foo (x y) (+ x y))) (foo *HERE*" "(foo ===> x <=== y)")
- ("(macrolet ((foo (x y) `(+ ,x ,y))) (foo *HERE*" "(foo ===> x <=== y)")
- ("(labels ((foo (x y) (+ x y))) (foo *HERE*" "(foo ===> x <=== y)")
- ("(labels ((foo (x y) (+ x y))
- (bar (y) (foo *HERE*"
- "(foo ===> x <=== y)"))
- (slime-check-top-level)
- (with-temp-buffer
- (setq slime-buffer-package "COMMON-LISP-USER")
- (lisp-mode)
- (insert buffer-sexpr)
- (search-backward "*HERE*")
- (delete-region (match-beginning 0) (match-end 0))
- (slime-check-autodoc-at-point wished-arglist)
- (unless skip-trailing-test-p
- (insert ")") (backward-char)
- (slime-check-autodoc-at-point wished-arglist))
- ))
-
-(provide 'slime-autodoc)
View
34 elisp/slime-2010-09-17/contrib/slime-banner.el
@@ -1,34 +0,0 @@
-
-(define-slime-contrib slime-banner
- "Persistent header line and startup animation."
- (:authors "Helmut Eller <heller@common-lisp.net>"
- "Luke Gorrie <luke@synap.se>")
- (:license "GPL")
- (:on-load (setq slime-repl-banner-function 'slime-startup-message))
- (:on-unload (setq slime-repl-banner-function 'slime-repl-insert-banner)))
-
-(defcustom slime-startup-animation (fboundp 'animate-string)
- "Enable the startup animation."
- :type '(choice (const :tag "Enable" t) (const :tag "Disable" nil))
- :group 'slime-ui)
-
-(defcustom slime-header-line-p (boundp 'header-line-format)
- "If non-nil, display a header line in Slime buffers."
- :type 'boolean
- :group 'slime-repl)
-
-(defun slime-startup-message ()
- (when slime-header-line-p
- (setq header-line-format
- (format "%s Port: %s Pid: %s"
- (slime-lisp-implementation-type)
- (slime-connection-port (slime-connection))
- (slime-pid))))
- (when (zerop (buffer-size))
- (let ((welcome (concat "; SLIME " (or (slime-changelog-date)
- "- ChangeLog file not found"))))
- (if slime-startup-animation
- (animate-string welcome 0 0)
- (insert welcome)))))
-
-(provide 'slime-banner)
View
237 elisp/slime-2010-09-17/contrib/slime-c-p-c.el
@@ -1,237 +0,0 @@
-(defvar slime-c-p-c-init-undo-stack nil)
-
-(define-slime-contrib slime-c-p-c
- "ILISP style Compound Prefix Completion."
- (:authors "Luke Gorrie <luke@synap.se>"
- "Edi Weitz <edi@agharta.de>"
- "Matthias Koeppe <mkoeppe@mail.math.uni-magdeburg.de>"
- "Tobias C. Rittweiler <tcr@freebits.de>")
- (:license "GPL")
- (:slime-dependencies slime-parse slime-editing-commands slime-autodoc)
- (:swank-dependencies swank-c-p-c)
- (:on-load
- (push
- `(progn
- (setq slime-complete-symbol-function ',slime-complete-symbol-function)
- (remove-hook 'slime-connected-hook 'slime-c-p-c-on-connect)
- ,@(when (featurep 'slime-repl)
- `((define-key slime-mode-map "\C-c\C-s"
- ',(lookup-key slime-mode-map "\C-c\C-s"))
- (define-key slime-repl-mode-map "\C-c\C-s"
- ',(lookup-key slime-repl-mode-map "\C-c\C-s")))))
- slime-c-p-c-init-undo-stack)
- (setq slime-complete-symbol-function 'slime-complete-symbol*)
- (define-key slime-mode-map "\C-c\C-s" 'slime-complete-form)
- (when (featurep 'slime-repl)
- (define-key slime-repl-mode-map "\C-c\C-s" 'slime-complete-form)))
- (:on-unload
- (while slime-c-p-c-init-undo-stack
- (eval (pop slime-c-p-c-init-undo-stack)))))
-
-(defcustom slime-c-p-c-unambiguous-prefix-p t
- "If true, set point after the unambigous prefix.
-If false, move point to the end of the inserted text."
- :type 'boolean
- :group 'slime-ui)
-
-(defcustom slime-complete-symbol*-fancy nil
- "Use information from argument lists for DWIM'ish symbol completion."
- :group 'slime-mode
- :type 'boolean)
-
-(defun slime-complete-symbol* ()
- "Expand abbreviations and complete the symbol at point."
- ;; NB: It is only the name part of the symbol that we actually want
- ;; to complete -- the package prefix, if given, is just context.
- (or (slime-maybe-complete-as-filename)
- (slime-expand-abbreviations-and-complete)))
-
-;; FIXME: factorize
-(defun slime-expand-abbreviations-and-complete ()
- (let* ((end (move-marker (make-marker) (slime-symbol-end-pos)))
- (beg (move-marker (make-marker) (slime-symbol-start-pos)))
- (prefix (buffer-substring-no-properties beg end))
- (completion-result (slime-contextual-completions beg end))
- (completion-set (first completion-result))
- (completed-prefix (second completion-result)))
- (if (null completion-set)
- (progn (slime-minibuffer-respecting-message
- "Can't find completion for \"%s\"" prefix)
- (ding)
- (slime-complete-restore-window-configuration))
- ;; some XEmacs issue makes this distinction necessary
- (cond ((> (length completed-prefix) (- end beg))
- (goto-char end)
- (insert-and-inherit completed-prefix)
- (delete-region beg end)
- (goto-char (+ beg (length completed-prefix))))
- (t nil))
- (cond ((and (member completed-prefix completion-set)
- (slime-length= completion-set 1))
- (slime-minibuffer-respecting-message "Sole completion")
- (when slime-complete-symbol*-fancy
- (slime-complete-symbol*-fancy-bit))
- (slime-complete-restore-window-configuration))
- ;; Incomplete
- (t
- (when (member completed-prefix completion-set)
- (slime-minibuffer-respecting-message
- "Complete but not unique"))
- (when slime-c-p-c-unambiguous-prefix-p
- (let ((unambiguous-completion-length
- (loop for c in completion-set
- minimizing (or (mismatch completed-prefix c)
- (length completed-prefix)))))
- (goto-char (+ beg unambiguous-completion-length))))
- (slime-display-or-scroll-completions completion-set
- completed-prefix))))))
-
-(defun slime-complete-symbol*-fancy-bit ()
- "Do fancy tricks after completing a symbol.
-\(Insert a space or close-paren based on arglist information.)"
- (let ((arglist (slime-retrieve-arglist (slime-symbol-at-point))))
- (unless (eq arglist :not-available)
- (let ((args
- ;; Don't intern these symbols
- (let ((obarray (make-vector 10 0)))
- (cdr (read arglist))))
- (function-call-position-p
- (save-excursion
- (backward-sexp)
- (equal (char-before) ?\())))
- (when function-call-position-p
- (if (null args)
- (insert-and-inherit ")")
- (insert-and-inherit " ")
- (when (and (slime-background-activities-enabled-p)
- (not (minibuffer-window-active-p (minibuffer-window))))
- (slime-echo-arglist))))))))
-
-(defun* slime-contextual-completions (beg end)
- "Return a list of completions of the token from BEG to END in the
-current buffer."
- (let ((token (buffer-substring-no-properties beg end)))
- (cond
- ((and (< beg (point-max))
- (string= (buffer-substring-no-properties beg (1+ beg)) ":"))
- ;; Contextual keyword completion
- (let ((completions
- (slime-completions-for-keyword token
- (save-excursion
- (goto-char beg)
- (slime-parse-form-upto-point)))))
- (when (first completions)
- (return-from slime-contextual-completions completions))
- ;; If no matching keyword was found, do regular symbol
- ;; completion.
- ))
- ((and (>= (length token) 2)
- (string= (subseq token 0 2) "#\\"))
- ;; Character name completion
- (return-from slime-contextual-completions
- (slime-completions-for-character token))))
- ;; Regular symbol completion
- (slime-completions token)))
-
-(defun slime-completions (prefix)
- (slime-eval `(swank:completions ,prefix ',(slime-current-package))))
-
-(defun slime-completions-for-keyword (prefix buffer-form)
- (slime-eval `(swank:completions-for-keyword ,prefix ',buffer-form)))
-
-(defun slime-completions-for-character (prefix)
- (flet ((append-char-syntax (string) (concat "#\\" string)))
- (let ((result (slime-eval `(swank:completions-for-character
- ,(subseq prefix 2)))))
- (when (car result)
- (list (mapcar 'append-char-syntax (car result))
- (append-char-syntax (cadr result)))))))
-
-
-;;; Complete form
-
-(defun slime-complete-form ()
- "Complete the form at point.
-This is a superset of the functionality of `slime-insert-arglist'."
- (interactive)
- ;; Find the (possibly incomplete) form around point.
- (let ((buffer-form (slime-parse-form-upto-point)))
- (let ((result (slime-eval `(swank:complete-form ',buffer-form))))
- (if (eq result :not-available)
- (error "Could not generate completion for the form `%s'" buffer-form)
- (progn
- (just-one-space (if (looking-back "\\s(" (1- (point)))
- 0
- 1))
- (save-excursion
- (insert result)
- (let ((slime-close-parens-limit 1))
- (slime-close-all-parens-in-sexp)))
- (save-excursion
- (backward-up-list 1)
- (indent-sexp)))))))
-
-;;; Tests
-
-(def-slime-test complete-symbol*
- (prefix expected-completions)
- "Find the completions of a symbol-name prefix."
- '(("cl:compile" (("cl:compile" "cl:compile-file" "cl:compile-file-pathname"
- "cl:compiled-function" "cl:compiled-function-p"
- "cl:compiler-macro" "cl:compiler-macro-function")
- "cl:compile"))
- ("cl:foobar" nil)
- ("swank::compile-file" (("swank::compile-file"
- "swank::compile-file-for-emacs"
- "swank::compile-file-if-needed"
- "swank::compile-file-output"
- "swank::compile-file-pathname")
- "swank::compile-file"))
- ("cl:m-v-l" (("cl:multiple-value-list" "cl:multiple-values-limit") "cl:multiple-value"))
- ("common-lisp" (("common-lisp-user:" "common-lisp:") "common-lisp")))
- (let ((completions (slime-completions prefix)))
- (slime-test-expect "Completion set" expected-completions completions)))
-
-(def-slime-test complete-form
- (buffer-sexpr wished-completion &optional skip-trailing-test-p)
- ""
- '(("(defmethod arglist-dispatch *HERE*"
- "(defmethod arglist-dispatch (operator arguments) body...)")
- ("(with-struct *HERE*"
- "(with-struct (conc-name names...) obj body...)")
- ("(with-struct *HERE*"
- "(with-struct (conc-name names...) obj body...)")
- ("(with-struct (*HERE*"
- "(with-struct (conc-name names...)" t)
- ("(with-struct (foo. bar baz *HERE*"
- "(with-struct (foo. bar baz names...)" t))
- (slime-check-top-level)
- (with-temp-buffer
- (lisp-mode)
- (setq slime-buffer-package "SWANK")
- (insert buffer-sexpr)
- (search-backward "*HERE*")
- (delete-region (match-beginning 0) (match-end 0))
- (slime-complete-form)
- (slime-check-completed-form buffer-sexpr wished-completion)
-
- ;; Now the same but with trailing `)' for paredit users...
- (unless skip-trailing-test-p
- (erase-buffer)
- (insert buffer-sexpr)
- (search-backward "*HERE*")
- (delete-region (match-beginning 0) (match-end 0))
- (insert ")") (backward-char)
- (slime-complete-form)
- (slime-check-completed-form (concat buffer-sexpr ")") wished-completion))
- ))
-
-(defun slime-check-completed-form (buffer-sexpr wished-completion)
- (slime-test-expect (format "Completed form for `%s' is as expected"
- buffer-sexpr)
- wished-completion
- (buffer-string)
- 'equal))
-
-(provide 'slime-c-p-c)
-
View
165 elisp/slime-2010-09-17/contrib/slime-clipboard.el
@@ -1,165 +0,0 @@
-
-(define-slime-contrib slime-clipboard
- "This add a few commands to put objects into a clipboard and to
-insert textual references to those objects.
-
-The clipboard command prefix is C-c @.
-
- C-c @ + adds an object to the clipboard
- C-c @ @ inserts a reference to an object in the clipboard
- C-c @ ? displays the clipboard
-
-This package also also binds the + key in the inspector and
-debugger to add the object at point to the clipboard."
- (:authors "Helmut Eller <heller@common-lisp.net>")
- (:license "GPL")
- (:swank-dependencies swank-clipboard))
-
-(define-derived-mode slime-clipboard-mode fundamental-mode
- "Slime-Clipboard"
- "SLIME Clipboad Mode.
-
-\\{slime-clipboard-mode-map}")
-
-(slime-define-keys slime-clipboard-mode-map
- ("g" 'slime-clipboard-redisplay)
- ((kbd "C-k") 'slime-clipboard-delete-entry)
- ("i" 'slime-clipboard-inspect))
-
-(defvar slime-clipboard-map (make-sparse-keymap))
-
-(slime-define-keys slime-clipboard-map
- ("?" 'slime-clipboard-display)
- ("+" 'slime-clipboard-add)
- ("@" 'slime-clipboard-ref))
-
-(define-key slime-mode-map (kbd "C-c @") slime-clipboard-map)
-(define-key slime-repl-mode-map (kbd "C-c @") slime-clipboard-map)
-
-(slime-define-keys slime-inspector-mode-map
- ("+" 'slime-clipboard-add-from-inspector))
-
-(slime-define-keys sldb-mode-map
- ("+" 'slime-clipboard-add-from-sldb))
-
-(defun slime-clipboard-add (exp package)
- "Add an object to the clipboard."
- (interactive (list (slime-read-from-minibuffer
- "Add to clipboard (evaluated): "
- (slime-sexp-at-point))
- (slime-current-package)))
- (slime-clipboard-add-internal `(:string ,exp ,package)))
-
-(defun slime-clipboard-add-internal (datum)
- (slime-eval-async `(swank-clipboard:add ',datum)
- (lambda (result) (message "%s" result))))
-
-(defun slime-clipboard-display ()
- "Display the content of the clipboard."
- (interactive)
- (slime-eval-async `(swank-clipboard:entries)
- #'slime-clipboard-display-entries))
-
-(defun slime-clipboard-display-entries (entries)
- (slime-with-popup-buffer ((slime-buffer-name :clipboard)
- :mode 'slime-clipboard-mode)
- (slime-clipboard-insert-entries entries)))
-
-(defun slime-clipboard-insert-entries (entries)
- (let ((fstring "%2s %3s %s\n"))
- (insert (format fstring "Nr" "Id" "Value")
- (format fstring "--" "--" "-----" ))
- (save-excursion
- (loop for i from 0 for (ref . value) in entries do
- (slime-insert-propertized `(slime-clipboard-entry ,i
- slime-clipboard-ref ,ref)
- (format fstring i ref value))))))
-
-(defun slime-clipboard-redisplay ()
- "Update the clipboard buffer."
- (interactive)
- (slime-eval-async
- `(swank-clipboard:entries)
- (lambda (entries)
- (let ((inhibit-read-only t))
- (slime-save-coordinates (point)
- (erase-buffer)
- (slime-clipboard-insert-entries entries))))))
-
-(defun slime-clipboard-entry-at-point ()
- (or (get-text-property (point) 'slime-clipboard-entry)
- (error "No clipboard entry at point")))
-
-(defun slime-clipboard-ref-at-point ()
- (or (get-text-property (point) 'slime-clipboard-ref)
- (error "No clipboard ref at point")))
-
-(defun slime-clipboard-inspect (&optional entry)
- "Inspect the current clipboard entry."
- (interactive (list (slime-clipboard-ref-at-point)))
- (slime-inspect (prin1-to-string `(swank-clipboard::clipboard-ref ,entry))))
-
-(defun slime-clipboard-delete-entry (&optional entry)
- "Delete the current entry from the clipboard."
- (interactive (list (slime-clipboard-entry-at-point)))
- (slime-eval-async `(swank-clipboard:delete-entry ,entry)
- (lambda (result)
- (slime-clipboard-redisplay)
- (message "%s" result))))
-
-(defun slime-clipboard-ref ()
- "Ask for a clipboard entry number and insert a reference to it."
- (interactive)
- (slime-clipboard-read-entry-number #'slime-clipboard-insert-ref))
-
-;; insert a reference to clipboard entry ENTRY at point. The text
-;; receives a special 'display property to make it look nicer. We
-;; remove this property in a modification when a user tries to modify
-;; he real text.
-(defun slime-clipboard-insert-ref (entry)
- (destructuring-bind (ref . string)
- (slime-eval `(swank-clipboard:entry-to-ref ,entry))
- (slime-insert-propertized
- `(display ,(format "#@%d%s" ref string)
- modification-hooks (slime-clipboard-ref-modified)
- rear-nonsticky t)
- (format "(swank-clipboard::clipboard-ref %d)" ref))))
-
-(defun slime-clipboard-ref-modified (start end)
- (when (get-text-property start 'display)
- (let ((inhibit-modification-hooks t))
- (save-excursion
- (goto-char start)
- (destructuring-bind (dstart dend) (slime-property-bounds 'display)
- (unless (and (= start dstart) (= end dend))
- (remove-list-of-text-properties
- dstart dend '(display modification-hooks))))))))
-
-;; Read a entry number.
-;; Written in CPS because the display the clipboard before reading.
-(defun slime-clipboard-read-entry-number (k)
- (slime-eval-async
- `(swank-clipboard:entries)
- (slime-rcurry
- (lambda (entries window-config k)
- (slime-clipboard-display-entries entries)
- (let ((entry (unwind-protect
- (read-from-minibuffer "Entry number: " nil nil t)
- (set-window-configuration window-config))))
- (funcall k entry)))
- (current-window-configuration)
- k)))
-
-(defun slime-clipboard-add-from-inspector ()
- (interactive)
- (let ((part (or (get-text-property (point) 'slime-part-number)
- (error "No part at point"))))
- (slime-clipboard-add-internal `(:inspector ,part))))
-
-(defun slime-clipboard-add-from-sldb ()
- (interactive)
- (slime-clipboard-add-internal
- `(:sldb ,(sldb-frame-number-at-point)
- ,(sldb-var-number-at-point))))
-
-(provide 'slime-clipboard)
View
182 elisp/slime-2010-09-17/contrib/slime-compiler-notes-tree.el
@@ -1,182 +0,0 @@
-
-(define-slime-contrib slime-compiler-notes-tree
- "Display compiler messages in tree layout.
-
-M-x slime-list-compiler-notes display the compiler notes in a tree
-grouped by severity.
-
- `slime-maybe-list-compiler-notes' can be used as
- `slime-compilation-finished-hook'.
-"
- (:authors "Helmut Eller <heller@common-lisp.net>")
- (:license "GPL"))
-
-(defun slime-maybe-list-compiler-notes (notes)
- "Show the compiler notes if appropriate."
- ;; don't pop up a buffer if all notes are already annotated in the
- ;; buffer itself
- (unless (every #'slime-note-has-location-p notes)
- (slime-list-compiler-notes notes)))
-
-(defun slime-list-compiler-notes (notes)
- "Show the compiler notes NOTES in tree view."
- (interactive (list (slime-compiler-notes)))
- (with-temp-message "Preparing compiler note tree..."
- (slime-with-popup-buffer ((slime-buffer-name :notes)
- :mode 'slime-compiler-notes-mode)
- (when (null notes)
- (insert "[no notes]"))
- (let ((collapsed-p))
- (dolist (tree (slime-compiler-notes-to-tree notes))
- (when (slime-tree.collapsed-p tree) (setf collapsed-p t))
- (slime-tree-insert tree "")
- (insert "\n"))
- (goto-char (point-min))))))
-
-(defvar slime-tree-printer 'slime-tree-default-printer)
-
-(defun slime-tree-for-note (note)
- (make-slime-tree :item (slime-note.message note)
- :plist (list 'note note)
- :print-fn slime-tree-printer))
-
-(defun slime-tree-for-severity (severity notes collapsed-p)
- (make-slime-tree :item (format "%s (%d)"
- (slime-severity-label severity)
- (length notes))
- :kids (mapcar #'slime-tree-for-note notes)
- :collapsed-p collapsed-p))
-
-(defun slime-compiler-notes-to-tree (notes)
- (let* ((alist (slime-alistify notes #'slime-note.severity #'eq))
- (collapsed-p (slime-length> alist 1)))
- (loop for (severity . notes) in alist
- collect (slime-tree-for-severity severity notes
- collapsed-p))))
-
-(defvar slime-compiler-notes-mode-map)
-
-(define-derived-mode slime-compiler-notes-mode fundamental-mode
- "Compiler-Notes"
- "\\<slime-compiler-notes-mode-map>\
-\\{slime-compiler-notes-mode-map}
-\\{slime-popup-buffer-mode-map}
-"
- (slime-set-truncate-lines))
-
-(slime-define-keys slime-compiler-notes-mode-map
- ((kbd "RET") 'slime-compiler-notes-default-action-or-show-details)
- ([return] 'slime-compiler-notes-default-action-or-show-details)
- ([mouse-2] 'slime-compiler-notes-default-action-or-show-details/mouse))
-
-(defun slime-compiler-notes-default-action-or-show-details/mouse (event)
- "Invoke the action pointed at by the mouse, or show details."
- (interactive "e")
- (destructuring-bind (mouse-2 (w pos &rest _) &rest __) event
- (save-excursion
- (goto-char pos)
- (let ((fn (get-text-property (point)
- 'slime-compiler-notes-default-action)))
- (if fn (funcall fn) (slime-compiler-notes-show-details))))))
-
-(defun slime-compiler-notes-default-action-or-show-details ()
- "Invoke the action at point, or show details."
- (interactive)
- (let ((fn (get-text-property (point) 'slime-compiler-notes-default-action)))
- (if fn (funcall fn) (slime-compiler-notes-show-details))))
-
-(defun slime-compiler-notes-show-details ()
- (interactive)
- (let* ((tree (slime-tree-at-point))
- (note (plist-get (slime-tree.plist tree) 'note))
- (inhibit-read-only t))
- (cond ((not (slime-tree-leaf-p tree))
- (slime-tree-toggle tree))
- (t
- (slime-show-source-location (slime-note.location note) t)))))
-
-
-;;;;;; Tree Widget
-
-(defstruct (slime-tree (:conc-name slime-tree.))
- item
- (print-fn #'slime-tree-default-printer :type function)
- (kids '() :type list)
- (collapsed-p t :type boolean)
- (prefix "" :type string)
- (start-mark nil)
- (end-mark nil)
- (plist '() :type list))
-
-(defun slime-tree-leaf-p (tree)
- (not (slime-tree.kids tree)))
-
-(defun slime-tree-default-printer (tree)
- (princ (slime-tree.item tree) (current-buffer)))
-
-(defun slime-tree-decoration (tree)
- (cond ((slime-tree-leaf-p tree) "-- ")
- ((slime-tree.collapsed-p tree) "[+] ")
- (t "-+ ")))
-
-(defun slime-tree-insert-list (list prefix)
- "Insert a list of trees."
- (loop for (elt . rest) on list
- do (cond (rest
- (insert prefix " |")
- (slime-tree-insert elt (concat prefix " |"))
- (insert "\n"))
- (t
- (insert prefix " `")
- (slime-tree-insert elt (concat prefix " "))))))
-
-(defun slime-tree-insert-decoration (tree)
- (insert (slime-tree-decoration tree)))
-
-(defun slime-tree-indent-item (start end prefix)
- "Insert PREFIX at the beginning of each but the first line.
-This is used for labels spanning multiple lines."
- (save-excursion
- (goto-char end)
- (beginning-of-line)
- (while (< start (point))
- (insert-before-markers prefix)