text:
Parent Directory | Revision Log
|Links to HEAD:
|(view) (annotate)
|Sticky Tag:
* slime.el (slime-delete-package): New command. * swank.lisp (swank-delete-package): The corresponding Swank part.
* swank.lisp (swank-profile-package): New wrapper for profile-package that does some input validation. * slime.el (slime-profile-package): Use it.
* swank.lisp (swank-compile-file*): Renamed from compile-file-with-compile-file.
* swank.lisp (frame-locals-for-emacs): Print variable names in frame-package.
* swank.lisp (find-definitions-find-symbol-or-package): Rename from `find-definitions-find-symbol'. Packages are not named by symbols and an uninterned string can refer to a package. In case it finds a package, return a new uninterned symbol.
* swank.lisp (thread-for-evaluation): Use INTEGER, not FIXNUM, as a specializer, FIXNUM is not a standard class.
* swank.lisp (thread-for-evaluation): Make generic. Remove keyword arg. Don't call find-repl-thread.
* swank-asdf.lisp: Better ASDF support. * swank.lisp (*compile-file-for-emacs-hook*): A hook for compile-file-for-emacs, so that ASDF can hook its compilation functions.
* swank.lisp (with-panic-handler): Abort the condition after closing the connection, otherwise it ends up in the slime debugger causing nested errors.
* swank.lisp (interrupt-worker-thread): Solve *send-counter* binding problem. find-worker-thread: Merge with `thread-for-evaluation'.
* swank.lisp (condition-message): New. Binds *print-cirlce. (safe-condition-message): Move binding of printer vars to condition-message. (*sldb-condition-printer*): Set it to #'condition-message.
* swank.lisp (safe-condition-message): Truncate the string after 64KB.
* slime.el (report-condition-with-circular-list): New test. * swank.lisp (safe-condition-message): Bind *print-length*.
* swank.lisp (close-connection%): Let *debugger-hook* be nil across the entire function to that we don't call our own debugger if we ever get some error during CLOSE or somesuch.
* clean up: (signal (make-condition ...)) => (signal ...)
* swank.lisp, swank-rpc.lisp: iso-8859-1 is not same as latin-1-unix.
* swank.lisp (find-definitions-find-symbol): Put back accidentally removed with-buffer-syntax.
* swank.lisp (*find-definitions-right-trim*) (*find-definitions-left-trim*): New variables. ",:." and "#:" default values. (find-definitions-for-emacs): Trim names with using the above variables when a symbol is not found.
* Use #\; to separate the file options.
Fix long lines. * swank.lisp: * slime.el: * ChangeLog:
*** empty log message ***
* swank.lisp (interrupt-worker-thread): Interrupt the REPL thread if there are no threads found. Send Emacs an error message if no threads are found at all.
* swank.lisp (swank-require): Ensure that provide as called.
Add a "sentinel thread" to protect access to global lists. * swank.lisp (start-sentinel, sentinel, send-to-sentinel) (sentinel-serve, sentinel-stop-server, sentinel-maybe-exit): New. (make-connection, close-connection, setup-server, stop-server): Use the sentinel. (close-connection%): Factored out. * swank-backend.lisp (register-thread, find-registered): New. * swank-allegro.lisp: Implement it. * swank-ccl.lisp: * swank-lispworks.lisp: * swank-sbcl.lisp:
* swank.lisp (throw-to-toplevel): If *sldb-quit-restart* is not found, try to invoke the last restart, which usually is a top-level abort restart. This is useful when the debugger is invoked from a non-slime thread.
* swank.lisp (auto-flush-loop): Don't use call-with-io-timeout. Removing it had no effect on the number of failed tests. If you want it back, first create a test case to demonstrate the problem. * swank-backend.lisp: Mention that locks should only be used in swank-gray.lisp.
* swank.lisp: Move global io-redirection contrib/slime-repl.lisp.
Make *active-threads* a slot of the connection struct. * swank.lisp (*active-threads*): Deleted ([struct] multithreaded-connection): New slot active-threads. (find-worker-thread, interrupt-worker-thread) (thread-for-evaluation): Update accordingly. (add-active-thread, remove-active-thread): New helpers.
Create an extra thread for the indentation cache. * swank.lisp (indentation-cache-loop): New. ([struct] multithreaded-connection): New slot indentation-cache-thread. (control-thread, cleanup-connection-threads): Create/kill it. (send-to-indentation-cache): New function. (update-indentation-information, sync-indentation-to-emacs): Use it. (perform-indentation-update, update-indentation/delta-for-emacs): Add package as argument; that used to be *buffer-package. Can again be simpler as the indentation-cache-thread doesn't share the cache with others. (handle-indentation-cache-request, symbol-packages): New helpers.
* swank.lisp (*slime-interrupts-enabled*): Describe the idea behind the interrupt handlig code a bit.
Make *event-queue* and *events-enqueued* slots of the connection struct. * swank.lisp (*event-queue*, *events-enqueued*): Deleted ([struct] singlethreaded-connection): New slots event-queue and events-enqueued. (poll-for-event, send-event, wait-for-event/event-loop): Update accordingly.
* swank.lisp (send-to-emacs): Add a without-slime-interrupts to protect send/receive from arbitrary interrupts.
Move flow control from dispatch-event to send-to-emacs. * swank.lisp (*send-counter*): New thread local variable. (with-connection): Bind it. (send-to-emacs): Call maybe-slow-down. (maybe-slow-down, ping-pong): Go through dispatch-event instead of writing to the socket directly. (dispatch-event): Re-add thread arg to :ping/:emacs-pong. Also add a :test-delay event. (perform-indentation-update): Use with-connection to bind *emacs-connection* and *send-counter*. (background-message): Remove reference to connection.slowdown. (flow-control-test): New support code for testing flow-control. ([defstruct] connection): Delete send-counter and slowdown slots. * slime.el (slime-dispatch-event): Re-add thread arg to :ping/:emacs-pong and :test-delay event. ([test] flow-control): New test.
* swank.lisp (background-message): Do nothing if connection.slowdown is set.
Move flow control into dispatch-event. * swank.lisp (maybe-slow-down, ping-pong): New functions. (dispatch-event): Use it. Also require connection argument. Update callers accordingly. ([defstruct] connection): New slots: send-counter and slowdown. * slime.el (slime-dispatch-event): Drop thread from :ping/:emacs-ping messages. Use subclasses of connection. Wasn't neccessary for flow control but seems like a good idea for the future. * swank.lisp (multithreaded-connection) (singlethreaded-connection): New (make-connection): Create multi/single threaded variant depending on style argument. ([defstruct] serve-requests, cleanup): Delete slots. Dispatch on connection type instead. (stop-serving-requests): New. (close-connection): Use it. Can't use *use-dedicated-output-stream* here.
* swank.lisp (interrupt-worker-thread): Don't use find-repl-thread as fallback.
* swank.lisp: Minor cleanups. * swank-rpc.lisp:
Ooops forgot this file in last commit.
* swank.lisp (listener-channel): Moved to contrib/swank-mrepl.lisp (create-listener, initial-listener-bindings, spawn-listener-thread).
* swank.lisp (do-symbols*, classify-symbol) (symbol-classification-string): Moved to contrib/swank-util.lisp.
* swank.lisp (to-line): Increase default limit to 512. (frame-locals-for-emacs): Let *print-right-margin* override default line width.
* swank.lisp (create-server): Add a :backlog argument. (setup-server): Pass it along. * swank-backend.lisp (create-socket): Backlog argument. * swank-abcl.lisp: Implement it. * swank-allegro.lisp: * swank-ccl.lisp: * swank-clisp.lisp: * swank-cmucl.lisp: * swank-corman.lisp: * swank-ecl.lisp: * swank-lispworks.lisp: * swank-sbcl.lisp: * swank-scl.lisp:
* swank.lisp (create-server): Remove coding-system argument. ([defstruct] connection): Remove coding-system slot. (connection.external-format, *coding-system*): Deleted. (make-connection, start-server, create-server, setup-server) (accept-connections): Drop coding-system arg. (connection-info): Return supported coding systems. (create-repl, open-dedicated-output-stream) (open-streams, initialize-streams-for-connection): Add coding-system arg. * slime.el (slime-init-command): Ignore the coding-system arg. (slime-connection-coding-systems): New connection variable. (slime-set-connection-info): Set it.
* swank.lisp (eval-in-frame-aux): Don't bind *package* during eval.
* swank.lisp (*sldb-printer-bindings*): Removed. Rather useless since the change from 2009-02-26. It could at best have some influence on the way conditions are printed. *sldb-string-length* and *sldb-bitvector-length* where both nil so *sldb-pprint-dispatch-table* was also not used by default. In summary, spending 3 pages for something that's not used by default was pretty silly. One variable less where we can get the defaults wrong.
* slime.el (sldb-eval-in-frame): Try to figure the package out. Ask Lisp if the function for frame was defined in a particular package and use it to read the form. (sldb-read-form-for-frame): New helper. * swank-backend (frame-package): New. * swank-cmucl (frame-package): Implement it. * swank.lisp (frame-package-name, eval-in-frame-aux): New. (eval-string-in-frame, pprint-eval-string-in-frame): Use package argument.
* swank.lisp (open-dedicated-output-stream): Open a stream with the right coding system. Change (:open-dedicated-output-stream port) message to (:open-dedicated-output-stream port coding-system), because Emacs can no longer determine the coding system based on the main network streams since they are binary now. * contrib/slime-repl.el (slime-open-stream-to-lisp): Set the process coding system to the right coding system.
* slime.el (slime-run-test): Renamed from slime-run-one-test. (slime-toggle-test-debug-on-error): New. ([test] break): Longer timeouts.
New wire format. Switch from character streams to binary streams. Counting characters was error prone because some Lisps use utf-16 internally and so READ-SEQUENCE can't be used easily. The new format looks so: | byte0 | 3 bytes length | | ... payload ... | The playload is an s-exp encoded as UTF-8 string. byte0 is currently always 0; other values are reserved for future use. * swank-rpc.lisp (write-message): Use new format. (write-header, parse-header, asciify, encoding-error): New. * swank.lisp (accept-connections): Create a binary stream. (input-available-p): Can't read-char-no-hang on binary streams. * slime.el (slime-net-connect): Use binary as coding system. (slime-net-send, slime-net-read, slime-net-decode-length) (slime-net-encode-length, slime-net-have-input-p): Use new format. (slime-unibyte-string, slime-handle-net-read-error): New. (featurep): Require 'un-define for XEmacs. ([test] break): Longer timeouts. * swank-sbcl.lisp (input-ready-p): Use sb-sys:wait-until-fd-usable.
* swank.lisp (close-connection): Fix thinko.
* swank.lisp (close-connection): Be more careful with non-ascii.
* swank.lisp (all-completions): Remove mixed case syms e.g |Foo|. "fo" is not a prefix of "|Foo|" and it would be problematic later.
* swank.lisp (clear-repl-variables): New functions, clears *, /, and + variables. * contrib/slime-repl.el (slime-clear-repl-variables): New function, clears *, /, and + variables. (slime-repl-clear-buffer-hook): Add `slime-clear-repl-variables' to it, now C-c M-o clears variables, allowing bound objects to be GCed.
* swank-allegro.lisp (with-redirected-y-or-n-p): Fix modern-mode issues. Patch by Andrew Myers.
* slime.el (slime-unintern-symbol): New command. * swank.lisp (unintern-symbol): Lisp-side implementation.
swank: thread-safe indentation update without explicit locks * Spawn a new thread to perform the indentation update. * In the new thread, if we need to write to the cache, copy it first. This makes the cache read-only by the time other threads can see it -- so in the worst case we will only have parallel readers, not readers-and-writers. * Remove *INDENTATION-CACHE-LOCK*.
swank: lock around updating the indentation cache Hash-tables aren't necessarily thread safe. (Yes, I actually saw the table get corrupted -- this isn't just theoretical.)
macro-indentation: try to sort it out * Restore old default. * Give slime-indentation the more complex one, and try to address the issues of the previous attempt at complexity.
sbcl: workaround for auto-flush thread deadlocks Occasionally auto-flush thread could deadlock with a thread doing compilation: T1: grabs world-lock T2: decides to flush, grabs stream lock T1: needs to do output (compiler note, etc), waits on the stream lock T2: needs the world-lock for a while (PCL dispatch machinery setup, etc) KABOOM. This is an SBCL issue, no mistake about it -- but sorting out the world-lock handling is going to take a while, and sticking a deadline around the FINISH-OUTPUT call avoids the issue.
fix &optional and &key handling in MACRO-INDENTATION * Don't count &optional. * Deal with &key and &rest identically.
swank: better macro-indentation lisp-indent-259 didn't handle complex destructuring right: &whole nested in &whole wasn't working properly. Now it hopefully does. (But the whole indentation spec walking really deserves a rewrite.) Derived indentation: * Walk the entire macro lambda-list instead of just looking for &BODY in the toplevel. * Set the base indentation to 4 in macro-indentation only for the first level of destructuring -- use 1 later. now (defmacro foo (x (&rest args) &body body) ...) gives (foo (bar quux zot) (a b c d) ...) instead of the old (foo (bar quux zot) (a b c d) ...) While this change may turn out to be controversial, I feel that since FOO and (&REST FOO) are semantically equivalent as long as the corresponding argument is not an atom, it seems most natural to treat them as indentation hints instead. Complaints to the usual address...
slime-indentation: per-package indentation from swank SWANK sends indentation information for macro-lambda lists to the Emacs side. Prior to this, however, this was a lossy N->1 mapping, where different symbols with the same name from multiple packages were conflated. Now an indentation update also includes a list of packages where the symbol in question is accessible. If slime-indentation is not being used, this information is dropped by Emacs. If, however, slime-indentation is used, the package information is stored in common-lisp-system-indentation hash-table, which is used as a fallback when indentation from other sources is not available for the symbol in question. Package used for looking up the indentation spec is either picked up from the package qualifier in the source, or guessed from the buffer.
* slime.el (sdlb-print-condition): New (or old new) function. It was bound by P in sldb-mode, but for some reason it was lost.
* swank.lisp (list-threads): Call `use-threads-p' only when *emacs-connection* is non-nil. `use-threads-p' wouldn't work in this case, and there is no need to remove a worker thread from the list if it's not connected. This fixes an issue with calling swank:stop-server when slime isn't connected.
* swank.lisp (format-restarts-for-emacs): Add without-printing-errors around restart printing.
Be careful with interning. * swank.lisp (find-definitions-for-emacs): Use parse-symbol.
Don't double encode results for eval-in-emacs. * slime.el (slime-check-eval-in-emacs-result): New. (slime-eval-for-lisp): Use it. * swank.lisp (unreadable-object): Removed.
* swank.lisp (eval-in-emacs): Return unreadable results from Emacs as an unreadable-object, not as a string.
* slime.el (slime-eval-for-lisp): Return value as a string, because it can be unreadable, e.g. #<buffer foo> * swank.lisp (eval-in-emacs): Prevent reader errors.
* swank.lisp (eval-in-emacs): Export it.
Allow tail-merging in call-with-bindings. * swank.lisp (call-with-bindings): Don't use progv if alist is empty alist is empty.
* slime.el (slime-toggle-break-on-signals): New command. * swank.lisp (toggle-break-on-signals): The corresponding Lisp code.
* swank.lisp (invoke-nth-restart): Make sure there is such restart before invoking it.
Smarten up the label-value-line macros. - support a :label emacs font property - added key args: padding-length, display-nil-value, hide-when-nil, splice-as-ispec, value-text - label-value-line* will evaluate and splice the result of the form after a @ character
add richer location information to the position arg in compile-string-for-emacs R's source location recording infrastructure works with line/column offsets rather than with character offsets, so to get the right srcrefs associated with some string source we need to communicate line and column information from the source buffer. Unfortunately, only the emacs side can do that -- in principle, the R side has no direct access to the source file at all. This means a protocol change, converting the position argument in swank:compile-string-for-emacs to a list of <position>s in the slime source location grammar. At present, pass in both :position and :line kinds, and have swank:compile-string-for-emacs extract just the :position for passing on to swank-compile-string.
Rename slime-macro/compiler-macro-expand-1 => slime-expand-1 * slime.el (slime-expand-1): Renamed from slime-macro/compiler-macro-expand-1. (slime-expand-1-inplace): Renamed from slime-macro/compiler-macro-expand-1-inplace. * swank.lisp (swank-expand-1): Renamed from swank-macro/compiler-macro-expand-1. (swank-expand): Renamed from swank-macro/compiler-macro-expand. (expand-1): Renamed from macro/compiler-macro-expand-1. (expand): Renamed from macro/compiler-macro-expand.
* swank.lisp (eval-for-emacs): Send (:abort condition) where condition is a condition which was aborted instead of just (:abort). * slime.el: Handle the above change. * contrib/slime-repl.el: Handle (:abort condition) message from lisp.
* swank.lisp (before-init): push :SWANK to *FEATURES*. (lp#627313)
Make C-c C-m also expand compiler macros. (lp#638720) * slime.el (slime-macro/compiler-macro-expand-1): New. (slime-macro/compiler-macro-expand-1-inplace): New. (slime-editing-keys): Map `C-c C-m' to first above. (slime-compiler-macroexpand-1): Take prefix-arg like others. (slime-compiler-macroexpand-1-inplace): Ditto. (slime-compiler-macroexpand): Thus deleted. (slime-compiler-macroexpand-inplace): Ditto. * swank.lisp (swank-macro/compiler-macro-expand-1): New interface. (swank-macro/compiler-macro-expand): New interface. (macro/compiler-macro-expand-1): New. (macro/compiler-macro-expand): New. (expand-repeatedly): New helper.
For C-c C-k, ask before loading possibly broken fasl files. * slime.el (slime-compilation-result): Add 2 slots: loadp and faslfile. (slime-compilation-finished): Use them to load the faslfile. * swank.lisp (:compilation-result): Add 2 slots. Use keyword constructor. (compile-file-for-emacs): Return loadp and faslfile to Emacs. (collect-notes): Pass loadp and falsfile along.
* swank.lisp (setup-server): Check the coding system before doing anything, otherwise it may be eaten by ignore-errors later.
Bind *print-readably* to nil when printing the title. * swank.lisp (prepare-title): Factored out into new function. (*inspector-printer-bindings*) (*inspector-verbose-printer-bindings*): New. (with-string-stream): New. (emacs-inspect/istate): Renamed from emacs-inspect/printer-bindings.
* slime.el (slime-dispatch-event): :eval-no-wait, lisp sends a form in a string, not a function name and arguments. Add slime-check-eval-in-emacs-enabled. * swank.lisp (defpackage): export eval-for-emacs.
Don't get confused by END-OF-FILE on unrelated streams. Fixes bug "slime connection broken on trivial condition..." Reported by Pascal J. Bourguignon. * swank.lisp (end-of-repl-input): New condition. (simple-repl, read-non-blocking): Use it. * slime.el ([test] end-of-file): Test it.
* swank.lisp (print-part-to-string): Bind *print-readably* to nil. Useful when debugging broken printer methods.
* slime.el, swank.lisp: #'(lambda -> (lambda
* swank.lisp: Move definition of LCONS before first use. Patch from Stelian Ionescu <firstname.lastname@example.com>
Some *sldb-quit-restart* related fixes. * swank.lisp (*sldb-quit-restart*): Set to nil by default. (throw-to-toplevel, debug-in-emacs): Get rid of boundp tests. (format-restarts-for-emacs): Add a mark for *sldb-quit-restart*. (handle-requests): Always bind *emacs-connection*. (with-connection): Get rid of call-with-connection so that compilers can remove the call frame more easily. (repl-input-stream-read): Factored out from make-repl-input-stream. Bind a *sldb-quit-restart* here too; no need to restart the repl and a extra prompt for errors in Emacs requests.
Clean up some of the confusion regarding *sldb-quit-restart*. * swank.lisp (top-level-restart-p, *toplevel-restart-available*) (coerce-restart): Deleted. (with-top-level-restart, simple-repl): Simplify.
* swank.lisp (swank-error): Unrename from swank-protocol-error.
* slime.el (sldb-insert-condition): Don't create a mouse tooltip for long error message, tooltip shows the same text and doesn't add any value. (slime-definition-at-point): factor out of `slime-inspect-definition'. (slime-disassemble-definition): New, similar to `slime-inspect-definition'. * swank.lisp (disassemble-form): rename from disassemble-symbol, do the same as before but evaluate the argument.
* swank.lisp (*after-init-hook*, simple-break) (coerce-to-condition, use-threads-p, current-thread-id): Moved around in swank.lisp. (with-temp-package): Deleted; not used anywhere. (ensure-list): Use in SWANK-REQUIRE.
* swank.lisp (format-values-for-echo-area): Also print the length of an integer in bits.
* swank.lisp (symbol-classification-string): New function to replace (symbol-classification->string (classify-symbol symbol)). It's faster and conses much less, while it is called many times by fuzzy completion and fancy inspector. (symbol-classification->string): Removed. (list-threads): Exclude the current thread only if its name is "worker".
* slime.el (slime-threads-update-interval): New customization variable, if set to a number the threads buffer will updated with this interval. (slime-with-popup-buffer): Rename modes option to mode, for a major mode. Enabling minor modes from within the body doesn't cause troubles. End that way it is compatible with XEmacs since it doesn't need to use minor-mode-list to distinguish between minor and major modes. * swank.lisp (list-threads): Delete the current thread from the listing.
* swank.lisp (compile-file-for-emacs): Actually commit the change described in 2010-04-12.
Handle errors during interrupt processing with SLDB. Bugfix for http://article.gmane.org/gmane.lisp.slime.devel/9641 * swank.lisp (invoke-or-queue-interrupt): When the queue is full, process the interrupt immediately and also handle SERIOUS-CONDITIONs during interrupt processing in SLDB. SLDB should work more likely than the interrupted code is expected to handle the condition. (with-interrupts-enabled%): Don't check for interrupts when toggling interrupts off. (wait-for-event): Add docstring.
Move error handling and logging from swank-rpc.lisp to swank.lisp * swank.lisp (log-event, destructure-case, decode-message) (encode-message, decode-message, swank-protocol-error): Moved back to swank.lisp from swank-rpc.lisp. It never belonged there anyway. * swank-rpc.lisp (read-message, write-message): New functions. (swank-reader-error): New condition.
Minor cleanups * swank.lisp (connection): Make socket-io read-only again. (*connections*): Move declaration before first use. (finish-connection-setup): Merged into make-connection. (accept-connections): Renamed from serve-connection and reorganized so that the socket-io slot can be read-only. (accept-authenticated-connection): Renamed to authenticate-client. Update callers accordingly.
* swank.lisp (connection-info): Use princ-to-string rather than prin1-to-string as the latter may barf if *print-readably* is nil.
* slime.el (slime-lisp-implementation-program): New connection variable. (slime-set-connection-info): Adapted to set it. (slime-attach-gdb): Use it to invoke gdb so gdb is able to find debugging symbols on non-Linux platforms. * swank.lisp (connection-info): Include lisp-implementation-program. * swank-backend.lisp (lisp-implementation-program): New interface. Default implementation based on command-line-args. * swank-ecl.lisp (command-line-args): Implement.
Remove attach-gdb restart. Instead add SLDB shortcut `A'. * slime.el (slime-dispatch-event): Remove :gdb-attach. (slime-attach-gdb): Changed API. Takes connection not pid now and lightweight &optional arg. If not lightweight, get the default gdb config from the inferior Lisp. (sldb-break-with-system-debugger): New command, bound to `A' in sldb. Called this way to mimick `sldb-break-with-default-debugger', and because it may make sense to go beyond gdb in future, e.g. to invoke the Java Debugger for ABCL. * swank.lisp (call-with-gdb-restart, with-gdb-restart): Removed. (with-top-level-restart): Remove use of with-gdb-restart. (make-connection, start-server, create-server, setup-server): Remove inferior-lisp flag again. Not needed anymore.
* swank.lisp (call-with-gdb-restart): Forgot to remove trailing T.
* swank.lisp (open-dedicated-output-stream): Forgot to rename accept-authenticated-connection to accept-authenticated-client here.
Add an ATTACH-GDB restart to SLDB. * swank.lisp (call-with-gdb-restart): New. Sends the new :gdb-attach event to Emacs. (with-gdb-restart): Sugar. (with-top-level-restart): Also expand to with-gdb-restart. (dispatch-event): Add :gdb-attach event. * swank-backend.lisp (gdb-initial-commands): New interface function so backends can customize how gdb needs to be configured for their implementation. * swank-ecl.lisp (gdb-initial-commands): Implement. * slime.el (slime-dispatch-event): Add clause for :gdb-attach. (slime-attach-gdb): New.
* swank.lisp (connection): Add socket slot, make slot-io slot not be required to be filled in during object creation. Add inferior-lisp slot so we can know whether a connection belongs to a superior Emacs process. Need for that will come in following commit. (make-connection): Our constructor. (create-connection): Removed; not needed anymore. (finish-connection-setup): Function to fill socket-io slot. (start-server): Results in inferior-lisp slot being T. (create-server): Results in inferior-lisp slot being NIL. (setup-server): Adapted accordingly. Construct connection early so we do not have to pass down all the meta information explicitly. (serve-connection): Adapted accordingly. (accept-authenticated-client): Renamed from accept-authenticated-connection. (dispatch-event): Get rid of unused :%apply and :end-of-stream events.
* swank.lisp (signal-interrupt): Removed. (interrupt-worker-thread): Slurp in definition of signal-interrupt. No need for invoke-or-queue-interrupt twice in case we do not use threads. Thus micro-prettification of backtraces.
* swank.lisp (dispatch-interrupt-event): Take a connection because it boils down to SIGNAL-INTERRUPT which uses USE-THREADS-P which needs a connection. (install-fd-handler): Adapted accordingly. (simple-serve-event): Adapted accordingly. Additionally, remove superfluous WITH-SWANK-PROTOCOL-HANDLER as that's established by WITH-CONNECTION already. (simple-repl): Show "abort inferior lisp" restart only if not a more appropriate "abort some REX" restart is available. Also make sure to return in case of END-OF-FILE, otherwise there's an infinite loop where we end up in the debugger again and again until the user eventually selects close-connection restart himself. (make-repl-input-stream): Use WITH-TOP-LEVEL-RESTART so `sldb-quit' can be used in SLDB.
* swank.lisp (close-connection): Include initially passed coding-system in debugging output.
Make swank:connection-info include information about initially passed coding-system, and the resulting external-format of the socket. Debugging aid. * swank.lisp (connection.external-format): New function. (start-server, create-server): Pass down coding-system, not external-format. (setup-server): Pass down both, coding-system and external-format. (serve-connection): Ditto. (create-connection): Set coding-system slot of CONNECTION. (connection-info): Include coding-system and external-format.
* slime.el (slime-inspector-history): New command.
Don't try to bind keywords in inspector-eval. * swank.lisp (inspector-eval): For now, don't bind symbols which are constantp. Maybe something better can be found later.
Use @ instead of # to mark object in the inspect history. * swank.lisp (print-part-to-string): Use @.
Make eval-in-frame display multiple values; not only the first. * swank.lisp (values-to-string): New macro. (eval-string-in-frame): Use it.
* slime.el (slime-compile-and-load-file): Accept C-u arguments for compilation policy the same way as slime-compile-defun. * swank.lisp (compile-file-for-emacs): Take an additional policy argument. * swank-backend.lisp (swank-compile-file): Ditto. * swank-sbcl.lisp (compiler-policy, (setf compiler-policy)): rename from get/set-compiler-policy. (with-compiler-policy): New macro. (swank-compile-file): Use with-compiler-policy. (swank-compile-string): Ditto.
* swank.lisp (documentation-symbol): Show arglists for functions too.
Add a command to eval stuff in the inspector. * slime.el (slime-inspector-eval): New command. (slime-inspector-mode-map): Bind it to 'e'. * swank.lisp (inspector-eval): New function. * swank-backend.lisp (eval-context): New function. * swank-cmucl.lisp (eval-context): Implement it.
* swank.lisp (xref-doit): Declare eql-specializing parameter ignorable, as some implementations complain about them not being used.
* swank.lisp (pathname-as-directory): Treat "/foo/bar" and "/foo/bar/" the same. (compile-file-output): Use the above function.
Refactoring to eliminate use of swank-protocol-error.backtrace.
Deleted redundant definitions covered by swank-rpc.
New swank-rpc package Use swank-rpc in swank package.
* swank.lisp (*swank-state-stack*): Delete. Not needed anymore. (defslimefun state-stack): Delete. (decode-message): Adapted. (debug-in-emacs): Adapted.
* swank.lisp (with-swank-protocol-error-handler): Remove debugging bits.
Commands to save&restore image files without disconnecting. * slime-snapshot.el: New file. * swank-snapshot.lisp: New file. Some new backend functions used for loading image files. * swank-backend.lisp (socket-fd, make-fd-stream, dup, exec-image) (command-line-args): New functions. * swank-cmucl.lisp: Impemented. * swank-cmucl.lisp (reset-sigio-handlers): New function. (save-image): Fix quoting bug. * swank.lisp (clear-event-history): New functoin. (interactive-eval, eval-region): Don't use FRESH-LINE.
* slime.el (slime-edit-uses-xrefs): New variable. For contribs to extend. (slime-edit-uses): Use it. * swank.lisp (xref-doit): Now a generic functions. For contribs to extend. * swank-asdf.lisp (who-depends-on): Make defslimefun. (xref-doit [:depends-on]): New method to make :depends-on valid xref request. * slime-asdf.el (slime-who-depends-on-rpc): New. (slime-who-depends-on): New interactive function. (slime-asdf-init): Make `slime-edit-uses' perform a :depends-on request, and bind `C-c C-w d' to `slime-who-depends-on'.
* swank.lisp (with-top-level-restart): Bind local special. (top-level-restart-p): Check for it; this tells us if where's in the dynamic extent of with-top-level-restart. (handle-requests): Use it.
swank.lisp(handle-requests): Comment out (assert (boundp '*sldb-quit-restart*)) because it's not bound on NIL communication style. It's not a real fix, but at least it lets null communication-style work.
swank.lisp(compile-file-output): Use (make-pathname :directory dir :defaults (compile-file-pathname file)) instead of (compile-file-pathname file :output-file dir), because the latter works differently on different implementations. (fasl-pathname): Use the above function.
* swank.lisp (*sldb-quit-restart*): Export. For users to customize what `q' does in SLDB. (handle-requests): Test differently for recursive invocations as *sldb-quit-restart* may now be globally bound due to user customization. (coerce-restart): Coerces a restart-designator to a restart. (throw-to-toplevel): Use it. * slime.texi (swank:*sldb-quit-restart*): Document it.
* swank.lisp (collect-notes): Establish new abort restart ("Abort Compilation"); if an error is signaled in EVAL-WHEN, or during macroexpansion -- assuming the backend DTRT --, invoking this restart will result in the normal compilation failure behaviour, including correct reporting of the offending toplevel form. * swank-sbcl.lisp (handle-notification-condition): Use `real-condition' here. (handle-file-compiler-termination): As a result, not needed anymore. (call-with-compilation-hooks): Also signal information about normal errors.
Add `M-x slime-toggle-debug-on-swank-error'. In "Debug on SWANK error" mode, errors which are normally caught to not annoy the user, will now drop into the debugger. Additionally, the backend won't do any backtrace magic so you'll see the full backtrace with all its glory details. SBCL only so far. * slime.el (slime-toggle-debug-on-swank-error): New. * swank.lisp (toggle-debug-on-swank-error): New slimefun. (debug-on-swank-error): New function. SETFable. (invoke-default-debugger): Use CALL-WITH-DEBUGGER-HOOK so we're trapped into the native debugger on SBCL (previously we weren't due to SB-EXT:*INVOKE-DEBUGGER-HOOK*.) * swank.lisp: Rename SWANK-ERROR to SWANK-PROTOCOL-ERROR.
* swank.lisp (classify-symbol): Check fboundp before calling fdefinition, ECL doesn't like (fdefinition nil).
* slime.el (sldb-backward-frame): If the point is at the end of the buffer, there is no property, handle this case. * swank.lisp (collect-notes): LOAD returns generalized boolean, not just boolean, but make-compilation-result accepts only booleans for its second argument. Both bugs reported by Derrell Piper.
* swank.lisp (without-interrupts): Removed. No longer used. * swank-backend.lisp (call-without-interrupts): Removed. Update backends accoringly.
* swank.lisp (tokenize-symbol-thoroughly): Return NIL instead of throwing an error. (parse-symbol): Handle null result of tokenize-symbol-thoroughly. This fixes a bug reported by Derrell Piper.
* slime.el (slime-inside-string-p, slime-inside-comment-p) (slime-inside-string-or-comment-p): New. * swank-match.lisp: New file. Contains very simple pattern matcher from the CMU AI archive. * swank-loader.lisp: Compile swank-match.lisp. * swank.lisp: Make SWANK package use new SWANK-MATCH package. * slime-autodoc.el, swank-arglists.lisp: Large parts were rewritten. Autodoc is now able to highlight &key parameters, and parameters in nested arglists. * slime-parse.el, slime-c-p-c.el, slime-highlighting-edits.el: Adapted to changes.
* swank.lisp (find-symbol-with-status): New. (parse-symbol): Use it to correctly parse symbols where only one colon is given. Consequences: Autodoc won't display an arglist on `(foo:bar |' if BAR is not exported from FOO.
* swank.lisp (list-threads): Remove thread-description. Wasn't used anymore. * swank-backend.lisp (thread-description, set-thread-description): Deleted. * swank-abcl.lisp: Update accordingly. * slime.el (slime-update-threads-buffer, slime-thread-insert): Update accordingly.
* swank.lisp (xref): Deal with non-yet-interned names gracefully.
* swank-sbcl.lisp (thread-description): Remove it and supporting code, because it didn't really work. * swank.lisp (with-thread-description): Remove unused macro.
* swank.lisp (without-printing-errors): New macro. (to-string): Use it. (to-line): Use it, too. This fixes printing error occuring during inspecting to prevent the inspector from displaying something useful. Reported by email@example.com.
* swank.lisp (stop-server): (list-threads) returns threads offset by 1, don't kill the wrong thread. Reported by Sebastian Tennant.
swank.lisp (set-package): Provide a more meaningful error message when package doesn't exist.
Generalize M-? (or M-_ respectively.) It will now list: - call sites for functions, - macroexpand sites for macros, - binding, setting, referencing sites for variables, - specializing methods for classes. * slime.el (slime-xref): Deal with :not-implemented. (slime-xrefs): New. Makes RPC request to XREFS. (slime-edit-callers): Renamed to `slime-edit-uses'. (slime-edit-uses): Use slime-xrefs. * swank-backend.lisp (who-*): Add default implementation which returns :not-implemented. * swank.lisp (xref-doit): Extracted from XREF. (xref): Pass over :not-implemented to Emacs side. (xrefs): New slime fun. To return results of multiple XREF requests at once.
* swank.lisp (documentation-symbol): Return more readable information.
Speed up symbol completion. * swank.lisp (all-completions): Don't call unparse-symbol while matching. That gets very slow in CCL's CCL package. Just use symbol-name and compare with char-equal. (prefix-match-p): Use char-equal.
* swank.lisp (init-global-stream-redirection): Continue even if streams are already redirected. Useful for restarting Swank with M-x slime when a REPL is already present. Will most likeley mess up the input stream in multi threaded setups, tho.
Separate context info from compiler message text. * swank-backend.lisp (compiler-condition): Add a new slot :source-context. Remove :short-message. * swank-cmucl.lisp, swank-sbcl.lisp, swank-scl.lisp, swank-openmcl.lisp, swank-ccl.lisp: Update callers. * swank.lisp (make-compiler-note): Use source-context slot. * slime.el (slime-note.source-context): New. (slime-insert-compilation-log): Use it. (slime-note.short-message): Deleted.
* slime.el (slime-profile-by-substring): new function for profiling functions by matching a substring. * swank.lisp (profile-by-substring): ditto. * contrib/slime-fuzzy.el (slime-fuzzy-complete-symbol): change `comint-completion-addsuffix' to not add space after completing a filename.
* swank.lisp (make-repl-input-stream): Make sure to redirect output from slime requests to the REPL buffer for communication-style=NIL.
* swank.lisp (ed-in-emacs): Handle symbols/function-names better. * slime.el (slime-ed): Updated accordingly.
* swank.lisp (operator-arglist): Don't use pprint-fill for people with wide screens.
(open-streams): do not create unnecessary output stream when using dedicated output stream. Thanks to Terje Norderhaug.
Generalize list-threads for implementation-dependent attributes. * swank-backend.lisp (thread-attributes): New function. * swank-openmcl (thread-attributes): Implement it. * swank.lisp (list-threads): Return a table with the attribute names as the first row and the new attributes in the last columns. * slime.el (slime-update-threads-buffer): For now, ignore the extra attributes.
Add :WAIT keyword argument to support blocking in SWANK:INSPECT-IN-EMACS.
* swank-backend.lisp (frame-source-location): Renamed from frame-source-location-for-emacs. Update callers accordingly.
* swank.lisp (tokenize-symbol-thoroughly): Make it work correctly on escaped symbols.
* slime.el (slime-dispatch-event): New event `:read-from-minibuffer'. (slime-read-from-minibuffer-for-swank): New. * swank.lisp (dispatch-event): Pass through :read-from-minibuffer event. (read-from-minibuffer-in-emacs): Now uses new event rather than eval-in-emacs.
* swank.lisp (sldb-bitvector-pprint): Oops, all bits are true.
swank.lisp (escape-string): Fix thinko.
*** empty log message ***
*** empty log message ***
* swank.lisp (*sldb-pprint-dispatch-table*): Be careful when calling WRITE recursively: set :circle to nil which avoids interference with cycle-detection. (escape-string): New helper function. (*backtrace-pprint-dispatch-table*): Use it.
* swank.lisp (read-from-minibuffer-in-emacs): New. ([struct] istate): Add METADATA-PLIST slot. (ensure-istate-metadata): New. To attach arbitrary metadata to an inspector page. (inspect-object): Adapted so methods on EMACS-INSPECT can look at *ISTATE*.
* swank.lisp (encode-message): Handle errors during write, e.g. closed sockets.
Make fasl-pathname fully customizable not only the direcrory part. * swank.lisp (*fasl-pathname-function*): New variable. (*fasl-directory*): Deleted.
* swank.lisp (debug-in-emacs): Moved (WITH-BINDINGS *SLDB-PRINTER-BINDINGS* ...), from here... (sldb-loop): ... to here. Otherwise results from a user doing an eval-in-frame were truncated. Reported by Jeff Workman.
* swank.lisp (hash-table-to-alist): New function. ([method] emacs-inspect (hash-table)): Sort keys if they're all numbers, symbols, or strings. Adapted from Willem Broekema.
`M-x slime-format-string-expand' displays the expansion of a format string. * slime.el (slime-string-at-point) New. (slime-string-at-point-or-error): New. (slime-format-string-expand): New; use them. * swank-backend.lisp (format-string-expand): New interface. * swank.lisp (swank-format-string-expand): New; use it.
* swank.lisp (dispatch-event [:emacs-rex]): Reply a :invalid-rpc message if the specified thread doesn't exist. * slime.el (slime-dispatch-event): Handle :invalid-rpc. (slime-init-connection-state): Bind slime-current-thread to avoid problems with dead threads.
Don't signal conditions in the interrupt handler to avoid problems with naive code like (handler-case foo (condition bar)) * swank-backend.lisp (*interrupt-queued-handler*): Use a dynamic variable instead. (slime-interrupt-queued): Deleted. * swank-cmucl.lisp, swank.lisp: Ditto.
* swank.lisp (pprint-eval): Also return the output produced during evaluation.
*** empty log message ***
* swank-backend.lisp (swank-compile-file): Take output-file as additional argument. Update backends accordingly. * swank.lisp (*fasl-directory*): New variable. (fasl-pathname): New function. (compile-file-for-emacs): Use it.
* swank-backend.lisp (set-default-initial-binding): New function. * swank.lisp (setup-stream-indirection): Use it
* swank.lisp (do-symbols*): Wrap body in TAGBODY.
Move the tree widget for compiler notes to contrib/.
* swank-backend.lisp (swank-compile-string): Pass the buffer-file-name to Lisp, not only the directory. Update callers accordingly
* swank.lisp (*sldb-pprint-dispatch-table*): Honor *print-escape*
Do not truncate error messages in SLDB. * swank.lisp (*sldb-bitvector-length*): Like *PRINT-LENGTH* for bit-vectors. (*sldb-string-length*): Likewise for strings. (*sldb-pprint-dispatch-table*): Truncate bit-vectors / strings according to the above variables. (*sldb-printer-bindings*): Use the new variables. Bind *PRINT-LINES* to NIL so error messages are not truncated.
* swank.lisp (simple-serve-requests, make-repl-input-stream): Move the call to WITH-CONNECTION to the input stream to pick up stream redirections.
Experimental implementation of "channels". The idea is to support arbitrary protocols without changes to the low level event dispatcher. * slime.el (slime-make-channel, slime-close-channel) (slime-channel-send, slime-send-to-remote-channel): New functions. (slime-define-channel-type, slime-define-channel-method): New macros. (slime-dispatch-event): Support channel events. * swank.lisp (channel, listener-channel): New classes. (channel-send, send-to-remote-channel): New functions. (create-listener): New function. Test case for channel code. (process-requests): Process channel events.
Experimental channels
* swank.lisp (sleep-for): New function * slime.el ([test] break): Use SWANK::SLEEP-FOR to help CCL pass this test. ([test] arglist): Update arglist of swank::compile-string-for-emacs. ([rest] find-definition.2): Allow some whitespace before the actual position. Otherwise, CCL would fail on this test.
* swank.lisp (maybe-redirect-global-io): Don't consider connections without streams. (*new-connection-hook*): Don't add MAYBE-REDIRECT-GLOBAL-IO. (create-repl): Call MAYBE-REDIRECT-GLOBAL-IO here.
* slime.el ([test] find-definition.2): Also fails for Lispworks. ([test] interrupt-at-toplevel, [test] interrupt-in-debugger): Those don't work well if there's no REPL thread. * swank-backend.lisp (wait-for-input, wait-for-one-stream): Don't use PEEK-CHAR because we can't interrupt that cleanly. * swank.lisp (simple-serve-requests): Run the REPL inside WITH-CONNECTION. * swank-lispworks.lisp (emacs-connected): Don't install the signal handler here ... (install-sigint-handler): ... use this instead
As of now, `C-u C-c C-c' compiled a function with maximum debug settings (SBCL only.) Now, `M-- C-c C-c' will compile a function with maximum _speed_ settings (still SBCL only) --- useful to elicit compiler notes. * slime.el (slime-compilation-debug-level): Renamed to `slime-compilation-policy'. (slime-normalize-optimization-level): Renamed to `slime-compute-policy'. * swank.lisp (compile-string-for-emacs): Takes a policy now. (compile-multiple-strings-for-emacs): Ditto. * swank-backend.lisp (swank-compile-string): Change :DEBUG key arg to :POLICY. * swank-scl.lisp, swank-openmcl.lisp, swank-lispworks.lisp * swank-ecl.lisp, swank-corman.lisp, swank-cmucl.lisp, * swank-clisp.lisp, swank-allegro.lisp, swank-sbcl.lisp: Changed accordingly.
Move slime-lisp-package to slime-repl.el * swank.lisp (create-repl): Return initial package and prompt. * slime-repl.el (slime-repl-event-hook-function): Handle :new-package events here. (slime-output-buffer): Initialize slime-buffer-package. (slime-repl-connected-hook-function): Initialize slime-lisp-package.
*** empty log message ***
* swank.lisp (connection.env): New slot. To hold dynamic variable bindings for this connection. (with-io-redirection): Use it. (create-repl): New function. Currently only redirects IO for the connection. Could potentially be used to create multiple listeners, each with a set of streams and corresponding buffers. (*redirect-io*, maybe-call-with-io-redirection) (call-with-redirected-io): Deleted. * slime-repl.el (slime-repl-connected-hook-function): Create a repl at startup. Well, initialize stream redirection.
Create a repl also for *communication-style* = nil. Use a custom stream which processes SLIME requests while waiting for input. * slime.el (slime-set-connection-info): Don't create a repl buffer. (slime-start-lisp): Bind process-connection-type to nil to avoid problems witht CLISPs readline code. * swank.lisp (read-non-blocking, make-repl-input-stream) (simple-repl): New functions. (simple-serve-requests): Use it. * swank-backend.lisp (wait-for-one-stream, wait-for-streams): New functions. (wait-for-input): Use it to support wainting on multiple streams. * swank-cmucl.lisp (to-fd-stream): New function. (wait-for-input): Use it.
* swank.lisp (connection): Add a slot to store the auto-flush-thread. (cleanup-connection-threads): Also kill the auto-flush-thread. (stop-server): list-threads returns the thread name in second position and not in first position.
Reset the stream column to 0 after eval requests. * swank.lisp (interactive-eval, eval-region): Use FRESH-LINE to reset the stream column. * slime.el (test repl-test): Adjust test accordingly.
Be a bit more careful when computing the toplevel restart. * swank.lisp (throw-to-toplevel): Test *sldb-quit-restart* for nilness. * sldb-quit (sldb-quit): Show the returned value in brackets.
* swank.lisp (invoke-default-debugger): New condition type. (swank-debugger-hook): Handle invoke-default-debugger conditions. (sldb-break-with-default-debugger): Signal invoke-default-debugger to transfer control to the default debugger. New argument DONT-UNWIND to invoke the native debugger without unwinding the stack. * slime.el (sldb-break-with-default-debugger): By default, unwind the stack before invoke the native debugger. With prefix argument, run the native debugger in the dynamic environment of SLDB.
* swank-backend.lisp (slime-interrupt-queued): New condition. * swank.lisp (invoke-or-queue-interrupt): Raise it here. * swank-cmucl.lisp (wait-for-input): Make fd readable in condition handler so that we can call serve-events without timeout.
* swank.lisp (debug-in-emacs): Bind *sldb-quit-restart* here, if necessary to the next abort retstart.
* swank.lisp (frame-locals-and-catch-tags): New function. Fetch locals and catch tags with a single RPC. * slime.el (sldb-frame-details): Use it. * swank-backend.lisp (frame-catch-tags): Provide a default implementation. Delete the dummy defs in various backends.
* swank-backend.lisp (compute-sane-restarts): Deleted. Use plain compute restarts instead.
* swank.lisp (call-with-retry-restart): Implement this a little less confusing.
* swank-backend.lisp (frame-restartable-p): New function. (swank-frame): Deleted. Update implemenetations accordingly. (print-frame): Renamed back from print-swank-frame. * swank.lisp (backtrace): Don't clutter the backtrace with '(:restartable :unknown). For practical purposes :unknown is the same as nil. * slime.el (sldb-compute-frame-face): Only accept nil or t for the :restartable prop.
* swank-lispworks.lisp (with-swank-compilation-unit): Return the values of BODY. (compile-from-temp-file): Return T on success. * swank.lisp (collect-notes): Check return type of FUNCTION.
* swank-kawa.scm (swank-require): Add a dummy definition to avoid errors at startup.
(compile-file-for-emacs): Update for chanded backends.
toggling of inspector verbosity In verbose mode the inspector uses normal PRINT-OBJECT machinery to produce the title part. SWANK:*INSPECTOR-VERBOSE* controls default verbosity. Inside the inspector "v" is bound to slime-inspector-toggle-verbosity which changes the verbosity of the current inspector. Inspecting a subpart inherits the verbosity of the parent.
export *BACKTRACE-PRINTER-BINDINGS* from SWANK
Some cleanups for compilation commands. * slime.el ([defstruct] slime-compilation-result): Rename result slot as successp. (slime-make-compilation-finished-continuation): Deleted. slime-eval-async preserves the current buffer and preserving the window-configuration was always a questionable feature. (slime-compilation-finished): Simplified. (slime-show-note-counts): Also show the success/failure flag. (slime-recompile-locations): Take a continuation as argument rather than messing around with compilation-finished-hooks. (slime-aggregate-compilation-results): New function. (slime-xref-recompilation-cont): Renamed from slime-make-xref-recompilation-cont. (slime-compiler-results): Deleted. (slime-goto-first-note-after-compilation): Replaced with hook function slime-goto-first-note. (slime-compilation-just-finished): Deleted. (slime-to-lisp-filename-function): Use convert-standard-filename. * swank.lisp ([defstruct] compilation-result): Renamed from swank-compilation-result. (measure-time-interval): Return seconds as float. (collect-notes): Renamed from swank-compiler. Return a single compilation-result. (compile-multiple-strings-for-emacs): Return a list of compilation-results instead of a single result with merged notes. * swank-backend.lisp (filename-to-pathname): Renamed from parse-emacs-filename. Updated callers. (pathname-to-filename): New function. Use it where appropriate. * swank-scl.lisp (pathname-to-filename): Implement it in the backend to get rid of the #+scl in swank.lisp. * swank-cmucl.lisp (swank-compile-file, swank-compile-string): Return t on success.
Stop handling events in worker threads after sldb-quit. * swank.lisp (with-top-level-restart): New macro. (handle-requests, spawn-worker-thread): Use it. (process-requests): Drop the just-one argument. (handle-or-process-requests): Deleted. Call handle-requests directly.
* Update for the Scieneer CL 1.3.8 release.
swank.lisp (guess-package): Return NIL if string designator is NIL Makes files without IN-PACKAGE forms more *BREAK-ON-SIGNALS friendly.
* swank.lisp (*backtrace-pprint-dispatch-table*): Honor *print-escape*.
Some cleanups for the REPL code. * slime.el (slime-show-last-output) (slime-show-last-output-function) (slime-show-last-output-region) (slime-maybe-display-output-buffer) (slime-repl-last-input-start-mark): Delete unused code. (slime-repl-emit-result, slime-repl-insert-prompt) (slime-repl-show-abort, slime-repl-insert-result) (slime-insert-transcript-delimiter) (slime-eval-with-transcript-cont): Consistently use save-excursion and insert-before-markers. We always want to preserve the cursor position in the input region (for type-ahead). (slime-batch-test): Use a timer. (slime-check-buffer-contents): New function to test contents and current position. Use it in various places. (sldb-recenter-region, def-slime-test interactive-eval) (def-slime-test interactive-eval-output): Act slightly differently when the test suite is executed in batch mode (without terminal). * swank.lisp (handle-requests): Flush output. (interactive-eval, interactive-eval): Don't use fresh-line, as that makes it harder to test the REPL code. * test.sh (Usage): Add a -T switch to run slime in the current directory without copying (and compiling) everything to a temporary directory.
(*pre-reply-hook*): Add 'force-user-output. [def-slime-test] (interrupt-at-toplevel, interrupt-in-debugger): Use it.
* swank.lisp (send-user-output): Lifted from make-output-function. Make this a top-level function for easier redefinition.
* slime.el (slime-test-find-top-level-restart): New function. [def-slime-test] (interrupt-at-toplevel, interrupt-in-debugger): Use it.
* swank.lisp (sldb-loop): Send a :sldb-return event to ourselfes to inform the debug session at the lower level. (wait-for-event): Drop the report-interrupt argument. No longer needed. (event-match-p): Add an OR pattern operator. Used to wait for different events simultaneously. (read-packet): Use peek-char to detect EOF. read-sequence wouldn't work. * slime.el (slime-test-interrupt-in-debugger): Call sldb-quit and sldb-continue in the right buffer. * swank-backend.lisp (wait-for-input): * swank-cmucl.lisp (wait-for-input): * swank-clisp.lisp (wait-for-input): Use the idiom "(when (check-slime-interrupts) (return :interrupt))".
More interrupt related frobbing.
Introduce a WAIT-FOR-INPUT backend function. CMUCL's blocking input functions READ-CHAR etc. are hard to use with interrupts. In the backend we have a more realistic chance to get interrupts working. * swank-backend.lisp (wait-for-input): New function. * swank-cmucl.lisp, swank-clisp.lisp (wait-for-input): Implement it. * swank.lisp (wait-for-event/event-loop): Use WAIT-FOR-INPUT and rescan the event-queue if WAIT-FOR-INPUT was interrupted. (reader-event): Deleted. Merged into wait-for-event/event-loop resp. dispatch-loop. (decode-message): Drop the timeout argument. (*events-enqueued*): A counter to quickly detect new events after a wait. (call-with-connection): If the argument is already the current connection, don't rebind anything. (without-slime-interrupts, with-slime-interrupts): Don't rebind *pending-slime-interrupts*. Just to be save. * slime.el (sldb-maybe-kill-buffer): New function, to handle the case when the debugger was interrupted in WAIT-FOR-INPUT and we want to return to the previous debug level.
New faces: `sldb-restartable-frame-line-face', `sldb-non-restartable-frame-line-face'. The former is the face for frames that are surely restartable, the latter for frames that are surely not restartable. If restartability of a frame cannot be reliably determined, the face `sldb-frame-line-face' is used. At the moment, determination of frame restartability is supported by the SBCL backend only. * slime.el (sldb-frame.string): New. (sldb-frame.number): New. (sldb-frame.plist): New. (sldb-prune-initial-frames): Use them. (sldb-insert-frames): Ditto. (sldb-compute-frame-face): New. (sldb-insert-frame): Use `sldb-compute-frame-face' to insert frames with one of the faces described above. * swank.lisp (defslimefun backtrace): Changed return value; each frame is now accompanied with a PLIST which at the moment can contain :RESTARTABLE NIL/T/:UNKNOWN depending on whether the frame is restartable, or not. * swank-backend.lisp (defstruct swank-frame): New structure. (compute-backtrace): Is now supposed to return a list of SWANK-FRAMEs. (print-frame): Renamed to PRINT-SWANK-FRAME. * swank-sbcl.lisp, swank-cmucl.lisp, swank-lispworks.lisp, * swank-allegro.lisp, swank-scl.lisp, swank-openmcl.lisp, * swank-abcl.lisp, swank-clisp.lisp: Adapted to swank-backend changes.
Reimplement recompilation support. The previous implementation involving specials was subtly broken with the :fd-handler communcation-style, because of serve-event's polite interplay with specials. (Cf. my slime-devel post "Per event bindings" on 2008-08-17.) * swank.lisp (with-swank-compilation-unit): Removed. (record-note-for-condition): Removed. (defstruct swank-compilation-unit): Renamed to `swank-compilation-result'. (swank-compilation-unit-for-emacs): Renamed to `swank-compilation-result-for-emacs'. (swank-compiler): Takes additional argument, the swank-compilation-result where caught notes should be accumulated into. (defslimefun compile-file-for-emacs): Adapted accordingly. (defslimefun compile-string-for-emacs): Ditto. (defslimefun compile-multiple-strings-for-emacs): New RPC call. * slime.el (slime-make-compile-expression-for-swank): Removed. (slime-compile-string): Don't use above function anymore. Adapted. (slime-recompile-locations): Rewritten to use new RPC call above.
* swank.lisp (eval-for-emacs): Remove WITH-RETRY-RESTART again for simplicity reasons. (interactive-eval): Add WITH-RETRY-RESTART. (eval-and-grab-output): Ditto. (interactive-eval-region): Ditto. (re-evaluate-defvar): Ditto. (pprint-eval): Ditto. (repl-eval): Ditto. (eval-string-in-frame): Ditto. (pprint-eval-string-in-frame): Ditto. (init-inspector): Ditto. (inspect-in-frame): Ditto.
A RETRY restart is provided for all Slime evaluation requests. The rationale is that restarting from a frame is mostly only possible for functions compiled with high debug settings; most functions aren't, however. [Alternatively, we could make EVAL-FOR-EMACS be compiled with a high debug level, so it'll become restartable. That would be non-obvious to the user, though, and would only work on those implementations that implement SWANK-BACKEND:RESTART-FRAME.] * swank.lisp (call-with-retry-restart): New function. (with-retry-restart): New macro. (eval-for-emacs): Use WITH-RETRY-RESTART.
A package "Foo.Bar.1.0" was truncated to "0>" as REPL prompt. It'll now be displayed as "Bar.1.0>". * swank.lisp (auto-abbreviated-package-name): Adapted accordingly.
* swank-backend.lisp (make-input-stream): Remove make-fn-streams. Update callers accordingly.
* swank.lisp (prepare-part): Also wrap action elements in a list. Reported by Ariel Badichi and Madhu.
* swank-cmucl.lisp (remove-sigio-handlers): Fix thinko.
(swank-debugger-hook): Remove the default-debugger restart.
* swank.lisp (decode-message): Don't ignore EOF.
Use lazy lists in the inspector. * swank.lisp (lcons): New data type. (lcons*, lcons-car, lcons-cdr, llist-range): New functions. (emacs-inspect array): Use lazy lists. (istate>elisp): The istate.content is now be a lazy list. (iline): New utility. (prepare-range, prepare-part): Replaces inspector-content.
Implement streams with a length limit. Use them to truncate printer output in backtraces. * swank-backend.lisp (make-output-stream, make-input-stream): Split make-fn-streams up into two functions. * swank.lisp (call/truncated-output-to-string): New function. (backtrace, istate>elisp, to-line): Use it. (frame-locals-for-emacs): Use to-line.
In backtraces, escape newlines in strings as \n. * swank.lisp (*backtrace-pprint-dispatch-table*): New. (*backtrace-printer-bindings*): Use it.
Collect most of the inspector state in a structrure. Truncate the printer output more aggressively. * swank.lisp (inspector-state): New structure. (*istate*): New variable holds the current state. (inspect-object, inspector-content, inspector-nth-part) (inspector-range, inspector-call-nth-action, describe-inspectee): Use it. (inspector-pop, inspector-next): Implemented forward/backward a bit differently. (emacs-inspect/printer-bindings, istate>elisp): New functions. (to-line, truncate-string): New functions.
Compiling a file `let*.lisp' on SBCL via C-c C-k resulted in an error, because it parsed the asterisk to a wild pathname. Fix that. * swank-backend.lisp (definterface parse-emacs-filename): New. PARSE-NAMESTRING by default. * swank-sbcl.lisp (defimplementation parse-emacs-filename): Use SB-EXT:PARSE-NATIVE-NAMESTRING. * swank.lisp (compile-file-for-emacs): Use PARSE-EMACS-FILENAME. (compile-file-if-needed): Ditto. (load-file): Ditto. (swank-require): Ditto.
* swank.lisp (install-fd-handler): Bind *emacs-connection* with with-connection, for case when the signal hander is called out of the blue. (swank-debugger-hook): Don't assume that the hook argument is #'swank-debugger-hook itself. * test.sh (usage): Use cat rather not echo for here-documents.
* slime.el (slime-inspector-show-source): New command. (slime-inspector-mode-map): Bind it to ".". (sldb-highlight-sexp): Use slime-flash-region rather than a permanent overlay.
Finally handle reader-errors without disconnecting. * swank.lisp (decode-message): Convert reader-error conditions into :reader-error events. (dispatch-event): Send :reader-error events to Emacs. * slime.el (slime-dispatch-event): Display reader-errors.
* swank.lisp (with-buffer-syntax): Take package as argument. (defslimefun): Derive the package for exporting from the symbol.
Let SIGINT create a synthetic event. * swank.lisp (install-fd-handler,simple-serve-requests): Dispatch a :emacs-interrupt event in the SIGINT handler. * slime.el (slime-interrupt): Send nothing over the wire when SIGINT is used.
Improve interrupt safety for single-threaded lisps. * slime.el (slime-interrupt): Send a :emacs-interrupt message together with SIGINT. SIGINT now means "check for new events" instead of "invoke the debugger". * swank-backend.lisp (install-sigint-handler) (call-with-user-break-handler): New functions. * swank.lisp (simple-serve-requests,install-fd-handler): Use it. (read-packet, read-char): New function. Check for interrupts. (wait-for-event/event-loop): Check for interrupts.
* swank.lisp (*global-debugger*): Change default back to t.
(swank-debugger-hook): Fix last change.
* swank.lisp (wait-for-event): Add timeout argument. This is used for :fd-handler and :sigio style where we only process events as long as we don't block. (wait-for-event/event-loop, read-event) (decode-message, receive-if): Ditto. (process-requests): Renamed from read-from-emacs. (handle-requests): Renamed from handle-request. Take timeout argument. Update callers. (process-available-input): Deleted. (with-swank-error-handler): Renamed from with-reader-error-handler. (with-connection): Use it.
* swank.lisp (wait-for-event): Add timeout argument. This is used for :fd-handler and :sigio style where we only process events as long we don't block. (wait-for-event/event-loop, read-event) (decode-message, receive-if): Ditto. (process-events): Renamed from read-from-emacs. (handle-requests): Renamed from handle-request. Take timeout argument. Update callers. (process-available-input): Deleted.
* swank.lisp (invoke-slime-debugger): New function. Analagous to cl:invoke-debugger. (swank-debugger-hook): Use it.
Fixes for heap dumping. * swank.lisp (*log-output*): Don't initialize at load-time, otherwise the stream would end up in a heap image.
* swank.lisp (*maximum-pipelined-output-chunks*): New variable
Display the "Use default debugger" restart more prominently. * swank.lisp (swank-debugger-hook): Bind a user visible restart to invoke the native debugger. (*global-debugger*): Make this nil by default. (sldb-loop): Minor cleanups. (sldb-break-with-default-debugger): Invoke the native debugger on top of the slime debugger. * slime.el (sldb-setup): Always pop to the debugger buffer. (sldb-activate): Optionally select the window. * swank-sbcl.lisp (sb-thread::get-foreground): Override this as the default implementation is unusable for Slime. * swank-lispworks.lisp (environment-display-notifier): Just return t.
Use wait-for-event instead of catch/throw where needed. * swank.lisp (read-user-input-from-emacs, y-or-n-p-in-emacs) (eval-in-emacs): Use wait-for-event. (make-tag): Replaces intern-catch-tag. (take-input): Deleted. (dispatch-event): Remove some redundancy.
Unify event dispatching for single and multi-threaded cases. * swank.lisp (send-to-control-thread,read-from-control-thread) (send-to-socket-io,read-from-socket-io): Deleted. (send-event, read-event, send-to-emacs) (signal-interrupt, use-threads-p): New functions. And more random changes.
(spawn-threads-for-connection): Simplify.
Spawn the auto-flush thread in the front end. This removes some copy&paste code in various backends. * swank.lisp (auto-flush-loop): New function. (open-streams): Use it. * swank-backend.lisp (make-stream-interactive): Deleted.
Queue interrupts in various places. * swank-backend.lisp (*pending-slime-interrupts*): New variable. (check-slime-interrupts): New function. * swank-lispworks.lisp (receive-if): Use it. * swank-sbcl.lisp, swank-openmcl.lisp: Ditto. * swank.lisp (*slime-interrupts-enabled*): New variable. (with-slime-interrupts, without-slime-interrupts): New macros. (invoke-or-queue-interrupt): New function. (interrupt-worker-thread, eval-for-emacs, swank-debugger-hook) (debug-nth-thread, wait-for-event, read-from-emacs): Use them.
* swank.lisp (encode-message): Inhibit interrupts while writing the length and the body.
* swank.lisp (eval-for-emacs): Don't flush streams here as that may now block.
(reader-from-emacs): Use &rest in destructure-case for CCL's sake.
Add some flow-control. * swank.lisp (make-output-function): Synchronize with Emacs on every 100th chunk of output. (wait-for-event,wait-for-event/event-loop,event-match-p): New functions. Used to selectively wait for some events and to queue the other events. (dispatch-event, read-from-socket-io): Tag non-queueable events with :call. (read-from-control-thread, read-from-emacs): Process :call events only; enqueue the others. (*log-output*): Don't use synonym-streams here. Dereference the symbol until we get at the real stream. (log-event): Escape non-ascii characters more carefully. * swank-backend.lisp (receive-if): New function. Update backends accordingly. (not yet for ABCL and SCL) * slime.el (slime-dispatch-event): Handle ping event.
* swank.lisp (swank-compiler): Fix bug when invoking an abort restart on a failed compilation attempt. * swank-sbcl.lisp (swank-compile-string): If a compilation attempt fails, COMPILE-FILE returns NIL which we tried to LOAD. Fix that. * swank-backend.lisp (swank-compile-string, swank-compile-file): Document return value.
Recompilation support added to xref buffers. You can now use `C-c C-c' in an xref buffer to recompile the defun represented by the xref at point. Similiarly, you can use `C-c C-k' to recompile all xrefs displayed. For example, if you've changed a macro, and want to recompile all the functions in the image which use that macro, you first call `slime-who-macroexpands' (C-c C-w RET), and then issues `C-c C-k' in the xref buffer that just popped up. [There's no guarantee that this will actually recompile all functions that depend on the changed macro, as this obviously depends on the quality of the backend's WHO-MACROEXPANDS implementation.] * swank.lisp: Introduced the notion of a SWANK-COMPILATION-UNIT, so we're able to compile different stuff comming from Slime one after the other, and have compiler notes &c. collected in a contiguous manner. (defstruct :swank-compilation-unit): New. Contains compilation notes, compilation results, etc. (*swank-compilation-unit*): New. Current Swank Compilation Unit. (with-swank-compilation-unit): New. Like WITH-COMPILATION-UNIT. (swank-compilation-unit-for-emacs): New. (swank-compiler): Adapted; collect compilation stuff into the current swank-compilation-unit. (compile-string-for-emacs): Use WITH-SWANK-COMPILATION-UNIT. (compile-file-for-emacs): Ditto. (*compiler-notes*, clear-compiler-notes): Removed. (compiler-notes-for-emacs): Removed. * slime.el (slime-compilation-unit, slime-last-compilation-unit), (slime-compiler-notes, slime-compiler-results): New/Adapted. (slime-make-compile-expression-for-swank): Factored out from `slime-compile-string'. (slime-recompile-location): New. (slime-recompile-locations): New. (slime-pop-to-location): &optional `where' arg can now also be 'excursion to only reset the current-buffer, but not switch. (slime-xref-mode-map): Add `C-c C-c' and `C-c C-k'. (slime-xref-dspec-at-point): New. (slime-all-xrefs): New. (slime-recompile-xref): New. (slime-recompile-all-xrefs): New. (slime-make-xref-recompilation-cont): New. (slime-xref-inert-recompilation-flags): New. (slime-trim-whitespace): New utility.
* swank.lisp: Revert Melis' change from 2008-07-04; Global IO redirection seems currently to be broken, and while it's not due to that commit (it seems that it's been broken since longer), I want to be on a safe bet.
`M-x slime-lisp-threads' will now contain a summary of what's currently executed in a thread that was created by Swank. * swank-backend.lisp (thread-description, set-thread-description): New interface functions to associate strings with threads. * swank-sbcl.lisp (thread-description, set-thread-description): Implemented. * swank.lisp (call-with-thread-description), (with-thread-description): New. (read-from-emacs): Now temporarily sets the thread-description of the current thread to a summary of what's going to be executed by the current request. (defslimefun list-threads): Changed return value to also contain a thread's description. * slime.el (slime-list-threads, slime-thread-insert): Adapted to new return value of LIST-THREADS.
* swank.lisp (call-with-redirected-io): Rebind only standard streams if *GLOBALLY-REDIRECT-IO*. Fixes lost output after disconnect, reconnect.
C-c C-c with prefix args now uses the maximal debug level. (By Zach Beane.) Only implemented for SBCL. * slime.el (slime-compile-with-maximum-debug): New variable. (slime-compile-defun, slime-compile-region): Use it. * swank.lisp (compile-string-for-emacs): Accept new debug argument. Update backend accordingly.
By default, don't ask if SLIME should be started. * slime.el (slime-auto-connect): New variable. (slime-auto-connect): New function. (slime-connection): Use it.
* swank-loader.lisp (load-swank): Call swank::before-init. * swank.lisp (before-init): New function. (init): Renamed from setup.
* swank.lisp (load-file-set-package): Removed; the function was only used in `slime-load-file-set-package' which invokes `slime-repl-set-package' which set the package for a second time. * slime.lisp (slime-load-file-set-package): Don't call SWANK:LOAD-FILE-SET-PACKAGE, but merely call SWANK:LOAD-FILE, then invoke `slime-repl-set-package' which will set the package. (slime-pretty-find-buffer-package): Removed. (Nowhere used.) (slime-set-package): Ditto.
* swank.lisp (classify-symbol, symbol-classification->string): Add classification of symbols denoting type specifier, and denoting constants.
* swank.lisp (find-definition-for-thing): New DEFSLIMEFUN. * swank-backend (find-source-location): New DEFINTERFACE. * swank-sbcl (find-source-location): Implement it. * slime.el (slime-edit-definition-cont): Use `slime-length='.
Make it easier to prepare core-files. * swank-loader.lisp (init): Two new keyword args: :SETUP and :LOAD-CONTRIBS. :SETUP=nil can be used to suppress init hooks and loading user init files. * swank.asd: Call swank-loader:init with :SETUP=nil. * swank.lisp (init-global-stream-redirection): Guard against redirecting already redirected streams.
Allow ED-IN-EMACS to edit new files. * swank.lisp (ed-in-emacs): Make it possible to canonicalize filenames of non-existing files. (canonicalize-filename): Merged into ed-in-emacs.
In the inspector, show one-element lists as list not as pair. * swank.lisp (emacs-inspect cons)
Better factorization for M-. and xref commands. * slime.el (slime-xref): Renamed from slime-definition. (slime-location, slime-location-p): New ADT def. (slime-xref-has-location-p, slime-analyze-xrefs): New functions. This work used to be done on the Lisp side. (slime-pop-to-location): New function. (slime-edit-definition, slime-edit-definition-cont): Simplified. (slime-find-definitions): New function. (slime-goto-definition, slime-goto-definition-other-window) (slime-pop-to-other-window, slime-show-definitions): Deleted. (slime-insert-xrefs): Simplified. (slime-insert-xref-location): Deleted. No need to show the filename twice. * swank.lisp (find-definitions-for-emacs, xref): Use common representation for "definitions" and "xrefs". (xref>elisp): New helper. (group-xrefs, alistify, parition, location-position<, xref-position) (xref-buffer, location-valid-p): Deleted. This work is now done on the Emacs side.
Minor cleanups for inspector code. * swank.lisp (inspector-content, inspect-list-aux): Slight cleanups.
Split loading and initialization (again). * swank-loader.lisp (init): New. Delete old packages only if explicitly requested. Also, if the swank package already exists don't load swank again. (setup): New function. * swank.lisp (setup): New function. Moved over here from swank-loader.lisp. * slime.el (slime-init-command): Call swank-loader:init. In the REPL, mark the trailing newline also as input. * slime.el (slime-repl-send-input): Mark the newline with the 'slime-repl-old-input property. (slime-repl-grab-old-input): Strip the newline.
Drop the first return value of emacs-inspect. * swank.lisp (emacs-inspect): Drop the first return value. It wasn't used anymore. Update all methods and callers.
Remove obsolete *slime-inspect-contents-limit*. * swank.lisp (*slime-inspect-contents-limit*): Deleted and all its uses. The new implementation isn't specific to hash-tables or arrays.
Limit the length of the inspector content. That's similar to the limitation of the length of backtraces in the debugger. * swank.lisp (*inspectee-content*): New variable. (content-range): New function. (inspect-object): Use it with a length of 1000. (inspector-range): New function. Called from Emacs. * slime.el (slime-inspector-insert-content) (slime-inspector-insert-range, slime-inspector-insert-range-button) (slime-inspector-fetch-range): New functions. (slime-inspector-operate-on-point): Handle range-buttons.
Inspector cleanups. * swank.lisp (emacs-inspect): Renamed from inspect-for-emacs. Changed all method-defs acordingly. (common-seperated-spec, inspector-princ): Moved to swank-fancy-inspector.lisp. (inspector-content): Renamed from inspector-content-for-emacs. (value-part): Renamed from value-part-for-emacs. (action-part): Renamed from action-part-for-emacs. (inspect-list): Renamed from inspect-for-emacs-list. (inspect-list-aux): New. (inspect-cons): Renamed from inspect-for-emacs-simple-cons. (*inspect-length*): Deleted. (inspect-list): Ignore max-length stuff. (inspector-content): Don't allow nil elements. (emacs-inspect array): Make the label of element type more consistent with the others.
*** empty log message ***
Drop second argument from inspect-for-emacs
Move some functions to swank-arglist.lisp. * swank.lisp (length=, ensure-list, recursively-empty-p) (maybecall, exactly-one-p, read-softly-from-string) (unintern-in-home-package, valid-function-name-p): Moved to contrib/swank-arglist.lisp.
(*sldb-condition-printer*): New variable. (safe-condition-message): Use the current binding of *sldb-condition-printer* to print the condition to a string.
* swank.lisp (read-softly-from-string): Now actually returns all three values as explained in its docstring.
Simplify the inspector. * swank.lisp (inspect-object): Ignore the title value returned from backends. * slime.el (slime-open-inspector): Updated accordingly.
Make it possible to close listening sockets. Patch by Alan Caulkins <email@example.com>. * swank.lisp (stop-server, restart-server): New functions. (*listener-sockets*): New variable. (setup-server): Store open sockets in *listener-sockets*.
Disable the pretty-printer for backtraces. Would be nice if we could print newlines in strings as \n. * swank.lisp (*backtrace-printer-bindings*): New varaible. (backtrace, frame-locals-for-emacs): Use it.
* swank.lisp (valid-function-name-p): Fixed wrt. setf functions.
Mirror *modules* in Emacs. * slime.el (slime-lisp-modules): New connction variable. (slime-set-connection-info): Load requested modules. (slime-required-modules): New variable. (slime-require, slime-load-contribs): New functions. * swank.lisp (connection-info): Include *modules*. (swank-require): Accept a list of modules as argument.
* swank.lisp (parse-package): The old version didn't pass the test-suite. Now use the reader directly instead of emulating it half-heartedly. * slime.el (slime-search-buffer-package): Don't remove double quotes or "#:", swank:parse-package takes care of that.
* swank.lisp (apropos-symbols): Use simple search instead of regexps. (make-apropos-matcher): Used to be make-regexp-matcher. (*sldb-printer-bindings*): Set *print-right-margin* to most-positive-fixnum. This prints each frame in the backtrace in a single long line. But is suboptimal for other purposes, like eval-in-frame. (setup-server): Initialize multiprocessing here, so that is also done for create-server.
* swank.lisp (swank-require): Fix typo (:key was used instead of :test.) Reported by Stelian Ionescu.
* swank.lisp (swank-require): Don't search the file if the module-name is present in *modules*. That should avoid problems if swank is included in a core file and moved to a different location. Reported by John Wiegley.
The inspector page layout has changed slightly. Before the header looked like A proper list. [type: CONS] ------------------- It now looks like #<CONS {B3DBD39}>: A proper list. -------------------- Rationale is to have a "presentation link" to the currently inspected object itself, to copy it down to the REPL via `M-RET'. This is mostly useful when trying to get a value from the Slime Debugger to the REPL, which you can do by inspecting the value first by `i', and then using `M-RET' on the object representation in the new header layout. Such a "presentation link" existed already but was removed in 2007-08-23. The old behaviour was to have the title ("A proper list" in the above example) to contain the link. I decided to make the link more explicit. * swank.lisp (inspect-object): Now additionally returns a string-representation of the object itself, and an inspector id for it. Removed returning its type as this is implicit in the new string representation. * slime.el (slime-open-inspector): Adapted for new header layout.
* swank.lisp (read-softly-from-string, unintern-in-home-package): Moved from `contrib/swank-arglist.lisp'. (parse-package): Use them. (Removes FIXME about interning symbols.) Also changed the logic somewhat to avoid passing :|| to FIND-PACKAGE as ECL chokes on that.
Fix close-connection. * swank.lisp (close-connection): Use *log-output* instead of *debug-io* (which could be redirected to the to-be-closed connection).
Move SBCL doc references to contrib. * slime.el (sldb-insert-condition): Merge REFERENCES and EXTRAS. (sldb-extras-hooks, sldb-dispatch-extras): New hook. * swank.lisp (debugger-condition-for-emacs): Merge REFERENCES and EXTRAS. * swank-backend.lisp (condition-references): Removed. Merged with condition-extras. * swank-sbcl.lisp (condition-references): Removed. (condition-extras): Include references. (externalize-reference): New function. Don't return plain symbols. * swank-allegro.lisp (condition-references): Removed. * contrib/slime-references.el: New file.
Move asdf support to contrib. * swank-backend.lisp (operate-on-system): Moved to swank-asdf.lisp. It wasn't specialized in any backend. * swank.lisp (operate-on-system-for-emacs) (list-all-systems-known-to-asdf, list-asdf-systems): Moved to swank-asdf.lisp. * slime.el: Move asdf commands to contrib slime-adsf.el. * swank-loader.lisp: Load swank-asdf if ASDF is in *FEATURES*. Also add the contrib source directory to swank::*load-path*.
Remove request-abort condition. * swank-backend.lisp (request-abort): Removed (abort-request): Removed. Replace all (3) uses with ERROR. * swank.lisp (eval-for-emacs): No special case for request-abort. * slime.el (slime-eval-async): Remove optional arg of :abort.
Move compound prefix completion and autodoc to contrib. * swank.lisp (simple-completions): Rewritten for simplicity. (operator-arglist): Rewritten for simplicity. * slime.el (slime-complete-symbol-function): Make simple completion the default. (slime-echo-arglist-function, slime-echo-arglist): New hook.
Fix some output related bugs. * swank.lisp (send-repl-results-to-emacs): Emit a fresh line. * slime.el (slime-insert-transcript-delimiter): Use insert-before-markers since slime-output-end is no longer left inserting. Reported by Austin Haas <email@example.com>.
* swank.lisp (classify-symbol, symbol-classification->string): Resurrected in swank.lisp. (I was bitten by cvs-pcl which committed (2007-08-27) my locally changed `contribs/swank-fuzzy.lisp' where I already removed these functions from.)
* slime.el (slime-make-form-spec-from-string): Elisp Hacking 101: Don't use `beginning-of-buffer' and `end-of-buffer' in Elisp code. * swank.lisp (read-form-spec): Unintern just newly interned symbols when an reader error occurs.
Move presentations to contrib. Part II. * swank.lisp (*listener-eval-function*): New variables. (listener-eval): Use it (repl-eval): Used to be listener-eval. (*send-repl-results-function*): New variable. (eval-region): Simplify. (track-package, cat): New functions.
Remove the ID argument from :write-string protocol messages. Everything, except for rigid-indentation tricks, can be achieved by using :write-string in conjunction with :presentation-start and :presentation-end. * swank.lisp (present-in-emacs): Unused, removed. * swank.lisp (make-output-function-for-target): Remove id argument from :write-string. (send-repl-results-to-emacs): Don't call save-presented-object. Remove id argument from :write-string.
* slime.el (slime-sexp-at-point): Fixes a few edge cases were Emacs' `(thing-at-point 'sexp)' behaves suboptimally. For example, `foo(bar baz)' where point is at the ?\(. (slime-internal-scratch-buffer): New. This variable holds an internal scratch buffer that can be reused instead of having to create a new temporary buffer again and again. (slime-make-extended-operator-parser/look-ahead): Uses `slime-make-form-spec-from-string' to parse nested expressions properly. (slime-nesting-until-point): Added docstring. (slime-make-form-spec-from-string): Added new optional parameter for stripping the operator off the passed string representation of a form. Necessary to work in the context of `slime-make-extended-operator-parser/look-ahead'. Added safety check against a possible endless recursion. * swank.lisp (parse-form-spec): Looses restriction for nesting.
Reduces needless interning of symbols that was introduced by my recent work on autodoc to a minimum. Also fixes this issue for `slime-complete-form' which always interned symbols even before my changes. * slime.el (slime-sexp-at-point): If N is given, but there aren't N sexps available at point, make it return a list of just as many as there are. (slime-make-form-spec-from-string): New. Creates a ``raw form spec'' from a string that's suited for determining newly interned symbols later in Swank. (slime-parse-extended-operator/declare): Uses it. * swank.lisp (parse-symbol): Returns internal knowledge, to provide a means for callers to perform a sanity check. (call-with-ignored-reader-errors): New. Abstracted out from `read-incomplete-form-from-string.' * swank.lisp (read-form-spec): New. Only READs elements of a form spec if necessary. And if it does have to READ, it keeps track of newly interned symbols which are returned as secondary return value. (parse-form-spec): Use it. Propagate newly interned symbols. (parse-first-valid-form-spec): Likewise. (arglist-for-echo-area, complete-form, completions-for-keyword): Adapted to unintern the newly interned symbols.
* swank.lisp (make-output-stream-for-target): New function, factored out from open-streams. (open-streams): Use it here. * swank.lisp (connection): New slot "trace-output". (call-with-redirected-io): Use it here. (redirect-trace-output): New slimefun; set the slot to a new target stream.
(arglist-for-insertion): Now unused, removed.
* slime.el (slime-forward-blanks): Wrapped w/ `ignore-errors.' (slime-sexp-at-point): Return results as a list of strings, rather than just one big string if called with arg > 1. (slime-parse-extended-operator-name): Wrapping some movement code in `ignore-errors'. Adapted to new return value of `slime-enclosing-form-specs'. Minor cosmetic changes. (slime-make-extended-operator-parser/look-ahead): Adapted to changes of the ``raw form spec'' format; returns a form of strings, instead of a string of a form. (slime-parse-extended-operator/declare): Simplified. Adapted to changes of the ``raw form spec'' format; passes decl-identifiers, or typespec-operators respectively, along the decl/type-spec. (%slime-in-mid-of-typespec-p): Removed. Replaced by an regexp based approach. (%slime-nesting-until-point): New helper for `slime-parse-extended-operator/declare'. * swank.lisp (parse-form-spec): Adapted to new ``raw form spec'' format. Updated format description in docstring accordingly.
(inspect-presentation): New slimefun.
Moved Marco Baringer's inspector to contrib.
Added arglist display for declaration specifiers and type specifiers. Examples: `(declare (type' will display (declare (type type-specifier &rest vars)) `(declare (type (float' will display [Typespec] (float &optional lower-limit upper-limit) `(declare (optimize' will display (declare (optimize &any (safety 1) (space 1) (speed 1) ...)) &ANY is a new lambda keyword that is introduced for arglist description purpose, and is very similiar to &KEY, but isn't based upon plists; they're more based upon *FEATURES* lists. (See the comment near the ARGLIST defstruct in `swank.lisp'.) * slime.el: (slime-to-feature-keyword): Renamed to `slime-keywordify'. (slime-eval-feature-conditional): Adapted to use `slime-keywordify'. (slime-ensure-list): New utility. (slime-sexp-at-point): Now takes an argument that specify how many sexps at point should be returned. (slime-enclosing-operator-names): Renamed to `slime-enclosing-form-specs'. (slime-enclosing-form-specs): Returns a list of ``raw form specs'' instead of what was called ``extended operator names'' before, see `swank::parse-form-spec' for more information. This is a simplified superset. Additionally as tertiary return value return a list of points to let the caller see where each form spec is located. Adapted callers accordingly. Extended docstring. (slime-parse-extended-operator-name): Adapted to changes in `slime-enclosing-form-specs'. Now gets more context, and is such more powerful. This was needed to allow parsing DECLARE forms. (slime-make-extended-operator-parser/look-ahead): Because the protocol for arglist display was simplified, it was possible to replace the plethora of parsing function just by this one. (slime-extended-operator-name-parser-alist): Use it. Also add parser for DECLARE forms. (slime-parse-extended-operator/declare): Responsible for parsing DECLARE forms. (%slime-in-mid-of-typespec-p): Helper function for `slime-parse-extended-operator/declare'. (slime-incomplete-form-at-point): New. Return the ``raw form spec'' near point. (slime-complete-form): Use `slime-incomplete-form-at-point'. * swank.lisp: New Helper functions. (length=, ensure-list, recursively-empty-p): New. (maybecall, exactly-one-p): New. * swank.lisp (arglist-for-echo-area): Adapted to take ``raw form specs'' from Slime. (parse-form-spec): New. Takes a ``raw form spec'' and returns a ``form spec'' for further processing in Swank. Docstring documents these two terms. (split-form-spec): New. Return relevant information from a form spec. (parse-first-valid-form-spec): Replaces `find-valid-operator-name'. (find-valid-operator-name): Removed. (operator-designator-to-form): Removed. Obsoleted by `parse-form-spec'. (defstruct arglist): Add `any-p' and `any-args' slots to contain arguments belonging to the &ANY lambda keyword. (print-arglist): Adapted to also print &ANY args. (print-decoded-arglist-as-template): Likewise. (decode-arglist): Adapted to also decode &ANY args. (remove-actual-args): Adapted to also remove &ANY args. (remove-&key-args): Split out from `remove-actual-args'. (remove-&any-args): New. Removes already provided &ANY args. (arglist-from-form-spec): New. Added detailed docstring. (arglist-dispatch): Dispatching generic function for `arglist-from-form-spec' that does all the work. Renamed from prior `form-completion'. (arglist-dispatch) Added methods for dealing with declaration and type-specifiers. (complete-form): Adapted to take ``raw form specs'' from Slime. (completions-for-keyword): Likewise. (format-arglist-for-echo-area): Removed. Not needed anymore. * swank-backend.lisp (declaration-arglist): New generic function. Returns the arglist for a given declaration identifier. (Backends are supposed to specialize it if they can provide additional information.) (type-specifier-arglist): New generic function. Returns the arglist for a given type-specifier operator. (Backends are supposed to specialize it if they can provide additional information.) (*type-specifier-arglists*): New variable. Contains the arglists for the type specifiers in Common Lisp. * swank-sbcl.lisp: Now depends upon sb-cltl2. (declaration-arglist 'optimize): Specialize the `optimize' declaration identifier to pass it to sb-cltl2:declaration-information.
Some inspector cleanups.
Merge contrib branch.
Add a contrib directory and move fuzzy completion code to that directory. * contrib: New directory. * swank.lisp (swank-require): New function to load contrib code. (*find-module*, module-filename, *load-path*, merged-directory) (find-module, module-canditates): New. Pathname acrobatics for swank-require. * swank-loader.lisp: Compile (but don't load) contribs. (*contribs*, contrib-source-files): New. * contrib/slime-fuzzy.el: New file. (slime-fuzzy-init): New function. Load CL code on startup. * contrib/swank-fuzzy.lisp: New file. Common Lisp code for fuzzy completion.
(backtrace): Handle printer errors while printing a frame. This makes debugging print-object methods with SLIME easier. Reported by Utz-Uwe Haus.
Revised docstring in SWANK::SYMBOL-STATUS; added comment to SWANK::UPDATE-INDENTATION/DELTA-FOR-EMACS.
* swank.lisp: Fixed regression in completion: "swank[TAB]" would previously be completed to "swank-backend:"; "get-internal[TAB]" would be completed to "get-internal-r-time" (instead of simply "get-internal-r"); and "custom:*comp[TAB]" would be completed to "custom:*compiled-" on CLISP, even though there's a "custom:*complile-". Thanks to Ken Causey for helping me find the first two. (completions): Revert changes from 2007-05-11. (longest-compound-prefix): Fixed to properly generate a compound _prefix_.
* swank.lisp: Fixed bug in completion as previously "swank:[tab]" would correctly list all the symbols in SWANK, but would simultaneously append a spooky dash to the original string ("swank:-"). (completions): Strip off the package identifier part, and only compute the longest compound prefix for the actual symbol identifiers. (untokenize-symbol): New function. Inverse of TOKENIZE-SYMBOL. (format-completion-result): Use UNTOKENIZE-SYMBOL.
* swank.lisp (inspect-for-emacs file-stream, stream-error): Fixed typo in keyword arg; it's `:refreshp', not `:refresh'.
* swank.lisp (eval-for-emacs): Remove code that would suggest that it's possible to use the rex `(:abort ...)' with more than one argument.
* swank.lisp: Liberated from unnecessary style-warnings! (eval-for-emacs): Don't use SLOT-VALUE on condition objects! (inspect-bigger-piece-actions): Changed from DEFMETHOD to DEFUN. (inspect-whole-thing-action): Likewise. (inspect-show-more-action): Likewise. (make-symbols-listing): Adds an explicit DEFGENERIC. (menu-choices-for-presentation): Likewise. (make-symbols-listing (eql :classification)): Use `(loop for k being EACH hash-key ...)' rather than `(loop for k being THE hash-key)', to omit the justified style-warning from CLISP.
* swank.lisp (package-names): Make sure to return a fresh list. (fuzzy-find-matching-packages): Use PACKAGE-NAMES. (list-all-package-names): Use PACKAGE-NAMES.
* swank.lisp (fuzzy-find-matching-symbols): Modified to take package nicknames into account. Previously, fuzzy completing on nicknames did (except for some incidental cases) not work. Thanks to Luís Oliveira and Attila Lendvai for pointing that out.
* swank.lisp (make-compound-prefix-matcher): New function. Abstracted from COMPOUND-PREFIX-MATCH. (compound-prefix-match): Use MAKE-COMPOUND-PREFIX-MATCHER. (compound-prefix-match/ci/underscores): Removed. (longest-completion): Renamed to LONGEST-COMPOUND-PREFIX. Changed to only return a compound prefix, instead of a concatenation of a compound prefix and a compound suffix. Added an &optional parameter to specify what delimeter the passed string is compounded with. (tokenize-completion): Takes additional parameter to specify the delimeter for tokenization. (longest-completion/underscores): Removed; not needed anymore. (tokenize-completion/underscores): Likewise. (untokenize-completion/underscores): Likewise. (completions): Slight docstring modification, also added an examplary use case; use LONGEST-COMPOUND-PREFIX instead of LONGEST-COMPLETION. (completions-for-character): Use LONGEST-COMPOUND-PREFIX, and MAKE-COMPOUND-PREFIX-MATCHER. (completions-for-keyword): Use LONGEST-COMPOUND-PREFIX.
* swank.lisp (apropos-symbols): Really use MAKE-REGEXP-MATCHER.
* swank.lisp: Previously when using SLIME-APROPOS-PACKAGE, only those symbols were considered whose home package matched the given package; this would, however, prevent all those symbols from being listed that are imported from another package, and then exported again in the package they got imported into. (As an example, SWANK:RESTART-FRAME is actually from SWANK-BACKEND.) (apropos-matcher): Renamed to MAKE-REGEXP-MATCHER. (make-regexp-matcher): Changed to only match for a given regexp. (apropos-symbols): Use MAKE-REGEXP-MATCHER.
(inspect-for-emacs-list): Don't add a newline after the last value of the list.
(log-event): Setup the printer so that, no matter what the global values of the *print-XYZ* variables, this function works as expected. (*debug-on-swank-error*): New variable. (defpackage :swank): Export *debug-on-swank-error*. (with-reader-error-handler): When *debug-on-swank-error* is non-nil drop into a debugger. (dispatch-loop): Idem.
Instead of just having all the symbols of a package listed alphabetically in the inspector page recently introduced for that purpose, add a button to that page to group them by their classification.
(swank-compiler): Fix the return value to always be a list of two elements even if the abort restart is invoked which originally just returned NIL. (Which wouldn't play with the recent change to use DESTRUCTURING-BIND in SLIME-COMPILATION-FINISHED.) (inspect-for-emacs %package-symbols-container): Revert Marco's change from 2007-04-08; he had the good idea of adding a facility to jump to the relevant source line of a symbol, but `M-.' is already bound to SLIME-FIND-DEFINITION in the inspector, which is a nicer way of doing this alltogether.
(fuzzy-find-matching-packages): Fix a small typo that prevented interpreting NIL as the argument TIME-LIMIT-IN-MEC to mean an infinite time limit. This bug propagated up to explicit calls to FUZZY-COMPLETIONS, like (swank:fuzzy-completions "mvb" "COMMON-LISP") => (NIL, T) (format-fuzzy-completions): Renamed to FORMAT-FUZZY-COMPLETION-SET (format-fuzzy-completion-set): Accomodated to recent changes of the return value of FUZZY-COMPLETIONS; changed the docstring to make it explicit that this function is supposed to take the return value of FUZZY-COMPLETION-SET.
*** empty log message ***
(inspector-content-for-emacs): Look for refresh keyword argument in :action links. (inspect-whole-thing-action, inspect-show-more-action): Update for new :action argument handling. (inspect-for-emacs stream, inspect-for-emacs stream-error): Pass :refresh nil on :action links. (action-part-for-emacs): Set both lambda and refresh in the *inspectee-actions* array. (inspector-call-nth-action): *inspectee-actions* now holds both the function and the boolean specifying whether to refresh or not.
(inspect-for-emacs): Added 'jump to source' action for symbols in the new package-symbol browser.
*** empty log message ***
*** empty log message ***
*** empty log message ***
*** empty log message ***
*** empty log message ***
*** empty log message ***
*** empty log message ***
Add *print-lines* to *macroexpand-printer-bindings*.
(menu-choices-for-presentation): Offer a "disassemble" menu item for functions.
(lookup-presented-object): The presentation id of frame locals now includes the thread id; ignore it for now.
(completion-output-symbol-converter): Fix completion for mixed-case symbols that need escaping in readtable-case :upcase or :downcase.
inspecting NaNs and infinities
(guess-package): Renamed from guess-package-from-string. (set-package): Use it.
(unparse-name): New function. (list-all-package-names): Use it. This fixes a bug related to readtable-case and makes package name completions look prettier. Suggested by Harald Hanche-Olsen <email@example.com>.
(list-all-systems-known-to-asdf): Don't reference asdf directly, that leads to read errors in some systems.
(handle-request): Use 'abort as restart name, but bind *sldb-quit-restart* to the restart returned by find-restart. Also use a slighly friendlier message, because newbies seem to invoke the ABORT restart instead of pressing q in the debugger.
Offer systems already know to ASDF for completion
(inspect-for-emacs integer): Don't die if the integer can't be expressed as a float. (Patch by: Ariel Badichi <email@example.com>)
(*sldb-printer-bindings*): Add *print-right-margin*. (debug-in-emacs): Bind *sldb-printer-bindings* here. (backtrace, debugger-info-for-emacs, frame-locals-for-emacs): And remove redundant bindings here. These functions are all called in the dynamic extend of debug-in-emacs.
(open-streams): Don't pass nil to make-fn-streams; use a dummy function as workaround. Both arguments must be functions and CMUCL checks the types.
FIX: slime-insert-possibly-as-rectange and sldb stuff on newer emacsen
FIX: sort is destructive, call copy-seq at a few places
FIX: bind *sldb-printer-bindings* also in frame-locals-for-emacs
FIX: drop extra "Slots: " from standard-object's inspector presentation
FIX: keyword symbols keep their : when travelling from swank to slime
Handle better the case when swank can not read anything from the string sent to be inspected. Only bring up the debugger when the inspect command is prefixed.
(connection): New slot repl-results (a stream). (make-output-function-for-target): New. (open-streams): Use it here to also create a stream for REPL results. (initialize-streams-for-connection): Store the stream.
(make-presentations-result): Removed. (send-repl-results-to-emacs): New function, sends :WRITE-STRING events. (listener-eval): Use it here instead of make-presentations-result.
Added customizable dwim lookup hook support for inspect
Change the order to [set value] [make unbound]
Sort slot names in the inspector
Extend :write-string with and &optional presentation id and use this in present-in-emacs
Added present-in-emacs that prints a presentation of the given object in the repl
Return the inspected object when inspecting from the lisp side.
Turn off right margin for restart printing, too
In all-slots-for-inspector pad slot names to be equal length, so the result is more readable
Properly bind *sldb-printer-bindings* and turn off right margin while printing stuff in sldb
Added hash-table-weakness and use it in hash-table-inspecting
Hashtable inspecting: added [clear hashtable] and [remove entry] actions
FIX dwim inspecting to handle (setf some-fun) functions, too
Small: get rid of notes and warnings
Added dwim-mode to slime-inspect that tries to be smart unless prefixed
Add (expt 1.2 length) higher scores for longer matches in fuzzy completion. A good example: puts "make-instance" before "make-string-input-stream" while completing "make-ins"
(*sldb-printer-bindings*): *PRINT-LINES* is in effect only if *PRINT-PRETTY* is non-NIL, so it better to enable the pretty printer. Suggested by Madhu <email@example.com>.
FIX: fuzzy completion for M-V-B. Fix by Madhu.
Implement INSPECT-IN-EMACS, tweak inspection of integers.
Added [set value] command for slot inspecting
Added inspect-slot-for-emacs to let users customize it. Use all-slots-for-inspector everywhere, render link to both the effective and direct slots when both are available. Dropped slot-value-using-class-for-inspector and friends. Added slot-makunbound-using-class to the swank-mop package and added a [make-unbound] action to the standard slot presentation.
FIX: Drop #\. and add #\, to escaped symbol chars
(init-inspector): Added eval parameter. If NIL we don't eval FORM but limit our selves to cl:read'ing it and inspecting that value.
*** empty log message ***
(create-swank-server): Deleted. Use create-server instead.
(*coding-system*): "Coding systems" are now strings instead of keywords. Set it to "iso-latin-1-unix".
(compile-file-for-emacs): Use guess-external-format. (*swank-wire-protocol-version*): Is now initialized by the loader. (wire-protocol-version): Removed, because it contained a reference to swank-loader::*source-directory*.
(make-presentations-result): New, factored out from listener-eval. (listener-eval): Use it here.
(all-slots-for-inspector): Added declare ignore for unused argument inspector (openmcl warns about this). Reindented.
(fuzzy-completion-set): Fix on clisp. (convert-fuzzy-completion-result): Fix symbol fbound and other annotations. (slot-value-using-class-for-inspector): New. (slot-boundp-using-class-for-inspector): New. (inspect-for-emacs): Use the special slot access methods so that it's possible to customize the inspecting of complex slots (e.g. computed-class at http://common-lisp.net/project/computed-class/). (all-slots-for-inspector): Converted to generic method.
(*swank-wire-protocol-version*): Use a defvar to declare the existence of tihs variable to the lisp (Reported by: Jonathon McKitrick <email@example.com>).
(*dont-close*): New variable. (defpackage :swank): Export *dont-close*. (start-server, create-server): Use *dont-close* as the default value of the :dont-close parameter. (connection-info): Send the wire-protocol-version (supplied by the swank-version.el file) to slime when connecting. (wire-protocol-version): New function.
(completions-for-character): New slimefun. (compound-prefix-match/ci/underscores) (longest-completion/underscores, tokenize-completion/underscores) (untokenize-completion/underscores): New functions.
(fuzzy-completions and friends): Added :limit and :time-limit-in-msec keyword params. Used vectors instead of lists that nearly doubled its speed (at least on sbcl). Also added some declare optimize and type annotations. (do-symbols*): New, uses a hash-table to visit only non-seen symbols. Replaced various uses of do-symbols where it was appropiate.
(startup-idle-and-top-level-loops): Deleted. Merged into initialize-multiprocessing.
(start-server): initialize-multiprocessing's API has changed.
(sanitize-xrefs): Moved to swank-sbcl. The backend is supposed to return sane values. (find-definitions-for-emacs): Don't filter errors out.
(guess-package-from-string): Remove special case for "#.". parse-package will handle that just fine.
(guess-package-from-string): Handle #. forms. (inspect-for-emacs standard-class): Handle non-string :documentation slot contents.
Clean up global IO redirection. (setup-stream-indirection): Turn macro into a function and delay initialization after user init files are loaded, so that we do nothing if *globally-redirect-io* is nil. (*after-init-hook*, run-after-init-hook, init-global-stream-redirection): New. (parse-symbol-or-lose): Lose loudly and early (instead of failing silently).
(completions-for-keyword): Look up the operator names in the right package. Return nil (rather than signalling an error) when no valid operator name is present.
(*globally-redirect-io*): Change default value to T.
fix SBCL 0.9.17
(find-definitions-for-emacs): Don't return locations whose CAR is :error. (xref): Process whatever is returned by the various xref functions with the new sanitize-xrefs functions. (sanitize-xrefs): Clean up the list of xrefs to remove duplicates. Patch by Dan Weinreb <email@example.com>
sbcl single-stepper
(eval-for-emacs): Handle request-abort conditions. (decode-keyword-arg, get-repl-result, parse-symbol-or-lose): Use abort-request instead of error.
(format-iso8601-time): Properly handle non integer time zones.
(format-arglist-for-echo-area): Instead of using let+first+rest to destructure a form use destructuring-bind. (lookup-presented-object): Added (declare (special *inspectee-parts*)) to silence openmcl's compiler. (inspect-object): Generate, and send to emacs, an ID for the object being inspected.
(input-available-p, process-available-input): Use READ-CHAR-NO-HANG instead of LISTEN because LISTEN suddenly returns false in SBCL 0.9.?? even if we are called from a fd-handler and the OPEN-STREAM-P returns true.
(lookup-presented-object): Fix for OpenMCL 1.0 [ppc32], which requires that the :NO-ERROR clause is last in HANDLER-CASE.
(lookup-presented-object): Handle presentation ids (:frame-var frame index), (:inspected-part part-index). (init-inspector): New optional argument, reset.
(compute-enriched-decoded-arglist with-open-file): Add an IGNORE declaration.
(*nil-surrogate*): New. (save-presented-object, lookup-presented-object): Distinguish between a saved NIL and a garbage-collected object that was replaced by NIL in the weak hash table.
(compute-enriched-decoded-arglist): Add method for handling APPLY.
(close-connection, swank-error): Include backtraces in our own errors. (simple-serve-requests): Don't enter the debugger (recursively) if the connection is closed.
swank-backend.lisp (definterface): Drop that incredibly unportable CLOS stuff. Use plists and plain functions instead. Update backends accordingly.
(test-print-arglist): Print a message instead of signalling an error. This should avoid startup problems (in particular with CormanLisp). (setup-stream-indirection): Disable it for now. We should fix it, if there is need for this functionality or just remove it.
(find-valid-operator-name): New, factored out from arglist-for-echo-area. (arglist-for-echo-area): Use it here. (print-arglist): New, factored out from decoded-arglist-to-string. Handle recursive arglist structures that arise in destructuring macro arglists. (decode-required-arg, encode-required-arg): New, handle destructuring patterns. (decode-keyword-arg, encode-keyword-arg, decode-optional-arg) (encode-optional-arg, decode-arglist, encode-arglist): Use them here to handle destructuring patterns. (print-decoded-arglist-as-template): Change interface, handle destructuring patterns. (decoded-arglist-to-template-string): Use it here. (enrich-decoded-arglist-with-keywords): New, factored out from enrich-decoded-arglist-with-extra-keywords. (enrich-decoded-arglist-with-extra-keywords): Use it here. (compute-enriched-decoded-arglist): New generic function, factored out from arglist-for-insertion, form-completion. Add specialized method for with-open-file. (arglist-for-insertion, form-completion): Use it here. (arglist-ref): New. (completions-for-keyword): Change interface, handle destructuring macro arglists.
(keywords-of-operator): New support function for writing user-defined `extra-keywords' methods.
(extra-keywords change-class): Don't drop the first argument.
(arglist): Distinguish between provided actual args and required formal args using the new slot provided-args. (form-completion): Likewise. (decoded-arglist-to-string): Use it here to display the argument list (make-instance 'CLASS-NAME ...) rather than (make-instance (quote CLASS-NAME) ...).
Remove FIXME.
(operator-designator-to-form): Handle cerror and change-class with :make-instance.
(operator-designator-to-form): Handle :cerror. (extra-keywords cerror): Make it work.
(*sldb-quit-restart*): New variable. (throw-to-toplevel): Use the restart named by *sldb-quit-restart* as opposed to hard coding abort-request.
* swank.lisp (recursively-compute-most-completions & friends): Micro-optimize the fuzzy completion engine, improving performace by a factor of about 4 on SBCL. However, it will only work on simple-strings now, and CHAR= is burned in instead of being an option. I don't think this is too much of a limitation. At this point rendering the results on the emacs side takes much longer than finding them for long result lists.
Fix for problem with Allegro CL 8.0: If I type M-x slime-update-indentation, Allegro CL starts growing until it hits a STORAGE-CONDITION or even segfaults.
(*use-dedicated-output-stream*): Disable it by default to avoid race conditions.
Fixes/improvements to the make-instance highlighting. * shared-initialize and allocate-instance keywords Also fixes to general keyword argument list handling: notably getting the keyword and variable the right way round.
(multiple-value-or): New macro. (extra-keywords): Use MULTIPLE-VALUE-OR rather than OR.
(operator-designator-to-form): Handle forms similar to make-instance (make-condition, error, etc.) (extra-keywords/make-instance): New function. (extra-keywords): Specialize on operators make-condition, error, signal, warn, cerror.
Move arglist test code down where all used functions are defined.
(arglist-for-echo-area): New keyword arg, print-lines. (decoded-arglist-to-string): New function, implement argument highlighting also for &optional and &rest/&body arguments. (arglist-to-string): Use decoded-arglist-to-string. (arglist): New slots aux-args, known-junk, unknown-junk. (nreversef): New macro. (decode-arglist, encode-arglist): Refine to handle more structure in argument lists, including implementation-defined stuff like &parse-body. (format-arglist-for-echo-area): New keyword arg, print-lines. Simplify the code as there is no need to fall back to the unparsed arglist any more.
Allow swank:ed-in-emacs to take cons function names. (This adds some ambiguity with conses representing filenames and positions)
(casify): Removed. (casify-char, tokenize-symbol-thoroughly): New functions. (parse-symbol): Use tokenize-symbol-thoroughly, so as to handle |escaped symbols|.
(arglist-for-echo-area): Fix when arg-indices are not given.
* Improve the robustness of connection establishment.
(inspect-for-emacs stream-error t): Don't call pathname on non-file streams.
(inspect-for-emacs): Specialize on FILE-STREAM and STREAM-ERROR, offering to visit the file at the current stream position as an inspector action. Useful for dealing with reader errors.
(arglist-for-echo-area): New keyword argument arg-indices. (arglist-to-string): New keyword argument highlight. (format-arglist-for-echo-area): Likewise.
(arglist-for-echo-area): Add keyword argument print-right-margin. (arglist-to-string, format-arglist-for-echo-area): Likewise.
* swank-backend.lisp (operate-on-system): symbol case fix for SCL's lowercase mode. * swak.lisp (setup-stream-indirection) (globally-redirect-io-to-connection) (revert-global-io-redirection): symbol case fixes. * swank-scl.lisp: (inspect-for-emacs): Fixes for the inspect standard-objects, and inspect array. Plus misc symbol case fixes.
(operator-designator-to-form): New, factored out from arglist-for-echo-area. (arglist-for-echo-area): Use it here. (completions-for-keyword): New. (find-matching-symbols-in-list): New.
(macro-indentation): Don't count '&optional as argument.
(arglist-to-template-string): Unused, removed. (extra-keywords): Indicate which part of the actual arglist was used to determine the extra keywords. For MAKE-INSTANCE, don't signal an error if the class does not exist. (enrich-decoded-arglist-with-extra-keywords): Indicate which part of the actual arglist was used to determine the extra keywords, and whether any extra keywords were added. (form-completion): Generalize to handle display of enriched formal arglists. (read-incomplete-form-from-string): New, factored out from complete-form. Handle end-of-file. (complete-form): Use it here. (format-arglist-for-echo-area): Use form-completion, so as to show enriched formal arglists for MAKE-INSTANCE and DEFMETHOD calls. (arglist-for-echo-area): Handle MAKE-INSTANCE and DEFMETHOD calls.
Patch from Ian Eslick. Show slot values for metaclasses that override the default storage locations for objects slots (i.e. where the default slot-boundp returns nil) in the inspector. * swank.lisp (inspect-for-emacs standard-object): Use slot-value-using-class and slot-boundp-using-class. * swank-backend.lisp: Add slot-value-using-class and slot-boundp-using-class to the swank-mop package.
Patch from Lu�s Oliveira. Extend slime-echo-arglist to display initargs and initforms when make-instance is detected. * slime.el (slime-enclosing-operator-names): detect make-instance forms and collect the class-name argument if it exists and is a quoted symbol. * swank.lisp (arglist-for-echo-area): handle pairs of of the form ("make-instance" . "<class-name>") by passing them to format-initargs-and-initforms-for-echo-area. (class-initargs-and-iniforms): New function. (format-initargs-and-initforms-for-echo-area): New function.
(spawn-threads-for-connection): Fix a race condition: Don't accept input before all threads are ready. (throw-to-toplevel): No longer invoke the 'abort restart if the 'abort-request isn't available.
(log-event): Record the event in the history buffer. (*event-history*, *event-history-index*, *enable-event-history*): Ring buffer for events. (dump-event-history, dump-event, escape-non-ascii, ascii-string-p) (ascii-char-p): New functions. (close-connection): Escape non-ascii strings and include the event history in the error message.
(all-slots-for-inspector): New function. (inspect-for-emacs): Use all-slots-for-inspector.
slime-selector tweak, robuster printing
(pprint-inspector-part, swank-compiler-macroexpand): New.
(*dedicated-output-stream-buffering*): New variable to customize the buffering scheme. For single-threaded Lisps we disable buffering because lazy programmers forget to call finish-output. (open-dedicated-output-stream): Use it.
(connection-info): Docfix.
(simple-serve-requests): Add an extra abort restart. (connection-info): Rename :type-name to :name.
(simple-serve-requests): Close the connection at the end.
* swank-backend.lisp (install-debugger-globally): new interface function * swank.lisp (install-debugger): call install-debugger-globally * swank-sbcl.lisp (install-debugger-globally): set sb-ext:*invoke-debugger-hook* too
* (canonical-package-nickname): always return the package name as a symbol if found. This restores the printing of package names as strings.
(eval-in-emacs): Instead of taking a string and attempting to parse it emacs side the function now takes a form and converts it to a string internally. This should allow users of the function to not have to worry about quoting issues and emacs' different printed represenation for, among other things, characters. (process-form-for-emacs): New function. Converts a list into a string for passing to emacs.
o *canonical-package-nicknames*: use lowercase symbols to name the packages. This supports CL implementations with lowercase default symbol names, such as Scieneer Common Lisp, while still being compatible with ANSI-CL.
(force-user-output): There seems to be a bug in Allegro's two-way-streams. As a workaround we use force-output for the user-io stream. (finish-output *debug-io*) still triggers the bug.
(connection-info): Include the initial package and a more self-descriptive format.
(start-server): Call initialize-multiprocessing before starting the server and startup-idle-and-top-level-loops afterwards. Calling startup-idle-and-top-level-loops here shouldn't be a problem because start-server is only invoked at startup via stdin. (inspector-reinspect): New function.
(accept-authenticated-connection): Minor fix. Ensure that the decoded message is a string before calling string= on it. Patch from Aleksandar Bakic.
(throw-to-toplevel): Invoke the `abort-restart' request instead of throwing to the `slime-toplevel' catch tag. (handle-request): Rename the restart from abort to abort-request. (call-with-connection): Remove the slime-toplevel catch tag because with-connection is used in far to many places which aren't at "toplevel".
(make-output-function): Rename :read-output to :write-string. (eval-for-emacs, interactive-eval, eval-region): Use finish-output not force-output.
Move presentation menu protocol here from present.lisp.
(eval-in-emacs): Fix a race condition which occurred with sigio. (*echo-area-prefix*): New variable.
*** empty log message ***
* slime.el (slime-menu-choices-for-presentation), (slime-presentation-menu) Fix loss after refactoring. xemacs can't handle lambda forms in the menu spec given to x-popup-menu, only symbols, so save the actions in a hash table keyed by a gensym, give x-popup-menu the gensym and then call the gensym. Haven't checked that it actually works in xemacs because my xemacs is hosed in os x Tiger. Could someone let me know... * swank.lisp (inspect-factor-more-action) rename (inspect-show-more-action) Prompt before reading how many more. Would be nicer to prompt in the minibuffer...
*** empty log message ***
*** empty log message ***
Fix parens.
Simplify the object <-> presentation-id mapping. (save-presented-object): Remove the optional `id' arg. (lookup-presented-object): Id's should be fixnums not some cons with fuzzy/non-documented meaning. Use the secondary return value to test for absence of the id. Update callers accordingly. (*not-present*): Deleted. Remove the repl result special cases, let the general presentation machinery handle it. (*last-repl-result-id*, add-repl-result, *current-id*) (clear-last-repl-result): Deleted. (listener-eval): Don't *current-id* to tag result values. (*can-print-presentation*): Deleted. Nobody quite knows whether it's still needed so let just try without it. Updated referrers accordingly. (eval-region, run-repl-eval-hooks): Move the eval hook stuff to a separate function.
(y-or-n-p-in-emacs): Simplify arglist. (evaluate-in-emacs, dispatch-event, send-to-socket-io): Remove evaluate-in-emacs stuff. (to-string): Undo last change. to-string is not to supposed to ignore errors. Bind *print-readably* instead. (background-message): New function. (symbol-external-p): Simplify it a little.
(to-string): Handle errors during printing of objects.
*** empty log message ***
(dispatch-event, send-to-socket-io): Handle new messages :y-or-n-p, :background-message. (y-or-n-p-in-emacs): New function.
(*object-to-presentation-id*, *presentation-id-to-object*): Use new functions make-weak-key-hash-table, make-weak-value-hash-table.
(send-to-socket-io): Handle :evaluate-in-emacs.
(fuzzy-find-matching-symbols): When completing the string "package:" present a list of all the external symbols in package (completing "package::" lists internal symbols as well). (inspect-for-emacs standard-class): List all the slots in the class (as per standard-object). The previous method of hard coding the slots in the inspector's code made inspecting custom meta-classes useless.
* swank.lisp (*object-to-presentation-id*) (*presentation-id-to-object*, clear-presentation-tables) (*presentation-counter*, lookup-presented-object): Move here from present.lisp. (save-presented-object): Likewise. Assign negative numbers only, so as not to clash with continuation ids. * swank.lisp (*repl-results*): Removed. * swank.lisp (get-repl-result, clear-repl-results): Use new implementations from present.lisp. (add-repl-result): Likewise, don't take the negative of the id. (*last-repl-result-id*): New variable. (clear-last-repl-result): Use it here.
TRANSPOSE-LISTS again...
Helmut's version is much nicer...
New version of SWANK::TRANSPOSE-LISTS
(form-completion): New generic function, factored out from complete-form. (complete-form): Factor out form-completion. (form-completion): Specialize on defmethod forms to insert arglist of generic function.
Undo changes I checked in by mistake.
(*can-print-presentation*): Move up.
(*can-print-presentation*): New variable, moved here from present.lisp. (interactive-eval, listener-eval, backtrace) (swank-compiler, compile-file-for-emacs, load-file) (init-inspector): Bind *can-print-presentation* to an appropriate value.
(encode-message): Don't use the pretty printer for printing the message length. (listener-eval): Store the whole values-list with add-repl-result.
(dispatch-event, send-to-socket-io): New events :presentation-start, :presentation-end for bridge-less presentation markup.
(*dedicated-output-stream-port*): New variable. (open-dedicated-output-stream): Open the stream on the port *dedicated-output-stream-port*.
(inspect-for-emacs): Don't make whitespace surrounding :action buttons part of the highlighted region.
(compile-file-for-emacs): Accept optional external-format argument.
*** empty log message ***
Add package nicknames to completion results
remove duplicate asdf systems
Minor changes to ED-IN-EMACS / slime-ed. Now (push 'swank:ed-in-emacs sb-ext:*ed-functions*) works more-or-less as required. (We don't obey the constraint that file-error conditions be signalled on file system errors, but...)
(compiled-regex): Use the new package name.
(present-symbol-before-p): Fix docstring; remove optimization; compare package names correctly.
(present-symbol-before-p): make it conform to its specification -- sort first by package and then by symbol name.
(simple-announce-function): force-output after announcing. (symbol-external-p): Be extra paranoid about the symbol's package; find-symbol barfs on a nil package in Corman Lisp.
*** empty log message ***
(clear-repl-results): Fixed unbalanced parens. Thanks Lawrence Mitchell.
(*record-repl-results*): Variable to enable/disable recording of REPL results. True by default. (*repl-results*): Renamed from ****.
(*current-id*, ****): New variables. (add-****, get-****, clear-last-****, clear-****): New functions for manipulating the repl history. (listener-eval): Add * to ****.
2005-05-12 Alan Ruttenberg <firstname.lastname@example.com> * swank.lisp Add ability to customize behavior of the repl. To do so, add a function to the list swank::*slime-repl-eval-hooks*. This function is passed the form typed into the repl. The function should decide whether it wants to handle evaluation of the form. If not, call (repl-eval-hook-pass) and the next hook is tried. Otherwise the values the function returns are used instead of calling eval. Inside the body of the function you can also suppress having the repl print the result by calling (repl-suppress-output) and/or suppress the advancement of the history variables (*** ** * /// // /) by calling (repl-suppress-advance-history).
(slime-secret): Removed #+unix conditional.
If ~/.slime-secret exists then insist that Emacs sends the contents (as a password) during initial handshaking. (announce-server-port): Use :IF-EXISTS :ERROR to prevent bad guys from slipping a symlink into /tmp and reading what port Lisp is listening on.
(arglist-to-string): Rolled back the previous change because it interferred with values appearing in parameter lists.
(arglist-to-string): Bind *PRINT-ESCAPE* to NIL. This way symbols in arglists are printed as with PRINC, i.e. without package qualifier.
(with-io-redirection, with-connection, with-buffer-syntax): Implement macros with a `call-with' functions to avoid some code bloat. (call-with-connection, maybe-call-with-io-redirection) (call-with-buffer-syntax): New functions. (interactive-eval): Use from-string instead of read-from-string to avoid problems whit *read-suppress*.
(connection-info): Include version and hostname in the result.
(spawn-repl-thread): Use *default-worker-thread-bindings* just like spawn-worker-thread. (wrap-sldb-vars): New function. When evaluating a form in a frame, Allegro uses the "old" dynamic context, i.e., dynamic variables like *sldb-level* and the like are reset to the values in those frames. But if *sldb-level* is reset to 0, Emacs doesn't notice when a (recursive) error occurs while evaluating the form in the old frame. wrap-sldb-vars saves the debugger related variables to avoid such confusion. (eval-string-in-frame, pprint-eval-string-in-frame): Use it.
(commit-edited-value): Read a backquated string, instead of quating the result of read. This allows one to put ,(form) into edit-value buffers.
(commit-edited-value): Use buffer syntax. (compile-file-for-emacs, compile-string-for-emacs): Bind *compile-print* to nil.
(*macroexpand-printer-bindings*): New user variable. (apply-macro-expander): Use it. (call-with-bindings): Bind reverse the list. Makes it easer to cons or push a new binding at the front the list. (with-bindings): New macro.
(inspect-for-emacs symbol): Add an "unintern it" action for symbols.
(value-for-editing, commit-edited-value): New functions for slime-edit-value.
*** empty log message ***
(format-arglist-for-echo-area): Use extra-keywords to enrich the list of keywords. (arglist-to-string): Remove extraneous whitespace. (keyword-arg, optional-arg): New structures. (decode-keyword-arg, decode-optional-arg): Return structure objects rather than multiple values. (encode-keyword-arg, encode-optional-arg, encode-arglist): New functions. (arglist): New slot key-p. (decode-arglist): Handle &whole, &environment. Store more information on optional and keyword args, set arglist.key-p. (values-equal?): Removed. (print-decoded-arglist-as-template): If keyword is not a keyword symbol, quote it in the template. (extra-keywords): Return a secondary value (allow-other-keys). For make-instance, try to finalize the class if it is not finalized yet (fix for Allegro CL 6.2). If class is not finalizable, use direct slots instead of slots and indicate that the keywords are not complete. (enrich-decoded-arglist-with-extra-keywords): New function, use the secondary value of extra-keywords. (arglist-for-insertion, complete-form): Use it here. (remove-keywords-alist): New variable. (remove-actual-args): When the keyword :test is provided, don't suggest :test-not and vice versa.
Export LOG-OUTPUT.
(*sldb-printer-bindings*, *swank-pprint-bindings*): New variables. The alists replace the variables which where previously hidden with the define-printer-variables macro. (define-printer-variables, with-printer-settings): Deleted, because the variable names where not visible in the source code. (swank-toggle-trace): Renamed from toggle-trace-fdefinition.
(eval-for-emacs): Use the new backend function call-with-debugger-hook. (eval-in-emacs): Cleaned up. Add support for synchronous RPCs. (receive-eval-result): New function. (dispatch-event, read-from-socket-io, send-to-socket-io): New :eval event. Rename :%apply to :eval-no-wait. (read-user-input-from-emacs, evaluate-in-emacs): Increment *read-input-catch-tag* instead of re-binding it. Reduces the danger of throwing to the wrong tag a bit.
(arglist): New struct for storing decoded arglists. (decode-arglist): New function. (arglist-keywords, methods-keywords, generic-function-keywords, applicable-methods-keywords): New functions. (decoded-arglist-to-template-string, print-decoded-arglist-as-template): New functions. (arglist-to-template-string): Rewrite using above functions. (remove-actual-args): New function. (complete-form): New slimefun. (extra-keywords): New generic function. (arglist-for-insertion): Use extra-keywords to enrich the list of keywords. (valid-operator-symbol-p): New function. (valid-operator-name-p): Use valid-operator-symbol-p.
(dispatch-event): Handle the :evaluate-in-emacs message type. (evaluate-in-emacs): New function.
(*pending-continuations*, eval-in-emacs, debugger-info-for-emacs): Keep track of debugged continuation the new variable *pending-continuations* and include the list of active continuations in the debugger info for Emacs. (eval-and-grab-output): New function. Used by slime-eval-print. (*log-output*): Renamed from *log-io*. Use *standard-error* as initial value instead of *terminal-io*. CMUCL opens its own tty and that makes it hard to redirect to output with a shell. *standard-error* writes its output to file descriptor 2. (*canonical-package-nicknames*): Fix typo.
(parse-symbol): Don't break if the package doesn't exists.
(arglist-to-template-string): New function. (arglist-for-insertion): Use it (decode-keyword-arg, decode-optional-arg): New functions.
*** empty log message ***
(*default-worker-thread-bindings*): New variable to initialize dynamic variables in worker threads. (spawn-worker-thread, call-with-bindings): New helper functions. (thread-for-evaluation): Use them.
(inspect-for-emacs-list): LispWorks has a low args limit for apply: use reduce instead of apply.
(frame-for-emacs): Print the frame number a little nicer with ~2D.
(slime-lisp-modes): New variable to make C-c C-k customizable and usable in scheme-mode. (slime-compile-file): Use it.
(*sldb-print-pretty*, *sldb-print-circle*, *sldb-print-length*) (*sldb-print-level*, *sldb-print-lines*) (*sldb-print-pprint-dispatch*): Export those symbols.
(eval-region): Use a simple loop.
(inspect-for-emacs (symbol)): Handle non-interned symbols.
(macro-indentation): Call clean-arglist.
(dispatch-loop): Catch errors and close the connection. It's almost impossible to run the debugger inside the control-thread, so let it crash instead. A backtrace would be nice, though. (cleanup-connection-threads): Can know be called in the control-thread. Add a check to avoid thread suicide. (arglist-to-string): Don't show &whole, &aux and &environment args. (clean-arglist): New function. (start-swank-server-in-thread): Fix the call to start-server.
(inspect-for-emacs-list): subseq on improper lists breaks in Lispworks. Handle that case better.
(*coding-system*): New variable. (start-server): Accept external-format as argument. (create-server, create-swank-server, setup-server, serve-connection) (open-dedicated-output-stream, create-connection): Ditto. (defstruct connection): Add external-format slot. (decode-message-length): Use function for new length encoding. (decode-message): Use it. (encode-message): Use new encoding.
(inspect-for-emacs array): Use row-major-aref instead of a displaced array. I that's the same. (inspect-for-emacs integer): Ignore errors in decode-universal-time. Negative values and in SBCL also small values cannot be decoded. (list-threads): Include the thread-id. Useful for SLIME debugging.
(inspect-for-emacs): Fix bug in handling of arrays with fill-pointers.
(defstruct connection): Add new slot: communication-style for convenience. (create-connection): Initialize the new slot. (connection-info): Send the communication-style to Emacs. (install-fd-handler, simple-serve-requests): Sending :use-sigint-for-interrupt is no longer necessary. (notify-backend-of-connection): Don't pass the output stream to the backend.
(features-for-emacs): New function to avoid keyword/string confusion. Case doesn't matter since Emacs will downcase them anyway. (connection-info, sync-features-to-emacs): Use it. Should fix highlighting bug reported by Edi Weitz.
* slime.el (slime-fuzzy-explanation): Added line to describe flags (:boundp, :fboundp, :macro, etc), which are now reported in the fuzzy-completion output. (slime-fuzzy-insert-completion-choice): Added flags. (slime-fuzzy-choices-buffer): Added flags header. * swank.lisp (fuzzy-completions): Changed docstring to describe new flags in the completion results. (convert-fuzzy-completion-result): New function to marshall the results from the completion core into something Emacs is expecting. Added flags. (fuzzy-completion-set): Use the above. (compute-completion): Removed. (score-completion): Cleaned up a little bit. (highlight-completion): Use destructive nstring-upcase.
(assign-index): Avoid linear search.
(inspect-for-emacs[integer]): Fix control string. Thanks to CSR for pointing it out.
(*sldb-stepping-p*): New variable. Used to tell emacs that the debugger buffer should not be closed even if we unwind. (debug-in-emacs): Use it. (sldb-step): Moved to the front end. (inspector-princ, method-specializers-for-inspect): Simplified. (methods-by-applicability): Use a simpler algorithm. I doubt there is much difference in practice. (inspect-for-emacs)[symbol, function, standard-generic-function] [standard-method]: Use less than 80 columns. (inspector-call-nth-action): Don't accept &rest args. Was never used.
(define-printer-variables): Handle doc strings properly. (*sldb-pprint-dispatch*): Initialize it with the default dispatch table.
(inspect-for-emacs array): Properly deal with arrays without fill pointers. (inspect-for-emacs function): Show function-lambda-expression when available. (inspect-for-emacs generic-function): Order generic function's methods and show abbreviated docs for methods. (abbrev-doc): New function. (methods-by-applicability): New function. (*gf-method-getter*): New variable.
(define-printer-variables): Allow print-gensym, base and others. (printer-variables sldb-print): Include print-gensym, pprint-dispatch, base, radix, array, lines.
(define-printer-variables): NIL is not a valid docstring. Reported by Alain Picard.
(printer-variables sldb-print): Ooops. Better use sldb-print as prefix than sldb alone. *sldb-level* was already defined.
(*sldb-pprint-frames*): Renamed to *sldb-print-pretty*. (*sldb-print-level*, *sldb-print-length*, *sldb-print-circle*) (*sldb-print-readbly): Group of new variables to customize printing in the debugger. The default values should be safe. (define-printer-variables, with-printer-settings): New macros to make definig and binding groups printer variables easier. (inspect-for-emacs-list): Rewritten. The old version had a bug with circular lists, didn't include the position of the element, and always showed the full list. The new version only shows the first 40 elements. (inspect-for-emacs): Minor cleanups. (all-qualified-readnames): Removed. It was not needed because common-lisp-indent-function strips of any package prefix and downcases the symbol anyway.
Bind *debugger-hook* instead of setfing it when spawning threads.
minor inspector cleanups
(update-indentation/delta-for-emacs): Configure Emacs indentation settings not just for the symbol name but for all package-qualified forms of it as well.
(arglist-for-echo-area): Handle errors and return a message. (parse-symbol): Recognise an empty package name as the KEYWORD package.
(parse-symbol): Don't use the reader because to avoid interning unknown symbols. The downside is that we no longer handle escaped |symbols| correctly.
(mop, mop-helper): Support functions for the class browser. By Rui Patroc�nio.
(load-file-set-package): New function.
(frame-locals-for-emacs): Bind *print-pretty* to *sldb-pprint-frames* to get more compact lines and bind *package* to frame-package to get shorter labels for variables. (format-values-for-echo-area): Include the hex and octal representation for integers. (apply-macro-expander, disassemble-symbol): Use the buffer-package for reading. (inspector-content-for-emacs): Use print-part-to-string so that we see cycles in the data structure. (inspect-for-emacs): Minor beatifications.
(interrupt-worker-thread): Interrupt the repl thread if there is no other active thread.
(thread-for-evaluation): Restart the listener thread if it was dead for some reason. (debugger-condition-for-emacs): Include "extra" stuff. (sldb-break): New entry function.
Don't print "Documentation:" if none is available; add support for classes specializer-direct-methods; deal with eql-specializers in methods. (inspector-princ): New function. (method-specializers-for-inspect): New function. (method-for-inspect-value): New function. (inspect-for-emacs): Use inspector-princ instead of princ-to-string.
It's -> Its
(inspect-for-emacs): Add function and compiler-macro documentation when inspecting symbols. View the truename of logical pathnames where they exist. Fix typos in package inspector (fix by Torsten Poulin <email@example.com>).
(cleanp-connection-threads): Kill all Swank threads for a connction when it terminates.
2004-09-14 Marco Baringer <email@example.com> * swank-backend.lisp (inspector, make-default-inspector): Add an INSPECTOR object argument to the inspector protocol. This allows implementations to provide more information regarding cretain objects which can't be, or simply aren't, inspected using the generic inspector implementation. also export inspect-for-emacs and related symbols from the backend package. (make-default-inspector): New function. * swank.lisp (inspected-parts): Rename to inspect-for-emacs and add an inspector argument. Move inspect-for-emacs to swank-backend.lisp, leave only the default implementations. * swank-openml.lisp, swank-sbcl.lisp, swank-allegro.lisp, swank-cmucl.lisp, swank-lispworks.lisp (inspected-parts): Rename and change argument list. Many of the inspected-parts methods were being clobbered by the inspected-parts in swank.lisp, now that they're being used the return values have been updated for the new inspect-for-emacs API.
(:newline) before the property list (now really!)
(:newline) before the property list
(intern-catch-tag): New function. (read-user-input-from-emacs, take-input): Use it. (define-special): Set the documentation for the 'variable not for the 'symbol.
2004-09-13 Marco Baringer <firstname.lastname@example.com> * swank.lisp (inspected-parts): Added inspectors for pathnames, logical pathnames, standard-objects and numbers (float, ratio, integer and complex). * swank-backend.lisp: Define import-to-swank-mop. * swank-openmcl.lisp, swank-sbcl.lisp, swank-allegro.lisp: Don't define the import-to-swank-mop function (now defined in swank-backend.lisp). * swank-cmucl.lisp (swank-mop, function-name): Implement backend for inspector. (arglist): Add support for extracting arglists from function objects. (create-socket): Don't specify the host on PPC.
2004-09-13 Marco Baringer <firstname.lastname@example.com> * swank.lisp (inspected-parts): Deal with unfinalized classes in standard-class inspector. (Patch from Thomas Schilling)
2004-09-13 Marco Baringer <firstname.lastname@example.com> * swank.lisp: New inspector protocol. 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. (inspected-parts): Redefine for new inspector protocol. (*inspectee-parts*): Redefine as array. (*inspectee-actions*): New array, similar to *inspectee-parts*. (reset-inspector): Update for new implementation of *inspectee-parts* and new variable *inspectee-actions*. (inspector-contents-for-emacs): New function. (inspect-object): Update for new inspector protocol. (inspector-nth-part): Update for new *inspectee-parts* implementation. (inspector-call-nth-action): New function. * slime.el (slime-inspector-action-face): New face. (slime-open-inspector): Adapt to new inspector protocol. (slime-inspector-operate-on-point): New function, subsumes slime-inspector-inspect-object-at-point. (slime-inspector-next-inspectable-object): Skip to next object, not just end of current object; wrap around buffer. (slime-inspector-mode-map): change bindings of [return] and "\C-m" * swank-bacend.lisp (swank-mop): New package. Simply defines all the MOP related symbols we need from an implementation. (arglist): Update doc string. Provide default implementation. (function-name): New backend function. * swank-allegro.lisp (swank-mop, slot-definition-documentation): Implement. * swank-sbcl.lisp (swank-mop, slot-definition-documentation, function-name): Implement. * swank-openmcl.lisp (swank-mop, function-name): Implement. (arglist): Implement for function objects.
(compile-file-for-emacs): Use with-buffer-syntax so that SBCL source files can be compiled.
Remove debugging code in comment.
(completion-set, tokenize-symbol-designator, tokenize-completion) (fuzzy-completion-set, briefly-describe-symbol-for-emacs): Remove simple-base-string declarations.
(send-to-socket-io): Add some ignore declarations.
Adding directory argument to swank-compile-string.
(*global-debugger*): New configurable to globally install swank-debugger-hook as *debugger-hook*. True by default.
(variable-desc-for-echo-area): Bind some printer variables to limit the length of the output.
(with-buffer-syntax): Don't bind *readtable* to *buffer-readtable* if they are already EQ. When we shadow this binding the user can't assign *readtable* from the REPL so it's best avoided when possible.
(carefully-find-package): Return *BUFFER-PACKAGE* if no other package can be found. This is reverting a previous change that broke completion in buffers with no known package.
Added a FIXME comment about unwanted interning in symbol lookup. Does bad things to completion of internal symbols like FOO::BAR.
Moved the Evaluation section up above the Debugging section.
(variable-desc-for-echo-area): New function. (arglist-for-echo-area): Return nil if symbol can't be found. (close-connection): Close connection before printing error message. This avoids it getting lost in closed I/O redirection.
(known-to-emacs-p): Removed filtering of def* and with-*. Now handled by Emacs.
(print-connection): print-function for connection objects. Dumping the indentation-cache was damned ugly with non-truncated lines (e.g. bug reports on slime-devel).
Trying to restore sanity to SLIME's notion of the lisp package.
Implement actionable references in *slime-compiler-notes*. Tested with sbcl-0.8.12 and sbcl CVS head -- I hope I haven't broken things for non-SBCL users... (There are some things in this that I think are suboptimal: they have been marked with FIXMEs. I lack elispfu in sufficient measure to clean them up confidently)
Added some docstrings. Rearranged completion code and somewhat SLDB trying to layout functions above their subfunctions in a tree-like way. (slime-protocol-error): Renamed from slime-read-error. (carefully-find-package): Now returns NIL if package can't be determined, rather than *BUFFER-PACKAGE*. Correct? I didn't see why it should return *BUFFER-PACKAGE*. (xref): Find symbol in *BUFFER-PACKAGE*.
Changing computation of package name used in REPL prompt.
From Thomas Schilling: (arglist-for-insertion): Changed formatting to use arglist-to-string. That results in proper cases for slime-insert-arglist.
Added a new backend function `buffer-first-change' which is called via Emacs's `first-change-hook' in slime-mode buffers. This gives Lisp a chance to do something with source files before you change them on disk.
(open-streams): Call make-stream-interactive on the redirected io streams.
Minor cleanups. (find-symbol-designator, find-symbol-or-lose, case-convert-input): Deleted. Replaced with calls to parse-symbol{-or-lose}.
(open-streams): Renamed the restart around reads from the user-input stream from ABORT to ABORT-READ. Invoking this restart seems kinda dangerous, so better for 'a' in SLDB not to do so.
2004-06-28 Thomas F. Burdick <email@example.com> * swank.lisp (inspector-nth-part): * slime.el (slime-inspector-copy-down, slime-inspector-mode-map): Added copy-down command (M-RET) to easily move an object from the inspector to the repl.
(dispatch-event): Quitting a from the debugger was seriously broken. Fix it. Move generation of thread ids to the backends.
(inspect-frame-var): New function.
Added "fuzzy completion" by Brian Downing.
Use `unbound-slot-filler' for unbound inspector slots.
(prefixed-var): Intern *REAL-STANDARD-INPUT* etc in the SWANK package instead of the COMMON-LISP package.
Doc fix.
Pass user-io to `emacs-connected', not socket-io.
(add-hook, run-hook): Moved the hook mechanism and all hooks here (from swank-backend.lisp). There is no compelling use for backends yet, I want to pass swank.lisp-internal data structures in the existing hooks. (notify-backend-of-connection): Call `emacs-connected' with the socket-io stream for its argument. Should fix previous breakage where the connection structure was passed instead. (*globally-redirect-io*): New configurable: when true the standard streams are globally redirected to Emacs. That way even e.g. SERVE-EVENT handlers will print to Emacs. Currently does not handle standard input -- that is trickier since the Lisp's native REPL can be trying to read from that.
(parse-symbol): Allow strings and symbols as package designators.
(guess-buffer-package): Don't signal a continuable error if the package doesn't exists; that's too annoying.
Added some comments and docstrings. (changelog-date): Removed unneeded function. (connection-info): No more version field in result. (package-external-symbols): Removed unused function. (serve-connection): Call *new-connection-hook*. (eval-for-emacs): Call *pre-reply-hook*. (sync-features-to-emacs, sync-indentation-to-emacs): Added to *pre-reply-hook*. (cl-package, keyword-package): Now defconstant instead of defvar. Removed the *'s accordingly.
(known-to-emacs-p): Bugfix. Indentation-updates was broken.
(emacs-connected): Pass the redirected stream as argument, so that the OpenMCL backend can add it to CCL::*AUTO-FLUSH-STREAMS*.
(*readtable-alist*): Call backend function for initialization. (eval-for-emacs, guess-buffer-package): Signal a continuable error if a package name was supplied but no such package exists. Not sure if this is better than what we did before (i.e. silently use the current package).
(parse-symbol, parse-package): Handle reader errors.
(*readtable-alist*): New configurable. The keys are package name and the values readtables. The readtable will be used to READ code originating from Emacs buffers in the associated slime-buffer-package. (drop-thread): Simplified. (*buffer-readtable*): New variable. (with-buffer-syntax): New macro. This should be used for code which needs to read or prints expressions with reader and printer variables, in particular *package* and *readtable*, suitable for the Emacs buffer. (to-string, format-values-for-echo-area, interactive-eval) (eval-region, interactive-eval-region, re-evaluate-defvar) (swank-pprint, pprint-eval, listener-eval, compile-string-for-emacs) (disassemble-symbol, describe-to-string, describe-symbol) (describe-function, describe-definition-for-emacs) (documentation-symbol, init-inspector, inspect-nth-part) (inspector-pop, inspector-next, describe-inspecte) (inspect-current-condition): Use it. (parse-string): Renamed from symbol-from-string. Make it case insensitive. (parse-package): New function. (eval-for-emacs): Initialize the *buffer-readtable*. (symbol-indentation): Don't consider symbols in the CL package. Emacs already knows how to indent them. (compile-file-if-needed): Used for REPL shortcut 'compile-and-load'.
(debugger-condition-for-emacs): Call new backend functions to add a `references' list for Emacs.
Wrap EXPORT calls in EVAL-WHEN. Fixes many warnings in ACL.
(from-string): Bind *READ-SUPPRESS* to NIL. (swank-compiler): Bind a restart to abort compilation but still report the compiler messages already trapped. (string-to-package-designator): Function that uses READ to case-convert package names. (apropos-list-for-emacs): Use it.
(prin1-to-string-for-emacs): CVS CLISP prints NIL as |COMMON-LISP|::|NIL| if *print-readably* is true. Set *print-readably* to nil for a more Emacs friendly printer syntax. (arglist-to-string): Ditto.
Remove (declaim (optimize ...)). The side-effect this has on people's environment seems harmful (I saw someone having trouble on the OpenMCL list).
(list-all-systems-in-central-registry): Use explicit :wild in pathname for matching (needed in at least SBCL).
(symbol-indentation): Oops. Consider symbols other then 'defmethod' and use prefix-match-p.
(symbol-indentation): Don't infer indentation for symbols starting with 'def' or 'with-' it's wrong most of the time and Emacs' defaults are better.
(thread-for-evaluation, dispatch-event): Accept :repl-thread as thread specifier and dispatch evaluation and interrupt request properly. (repl-thread-eval, repl-eval): Deleted. We do the special casing in thread-for-evaluation.
(arglist-for-insertion): Don't use ~< ..~:@>. CLISP's pretty printer can't handle it.
(create-server): New keyword based variant to start the server in background. (setup-server): Add support to keep the socket open for single-threaded Lisps.
(oneway-eval-string): Removed unused function.
(oneway-eval-string): Bind *package* to *buffer-package*.
(interactive-eval): Bind *package* to *buffer-package*, so that `C-x C-e' and related commands evaluate in the expected package.
Move definition of `with-io-redirection' above `with-connection' to avoid a CLISP error. This is really weird.
(ed-in-emacs): Avoid mutating the argument. (spawn-repl-thread): Add a new thread for evaluating REPL expressions. This same thread is used for all REPL evaluation. This fixes some issues with variables like * and ** in at least SBCL.
(arglist-for-echo-area): Simplified and adapted for the new semantic of ARGLIST. (arglist-for-insertion): New separate function. (read-arglist): Deleted. No longer needed.
(list-all-systems-in-central-registry, asdf-central-registry): New functions.
(arglist-for-echo-area): New argument to control if the operator name should be included.
Support for regexp based apropos. From Edi Weitz.
(list-all-package-names): Optionally include nicknames in the result (From Edi Weitz).
(operate-on-system-for-emacs): More generic interface to ASDF.
REPL Shortcuts. See ChangeLog entry 2004-04-08 Marco Baringer
Adding swank versions of two missing pretty-printer control variables.
*** empty log message ***
(find-matching-packages): Add a ":" to the end of package names in completion.
(completion-set): Also complete package names. (Patch from Sean O'Rourke.)
See ChangeLog entry 2004-04-06 Marco Baringer
(macro-indentation): Check that the arglist is well-formed. This works around a problem with ACL returning arglists that aren't real lambda-lists.
dispatch-event fix for :indentation-update.
(*swank-pprint-circle*, *swank-pprint-escape*, *swank-pprint-level*, *swank,pprint-length*): Fix typo in docstring.
(connection): Added slots to track indentation caching. (*connections*): List of all open connections. (default-connection): Function to get a "default" connection. This is intended to support globally using the debugger hook outside the context of a SLIME request, which is broken at present. (with-connection): Don't setup a restart: that must be done separately. (sync-state-to-emacs): Call `update-connection-indentation'. (update-connection-indentation): Automatically discover how to indent macros and tell Emacs.
(ed-in-emacs): New allowed form for argument. (pprint-eval-string-in-frame): Apply arguments in proper order.
(*log-io*): New variable. Bind it to *terminal-io* at load-time, so we can log to a non-redirected stream. (disassemble-symbol): Allow generalized function names. (apropos-symbols): Handle the PACKAGE argument properly to get useful output for C-c P.
(print-arglist): Updated to handle arglists with string elements, causing arglists for macros to display properly in LW 4.1.
(open-streams, make-output-function): Capture the connection not only the socket. This was the streams can be used from unrelated threads. (create-connection): Factorized. Initialize the streams after the connection is created. (initialize-streams-for-connection, spawn-threads-for-connection): New functions. (with-connection): Fix quoting bug and move upwards before first use. (send-output-to-emacs): Add kludge for SBCL !-package names. (apropos-list-for-emacs): Lispworks apparently returns duplicates; remove them. (inspect-object): Princ the label to allow strings and symbols. (send-output-to-emacs): Deleted. (defslimefun-unimplemented): Deleted. Was unused.
(*communication-style*): New name for *swank-in-background*. Exported configuration variables: *communication-style*, *log-events*, *use-dedicated-output-stream*.
Take into account `pathname-device' when deriving paths. A fix for Windows.
(format-values-for-echo-area): Bind *package* to *buffer-package*. (load-system-for-emacs): Renamed from swank-load-system. (carefully-find-package): Be friendly to case inverting readtables. (inspect-current-condition): New function.
Better symbol completion for case-inverting readtables. (output-case-converter): New function. (find-matching-symbols): Case convert the symbol-name before comparing. (compound-prefix-match, prefix-match-p): Use char= instead of char-equal. (eval-for-emacs): Renamed from eval-string. Take a form instead of a string. (dispatch-event, read-from-socket-io): Update callers. (eval-region, interactive-eval): Use fresh-line to reset column. (case-convert-input): Renamed from case-convert.
(arglist-for-echo-area): Renamed from arglist-string. (format-arglist-for-echo-area, arglist-to-string): New functions.
(sldb-return-from-frame): Convert the string to a sexp. (dispatch-event, send-to-socket-io): Allow %apply events. (safe-condition-message): Bind *pretty-print* to t. (set-default-directory): Use the truename. (find-definitions-for-emacs): Allow names like (setf car).
(:swank): Export startup-multiprocessing, restart-frame, return-from-frame. What about kill-thread and interrupt-thread, which are accessed as internal symbols?
*** empty log message ***
Fix test.
(print-arglist): Use with-standard-io-syntax to avoid further surprises.
(:swank): export profile symbols (profiled-functions, profile-report, profile-reset, unprofile-all, profile-package).
(print-arglist): Bind *pretty-circle* to nil to avoid output like "(function . (cons))" for (function cons). (test-print-arglist): Re-enable the tests (find-definitions-for-emacs): Renamed from find-function-locations.
Disable print-arglist tests.
Merge remaining stuff.
(frame-source-location-for-emacs): Export it. Reported by Jouni K Seppanen
Merge package-split branch into main trunk.
(:swank): Create the package here. (*swank-in-background*): Call the backend function preferred-communication-style to for the initial value. (find-symbol-designator): Handle NIL properly. (arglist-string): Renamed from format-arglist. Call backend function directly. (*sldb-restarts*, swank-debugger-hook, format-restarts-for-emacs) (nth-restart, invoke-nth-restart, sldb-abort): Handle restarts in the front end. (frame-for-emacs): Renamed from print-with-frame-label. (backtrace, debugger-info-for-emacs, pprint-eval-string-in-frame) (set-default-directory): Now in the front end. (frame-locals-for-emacs): Use print not princ for variable names. (compile-file-for-emacs, compile-string-for-emacs): Small wrappers around backend functions. (describe-definition-for-emacs): Handle unknown symbols before calling the backend. (find-function-locations): Wrapper for new backend function find-definitions. (group-xrefs, partition, location-valid-p, xref-buffer, xref): Updated for the new backend functions.
(frame-locals-for-emacs): Bind *print-readably* to nil.
See ChangeLog entry 2004-03-05 Marco Baringer
(remove-dead-threads): New function. (lookup-thread): Use it. (print-arglist): New function. This time without binding pretty dispatch table. (format-arglist): Use it. (inspected-parts): Add method for hash-tables.
Use *emacs-connection*, *active-threads*, and *thread-counter* as thread local dynamic variables. (init-emacs-connection): Don't set *emacs-connection*. (create-connection, dispatch-event): Pass the connection object to newly created threads. (with-connection): New macro (handle-request, install-fd-handler, debug-thread): Use it.
(setup-server, serve-connection): New dont-close argument to keep the socket open after the first request. (start-server, create-swank-server): Update callers.
(find-completions): Deleted. (simple-completions): Use longest-common-prefix instead of longest-completion. (inspect-in-frame): Moved here from swank-cmucl.lisp.
See ChangeLog entry Marco Baringer 2004-03-01
(format-arglist): Don't use custom pprint table. Didn't work with CLISP and the behavior was different in SBCL and Lispworks. (completions): Factorize. (parse-completion-arguments, format-completion-set, (completion-set, find-matching-symbols, find-completions): New functions. (simple-completions): New function. (prefix-match-p) New function.
(*initial-pprint-dispatch-table*, *arglist-pprint-dispatch-table*): Workaround for bug in CLISP. Don't supply nil as argument to copy-pprint-dispatch. (print-cons-argument): Insert a space after the car.
See ChangeLog entry "2004-02-27 Macro Baringer"
(swank-pprint): Bind *package* to *buffer-package*.
(connection-info): New function. (open-streams): Don't send the :check-protocol-version message. Now handled with CONNECTION-INFO.
(format-arglist): Use an special pprint-dispatch table.
* swank.lisp (format-arglist): Bind *PRINT-PRETTY* to NIL. (eval-in-emacs): Fix typo in docstring. * swank-cmucl.lisp (arglist-string): Bind *PRINT-PRETTY* to NIL.
(create-connection): Add support for fd-handlers. (install-fd-handler, deinstall-fd-handler): New functions.
(process-available-input): Move auxiliary function to toplevel. Test if the stream is open. (install-sigio-handler): Handle the first request after installing the signal handler.
(make-compiler-note): Don't send the short-message across the wire if the slot is nil.
(make-compiler-note): Include short-message.
(setup-server): Pass loopback-interface to create-socket. (*loopback-interface*): New parameter. (sldb-loop): Move send :debug event inside unwind-protect, to avoid losing :debug-return events.
Previous commit left out the files and only changed the ChangeLog, my bad.
(dispatch-event): :debug, :debug-condition, :debug-activate events where all encoded as :debug events, which means the debugger never worked! Fix it. I guess no one uses SLIME with a multithreaded Lisp (read-user-input-from-emacs): Flush the output for reading. (sldb-loop): Add a sldb-enter-default-debugger tag, so we can enter the default debugger by throwing to this it. (sldb-break-with-default-debugger): Throw to sldb-enter-default-debugger. (*thread-list*): New variable. (list-threads): New function.
(undefine-function): New function. (print-with-frame-label, print-part-to-string): Bind *print-circle* to t, to avoid unbound recursion when printing cyclic data structures.
(sldb-loop, dispatch-event, send-to-socket-io): Send a :debug-activate event instead of a :debug event (to avoid sending a backtrace each time). (handle-sldb-condition): Include the thread-id in the message.
(simple-break): Bind *debugger-hook* before invoking the debugger. Fixes bug reported by Michael Livshin.
Add more type declarations and detect missing initargs for the connection struct. Patch by Robert E. Brown.
Merge stateless-emacs branch into main trunk.
Use signal driven IO for CMUCL and SBCL. Use one thread per request for multithreaded lisps.
Patch by Robert E. Brown. Add type declarations to keep SBCL quiet.
Profiler support. Patch by Michael Weber.
Major restructuring. Deleted the Emacs state machine. Emacs is now essentially stateless and just does what Lisp tells it to.
(set-package): Return the shortest nickname.
(completions): Never bind *package* to nil. That's a type error in SBCL.
(swank-debugger-hook): Flush the output streams and be careful when accessing *buffer-package*.
(create-swank-server): Return the port of the serve socket.
(create-swank-server): Take announce-fn as optional argument.
(ed-in-emacs): New command with the same interface as CL:ED.
(find-symbol-or-lose, format-arglist): New functions. (without-interrupts): New macro. (send-to-emacs): Use it.
Refactor inspector code.
(create-swank-server): Patch by Marco Baringer <firstname.lastname@example.com>. Bring it back again. (create-connection): Use return the dedicated output stream if available.
(changelog-date): Use *compile-file-truename* instead of *compile-file-pathname*. (with-I/O-lock, with-a-connection): The usual CLISP fixes.
(changelog-date): make-pathname portability fix (from alanr). (with-io-redirection): Use (current-connection) instead of *dispatching-connection* (from alanr).
(changelog-date): make-pathname portability fix (from alanr).
(serve-requests): New function. (setup-server): Use it. (start-server): Pass backgroud to setup-server. (create-connection): Check the protocol version. (changelog-date): New function. (make-output-function): Use write-string instead of princ.
New support for multiprocessing and multiple connections + commentary. (with-a-connection): Macro to execute some forms "with a connection". This is used in the debugger hook to automatically create a temporary connection if needed (i.e. if the current thread doesn't already have one). (open-aux-connection): Helper function to create an extra connection to Emacs.
(*swank-in-background*): New variable. (start-server): Start swank in background, depending on *swank-in-background*.
(start-server, open-dedicated-output-stream &etc): Use new socket functions.
Updated for new network interface.
Changed eval-region back to with-input-from-string style. For slime's purposes, read-from-string doesn't do the right thing with trailing whitespace, which is not easy to work around it.
Bugfix: moved some specials up to before they're referenced.
Taking over previously non-portable jobs: (start-server): Now only uses sockets code from the backend. (handle-request): Top-level request loop. (open-dedicated-output-stream): Dedicated output socket. (connection): New data structure that bundles together the things that constitute a connection to Emacs: socket-level stream and user-level redirected streams.
(eval-region): Bind *package* outside the unwind-protect to detect updates.
Minor update of CLISP backend (streams, portability). eval-region is now do-based (that loop was just waiting to be scratched :).
(eval-string): New argument 'id'. Used to identify the remote continuation. (log-event): New debugging function. (read-from-emacs, send-to-emacs): Use it.
(safe-condition-message): New function. (debugger-condition-for-emacs): Used to be format-condition-for-emacs in each backend. Separate the condition message from the type description. Update all backends accordingly. (print-with-frame-label): New function.
(eval-region, tokenize-completion): Modify loops a bit to make CLISP happy.
(invoke-nth-restart-for-emacs): Wrapper around INVOKE-NTH-RESTART that checks that Lisp and Emacs agree on the debug level. This detects and ignores old restart requests when several are sent at once (possible because of new oneway-eval feature). (oneway-eval-string): New function to evaluate a string without sending a result, and with *DEBUGGER-HOOK* bound to NIL. (The debugger hook is inhibited to avoid state conflicts.)
*start-swank-in-background*: Set to t by default.
(send-to-emacs): Put back WITHOUT-INTERRUPTS* -- not sure exactly what it's for, but I had no actual reason to remove it so I probably broke something!
(eval-region, shortest-package-nickname): Report the shortest package nickname to Emacs (for the REPL prompt). Patch from Marco Baringer.
(*processing-rpc*, *multiprocessing-enabled*, (with-conversation-lock, with-I/O-lock): New macros. (read-next-form): Use with-I/O-lock. (send-to-emacs): Use with-I/O-lock instead of without-interrupts*. (But should we have without-interrupts* too?) (swank-debugger-hook): When called asynchronously (i.e. not during RPC) and multiprocessing is enabled, suspend until acknowleged by Emacs. (install-global-debugger-hook): Install a SLIME-DEBUGGER-FUNCTION globally on *DEBUGGER-HOOK*. (startup-multiprocessing-for-emacs): Called to initialize multiprocessing. (eval-string): Dynamically set the *PROCESSING-RPC* flag. (eval-string): Nasty hack with *DEBUGGER-HOOK-PASSBACK* to install debugger hook. Temporary, I swear!
*start-swank-in-background*, *close-swank-socket-after-setup*, *use-dedicated-output-stream*: Moved here from swank-cmucl. (sldb-continue): Don't pass the condition as argument, because that *doesn't work with Allegro. (toggle-trace-fdefinition, tracedp): Remove backend specific code with portable, but ugly, to calls to eval.
* swank.lisp (swank-compiler): new function abstracts commonality between swank-compile-{file, string}. (swank-load-system): call swank-compiler to load asdf system
(start-server): Pass an announce callback function to create-swank-server. Works better with single threaded implementations. (announce-server-port, simple-announce-function): New functions. (alistify): Doc fix.
(compound-prefix-match): New name and rewritten for speed. Completion is much faster now. (*sldb-initial-frames*): Send up to this many (default 20) backtrace frames to Emacs when entering the debugger.
(documentation-symbol): New optional argument for return value if the symbol is not documented.
(group-xrefs): Handle unresolved source locations. (describe-symbol): Print something sensible about unknown symbols.
(slime-debugger-function): New. Returns a function suitable for use as the value of *DEBUGGER-HOOK* to install the SLIME debugger globally. Must be run from the *slime-repl* buffer or somewhere else that the slime streams are visible so that it can capture them. e.g. for Araneida: PKG> (setf araneida:*restart-on-handler-errors* (swank:slime-debugger-fucntion))
Structure definitions for source-locations. (alistify, location-position<, group-xrefs): Utilities for xref support.
Minor cleanups.
Documentation fixes.
(longest-completion): Compute the best partial completion for Emacs. (completions): Use it.
(slime-read-string, eval-string): Flush *emacs-io*. (eval-in-emacs): New function.
(briefly-describe-symbol-for-emacs): Don't return unbound symbols. (load-file): The result of LOAD may be a pathname. Turn it into a string. (describe-symbol, describe-function): Support package-qualified strings.
(completions): Complete compound symbols.
(eval-string-in-frame): Fixed symbol-visibility problem (thanks Lawrence Mitchell).
Updated to use new debugger interfaces in swank-backend.lisp.
*** empty log message ***
* swank.lisp: Tidied up outline-minor-mode structure, added comments and docstrings. (sldb-loop): Took over the main debugger loop.
* swank-sbcl.lisp (describe-symbol-for-emacs): Don't ask for (documentation SYM 'class), CLHS says there isn't any 'class documentation (and SBCL warns). * swank.lisp, swank-cmucl.lisp, swank-sbcl.lisp: Refactored interface through swank-backend.lisp for: swank-compile-file, swank-compile-string, describe-symbol-for-emacs (apropos), macroexpand-all, arglist-string. * swank-backend.lisp: New file defining the interface between swank.lisp and the swank-*.lisp implementation files.
(listener-eval): Format results in *buffer-package*. Exporting (CREATE-SWANK-SERVER <port>). This function can be called directly to start a swank server, which you can then connect to with `M-x slime-connect'. It takes a port number as argument, but this can be zero to use a random available port. The function always returns the actual port number being used.
*sldb-pprint-frames*: New option. Tweak printing off return values. Print each value in a separate line in the REPL buffer and comma separated in the echo-area. Print "; No value" for (values). (format-values-for-echo-area): New function. (interactive-eval-region, (swank-pprint, listener-eval): Print each value in separate line.
(send-to-emacs): Protect the write operations by a without-interrupts, so that we don't trash the *cl-connection* buffer with partially written messages.
(swank-pprint): New function.
(completions): Use *buffer-package* if no other package is given. (case-convert): Only accept strings as argument.
(slime-read-string): Send a :read-aborted event for non-local exits. (case-convert): Handle :invert case better.
Duh! I'd better run the test suite _before_ committing.
(case-convert, find-symbol-designator): New functions.
Input redirection works now on the line level, like a tty. Output streams are now line buffered. We no longer compute the backtrace-length.
(eval-string): force-output on *slime-output* before returning the result. This somewhat works around some trouble where output printed by lisp is being buffered too long.
(*slime-features*): Variable remembering the FEATURES list. (sync-state-to-emacs): Update Emacs about any state changes - currently this just means changes to the FEATURES list. (eval-string): Call `sync-state-to-emacs' before sending result. (eval-region): With optional PACKAGE-UPDATE-P, if the evaluation changes the current package, tell Emacs about the new package. (listener-eval): Tell `eval-region' to notify Emacs of package changes, so that e.g. (in-package :swank) does the right thing when evaluated in the REPL.
(slime-read-char): Flush the output before reading. (eval-region, listener-eval): New functions. (interactive-eval-region): Use eval-region.
(interactive-eval): Evaluate in *buffer-package*.
*read-input-catch-tag*, take-input, slime-read-char: Moved here from swank-cmucl.lisp. (defslimefun, defslimefun-unimplemented): Move macro definitions to the beginning of the file.
slime-read-error: New condition. (read-next-form): Re-signal the conditions as slime-read-errors. And check the result of read-sequence (i.e. detect CMUCL's read-sequence bug). (sldb-continue, throw-to-toplevel): Was more or less the same in all backends.
(on bighackattack-1 branch) Took a step towards refactoring the backends, working on just the CMUCL one to begin with. The backend is now split into a separate package, so that all necessary symbols are explicit. Major major hackage, but the test suite passes for CMUCL. Have not made any actual improvements yet - except for adding asynchronous evaluation, which I should have committed before the hackage that lead to the branch. "Won't stay branched for long!"
Changed the connection setup to use a dynamic collision-free TCP port. The new protocol is this: Emacs calls (swank:start-server FILENAME) via the listener. FILENAME is /tmp/slime.${emacspid} Lisp starts a TCP server on a dynamic available port and writes the port number it gets to FILENAME. Emacs asynchronously polls for FILENAME's creation. When it exists, Emacs reads the port number, deletes the file, and makes the connection. The advantage is that you can run multiple Emacsen each with an inferior lisp, and the port numbers will never collide and Emacs will always connect to the right lisp. All backends are updated, but only CMUCL and SBCL are tested. Therefore, OpenMCL is almost certainly broken just now.
(read-next-form, send-to-emacs): Assume *emacs-io* is a character stream. Add the necessary char-code/code-char conversions.
Now sorting completions on symbol-name instead of `present-symbol-before-p'
(completions): Fixed semantics: should now consider only/all completions that would not cause a read-error due to symbol visibility. Also avoiding duplicates, and sorting the results as with apropos.
(completions): Slight change of semantics: when a prefix-designator is package-qualified, like "swank:", only match symbols whose home-package matches the one given - ignore inherited symbols.
*** empty log message ***
First shoot at input redirection. *slime-input*, *slime-io*: New variables.
Move more stuff to swank.lisp.
*** empty log message ***
Many fixes for the OpenMCL port: * swank.lisp (apropos-symbols): Change back to using the standard 2-argument APROPOS-LIST and check symbols explicitly when EXTERNAL-ONLY is true. Move loading of sys-dependent backend code into 'swank-loader'. * swank-sbcl.lisp: Moved declarations of *PREVIOUS-COMPILER-CONDITION* into 'swank.lisp' to kill warnings about undefined variables. * swank-openmcl.lisp (handle-compiler-warning): Use source position instead of function name for warning locations. (swank-compile-string): Compile into a temporary file instead of using COMPILE so finding warning positions works when using C-c C-c. (compute-backtrace): Don't display frames without a function. (apropos-list-for-emacs): Implement APROPOS. (who-calls): Implement WHO-CALLS. (completions): Implement COMPLETIONS. Use NIL instead of zero so FRESH-LINE does the right thing. * slime.el (slime-maybe-compile-swank): Removed function---compile the backend using 'swank-loader.lisp' instead. (slime-backend): Changed default backend to 'slime-loader'. (slime-lisp-binary-extension): Deleted as this is no longer needed. * swank-loader.lisp: New file.
<rtoy_> Ok. There is a mistake in the local vars part in swank.lisp. ;;; End needs a colon at the end to match the colon on ;;; Local Variables:
Fix random typos
Fixed braino in previous change.
The macro `with-trapping-compiler-notes' is now defined in the portable code, and expands to a call to the backend-defined `call-trapping-compiler-notes' with the body wrapped in a lambda. This is to avoid swank.lisp referring to macros in the backends -- it gets compiled first so it thinks they're functions.
swank::*sysdep-pathname*: Use defparameter so that cmucl loads the fasl file. (compiler-notes-for-emacs): Got lost during refactoring.
silly packaging mistake
Third portablizing iteration: more refactoring common bits pprint-eval set-package *compiler-notes* clear-compiler-notes *notes-database* clear-note-database features canonicalize-filename compiler-notes-for-file compiler-notes-for-emacs measure-time-interval call-with-compilation-hooks list-all-package-names apropos-symbols print-output-to-string print-description-to-string describe-symbol describe-function apply-macro-expander swank-macroexpand-1 swank-macroexpand disassemble-symbol
Second iteration refactoring common bits: server-port *swank-debug-p* start-server *emacs-io* *slime-output* read-next-form read-form *redirect-output* read-from-emacs send-to-emacs prin1-to-string-for-emacs defslimefun *buffer-package* from-string to-string guess-package-from-string eval-string interactive-eval defslimefun-unimplemented *swank-io-package*
First checkin on the way to rearranging the backends. Rename swank.lisp to swank-cmucl.lisp, then create new swank.lisp which loads an appropriate backend according to *features*. Next, identify common functions in the backends and move them into swank.lisp
*swank-io-package*: Import t and quote. (prin1-to-string-for-emacs): Use standard-io-syntax. (*previous-compiler-condition*, *previous-context*, handle-notification-condition, clear-compiler-notes, compiler-note-for-emacs, minimal-compiler-note-for-emacs, severity-for-emacs): Try to deal with error messages without context info. (list-callers, list-callees): Find callers by inspecting the constant pool of code components. (find-fdefinition, function-debug-info, fdefinition-file, code-definition-file): Deleted. Inspector support.
Minor protocol changes to accomodate slime.el's changes.
(getpid, set-package, set-default-directory): New functions. (slime-out-misc): Don't send empty strings. (*redirect-output*, read-from-emacs): A new switch to turn output redirection off. Useful for debugging. (interactive-eval, interactive-eval-region, pprint-eval, re-evaluate-defvar): Bind *package* to *buffer-package*. (with-trapping-compilation-notes): Add a dummy argumetn for better indentation. (measure-time-intervall, call-with-compilation-hooks): Measure compilation time. (frame-locals): Use di::debug-function-debug-variables instead of di:ambiguous-debug-variables. Don't access non-valid variables.
(create-swank-server): Bind the listen-socket on the loopback interface by default, so that remote machines can't connect to the Swank server.
(with-trapping-compilation-notes): New macro for bindings the handlers to record compiler notes. Now being used in `compile-string', which I had broken when removing the compilation hook.
(handle-notification-condition): Rewrote compiler-note collection. Now it uses lower-level condition handlers instead of c:*compiler-notification-function*. This way the error messages are tailored to omit redundant information, like the filename and original source text (which are displayed and highlighted in Emacs already). Much nicer. (sort-contexts-by-source-path): Now sorting xref results by lexical source-path order, so that you're always jumping in the same direction. (*debug-definition-finding*): New variable. You can set this to true if you want to be popped into the debugger when M-. fails to find a definition (for debugging the definition-finding). Otherwise it reports the error to Emacs as a message, like "Error: SETQ is a special form."
Did a little defensive programming so that asking for the definition of an unbound function will return nil to Emacs instead of entering the debugger. (format-frame-for-emacs): Binding *PRETTY-PRINT* to nil when formatting frames (due to related change of setting `truncate-lines' in sldb buffer of slime.el).
Support for stream redirection. slime-output-stream: New structure. (slime-out-misc): New function. *slime-output*: New variable. (read-from-emacs): Redirect output to *slime-output*. (read-form): Bind *package* inside the standard-io-syntax macro. (eval-string): Read the string with read-form. (completions): Support for keyword completion.
(completions): Moved most of the completion code to Lisp. (string-prefix-p): Be case insensitive.
xref improvements.
(who-calls, who-references, who-binds, who-sets, who-macroexpands): New function. (present-symbol-before-p): Use `*buffer-package*' when checking accessibility of symbols.
(print-error-message): Pass all error messages to *compiler-notification-function*.
Pruned dead/commented function.
(handle-notification): Skipping null notifications. For some reason CMUCL occasionally calls us with NIL as each argument.
(interactive-eval-region): New function. (re-evaluate-defvar): New function. (compile-defun): Install handler for compiler-errors. (function-first-code-location): Simplified.
(read-string, from-string): Renamed read-string to from-string. (to-string) New function. (arglist-string): Catch reader errors. (sldb-loop): Also bind *readstrable*.
(function-source-location, function-source-location-for-emacs): New functions to extract source locations from compiled code. For struct-accessors we try to find the source location of the corresponding constructor. (list-all-package-names): New function. (toggle-trace-fdefinition, tracedp): New functions.
Moved many CL fragments from slime.el to swank.lisp. (defslimefun): New macro.
(apropos-list-for-emacs): Hacked the apropos listing to accept more options and to specially sort results.
(serve-request, read-next-form): Don't bind any handlers that are visible in the code we are going to evaluate. (prin1-to-string-for-emacs): Bind print-readably to t. (eval-string-async): Renamed to eval-string. (eval-string): Don't catch reader errors. Return either OK, ABORTED or DEBUGGER-HOOK (used to be (CALL-CONTINUATION (OK | ABORT)) and DEBUGGER-HOOK). *buffer-package*: New variable. (read-string): New function. (sldb-loop): Report unhandled debug-conditions to Emacs.
Debugger from Helmut, new communication protocol.
(symbol-external-p): Put back this function which was lost in a merge.
Large patch from Helmut Eller. Includes: apropos, describe, compile-defun, fully asynchronous continuation-based wire interface, interactive evaluation, and more. Very nice :-)
(find-fdefinition): Support for finding function/macro definitions for Emacs.
Completion now works for internal symbols. i.e. 'package::foo' can be used to complete non-exported symbols. Some cleanups.
Imported from slime-0.2
This form allows you to request diffs between any two revisions of this file. For each of the two "sides" of the diff, select a symbolic revision name using the selection box, or choose 'Use Text Field' and enter a numeric revision.
|ViewVC Help
|Powered by ViewVC 1.1.5