From trittweiler at common-lisp.net Sat Sep 1 05:36:07 2007 From: trittweiler at common-lisp.net (trittweiler) Date: Sat, 1 Sep 2007 01:36:07 -0400 (EDT) Subject: [slime-cvs] CVS slime/contrib Message-ID: <20070901053607.286E24B026@common-lisp.net> Update of /project/slime/cvsroot/slime/contrib In directory clnet:/tmp/cvs-serv5065/contrib Modified Files: swank-arglists.lisp Log Message: Makes `slime-complete-form' work on `(eval-when |'; doesn't work on `(eval-when (|' yet. * slime-parse.el (slime-parse-sexp-at-point): Guard against `(char-after)' being NIL at end of buffer (especially important for use on the REPL.) * swank-arglist.lisp (arglist-dispatch 'eval-when): Fix typo. --- /project/slime/cvsroot/slime/contrib/swank-arglists.lisp 2007/08/31 22:17:09 1.3 +++ /project/slime/cvsroot/slime/contrib/swank-arglists.lisp 2007/09/01 05:36:07 1.4 @@ -1058,7 +1058,8 @@ (let ((eval-when-args '(:compile-toplevel :load-toplevel :execute))) (maybecall remove-args #'remove-actual-args (make-arglist :required-args (list (make-arglist :any-args eval-when-args)) - :rest '#:body :body-p t)))) + :rest '#:body :body-p t) + arguments))) (defmethod arglist-dispatch ((operator-type (eql :declaration)) decl-identifier decl-args &key (remove-args t)) From trittweiler at common-lisp.net Sat Sep 1 05:36:19 2007 From: trittweiler at common-lisp.net (trittweiler) Date: Sat, 1 Sep 2007 01:36:19 -0400 (EDT) Subject: [slime-cvs] CVS slime/contrib Message-ID: <20070901053619.B84E654168@common-lisp.net> Update of /project/slime/cvsroot/slime/contrib In directory clnet:/tmp/cvs-serv5119/contrib Modified Files: slime-parse.el Log Message: Makes `slime-complete-form' work on `(eval-when |'; doesn't work on `(eval-when (|' yet. * slime-parse.el (slime-parse-sexp-at-point): Guard against `(char-after)' being NIL at end of buffer (especially important for use on the REPL.) * swank-arglist.lisp (arglist-dispatch 'eval-when): Fix typo. --- /project/slime/cvsroot/slime/contrib/slime-parse.el 2007/08/31 11:48:23 1.1 +++ /project/slime/cvsroot/slime/contrib/slime-parse.el 2007/09/01 05:36:19 1.2 @@ -100,7 +100,7 @@ (let ((result nil)) (dotimes (i n) ;; `foo(bar baz)' where point is at ?\( or ?\). - (if (member (char-syntax (char-after)) '(?\( ?\) ?\')) + (if (and (char-after) (member (char-syntax (char-after)) '(?\( ?\) ?\'))) (push (sexp-at-point :sexp-first) result) (push (sexp-at-point :symbol-first) result)) (ignore-errors (forward-sexp) (slime-forward-blanks)) From trittweiler at common-lisp.net Sat Sep 1 05:36:29 2007 From: trittweiler at common-lisp.net (trittweiler) Date: Sat, 1 Sep 2007 01:36:29 -0400 (EDT) Subject: [slime-cvs] CVS slime/contrib Message-ID: <20070901053629.856B461052@common-lisp.net> Update of /project/slime/cvsroot/slime/contrib In directory clnet:/tmp/cvs-serv5152/contrib Modified Files: ChangeLog Log Message: Makes `slime-complete-form' work on `(eval-when |'; doesn't work on `(eval-when (|' yet. * slime-parse.el (slime-parse-sexp-at-point): Guard against `(char-after)' being NIL at end of buffer (especially important for use on the REPL.) * swank-arglist.lisp (arglist-dispatch 'eval-when): Fix typo. --- /project/slime/cvsroot/slime/contrib/ChangeLog 2007/08/31 22:40:31 1.21 +++ /project/slime/cvsroot/slime/contrib/ChangeLog 2007/09/01 05:36:29 1.22 @@ -1,3 +1,14 @@ +2007-09-01 Tobias C. Rittweiler + + Makes `slime-complete-form' work on `(eval-when |'; doesn't work + on `(eval-when (|' yet. + + * slime-parse.el (slime-parse-sexp-at-point): Guard against + `(char-after)' being NIL at end of buffer (especially important + for use on the REPL.) + + * swank-arglist.lisp (arglist-dispatch 'eval-when): Fix typo. + 2007-08-31 Tobias C. Rittweiler Added extended arglist display for EVAL-WHEN, viz: From mkoeppe at common-lisp.net Sat Sep 1 05:37:19 2007 From: mkoeppe at common-lisp.net (mkoeppe) Date: Sat, 1 Sep 2007 01:37:19 -0400 (EDT) Subject: [slime-cvs] CVS slime/contrib Message-ID: <20070901053719.744922105A@common-lisp.net> Update of /project/slime/cvsroot/slime/contrib In directory clnet:/tmp/cvs-serv5205 Modified Files: slime-typeout-frame.el Log Message: (slime-typeout-autodoc-message): Fix for messages that contain "%". Reported by Martin Simmons. --- /project/slime/cvsroot/slime/contrib/slime-typeout-frame.el 2007/08/24 15:48:44 1.1 +++ /project/slime/cvsroot/slime/contrib/slime-typeout-frame.el 2007/09/01 05:37:19 1.2 @@ -51,7 +51,7 @@ (defun slime-typeout-autodoc-message (doc) (setq slime-autodoc-last-message "") ; no need for refreshing - (slime-typeout-message doc)) + (slime-typeout-message "%s" doc)) ;;; Initialization From mkoeppe at common-lisp.net Sat Sep 1 05:38:17 2007 From: mkoeppe at common-lisp.net (mkoeppe) Date: Sat, 1 Sep 2007 01:38:17 -0400 (EDT) Subject: [slime-cvs] CVS slime/contrib Message-ID: <20070901053817.67FFB33083@common-lisp.net> Update of /project/slime/cvsroot/slime/contrib In directory clnet:/tmp/cvs-serv5279 Modified Files: ChangeLog Log Message: *** empty log message *** --- /project/slime/cvsroot/slime/contrib/ChangeLog 2007/09/01 05:36:29 1.22 +++ /project/slime/cvsroot/slime/contrib/ChangeLog 2007/09/01 05:38:17 1.23 @@ -1,3 +1,8 @@ +2007-09-01 Matthias Koeppe + + * slime-typeout-frame.el (slime-typeout-autodoc-message): Fix for + messages that contain "%". Reported by Martin Simmons. + 2007-09-01 Tobias C. Rittweiler Makes `slime-complete-form' work on `(eval-when |'; doesn't work From trittweiler at common-lisp.net Sat Sep 1 05:39:11 2007 From: trittweiler at common-lisp.net (trittweiler) Date: Sat, 1 Sep 2007 01:39:11 -0400 (EDT) Subject: [slime-cvs] CVS slime/contrib Message-ID: <20070901053911.E3A367E008@common-lisp.net> Update of /project/slime/cvsroot/slime/contrib In directory clnet:/tmp/cvs-serv5338/contrib Modified Files: swank-arglists.lisp Log Message: Makes `slime-complete-form' work on `(eval-when |'; doesn't work on `(eval-when (|' yet. * slime-parse.el (slime-parse-sexp-at-point): Guard against `(char-after)' being NIL at end of buffer (especially important for use on the REPL.) * swank-arglist.lisp (arglist-dispatch 'eval-when): Fix typo. (print-decoded-arglist-as-template): Print keywords with PRIN1. --- /project/slime/cvsroot/slime/contrib/swank-arglists.lisp 2007/09/01 05:36:07 1.4 +++ /project/slime/cvsroot/slime/contrib/swank-arglists.lisp 2007/09/01 05:39:11 1.5 @@ -649,7 +649,7 @@ (setq first-p nil)) (print-arg-or-pattern (arg) (etypecase arg - (symbol (princ arg)) + (symbol (if (keywordp arg) (prin1 arg) (princ arg))) (string (princ arg)) (list (princ arg)) (arglist (print-decoded-arglist-as-template arg))))) From trittweiler at common-lisp.net Sat Sep 1 05:40:11 2007 From: trittweiler at common-lisp.net (trittweiler) Date: Sat, 1 Sep 2007 01:40:11 -0400 (EDT) Subject: [slime-cvs] CVS slime/contrib Message-ID: <20070901054011.BE9C8481AB@common-lisp.net> Update of /project/slime/cvsroot/slime/contrib In directory clnet:/tmp/cvs-serv5535/contrib Modified Files: ChangeLog Log Message: Makes `slime-complete-form' work on `(eval-when |'; doesn't work on `(eval-when (|' yet. * slime-parse.el (slime-parse-sexp-at-point): Guard against `(char-after)' being NIL at end of buffer (especially important for use on the REPL.) * swank-arglist.lisp (arglist-dispatch 'eval-when): Fix typo. (print-decoded-arglist-as-template): Print keywords with PRIN1. --- /project/slime/cvsroot/slime/contrib/ChangeLog 2007/09/01 05:38:17 1.23 +++ /project/slime/cvsroot/slime/contrib/ChangeLog 2007/09/01 05:40:11 1.24 @@ -13,6 +13,7 @@ for use on the REPL.) * swank-arglist.lisp (arglist-dispatch 'eval-when): Fix typo. + (print-decoded-arglist-as-template): Print keywords with PRIN1. 2007-08-31 Tobias C. Rittweiler From mkoeppe at common-lisp.net Sat Sep 1 05:42:50 2007 From: mkoeppe at common-lisp.net (mkoeppe) Date: Sat, 1 Sep 2007 01:42:50 -0400 (EDT) Subject: [slime-cvs] CVS slime/contrib Message-ID: <20070901054250.9229B61051@common-lisp.net> Update of /project/slime/cvsroot/slime/contrib In directory clnet:/tmp/cvs-serv6500/contrib Modified Files: slime-presentations.el Log Message: (slime-dispatch-presentation-event): Explicitly return t to indicate the events have been handled, rather than relying on the return values of the called functions. --- /project/slime/cvsroot/slime/contrib/slime-presentations.el 2007/08/28 21:59:48 1.4 +++ /project/slime/cvsroot/slime/contrib/slime-presentations.el 2007/09/01 05:42:50 1.5 @@ -547,9 +547,11 @@ (defun slime-dispatch-presentation-event (event) (destructure-case event ((:presentation-start id &optional target) - (slime-mark-presentation-start id target)) + (slime-mark-presentation-start id target) + t) ((:presentation-end id &optional target) - (slime-mark-presentation-end id target)) + (slime-mark-presentation-end id target) + t) (t nil))) (defun slime-presentation-write (string &optional target) From mkoeppe at common-lisp.net Sat Sep 1 05:44:10 2007 From: mkoeppe at common-lisp.net (mkoeppe) Date: Sat, 1 Sep 2007 01:44:10 -0400 (EDT) Subject: [slime-cvs] CVS slime/contrib Message-ID: <20070901054410.B04CD680FC@common-lisp.net> Update of /project/slime/cvsroot/slime/contrib In directory clnet:/tmp/cvs-serv6734 Modified Files: ChangeLog Log Message: *** empty log message *** --- /project/slime/cvsroot/slime/contrib/ChangeLog 2007/09/01 05:40:11 1.24 +++ /project/slime/cvsroot/slime/contrib/ChangeLog 2007/09/01 05:44:00 1.25 @@ -1,3 +1,9 @@ +2007-08-31 Matthias Koeppe + + * slime-presentations.el (slime-dispatch-presentation-event): + Explicitly return t to indicate the events have been handled, + rather than relying on the return values of the called functions. + 2007-09-01 Matthias Koeppe * slime-typeout-frame.el (slime-typeout-autodoc-message): Fix for From mkoeppe at common-lisp.net Sat Sep 1 16:54:11 2007 From: mkoeppe at common-lisp.net (mkoeppe) Date: Sat, 1 Sep 2007 12:54:11 -0400 (EDT) Subject: [slime-cvs] CVS slime/contrib Message-ID: <20070901165411.CB49944060@common-lisp.net> Update of /project/slime/cvsroot/slime/contrib In directory clnet:/tmp/cvs-serv4560 Added Files: slime-fancy.el Log Message: New meta-contrib. --- /project/slime/cvsroot/slime/contrib/slime-fancy.el 2007/09/01 16:54:11 NONE +++ /project/slime/cvsroot/slime/contrib/slime-fancy.el 2007/09/01 16:54:11 1.1 ;;; slime-fancy.el --- Load all stable fancy SLIME contribs ;; ;; Authors: Matthias Koeppe ;; ;; License: GNU GPL (same license as Emacs) ;; ;;; Installation: ;; ;; Add this to your .emacs: ;; ;; (add-to-list 'load-path "") ;; (add-hook 'slime-load-hook (lambda () (require 'slime-fancy))) ;; ;; We load all SLIME contribs that are currently working, ;; and which only "upgrade" the behavior of SLIME in some way. ;; This includes: ;; * Adding new commands, keybindings, menu items ;; * Making things clickable that would otherwise be just plain text ;; Better arglist display, can be turned off by customization. (require 'slime-autodoc) ;; Adds new commands and installs compound-prefix-completion as ;; default completion command. Behaves similar to standard Emacs ;; completion, unless dashes are present. --mkoeppe (require 'slime-c-p-c) ;; Just adds commands. (require 'slime-editing-commands) ;; Makes the inspector fancier. (require 'slime-fancy-inspector) ;; Just adds the command C-c M-i. We do not make fuzzy completion the ;; default completion invoked by TAB. --mkoeppe (require 'slime-fuzzy) (require 'slime-highlight-edits) ;; Load slime-presentations even though they seem to be a ;; controversial feature, as they can be easily turned off by ;; customizing swank:*record-repl-results*. --mkoeppe (require 'slime-presentations) ;;; Do not load slime-presentation-streams, as this is an experimental ;;; feature that installs patches into some Lisps. --mkoeppe ;;(require 'slime-presentation-streams) (require 'slime-scratch) ;;; Do not load slime-typeout-frame, as simply loading causes display of a ;;; typeout frame, which cannot be turned off. --mkoeppe ;;(require 'slime-typeout-frame) ;; Just adds commands. (require 'slime-xref-browser) (provide 'slime-fancy) From mkoeppe at common-lisp.net Sat Sep 1 16:58:05 2007 From: mkoeppe at common-lisp.net (mkoeppe) Date: Sat, 1 Sep 2007 12:58:05 -0400 (EDT) Subject: [slime-cvs] CVS slime/contrib Message-ID: <20070901165805.6FAFF5005C@common-lisp.net> Update of /project/slime/cvsroot/slime/contrib In directory clnet:/tmp/cvs-serv4826 Modified Files: ChangeLog Log Message: *** empty log message *** --- /project/slime/cvsroot/slime/contrib/ChangeLog 2007/09/01 05:44:00 1.25 +++ /project/slime/cvsroot/slime/contrib/ChangeLog 2007/09/01 16:58:05 1.26 @@ -1,4 +1,8 @@ -2007-08-31 Matthias Koeppe +2007-09-01 Matthias Koeppe + + * slime-fancy.el: New meta-contrib. + +2007-09-01 Matthias Koeppe * slime-presentations.el (slime-dispatch-presentation-event): Explicitly return t to indicate the events have been handled, From heller at common-lisp.net Tue Sep 4 09:42:42 2007 From: heller at common-lisp.net (heller) Date: Tue, 4 Sep 2007 05:42:42 -0400 (EDT) Subject: [slime-cvs] CVS slime Message-ID: <20070904094242.1E97931043@common-lisp.net> Update of /project/slime/cvsroot/slime In directory clnet:/tmp/cvs-serv20279 Modified Files: ChangeLog slime.el Log Message: Rename slime-insert-possibly-as-rectangle to slime-insert-indented. * slime.el (slime-insert-indented): Renamed. Update callers. --- /project/slime/cvsroot/slime/ChangeLog 2007/08/31 13:11:03 1.1192 +++ /project/slime/cvsroot/slime/ChangeLog 2007/09/04 09:42:41 1.1193 @@ -1,3 +1,9 @@ +2007-09-04 Helmut Eller + + Rename slime-insert-possibly-as-rectangle to slime-insert-indented. + + * slime.el (slime-insert-indented): Renamed. Update callers. + 2007-08-31 Helmut Eller Move compound prefix completion and autodoc to contrib. --- /project/slime/cvsroot/slime/slime.el 2007/08/31 13:10:47 1.841 +++ /project/slime/cvsroot/slime/slime.el 2007/09/04 09:42:41 1.842 @@ -1146,7 +1146,7 @@ (put 'slime-with-rigid-indentation 'lisp-indent-function 1) (defun slime-indent-rigidly (start end column) - "Similar to `indent-rigidly' but doesn't inherit text props." + ;; Similar to `indent-rigidly' but doesn't inherit text props. (save-excursion (goto-char end) (beginning-of-line) @@ -1155,7 +1155,8 @@ (save-excursion (insert-char ?\ column)) (zerop (forward-line -1))))))) -(defun slime-insert-possibly-as-rectangle (&rest strings) +(defun slime-insert-indented (&rest strings) + "Insert all arguments rigidly indented." (slime-with-rigid-indentation nil (apply #'insert strings))) @@ -6966,7 +6967,7 @@ (slime-propertize-region props (slime-propertize-region '(mouse-face highlight) (insert " " (in-sldb-face frame-label (format "%2d:" number)) " ") - (slime-insert-possibly-as-rectangle + (slime-insert-indented (slime-add-face (or face 'sldb-frame-line-face) string))) (insert "\n"))))) @@ -9712,7 +9713,6 @@ slime-print-apropos slime-show-note-counts slime-insert-propertized - slime-insert-possibly-as-rectangle slime-tree-insert))) (run-hooks 'slime-load-hook) From heller at common-lisp.net Tue Sep 4 09:42:42 2007 From: heller at common-lisp.net (heller) Date: Tue, 4 Sep 2007 05:42:42 -0400 (EDT) Subject: [slime-cvs] CVS slime/contrib Message-ID: <20070904094242.6064031033@common-lisp.net> Update of /project/slime/cvsroot/slime/contrib In directory clnet:/tmp/cvs-serv20279/contrib Modified Files: slime-presentations.el Log Message: Rename slime-insert-possibly-as-rectangle to slime-insert-indented. * slime.el (slime-insert-indented): Renamed. Update callers. --- /project/slime/cvsroot/slime/contrib/slime-presentations.el 2007/09/01 05:42:50 1.5 +++ /project/slime/cvsroot/slime/contrib/slime-presentations.el 2007/09/04 09:42:42 1.6 @@ -159,7 +159,7 @@ strings to line up below the current point." (flet ((insert-it () (if rectangle - (slime-insert-possibly-as-rectangle string) + (slime-insert-indented string) (insert string)))) (let ((start (point))) (insert-it) From heller at common-lisp.net Tue Sep 4 09:49:10 2007 From: heller at common-lisp.net (heller) Date: Tue, 4 Sep 2007 05:49:10 -0400 (EDT) Subject: [slime-cvs] CVS slime Message-ID: <20070904094910.3EE8A2E1D0@common-lisp.net> Update of /project/slime/cvsroot/slime In directory clnet:/tmp/cvs-serv20778 Modified Files: ChangeLog swank-backend.lisp swank.lisp swank-sbcl.lisp slime.el Log Message: 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. --- /project/slime/cvsroot/slime/ChangeLog 2007/09/04 09:42:41 1.1193 +++ /project/slime/cvsroot/slime/ChangeLog 2007/09/04 09:49:09 1.1194 @@ -1,5 +1,14 @@ 2007-09-04 Helmut Eller + 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. + +2007-09-04 Helmut Eller + Rename slime-insert-possibly-as-rectangle to slime-insert-indented. * slime.el (slime-insert-indented): Renamed. Update callers. --- /project/slime/cvsroot/slime/swank-backend.lisp 2007/08/23 19:32:56 1.122 +++ /project/slime/cvsroot/slime/swank-backend.lisp 2007/09/04 09:49:09 1.123 @@ -15,8 +15,6 @@ (:export #:sldb-condition #:original-condition #:compiler-condition - #:abort-request - #:request-abort #:message #:short-message #:condition @@ -166,20 +164,6 @@ (warn "DEFIMPLEMENTATION of undefined interface (~S)" ',name)) ',name)) -(define-condition request-abort (error) - ((reason :initarg :reason :reader reason)) - (:report (lambda (condition stream) - (princ (reason condition) stream))) - (:documentation "Condition signalled when SLIME wasn't able to -complete a user request due to bad data. This condition is not -for real errors but for situations where SLIME has to give up and -return control back to the user.")) - -(defun abort-request (reason-control &rest reason-args) - "Abort whatever swank is currently do and send a message to the -user." - (error 'request-abort :reason (apply #'format nil reason-control reason-args))) - (defun warn-unimplemented-interfaces () "Warn the user about unimplemented backend features. The portable code calls this function at startup." @@ -367,12 +351,12 @@ Example: \(operate-on-system \"SWANK\" \"COMPILE-OP\" :force t)" (unless (member :asdf *features*) - (abort-request "ASDF is not loaded.")) + (error "ASDF is not loaded.")) (with-compilation-hooks () (let ((operate (find-symbol (symbol-name '#:operate) :asdf)) (operation (find-symbol operation-name :asdf))) (when (null operation) - (abort-request "Couldn't find ASDF operation ~S" operation-name)) + (error "Couldn't find ASDF operation ~S" operation-name)) (apply operate operation system-name keyword-args)))) (definterface swank-compile-file (filename load-p external-format) --- /project/slime/cvsroot/slime/swank.lisp 2007/08/31 11:48:23 1.507 +++ /project/slime/cvsroot/slime/swank.lisp 2007/09/04 09:49:09 1.508 @@ -1657,7 +1657,7 @@ (call-with-debugger-hook #'swank-debugger-hook (lambda () - (let (ok result reason) + (let (ok result) (unwind-protect (let ((*buffer-package* (guess-buffer-package buffer-package)) (*buffer-readtable* (guess-buffer-readtable buffer-package)) @@ -1666,20 +1666,15 @@ (check-type *buffer-readtable* readtable) ;; APPLY would be cleaner than EVAL. ;;(setq result (apply (car form) (cdr form))) - (handler-case - (progn - (setq result (eval form)) - (run-hook *pre-reply-hook*) - (finish-output) - (setq ok t)) - (request-abort (c) - (setf ok nil) - (setf reason (swank-backend::reason c))))) + (setq result (eval form)) + (run-hook *pre-reply-hook*) + (finish-output) + (setq ok t)) (force-user-output) (send-to-emacs `(:return ,(current-thread) ,(if ok `(:ok ,result) - `(:abort ,reason)) + `(:abort)) ,id))))))) (defvar *echo-area-prefix* "=> " --- /project/slime/cvsroot/slime/swank-sbcl.lisp 2007/08/24 06:41:54 1.181 +++ /project/slime/cvsroot/slime/swank-sbcl.lisp 2007/09/04 09:49:09 1.182 @@ -787,7 +787,7 @@ (defun fallback-source-location (code-location) (let ((fun (code-location-debug-fun-fun code-location))) (cond (fun (function-source-location fun)) - (t (abort-request "Cannot find source location for: ~A " code-location))))) + (t (error "Cannot find source location for: ~A " code-location))))) (defun lisp-source-location (code-location) (let ((source (prin1-to-string --- /project/slime/cvsroot/slime/slime.el 2007/09/04 09:42:41 1.842 +++ /project/slime/cvsroot/slime/slime.el 2007/09/04 09:49:09 1.843 @@ -2443,7 +2443,7 @@ CLAUSES is a list of patterns with same syntax as `destructure-case'. The result of the evaluation of SEXP is dispatched on CLAUSES. The result is either a sexp of the -form (:ok VALUE) or (:abort REASON). CLAUSES is executed +form (:ok VALUE) or (:abort). CLAUSES is executed asynchronously. Note: don't use backquote syntax for SEXP, because Emacs20 cannot @@ -2527,8 +2527,8 @@ (error "tag = %S eval-tags = %S sexp = %S" tag slime-stack-eval-tags sexp)) (throw tag (list #'identity value))) - ((:abort &optional reason) - (throw tag (list #'error (or reason "Synchronous Lisp Evaluation aborted."))))) + ((:abort) + (throw tag (list #'error "Synchronous Lisp Evaluation aborted.")))) (let ((debug-on-quit t) (inhibit-quit nil) (conn (slime-connection))) @@ -2543,8 +2543,8 @@ (sexp (or package (slime-current-package))) ((:ok result) (when cont (funcall cont result))) - ((:abort &optional reason) - (message (or reason "Evaluation aborted."))))) + ((:abort) + (message "Evaluation aborted.")))) ;;; These functions can be handy too: @@ -3174,8 +3174,8 @@ ((list 'swank:listener-eval string) (slime-lisp-package)) ((:ok result) (slime-repl-insert-result result)) - ((:abort &optional reason) - (slime-repl-show-abort reason)))) + ((:abort) + (slime-repl-show-abort)))) (defun slime-repl-insert-result (result) (with-current-buffer (slime-output-buffer) @@ -3193,13 +3193,11 @@ (insert "\n"))))))) (slime-repl-insert-prompt))) -(defun slime-repl-show-abort (reason) +(defun slime-repl-show-abort () (with-current-buffer (slime-output-buffer) (slime-with-output-end-mark (unless (bolp) (insert-before-markers "\n")) - (insert-before-markers (if reason - (concat "; Evaluation aborted: " reason "\n") - "; Evaluation aborted.\n"))) + (insert-before-markers "; Evaluation aborted.\n")) (slime-repl-insert-prompt))) (defun slime-repl-insert-prompt () @@ -7389,7 +7387,7 @@ (interactive) (slime-rex () ('(swank:throw-to-toplevel)) ((:ok _) (error "sldb-quit returned")) - ((:abort &optional _)))) + ((:abort)))) (defun sldb-continue () "Invoke the \"continue\" restart." @@ -7399,7 +7397,7 @@ ((:ok _) (message "No restart named continue") (ding)) - ((:abort &optional _)))) + ((:abort)))) (defun sldb-abort () "Invoke the \"abort\" restart." @@ -7416,14 +7414,14 @@ (slime-rex () ((list 'swank:invoke-nth-restart-for-emacs sldb-level restart)) ((:ok value) (message "Restart returned: %s" value)) - ((:abort &optional _))))) + ((:abort))))) (defun sldb-break-with-default-debugger () "Enter default debugger." (interactive) (slime-rex () ('(swank:sldb-break-with-default-debugger) nil slime-current-thread) - ((:abort &optional _)))) + ((:abort)))) (defun sldb-step () "Select the \"continue\" restart and set a new break point." @@ -7465,7 +7463,7 @@ (slime-rex () ((list 'swank:sldb-return-from-frame number string)) ((:ok value) (message "%s" value)) - ((:abort &optional _))))) + ((:abort))))) (defun sldb-restart-frame () "Causes the frame to restart execution with the same arguments as it @@ -7475,7 +7473,7 @@ (slime-rex () ((list 'swank:restart-frame number)) ((:ok value) (message "%s" value)) - ((:abort &optional _))))) + ((:abort))))) ;;;;; SLDB references (rather SBCL specific) From heller at common-lisp.net Tue Sep 4 09:49:10 2007 From: heller at common-lisp.net (heller) Date: Tue, 4 Sep 2007 05:49:10 -0400 (EDT) Subject: [slime-cvs] CVS slime/contrib Message-ID: <20070904094910.7897832011@common-lisp.net> Update of /project/slime/cvsroot/slime/contrib In directory clnet:/tmp/cvs-serv20778/contrib Modified Files: swank-arglists.lisp swank-presentations.lisp Log Message: 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. --- /project/slime/cvsroot/slime/contrib/swank-arglists.lisp 2007/09/01 05:39:11 1.5 +++ /project/slime/cvsroot/slime/contrib/swank-arglists.lisp 2007/09/04 09:49:10 1.6 @@ -436,7 +436,7 @@ (car arg) (cadr arg))) (t - (abort-request "Bad keyword item of formal argument list")))) + (error "Bad keyword item of formal argument list")))) (defun encode-keyword-arg (arg) (cond --- /project/slime/cvsroot/slime/contrib/swank-presentations.lisp 2007/08/29 04:50:34 1.3 +++ /project/slime/cvsroot/slime/contrib/swank-presentations.lisp 2007/09/04 09:49:10 1.4 @@ -85,7 +85,7 @@ "Get the result of the previous REPL evaluation with ID." (multiple-value-bind (object foundp) (lookup-presented-object id) (cond (foundp object) - (t (abort-request "Attempt to access unrecorded object (id ~D)." id))))) + (t (error "Attempt to access unrecorded object (id ~D)." id))))) (defslimefun clear-repl-results () "Forget the results of all previous REPL evaluations." From heller at common-lisp.net Tue Sep 4 09:55:32 2007 From: heller at common-lisp.net (heller) Date: Tue, 4 Sep 2007 05:55:32 -0400 (EDT) Subject: [slime-cvs] CVS slime Message-ID: <20070904095532.617BB74374@common-lisp.net> Update of /project/slime/cvsroot/slime In directory clnet:/tmp/cvs-serv21456 Modified Files: ChangeLog slime.el Log Message: Simplify slime-process-available-input. * slime.el (slime-process-available-input): We are called in a process filter, i.e. at arbitrary times and in an aribtrary buffer. So it doesn't make sense to save-and-restore the current buffer here (slime-eval-async): Instead, save and restore the buffer here. (slime-net-read-or-lose): New. --- /project/slime/cvsroot/slime/ChangeLog 2007/09/04 09:49:09 1.1194 +++ /project/slime/cvsroot/slime/ChangeLog 2007/09/04 09:55:32 1.1195 @@ -1,5 +1,16 @@ 2007-09-04 Helmut Eller + Simplify slime-process-available-input. + + * slime.el (slime-process-available-input): We are called in a + process filter, i.e. at arbitrary times and in an aribtrary + buffer. So it doesn't make sense to save-and-restore the current + buffer here + (slime-eval-async): Instead, save and restore the buffer here. + (slime-net-read-or-lose): New. + +2007-09-04 Helmut Eller + Remove request-abort condition. * swank-backend.lisp (request-abort): Removed --- /project/slime/cvsroot/slime/slime.el 2007/09/04 09:49:09 1.843 +++ /project/slime/cvsroot/slime/slime.el 2007/09/04 09:55:32 1.844 @@ -1974,26 +1974,17 @@ (defun slime-process-available-input (process) "Process all complete messages that have arrived from Lisp." - (let ((original-buffer (current-buffer))) - (with-current-buffer (process-buffer process) - (while (slime-net-have-input-p) - (let ((event (condition-case error - (slime-net-read) - (error - (slime-net-close process t) - (error "net-read error: %S" error))))) - (slime-log-event event) - (let ((ok nil)) - (unwind-protect - (with-current-buffer - (if (buffer-live-p original-buffer) - original-buffer - (current-buffer)) - (slime-dispatch-event event process) - (setq ok t)) - (unless ok - (slime-run-when-idle - 'slime-process-available-input process))))))))) + (with-current-buffer (process-buffer process) + (while (slime-net-have-input-p) + (let ((event (slime-net-read-or-lose process)) + (ok nil)) + (slime-log-event event) + (unwind-protect + (save-current-buffer + (slime-dispatch-event event process) + (setq ok t)) + (unless ok + (slime-run-when-idle 'slime-process-available-input process))))))) (defun slime-net-have-input-p () "Return true if a complete message is available." @@ -2001,6 +1992,14 @@ (and (>= (buffer-size) 6) (>= (- (buffer-size) 6) (slime-net-decode-length)))) +(defun slime-net-read-or-lose (process) + (condition-case error + (slime-net-read) + (error + (debug) + (slime-net-close process t) + (error "net-read error: %S" error)))) + (defun slime-net-read () "Read a message from the network buffer." (goto-char (point-min)) @@ -2539,10 +2538,12 @@ (defun slime-eval-async (sexp &optional cont package) "Evaluate EXPR on the superior Lisp and call CONT with the result." - (slime-rex (cont) + (slime-rex (cont (buffer (current-buffer))) (sexp (or package (slime-current-package))) ((:ok result) - (when cont (funcall cont result))) + (when cont + (set-buffer buffer) + (funcall cont result))) ((:abort) (message "Evaluation aborted.")))) From heller at common-lisp.net Tue Sep 4 09:59:40 2007 From: heller at common-lisp.net (heller) Date: Tue, 4 Sep 2007 05:59:40 -0400 (EDT) Subject: [slime-cvs] CVS slime Message-ID: <20070904095940.D963B74310@common-lisp.net> Update of /project/slime/cvsroot/slime In directory clnet:/tmp/cvs-serv21812 Modified Files: ChangeLog slime.el Log Message: * slime.el: Fix the test suite (except for SBCL). --- /project/slime/cvsroot/slime/ChangeLog 2007/09/04 09:55:32 1.1195 +++ /project/slime/cvsroot/slime/ChangeLog 2007/09/04 09:59:40 1.1196 @@ -1,5 +1,9 @@ 2007-09-04 Helmut Eller + * slime.el: Fix the test suite (except for SBCL). + +2007-09-04 Helmut Eller + Simplify slime-process-available-input. * slime.el (slime-process-available-input): We are called in a --- /project/slime/cvsroot/slime/slime.el 2007/09/04 09:55:32 1.844 +++ /project/slime/cvsroot/slime/slime.el 2007/09/04 09:59:40 1.845 @@ -8654,25 +8654,22 @@ (def-slime-test find-definition - (name buffer-package) + (name buffer-package snippet) "Find the definition of a function or macro in swank.lisp." - '((read-from-emacs "SWANK") - (swank::read-from-emacs "CL-USER") - (swank:start-server "CL-USER")) + '(("read-from-emacs" "SWANK" "(defun read-from-emacs ") + ("swank::read-from-emacs" "CL-USER" "(defun read-from-emacs ") + ("swank:start-server" "CL-USER" "(defun start-server ")) (switch-to-buffer "*scratch*") ; not buffer of definition (slime-check-top-level) (let ((orig-buffer (current-buffer)) (orig-pos (point)) (enable-local-variables nil) ; don't get stuck on -*- eval: -*- (slime-buffer-package buffer-package)) - (slime-edit-definition (symbol-name name)) + (slime-edit-definition name) ;; Postconditions (slime-check ("Definition of `%S' is in swank.lisp." name) - (string= (file-name-nondirectory (buffer-file-name)) - "swank.lisp")) - (slime-check "Definition now at point." - (looking-at (format "(\\(defun\\|defmacro\\)\\s *%s\\s " - (slime-cl-symbol-name name)))) + (string= (file-name-nondirectory (buffer-file-name)) "swank.lisp")) + (slime-check "Definition now at point." (looking-at snippet)) (slime-pop-find-definition-stack) (slime-check "Returning from definition restores original buffer/position." (and (eq orig-buffer (current-buffer)) @@ -8692,9 +8689,8 @@ "swank::compile-file-if-needed" "swank::compile-file-pathname") "swank::compile-file")) - ("cl:m-v-l" (("cl:multiple-value-list" "cl:multiple-values-limit") - "cl:multiple-value-li"))) - (let ((completions (slime-completions prefix))) + ("cl:m-v-l" (nil ""))) + (let ((completions (slime-simple-completions prefix))) (slime-test-expect "Completion set" expected-completions completions))) (def-slime-test arglist @@ -8706,26 +8702,21 @@ (function-name expected-arglist) "Lookup the argument list for FUNCTION-NAME. Confirm that EXPECTED-ARGLIST is displayed." - '(("swank:start-server" - "(swank:start-server port-file &key \\((style swank:\\*communication-style\\*)\\|style\\)[ \n]+dont-close[ \n]+(coding-system swank::\\*coding-system\\*))") - ("swank::compound-prefix-match" - "(swank::compound-prefix-match prefix target)") - ("swank::create-socket" - "(swank::create-socket host port)") - ("swank::emacs-connected" - "(swank::emacs-connected)") + '(("swank::operator-arglist" "(swank::operator-arglist name package)") + ("swank::create-socket" "(swank::create-socket host port)") + ("swank::emacs-connected" "(swank::emacs-connected )") ("swank::compile-string-for-emacs" "(swank::compile-string-for-emacs string buffer position directory)") ("swank::connection.socket-io" "(swank::connection.socket-io \\(struct\\(ure\\)?\\|object\\|instance\\))") - ("cl:lisp-implementation-type" - "(cl:lisp-implementation-type)") + ("cl:lisp-implementation-type" "(cl:lisp-implementation-type )") ("cl:class-name" "(cl:class-name \\(class\\|object\\|instance\\|structure\\))")) (slime-check-top-level) - (let ((arglist (slime-get-arglist function-name))) ; + (let ((arglist (slime-eval `(swank:operator-arglist ,function-name + "swank")))) (slime-test-expect "Argument list is as expected" - expected-arglist arglist + expected-arglist (downcase arglist) #'string-match)) (slime-check-top-level)) @@ -8818,7 +8809,7 @@ (enter (cond ((= sldb-level level2) (setq state 'leave) - (sldb-invoke-restart 0)) + (sldb-invoke-restart (sldb-first-abort-restart))) (t (slime-eval-async `(cl:aref cl:nil ,sldb-level))))) (leave @@ -8826,7 +8817,8 @@ (setq state 'ok) (sldb-quit)) (t - (sldb-invoke-restart 0))))))))) + (sldb-invoke-restart (sldb-first-abort-restart)) + )))))))) (let ((sldb-hook (cons debug-hook sldb-hook))) (slime-eval-async `(cl:aref cl:nil 0)) (slime-sync-to-top-level 15) @@ -8836,6 +8828,10 @@ (slime-check ("Final state reached.") (eq state 'ok)))))) +(defun sldb-first-abort-restart () + (let ((case-fold-search t)) + (position-if (lambda (x) (string-match "abort" (car x))) sldb-restarts))) + (def-slime-test loop-interrupt-quit () "Test interrupting a loop." From heller at common-lisp.net Tue Sep 4 10:04:48 2007 From: heller at common-lisp.net (heller) Date: Tue, 4 Sep 2007 06:04:48 -0400 (EDT) Subject: [slime-cvs] CVS slime Message-ID: <20070904100448.D8C851C0C5@common-lisp.net> Update of /project/slime/cvsroot/slime In directory clnet:/tmp/cvs-serv24995 Modified Files: ChangeLog slime.el Log Message: * slime.el: Move inferior-slime-mode to contrib. * contrib/inferior-slime.el: New file. --- /project/slime/cvsroot/slime/ChangeLog 2007/09/04 09:59:40 1.1196 +++ /project/slime/cvsroot/slime/ChangeLog 2007/09/04 10:04:48 1.1197 @@ -1,5 +1,9 @@ 2007-09-04 Helmut Eller + * slime.el: Move inferior-slime-mode to contrib. + +2007-09-04 Helmut Eller + * slime.el: Fix the test suite (except for SBCL). 2007-09-04 Helmut Eller --- /project/slime/cvsroot/slime/slime.el 2007/09/04 09:59:40 1.845 +++ /project/slime/cvsroot/slime/slime.el 2007/09/04 10:04:48 1.846 @@ -539,19 +539,6 @@ (when slime-update-modeline-package (run-with-idle-timer 0.2 0.2 'slime-update-modeline-package)) -;;;;; inferior-slime-mode -(define-minor-mode inferior-slime-mode - "\\\ -Inferior SLIME mode: The Inferior Superior Lisp Mode for Emacs. - -This mode is intended for use with `inferior-lisp-mode'. It provides a -subset of the bindings from `slime-mode'. - -\\{inferior-slime-mode-map}" - nil - nil - ;; Fake binding to coax `define-minor-mode' to create the keymap - '((" " 'undefined))) ;; Setup the mode-line to say when we're in slime-mode, and which CL ;; package we think the current buffer belongs to. @@ -561,35 +548,6 @@ ((slime-modeline-package (":" slime-modeline-package) "") slime-state-name)))) -(add-to-list 'minor-mode-alist - '(inferior-slime-mode - (" Inf-Slime" slime-state-name))) - -(defun inferior-slime-return () - "Handle the return key in the inferior-lisp buffer. -The current input should only be sent if a whole expression has been -entered, i.e. the parenthesis are matched. - -A prefix argument disables this behaviour." - (interactive) - (if (or current-prefix-arg (inferior-slime-input-complete-p)) - (comint-send-input) - (insert "\n") - (inferior-slime-indent-line))) - -(defun inferior-slime-indent-line () - "Indent the current line, ignoring everything before the prompt." - (interactive) - (save-restriction - (let ((indent-start - (save-excursion - (goto-char (process-mark (get-buffer-process (current-buffer)))) - (let ((inhibit-field-text-motion t)) - (beginning-of-line 1)) - (point)))) - (narrow-to-region indent-start (point-max))) - (lisp-indent-line))) - (defun slime-input-complete-p (start end) "Return t if the region from START to END contains a complete sexp." (save-excursion @@ -607,22 +565,6 @@ t))) (t t)))) -(defun inferior-slime-input-complete-p () - "Return true if the input is complete in the inferior lisp buffer." - (slime-input-complete-p (process-mark (get-buffer-process (current-buffer))) - (point-max))) - -(defun inferior-slime-closing-return () - "Send the current expression to Lisp after closing any open lists." - (interactive) - (goto-char (point-max)) - (save-restriction - (narrow-to-region (process-mark (get-buffer-process (current-buffer))) - (point-max)) - (while (ignore-errors (save-excursion (backward-up-list 1) t)) - (insert ")"))) - (comint-send-input)) - ;;;;; Key bindings @@ -719,25 +661,16 @@ (defun* slime-define-key (key command &key prefixed inferior) "Define a keybinding of KEY for COMMAND. -If PREFIXED is non-nil, `slime-prefix-key' is prepended to KEY. -If INFERIOR is non-nil, the key is also bound for `inferior-slime-mode'." +If PREFIXED is non-nil, `slime-prefix-key' is prepended to KEY." (when prefixed (setq key (concat slime-prefix-key key))) - (define-key slime-mode-map key command) - (when inferior - (define-key inferior-slime-mode-map key command))) + (define-key slime-mode-map key command)) (defun slime-init-keymaps () - "(Re)initialize the keymaps for `slime-mode' and `inferior-slime-mode'." + "(Re)initialize the keymaps for `slime-mode'." (interactive) (loop for (key command . keys) in slime-keys do (apply #'slime-define-key key command :allow-other-keys t keys)) - ;; Extras.. - (define-key inferior-slime-mode-map [return] 'inferior-slime-return) - (define-key inferior-slime-mode-map - [(control return)] 'inferior-slime-closing-return) - (define-key inferior-slime-mode-map - [(meta control ?m)] 'inferior-slime-closing-return) ;; Documentation (setq slime-doc-map (make-sparse-keymap)) (loop for (key command) in slime-doc-bindings From heller at common-lisp.net Tue Sep 4 10:04:48 2007 From: heller at common-lisp.net (heller) Date: Tue, 4 Sep 2007 06:04:48 -0400 (EDT) Subject: [slime-cvs] CVS slime/contrib Message-ID: <20070904100448.EB7051E0A6@common-lisp.net> Update of /project/slime/cvsroot/slime/contrib In directory clnet:/tmp/cvs-serv24995/contrib Modified Files: ChangeLog Added Files: inferior-slime.el Log Message: * slime.el: Move inferior-slime-mode to contrib. * contrib/inferior-slime.el: New file. --- /project/slime/cvsroot/slime/contrib/ChangeLog 2007/09/01 16:58:05 1.26 +++ /project/slime/cvsroot/slime/contrib/ChangeLog 2007/09/04 10:04:48 1.27 @@ -1,3 +1,7 @@ +2007-09-04 Helmut Eller + + * inferior-slime.el: New file. + 2007-09-01 Matthias Koeppe * slime-fancy.el: New meta-contrib. --- /project/slime/cvsroot/slime/contrib/inferior-slime.el 2007/09/04 10:04:48 NONE +++ /project/slime/cvsroot/slime/contrib/inferior-slime.el 2007/09/04 10:04:48 1.1 ;;; inferior-slime.el --- Minor mode with Slime keys for comint buffers ;; ;; Author: Luke Gorrie ;; License: GNU GPL (same license as Emacs) ;; ;;; Installation: ;; ;; Add something like this to your .emacs: ;; ;; (add-to-list 'load-path "") ;; (add-hook 'slime-load-hook (lambda () (require 'slime-typeout-frame))) ;; (add-hook 'inferior-lisp-mode-hook (lambda () (inferior-slime-mode 1))) (define-minor-mode inferior-slime-mode "\\\ Inferior SLIME mode: The Inferior Superior Lisp Mode for Emacs. This mode is intended for use with `inferior-lisp-mode'. It provides a subset of the bindings from `slime-mode'. \\{inferior-slime-mode-map}" nil nil ;; Fake binding to coax `define-minor-mode' to create the keymap '((" " 'undefined))) (add-to-list 'minor-mode-alist '(inferior-slime-mode (" Inf-Slime" slime-state-name))) (defun inferior-slime-return () "Handle the return key in the inferior-lisp buffer. The current input should only be sent if a whole expression has been entered, i.e. the parenthesis are matched. A prefix argument disables this behaviour." (interactive) (if (or current-prefix-arg (inferior-slime-input-complete-p)) (comint-send-input) (insert "\n") (inferior-slime-indent-line))) (defun inferior-slime-indent-line () "Indent the current line, ignoring everything before the prompt." (interactive) (save-restriction (let ((indent-start (save-excursion (goto-char (process-mark (get-buffer-process (current-buffer)))) (let ((inhibit-field-text-motion t)) (beginning-of-line 1)) (point)))) (narrow-to-region indent-start (point-max))) (lisp-indent-line))) (defun inferior-slime-input-complete-p () "Return true if the input is complete in the inferior lisp buffer." (slime-input-complete-p (process-mark (get-buffer-process (current-buffer))) (point-max))) (defun inferior-slime-closing-return () "Send the current expression to Lisp after closing any open lists." (interactive) (goto-char (point-max)) (save-restriction (narrow-to-region (process-mark (get-buffer-process (current-buffer))) (point-max)) (while (ignore-errors (save-excursion (backward-up-list 1) t)) (insert ")"))) (comint-send-input)) (defun inferior-slime-init-keymap () (let ((map inferior-slime-mode-map)) (define-key map [return] 'inferior-slime-return) (define-key map [(control return)] 'inferior-slime-closing-return) (define-key map [(meta control ?m)] 'inferior-slime-closing-return) (define-key map "\C-c\C-d" slime-doc-map) (define-key map "\C-c\C-w" slime-who-map) (loop for (key command . keys) in slime-keys do (destructuring-bind (&key prefixed inferior &allow-other-keys) keys (when prefixed (setq key (concat slime-prefix-key key))) (when inferior (define-key map key command)))))) (inferior-slime-init-keymap) (provide 'inferior-slime) From heller at common-lisp.net Tue Sep 4 10:12:41 2007 From: heller at common-lisp.net (heller) Date: Tue, 4 Sep 2007 06:12:41 -0400 (EDT) Subject: [slime-cvs] CVS slime Message-ID: <20070904101241.80DBB330C8@common-lisp.net> Update of /project/slime/cvsroot/slime In directory clnet:/tmp/cvs-serv25797 Modified Files: ChangeLog slime.el Log Message: Move startup animation to contrib. * slime.el (slime-repl-banner-function): New hook. (slime-repl-update-banner): Use it and reset markers after calling it. (slime-set-default-directory): Don't call slime-repl-update-banner here. (slime-repl-insert-prompt): Set slime-repl-input-end-mark to point-max. * contrib/slime-banner.el: New file --- /project/slime/cvsroot/slime/ChangeLog 2007/09/04 10:04:48 1.1197 +++ /project/slime/cvsroot/slime/ChangeLog 2007/09/04 10:12:41 1.1198 @@ -1,5 +1,17 @@ 2007-09-04 Helmut Eller + Move startup animation to contrib. + + * slime.el (slime-repl-banner-function): New hook. + (slime-repl-update-banner): Use it and reset markers after calling + it. + (slime-set-default-directory): Don't call slime-repl-update-banner + here. + (slime-repl-insert-prompt): Set slime-repl-input-end-mark to + point-max. + +2007-09-04 Helmut Eller + * slime.el: Move inferior-slime-mode to contrib. 2007-09-04 Helmut Eller --- /project/slime/cvsroot/slime/slime.el 2007/09/04 10:04:48 1.846 +++ /project/slime/cvsroot/slime/slime.el 2007/09/04 10:12:41 1.847 @@ -8,12 +8,12 @@ ;; modify it under the terms of the GNU General Public License as ;; published by the Free Software Foundation; either version 2 of ;; the License, or (at your option) any later version. -;; +;; ;; This program is distributed in the hope that it will be useful, ;; but WITHOUT ANY WARRANTY; without even the implied warranty of ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ;; GNU General Public License for more details. -;; +;; ;; You should have received a copy of the GNU General Public ;; License along with this program; if not, write to the Free ;; Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, @@ -150,11 +150,6 @@ This applies to the *inferior-lisp* buffer and the network connections." :type 'boolean :group 'slime-ui) - -(defcustom slime-startup-animation t - "Enable the startup animation." - :type '(choice (const :tag "Enable" t) (const :tag "Disable" nil)) - :group 'slime-ui) ;;;;; slime-lisp @@ -2677,11 +2672,6 @@ (slime-def-connection-var slime-connection-output-buffer nil "The buffer for the REPL. May be nil or a dead buffer.") -(defcustom slime-header-line-p t - "If non-nil, display a header line in Slime buffers." - :type 'boolean - :group 'slime-repl) - (make-variable-buffer-local (defvar slime-output-start nil "Marker for the start of the output for the evaluation.")) @@ -2699,12 +2689,8 @@ slime-repl-last-input-start-mark)) (set markname (make-marker)) (set-marker (symbol-value markname) (point))) + ;; (set-marker-insertion-type slime-output-end t) (set-marker-insertion-type slime-repl-input-end-mark t) - ;;; We manage the movement of the slime-output-end marker ourselves - ;;; when output arrives; we do not wish it moves behind typed-ahead - ;;; user input. Therefore, don't make the marker advance - ;;; automatically. --mkoeppe - ;;(set-marker-insertion-type slime-output-end t) (set-marker-insertion-type slime-repl-prompt-start-mark t)) (defun slime-output-buffer (&optional noprompt) @@ -2722,28 +2708,21 @@ (slime-repl-insert-prompt)) (current-buffer))))))) +(defvar slime-repl-banner-function 'slime-repl-insert-banner) + (defun slime-repl-update-banner () - (let* ((banner (format "%s Port: %s Pid: %s" - (slime-lisp-implementation-type) - (slime-connection-port (slime-connection)) - (slime-pid))) - ;; Emacs21 has the fancy persistent header-line. - (use-header-p (and slime-header-line-p - (boundp 'header-line-format))) - ;; and dancing text - (animantep (and (fboundp 'animate-string) - slime-startup-animation))) - (when use-header-p - (setq header-line-format banner)) - (when (zerop (buffer-size)) - (let ((hello-message (concat "; SLIME " - (or (slime-changelog-date) - "- ChangeLog file not found")))) - (if animantep - (animate-string hello-message 0 0) - (insert-before-markers hello-message)))) - (pop-to-buffer (current-buffer)) - (slime-repl-insert-prompt))) + (funcall slime-repl-banner-function) + (goto-char (point-max)) + (slime-mark-output-start) + (slime-mark-input-start) + (slime-repl-insert-prompt) + (pop-to-buffer (current-buffer))) + +(defun slime-repl-insert-banner () + (when (zerop (buffer-size)) + (let ((welcome (concat "; SLIME " (or (slime-changelog-date) + "- ChangeLog file not found")))) + (insert welcome)))) (defun slime-init-output-buffer (connection) (with-current-buffer (slime-output-buffer t) @@ -3136,7 +3115,8 @@ (defun slime-repl-insert-prompt () "Goto to point max, and insert the prompt." - (goto-char (if slime-repl-input-start-mark slime-repl-input-start-mark (point-max))) + (goto-char slime-repl-input-start-mark) + (assert (= slime-repl-input-end-mark (point-max))) (unless (bolp) (insert "\n")) (let ((prompt-start (point)) (prompt (format "%s> " (slime-lisp-package-prompt-string)))) @@ -3149,6 +3129,7 @@ start-open t end-open t) (insert-before-markers prompt)) (slime-mark-input-start) + (set-marker slime-repl-input-end-mark (point-max)) (set-marker slime-repl-prompt-start-mark prompt-start) (goto-char slime-repl-prompt-start-mark) (slime-mark-output-start) @@ -6537,9 +6518,7 @@ (slime-eval `(swank:set-default-directory ,(slime-to-lisp-filename directory))))) (with-current-buffer (slime-output-buffer) - (setq default-directory (expand-file-name directory)) - (when (boundp 'header-line-format) - (slime-repl-update-banner)))) + (setq default-directory (expand-file-name directory)))) (defun slime-sync-package-and-default-directory () "Set Lisp's package and directory to the values in current buffer." From heller at common-lisp.net Tue Sep 4 10:12:41 2007 From: heller at common-lisp.net (heller) Date: Tue, 4 Sep 2007 06:12:41 -0400 (EDT) Subject: [slime-cvs] CVS slime/contrib Message-ID: <20070904101241.C490E44060@common-lisp.net> Update of /project/slime/cvsroot/slime/contrib In directory clnet:/tmp/cvs-serv25797/contrib Modified Files: ChangeLog Added Files: slime-banner.el Log Message: Move startup animation to contrib. * slime.el (slime-repl-banner-function): New hook. (slime-repl-update-banner): Use it and reset markers after calling it. (slime-set-default-directory): Don't call slime-repl-update-banner here. (slime-repl-insert-prompt): Set slime-repl-input-end-mark to point-max. * contrib/slime-banner.el: New file --- /project/slime/cvsroot/slime/contrib/ChangeLog 2007/09/04 10:04:48 1.27 +++ /project/slime/cvsroot/slime/contrib/ChangeLog 2007/09/04 10:12:41 1.28 @@ -1,5 +1,6 @@ 2007-09-04 Helmut Eller + * slime-banner.el: New file. * inferior-slime.el: New file. 2007-09-01 Matthias Koeppe --- /project/slime/cvsroot/slime/contrib/slime-banner.el 2007/09/04 10:12:41 NONE +++ /project/slime/cvsroot/slime/contrib/slime-banner.el 2007/09/04 10:12:41 1.1 ;;; slime-banner.el -- Persistent header line and startup animation ;; ;; Authors: Helmut Eller ;; Luke Gorrie ;; License: GNU GPL (same license as Emacs) ;; ;;; Installation: ;; ;; Add something like this your .emacs: ;; ;; (add-to-list 'load-path ".../slime/contrib") ;; (add-hook 'slime-load-hook (lambda () (require 'slime-banner))) (defcustom slime-startup-animation (fboundp 'animate-string) "Enable the startup animation." :type '(choice (const :tag "Enable" t) (const :tag "Disable" nil)) :group 'slime-ui) (defcustom slime-header-line-p (boundp 'header-line-format) "If non-nil, display a header line in Slime buffers." :type 'boolean :group 'slime-repl) (defun slime-startup-message () (when slime-header-line-p (setq header-line-format (format "%s Port: %s Pid: %s" (slime-lisp-implementation-type) (slime-connection-port (slime-connection)) (slime-pid)))) (when (zerop (buffer-size)) (let ((welcome (concat "; SLIME " (or (slime-changelog-date) "- ChangeLog file not found")))) (if slime-startup-animation (animate-string welcome 0 0) (insert welcome))))) (setq slime-repl-banner-function 'slime-startup-message) (provide 'slime-startup-animation) From heller at common-lisp.net Tue Sep 4 10:16:43 2007 From: heller at common-lisp.net (heller) Date: Tue, 4 Sep 2007 06:16:43 -0400 (EDT) Subject: [slime-cvs] CVS slime Message-ID: <20070904101643.B33C074310@common-lisp.net> Update of /project/slime/cvsroot/slime In directory clnet:/tmp/cvs-serv26595 Modified Files: ChangeLog slime.el Log Message: * slime.el: Move tramp support to contrib. * contrib/slime-tramp.el: New file. --- /project/slime/cvsroot/slime/ChangeLog 2007/09/04 10:12:41 1.1198 +++ /project/slime/cvsroot/slime/ChangeLog 2007/09/04 10:16:40 1.1199 @@ -1,5 +1,9 @@ 2007-09-04 Helmut Eller + * slime.el: Move tramp support to contrib. + +2007-09-04 Helmut Eller + Move startup animation to contrib. * slime.el (slime-repl-banner-function): New hook. --- /project/slime/cvsroot/slime/slime.el 2007/09/04 10:12:41 1.847 +++ /project/slime/cvsroot/slime/slime.el 2007/09/04 10:16:40 1.848 @@ -1280,47 +1280,6 @@ (error "No filename-translations for hostname: %s" hostname))) (t (list #'identity #'identity)))) -(defun slime-make-tramp-file-name (username remote-host lisp-filename) - "Old (with multi-hops) tramp compatability function" - (require 'tramp) - (if (boundp 'tramp-multi-methods) - (tramp-make-tramp-file-name nil nil - username - remote-host - lisp-filename) - (tramp-make-tramp-file-name nil - username - remote-host - lisp-filename))) - -(defun* slime-create-filename-translator (&key machine-instance - remote-host - username) - "Creates a three element list suitable for push'ing onto -slime-filename-translations which uses Tramp to load files on -hostname using username. MACHINE-INSTANCE is a required -parameter, REMOTE-HOST defaults to MACHINE-INSTANCE and USERNAME -defaults to (user-login-name). - -MACHINE-INSTANCE is the value returned by slime-machine-instance, -which is just the value returned by cl:machine-instance on the -remote lisp. REMOTE-HOST is the fully qualified domain name (or -just the IP) of the remote machine. USERNAME is the username we -should login with. -The functions created here expect your tramp-default-method or - tramp-default-method-alist to be setup correctly." - (lexical-let ((remote-host (or remote-host machine-instance)) - (username (or username (user-login-name)))) - (list (concat "^" machine-instance "$") - (lambda (emacs-filename) - (tramp-file-name-localname - (tramp-dissect-file-name emacs-filename))) - `(lambda (lisp-filename) - (slime-make-tramp-file-name - ,username - ,remote-host - lisp-filename))))) - ;;;; Starting SLIME ;;; From heller at common-lisp.net Tue Sep 4 10:16:44 2007 From: heller at common-lisp.net (heller) Date: Tue, 4 Sep 2007 06:16:44 -0400 (EDT) Subject: [slime-cvs] CVS slime/contrib Message-ID: <20070904101644.D071470E3@common-lisp.net> Update of /project/slime/cvsroot/slime/contrib In directory clnet:/tmp/cvs-serv26595/contrib Modified Files: ChangeLog Added Files: slime-tramp.el Log Message: * slime.el: Move tramp support to contrib. * contrib/slime-tramp.el: New file. --- /project/slime/cvsroot/slime/contrib/ChangeLog 2007/09/04 10:12:41 1.28 +++ /project/slime/cvsroot/slime/contrib/ChangeLog 2007/09/04 10:16:43 1.29 @@ -1,5 +1,6 @@ 2007-09-04 Helmut Eller + * slime-tramp.el: New file. * slime-banner.el: New file. * inferior-slime.el: New file. --- /project/slime/cvsroot/slime/contrib/slime-tramp.el 2007/09/04 10:16:44 NONE +++ /project/slime/cvsroot/slime/contrib/slime-tramp.el 2007/09/04 10:16:44 1.1 ;;; slime-tramp.el --- Filename translations for tramp ;; ;; Authors: Marco Baringer ;; License: GNU GPL (same license as Emacs) ;; ;;; Installation: ;; ;; Add something like this your .emacs: ;; ;; (add-to-list 'load-path ".../slime/contrib") ;; (add-hook 'slime-load-hook (lambda () (require 'slime-tramp))) ;; (defun slime-make-tramp-file-name (username remote-host lisp-filename) "Old (with multi-hops) tramp compatability function" (require 'tramp) (if (boundp 'tramp-multi-methods) (tramp-make-tramp-file-name nil nil username remote-host lisp-filename) (tramp-make-tramp-file-name nil username remote-host lisp-filename))) (defun* slime-create-filename-translator (&key machine-instance remote-host username) "Creates a three element list suitable for push'ing onto slime-filename-translations which uses Tramp to load files on hostname using username. MACHINE-INSTANCE is a required parameter, REMOTE-HOST defaults to MACHINE-INSTANCE and USERNAME defaults to (user-login-name). MACHINE-INSTANCE is the value returned by slime-machine-instance, which is just the value returned by cl:machine-instance on the remote lisp. REMOTE-HOST is the fully qualified domain name (or just the IP) of the remote machine. USERNAME is the username we should login with. The functions created here expect your tramp-default-method or tramp-default-method-alist to be setup correctly." (lexical-let ((remote-host (or remote-host machine-instance)) (username (or username (user-login-name)))) (list (concat "^" machine-instance "$") (lambda (emacs-filename) (tramp-file-name-localname (tramp-dissect-file-name emacs-filename))) `(lambda (lisp-filename) (slime-make-tramp-file-name ,username ,remote-host lisp-filename))))) (provide 'slime-tramp) From heller at common-lisp.net Tue Sep 4 10:18:45 2007 From: heller at common-lisp.net (heller) Date: Tue, 4 Sep 2007 06:18:45 -0400 (EDT) Subject: [slime-cvs] CVS slime/contrib Message-ID: <20070904101845.366FF1B000@common-lisp.net> Update of /project/slime/cvsroot/slime/contrib In directory clnet:/tmp/cvs-serv26921 Modified Files: slime-banner.el slime-scratch.el slime-tramp.el Log Message: Fix typos in comments. --- /project/slime/cvsroot/slime/contrib/slime-banner.el 2007/09/04 10:12:41 1.1 +++ /project/slime/cvsroot/slime/contrib/slime-banner.el 2007/09/04 10:18:44 1.2 @@ -6,7 +6,7 @@ ;; ;;; Installation: ;; -;; Add something like this your .emacs: +;; Add something like this to your .emacs: ;; ;; (add-to-list 'load-path ".../slime/contrib") ;; (add-hook 'slime-load-hook (lambda () (require 'slime-banner))) --- /project/slime/cvsroot/slime/contrib/slime-scratch.el 2007/08/27 12:58:51 1.2 +++ /project/slime/cvsroot/slime/contrib/slime-scratch.el 2007/09/04 10:18:44 1.3 @@ -5,7 +5,7 @@ ;; ;;; Installation: ;; -;; Add something like this your .emacs: +;; Add something like this to your .emacs: ;; ;; (add-to-list 'load-path ".../slime/contrib") ;; (add-hook 'slime-load-hook (lambda () (require 'slime-scratch))) --- /project/slime/cvsroot/slime/contrib/slime-tramp.el 2007/09/04 10:16:43 1.1 +++ /project/slime/cvsroot/slime/contrib/slime-tramp.el 2007/09/04 10:18:44 1.2 @@ -5,7 +5,7 @@ ;; ;;; Installation: ;; -;; Add something like this your .emacs: +;; Add something like this to your .emacs: ;; ;; (add-to-list 'load-path ".../slime/contrib") ;; (add-hook 'slime-load-hook (lambda () (require 'slime-tramp))) From heller at common-lisp.net Tue Sep 4 10:32:07 2007 From: heller at common-lisp.net (heller) Date: Tue, 4 Sep 2007 06:32:07 -0400 (EDT) Subject: [slime-cvs] CVS slime Message-ID: <20070904103207.239645D006@common-lisp.net> Update of /project/slime/cvsroot/slime In directory clnet:/tmp/cvs-serv30531 Modified Files: ChangeLog slime.el swank-backend.lisp swank-loader.lisp swank.lisp Log Message: 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*. --- /project/slime/cvsroot/slime/ChangeLog 2007/09/04 10:16:40 1.1199 +++ /project/slime/cvsroot/slime/ChangeLog 2007/09/04 10:32:04 1.1200 @@ -1,5 +1,22 @@ 2007-09-04 Helmut Eller + 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*. + +2007-09-04 Helmut Eller + * slime.el: Move tramp support to contrib. 2007-09-04 Helmut Eller --- /project/slime/cvsroot/slime/slime.el 2007/09/04 10:16:40 1.848 +++ /project/slime/cvsroot/slime/slime.el 2007/09/04 10:32:04 1.849 @@ -727,7 +727,6 @@ [ "Compile/Load File" slime-compile-and-load-file ,C ] [ "Compile File" slime-compile-file ,C ] [ "Compile Region" slime-compile-region ,C ] - [ "Compile System" slime-load-system ,C ] "--" [ "Next Note" slime-next-note t ] [ "Previous Note" slime-previous-note t ] @@ -3891,43 +3890,6 @@ (slime-make-compilation-finished-continuation (current-buffer))))) (:one-liner "Compile (if neccessary) and load a lisp file.")) -(defslime-repl-shortcut slime-repl-load/force-system ("force-load-system") - (:handler (lambda () - (interactive) - (slime-oos (slime-read-system-name) "LOAD-OP" :force t))) - (:one-liner "Recompile and load an ASDF system.")) - -(defslime-repl-shortcut slime-repl-load-system ("load-system") - (:handler (lambda () - (interactive) - (slime-oos (slime-read-system-name) "LOAD-OP"))) - (:one-liner "Compile (as needed) and load an ASDF system.")) - -(defslime-repl-shortcut slime-repl-test/force-system ("force-test-system") - (:handler (lambda () - (interactive) - (slime-oos (slime-read-system-name) "TEST-OP" :force t))) - (:one-liner "Compile (as needed) and force test an ASDF system.")) - -(defslime-repl-shortcut slime-repl-test-system ("test-system") - (:handler (lambda () - (interactive) - (slime-oos (slime-read-system-name) "TEST-OP"))) - (:one-liner "Compile (as needed) and test an ASDF system.")) - -(defslime-repl-shortcut slime-repl-compile-system ("compile-system") - (:handler (lambda () - (interactive) - (slime-oos (slime-read-system-name) "COMPILE-OP"))) - (:one-liner "Compile (but not load) an ASDF system.")) - -(defslime-repl-shortcut slime-repl-compile/force-system - ("force-compile-system") - (:handler (lambda () - (interactive) - (slime-oos (slime-read-system-name) "COMPILE-OP" :force t))) - (:one-liner "Recompile (but not load) an ASDF system.")) - (defslime-repl-shortcut nil ("restart-inferior-lisp") (:handler 'slime-restart-inferior-lisp) (:one-liner "Restart *inferior-lisp* and reconnect SLIME.")) @@ -4027,52 +3989,6 @@ (slime-make-compilation-finished-continuation (current-buffer) snapshot)) (message "Compiling %s.." lisp-filename))) -(defun slime-find-asd (system-names) - "Tries to find an ASDF system definition in the default -directory or in the directory belonging to the current buffer and -returns it if it's in `system-names'." - (let* ((asdf-systems-in-directory - (mapcar #'file-name-sans-extension - (directory-files - (file-name-directory (or default-directory - (buffer-file-name))) - nil "\.asd$")))) - (loop for system in asdf-systems-in-directory - for candidate = (file-name-sans-extension system) - when (find candidate system-names :test #'string-equal) - do (return candidate)))) - -(defun slime-load-system (&optional system) - "Compile and load an ASDF system. - -Default system name is taken from first file matching *.asd in current -buffer's working directory" - (interactive (list (slime-read-system-name))) - (slime-oos system "LOAD-OP")) - -(defvar slime-system-history nil - "History list for ASDF system names.") - -(defun slime-read-system-name (&optional prompt initial-value) - "Read a system name from the minibuffer, prompting with PROMPT." - (setq prompt (or prompt "System: ")) - (let* ((completion-ignore-case nil) - (system-names (slime-eval `(swank:list-asdf-systems))) - (alist (slime-bogus-completion-alist system-names))) - (completing-read prompt alist nil nil - (or initial-value (slime-find-asd system-names) "") - 'slime-system-history))) - -(defun slime-oos (system operation &rest keyword-args) - (slime-save-some-lisp-buffers) - (slime-display-output-buffer) - (message "Performing ASDF %S%s on system %S" - operation (if keyword-args (format " %S" keyword-args) "") - system) - (slime-eval-async - `(swank:operate-on-system-for-emacs ,system ,operation , at keyword-args) - (slime-make-compilation-finished-continuation (current-buffer)))) - (defun slime-compile-defun () "Compile the current toplevel form." (interactive) --- /project/slime/cvsroot/slime/swank-backend.lisp 2007/09/04 09:49:09 1.123 +++ /project/slime/cvsroot/slime/swank-backend.lisp 2007/09/04 10:32:05 1.124 @@ -19,6 +19,7 @@ #:short-message #:condition #:severity + #:with-compilation-hooks #:location #:location-p #:location-buffer @@ -345,20 +346,6 @@ rebind *DEFAULT-PATHNAME-DEFAULTS* which may improve the recording of source information.") -(definterface operate-on-system (system-name operation-name &rest keyword-args) - "Perform OPERATION-NAME on SYSTEM-NAME using ASDF. -The KEYWORD-ARGS are passed on to the operation. -Example: -\(operate-on-system \"SWANK\" \"COMPILE-OP\" :force t)" - (unless (member :asdf *features*) - (error "ASDF is not loaded.")) - (with-compilation-hooks () - (let ((operate (find-symbol (symbol-name '#:operate) :asdf)) - (operation (find-symbol operation-name :asdf))) - (when (null operation) - (error "Couldn't find ASDF operation ~S" operation-name)) - (apply operate operation system-name keyword-args)))) - (definterface swank-compile-file (filename load-p external-format) "Compile FILENAME signalling COMPILE-CONDITIONs. If LOAD-P is true, load the file after compilation. --- /project/slime/cvsroot/slime/swank-loader.lisp 2007/08/31 11:48:23 1.70 +++ /project/slime/cvsroot/slime/swank-loader.lisp 2007/09/04 10:32:05 1.71 @@ -200,7 +200,9 @@ (defvar *contribs* '(swank-c-p-c swank-arglists swank-fuzzy swank-fancy-inspector - swank-presentations swank-presentation-streams) + swank-presentations swank-presentation-streams + #+asdf swank-asdf + ) "List of names for contrib modules.") (defun append-dir (absolute name) @@ -208,8 +210,11 @@ (make-pathname :directory `(:relative ,name) :defaults absolute) absolute)) +(defun contrib-src-dir (src-dir) + (append-dir src-dir "contrib")) + (defun contrib-source-files (src-dir) - (source-files *contribs* (append-dir src-dir "contrib"))) + (source-files *contribs* (contrib-src-dir src-dir))) (defun load-swank (&key (source-directory *source-directory*) @@ -219,12 +224,14 @@ (compile-files-if-needed-serially (swank-source-files source-directory) fasl-directory t) (compile-files-if-needed-serially (contrib-source-files source-directory) - contrib-fasl-directory nil) - (set (read-from-string "swank::*swank-wire-protocol-version*") - (slime-version-string)) - (funcall (intern (string :warn-unimplemented-interfaces) :swank-backend)) - (load-site-init-file source-directory) - (load-user-init-file) - (funcall (intern (string :run-after-init-hook) :swank))) + contrib-fasl-directory nil)) (load-swank) + +(setq swank::*swank-wire-protocol-version* (slime-version-string)) +(setq swank::*load-path* + (append swank::*load-path* (list (contrib-src-dir *source-directory*)))) +(swank-backend::warn-unimplemented-interfaces) +(load-site-init-file *source-directory*) +(load-user-init-file) +(swank:run-after-init-hook) --- /project/slime/cvsroot/slime/swank.lisp 2007/09/04 09:49:09 1.508 +++ /project/slime/cvsroot/slime/swank.lisp 2007/09/04 10:32:05 1.509 @@ -2223,50 +2223,6 @@ (let ((*compile-print* nil) (*compile-verbose* t)) (swank-compile-string string :buffer buffer :position position :directory directory)))))) - -(defslimefun operate-on-system-for-emacs (system-name operation &rest keywords) - "Compile and load SYSTEM using ASDF. -Record compiler notes signalled as `compiler-condition's." - (swank-compiler - (lambda () - (apply #'operate-on-system system-name operation keywords)))) - -(defun asdf-central-registry () - (when (find-package :asdf) - (symbol-value (find-symbol (string :*central-registry*) :asdf)))) - -(defslimefun list-all-systems-in-central-registry () - "Returns a list of all systems in ASDF's central registry." - (mapcar #'pathname-name - (delete-duplicates - (loop for dir in (asdf-central-registry) - for defaults = (eval dir) - when defaults - nconc (mapcar #'file-namestring - (directory - (make-pathname :defaults defaults - :version :newest - :type "asd" - :name :wild - :case :local)))) - :test #'string=))) - -(defslimefun list-all-systems-known-to-asdf () - "Returns a list of all systems ASDF knows already." - (unless (find-package :asdf) - (error "ASDF not loaded")) - ;; ugh, yeah, it's unexported - but do we really expect this to - ;; change anytime soon? - (loop for name being the hash-keys of (read-from-string - "#.asdf::*defined-systems*") - collect name)) - -(defslimefun list-asdf-systems () - "Returns the systems in ASDF's central registry and those which ASDF -already knows." - (nunion (list-all-systems-known-to-asdf) - (list-all-systems-in-central-registry) - :test #'string=)) (defun file-newer-p (new-file old-file) "Returns true if NEW-FILE is newer than OLD-FILE." From heller at common-lisp.net Tue Sep 4 10:32:07 2007 From: heller at common-lisp.net (heller) Date: Tue, 4 Sep 2007 06:32:07 -0400 (EDT) Subject: [slime-cvs] CVS slime/contrib Message-ID: <20070904103207.6AAA65D0DD@common-lisp.net> Update of /project/slime/cvsroot/slime/contrib In directory clnet:/tmp/cvs-serv30531/contrib Modified Files: ChangeLog Added Files: slime-asdf.el swank-asdf.lisp Log Message: 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*. --- /project/slime/cvsroot/slime/contrib/ChangeLog 2007/09/04 10:16:43 1.29 +++ /project/slime/cvsroot/slime/contrib/ChangeLog 2007/09/04 10:32:07 1.30 @@ -1,5 +1,17 @@ 2007-09-04 Helmut Eller + Move asdf support to contrib: + + * slime-asdf.el: New file. + + * swank-asdf.lisp: New file + (operate-on-system, asdf-central-registry) + (list-all-systems-known-to-asdf): Use the asdf package in the + source code, i.e. write asdf:operate instead of + (find-symbol "OPERATE" "ASDF"). + +2007-09-04 Helmut Eller + * slime-tramp.el: New file. * slime-banner.el: New file. * inferior-slime.el: New file. --- /project/slime/cvsroot/slime/contrib/slime-asdf.el 2007/09/04 10:32:07 NONE +++ /project/slime/cvsroot/slime/contrib/slime-asdf.el 2007/09/04 10:32:07 1.1 ;;; slime-asdf.el -- ASDF support ;; ;; Authors: Daniel Barlow ;; Marco Baringer ;; Edi Weitz ;; and others ;; License: GNU GPL (same license as Emacs) ;; ;;; Installation: ;; ;; Add something like this to your .emacs: ;; ;; (add-to-list 'load-path ".../slime/contrib") ;; (add-hook 'slime-load-hook (lambda () (require 'slime-asdf))) ;; ;; NOTE: `system-name' is a predefined variable in Emacs. Try to ;; avoid it as local variable name. (defun slime-load-system (&optional system) "Compile and load an ASDF system. Default system name is taken from first file matching *.asd in current buffer's working directory" (interactive (list (slime-read-system-name))) (slime-oos system "LOAD-OP")) (defvar slime-system-history nil "History list for ASDF system names.") (defun slime-read-system-name (&optional prompt initial-value) "Read a system name from the minibuffer, prompting with PROMPT." (setq prompt (or prompt "System: ")) (let* ((completion-ignore-case nil) (system-names (slime-eval `(swank:list-asdf-systems))) (alist (slime-bogus-completion-alist system-names))) (completing-read prompt alist nil nil (or initial-value (slime-find-asd system-names) "") 'slime-system-history))) (defun slime-find-asd (system-names) "Tries to find an ASDF system definition in the default directory or in the directory belonging to the current buffer and returns it if it's in `system-names'." (let* ((asdf-systems-in-directory (mapcar #'file-name-sans-extension (directory-files (file-name-directory (or default-directory (buffer-file-name))) nil "\.asd$")))) (loop for system in asdf-systems-in-directory for candidate = (file-name-sans-extension system) when (find candidate system-names :test #'string-equal) do (return candidate)))) (defun slime-oos (system operation &rest keyword-args) (slime-save-some-lisp-buffers) (slime-display-output-buffer) (message "Performing ASDF %S%s on system %S" operation (if keyword-args (format " %S" keyword-args) "") system) (slime-eval-async `(swank:operate-on-system-for-emacs ,system ,operation , at keyword-args) (slime-make-compilation-finished-continuation (current-buffer)))) (defslime-repl-shortcut slime-repl-load/force-system ("force-load-system") (:handler (lambda () (interactive) (slime-oos (slime-read-system-name) "LOAD-OP" :force t))) (:one-liner "Recompile and load an ASDF system.")) (defslime-repl-shortcut slime-repl-load-system ("load-system") (:handler (lambda () (interactive) (slime-oos (slime-read-system-name) "LOAD-OP"))) (:one-liner "Compile (as needed) and load an ASDF system.")) (defslime-repl-shortcut slime-repl-test/force-system ("force-test-system") (:handler (lambda () (interactive) (slime-oos (slime-read-system-name) "TEST-OP" :force t))) (:one-liner "Compile (as needed) and force test an ASDF system.")) (defslime-repl-shortcut slime-repl-test-system ("test-system") (:handler (lambda () (interactive) (slime-oos (slime-read-system-name) "TEST-OP"))) (:one-liner "Compile (as needed) and test an ASDF system.")) (defslime-repl-shortcut slime-repl-compile-system ("compile-system") (:handler (lambda () (interactive) (slime-oos (slime-read-system-name) "COMPILE-OP"))) (:one-liner "Compile (but not load) an ASDF system.")) (defslime-repl-shortcut slime-repl-compile/force-system ("force-compile-system") (:handler (lambda () (interactive) (slime-oos (slime-read-system-name) "COMPILE-OP" :force t))) (:one-liner "Recompile (but not load) an ASDF system.")) (defun slime-asdf-on-connect () (slime-eval-async '(swank:swank-require :swank-asdf))) (add-hook 'slime-connected-hook 'slime-asdf-on-connect) (provide 'slime-asdf) --- /project/slime/cvsroot/slime/contrib/swank-asdf.lisp 2007/09/04 10:32:07 NONE +++ /project/slime/cvsroot/slime/contrib/swank-asdf.lisp 2007/09/04 10:32:07 1.1 ;;; swank-asdf.el -- ASDF support ;; ;; Authors: Daniel Barlow ;; Marco Baringer ;; Edi Weitz ;; and others ;; License: Public Domain ;; (in-package :swank) (defslimefun operate-on-system-for-emacs (system-name operation &rest keywords) "Compile and load SYSTEM using ASDF. Record compiler notes signalled as `compiler-condition's." (swank-compiler (lambda () (apply #'operate-on-system system-name operation keywords)))) (defun operate-on-system (system-name operation-name &rest keyword-args) "Perform OPERATION-NAME on SYSTEM-NAME using ASDF. The KEYWORD-ARGS are passed on to the operation. Example: \(operate-on-system \"SWANK\" \"COMPILE-OP\" :force t)" (with-compilation-hooks () (let ((operation (find-symbol operation-name :asdf))) (when (null operation) (error "Couldn't find ASDF operation ~S" operation-name)) (apply #'asdf:operate operation system-name keyword-args)))) (defun asdf-central-registry () asdf:*central-registry*) (defslimefun list-all-systems-in-central-registry () "Returns a list of all systems in ASDF's central registry." (mapcar #'pathname-name (delete-duplicates (loop for dir in (asdf-central-registry) for defaults = (eval dir) when defaults nconc (mapcar #'file-namestring (directory (make-pathname :defaults defaults :version :newest :type "asd" :name :wild :case :local)))) :test #'string=))) (defslimefun list-all-systems-known-to-asdf () "Returns a list of all systems ASDF knows already." ;; ugh, yeah, it's unexported - but do we really expect this to ;; change anytime soon? (loop for name being the hash-keys of asdf::*defined-systems* collect name)) (defslimefun list-asdf-systems () "Returns the systems in ASDF's central registry and those which ASDF already knows." (nunion (list-all-systems-known-to-asdf) (list-all-systems-in-central-registry) :test #'string=)) (provide :swank-asdf) From heller at common-lisp.net Tue Sep 4 10:51:24 2007 From: heller at common-lisp.net (heller) Date: Tue, 4 Sep 2007 06:51:24 -0400 (EDT) Subject: [slime-cvs] CVS slime/contrib Message-ID: <20070904105124.E62F51B000@common-lisp.net> Update of /project/slime/cvsroot/slime/contrib In directory clnet:/tmp/cvs-serv1522 Modified Files: ChangeLog slime-c-p-c.el Log Message: Some bug fixes for slime-complete-symbol*. Patches by Mr. Madhu * slime-c-p-c.el (slime-c-p-c-unambiguous-prefix-p): New variable. (slime-expand-abbreviations-and-complete): Use it. Also add a workaround for XEmacs issues. --- /project/slime/cvsroot/slime/contrib/ChangeLog 2007/09/04 10:32:07 1.30 +++ /project/slime/cvsroot/slime/contrib/ChangeLog 2007/09/04 10:51:24 1.31 @@ -1,5 +1,14 @@ 2007-09-04 Helmut Eller + Some bug fixes for slime-complete-symbol*. + Patches by Mr. Madhu + + * slime-c-p-c.el (slime-c-p-c-unambiguous-prefix-p): New variable. + (slime-expand-abbreviations-and-complete): Use it. Also add a + workaround for XEmacs issues. + +2007-09-04 Helmut Eller + Move asdf support to contrib: * slime-asdf.el: New file. --- /project/slime/cvsroot/slime/contrib/slime-c-p-c.el 2007/08/31 22:16:11 1.4 +++ /project/slime/cvsroot/slime/contrib/slime-c-p-c.el 2007/09/04 10:51:24 1.5 @@ -21,6 +21,12 @@ (require 'slime-parse) (require 'slime-editing-commands) +(defcustom slime-c-p-c-unambiguous-prefix-p t + "If true, set point after the unambigous prefix. +If false, move point to the end of the inserted text." + :type 'boolean + :group 'slime-ui) + (defun slime-complete-symbol* () "Expand abbreviations and complete the symbol at point." ;; NB: It is only the name part of the symbol that we actually want @@ -28,9 +34,7 @@ (or (slime-maybe-complete-as-filename) (slime-expand-abbreviations-and-complete))) -;; FIXME: there is no consesus where point should end up after -;; completion. Some want it after the first non-completed prefix, -;; others at the end of the inserted text. +;; FIXME: factorize (defun slime-expand-abbreviations-and-complete () (let* ((end (move-marker (make-marker) (slime-symbol-end-pos))) (beg (move-marker (make-marker) (slime-symbol-start-pos))) @@ -43,10 +47,13 @@ "Can't find completion for \"%s\"" prefix) (ding) (slime-complete-restore-window-configuration)) - (goto-char end) - (insert-and-inherit completed-prefix) - (delete-region beg end) - (goto-char (+ beg (length completed-prefix))) + ;; some XEmacs issue makes this distinction necessary + (cond ((> (length completed-prefix) (- end beg)) + (goto-char end) + (insert-and-inherit completed-prefix) + (delete-region beg end) + (goto-char (+ beg (length completed-prefix)))) + (t nil)) (cond ((and (member completed-prefix completion-set) (slime-length= completion-set 1)) (slime-minibuffer-respecting-message "Sole completion") @@ -58,6 +65,12 @@ (when (member completed-prefix completion-set) (slime-minibuffer-respecting-message "Complete but not unique")) + (when slime-c-p-c-unambiguous-prefix-p + (let ((unambiguous-completion-length + (loop for c in completion-set + minimizing (or (mismatch completed-prefix c) + (length completed-prefix))))) + (goto-char (+ beg unambiguous-completion-length)))) (slime-display-or-scroll-completions completion-set completed-prefix)))))) From heller at common-lisp.net Tue Sep 4 15:45:20 2007 From: heller at common-lisp.net (heller) Date: Tue, 4 Sep 2007 11:45:20 -0400 (EDT) Subject: [slime-cvs] CVS slime Message-ID: <20070904154520.1E84968248@common-lisp.net> Update of /project/slime/cvsroot/slime In directory clnet:/tmp/cvs-serv29758 Modified Files: ChangeLog swank-abcl.lisp Log Message: Abcl fixes. --- /project/slime/cvsroot/slime/ChangeLog 2007/09/04 10:32:04 1.1200 +++ /project/slime/cvsroot/slime/ChangeLog 2007/09/04 15:45:19 1.1201 @@ -1,3 +1,8 @@ +2007-09-04 Mark Evenson + + * swank-abcl.lisp: Call accessors of compiler-condition at load + time to work around some ABCL problems. + 2007-09-04 Helmut Eller Move asdf support to contrib. --- /project/slime/cvsroot/slime/swank-abcl.lisp 2007/08/23 19:03:37 1.42 +++ /project/slime/cvsroot/slime/swank-abcl.lisp 2007/09/04 15:45:19 1.43 @@ -532,6 +532,10 @@ (defimplementation quit-lisp () (ext:exit)) - - - +;; WORKAROUND: call/initialize accessors at load time +(let ((c (make-condition 'compiler-condition + :original-condition nil + :severity ':note :message "" :location nil)) + (slots `(severity message short-message references location))) + (dolist (slot slots) + (funcall slot c))) From heller at common-lisp.net Tue Sep 4 15:45:20 2007 From: heller at common-lisp.net (heller) Date: Tue, 4 Sep 2007 11:45:20 -0400 (EDT) Subject: [slime-cvs] CVS slime/contrib Message-ID: <20070904154520.5C5466A004@common-lisp.net> Update of /project/slime/cvsroot/slime/contrib In directory clnet:/tmp/cvs-serv29758/contrib Modified Files: ChangeLog swank-arglists.lisp Log Message: Abcl fixes. --- /project/slime/cvsroot/slime/contrib/ChangeLog 2007/09/04 10:51:24 1.31 +++ /project/slime/cvsroot/slime/contrib/ChangeLog 2007/09/04 15:45:20 1.32 @@ -1,5 +1,10 @@ 2007-09-04 Helmut Eller + * swank-arglists.lisp (parse-first-valid-form-spec): Rewrite it for + ABCL. + +2007-09-04 Helmut Eller + Some bug fixes for slime-complete-symbol*. Patches by Mr. Madhu --- /project/slime/cvsroot/slime/contrib/swank-arglists.lisp 2007/09/04 09:49:10 1.6 +++ /project/slime/cvsroot/slime/contrib/swank-arglists.lisp 2007/09/04 15:45:20 1.7 @@ -164,21 +164,17 @@ (values :function operator-designator)) ; functions, macros, special ops (values type operator arguments)))) ; are all fbound. - (defun parse-first-valid-form-spec (raw-specs &optional arg-indices reader) "Returns the first parsed form spec in RAW-SPECS that can successfully be parsed. Additionally returns its respective index in ARG-INDICES (or NIL.), and all newly interned symbols as tertiary return value." - (block traversal - (mapc #'(lambda (raw-spec index) - (multiple-value-bind (spec symbols) (parse-form-spec raw-spec reader) - (when spec (return-from traversal - (values spec index symbols))))) - raw-specs - (append arg-indices '#1=(nil . #1#))) - nil)) ; found nothing - + (do ((raw raw-specs (cdr raw)) + (arg arg-indices (cdr arg))) + ((null raw) nil) + (let ((raw-spec (car raw)) (index (car arg))) + (multiple-value-bind (spec symbols) (parse-form-spec raw-spec reader) + (when spec (return (values spec index symbols))))))) (defun read-form-spec (spec &optional reader) "Turns the ``raw form spec'' SPEC into a proper Common Lisp From heller at common-lisp.net Wed Sep 5 12:02:30 2007 From: heller at common-lisp.net (heller) Date: Wed, 5 Sep 2007 08:02:30 -0400 (EDT) Subject: [slime-cvs] CVS slime Message-ID: <20070905120230.3E8A23C016@common-lisp.net> Update of /project/slime/cvsroot/slime In directory clnet:/tmp/cvs-serv29914 Modified Files: slime.el ChangeLog Log Message: * slime.el (slime-filename-translations): Fix custom type. * slime.el (slime-toggle-trace-fdefinition): Fix typo. The argument for interactive should be "P" not "p". --- /project/slime/cvsroot/slime/slime.el 2007/09/04 10:32:04 1.849 +++ /project/slime/cvsroot/slime/slime.el 2007/09/05 12:02:24 1.850 @@ -171,9 +171,8 @@ :group 'slime-lisp) (defcustom slime-filename-translations nil - "Alist of mappings between machine names and filename -translation functions. Each element is of the -form (HOSTNAME-REGEXP TO-LISP FROM-LISP). + "Assoc list of hostnames and filename translation functions. +Each element is of the form (HOSTNAME-REGEXP TO-LISP FROM-LISP). HOSTNAME-REGEXP is a regexp which is applied to the connection's slime-machine-instance. If HOSTNAME-REGEXP maches then the @@ -204,7 +203,10 @@ slime-filename-translations) See also `slime-create-filename-translator'." - :type 'list + :type '(repeat (list :tag "Host description" + (regexp :tag "Hostname regexp") + (function :tag "To lisp function") + (function :tag "From lisp function"))) :group 'slime-lisp) (defcustom slime-enable-evaluate-in-emacs nil @@ -5585,20 +5587,20 @@ (defun slime-toggle-trace-fdefinition (&optional using-context-p) "Toggle trace." - (interactive "p") - (let ((spec (if using-context-p + (interactive "P") + (let* ((spec (if using-context-p (slime-extract-context) - (slime-symbol-at-point)))) - (let ((spec (slime-trace-query spec))) - (message "%s" (slime-eval `(swank:swank-toggle-trace ,spec)))))) + (slime-symbol-name-at-point))) + (spec (slime-trace-query spec))) + (message "%s" (slime-eval `(swank:swank-toggle-trace ,spec))))) (defun slime-trace-query (spec) "Ask the user which function to trace; SPEC is the default. The result is a string." (cond ((null spec) (slime-read-from-minibuffer "(Un)trace: ")) - ((symbolp spec) - (slime-read-from-minibuffer "(Un)trace: " (symbol-name spec))) + ((stringp spec) + (slime-read-from-minibuffer "(Un)trace: " spec)) (t (destructure-case spec ((setf n) --- /project/slime/cvsroot/slime/ChangeLog 2007/09/04 15:45:19 1.1201 +++ /project/slime/cvsroot/slime/ChangeLog 2007/09/05 12:02:24 1.1202 @@ -1,3 +1,12 @@ +2007-09-05 Didier Verna + + * slime.el (slime-filename-translations): Fix custom type. + +2007-09-05 Helmut Eller + + * slime.el (slime-toggle-trace-fdefinition): Fix typo. The + argument for interactive should be "P" not "p". + 2007-09-04 Mark Evenson * swank-abcl.lisp: Call accessors of compiler-condition at load From heller at common-lisp.net Wed Sep 5 12:04:46 2007 From: heller at common-lisp.net (heller) Date: Wed, 5 Sep 2007 08:04:46 -0400 (EDT) Subject: [slime-cvs] CVS slime Message-ID: <20070905120446.9066913026@common-lisp.net> Update of /project/slime/cvsroot/slime In directory clnet:/tmp/cvs-serv1624 Modified Files: swank-cmucl.lisp Log Message: (toggle-trace): Add a comment about not working :flet. --- /project/slime/cvsroot/slime/swank-cmucl.lisp 2007/08/30 23:20:31 1.173 +++ /project/slime/cvsroot/slime/swank-cmucl.lisp 2007/09/05 12:04:43 1.174 @@ -2228,7 +2228,10 @@ ((:call) (destructuring-bind (caller callee) (cdr spec) (toggle-trace-aux (process-fspec callee) - :wherein (list (process-fspec caller))))))) + :wherein (list (process-fspec caller))))) + ;; doesn't work properly + ;; ((:labels :flet) (toggle-trace-aux (process-fspec spec))) + )) (defun process-fspec (fspec) (cond ((consp fspec) @@ -2236,9 +2239,8 @@ ((:defun :defgeneric) (second fspec)) ((:defmethod) `(method ,(second fspec) ,@(third fspec) ,(fourth fspec))) - ;; this isn't actually supported - ((:labels) `(labels ,(process-fspec (second fspec)) ,(third fspec))) - ((:flet) `(flet ,(process-fspec (second fspec)) ,(third fspec))))) + ((:labels) `(labels ,(third fspec) ,(process-fspec (second fspec)))) + ((:flet) `(flet ,(third fspec) ,(process-fspec (second fspec)))))) (t fspec))) From trittweiler at common-lisp.net Wed Sep 5 18:48:49 2007 From: trittweiler at common-lisp.net (trittweiler) Date: Wed, 5 Sep 2007 14:48:49 -0400 (EDT) Subject: [slime-cvs] CVS slime/contrib Message-ID: <20070905184849.E1EC1A15D@common-lisp.net> Update of /project/slime/cvsroot/slime/contrib In directory clnet:/tmp/cvs-serv26346/contrib Modified Files: swank-arglists.lisp Log Message: Added extended arglist display for DECLAIM and PROCLAIM. * slime.el (slime-extended-operator-name-parser-alist): Added entries for "DECLAIM", and "PROCLAIM". (slime-parse-extended-operator/declare): Provide information about the operator the arglist is requested for. (slime-make-form-spec-from-string): Fixed for "()" as input. * swank-arglists.lisp (valid-operator-symbol-p): Explicitly allow the symbol 'DECLARE. (arglist-dispatch): New method for `DECLARE'. We have to catch this explicitly, as DECLARE doesn't have an arglist (in the `swank-backend:arglist' sense.) (*arglist-pprint-bindings*): New variable. Splitted out from `decoded-arglist-to-string'. (decoded-arglist-to-string): Use `*arglist-pprint-bindings*'. (parse-first-valid-form-spec): Rewritten, because function signature had to be changed: doesn't take arg-indices anymore; returns position of first valid spec as second value to remedy. (arglist-for-echo-area): Accomodated to new signature of `parse-first-valid-form-spec'; now searchs for contextual declaration operator name, to prefix a declaration arglist by "declare", "declaim", or "proclaim" depending on what was used at user's point in Slime. Use `*arglist-pprint-bindings*' for printing the found declaration operator name. (%find-declaration-operator): New helper to do this search. (completions-for-keyword): Accomodated to new signature of `parse-first-valid-form-spec'. Also fixed to correctly provide keyword completions in nested expressions like: `(defun foo (x) (let ((bar 'quux)) (with-open-file (s f :|' [`|' being point] --- /project/slime/cvsroot/slime/contrib/swank-arglists.lisp 2007/09/04 15:45:20 1.7 +++ /project/slime/cvsroot/slime/contrib/swank-arglists.lisp 2007/09/05 18:48:49 1.8 @@ -16,7 +16,8 @@ "Is SYMBOL the name of a function, a macro, or a special-operator?" (or (fboundp symbol) (macro-function symbol) - (special-operator-p symbol))) + (special-operator-p symbol) + (eq symbol 'declare))) (defun valid-operator-name-p (string) "Is STRING the name of a function, macro, or special-operator?" @@ -33,9 +34,8 @@ ``form specs'', please see PARSE-FORM-SPEC." (handler-case (with-buffer-syntax () - (multiple-value-bind (form-spec arg-index newly-interned-symbols) - (parse-first-valid-form-spec raw-specs arg-indices - #'read-conversatively-for-autodoc) + (multiple-value-bind (form-spec position newly-interned-symbols) + (parse-first-valid-form-spec raw-specs #'read-conversatively-for-autodoc) (unwind-protect (when form-spec (let ((arglist (arglist-from-form-spec form-spec :remove-args nil))) @@ -49,19 +49,28 @@ :operator operator :print-right-margin print-right-margin :print-lines print-lines - :highlight (and arg-index - (not (zerop arg-index)) - ;; don't highlight the operator - arg-index)) + :highlight (let ((index (nth position arg-indices))) + ;; don't highlight the operator + (and index (not (zerop index)) index))) + ;; Post formatting: (case type - (:declaration (format nil "(declare ~A)" stringified-arglist)) (:type-specifier (format nil "[Typespec] ~A" stringified-arglist)) + (:declaration + (with-bindings *arglist-pprint-bindings* + (let ((op (%find-declaration-operator raw-specs position))) + (if op + (format nil "(~A ~A)" op stringified-arglist) + (format nil "[Declaration] ~A" stringified-arglist))))) (t stringified-arglist))))))) (mapc #'unintern-in-home-package newly-interned-symbols)))) (error (cond) (format nil "ARGLIST (error): ~A" cond)) )) +(defun %find-declaration-operator (raw-specs position) + (let ((op-rawspec (nth (1+ position) raw-specs))) + (first (parse-form-spec op-rawspec #'read-conversatively-for-autodoc)))) + (defvar *arglist-dummy* (cons :dummy nil)) (defun read-conversatively-for-autodoc (string) @@ -132,9 +141,9 @@ (flet ((parse-extended-spec (raw-extension extension-flag) (when (and (stringp (first raw-extension)) ; (:DECLARATION (("a" "b" ("c")) "d")) (nth-value 1 (parse-symbol (first raw-extension)))) - (multiple-value-bind (extension introduced-symbols) + (multiple-value-bind (extension introduced-symbols) (read-form-spec raw-extension reader) - (unless (recursively-empty-p extension) ; (:DECLARATION (())) &c. + (unless (recursively-empty-p extension) ; (:DECLARATION (())) &c. (destructuring-bind (identifier &rest args) extension (values `((,extension-flag ,identifier) , at args) introduced-symbols))))))) @@ -164,17 +173,15 @@ (values :function operator-designator)) ; functions, macros, special ops (values type operator arguments)))) ; are all fbound. -(defun parse-first-valid-form-spec (raw-specs &optional arg-indices reader) +(defun parse-first-valid-form-spec (raw-specs &optional reader) "Returns the first parsed form spec in RAW-SPECS that can -successfully be parsed. Additionally returns its respective index -in ARG-INDICES (or NIL.), and all newly interned symbols as tertiary -return value." - (do ((raw raw-specs (cdr raw)) - (arg arg-indices (cdr arg))) - ((null raw) nil) - (let ((raw-spec (car raw)) (index (car arg))) - (multiple-value-bind (spec symbols) (parse-form-spec raw-spec reader) - (when spec (return (values spec index symbols))))))) +successfully be parsed. Additionally returns that spec's position +as secondary, and all newly interned symbols as tertiary return +value." + (loop for raw-spec in raw-specs + for pos upfrom 0 + do (multiple-value-bind (spec symbols) (parse-form-spec raw-spec reader) + (when spec (return (values spec pos symbols)))))) (defun read-form-spec (spec &optional reader) "Turns the ``raw form spec'' SPEC into a proper Common Lisp @@ -370,6 +377,15 @@ (mapc #'print-with-space (arglist.unknown-junk arglist)))))) +(defvar *arglist-pprint-bindings* + '((*print-case* . :downcase) + (*print-pretty* . t) + (*print-circle* . nil) + (*print-readably* . nil) + (*print-level* . 10) + (*print-length* . 20) + (*print-escape* . nil))) ; no package qualifiers. + (defun decoded-arglist-to-string (arglist &key operator highlight (package *package*) print-right-margin print-lines) @@ -380,13 +396,11 @@ If OPERATOR is non-nil, put it in front of the arglist." (with-output-to-string (*standard-output*) (with-standard-io-syntax - (let ((*package* package) (*print-case* :downcase) - (*print-pretty* t) (*print-circle* nil) (*print-readably* nil) - (*print-level* 10) (*print-length* 20) - (*print-right-margin* print-right-margin) - (*print-lines* print-lines) - (*print-escape* nil)) ; no package qualifies. - (print-arglist arglist :operator operator :highlight highlight))))) + (with-bindings *arglist-pprint-bindings* + (let ((*package* package) + (*print-right-margin* print-right-margin) + (*print-lines* print-lines)) + (print-arglist arglist :operator operator :highlight highlight)))))) (defslimefun variable-desc-for-echo-area (variable-name) "Return a short description of VARIABLE-NAME, or NIL." @@ -1052,10 +1066,16 @@ (defmethod arglist-dispatch ((operator-type (eql :function)) (operator (eql 'eval-when)) arguments &key (remove-args t)) (let ((eval-when-args '(:compile-toplevel :load-toplevel :execute))) - (maybecall remove-args #'remove-actual-args - (make-arglist :required-args (list (make-arglist :any-args eval-when-args)) - :rest '#:body :body-p t) - arguments))) + (make-arglist :required-args (list (maybecall remove-args #'remove-actual-args + (make-arglist :any-args eval-when-args) + arguments)) + :rest '#:body :body-p t))) + +(defmethod arglist-dispatch ((operator-type (eql :function)) (operator (eql 'declare)) + arguments &key (remove-args t)) + ;; Catching 'DECLARE before SWANK-BACKEND:ARGLIST can barf. + (declare (ignore remove-args)) + (make-arglist :rest '#:decl-specifiers)) (defmethod arglist-dispatch ((operator-type (eql :declaration)) decl-identifier decl-args &key (remove-args t)) @@ -1125,39 +1145,38 @@ (let ((arg (elt args index))) (apply #'arglist-ref arg nil (rest indices)))))))) -(defslimefun completions-for-keyword (raw-specs keyword-string arg-indices) +(defslimefun completions-for-keyword (raw-specs keyword-string arg-index-specs) (with-buffer-syntax () - (multiple-value-bind (form-spec index newly-interned-symbols) - (parse-first-valid-form-spec raw-specs arg-indices) + (multiple-value-bind (form-spec position newly-interned-symbols) + (parse-first-valid-form-spec raw-specs) (unwind-protect (when form-spec - (let ((arglist (arglist-from-form-spec form-spec :remove-args nil))) + (let ((arglist (arglist-from-form-spec form-spec :remove-args nil))) (unless (eql arglist :not-available) - (multiple-value-bind (type operator arguments) (split-form-spec form-spec) - (declare (ignore type arguments)) - (let* ((indices (butlast (reverse (last arg-indices (1+ index))))) - (arglist (apply #'arglist-ref arglist operator indices))) - (when (and arglist (arglist-p arglist)) - ;; It would be possible to complete keywords only if we - ;; are in a keyword position, but it is not clear if we - ;; want that. - (let* ((keywords - (append (mapcar #'keyword-arg.keyword - (arglist.keyword-args arglist)) - (remove-if-not #'keywordp (arglist.any-args arglist)))) - (keyword-name - (tokenize-symbol keyword-string)) - (matching-keywords - (find-matching-symbols-in-list keyword-name keywords - #'compound-prefix-match)) - (converter (completion-output-symbol-converter keyword-string)) - (strings - (mapcar converter - (mapcar #'symbol-name matching-keywords))) - (completion-set - (format-completion-set strings nil ""))) - (list completion-set - (longest-compound-prefix completion-set))))))))) + (let* ((operator (nth-value 1 (split-form-spec form-spec))) + (indices (reverse (rest (subseq arg-index-specs 0 (1+ position))))) + (arglist (apply #'arglist-ref arglist operator indices))) + (when (and arglist (arglist-p arglist)) + ;; It would be possible to complete keywords only if we + ;; are in a keyword position, but it is not clear if we + ;; want that. + (let* ((keywords + (append (mapcar #'keyword-arg.keyword + (arglist.keyword-args arglist)) + (remove-if-not #'keywordp (arglist.any-args arglist)))) + (keyword-name + (tokenize-symbol keyword-string)) + (matching-keywords + (find-matching-symbols-in-list keyword-name keywords + #'compound-prefix-match)) + (converter (completion-output-symbol-converter keyword-string)) + (strings + (mapcar converter + (mapcar #'symbol-name matching-keywords))) + (completion-set + (format-completion-set strings nil ""))) + (list completion-set + (longest-compound-prefix completion-set)))))))) (mapc #'unintern-in-home-package newly-interned-symbols))))) From trittweiler at common-lisp.net Wed Sep 5 18:49:00 2007 From: trittweiler at common-lisp.net (trittweiler) Date: Wed, 5 Sep 2007 14:49:00 -0400 (EDT) Subject: [slime-cvs] CVS slime/contrib Message-ID: <20070905184900.871CBA192@common-lisp.net> Update of /project/slime/cvsroot/slime/contrib In directory clnet:/tmp/cvs-serv26398/contrib Modified Files: slime-parse.el Log Message: Added extended arglist display for DECLAIM and PROCLAIM. * slime.el (slime-extended-operator-name-parser-alist): Added entries for "DECLAIM", and "PROCLAIM". (slime-parse-extended-operator/declare): Provide information about the operator the arglist is requested for. (slime-make-form-spec-from-string): Fixed for "()" as input. * swank-arglists.lisp (valid-operator-symbol-p): Explicitly allow the symbol 'DECLARE. (arglist-dispatch): New method for `DECLARE'. We have to catch this explicitly, as DECLARE doesn't have an arglist (in the `swank-backend:arglist' sense.) (*arglist-pprint-bindings*): New variable. Splitted out from `decoded-arglist-to-string'. (decoded-arglist-to-string): Use `*arglist-pprint-bindings*'. (parse-first-valid-form-spec): Rewritten, because function signature had to be changed: doesn't take arg-indices anymore; returns position of first valid spec as second value to remedy. (arglist-for-echo-area): Accomodated to new signature of `parse-first-valid-form-spec'; now searchs for contextual declaration operator name, to prefix a declaration arglist by "declare", "declaim", or "proclaim" depending on what was used at user's point in Slime. Use `*arglist-pprint-bindings*' for printing the found declaration operator name. (%find-declaration-operator): New helper to do this search. (completions-for-keyword): Accomodated to new signature of `parse-first-valid-form-spec'. Also fixed to correctly provide keyword completions in nested expressions like: `(defun foo (x) (let ((bar 'quux)) (with-open-file (s f :|' [`|' being point] --- /project/slime/cvsroot/slime/contrib/slime-parse.el 2007/09/01 05:36:19 1.2 +++ /project/slime/cvsroot/slime/contrib/slime-parse.el 2007/09/05 18:49:00 1.3 @@ -154,7 +154,9 @@ ("CHANGE-CLASS" . (slime-make-extended-operator-parser/look-ahead 2)) ("DEFMETHOD" . (slime-make-extended-operator-parser/look-ahead 1)) ("APPLY" . (slime-make-extended-operator-parser/look-ahead 1)) - ("DECLARE" . slime-parse-extended-operator/declare))) + ("DECLARE" . slime-parse-extended-operator/declare) + ("DECLAIM" . slime-parse-extended-operator/declare) + ("PROCLAIM" . slime-parse-extended-operator/declare))) (defun slime-make-extended-operator-parser/look-ahead (steps) "Returns a parser that parses the current operator at point @@ -195,9 +197,11 @@ (setq current-indices (list (second decl-indices))) (setq current-points (list (second decl-points)))) (let ((declspec (slime-make-form-spec-from-string declspec-str))) - (setq current-forms (list `(:declaration ,declspec))) - (setq current-indices (list (first decl-indices))) - (setq current-points (list (first decl-points))))))))) + (setq current-forms (list `(,name) `(:declaration ,declspec))) + (setq current-indices (list (first current-indices) + (first decl-indices))) + (setq current-points (list (first current-points) + (first decl-points))))))))) (values current-forms current-indices current-points)) (defun slime-nesting-until-point (target-point) @@ -219,34 +223,35 @@ is stripped from the form. This can be important to avoid mutual recursion between this function, `slime-enclosing-form-specs' and `slime-parse-extended-operator-name'." - (if (slime-length= string 0) - "" - (with-temp-buffer - ;; Do NEVER ever try to activate `lisp-mode' here with - ;; `slime-use-autodoc-mode' enabled, as this function is used - ;; to compute the current autodoc itself. - (erase-buffer) - (insert string) - (when strip-operator-p ; `(OP arg1 arg2 ...)' ==> `(arg1 arg2 ...)' - (goto-char (point-min)) - (when (string= (thing-at-point 'char) "(") - (ignore-errors (forward-char 1) - (forward-sexp) - (slime-forward-blanks)) - (delete-region (point-min) (point)) - (insert "("))) - (goto-char (1- (point-max))) ; `(OP arg1 ... argN|)' - (multiple-value-bind (forms indices points) - (slime-enclosing-form-specs 1) - (if (null forms) - string - (let ((n (first (last indices)))) - (goto-char (1+ (point-min))) ; `(|OP arg1 ... argN)' - (mapcar #'(lambda (s) - (assert (not (equal s string))) ; trap against - (slime-make-form-spec-from-string s)) ; endless recursion. - (slime-ensure-list - (slime-parse-sexp-at-point (1+ n) t))))))))) + (cond ((slime-length= string 0) "") + ((equal string "()") '()) + (t + (with-temp-buffer + ;; Do NEVER ever try to activate `lisp-mode' here with + ;; `slime-use-autodoc-mode' enabled, as this function is used + ;; to compute the current autodoc itself. + (erase-buffer) + (insert string) + (when strip-operator-p ; `(OP arg1 arg2 ...)' ==> `(arg1 arg2 ...)' + (goto-char (point-min)) + (when (string= (thing-at-point 'char) "(") + (ignore-errors (forward-char 1) + (forward-sexp) + (slime-forward-blanks)) + (delete-region (point-min) (point)) + (insert "("))) + (goto-char (1- (point-max))) ; `(OP arg1 ... argN|)' + (multiple-value-bind (forms indices points) + (slime-enclosing-form-specs 1) + (if (null forms) + string + (let ((n (first (last indices)))) + (goto-char (1+ (point-min))) ; `(|OP arg1 ... argN)' + (mapcar #'(lambda (s) + (assert (not (equal s string))) ; trap against + (slime-make-form-spec-from-string s)) ; endless recursion. + (slime-ensure-list + (slime-parse-sexp-at-point (1+ n) t)))))))))) (defun slime-enclosing-form-specs (&optional max-levels) @@ -260,7 +265,7 @@ As tertiary value, return the positions of the operators that are contained in the returned form specs. - When MAX-LEVELS is non-nil, go up at most this many levels of +When MAX-LEVELS is non-nil, go up at most this many levels of parens. \(See SWANK::PARSE-FORM-SPEC for more information about what From trittweiler at common-lisp.net Wed Sep 5 18:49:14 2007 From: trittweiler at common-lisp.net (trittweiler) Date: Wed, 5 Sep 2007 14:49:14 -0400 (EDT) Subject: [slime-cvs] CVS slime/contrib Message-ID: <20070905184914.39E7AA192@common-lisp.net> Update of /project/slime/cvsroot/slime/contrib In directory clnet:/tmp/cvs-serv26442/contrib Modified Files: ChangeLog Log Message: Added extended arglist display for DECLAIM and PROCLAIM. * slime.el (slime-extended-operator-name-parser-alist): Added entries for "DECLAIM", and "PROCLAIM". (slime-parse-extended-operator/declare): Provide information about the operator the arglist is requested for. (slime-make-form-spec-from-string): Fixed for "()" as input. * swank-arglists.lisp (valid-operator-symbol-p): Explicitly allow the symbol 'DECLARE. (arglist-dispatch): New method for `DECLARE'. We have to catch this explicitly, as DECLARE doesn't have an arglist (in the `swank-backend:arglist' sense.) (*arglist-pprint-bindings*): New variable. Splitted out from `decoded-arglist-to-string'. (decoded-arglist-to-string): Use `*arglist-pprint-bindings*'. (parse-first-valid-form-spec): Rewritten, because function signature had to be changed: doesn't take arg-indices anymore; returns position of first valid spec as second value to remedy. (arglist-for-echo-area): Accomodated to new signature of `parse-first-valid-form-spec'; now searchs for contextual declaration operator name, to prefix a declaration arglist by "declare", "declaim", or "proclaim" depending on what was used at user's point in Slime. Use `*arglist-pprint-bindings*' for printing the found declaration operator name. (%find-declaration-operator): New helper to do this search. (completions-for-keyword): Accomodated to new signature of `parse-first-valid-form-spec'. Also fixed to correctly provide keyword completions in nested expressions like: `(defun foo (x) (let ((bar 'quux)) (with-open-file (s f :|' [`|' being point] --- /project/slime/cvsroot/slime/contrib/ChangeLog 2007/09/04 15:45:20 1.32 +++ /project/slime/cvsroot/slime/contrib/ChangeLog 2007/09/05 18:49:14 1.33 @@ -1,3 +1,40 @@ +2007-09-05 Tobias C. Rittweiler + + Added extended arglist display for DECLAIM and PROCLAIM. + + * slime.el (slime-extended-operator-name-parser-alist): Added + entries for "DECLAIM", and "PROCLAIM". + (slime-parse-extended-operator/declare): Provide information about + the operator the arglist is requested for. + (slime-make-form-spec-from-string): Fixed for "()" as input. + + * swank-arglists.lisp (valid-operator-symbol-p): Explicitly allow + the symbol 'DECLARE. + (arglist-dispatch): New method for `DECLARE'. We have to catch + this explicitly, as DECLARE doesn't have an arglist (in the + `swank-backend:arglist' sense.) + (*arglist-pprint-bindings*): New variable. Splitted out from + `decoded-arglist-to-string'. + (decoded-arglist-to-string): Use `*arglist-pprint-bindings*'. + + (parse-first-valid-form-spec): Rewritten, because function + signature had to be changed: doesn't take arg-indices anymore; + returns position of first valid spec as second value to remedy. + (arglist-for-echo-area): Accomodated to new signature of + `parse-first-valid-form-spec'; now searchs for contextual + declaration operator name, to prefix a declaration arglist by + "declare", "declaim", or "proclaim" depending on what was used at + user's point in Slime. Use `*arglist-pprint-bindings*' for + printing the found declaration operator name. + (%find-declaration-operator): New helper to do this search. + (completions-for-keyword): Accomodated to new signature of + `parse-first-valid-form-spec'. Also fixed to correctly provide + keyword completions in nested expressions like: + + `(defun foo (x) + (let ((bar 'quux)) + (with-open-file (s f :|' [`|' being point] + 2007-09-04 Helmut Eller * swank-arglists.lisp (parse-first-valid-form-spec): Rewrite it for From trittweiler at common-lisp.net Wed Sep 5 18:57:25 2007 From: trittweiler at common-lisp.net (trittweiler) Date: Wed, 5 Sep 2007 14:57:25 -0400 (EDT) Subject: [slime-cvs] CVS slime/contrib Message-ID: <20070905185725.EA36C1D136@common-lisp.net> Update of /project/slime/cvsroot/slime/contrib In directory clnet:/tmp/cvs-serv27168/contrib Modified Files: slime-c-p-c.el Log Message: * slime-c-p-c.el (slime-c-p-c-init): Bind `slime-complete-form' to `C-c C-s' in `slime-repl-mode-map'. --- /project/slime/cvsroot/slime/contrib/slime-c-p-c.el 2007/09/04 10:51:24 1.5 +++ /project/slime/cvsroot/slime/contrib/slime-c-p-c.el 2007/09/05 18:57:25 1.6 @@ -172,6 +172,7 @@ (setq slime-complete-symbol-function 'slime-complete-symbol*) (add-hook 'slime-connected-hook 'slime-c-p-c-on-connect) (define-key slime-mode-map "\C-c\C-s" 'slime-complete-form) + (define-key slime-repl-mode-map "\C-c\C-s" 'slime-complete-form) ) (defun slime-c-p-c-on-connect () From trittweiler at common-lisp.net Wed Sep 5 18:57:33 2007 From: trittweiler at common-lisp.net (trittweiler) Date: Wed, 5 Sep 2007 14:57:33 -0400 (EDT) Subject: [slime-cvs] CVS slime/contrib Message-ID: <20070905185733.142AC2E20A@common-lisp.net> Update of /project/slime/cvsroot/slime/contrib In directory clnet:/tmp/cvs-serv27209/contrib Modified Files: ChangeLog Log Message: * slime-c-p-c.el (slime-c-p-c-init): Bind `slime-complete-form' to `C-c C-s' in `slime-repl-mode-map'. --- /project/slime/cvsroot/slime/contrib/ChangeLog 2007/09/05 18:49:14 1.33 +++ /project/slime/cvsroot/slime/contrib/ChangeLog 2007/09/05 18:57:33 1.34 @@ -1,8 +1,13 @@ 2007-09-05 Tobias C. Rittweiler + * slime-c-p-c.el (slime-c-p-c-init): Bind `slime-complete-form' to + `C-c C-s' in `slime-repl-mode-map'. + +2007-09-05 Tobias C. Rittweiler + Added extended arglist display for DECLAIM and PROCLAIM. - * slime.el (slime-extended-operator-name-parser-alist): Added + * slime-parse.el (slime-extended-operator-name-parser-alist): Added entries for "DECLAIM", and "PROCLAIM". (slime-parse-extended-operator/declare): Provide information about the operator the arglist is requested for. From trittweiler at common-lisp.net Wed Sep 5 19:35:35 2007 From: trittweiler at common-lisp.net (trittweiler) Date: Wed, 5 Sep 2007 15:35:35 -0400 (EDT) Subject: [slime-cvs] CVS slime/contrib Message-ID: <20070905193535.B7ABC450D0@common-lisp.net> Update of /project/slime/cvsroot/slime/contrib In directory clnet:/tmp/cvs-serv2416/contrib Modified Files: swank-c-p-c.lisp Log Message: * swank-c-p-c.el: This file incorrectly provided the module `:swank-compound-prefix'; changed that to `:swank-c-p-c'. This gets rid off the nasty redefinition warnings that were previously signalled when loading SWANK with SBCL. * swank-arglist.lisp (arglist-for-echo-area): Locally declare `*arglist-pprint-bindings*' to be special, as the variable is defined later in the file. (Gets rid of warnings during loading.) --- /project/slime/cvsroot/slime/contrib/swank-c-p-c.lisp 2007/08/31 11:48:23 1.1 +++ /project/slime/cvsroot/slime/contrib/swank-c-p-c.lisp 2007/09/05 19:35:35 1.2 @@ -276,4 +276,4 @@ (completions (sort completion-set #'string<))) (list completions (longest-compound-prefix completions #\_)))) -(provide :swank-compound-prefix) \ No newline at end of file +(provide :swank-c-p-c) \ No newline at end of file From trittweiler at common-lisp.net Wed Sep 5 19:35:46 2007 From: trittweiler at common-lisp.net (trittweiler) Date: Wed, 5 Sep 2007 15:35:46 -0400 (EDT) Subject: [slime-cvs] CVS slime/contrib Message-ID: <20070905193546.58409450EE@common-lisp.net> Update of /project/slime/cvsroot/slime/contrib In directory clnet:/tmp/cvs-serv2456/contrib Modified Files: swank-arglists.lisp Log Message: * swank-c-p-c.el: This file incorrectly provided the module `:swank-compound-prefix'; changed that to `:swank-c-p-c'. This gets rid off the nasty redefinition warnings that were previously signalled when loading SWANK with SBCL. * swank-arglist.lisp (arglist-for-echo-area): Locally declare `*arglist-pprint-bindings*' to be special, as the variable is defined later in the file. (Gets rid of warnings during loading.) --- /project/slime/cvsroot/slime/contrib/swank-arglists.lisp 2007/09/05 18:48:49 1.8 +++ /project/slime/cvsroot/slime/contrib/swank-arglists.lisp 2007/09/05 19:35:46 1.9 @@ -56,11 +56,12 @@ (case type (:type-specifier (format nil "[Typespec] ~A" stringified-arglist)) (:declaration - (with-bindings *arglist-pprint-bindings* - (let ((op (%find-declaration-operator raw-specs position))) - (if op - (format nil "(~A ~A)" op stringified-arglist) - (format nil "[Declaration] ~A" stringified-arglist))))) + (locally (declare (special *arglist-pprint-bindings*)) + (with-bindings *arglist-pprint-bindings* + (let ((op (%find-declaration-operator raw-specs position))) + (if op + (format nil "(~A ~A)" op stringified-arglist) + (format nil "[Declaration] ~A" stringified-arglist)))))) (t stringified-arglist))))))) (mapc #'unintern-in-home-package newly-interned-symbols)))) (error (cond) From trittweiler at common-lisp.net Wed Sep 5 19:35:55 2007 From: trittweiler at common-lisp.net (trittweiler) Date: Wed, 5 Sep 2007 15:35:55 -0400 (EDT) Subject: [slime-cvs] CVS slime/contrib Message-ID: <20070905193555.3C8ED5B069@common-lisp.net> Update of /project/slime/cvsroot/slime/contrib In directory clnet:/tmp/cvs-serv2501/contrib Modified Files: ChangeLog Log Message: * swank-c-p-c.el: This file incorrectly provided the module `:swank-compound-prefix'; changed that to `:swank-c-p-c'. This gets rid off the nasty redefinition warnings that were previously signalled when loading SWANK with SBCL. * swank-arglist.lisp (arglist-for-echo-area): Locally declare `*arglist-pprint-bindings*' to be special, as the variable is defined later in the file. (Gets rid of warnings during loading.) --- /project/slime/cvsroot/slime/contrib/ChangeLog 2007/09/05 18:57:33 1.34 +++ /project/slime/cvsroot/slime/contrib/ChangeLog 2007/09/05 19:35:55 1.35 @@ -1,5 +1,17 @@ 2007-09-05 Tobias C. Rittweiler + * swank-c-p-c.el: This file incorrectly provided the module + `:swank-compound-prefix'; changed that to `:swank-c-p-c'. + + This gets rid off the nasty redefinition warnings that were + previously signalled when loading SWANK with SBCL. + + * swank-arglist.lisp (arglist-for-echo-area): Locally declare + `*arglist-pprint-bindings*' to be special, as the variable is + defined later in the file. (Gets rid of warnings during loading.) + +2007-09-05 Tobias C. Rittweiler + * slime-c-p-c.el (slime-c-p-c-init): Bind `slime-complete-form' to `C-c C-s' in `slime-repl-mode-map'. From mkoeppe at common-lisp.net Thu Sep 6 21:22:19 2007 From: mkoeppe at common-lisp.net (mkoeppe) Date: Thu, 6 Sep 2007 17:22:19 -0400 (EDT) Subject: [slime-cvs] CVS slime Message-ID: <20070906212219.A536913017@common-lisp.net> Update of /project/slime/cvsroot/slime In directory clnet:/tmp/cvs-serv16540 Modified Files: slime.el Log Message: (slime-repl-write-string): Use case, not ecase, for dispatching targets.Should fix XEmacs compatibility. Reported by Steven E. Harris. --- /project/slime/cvsroot/slime/slime.el 2007/09/05 12:02:24 1.850 +++ /project/slime/cvsroot/slime/slime.el 2007/09/06 21:22:19 1.851 @@ -2805,7 +2805,7 @@ (funcall slime-write-string-function string target)) (defun slime-repl-write-string (string &optional target) - (ecase target + (case target ((nil) ; Regular process output (with-current-buffer (slime-output-buffer) (slime-with-output-end-mark From mkoeppe at common-lisp.net Thu Sep 6 21:22:26 2007 From: mkoeppe at common-lisp.net (mkoeppe) Date: Thu, 6 Sep 2007 17:22:26 -0400 (EDT) Subject: [slime-cvs] CVS slime/contrib Message-ID: <20070906212226.AE4DF1B018@common-lisp.net> Update of /project/slime/cvsroot/slime/contrib In directory clnet:/tmp/cvs-serv16614/contrib Modified Files: slime-presentations.el Log Message: (slime-repl-write-string): Use case, not ecase, for dispatching targets.Should fix XEmacs compatibility. Reported by Steven E. Harris. --- /project/slime/cvsroot/slime/contrib/slime-presentations.el 2007/09/04 09:42:42 1.6 +++ /project/slime/cvsroot/slime/contrib/slime-presentations.el 2007/09/06 21:22:26 1.7 @@ -555,7 +555,7 @@ (t nil))) (defun slime-presentation-write (string &optional target) - (ecase target + (case target ((nil) ; Regular process output (with-current-buffer (slime-output-buffer) (slime-with-output-end-mark From mkoeppe at common-lisp.net Thu Sep 6 21:22:36 2007 From: mkoeppe at common-lisp.net (mkoeppe) Date: Thu, 6 Sep 2007 17:22:36 -0400 (EDT) Subject: [slime-cvs] CVS slime/contrib Message-ID: <20070906212236.45E342400D@common-lisp.net> Update of /project/slime/cvsroot/slime/contrib In directory clnet:/tmp/cvs-serv16720/contrib Modified Files: ChangeLog Log Message: --- /project/slime/cvsroot/slime/contrib/ChangeLog 2007/09/05 19:35:55 1.35 +++ /project/slime/cvsroot/slime/contrib/ChangeLog 2007/09/06 21:22:36 1.36 @@ -1,3 +1,9 @@ +2007-09-06 Matthias Koeppe + + * slime-presentations.el (slime-presentation-write): Use case, not + ecase, for dispatching targets. Should fix XEmacs compatibility. + Reported by Steven E. Harris. + 2007-09-05 Tobias C. Rittweiler * swank-c-p-c.el: This file incorrectly provided the module From mkoeppe at common-lisp.net Thu Sep 6 21:22:37 2007 From: mkoeppe at common-lisp.net (mkoeppe) Date: Thu, 6 Sep 2007 17:22:37 -0400 (EDT) Subject: [slime-cvs] CVS slime Message-ID: <20070906212237.9B1127B49D@common-lisp.net> Update of /project/slime/cvsroot/slime In directory clnet:/tmp/cvs-serv16720 Modified Files: ChangeLog Log Message: --- /project/slime/cvsroot/slime/ChangeLog 2007/09/05 12:02:24 1.1202 +++ /project/slime/cvsroot/slime/ChangeLog 2007/09/06 21:22:37 1.1203 @@ -1,3 +1,9 @@ +2007-09-06 Matthias Koeppe + + * slime.el (slime-repl-write-string): Use case, not ecase, for + dispatching targets.Should fix XEmacs compatibility. + Reported by Steven E. Harris. + 2007-09-05 Didier Verna * slime.el (slime-filename-translations): Fix custom type. From trittweiler at common-lisp.net Sat Sep 8 21:37:22 2007 From: trittweiler at common-lisp.net (trittweiler) Date: Sat, 8 Sep 2007 17:37:22 -0400 (EDT) Subject: [slime-cvs] CVS slime Message-ID: <20070908213722.1C20F5416D@common-lisp.net> Update of /project/slime/cvsroot/slime In directory clnet:/tmp/cvs-serv32756 Modified Files: swank-backend.lisp Log Message: * swank-backend.lisp (definterface): Updated docstring. --- /project/slime/cvsroot/slime/swank-backend.lisp 2007/09/04 10:32:05 1.124 +++ /project/slime/cvsroot/slime/swank-backend.lisp 2007/09/08 21:37:21 1.125 @@ -110,11 +110,15 @@ (defmacro definterface (name args documentation &rest default-body) "Define an interface function for the backend to implement. -A generic function is defined with NAME, ARGS, and DOCUMENTATION. - -If a DEFAULT-BODY is supplied then NO-APPLICABLE-METHOD is specialized -to execute the body if the backend doesn't provide a specific -implementation. +A function is defined with NAME, ARGS, and DOCUMENTATION. This +function first looks for a function to call in NAME's property list +that is indicated by 'IMPLEMENTATION; failing that, it looks for a +function indicated by 'DEFAULT. If neither is present, an error is +signaled. + +If a DEFAULT-BODY is supplied, then a function with the same body and +ARGS will be added to NAME's property list as the property indicated +by 'DEFAULT. Backends implement these functions using DEFIMPLEMENTATION." (check-type documentation string "a documentation string") From trittweiler at common-lisp.net Sat Sep 8 21:41:50 2007 From: trittweiler at common-lisp.net (trittweiler) Date: Sat, 8 Sep 2007 17:41:50 -0400 (EDT) Subject: [slime-cvs] CVS slime Message-ID: <20070908214150.9692968244@common-lisp.net> Update of /project/slime/cvsroot/slime In directory clnet:/tmp/cvs-serv2379 Modified Files: ChangeLog Log Message: * swank-backend.lisp (definterface): Updated docstring. --- /project/slime/cvsroot/slime/ChangeLog 2007/09/06 21:22:37 1.1203 +++ /project/slime/cvsroot/slime/ChangeLog 2007/09/08 21:41:50 1.1204 @@ -1,3 +1,7 @@ +2007-09-08 Matt Pillsbury + + * swank-backend.lisp (definterface): Updated docstring. + 2007-09-06 Matthias Koeppe * slime.el (slime-repl-write-string): Use case, not ecase, for From trittweiler at common-lisp.net Sat Sep 8 22:13:24 2007 From: trittweiler at common-lisp.net (trittweiler) Date: Sat, 8 Sep 2007 18:13:24 -0400 (EDT) Subject: [slime-cvs] CVS slime Message-ID: <20070908221324.E48A4100A@common-lisp.net> Update of /project/slime/cvsroot/slime In directory clnet:/tmp/cvs-serv10806 Modified Files: slime.el Log Message: Fix message displaying on XEmacs. Reported by Steven E. Harris, and Ken Causey. * slime.el (slime-display-message): Resurrect secondary `buffer-name' argument which got lost in 2007-08-24. (slime-format-display-message): Resurrect passing "*SLIME Note*" as default buffer-name to `slime-display-message'. --- /project/slime/cvsroot/slime/slime.el 2007/09/06 21:22:19 1.851 +++ /project/slime/cvsroot/slime/slime.el 2007/09/08 22:13:24 1.852 @@ -951,9 +951,9 @@ (setq slime-message-function 'slime-format-display-message)) (defun slime-format-display-message (format &rest args) - (slime-display-message (apply #'format format args))) + (slime-display-message (apply #'format format args) "*SLIME Note*")) -(defun slime-display-message (message) +(defun slime-display-message (message buffer-name) "Display MESSAGE in the echo area or in BUFFER-NAME. Use the echo area if MESSAGE needs only a single line. If the MESSAGE requires more than one line display it in BUFFER-NAME and add a hook From trittweiler at common-lisp.net Sat Sep 8 22:13:54 2007 From: trittweiler at common-lisp.net (trittweiler) Date: Sat, 8 Sep 2007 18:13:54 -0400 (EDT) Subject: [slime-cvs] CVS slime Message-ID: <20070908221354.61DF870E0@common-lisp.net> Update of /project/slime/cvsroot/slime In directory clnet:/tmp/cvs-serv10852 Modified Files: ChangeLog Log Message: Fix message displaying on XEmacs. Reported by Steven E. Harris, and Ken Causey. * slime.el (slime-display-message): Resurrect secondary `buffer-name' argument which got lost in 2007-08-24. (slime-format-display-message): Resurrect passing "*SLIME Note*" as default buffer-name to `slime-display-message'. --- /project/slime/cvsroot/slime/ChangeLog 2007/09/08 21:41:50 1.1204 +++ /project/slime/cvsroot/slime/ChangeLog 2007/09/08 22:13:54 1.1205 @@ -1,4 +1,14 @@ -2007-09-08 Matt Pillsbury +2007-09-08 Tobias C. Rittweiler + + Fix message displaying on XEmacs. Reported by Steven E. Harris, + and Ken Causey. + + * slime.el (slime-display-message): Resurrect secondary + `buffer-name' argument which got lost in 2007-08-24. + (slime-format-display-message): Resurrect passing "*SLIME Note*" + as default buffer-name to `slime-display-message'. + +2007-09-08 Matt Pillsbury * swank-backend.lisp (definterface): Updated docstring. @@ -17,7 +27,7 @@ * slime.el (slime-toggle-trace-fdefinition): Fix typo. The argument for interactive should be "P" not "p". -2007-09-04 Mark Evenson +2007-09-04 Mark Evenson * swank-abcl.lisp: Call accessors of compiler-condition at load time to work around some ABCL problems. From trittweiler at common-lisp.net Sat Sep 8 22:23:46 2007 From: trittweiler at common-lisp.net (trittweiler) Date: Sat, 8 Sep 2007 18:23:46 -0400 (EDT) Subject: [slime-cvs] CVS slime/contrib Message-ID: <20070908222346.DBCE21C0BD@common-lisp.net> Update of /project/slime/cvsroot/slime/contrib In directory clnet:/tmp/cvs-serv14278/contrib Modified Files: slime-banner.el Log Message: * slime-banner.el: Fixed typo to provide `slime-banner', not `slime-startup-animation'. --- /project/slime/cvsroot/slime/contrib/slime-banner.el 2007/09/04 10:18:44 1.2 +++ /project/slime/cvsroot/slime/contrib/slime-banner.el 2007/09/08 22:23:46 1.3 @@ -37,4 +37,4 @@ (setq slime-repl-banner-function 'slime-startup-message) -(provide 'slime-startup-animation) +(provide 'slime-banner) From trittweiler at common-lisp.net Sat Sep 8 22:23:55 2007 From: trittweiler at common-lisp.net (trittweiler) Date: Sat, 8 Sep 2007 18:23:55 -0400 (EDT) Subject: [slime-cvs] CVS slime/contrib Message-ID: <20070908222355.92B521D110@common-lisp.net> Update of /project/slime/cvsroot/slime/contrib In directory clnet:/tmp/cvs-serv14339/contrib Modified Files: ChangeLog Log Message: * slime-banner.el: Fixed typo to provide `slime-banner', not `slime-startup-animation'. --- /project/slime/cvsroot/slime/contrib/ChangeLog 2007/09/06 21:22:36 1.36 +++ /project/slime/cvsroot/slime/contrib/ChangeLog 2007/09/08 22:23:55 1.37 @@ -1,3 +1,8 @@ +2007-09-08 Stelian Ionescu + + * slime-banner.el: Fixed typo to provide `slime-banner', not + `slime-startup-animation'. + 2007-09-06 Matthias Koeppe * slime-presentations.el (slime-presentation-write): Use case, not From trittweiler at common-lisp.net Sat Sep 8 22:43:45 2007 From: trittweiler at common-lisp.net (trittweiler) Date: Sat, 8 Sep 2007 18:43:45 -0400 (EDT) Subject: [slime-cvs] CVS slime Message-ID: <20070908224345.393114E03D@common-lisp.net> Update of /project/slime/cvsroot/slime In directory clnet:/tmp/cvs-serv20316 Modified Files: slime.el Log Message: * slime.el (save-restriction-if-possible): Place macro definition above use of the macro, to regain ability to byte-compile-file. --- /project/slime/cvsroot/slime/slime.el 2007/09/08 22:13:24 1.852 +++ /project/slime/cvsroot/slime/slime.el 2007/09/08 22:43:45 1.853 @@ -1155,6 +1155,39 @@ until (eq window last-window))) +(defmacro save-restriction-if-possible (&rest body) + "Very similiarly to `save-restriction'. The only difference is +that it's not enforcing the restriction as strictly: It's only +enforced if `point' was not moved outside of the restriction +after executing BODY. + +Example: + + (progn (goto-line 1000) + (narrow-to-page) + (save-restriction-if-possible (widen) (goto-line 999))) + + In this case, the buffer is narrowed to the current page, and + point is on line 999. + + (progn (goto-char 1000) + (narrow-to-page) + (save-restriction-if-possible (widen) (goto-line 1))) + + Whereas in this case, the buffer is widened and point is on + line 1." + (let ((gcfg (gensym "NARROWING-CFG+")) + (gbeg (gensym "OLDBEG+")) + (gend (gensym "OLDEND+"))) + `(let ((,gcfg (slime-current-narrowing-configuration))) + (unwind-protect (progn , at body) + (let ((,gbeg (slime-narrowing-configuration.beg ,gcfg)) + (,gend (slime-narrowing-configuration.end ,gcfg))) + (when (and (>= (point) ,gbeg) (<= (point) ,gend)) + (slime-set-narrowing-configuration ,gcfg))))))) + +(put 'save-restriction-if-possible 'lisp-indent-function 0) + ;;;;; Temporary popup buffers (make-variable-buffer-local @@ -8998,39 +9031,6 @@ (total (buffer-size))) (or (/= beg 1) (/= end (1+ total)))))) -(defmacro save-restriction-if-possible (&rest body) - "Very similiarly to `save-restriction'. The only difference is -that it's not enforcing the restriction as strictly: It's only -enforced if `point' was not moved outside of the restriction -after executing BODY. - -Example: - - (progn (goto-line 1000) - (narrow-to-page) - (save-restriction-if-possible (widen) (goto-line 999))) - - In this case, the buffer is narrowed to the current page, and - point is on line 999. - - (progn (goto-char 1000) - (narrow-to-page) - (save-restriction-if-possible (widen) (goto-line 1))) - - Whereas in this case, the buffer is widened and point is on - line 1." - (let ((gcfg (gensym "NARROWING-CFG+")) - (gbeg (gensym "OLDBEG+")) - (gend (gensym "OLDEND+"))) - `(let ((,gcfg (slime-current-narrowing-configuration))) - (unwind-protect (progn , at body) - (let ((,gbeg (slime-narrowing-configuration.beg ,gcfg)) - (,gend (slime-narrowing-configuration.end ,gcfg))) - (when (and (>= (point) ,gbeg) (<= (point) ,gend)) - (slime-set-narrowing-configuration ,gcfg))))))) - -(put 'save-restriction-if-possible 'lisp-indent-function 0) - ;;;;; Extracting Lisp forms from the buffer or user From trittweiler at common-lisp.net Sat Sep 8 22:46:35 2007 From: trittweiler at common-lisp.net (trittweiler) Date: Sat, 8 Sep 2007 18:46:35 -0400 (EDT) Subject: [slime-cvs] CVS slime Message-ID: <20070908224635.21AC74E03D@common-lisp.net> Update of /project/slime/cvsroot/slime In directory clnet:/tmp/cvs-serv20773 Modified Files: ChangeLog Log Message: * slime.el (save-restriction-if-possible): Place macro definition above use of the macro, to regain ability to byte-compile-file. --- /project/slime/cvsroot/slime/ChangeLog 2007/09/08 22:13:54 1.1205 +++ /project/slime/cvsroot/slime/ChangeLog 2007/09/08 22:46:34 1.1206 @@ -1,3 +1,8 @@ +2007-09-08 Stelian Ionescu + + * slime.el (save-restriction-if-possible): Place macro definition + above use of the macro, to regain ability to byte-compile-file. + 2007-09-08 Tobias C. Rittweiler Fix message displaying on XEmacs. Reported by Steven E. Harris, From trittweiler at common-lisp.net Sun Sep 9 23:28:28 2007 From: trittweiler at common-lisp.net (trittweiler) Date: Sun, 9 Sep 2007 19:28:28 -0400 (EDT) Subject: [slime-cvs] CVS slime Message-ID: <20070909232828.3E36225002@common-lisp.net> Update of /project/slime/cvsroot/slime In directory clnet:/tmp/cvs-serv31649 Modified Files: slime.el Log Message: When working on multiple source trees simultaneously, the way `slime-edit-definition' (M-.) works can sometimes be confusing: `M-.' visits locations that are present in the current Lisp image, which works perfectly well as long as the image reflects the source tree that one is currently looking at. In the other case, however, one can easily end up visiting a file in a different source root directory (the one corresponding to the Lisp image), and is thus easily tricked to modify the wrong source files---which can lead to quite some stressfull cursing. If the variable `slime-warn-when-possibly-tricked-by-M-.' is T (the default), a warning message is issued to raise the user's attention whenever `M-.' is about opening a file in a different source root that also exists in the source root directory of the user's _current buffer_. There's no guarantee that all possible cases are covered, but if you encounter such a warning, it's a strong indication that you should check twice before modifying. * slime.el (slime-file-name-merge-source-root): New function. (slime-highlight-differences-in-dirname): New function. (slime-maybe-warn-for-different-source-root): New function. (slime-warn-when-possibly-tricked-by-M-.): New variable (T by default.) (slime-goto-location-buffer): Where appropriate, call `slime-maybe-warn-for-different-source-root' --- /project/slime/cvsroot/slime/slime.el 2007/09/08 22:43:45 1.853 +++ /project/slime/cvsroot/slime/slime.el 2007/09/09 23:28:27 1.854 @@ -4575,33 +4575,130 @@ (beginning-of-sexp)) (error (goto-char origin))))) + +(defun slime-file-name-merge-source-root (target-filename buffer-filename) + "Returns a filename where the source root directory of TARGET-FILENAME +is replaced with the source root directory of BUFFER-FILENAME. + +E.g. (slime-file-name-merge-source-root + \"/usr/local/src/joe/upstream/sbcl/code/late-extensions.lisp\" + \"/usr/local/src/joe/hacked/sbcl/compiler/deftype.lisp\") + + ==> \"/usr/local/src/joe/hacked/sbcl/code/late-extensions.lisp\" +" + (let ((target-dirs (split-string (file-name-directory target-filename) "/" t)) + (buffer-dirs (split-string (file-name-directory buffer-filename) "/" t))) + ;; Starting from the end, we look if one of the TARGET-DIRS exists + ;; in BUFFER-FILENAME---if so, it and everything left from that dirname + ;; is considered to be the source root directory of BUFFER-FILENAME. + (loop with target-suffix-dirs = nil + with buffer-dirs* = (reverse buffer-dirs) + with target-dirs* = (reverse target-dirs) + for target-dir in target-dirs* + do (flet ((concat-dirs (dirs) + (apply #'concat (mapcar #'file-name-as-directory dirs)))) + (let ((pos (position target-dir buffer-dirs* :test #'equal))) + (if (not pos) ; TARGET-DIR not in BUFFER-FILENAME? + (push target-dir target-suffix-dirs) + (let* ((target-suffix (concat-dirs target-suffix-dirs)) ; PUSH reversed for us! + (buffer-root (concat-dirs (reverse (nthcdr pos buffer-dirs*))))) + (return (concat (file-name-as-directory "/") + buffer-root + target-suffix + (file-name-nondirectory target-filename)))))))))) + +(defun slime-highlight-differences-in-dirname (base-dirname contrast-dirname) + "Returns a copy of BASE-DIRNAME where all differences between +BASE-DIRNAME and CONTRAST-DIRNAME are propertized with a +highlighting face." + (flet ((insert-dir (dirname) + (insert (file-name-as-directory dirname))) + (insert-dir/propzd (dirname) + (slime-insert-propertized '(face highlight) dirname) + (insert "/"))) ; Not exactly portable (to VMS...) + (let ((base-dirs (split-string (file-name-as-directory base-dirname) "/" t)) + (contrast-dirs (split-string (file-name-as-directory contrast-dirname) "/" t))) + (with-temp-buffer + (loop initially (insert (file-name-as-directory "/")) + for base-dir in base-dirs do + (let ((pos (position base-dir contrast-dirs :test #'equal))) + (if (not pos) + (insert-dir/propzd base-dir) + (progn (insert-dir base-dir) + (setq contrast-dirs (nthcdr (1+ pos) contrast-dirs)))))) + (buffer-substring (point-min) (point-max)))))) + +(defvar slime-warn-when-possibly-tricked-by-M-. t + "When working on multiple source trees simultaneously, the way +`slime-edit-definition' (M-.) works can sometimes be confusing: + +`M-.' visits locations that are present in the current Lisp image, +which works perfectly well as long as the image reflects the source +tree that one is currently looking at. + +In the other case, however, one can easily end up visiting a file +in a different source root directory (the one corresponding to +the Lisp image), and is thus easily tricked to modify the wrong +source files---which can lead to quite some stressfull cursing. + +If this variable is T, a warning message is issued to raise the +user's attention whenever `M-.' is about opening a file in a +different source root that also exists in the source root +directory of the user's current buffer. + +There's no guarantee that all possible cases are covered, but +if you encounter such a warning, it's a strong indication that +you should check twice before modifying.") + +(defun slime-maybe-warn-for-different-source-root (target-filename buffer-filename) + (when slime-warn-when-possibly-tricked-by-M-. + (let ((guessed-target (slime-file-name-merge-source-root target-filename + buffer-filename))) + (when (and (not (equal guessed-target target-filename)) + (or t (file-exists-p guessed-target))) + (slime-message "Attention: This is `%s'." + (concat (slime-highlight-differences-in-dirname + (file-name-directory target-filename) + (file-name-directory guessed-target)) + (file-name-nondirectory target-filename))))))) + + (defun slime-goto-location-buffer (buffer) - (destructure-case buffer - ((:file filename) - (let ((emacs-filename (slime-from-lisp-filename filename))) - (unless (and (buffer-file-name) - (string= (buffer-file-name) emacs-filename)) - (set-buffer (find-file-noselect emacs-filename t)))) - (goto-char (point-min))) - ((:buffer buffer) - (set-buffer buffer) - (goto-char (point-min))) - ((:source-form string) - (set-buffer (get-buffer-create "*SLIME Source Form*")) - (erase-buffer) - (lisp-mode) - (insert string) - (goto-char (point-min))) - ((:zip file entry) - (require 'arc-mode) - (set-buffer (find-file-noselect file t)) - (goto-char (point-min)) - (re-search-forward (concat " " entry "$")) - (let ((buffer (save-window-excursion - (archive-extract) - (current-buffer)))) - (set-buffer buffer) - (goto-char (point-min)))))) + (flet ((file-truename-safe (filename) (and filename (file-truename filename)))) + (destructure-case buffer + ((:file filename) + (let ((target-filename (file-truename-safe (slime-from-lisp-filename filename))) + (buffer-filename (file-truename-safe (buffer-file-name)))) + (when buffer-filename + (slime-maybe-warn-for-different-source-root target-filename buffer-filename)) + (unless (and buffer-filename (string= buffer-filename target-filename)) + (set-buffer (find-file-noselect target-filename t)))) + (goto-char (point-min))) + ((:buffer buffer-name) + (let ((old-buffer-filename (file-truename-safe (buffer-file-name))) + (target-buffer-filename (file-truename-safe + (buffer-file-name (get-buffer buffer-name))))) + (when (and target-buffer-filename old-buffer-filename) + (slime-maybe-warn-for-different-source-root target-buffer-filename + old-buffer-filename))) + (set-buffer buffer-name) + (goto-char (point-min))) + ((:source-form string) + (set-buffer (get-buffer-create "*SLIME Source Form*")) + (erase-buffer) + (lisp-mode) + (insert string) + (goto-char (point-min))) + ((:zip file entry) + (require 'arc-mode) + (set-buffer (find-file-noselect file t)) + (goto-char (point-min)) + (re-search-forward (concat " " entry "$")) + (let ((buffer (save-window-excursion + (archive-extract) + (current-buffer)))) + (set-buffer buffer) + (goto-char (point-min))))))) (defun slime-goto-location-position (position) (save-restriction-if-possible ; try to keep restriction if possible. From trittweiler at common-lisp.net Sun Sep 9 23:29:08 2007 From: trittweiler at common-lisp.net (trittweiler) Date: Sun, 9 Sep 2007 19:29:08 -0400 (EDT) Subject: [slime-cvs] CVS slime Message-ID: <20070909232908.B25632B129@common-lisp.net> Update of /project/slime/cvsroot/slime In directory clnet:/tmp/cvs-serv31702 Modified Files: ChangeLog Log Message: When working on multiple source trees simultaneously, the way `slime-edit-definition' (M-.) works can sometimes be confusing: `M-.' visits locations that are present in the current Lisp image, which works perfectly well as long as the image reflects the source tree that one is currently looking at. In the other case, however, one can easily end up visiting a file in a different source root directory (the one corresponding to the Lisp image), and is thus easily tricked to modify the wrong source files---which can lead to quite some stressfull cursing. If the variable `slime-warn-when-possibly-tricked-by-M-.' is T (the default), a warning message is issued to raise the user's attention whenever `M-.' is about opening a file in a different source root that also exists in the source root directory of the user's _current buffer_. There's no guarantee that all possible cases are covered, but if you encounter such a warning, it's a strong indication that you should check twice before modifying. * slime.el (slime-file-name-merge-source-root): New function. (slime-highlight-differences-in-dirname): New function. (slime-maybe-warn-for-different-source-root): New function. (slime-warn-when-possibly-tricked-by-M-.): New variable (T by default.) (slime-goto-location-buffer): Where appropriate, call `slime-maybe-warn-for-different-source-root' --- /project/slime/cvsroot/slime/ChangeLog 2007/09/08 22:46:34 1.1206 +++ /project/slime/cvsroot/slime/ChangeLog 2007/09/09 23:29:08 1.1207 @@ -1,3 +1,34 @@ +2007-09-10 Tobias C. Rittweiler + + When working on multiple source trees simultaneously, the way + `slime-edit-definition' (M-.) works can sometimes be confusing: + + `M-.' visits locations that are present in the current Lisp image, + which works perfectly well as long as the image reflects the + source tree that one is currently looking at. + + In the other case, however, one can easily end up visiting a file + in a different source root directory (the one corresponding to the + Lisp image), and is thus easily tricked to modify the wrong source + files---which can lead to quite some stressfull cursing. + + If the variable `slime-warn-when-possibly-tricked-by-M-.' is + T (the default), a warning message is issued to raise the user's + attention whenever `M-.' is about opening a file in a different + source root that also exists in the source root directory of the + user's _current buffer_. + + There's no guarantee that all possible cases are covered, but if + you encounter such a warning, it's a strong indication that you + should check twice before modifying. + + * slime.el (slime-file-name-merge-source-root): New function. + (slime-highlight-differences-in-dirname): New function. + (slime-maybe-warn-for-different-source-root): New function. + (slime-warn-when-possibly-tricked-by-M-.): New variable (T by default.) + (slime-goto-location-buffer): Where appropriate, call + `slime-maybe-warn-for-different-source-root' + 2007-09-08 Stelian Ionescu * slime.el (save-restriction-if-possible): Place macro definition From trittweiler at common-lisp.net Mon Sep 10 00:42:25 2007 From: trittweiler at common-lisp.net (trittweiler) Date: Sun, 9 Sep 2007 20:42:25 -0400 (EDT) Subject: [slime-cvs] CVS slime Message-ID: <20070910004225.5D57AA141@common-lisp.net> Update of /project/slime/cvsroot/slime In directory clnet:/tmp/cvs-serv12286 Modified Files: slime.el Log Message: * slime.el (slime-cl-symbol-name, slime-cl-symbol-package): Ressurected, as they're still used in this file. Reported by Edward Cant. --- /project/slime/cvsroot/slime/slime.el 2007/09/09 23:28:27 1.854 +++ /project/slime/cvsroot/slime/slime.el 2007/09/10 00:42:25 1.855 @@ -9206,6 +9206,24 @@ (or (slime-sexp-at-point) (error "No expression at point."))) +;;;;; Common Lisp-style package-qualified symbols + +(defun slime-cl-symbol-name (symbol) + (let ((n (if (stringp symbol) symbol (symbol-name symbol)))) + (if (string-match ":\\([^:]*\\)$" n) + (let ((symbol-part (match-string 1 n))) + (if (string-match "^|\\(.*\\)|$" symbol-part) + (match-string 1 symbol-part) + symbol-part)) + n))) + +(defun slime-cl-symbol-package (symbol &optional default) + (let ((n (if (stringp symbol) symbol (symbol-name symbol)))) + (if (string-match "^\\([^:]*\\):" n) + (match-string 1 n) + default))) + + ;;;; Portability library (when (featurep 'xemacs) From trittweiler at common-lisp.net Mon Sep 10 00:42:57 2007 From: trittweiler at common-lisp.net (trittweiler) Date: Sun, 9 Sep 2007 20:42:57 -0400 (EDT) Subject: [slime-cvs] CVS slime Message-ID: <20070910004257.28F55A16A@common-lisp.net> Update of /project/slime/cvsroot/slime In directory clnet:/tmp/cvs-serv12345 Modified Files: ChangeLog Log Message: * slime.el (slime-cl-symbol-name, slime-cl-symbol-package): Ressurected, as they're still used in this file. Reported by Edward Cant. --- /project/slime/cvsroot/slime/ChangeLog 2007/09/09 23:29:08 1.1207 +++ /project/slime/cvsroot/slime/ChangeLog 2007/09/10 00:42:56 1.1208 @@ -1,5 +1,11 @@ 2007-09-10 Tobias C. Rittweiler + * slime.el (slime-cl-symbol-name, slime-cl-symbol-package): + Ressurected, as they're still used in this file. + Reported by Edward Cant. + +2007-09-10 Tobias C. Rittweiler + When working on multiple source trees simultaneously, the way `slime-edit-definition' (M-.) works can sometimes be confusing: From trittweiler at common-lisp.net Mon Sep 10 00:43:18 2007 From: trittweiler at common-lisp.net (trittweiler) Date: Sun, 9 Sep 2007 20:43:18 -0400 (EDT) Subject: [slime-cvs] CVS slime/contrib Message-ID: <20070910004318.7FDEC1703E@common-lisp.net> Update of /project/slime/cvsroot/slime/contrib In directory clnet:/tmp/cvs-serv12404/contrib Modified Files: slime-parse.el Log Message: * slime-parse.el (slime-cl-symbol-name, slime-cl-symbol-package): Moved back into slime.el. --- /project/slime/cvsroot/slime/contrib/slime-parse.el 2007/09/05 18:49:00 1.3 +++ /project/slime/cvsroot/slime/contrib/slime-parse.el 2007/09/10 00:43:18 1.4 @@ -25,23 +25,6 @@ (slime-parse-sexp-at-point (1+ (first arg-indices))))))))))) -;;;;; Common Lisp-style package-qualified symbols - -(defun slime-cl-symbol-name (symbol) - (let ((n (if (stringp symbol) symbol (symbol-name symbol)))) - (if (string-match ":\\([^:]*\\)$" n) - (let ((symbol-part (match-string 1 n))) - (if (string-match "^|\\(.*\\)|$" symbol-part) - (match-string 1 symbol-part) - symbol-part)) - n))) - -(defun slime-cl-symbol-package (symbol &optional default) - (let ((n (if (stringp symbol) symbol (symbol-name symbol)))) - (if (string-match "^\\([^:]*\\):" n) - (match-string 1 n) - default))) - ;; XXX: unused function (defun slime-cl-symbol-external-ref-p (symbol) "Does SYMBOL refer to an external symbol? From trittweiler at common-lisp.net Mon Sep 10 00:43:28 2007 From: trittweiler at common-lisp.net (trittweiler) Date: Sun, 9 Sep 2007 20:43:28 -0400 (EDT) Subject: [slime-cvs] CVS slime/contrib Message-ID: <20070910004328.F07AB1B01B@common-lisp.net> Update of /project/slime/cvsroot/slime/contrib In directory clnet:/tmp/cvs-serv12432/contrib Modified Files: ChangeLog Log Message: * slime-parse.el (slime-cl-symbol-name, slime-cl-symbol-package): Moved back into slime.el. --- /project/slime/cvsroot/slime/contrib/ChangeLog 2007/09/08 22:23:55 1.37 +++ /project/slime/cvsroot/slime/contrib/ChangeLog 2007/09/10 00:43:28 1.38 @@ -1,3 +1,8 @@ +2007-09-10 Tobias C. Rittweiler + + * slime-parse.el (slime-cl-symbol-name, slime-cl-symbol-package): + Moved back into slime.el. + 2007-09-08 Stelian Ionescu * slime-banner.el: Fixed typo to provide `slime-banner', not From trittweiler at common-lisp.net Mon Sep 10 11:01:02 2007 From: trittweiler at common-lisp.net (trittweiler) Date: Mon, 10 Sep 2007 07:01:02 -0400 (EDT) Subject: [slime-cvs] CVS slime/contrib Message-ID: <20070910110102.0A0422F04A@common-lisp.net> Update of /project/slime/cvsroot/slime/contrib In directory clnet:/tmp/cvs-serv25238/contrib Modified Files: slime-fuzzy.el Log Message: * slime-fuzzy.el: Fixed some race condition that prevented a proper closing of the *Fuzzy Completions* buffer in some circumstances. (slime-fuzzy-save-window-configuration): Removed. Hooking up `window-configuration-change-hook' via `run-with-timer' was racy and lead to this bug; we now set the hook explicitely at the necessary place instead. (slime-fuzzy-window-configuration-change-add-hook): Removed. (slime-fuzzy-choices-buffer): Explicitly save the window-configuration, and explicitly set the hook. (slime-fuzzy-done): Explicitely remove the hook. --- /project/slime/cvsroot/slime/contrib/slime-fuzzy.el 2007/08/23 12:58:52 1.2 +++ /project/slime/cvsroot/slime/contrib/slime-fuzzy.el 2007/09/10 11:01:01 1.3 @@ -1,6 +1,10 @@ ;;; slime-fuzzy.el --- fuzzy symbol completion ;; -;; Author: Brian Downing and others +;; Authors: Brian Downing +;; Tobias C. Rittweiler +;; Attila Lendvai +;; and others +;; ;; License: GNU GPL (same license as Emacs) ;; ;;; Installation @@ -346,7 +350,8 @@ done." (let ((new-completion-buffer (not slime-fuzzy-target-buffer))) (when new-completion-buffer - (slime-fuzzy-save-window-configuration)) + (setq slime-fuzzy-saved-window-configuration + (current-window-configuration))) (slime-fuzzy-enable-target-buffer-completions-mode) (setq slime-fuzzy-target-buffer (current-buffer)) (setq slime-fuzzy-start (move-marker (make-marker) start)) @@ -357,6 +362,11 @@ (slime-fuzzy-fill-completions-buffer completions interrupted-p) (pop-to-buffer (slime-get-fuzzy-buffer)) (when new-completion-buffer + ;; Hook to nullify window-config restoration if the user changes + ;; the window configuration himself. + (when (boundp 'window-configuration-change-hook) + (add-hook 'window-configuration-change-hook + 'slime-fuzzy-window-configuration-change)) (add-local-hook 'kill-buffer-hook 'slime-fuzzy-abort) (setq buffer-quit-function 'slime-fuzzy-abort)) ; M-Esc Esc (when slime-fuzzy-completion-in-place @@ -551,20 +561,9 @@ (bury-buffer)) (pop-to-buffer slime-fuzzy-target-buffer) (goto-char slime-fuzzy-end) - (setq slime-fuzzy-target-buffer nil))) - -(defun slime-fuzzy-save-window-configuration () - "Saves the current window configuration, and (if the -window-configuration-change-hook variable exists) sets up for the -saved configuration to be nullified if the user changes the -window configuration further. Adding the nullification routine -to window-configuration-change-hook is delayed so that the -windows stabalize before we start listening on the hook." - (setq slime-fuzzy-saved-window-configuration - (current-window-configuration)) - (when (boundp 'window-configuration-change-hook) - (run-with-timer - 0.5 nil 'slime-fuzzy-window-configuration-change-add-hook))) + (setq slime-fuzzy-target-buffer nil) + (remove-hook 'window-configuration-change-hook + 'slime-fuzzy-window-configuration-change))) (defun slime-fuzzy-maybe-restore-window-configuration () "Restores the saved window configuration if it has not been @@ -578,17 +577,9 @@ (setq slime-fuzzy-saved-window-configuration nil) t)) -(defun slime-fuzzy-window-configuration-change-add-hook () - "Sets up slime-fuzzy-window-configuration-change on -window-configuration-change-hook." - (add-hook 'window-configuration-change-hook - 'slime-fuzzy-window-configuration-change)) - (defun slime-fuzzy-window-configuration-change () "Called on window-configuration-change-hook. Since the window configuration was changed, we nullify our saved configuration." - (remove-hook 'window-configuration-change-hook - 'slime-fuzzy-window-configuration-change) (setq slime-fuzzy-saved-window-configuration nil)) ;;; Initialization From trittweiler at common-lisp.net Mon Sep 10 11:01:09 2007 From: trittweiler at common-lisp.net (trittweiler) Date: Mon, 10 Sep 2007 07:01:09 -0400 (EDT) Subject: [slime-cvs] CVS slime/contrib Message-ID: <20070910110109.C0AA25310C@common-lisp.net> Update of /project/slime/cvsroot/slime/contrib In directory clnet:/tmp/cvs-serv25264/contrib Modified Files: ChangeLog Log Message: * slime-fuzzy.el: Fixed some race condition that prevented a proper closing of the *Fuzzy Completions* buffer in some circumstances. (slime-fuzzy-save-window-configuration): Removed. Hooking up `window-configuration-change-hook' via `run-with-timer' was racy and lead to this bug; we now set the hook explicitely at the necessary place instead. (slime-fuzzy-window-configuration-change-add-hook): Removed. (slime-fuzzy-choices-buffer): Explicitly save the window-configuration, and explicitly set the hook. (slime-fuzzy-done): Explicitely remove the hook. --- /project/slime/cvsroot/slime/contrib/ChangeLog 2007/09/10 00:43:28 1.38 +++ /project/slime/cvsroot/slime/contrib/ChangeLog 2007/09/10 11:01:09 1.39 @@ -1,3 +1,18 @@ +2007-09-10 Attila Lendvai + + * slime-fuzzy.el: Fixed some race condition that prevented a + proper closing of the *Fuzzy Completions* buffer in some + circumstances. + + (slime-fuzzy-save-window-configuration): Removed. Hooking up + `window-configuration-change-hook' via `run-with-timer' was racy + and lead to this bug; we now set the hook explicitely at the + necessary place instead. + (slime-fuzzy-window-configuration-change-add-hook): Removed. + (slime-fuzzy-choices-buffer): Explicitly save the + window-configuration, and explicitly set the hook. + (slime-fuzzy-done): Explicitely remove the hook. + 2007-09-10 Tobias C. Rittweiler * slime-parse.el (slime-cl-symbol-name, slime-cl-symbol-package): From heller at common-lisp.net Mon Sep 10 15:39:05 2007 From: heller at common-lisp.net (heller) Date: Mon, 10 Sep 2007 11:39:05 -0400 (EDT) Subject: [slime-cvs] CVS slime Message-ID: <20070910153905.95B551C0BD@common-lisp.net> Update of /project/slime/cvsroot/slime In directory clnet:/tmp/cvs-serv18471 Modified Files: ChangeLog slime.el swank.lisp swank-backend.lisp swank-allegro.lisp swank-sbcl.lisp Log Message: 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. --- /project/slime/cvsroot/slime/ChangeLog 2007/09/10 00:42:56 1.1208 +++ /project/slime/cvsroot/slime/ChangeLog 2007/09/10 15:39:04 1.1209 @@ -1,3 +1,20 @@ +2007-09-10 Helmut Eller + + Move SBCL doc references to contrib. + + * slime.el (sldb-insert-condition): Merge REFERENCES and EXTRAS. + (sldb-extras-hooks, sldb-dispatch-extras): New hook. + + * 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. + 2007-09-10 Tobias C. Rittweiler * slime.el (slime-cl-symbol-name, slime-cl-symbol-package): @@ -44,7 +61,7 @@ Fix message displaying on XEmacs. Reported by Steven E. Harris, and Ken Causey. - + * slime.el (slime-display-message): Resurrect secondary `buffer-name' argument which got lost in 2007-08-24. (slime-format-display-message): Resurrect passing "*SLIME Note*" @@ -53,7 +70,7 @@ 2007-09-08 Matt Pillsbury * swank-backend.lisp (definterface): Updated docstring. - + 2007-09-06 Matthias Koeppe * slime.el (slime-repl-write-string): Use case, not ecase, for --- /project/slime/cvsroot/slime/slime.el 2007/09/10 00:42:25 1.855 +++ /project/slime/cvsroot/slime/slime.el 2007/09/10 15:39:05 1.856 @@ -387,8 +387,7 @@ "function names and arguments in a detailed (expanded) frame") (local-name "local variable names") (local-value "local variable values") - (catch-tag "catch tags") - (reference "documentation references" '(:underline t))) + (catch-tag "catch tags")) ;;;;; slime-repl @@ -4155,12 +4154,10 @@ "Merge NOTES together. Keep the highest severity, concatenate the messages." (let* ((new-severity (reduce #'slime-most-severe notes :key #'slime-note.severity)) - (new-message (mapconcat #'slime-note.short-message notes "\n")) - (new-references (reduce #'append notes :key #'slime-note.references))) + (new-message (mapconcat #'slime-note.short-message notes "\n"))) (let ((new-note (copy-list (car notes)))) (setf (getf new-note :message) new-message) (setf (getf new-note :severity) new-severity) - (setf (getf new-note :references) new-references) new-note))) ;; XXX: unused function @@ -4204,8 +4201,8 @@ (defun slime-maybe-list-compiler-notes (notes &optional emacs-snapshot) "Show the compiler notes if appropriate." - ;; don't pop up a buffer if all notes will are already annotated in - ;; the buffer itself + ;; don't pop up a buffer if all notes are already annotated in the + ;; buffer itself (unless (every #'slime-note-has-location-p notes) (slime-list-compiler-notes notes emacs-snapshot))) @@ -4228,8 +4225,8 @@ (goto-char (point-min))))) (defun slime-alistify (list key test) - "Partition the elements of LIST into an alist. KEY extracts the key -from an element and TEST is used to compare keys." + "Partition the elements of LIST into an alist. +KEY extracts the key from an element and TEST is used to compare keys." (declare (type function key)) (let ((alist '())) (dolist (e list) @@ -4252,9 +4249,6 @@ (or (plist-get note :short-message) (plist-get note :message))) -(defun slime-note.references (note) - (plist-get note :references)) - (defun slime-note.location (note) (plist-get note :location)) @@ -4266,12 +4260,12 @@ (:read-error "Read Errors") (:style-warning "Style Warnings"))) +(defvar slime-tree-printer 'slime-tree-default-printer) + (defun slime-tree-for-note (note) (make-slime-tree :item (slime-note.message note) :plist (list 'note note) - :print-fn (if (slime-note.references note) - 'slime-tree-print-with-references - 'slime-tree-default-printer))) + :print-fn slime-tree-printer)) (defun slime-tree-for-severity (severity notes collapsed-p) (make-slime-tree :item (format "%s (%d)" @@ -4345,35 +4339,6 @@ (defun slime-tree-default-printer (tree) (princ (slime-tree.item tree) (current-buffer))) -(defun slime-tree-print-with-references (tree) - ;; for SBCL-style references - (slime-tree-default-printer tree) - (when-let (note (plist-get (slime-tree.plist tree) 'note)) - (when-let (references (slime-note.references note)) - (terpri (current-buffer)) - (princ "See also:" (current-buffer)) - (terpri (current-buffer)) - (slime-tree-insert-references references)))) - -(defun slime-tree-insert-references (references) - "Insert documentation references from a condition. -See SWANK-BACKEND:CONDITION-REFERENCES for the datatype." - (loop for refs on references - for ref = (car refs) - do - (destructuring-bind (where type what) ref - ;; FIXME: this is poorly factored, and shares some code and - ;; data with sldb that it shouldn't: notably - ;; sldb-reference-face. Probably the names of - ;; sldb-reference-foo should be altered to be not sldb - ;; specific. - (insert " " (sldb-format-reference-source where) ", ") - (slime-insert-propertized (sldb-reference-properties ref) - (sldb-format-reference-node what)) - (insert (format " [%s]" (slime-cl-symbol-name type))) - (when (cdr refs) - (terpri (current-buffer)))))) - (defun slime-tree-decoration (tree) (cond ((slime-tree-leaf-p tree) "-- ") ((slime-tree.collapsed-p tree) "[+] ") @@ -4452,9 +4417,9 @@ (goto-char start) (let ((severity (plist-get note :severity)) (message (plist-get note :message)) - (appropriate-overlay (slime-note-at-point))) - (if appropriate-overlay - (slime-merge-note-into-overlay appropriate-overlay severity message) + (overlay (slime-note-at-point))) + (if overlay + (slime-merge-note-into-overlay overlay severity message) (slime-create-note-overlay note start end severity message)))))) (defun slime-create-note-overlay (note start end severity message) @@ -6810,10 +6775,9 @@ (defun sldb-insert-condition (condition) "Insert the text for CONDITION. -CONDITION should be a list (MESSAGE TYPE REFERENCES EXTRAS). -REFERENCES a references to additional documentation. +CONDITION should be a list (MESSAGE TYPE EXTRAS). EXTRAS is currently used for the stepper." - (destructuring-bind (message type references extras) condition + (destructuring-bind (message type extras) condition (when (> (length message) 70) (add-text-properties 0 (length message) (list 'help-echo message) message)) @@ -6821,19 +6785,20 @@ (in-sldb-face topline message) "\n" (in-sldb-face condition type)) - (when references - (insert "See also:\n") - (slime-with-rigid-indentation 2 - (sldb-insert-references references)) - (insert "\n")) (sldb-dispatch-extras extras))) +(defvar sldb-extras-hooks) + (defun sldb-dispatch-extras (extras) ;; this is (mis-)used for the stepper (dolist (extra extras) (destructure-case extra ((:show-frame-source n) - (sldb-show-frame-source n))))) + (sldb-show-frame-source n)) + (t + (or (run-hook-with-args-until-success sldb-extras-hooks extra) + ;;(error "Unhandled extra element:" extra) + ))))) (defun sldb-insert-restarts (restarts) "Insert RESTARTS and add the needed text props @@ -7396,74 +7361,6 @@ ((:abort))))) -;;;;; SLDB references (rather SBCL specific) - -(defun sldb-insert-references (references) - "Insert documentation references from a condition. -See SWANK-BACKEND:CONDITION-REFERENCES for the datatype." - (loop for ref in references do - (destructuring-bind (where type what) ref - (insert (sldb-format-reference-source where) ", ") - (slime-insert-propertized (sldb-reference-properties ref) - (sldb-format-reference-node what)) - (insert (format " [%s]" (slime-cl-symbol-name type)) "\n")))) - -(defun sldb-reference-properties (reference) - "Return the properties for a reference. -Only add clickability to properties we actually know how to lookup." - (destructuring-bind (where type what) reference - (if (or (and (eq where :sbcl) (eq type :node)) - (and (eq where :ansi-cl) - (symbolp type) - (member (slime-cl-symbol-name type) - '("function" "special-operator" "macro" - "section" "glossary" "issue")))) - `(sldb-default-action - sldb-lookup-reference - ;; FIXME: this is a hack! slime-compiler-notes and sldb are a - ;; little too intimately entwined. - slime-compiler-notes-default-action sldb-lookup-reference - sldb-reference ,reference - face sldb-reference-face - mouse-face highlight)))) - -(defun sldb-format-reference-source (where) - (case where - (:amop "The Art of the Metaobject Protocol") - (:ansi-cl "Common Lisp Hyperspec") - (:sbcl "SBCL Manual") - (t (format "%S" where)))) - -(defun sldb-format-reference-node (what) - (if (symbolp what) - (upcase (slime-cl-symbol-name what)) - (if (listp what) - (mapconcat (lambda (x) (format "%S" x)) what ".") - what))) - -(defun sldb-lookup-reference () - "Browse the documentation reference at point." - (destructuring-bind (where type what) - (get-text-property (point) 'sldb-reference) - (case where - (:ansi-cl - (case type - (:section - (browse-url (funcall common-lisp-hyperspec-section-fun what))) - (:glossary - (browse-url (funcall common-lisp-glossary-fun what))) - (:issue - (browse-url (funcall 'common-lisp-issuex what))) - (t - (hyperspec-lookup (if (symbolp what) - (slime-cl-symbol-name what) - what))))) - (t - (let ((url (format "%s%s.html" slime-sbcl-manual-root - (subst-char-in-string ?\ ?\- what)))) - (browse-url url)))))) - - ;;;; Thread control panel (defun slime-list-threads () --- /project/slime/cvsroot/slime/swank.lisp 2007/09/04 10:32:05 1.509 +++ /project/slime/cvsroot/slime/swank.lisp 2007/09/10 15:39:05 1.510 @@ -2003,7 +2003,6 @@ (list (safe-condition-message *swank-debugger-condition*) (format nil " [Condition of type ~S]" (type-of *swank-debugger-condition*)) - (condition-references *swank-debugger-condition*) (condition-extras *swank-debugger-condition*))) (defun format-restarts-for-emacs () --- /project/slime/cvsroot/slime/swank-backend.lisp 2007/09/08 21:37:21 1.125 +++ /project/slime/cvsroot/slime/swank-backend.lisp 2007/09/10 15:39:05 1.126 @@ -686,20 +686,12 @@ "Format a condition for display in SLDB." (princ-to-string condition)) -(definterface condition-references (condition) - "Return a list of documentation references for a condition. -Each reference is one of: - (:ANSI-CL - {:FUNCTION | :SPECIAL-OPERATOR | :MACRO | :SECTION | :GLOSSARY } - symbol-or-name) - (:SBCL :NODE node-name)" - (declare (ignore condition)) - '()) - (definterface condition-extras (condition) "Return a list of extra for the debugger. The allowed elements are of the form: - (:SHOW-FRAME-SOURCE frame-number)" + (:SHOW-FRAME-SOURCE frame-number) + (:REFERENCES &rest refs) +" (declare (ignore condition)) '()) --- /project/slime/cvsroot/slime/swank-allegro.lisp 2007/08/23 19:03:37 1.96 +++ /project/slime/cvsroot/slime/swank-allegro.lisp 2007/09/10 15:39:05 1.97 @@ -66,10 +66,6 @@ (defimplementation format-sldb-condition (c) (princ-to-string c)) -(defimplementation condition-references (c) - (declare (ignore c)) - '()) - (defimplementation call-with-syntax-hooks (fn) (funcall fn)) --- /project/slime/cvsroot/slime/swank-sbcl.lisp 2007/09/04 09:49:09 1.182 +++ /project/slime/cvsroot/slime/swank-sbcl.lisp 2007/09/10 15:39:05 1.183 @@ -691,10 +691,25 @@ (defimplementation install-debugger-globally (function) (setq sb-ext:*invoke-debugger-hook* function)) -#+#.(swank-backend::sbcl-with-new-stepper-p) (defimplementation condition-extras (condition) - (when (typep condition 'sb-impl::step-form-condition) - `((:show-frame-source 0)))) + (cond #+#.(swank-backend::sbcl-with-new-stepper-p) + ((typep condition 'sb-impl::step-form-condition) + `((:show-frame-source 0))) + ((typep condition 'sb-int:reference-condition) + (let ((refs (sb-int:reference-condition-references condition))) + (if refs + `((:references ,(externalize-reference refs)))))))) + +(defun externalize-reference (ref) + (etypecase ref + (null nil) + (cons (cons (externalize-reference (car ref)) + (externalize-reference (cdr ref)))) + ((or string number) ref) + (symbol + (cond ((eq (symbol-package ref) (symbol-package :test)) + ref) + (t (symbol-name ref)))))) (defimplementation call-with-debugging-environment (debugger-loop-fn) (declare (type function debugger-loop-fn)) @@ -946,11 +961,6 @@ (let ((sb-int:*print-condition-references* nil)) (princ-to-string condition))) -(defimplementation condition-references (condition) - (if (typep condition 'sb-int:reference-condition) - (sb-int:reference-condition-references condition) - '())) - ;;;; Profiling From heller at common-lisp.net Mon Sep 10 15:39:05 2007 From: heller at common-lisp.net (heller) Date: Mon, 10 Sep 2007 11:39:05 -0400 (EDT) Subject: [slime-cvs] CVS slime/contrib Message-ID: <20070910153905.D9B951F009@common-lisp.net> Update of /project/slime/cvsroot/slime/contrib In directory clnet:/tmp/cvs-serv18471/contrib Modified Files: ChangeLog Added Files: slime-references.el Log Message: 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. --- /project/slime/cvsroot/slime/contrib/ChangeLog 2007/09/10 11:01:09 1.39 +++ /project/slime/cvsroot/slime/contrib/ChangeLog 2007/09/10 15:39:05 1.40 @@ -1,3 +1,9 @@ +2007-09-10 Helmut Eller + + Move SBCL doc references to contrib. + + * slime-references.el: New file. + 2007-09-10 Attila Lendvai * slime-fuzzy.el: Fixed some race condition that prevented a --- /project/slime/cvsroot/slime/contrib/slime-references.el 2007/09/10 15:39:05 NONE +++ /project/slime/cvsroot/slime/contrib/slime-references.el 2007/09/10 15:39:05 1.1 ;;; slime-references.el --- Clickable references to documentation (SBCL only) ;; ;; Authors: Christophe Rhodes ;; Luke Gorrie ;; ;; License: GNU GPL (same license as Emacs) ;; ;;; (defface sldb-reference-face (list (list t (:underline t))) "Face for references." :group 'slime-debugger) (defun slime-note.references (note) (plist-get note :references)) (defun slime-tree-print-with-references (tree) ;; for SBCL-style references (slime-tree-default-printer tree) (when-let (note (plist-get (slime-tree.plist tree) 'note)) (when-let (references (slime-note.references note)) (terpri (current-buffer)) (princ "See also:" (current-buffer)) (terpri (current-buffer)) (slime-tree-insert-references references)))) (defun slime-tree-insert-references (references) "Insert documentation references from a condition. See SWANK-BACKEND:CONDITION-REFERENCES for the datatype." (loop for refs on references for ref = (car refs) do (destructuring-bind (where type what) ref ;; FIXME: this is poorly factored, and shares some code and ;; data with sldb that it shouldn't: notably ;; sldb-reference-face. Probably the names of ;; sldb-reference-foo should be altered to be not sldb ;; specific. (insert " " (sldb-format-reference-source where) ", ") (slime-insert-propertized (sldb-reference-properties ref) (sldb-format-reference-node what)) (insert (format " [%s]" type)) (when (cdr refs) (terpri (current-buffer)))))) ;;;;; SLDB references (rather SBCL specific) (defun sldb-insert-references (references) "Insert documentation references from a condition. See SWANK-BACKEND:CONDITION-REFERENCES for the datatype." (loop for ref in references do (destructuring-bind (where type what) ref (insert (sldb-format-reference-source where) ", ") (slime-insert-propertized (sldb-reference-properties ref) (sldb-format-reference-node what)) (insert (format " [%s]" type) "\n")))) (defun sldb-reference-properties (reference) "Return the properties for a reference. Only add clickability to properties we actually know how to lookup." (destructuring-bind (where type what) reference (if (or (and (eq where :sbcl) (eq type :node)) (and (eq where :ansi-cl) (member type '("FUNCTION" "SPECIAL-OPERATOR" "MACRO" "SECTION" "GLOSSARY" "ISSUE")))) `(sldb-default-action sldb-lookup-reference ;; FIXME: this is a hack! slime-compiler-notes and sldb are a ;; little too intimately entwined. slime-compiler-notes-default-action sldb-lookup-reference sldb-reference ,reference face sldb-reference-face mouse-face highlight)))) (defun sldb-format-reference-source (where) (case where (:amop "The Art of the Metaobject Protocol") (:ansi-cl "Common Lisp Hyperspec") (:sbcl "SBCL Manual") (t (format "%S" where)))) (defun sldb-format-reference-node (what) (if (listp what) (mapconcat (lambda (x) (format "%s" x)) what ".") what)) (defun sldb-lookup-reference () "Browse the documentation reference at point." (destructuring-bind (where type what) (get-text-property (point) 'sldb-reference) (case where (:ansi-cl (case type (:section (browse-url (funcall common-lisp-hyperspec-section-fun what))) (:glossary (browse-url (funcall common-lisp-glossary-fun what))) (:issue (browse-url (funcall 'common-lisp-issuex what))) (t (hyperspec-lookup what)))) (t (let ((url (format "%s%s.html" slime-sbcl-manual-root (subst-char-in-string ?\ ?\- what)))) (browse-url url)))))) (defun sldb-maybe-insert-references (extra) (destructure-case extra ((:references references) (when references (insert "See also:\n") (slime-with-rigid-indentation 2 (sldb-insert-references references)) (insert "\n")) t) (t nil))) ;;; Initialization (setq slime-tree-printer 'slime-tree-print-with-references) (add-hook sldb-extras-hooks 'sldb-maybe-insert-references) (provide 'slime-references) From heller at common-lisp.net Mon Sep 10 20:09:52 2007 From: heller at common-lisp.net (heller) Date: Mon, 10 Sep 2007 16:09:52 -0400 (EDT) Subject: [slime-cvs] CVS slime Message-ID: <20070910200952.D8A602B13C@common-lisp.net> Update of /project/slime/cvsroot/slime In directory clnet:/tmp/cvs-serv8549 Modified Files: slime.el ChangeLog Log Message: Fix some of the bugs introduced when moving doc refs to contrib. * slime.el (sldb-dispatch-extras): Add missing quote. * slime-references.el (sldb-reference-face): Add missing quote. (sldb-reference-properties): We are lucky and can use keywords instead of strings. --- /project/slime/cvsroot/slime/slime.el 2007/09/10 15:39:05 1.856 +++ /project/slime/cvsroot/slime/slime.el 2007/09/10 20:09:52 1.857 @@ -6796,7 +6796,7 @@ ((:show-frame-source n) (sldb-show-frame-source n)) (t - (or (run-hook-with-args-until-success sldb-extras-hooks extra) + (or (run-hook-with-args-until-success 'sldb-extras-hooks extra) ;;(error "Unhandled extra element:" extra) ))))) --- /project/slime/cvsroot/slime/ChangeLog 2007/09/10 15:39:04 1.1209 +++ /project/slime/cvsroot/slime/ChangeLog 2007/09/10 20:09:52 1.1210 @@ -1,5 +1,9 @@ 2007-09-10 Helmut Eller + * slime.el (sldb-dispatch-extras): Add missing quote. + +2007-09-10 Helmut Eller + Move SBCL doc references to contrib. * slime.el (sldb-insert-condition): Merge REFERENCES and EXTRAS. From heller at common-lisp.net Mon Sep 10 20:09:53 2007 From: heller at common-lisp.net (heller) Date: Mon, 10 Sep 2007 16:09:53 -0400 (EDT) Subject: [slime-cvs] CVS slime/contrib Message-ID: <20070910200953.1EC1B2B129@common-lisp.net> Update of /project/slime/cvsroot/slime/contrib In directory clnet:/tmp/cvs-serv8549/contrib Modified Files: ChangeLog slime-references.el Log Message: Fix some of the bugs introduced when moving doc refs to contrib. * slime.el (sldb-dispatch-extras): Add missing quote. * slime-references.el (sldb-reference-face): Add missing quote. (sldb-reference-properties): We are lucky and can use keywords instead of strings. --- /project/slime/cvsroot/slime/contrib/ChangeLog 2007/09/10 15:39:05 1.40 +++ /project/slime/cvsroot/slime/contrib/ChangeLog 2007/09/10 20:09:52 1.41 @@ -1,5 +1,13 @@ 2007-09-10 Helmut Eller + Fix some of the bugs introduced with the last change. + + * slime-references.el (sldb-reference-face): Add missing quote. + (sldb-reference-properties): We are lucky and can use keywords + instead of strings. + +2007-09-10 Helmut Eller + Move SBCL doc references to contrib. * slime-references.el: New file. --- /project/slime/cvsroot/slime/contrib/slime-references.el 2007/09/10 15:39:05 1.1 +++ /project/slime/cvsroot/slime/contrib/slime-references.el 2007/09/10 20:09:52 1.2 @@ -8,7 +8,7 @@ ;;; (defface sldb-reference-face - (list (list t (:underline t))) + (list (list t '(:underline t))) "Face for references." :group 'slime-debugger) @@ -64,8 +64,8 @@ (destructuring-bind (where type what) reference (if (or (and (eq where :sbcl) (eq type :node)) (and (eq where :ansi-cl) - (member type '("FUNCTION" "SPECIAL-OPERATOR" "MACRO" - "SECTION" "GLOSSARY" "ISSUE")))) + (memq type '(:function :special-operator :macro + :section :glossary :issue)))) `(sldb-default-action sldb-lookup-reference ;; FIXME: this is a hack! slime-compiler-notes and sldb are a @@ -123,6 +123,6 @@ (setq slime-tree-printer 'slime-tree-print-with-references) -(add-hook sldb-extras-hooks 'sldb-maybe-insert-references) +(add-hook 'sldb-extras-hooks 'sldb-maybe-insert-references) (provide 'slime-references) From heller at common-lisp.net Mon Sep 10 21:33:36 2007 From: heller at common-lisp.net (heller) Date: Mon, 10 Sep 2007 17:33:36 -0400 (EDT) Subject: [slime-cvs] CVS slime Message-ID: <20070910213336.3BCBF1D129@common-lisp.net> Update of /project/slime/cvsroot/slime In directory clnet:/tmp/cvs-serv32550 Modified Files: ChangeLog swank-sbcl.lisp Log Message: * swank-sbcl.lisp (condition-references): It's still needed. --- /project/slime/cvsroot/slime/ChangeLog 2007/09/10 20:09:52 1.1210 +++ /project/slime/cvsroot/slime/ChangeLog 2007/09/10 21:33:35 1.1211 @@ -1,4 +1,6 @@ -2007-09-10 Helmut Eller +2007-09-10 Helmut Eller + + * swank-sbcl.lisp (condition-references): It's still needed. * slime.el (sldb-dispatch-extras): Add missing quote. --- /project/slime/cvsroot/slime/swank-sbcl.lisp 2007/09/10 15:39:05 1.183 +++ /project/slime/cvsroot/slime/swank-sbcl.lisp 2007/09/10 21:33:36 1.184 @@ -325,6 +325,11 @@ (sb-int:encapsulated-condition (sb-int:encapsulated-condition condition)) (t condition))) +(defun condition-references (condition) + (if (typep condition 'sb-int:reference-condition) + (externalize-reference + (sb-int:reference-condition-references condition)))) + (defun compiler-note-location (context) (if context (locate-compiler-note From heller at common-lisp.net Mon Sep 10 21:38:35 2007 From: heller at common-lisp.net (heller) Date: Mon, 10 Sep 2007 17:38:35 -0400 (EDT) Subject: [slime-cvs] CVS slime Message-ID: <20070910213835.4708F2B159@common-lisp.net> Update of /project/slime/cvsroot/slime In directory clnet:/tmp/cvs-serv865 Modified Files: slime.el ChangeLog Log Message: Minor beautifications. * slime.el (slime-sbcl-manual-root): Move definition to contrib/slime-references.el. * contrib/slime-references.el (sldb-maybe-insert-references): Insert newlines differently. --- /project/slime/cvsroot/slime/slime.el 2007/09/10 20:09:52 1.857 +++ /project/slime/cvsroot/slime/slime.el 2007/09/10 21:38:34 1.858 @@ -277,11 +277,6 @@ :type '(choice (const :tag "Enable" t) (const :tag "Disable" nil)) :group 'slime-mode) -(defcustom slime-sbcl-manual-root "http://www.sbcl.org/manual/" - "*The base URL of the SBCL manual, for documentation lookup." - :type 'string - :group 'slime-mode) - ;;;;; slime-mode-faces (defgroup slime-mode-faces nil --- /project/slime/cvsroot/slime/ChangeLog 2007/09/10 21:33:35 1.1211 +++ /project/slime/cvsroot/slime/ChangeLog 2007/09/10 21:38:34 1.1212 @@ -1,8 +1,12 @@ 2007-09-10 Helmut Eller + Fix some bugs introduced while moving doc refs to contrib. + * swank-sbcl.lisp (condition-references): It's still needed. * slime.el (sldb-dispatch-extras): Add missing quote. + (slime-sbcl-manual-root): Move definition to + contrib/slime-references.el. 2007-09-10 Helmut Eller From heller at common-lisp.net Mon Sep 10 21:38:35 2007 From: heller at common-lisp.net (heller) Date: Mon, 10 Sep 2007 17:38:35 -0400 (EDT) Subject: [slime-cvs] CVS slime/contrib Message-ID: <20070910213835.7C5122F076@common-lisp.net> Update of /project/slime/cvsroot/slime/contrib In directory clnet:/tmp/cvs-serv865/contrib Modified Files: ChangeLog slime-references.el Log Message: Minor beautifications. * slime.el (slime-sbcl-manual-root): Move definition to contrib/slime-references.el. * contrib/slime-references.el (sldb-maybe-insert-references): Insert newlines differently. --- /project/slime/cvsroot/slime/contrib/ChangeLog 2007/09/10 20:09:52 1.41 +++ /project/slime/cvsroot/slime/contrib/ChangeLog 2007/09/10 21:38:35 1.42 @@ -5,7 +5,8 @@ * slime-references.el (sldb-reference-face): Add missing quote. (sldb-reference-properties): We are lucky and can use keywords instead of strings. - + (sldb-maybe-insert-references): Insert newlines differently. + 2007-09-10 Helmut Eller Move SBCL doc references to contrib. --- /project/slime/cvsroot/slime/contrib/slime-references.el 2007/09/10 20:09:52 1.2 +++ /project/slime/cvsroot/slime/contrib/slime-references.el 2007/09/10 21:38:35 1.3 @@ -7,6 +7,11 @@ ;; ;;; +(defcustom slime-sbcl-manual-root "http://www.sbcl.org/manual/" + "*The base URL of the SBCL manual, for documentation lookup." + :type 'string + :group 'slime-mode) + (defface sldb-reference-face (list (list t '(:underline t))) "Face for references." @@ -44,19 +49,18 @@ (when (cdr refs) (terpri (current-buffer)))))) - ;;;;; SLDB references (rather SBCL specific) (defun sldb-insert-references (references) "Insert documentation references from a condition. See SWANK-BACKEND:CONDITION-REFERENCES for the datatype." - (loop for ref in references do - (destructuring-bind (where type what) ref - (insert (sldb-format-reference-source where) ", ") - (slime-insert-propertized (sldb-reference-properties ref) - (sldb-format-reference-node what)) - (insert (format " [%s]" type) "\n")))) + (dolist (ref references) + (destructuring-bind (where type what) ref + (insert "\n" (sldb-format-reference-source where) ", ") + (slime-insert-propertized (sldb-reference-properties ref) + (sldb-format-reference-node what)) + (insert (format " [%s]" type))))) (defun sldb-reference-properties (reference) "Return the properties for a reference. @@ -84,7 +88,7 @@ (defun sldb-format-reference-node (what) (if (listp what) - (mapconcat (lambda (x) (format "%s" x)) what ".") + (mapconcat #'prin1-to-string what ".") what)) (defun sldb-lookup-reference () @@ -111,10 +115,9 @@ (destructure-case extra ((:references references) (when references - (insert "See also:\n") + (insert "\nSee also:") (slime-with-rigid-indentation 2 - (sldb-insert-references references)) - (insert "\n")) + (sldb-insert-references references))) t) (t nil))) From heller at common-lisp.net Mon Sep 10 21:44:48 2007 From: heller at common-lisp.net (heller) Date: Mon, 10 Sep 2007 17:44:48 -0400 (EDT) Subject: [slime-cvs] CVS slime/contrib Message-ID: <20070910214448.E7D9943233@common-lisp.net> Update of /project/slime/cvsroot/slime/contrib In directory clnet:/tmp/cvs-serv2367 Modified Files: ChangeLog inferior-slime.el Log Message: * inferior-slime.el: Fix installation comment. --- /project/slime/cvsroot/slime/contrib/ChangeLog 2007/09/10 21:38:35 1.42 +++ /project/slime/cvsroot/slime/contrib/ChangeLog 2007/09/10 21:44:48 1.43 @@ -1,5 +1,14 @@ 2007-09-10 Helmut Eller + * slime-parse.el (slime-cl-symbol-name, slime-cl-symbol-package): + Move from slime.el to contrib/slime-parse.el. + +2007-09-10 Helmut Eller + + * inferior-slime.el: Fix installation comment. + +2007-09-10 Helmut Eller + Fix some of the bugs introduced with the last change. * slime-references.el (sldb-reference-face): Add missing quote. --- /project/slime/cvsroot/slime/contrib/inferior-slime.el 2007/09/04 10:04:48 1.1 +++ /project/slime/cvsroot/slime/contrib/inferior-slime.el 2007/09/10 21:44:48 1.2 @@ -8,7 +8,7 @@ ;; Add something like this to your .emacs: ;; ;; (add-to-list 'load-path "") -;; (add-hook 'slime-load-hook (lambda () (require 'slime-typeout-frame))) +;; (add-hook 'slime-load-hook (lambda () (require 'inferior-slime))) ;; (add-hook 'inferior-lisp-mode-hook (lambda () (inferior-slime-mode 1))) (define-minor-mode inferior-slime-mode From heller at common-lisp.net Mon Sep 10 21:45:18 2007 From: heller at common-lisp.net (heller) Date: Mon, 10 Sep 2007 17:45:18 -0400 (EDT) Subject: [slime-cvs] CVS slime Message-ID: <20070910214518.706A2650DB@common-lisp.net> Update of /project/slime/cvsroot/slime In directory clnet:/tmp/cvs-serv3898 Modified Files: ChangeLog slime.el Log Message: * slime.el (slime-cl-symbol-name, slime-cl-symbol-package): Move to contrib/slime-parse.el. --- /project/slime/cvsroot/slime/ChangeLog 2007/09/10 21:38:34 1.1212 +++ /project/slime/cvsroot/slime/ChangeLog 2007/09/10 21:45:17 1.1213 @@ -1,4 +1,4 @@ -2007-09-10 Helmut Eller +2007-09-10 Helmut Eller Fix some bugs introduced while moving doc refs to contrib. @@ -7,7 +7,9 @@ * slime.el (sldb-dispatch-extras): Add missing quote. (slime-sbcl-manual-root): Move definition to contrib/slime-references.el. - + (slime-cl-symbol-name, slime-cl-symbol-package): Move to + contrib/slime-parse.el. + 2007-09-10 Helmut Eller Move SBCL doc references to contrib. --- /project/slime/cvsroot/slime/slime.el 2007/09/10 21:38:34 1.858 +++ /project/slime/cvsroot/slime/slime.el 2007/09/10 21:45:17 1.859 @@ -9098,24 +9098,6 @@ (or (slime-sexp-at-point) (error "No expression at point."))) -;;;;; Common Lisp-style package-qualified symbols - -(defun slime-cl-symbol-name (symbol) - (let ((n (if (stringp symbol) symbol (symbol-name symbol)))) - (if (string-match ":\\([^:]*\\)$" n) - (let ((symbol-part (match-string 1 n))) - (if (string-match "^|\\(.*\\)|$" symbol-part) - (match-string 1 symbol-part) - symbol-part)) - n))) - -(defun slime-cl-symbol-package (symbol &optional default) - (let ((n (if (stringp symbol) symbol (symbol-name symbol)))) - (if (string-match "^\\([^:]*\\):" n) - (match-string 1 n) - default))) - - ;;;; Portability library (when (featurep 'xemacs) From heller at common-lisp.net Mon Sep 10 21:45:18 2007 From: heller at common-lisp.net (heller) Date: Mon, 10 Sep 2007 17:45:18 -0400 (EDT) Subject: [slime-cvs] CVS slime/contrib Message-ID: <20070910214518.B18EB6A004@common-lisp.net> Update of /project/slime/cvsroot/slime/contrib In directory clnet:/tmp/cvs-serv3898/contrib Modified Files: slime-parse.el Log Message: * slime.el (slime-cl-symbol-name, slime-cl-symbol-package): Move to contrib/slime-parse.el. --- /project/slime/cvsroot/slime/contrib/slime-parse.el 2007/09/10 00:43:18 1.4 +++ /project/slime/cvsroot/slime/contrib/slime-parse.el 2007/09/10 21:45:18 1.5 @@ -34,6 +34,21 @@ (and (string-match ":" name) (not (string-match "::" name))))) +(defun slime-cl-symbol-name (symbol) + (let ((n (if (stringp symbol) symbol (symbol-name symbol)))) + (if (string-match ":\\([^:]*\\)$" n) + (let ((symbol-part (match-string 1 n))) + (if (string-match "^|\\(.*\\)|$" symbol-part) + (match-string 1 symbol-part) + symbol-part)) + n))) + +(defun slime-cl-symbol-package (symbol &optional default) + (let ((n (if (stringp symbol) symbol (symbol-name symbol)))) + (if (string-match "^\\([^:]*\\):" n) + (match-string 1 n) + default))) + ;; XXX: unused function (defun slime-qualify-cl-symbol (symbol-or-name) "Like `slime-qualify-cl-symbol-name', but interns the result." From trittweiler at common-lisp.net Tue Sep 11 10:00:25 2007 From: trittweiler at common-lisp.net (trittweiler) Date: Tue, 11 Sep 2007 06:00:25 -0400 (EDT) Subject: [slime-cvs] CVS slime/contrib Message-ID: <20070911100025.81A361B024@common-lisp.net> Update of /project/slime/cvsroot/slime/contrib In directory clnet:/tmp/cvs-serv21377 Modified Files: slime-fancy.el Log Message: * slime-fancy.el: Require `slime-references'. --- /project/slime/cvsroot/slime/contrib/slime-fancy.el 2007/09/01 16:54:11 1.1 +++ /project/slime/cvsroot/slime/contrib/slime-fancy.el 2007/09/11 10:00:24 1.2 @@ -55,5 +55,8 @@ ;; Just adds commands. (require 'slime-xref-browser) +;; Puts clickable references to documentation into SBCL errors. +(require 'slime-references) + (provide 'slime-fancy) From trittweiler at common-lisp.net Tue Sep 11 10:00:36 2007 From: trittweiler at common-lisp.net (trittweiler) Date: Tue, 11 Sep 2007 06:00:36 -0400 (EDT) Subject: [slime-cvs] CVS slime/contrib Message-ID: <20070911100036.057267B4A9@common-lisp.net> Update of /project/slime/cvsroot/slime/contrib In directory clnet:/tmp/cvs-serv22047 Modified Files: ChangeLog Log Message: * slime-fancy.el: Require `slime-references'. --- /project/slime/cvsroot/slime/contrib/ChangeLog 2007/09/10 21:44:48 1.43 +++ /project/slime/cvsroot/slime/contrib/ChangeLog 2007/09/11 10:00:35 1.44 @@ -1,3 +1,7 @@ +2007-09-11 Tobias C. Rittweiler + + * slime-fancy.el: Require `slime-references'. + 2007-09-10 Helmut Eller * slime-parse.el (slime-cl-symbol-name, slime-cl-symbol-package): @@ -37,7 +41,7 @@ window-configuration, and explicitly set the hook. (slime-fuzzy-done): Explicitely remove the hook. -2007-09-10 Tobias C. Rittweiler +2007-09-10 Tobias C. Rittweiler * slime-parse.el (slime-cl-symbol-name, slime-cl-symbol-package): Moved back into slime.el. @@ -53,7 +57,7 @@ ecase, for dispatching targets. Should fix XEmacs compatibility. Reported by Steven E. Harris. -2007-09-05 Tobias C. Rittweiler +2007-09-05 Tobias C. Rittweiler * swank-c-p-c.el: This file incorrectly provided the module `:swank-compound-prefix'; changed that to `:swank-c-p-c'. @@ -65,12 +69,12 @@ `*arglist-pprint-bindings*' to be special, as the variable is defined later in the file. (Gets rid of warnings during loading.) -2007-09-05 Tobias C. Rittweiler +2007-09-05 Tobias C. Rittweiler * slime-c-p-c.el (slime-c-p-c-init): Bind `slime-complete-form' to `C-c C-s' in `slime-repl-mode-map'. -2007-09-05 Tobias C. Rittweiler +2007-09-05 Tobias C. Rittweiler Added extended arglist display for DECLAIM and PROCLAIM. From trittweiler at common-lisp.net Tue Sep 11 12:33:00 2007 From: trittweiler at common-lisp.net (trittweiler) Date: Tue, 11 Sep 2007 08:33:00 -0400 (EDT) Subject: [slime-cvs] CVS slime/contrib Message-ID: <20070911123300.390051E0A4@common-lisp.net> Update of /project/slime/cvsroot/slime/contrib In directory clnet:/tmp/cvs-serv27413/contrib Modified Files: swank-arglists.lisp Log Message: * swank-arglist.lisp (read-conversatively-for-autodoc): Also parse quoted symbols explicitly. This fixed extended arglist display for `(make-instance 'foo'. Reported by: Johannes Groedem. --- /project/slime/cvsroot/slime/contrib/swank-arglists.lisp 2007/09/05 19:35:46 1.9 +++ /project/slime/cvsroot/slime/contrib/swank-arglists.lisp 2007/09/11 12:33:00 1.10 @@ -86,8 +86,13 @@ In such a case (that no symbol could be found), the object *ARGLIST-DUMMY* is returned instead, which works as a placeholder datum for subsequent logics to rely on." - (multiple-value-bind (symbol found?) (parse-symbol string) - (if found? symbol *arglist-dummy*))) + (let* ((string (string-left-trim '(#\Space #\Tab #\Newline) string)) + (quoted? (eql (aref string 0) #\'))) + (multiple-value-bind (symbol found?) + (parse-symbol (if quoted? (subseq string 1) string)) + (if found? + (if quoted? `(quote ,symbol) symbol) + *arglist-dummy*)))) (defun parse-form-spec (raw-spec &optional reader) From trittweiler at common-lisp.net Tue Sep 11 12:33:56 2007 From: trittweiler at common-lisp.net (trittweiler) Date: Tue, 11 Sep 2007 08:33:56 -0400 (EDT) Subject: [slime-cvs] CVS slime/contrib Message-ID: <20070911123356.173007B4A9@common-lisp.net> Update of /project/slime/cvsroot/slime/contrib In directory clnet:/tmp/cvs-serv27522/contrib Modified Files: ChangeLog Log Message: * swank-arglist.lisp (read-conversatively-for-autodoc): Also parse quoted symbols explicitly. This fixed extended arglist display for `(make-instance 'foo'. Reported by: Johannes Groedem. --- /project/slime/cvsroot/slime/contrib/ChangeLog 2007/09/11 10:00:35 1.44 +++ /project/slime/cvsroot/slime/contrib/ChangeLog 2007/09/11 12:33:56 1.45 @@ -1,5 +1,11 @@ 2007-09-11 Tobias C. Rittweiler + * swank-arglist.lisp (read-conversatively-for-autodoc): Also parse + quoted symbols explicitly. This fixed extended arglist display for + `(make-instance 'foo'. Reported by: Johannes Groedem. + +2007-09-11 Tobias C. Rittweiler + * slime-fancy.el: Require `slime-references'. 2007-09-10 Helmut Eller From trittweiler at common-lisp.net Tue Sep 11 17:04:17 2007 From: trittweiler at common-lisp.net (trittweiler) Date: Tue, 11 Sep 2007 13:04:17 -0400 (EDT) Subject: [slime-cvs] CVS slime/contrib Message-ID: <20070911170417.8FB7F6B545@common-lisp.net> Update of /project/slime/cvsroot/slime/contrib In directory clnet:/tmp/cvs-serv10590/contrib Modified Files: slime-parse.el Log Message: * slime-parse.el (slime-enclosing-form-specs): Now also works even when point is inside a string. (slime-inside-string-p): New function. (slime-beginning-of-string): New function. --- /project/slime/cvsroot/slime/contrib/slime-parse.el 2007/09/10 21:45:18 1.5 +++ /project/slime/cvsroot/slime/contrib/slime-parse.el 2007/09/11 17:04:17 1.6 @@ -299,8 +299,11 @@ ;; This speeds up this function significantly. (ignore-errors (save-excursion - ;; Make sure we get the whole operator name. - (slime-end-of-symbol) + ;; Make sure we get the whole thing at point. + (if (not (slime-inside-string-p)) + (slime-end-of-symbol) + (slime-beginning-of-string) + (forward-sexp)) (save-restriction ;; Don't parse more than 20000 characters before point, so we don't spend ;; too much time. @@ -347,7 +350,22 @@ (nreverse arg-indices) (nreverse points)))) + (defun slime-ensure-list (thing) (if (listp thing) thing (list thing))) +(defun slime-inside-string-p () + (let* ((toplevel-begin (first (slime-region-for-defun-at-point))) + (parse-result (parse-partial-sexp toplevel-begin (point))) + (inside-string-p (nth 3 parse-result)) + (string-start-pos (nth 8 parse-result))) + (and inside-string-p string-start-pos))) + +(defun slime-beginning-of-string () + (let ((string-start-pos (slime-inside-string-p))) + (if string-start-pos + (goto-char string-start-pos) + (error "We're not within a string")))) + (provide 'slime-parse) + From trittweiler at common-lisp.net Tue Sep 11 17:04:25 2007 From: trittweiler at common-lisp.net (trittweiler) Date: Tue, 11 Sep 2007 13:04:25 -0400 (EDT) Subject: [slime-cvs] CVS slime/contrib Message-ID: <20070911170425.C32EE15@common-lisp.net> Update of /project/slime/cvsroot/slime/contrib In directory clnet:/tmp/cvs-serv10618/contrib Modified Files: ChangeLog Log Message: * slime-parse.el (slime-enclosing-form-specs): Now also works even when point is inside a string. (slime-inside-string-p): New function. (slime-beginning-of-string): New function. --- /project/slime/cvsroot/slime/contrib/ChangeLog 2007/09/11 12:33:56 1.45 +++ /project/slime/cvsroot/slime/contrib/ChangeLog 2007/09/11 17:04:25 1.46 @@ -1,5 +1,12 @@ 2007-09-11 Tobias C. Rittweiler + * slime-parse.el (slime-enclosing-form-specs): Now also works even + when point is inside a string. + (slime-inside-string-p): New function. + (slime-beginning-of-string): New function. + +2007-09-11 Tobias C. Rittweiler + * swank-arglist.lisp (read-conversatively-for-autodoc): Also parse quoted symbols explicitly. This fixed extended arglist display for `(make-instance 'foo'. Reported by: Johannes Groedem. From trittweiler at common-lisp.net Tue Sep 11 17:11:01 2007 From: trittweiler at common-lisp.net (trittweiler) Date: Tue, 11 Sep 2007 13:11:01 -0400 (EDT) Subject: [slime-cvs] CVS slime/contrib Message-ID: <20070911171101.4A19719005@common-lisp.net> Update of /project/slime/cvsroot/slime/contrib In directory clnet:/tmp/cvs-serv11421/contrib Modified Files: slime-editing-commands.el Log Message: * slime-editing-commands.el: Automatically bind the editing commands when this module is required. (Previously, one had to enable them explicitly, but this is inconsistent to, for instance, the `slime-c-p-c' module which also sets up its bindings automatically.) (slime-bind-editing-commands): Renamed to `slime-editing-commands-init'. (slime-editing-commands-init): Evaluated at toplevel. --- /project/slime/cvsroot/slime/contrib/slime-editing-commands.el 2007/08/31 14:07:54 1.2 +++ /project/slime/cvsroot/slime/contrib/slime-editing-commands.el 2007/09/11 17:11:01 1.3 @@ -14,7 +14,6 @@ ;; ;; (add-to-list 'load-path "") ;; (add-hook 'slime-load-hook (lambda () (require 'slime-editing-commands))) -;; (add-hook 'slime-mode-hook 'slime-bind-editing-commands) ;; (defun slime-beginning-of-defun () @@ -182,9 +181,11 @@ (setf end (point))) (indent-region start end nil))))) -(defun slime-bind-editing-commands () +(defun slime-editing-commands-init () (define-key slime-mode-map "\M-\C-a" 'slime-beginning-of-defun) (define-key slime-mode-map "\M-\C-e" 'slime-end-of-defun) (define-key slime-mode-map "\C-c\M-q" 'slime-reindent-defun)) +(slime-editing-command-init) + (provide 'slime-editing-commands) From trittweiler at common-lisp.net Tue Sep 11 17:11:09 2007 From: trittweiler at common-lisp.net (trittweiler) Date: Tue, 11 Sep 2007 13:11:09 -0400 (EDT) Subject: [slime-cvs] CVS slime/contrib Message-ID: <20070911171109.AF79C1903A@common-lisp.net> Update of /project/slime/cvsroot/slime/contrib In directory clnet:/tmp/cvs-serv11459/contrib Modified Files: ChangeLog Log Message: * slime-editing-commands.el: Automatically bind the editing commands when this module is required. (Previously, one had to enable them explicitly, but this is inconsistent to, for instance, the `slime-c-p-c' module which also sets up its bindings automatically.) (slime-bind-editing-commands): Renamed to `slime-editing-commands-init'. (slime-editing-commands-init): Evaluated at toplevel. --- /project/slime/cvsroot/slime/contrib/ChangeLog 2007/09/11 17:04:25 1.46 +++ /project/slime/cvsroot/slime/contrib/ChangeLog 2007/09/11 17:11:08 1.47 @@ -1,5 +1,15 @@ 2007-09-11 Tobias C. Rittweiler + * slime-editing-commands.el: Automatically bind the editing + commands when this module is required. (Previously, one had to + enable them explicitly, but this is inconsistent to, for instance, + the `slime-c-p-c' module which also sets up its bindings + automatically.) + (slime-bind-editing-commands): Renamed to `slime-editing-commands-init'. + (slime-editing-commands-init): Evaluated at toplevel. + +2007-09-11 Tobias C. Rittweiler + * slime-parse.el (slime-enclosing-form-specs): Now also works even when point is inside a string. (slime-inside-string-p): New function. From trittweiler at common-lisp.net Tue Sep 11 18:08:20 2007 From: trittweiler at common-lisp.net (trittweiler) Date: Tue, 11 Sep 2007 14:08:20 -0400 (EDT) Subject: [slime-cvs] CVS slime/contrib Message-ID: <20070911180820.6146E3C015@common-lisp.net> Update of /project/slime/cvsroot/slime/contrib In directory clnet:/tmp/cvs-serv22957/contrib Modified Files: slime-editing-commands.el Log Message: * slime-editing-commands.el: Automatically bind the editing commands when this module is required. (Previously, one had to enable them explicitly, but this is inconsistent to, for instance, the `slime-c-p-c' module which also sets up its bindings automatically.) (slime-bind-editing-commands): Renamed to `slime-editing-commands-init'. (slime-editing-commands-init): Evaluated at toplevel. --- /project/slime/cvsroot/slime/contrib/slime-editing-commands.el 2007/09/11 17:11:01 1.3 +++ /project/slime/cvsroot/slime/contrib/slime-editing-commands.el 2007/09/11 18:08:20 1.4 @@ -186,6 +186,6 @@ (define-key slime-mode-map "\M-\C-e" 'slime-end-of-defun) (define-key slime-mode-map "\C-c\M-q" 'slime-reindent-defun)) -(slime-editing-command-init) +(slime-editing-commands-init) (provide 'slime-editing-commands) From trittweiler at common-lisp.net Tue Sep 11 19:30:53 2007 From: trittweiler at common-lisp.net (trittweiler) Date: Tue, 11 Sep 2007 15:30:53 -0400 (EDT) Subject: [slime-cvs] CVS slime Message-ID: <20070911193053.D177959092@common-lisp.net> Update of /project/slime/cvsroot/slime In directory clnet:/tmp/cvs-serv6188 Modified Files: swank-loader.lisp Log Message: * swank-loader.lisp: Aways compile-file `contrib/swank-asdf.lisp' on SBCL. This fixes "Undefined function" style-warnings when using `slime-asdf' in combination with SBCL. Reported by Cyrus Harmon. * swank-sbcl.lisp: Explicitly require ASDF. (While this is not strictly necessary, as it's implicitly loaded on requiring the other modules, I think it's better to be explicit about it.) --- /project/slime/cvsroot/slime/swank-loader.lisp 2007/09/04 10:32:05 1.71 +++ /project/slime/cvsroot/slime/swank-loader.lisp 2007/09/11 19:30:53 1.72 @@ -201,7 +201,7 @@ (defvar *contribs* '(swank-c-p-c swank-arglists swank-fuzzy swank-fancy-inspector swank-presentations swank-presentation-streams - #+asdf swank-asdf + #+(or asdf sbcl) swank-asdf ) "List of names for contrib modules.") From trittweiler at common-lisp.net Tue Sep 11 19:31:03 2007 From: trittweiler at common-lisp.net (trittweiler) Date: Tue, 11 Sep 2007 15:31:03 -0400 (EDT) Subject: [slime-cvs] CVS slime Message-ID: <20070911193103.5097B5D00B@common-lisp.net> Update of /project/slime/cvsroot/slime In directory clnet:/tmp/cvs-serv6217 Modified Files: swank-sbcl.lisp Log Message: * swank-loader.lisp: Aways compile-file `contrib/swank-asdf.lisp' on SBCL. This fixes "Undefined function" style-warnings when using `slime-asdf' in combination with SBCL. Reported by Cyrus Harmon. * swank-sbcl.lisp: Explicitly require ASDF. (While this is not strictly necessary, as it's implicitly loaded on requiring the other modules, I think it's better to be explicit about it.) --- /project/slime/cvsroot/slime/swank-sbcl.lisp 2007/09/10 21:33:36 1.184 +++ /project/slime/cvsroot/slime/swank-sbcl.lisp 2007/09/11 19:31:03 1.185 @@ -14,6 +14,7 @@ (in-package :swank-backend) (eval-when (:compile-toplevel :load-toplevel :execute) + (require 'asdf) (require 'sb-bsd-sockets) (require 'sb-introspect) (require 'sb-posix) From trittweiler at common-lisp.net Tue Sep 11 19:31:45 2007 From: trittweiler at common-lisp.net (trittweiler) Date: Tue, 11 Sep 2007 15:31:45 -0400 (EDT) Subject: [slime-cvs] CVS slime Message-ID: <20070911193145.E8EF574374@common-lisp.net> Update of /project/slime/cvsroot/slime In directory clnet:/tmp/cvs-serv6242 Modified Files: ChangeLog Log Message: * swank-loader.lisp: Aways compile-file `contrib/swank-asdf.lisp' on SBCL. This fixes "Undefined function" style-warnings when using `slime-asdf' in combination with SBCL. Reported by Cyrus Harmon. * swank-sbcl.lisp: Explicitly require ASDF. (While this is not strictly necessary, as it's implicitly loaded on requiring the other modules, I think it's better to be explicit about it.) --- /project/slime/cvsroot/slime/ChangeLog 2007/09/10 21:45:17 1.1213 +++ /project/slime/cvsroot/slime/ChangeLog 2007/09/11 19:31:45 1.1214 @@ -1,3 +1,13 @@ +2007-09-11 Tobias C. Rittweiler + + * swank-loader.lisp: Aways compile-file `contrib/swank-asdf.lisp' + on SBCL. This fixes "Undefined function" style-warnings when using + `slime-asdf' in combination with SBCL. Reported by Cyrus Harmon. + + * swank-sbcl.lisp: Explicitly require ASDF. (While this is not + strictly necessary, as it's implicitly loaded on requiring the + other modules, I think it's better to be explicit about it.) + 2007-09-10 Helmut Eller Fix some bugs introduced while moving doc refs to contrib. From heller at common-lisp.net Fri Sep 14 12:41:28 2007 From: heller at common-lisp.net (heller) Date: Fri, 14 Sep 2007 08:41:28 -0400 (EDT) Subject: [slime-cvs] CVS slime Message-ID: <20070914124128.AE72C65113@common-lisp.net> Update of /project/slime/cvsroot/slime In directory clnet:/tmp/cvs-serv11384 Modified Files: ChangeLog swank.asd swank-loader.lisp Log Message: Make ASDF:LOAD-OP (and SBCL REQUIRE) happy with swank.asd * swank.asd: Define and use a CL-SCRIPT-FILE class for loading as source, even with ASDF:LOAD-OP. --- /project/slime/cvsroot/slime/ChangeLog 2007/09/11 19:31:45 1.1214 +++ /project/slime/cvsroot/slime/ChangeLog 2007/09/14 12:41:28 1.1215 @@ -1,3 +1,10 @@ +2007-09-12 Christophe Rhodes + + Make ASDF:LOAD-OP (and SBCL REQUIRE) happy with swank.asd + + * swank.asd: Define and use a CL-SCRIPT-FILE class for loading as + source, even with ASDF:LOAD-OP. + 2007-09-11 Tobias C. Rittweiler * swank-loader.lisp: Aways compile-file `contrib/swank-asdf.lisp' --- /project/slime/cvsroot/slime/swank.asd 2006/07/12 20:25:23 1.4 +++ /project/slime/cvsroot/slime/swank.asd 2007/09/14 12:41:28 1.5 @@ -19,10 +19,30 @@ ;; This code has been placed in the Public Domain. All warranties ;; are disclaimed. +(defpackage :swank-loader + (:use :cl)) + +(in-package :swank-loader) + +(defclass cl-script-file (asdf:source-file) ()) + +(defmethod asdf:perform ((o asdf:compile-op) (f cl-script-file)) + t) +(defmethod asdf:perform ((o asdf:load-op) (f cl-script-file)) + (mapcar #'load (asdf:input-files o f))) +(defmethod asdf:output-files ((o asdf:compile-op) (f cl-script-file)) + nil) +(defmethod asdf:input-files ((o asdf:load-op) (c cl-script-file)) + (list (asdf:component-pathname c))) +(defmethod asdf:operation-done-p ((o asdf:compile-op) (c cl-script-file)) + t) +(defmethod asdf:source-file-type ((c cl-script-file) (s asdf:module)) + "lisp") + (asdf:defsystem :swank + :default-component-class cl-script-file :components ((:file "swank-loader"))) -(defpackage :swank-loader) -(defparameter swank-loader::*source-directory* +(defparameter *source-directory* (asdf:component-pathname (asdf:find-system :swank))) --- /project/slime/cvsroot/slime/swank-loader.lisp 2007/09/11 19:30:53 1.72 +++ /project/slime/cvsroot/slime/swank-loader.lisp 2007/09/14 12:41:28 1.73 @@ -18,7 +18,6 @@ ;; (defparameter swank-loader::*fasl-directory* "/tmp/fasl/") ;; (load ".../swank-loader.lisp") - (cl:defpackage :swank-loader (:use :cl) (:export :load-swank From heller at common-lisp.net Fri Sep 14 13:36:23 2007 From: heller at common-lisp.net (heller) Date: Fri, 14 Sep 2007 09:36:23 -0400 (EDT) Subject: [slime-cvs] CVS slime Message-ID: <20070914133623.0D4C95909E@common-lisp.net> Update of /project/slime/cvsroot/slime In directory clnet:/tmp/cvs-serv20228 Modified Files: ChangeLog slime.el Log Message: Some cleanups for the REPL. * slime.el (slime-repl-write-string): Split it up into smaller functions. (slime-repl-emit, slime-repl-emit-result) (slime-emit-string): New functions. (slime-repl-save-history): Use prin1 instead of pp. (repl-type-ahead): New test case. --- /project/slime/cvsroot/slime/ChangeLog 2007/09/14 12:41:28 1.1215 +++ /project/slime/cvsroot/slime/ChangeLog 2007/09/14 13:36:23 1.1216 @@ -1,3 +1,16 @@ +2007-09-14 Helmut Eller + + Some cleanups for the REPL. + + * slime.el (slime-repl-write-string): Split it up into smaller + functions. + (slime-repl-emit, slime-repl-emit-result) + (slime-emit-string): New functions. + + (slime-repl-save-history): Use prin1 instead of pp. + + (repl-type-ahead): New test case. + 2007-09-12 Christophe Rhodes Make ASDF:LOAD-OP (and SBCL REQUIRE) happy with swank.asd @@ -14,11 +27,11 @@ * swank-sbcl.lisp: Explicitly require ASDF. (While this is not strictly necessary, as it's implicitly loaded on requiring the other modules, I think it's better to be explicit about it.) - + 2007-09-10 Helmut Eller Fix some bugs introduced while moving doc refs to contrib. - + * swank-sbcl.lisp (condition-references): It's still needed. * slime.el (sldb-dispatch-extras): Add missing quote. @@ -26,7 +39,7 @@ contrib/slime-references.el. (slime-cl-symbol-name, slime-cl-symbol-package): Move to contrib/slime-parse.el. - + 2007-09-10 Helmut Eller Move SBCL doc references to contrib. --- /project/slime/cvsroot/slime/slime.el 2007/09/10 21:45:17 1.859 +++ /project/slime/cvsroot/slime/slime.el 2007/09/14 13:36:23 1.860 @@ -2833,53 +2833,44 @@ (defun slime-repl-write-string (string &optional target) (case target - ((nil) ; Regular process output - (with-current-buffer (slime-output-buffer) - (slime-with-output-end-mark - (slime-insert-propertized '(face slime-repl-output-face - rear-nonsticky (face)) - string) - (set-marker slime-output-end (point)) - (when (and (= (point) slime-repl-prompt-start-mark) - (not (bolp))) - (insert "\n") - (set-marker slime-output-end (1- (point)))) - (if (< slime-repl-input-start-mark (point)) - (set-marker slime-repl-input-start-mark - (point)))))) - (:repl-result - (with-current-buffer (slime-output-buffer) - (let ((marker (slime-output-target-marker target))) - (goto-char marker) - (let ((result-start (point))) - (slime-insert-propertized `(face slime-repl-result-face - rear-nonsticky (face)) - string) - ;; Move the input-start marker after the REPL result. - (set-marker marker (point)))))) - (t - (let* ((marker (slime-output-target-marker target)) - (buffer (and marker (marker-buffer marker)))) - (when buffer - (with-current-buffer buffer - (save-excursion - ;; Insert STRING at MARKER, then move MARKER behind - ;; the insertion. - (goto-char marker) - (insert-before-markers string) - (set-marker marker (point))))))))) + ((nil) (slime-repl-emit string)) + (:repl-result (slime-repl-emit-result string)) + (t (slime-emit-string string target)))) + +(defun slime-repl-emit (string) + ;; insert the string STRING in the output buffer + (with-current-buffer (slime-output-buffer) + (slime-with-output-end-mark + (slime-insert-propertized '(face slime-repl-output-face + rear-nonsticky (face)) + string) + (set-marker slime-output-end (point)) + (when (and (= (point) slime-repl-prompt-start-mark) + (not (bolp))) + (insert "\n") + (set-marker slime-output-end (1- (point)))) + (when (< slime-repl-input-start-mark (point)) + (set-marker slime-repl-input-start-mark (point)))))) + +(defun slime-repl-emit-result (string) + ;; insert STRING and mark it as evaluation result + (with-current-buffer (slime-output-buffer) + (goto-char slime-repl-input-start-mark) + (slime-insert-propertized `(face slime-repl-result-face + rear-nonsticky (face)) + string) + (set-marker slime-repl-input-start-mark (point)))) (defvar slime-last-output-target-id 0 "The last integer we used as a TARGET id.") (defvar slime-output-target-to-marker (make-hash-table) - "Map from TARGET ids to Emacs markers that indicate where -output should be inserted.") + "Map from TARGET ids to Emacs markers. +The markers indicate where output should be inserted.") (defun slime-output-target-marker (target) - "Return a marker that indicates where output for TARGET should -be inserted." + "Return the marker where output for TARGET should be inserted." (case target ((nil) (with-current-buffer (slime-output-buffer) @@ -2890,6 +2881,20 @@ (t (gethash target slime-output-target-to-marker)))) +(defun slime-emit-string (string target) + "Insert STRING at target TARGET. +See `slime-output-target-to-marker'." + (let* ((marker (slime-output-target-marker target)) + (buffer (and marker (marker-buffer marker)))) + (when buffer + (with-current-buffer buffer + (save-excursion + ;; Insert STRING at MARKER, then move MARKER behind + ;; the insertion. + (goto-char marker) + (insert-before-markers string) + (set-marker marker (point))))))) + (defun slime-switch-to-output-buffer (&optional connection) "Select the output buffer, preferably in a different window." (interactive (list (if prefix-arg (slime-choose-connection)))) @@ -3653,12 +3658,13 @@ (let ((hist (subseq hist 0 (min (length hist) slime-repl-history-size)))) ;;(message "saving %s to %s\n" hist file) (with-temp-file file - (let ((cs slime-repl-history-file-coding-system)) + (let ((cs slime-repl-history-file-coding-system) + (print-length nil) (print-level nil)) (setq buffer-file-coding-system cs) - (insert (format ";; -*- coding: %s -*-\n" cs))) - (insert ";; History for SLIME REPL. Automatically written.\n" - ";; Edit only if you know what you're doing\n") - (pp (mapcar #'substring-no-properties hist) (current-buffer)))))) + (insert (format ";; -*- coding: %s -*-\n" cs)) + (insert ";; History for SLIME REPL. Automatically written.\n" + ";; Edit only if you know what you're doing\n") + (prin1 (mapcar #'substring-no-properties hist) (current-buffer))))))) (defun slime-repl-save-all-histories () "Save the history in each repl buffer." @@ -8862,6 +8868,24 @@ (slime-check "Buffer contains result" (equal final-contents (buffer-string))))) +(def-slime-test repl-type-ahead + (command input final-contents) + "Ensure that user input is preserved correctly. +In particular, input inserted while waiting for a result." + '(("(sleep 1)" "foo" "SWANK> (sleep 1) +NIL +SWANK> foo")) + (when (slime-output-buffer) + (kill-buffer (slime-output-buffer))) + (setf (slime-lisp-package-prompt-string) "SWANK") + (with-current-buffer (slime-output-buffer) + (insert command) + (call-interactively 'slime-repl-return) + (insert input) + (slime-sync-to-top-level 5) + (slime-check "Buffer contains result" + (equal final-contents (buffer-string))))) + (def-slime-test interactive-eval-output (input result-contents visiblep) "Test simple commands in the minibuffer." @@ -9407,8 +9431,9 @@ (defvar slime-obsolete-commands '(("\C-c\M-i" (slime repl) slime-fuzzy-complete-symbol) - ("\M-\C-a" (slime) slime-beginning-of-defun) - ("\M-\C-e" (slime) slime-end-of-defun) + ;; Don't shadow bindings in lisp-mode-map + ;;("\M-\C-a" (slime) slime-beginning-of-defun) + ;;("\M-\C-e" (slime) slime-end-of-defun) ("\C-c\M-q" (slime) slime-reindent-defun) ("\C-c\C-s" (slime) slime-complete-form) ;; (nil nil slime-close-all-parens-in-sexp) From trittweiler at common-lisp.net Fri Sep 14 23:24:09 2007 From: trittweiler at common-lisp.net (trittweiler) Date: Fri, 14 Sep 2007 19:24:09 -0400 (EDT) Subject: [slime-cvs] CVS slime/contrib Message-ID: <20070914232409.5E03F1C0D0@common-lisp.net> Update of /project/slime/cvsroot/slime/contrib In directory clnet:/tmp/cvs-serv9717 Modified Files: swank-fuzzy.lisp Log Message: * swank-fuzzy.lisp: Code reorganization and cleanup; making it compute less and couple of other minor issues fixed on the way. Thanks to Stelian Ionescu for testing and providing feedback! (defstruct fuzzy-matching): New `package-name' slot. (make-fuzzy-matching): Updated for new slot. (format-completion-result): Renamed to `fuzzy-format-matching'. (%fuzzy-extract-matching-info): Helper for `fuzzy-format-matching'. (fuzzy-completion-set): Convert the matchings after they got truncated to the passed completion-set limit from Emacs. I.e. `slime-fuzzy-completion-limit' This means a huge computational reduction. (fuzzy-create-completion-set): Renamed to `fuzzy-generate-matchings'. (fuzzy-generate-matchings): Returns the fuzzy matchings themselves, do not yet convert them for Emacs. Do not perform two sorts on the generated matchings (first alphabetically, then per score), but just one with an appropriate predicate that sorts per score, unless matchings are equal, then sort alphabetically. Prune matchings with symbols which are found in a differenta package than their home package when the home package is among the matched packages. Try to take the time needed to sort the generated matchings into account for the time-limit. (%guess-sort-duration): Helper. Tries to guess how long the sort will take. (%make-duplicate-symbols-filter): Helper. Used for pruning of matchings. (fuzzy-matching-greaterp): New testing predicate for sorting. (fuzzy-find-matching-symbols): Now takes a :filter keyarg; only considers symbols that pass through the filter. (fuzzy-find-matching-packages): Do not return matchings for all nicknames of package, but just the one that matches best. --- /project/slime/cvsroot/slime/contrib/swank-fuzzy.lisp 2007/08/31 11:48:23 1.4 +++ /project/slime/cvsroot/slime/contrib/swank-fuzzy.lisp 2007/09/14 23:24:09 1.5 @@ -1,6 +1,9 @@ ;;; swank-fuzzy.lisp --- fuzzy symbol completion ;; -;; Author: Brian Downing and others +;; Authors: Brian Downing +;; Tobias C. Rittweiler +;; and others +;; ;; License: Public Domain ;; @@ -76,20 +79,58 @@ (defstruct (fuzzy-matching (:conc-name fuzzy-matching.) (:predicate fuzzy-matching-p) (:constructor %make-fuzzy-matching)) - symbol ; The symbol that has been found to match. - score ; The higher the better symbol is a match. - package-chunks ; Chunks pertaining to the package identifier of the symbol. - symbol-chunks) ; Chunks pertaining to the symbol's name. + symbol ; The symbol that has been found to match. + package-name ; The name of the package where SYMBOL was found in. + ; (This is not necessarily the same as the home-package + ; of SYMBOL, because the SYMBOL can be internal to + ; lots of packages; also think of package nicknames.) + score ; The higher the better SYMBOL is a match. + package-chunks ; Chunks pertaining to the package identifier of SYMBOL. + symbol-chunks) ; Chunks pertaining to SYMBOL's name. -(defun make-fuzzy-matching (symbol score package-chunks symbol-chunks) +(defun make-fuzzy-matching (symbol package-name score package-chunks symbol-chunks) (declare (inline %make-fuzzy-matching)) - (%make-fuzzy-matching :symbol symbol :score score + (%make-fuzzy-matching :symbol symbol :package-name package-name :score score :package-chunks package-chunks :symbol-chunks symbol-chunks)) +(defun %fuzzy-extract-matching-info (fuzzy-matching user-input-string) + (multiple-value-bind (_ user-package-name __ input-internal-p) + (parse-completion-arguments user-input-string nil) + (declare (ignore _ __)) + (with-struct (fuzzy-matching. score symbol package-name package-chunks symbol-chunks) + fuzzy-matching + (let (symbol-name real-package-name internal-p) + (cond (symbol ; symbol fuzzy matching? + (setf symbol-name (symbol-name symbol)) + (setf internal-p input-internal-p) + (setf real-package-name (cond ((keywordp symbol) "") + ((not user-package-name) nil) + (t package-name)))) + (t ; package fuzzy matching? + (setf symbol-name "") + (setf real-package-name package-name) + ;; If no explicit package name was given by the user + ;; (e.g. input was "asdf"), we want to append only + ;; one colon ":" to the package names. + (setf internal-p (if user-package-name input-internal-p nil)))) + (values symbol-name + real-package-name + (if user-package-name internal-p nil) + (completion-output-symbol-converter user-input-string) + (completion-output-package-converter user-input-string)))))) + +(defun fuzzy-format-matching (fuzzy-matching user-input-string) + "Returns the completion (\"foo:bar\") that's represented by FUZZY-MATCHING." + (multiple-value-bind (symbol-name package-name internal-p symbol-converter package-converter) + (%fuzzy-extract-matching-info fuzzy-matching user-input-string) + (setq symbol-name (and symbol-name (funcall symbol-converter symbol-name))) + (setq package-name (and package-name (funcall package-converter package-name))) + (let ((result (untokenize-symbol package-name internal-p symbol-name))) + ;; We return the length of the possibly added prefix as second value. + (values result (search symbol-name result))))) -(defun fuzzy-convert-matching-for-emacs (fuzzy-matching converter - internal-p package-name) +(defun fuzzy-convert-matching-for-emacs (fuzzy-matching user-input-string) "Converts a result from the fuzzy completion core into something that emacs is expecting. Converts symbols to strings, fixes case issues, and adds information describing if the symbol @@ -97,24 +138,17 @@ a :special-operator, or a :package." (with-struct (fuzzy-matching. symbol score package-chunks symbol-chunks) fuzzy-matching (multiple-value-bind (name added-length) - (format-completion-result - (funcall (or converter #'identity) (symbol-name symbol)) - internal-p package-name) + (fuzzy-format-matching fuzzy-matching user-input-string) (list name - score - (append package-chunks + score + (append package-chunks (mapcar #'(lambda (chunk) ;; Fix up chunk positions to account for possible ;; added package identifier. (let ((offset (first chunk)) (string (second chunk))) (list (+ added-length offset) string))) symbol-chunks)) - (classify-symbol symbol))))) - -(defun format-completion-result (string internal-p package-name) - (let ((result (untokenize-symbol package-name internal-p string))) - ;; We return the length of the possibly added prefix as second value. - (values result (search string result)))) + (classify-symbol symbol))))) (defun fuzzy-completion-set (string default-package-name &key limit time-limit-in-msec) "Returns two values: an array of completion objects, sorted by @@ -125,113 +159,140 @@ exhausted." (check-type limit (or null (integer 0 #.(1- most-positive-fixnum)))) (check-type time-limit-in-msec (or null (integer 0 #.(1- most-positive-fixnum)))) - (multiple-value-bind (completion-set interrupted-p) - (fuzzy-create-completion-set string default-package-name - time-limit-in-msec) + (multiple-value-bind (matchings interrupted-p) + (fuzzy-generate-matchings string default-package-name time-limit-in-msec) (when (and limit (> limit 0) - (< limit (length completion-set))) - (if (array-has-fill-pointer-p completion-set) - (setf (fill-pointer completion-set) limit) - (setf completion-set (make-array limit :displaced-to completion-set)))) - (values completion-set interrupted-p))) + (< limit (length matchings))) + (if (array-has-fill-pointer-p matchings) + (setf (fill-pointer matchings) limit) + (setf matchings (make-array limit :displaced-to matchings)))) + (map-into matchings #'(lambda (m) + (fuzzy-convert-matching-for-emacs m string)) + matchings) + (values matchings interrupted-p))) -(defun fuzzy-create-completion-set (string default-package-name time-limit-in-msec) +(defun fuzzy-generate-matchings (string default-package-name time-limit-in-msec) "Does all the hard work for FUZZY-COMPLETION-SET. If TIME-LIMIT-IN-MSEC is NIL, an infinite time limit is assumed." - (multiple-value-bind (parsed-name parsed-package-name package internal-p) + (multiple-value-bind (parsed-symbol-name parsed-package-name package internal-p) (parse-completion-arguments string default-package-name) - (flet ((convert (matchings package-name &optional converter) - ;; Converts MATCHINGS to completion objects for Emacs. - ;; PACKAGE-NAME is the package identifier that's used as prefix - ;; during formatting. If NIL, the identifier is omitted. - (map-into matchings - #'(lambda (m) - (fuzzy-convert-matching-for-emacs m converter - internal-p - package-name)) - matchings)) - (fix-up (matchings parent-package-matching) + (flet ((fix-up (matchings parent-package-matching) ;; The components of each matching in MATCHINGS have been computed ;; relatively to PARENT-PACKAGE-MATCHING. Make them absolute. (let* ((p parent-package-matching) + (p.name (fuzzy-matching.package-name p)) (p.score (fuzzy-matching.score p)) (p.chunks (fuzzy-matching.package-chunks p))) (map-into matchings #'(lambda (m) (let ((m.score (fuzzy-matching.score m))) + (setf (fuzzy-matching.package-name m) p.name) (setf (fuzzy-matching.package-chunks m) p.chunks) (setf (fuzzy-matching.score m) - (if (string= parsed-name "") + (if (equal parsed-symbol-name "") ;; (Make package matchings be sorted before all the - ;; relative symbol matchings while preserving over + ;; relative symbol matchings while preserving over ;; all orderness.) (/ p.score 100) (+ p.score m.score))) m)) matchings))) - (find-symbols (designator package time-limit) + (find-symbols (designator package time-limit &optional filter) (fuzzy-find-matching-symbols designator package :time-limit-in-msec time-limit - :external-only (not internal-p))) - (find-packages (designator time-limit) - (fuzzy-find-matching-packages designator :time-limit-in-msec time-limit))) - (let ((symbol-normalizer (completion-output-symbol-converter string)) - (package-normalizer #'(lambda (package-name) - (let ((converter (completion-output-package-converter string))) - ;; Present packages with a trailing colon for maximum convenience! - (concatenate 'string (funcall converter package-name) ":")))) - (time-limit time-limit-in-msec) (symbols) (packages) (results)) - (cond ((not parsed-package-name) ; E.g. STRING = "asd" + :external-only (not internal-p) + :filter (or filter #'identity))) + (find-packages (designator time-limit) + (fuzzy-find-matching-packages designator :time-limit-in-msec time-limit))) + (let ((time-limit time-limit-in-msec) (symbols) (packages) (results)) + (cond ((not parsed-package-name) ; E.g. STRING = "asd" ;; We don't know if user is searching for a package or a symbol ;; within his current package. So we try to find either. - (setf (values packages time-limit) (find-packages parsed-name time-limit)) - (setf (values symbols time-limit) (find-symbols parsed-name package time-limit)) - (setf symbols (convert symbols nil symbol-normalizer)) - (setf packages (convert packages nil package-normalizer))) + (setf (values packages time-limit) (find-packages parsed-symbol-name time-limit)) + (setf (values symbols time-limit) (find-symbols parsed-symbol-name package time-limit))) ((string= parsed-package-name "") ; E.g. STRING = ":" or ":foo" - (setf (values symbols time-limit) (find-symbols parsed-name package time-limit)) - (setf symbols (convert symbols "" symbol-normalizer))) - (t ; E.g. STRING = "asd:" or "asd:foo" + (setf (values symbols time-limit) (find-symbols parsed-symbol-name package time-limit))) + (t ; E.g. STRING = "asd:" or "asd:foo" ;; Find fuzzy matchings of the denoted package identifier part. ;; After that, find matchings for the denoted symbol identifier ;; relative to all the packages found. - (multiple-value-bind (found-packages rest-time-limit) - (find-packages parsed-package-name time-limit-in-msec) - (loop - for package-matching across found-packages - for package-sym = (fuzzy-matching.symbol package-matching) - for package-name = (funcall symbol-normalizer (symbol-name package-sym)) - for package = (find-package package-sym) - while (or (not time-limit) (> rest-time-limit 0)) do - (multiple-value-bind (matchings remaining-time) - (find-symbols parsed-name package rest-time-limit) - (setf matchings (fix-up matchings package-matching)) - (setf matchings (convert matchings package-name symbol-normalizer)) - (setf symbols (concatenate 'vector symbols matchings)) - (setf rest-time-limit remaining-time)) - finally ; CONVERT is destructive. So we have to do this at last. - (setf time-limit rest-time-limit) - (setf packages (when (string= parsed-name "") - (convert found-packages nil package-normalizer))))))) - ;; Sort alphabetically before sorting by score. (Especially useful when - ;; PARSED-NAME is empty, and all possible completions are to be returned.) + (multiple-value-bind (found-packages rest-time-limit) + (find-packages parsed-package-name time-limit-in-msec) + (loop + for package-matching across found-packages + for package = (find-package (fuzzy-matching.package-name package-matching)) + while (or (not time-limit) (> rest-time-limit 0)) do + (multiple-value-bind (matchings remaining-time) + (find-symbols parsed-symbol-name package rest-time-limit + (%make-duplicate-symbols-filter + (remove package-matching found-packages))) + (setf matchings (fix-up matchings package-matching)) + (setf symbols (concatenate 'vector symbols matchings)) + (setf rest-time-limit remaining-time) + (let ((guessed-sort-duration (%guess-sort-duration (length symbols)))) + (when (<= rest-time-limit guessed-sort-duration) + (decf rest-time-limit guessed-sort-duration) + (loop-finish)))) + finally + (setf time-limit rest-time-limit) + (when (equal parsed-symbol-name "") ; E.g. STRING = "asd:" + (setf packages found-packages)))))) + ;; Sort by score; thing with equal score, sort alphabetically. + ;; (Especially useful when PARSED-SYMBOL-NAME is empty, and all possible + ;; completions are to be returned.) (setf results (concatenate 'vector symbols packages)) - (setf results (sort results #'string< :key #'first)) ; SORT + #'STRING-LESSP - (setf results (stable-sort results #'> :key #'second)); conses on at least SBCL 0.9.18. + (setf results (sort results #'fuzzy-matching-greaterp)) (values results (and time-limit (<= time-limit 0))))))) +(defun %guess-sort-duration (length) + ;; These numbers are pretty much arbitrary, except that they're + ;; vaguely correct on my machine with SBCL. Yes, this is an ugly + ;; kludge, but it's better than before (where this didn't exist at + ;; all, which essentially meant, that this was taken to be 0.) + (if (zerop length) + 0 + (let ((comparasions (* 3.8 (* length (log length 2))))) + (* 1000 (* comparasions (expt 10 -7)))))) ; msecs + +(defun %make-duplicate-symbols-filter (fuzzy-package-matchings) + ;; Returns a filter function that takes a symbol and which returns T + ;; if one of FUZZY-PACKAGE-MATCHINGS represents the home-package of + ;; the symbol. + (let ((packages (mapcar #'(lambda (m) + (find-package (fuzzy-matching.package-name m))) + (coerce fuzzy-package-matchings 'list)))) + #'(lambda (symbol) + (member (symbol-package symbol) packages)))) + +(defun fuzzy-matching-greaterp (m1 m2) + "Returns T if fuzzy-matching M1 should be sorted before M2. +Basically just the scores of the two matchings are compared, and +the match with higher score wins. For the case that the score is +equal, the one which comes alphabetically first wins." + (declare (type fuzzy-matching m1 m2)) + (let ((score1 (fuzzy-matching.score m1)) + (score2 (fuzzy-matching.score m2))) + (cond ((> score1 score2) t) + ((< score1 score2) nil) ; total order + (t + (let ((name1 (symbol-name (fuzzy-matching.symbol m1))) + (name2 (symbol-name (fuzzy-matching.symbol m2)))) + (string< name1 name2)))))) + (defun get-real-time-in-msecs () (let ((units-per-msec (max 1 (floor internal-time-units-per-second 1000)))) (values (floor (get-internal-real-time) units-per-msec)))) ; return just one value! - -(defun fuzzy-find-matching-symbols (string package &key external-only time-limit-in-msec) +(defun fuzzy-find-matching-symbols + (string package &key (filter #'identity) external-only time-limit-in-msec) "Returns two values: a vector of fuzzy matchings for matching -symbols in PACKAGE, using the fuzzy completion algorithm; the -remaining time limit. +symbols in PACKAGE, using the fuzzy completion algorithm, and the +remaining time limit. + +Only those symbols are considered of which FILTER does not return T. If EXTERNAL-ONLY is true, only external symbols are considered. A TIME-LIMIT-IN-MSEC of NIL is considered no limit; if it's zero or @@ -239,6 +300,7 @@ (let ((time-limit-p (and time-limit-in-msec t)) (time-limit (or time-limit-in-msec 0)) (rtime-at-start (get-real-time-in-msecs)) + (package-name (package-name package)) (count 0)) (declare (type boolean time-limit-p)) (declare (type integer time-limit rtime-at-start)) @@ -265,16 +327,19 @@ (recompute-remaining-time rest-time-limit) (setf rest-time-limit remaining-time) (cond (exhausted? (return-from loop)) + ((funcall filter symbol) :continue) ((or (not external-only) (symbol-external-p symbol package)) - (if (string= "" string) ; "" matchs always - (vector-push-extend (make-fuzzy-matching symbol 0.0 '() '()) - completions) + (if (string= "" string) ; "" matches always + (vector-push-extend (make-fuzzy-matching symbol package-name + 0.0 '() '()) + completions) (multiple-value-bind (match-result score) (perform-fuzzy-match string (symbol-name symbol)) (when match-result - (vector-push-extend - (make-fuzzy-matching symbol score '() match-result) - completions))))))))) + (vector-push-extend + (make-fuzzy-matching symbol package-name score + '() match-result) + completions))))))))) (values completions rest-time-limit))))) @@ -292,15 +357,25 @@ (declare (type function converter)) (if (and time-limit-p (<= time-limit 0)) (values #() time-limit) - (loop for package-name in (mapcan #'package-names (list-all-packages)) - for converted-name = (funcall converter package-name) - for package-symbol = (or (find-symbol package-name) - (make-symbol package-name)) ; no INTERN - do (multiple-value-bind (result score) - (compute-highest-scoring-completion name converted-name) - (when result - (vector-push-extend (make-fuzzy-matching package-symbol score result '()) - completions))) + (loop for package in (list-all-packages) do + ;; Find best-matching package-nickname: + (loop with max-pkg-name = "" + with max-result = nil + with max-score = 0 + for package-name in (package-names package) + for converted-name = (funcall converter package-name) + do + (multiple-value-bind (result score) + (compute-highest-scoring-completion name converted-name) + (when (and result (> score max-score)) + (setf max-pkg-name package-name) + (setf max-result result) + (setf max-score score))) + finally + (when max-result + (vector-push-extend (make-fuzzy-matching nil max-pkg-name + max-score max-result '()) + completions))) finally (return (values completions From trittweiler at common-lisp.net Fri Sep 14 23:24:19 2007 From: trittweiler at common-lisp.net (trittweiler) Date: Fri, 14 Sep 2007 19:24:19 -0400 (EDT) Subject: [slime-cvs] CVS slime/contrib Message-ID: <20070914232419.DF1E52B127@common-lisp.net> Update of /project/slime/cvsroot/slime/contrib In directory clnet:/tmp/cvs-serv9764 Modified Files: ChangeLog Log Message: * swank-fuzzy.lisp: Code reorganization and cleanup; making it compute less and couple of other minor issues fixed on the way. Thanks to Stelian Ionescu for testing and providing feedback! (defstruct fuzzy-matching): New `package-name' slot. (make-fuzzy-matching): Updated for new slot. (format-completion-result): Renamed to `fuzzy-format-matching'. (%fuzzy-extract-matching-info): Helper for `fuzzy-format-matching'. (fuzzy-completion-set): Convert the matchings after they got truncated to the passed completion-set limit from Emacs. I.e. `slime-fuzzy-completion-limit' This means a huge computational reduction. (fuzzy-create-completion-set): Renamed to `fuzzy-generate-matchings'. (fuzzy-generate-matchings): Returns the fuzzy matchings themselves, do not yet convert them for Emacs. Do not perform two sorts on the generated matchings (first alphabetically, then per score), but just one with an appropriate predicate that sorts per score, unless matchings are equal, then sort alphabetically. Prune matchings with symbols which are found in a differenta package than their home package when the home package is among the matched packages. Try to take the time needed to sort the generated matchings into account for the time-limit. (%guess-sort-duration): Helper. Tries to guess how long the sort will take. (%make-duplicate-symbols-filter): Helper. Used for pruning of matchings. (fuzzy-matching-greaterp): New testing predicate for sorting. (fuzzy-find-matching-symbols): Now takes a :filter keyarg; only considers symbols that pass through the filter. (fuzzy-find-matching-packages): Do not return matchings for all nicknames of package, but just the one that matches best. --- /project/slime/cvsroot/slime/contrib/ChangeLog 2007/09/11 17:11:08 1.47 +++ /project/slime/cvsroot/slime/contrib/ChangeLog 2007/09/14 23:24:19 1.48 @@ -1,3 +1,40 @@ +2007-09-15 Tobias C. Rittweiler + + * swank-fuzzy.lisp: Code reorganization and cleanup; making it + compute less and couple of other minor issues fixed on the + way. Thanks to Stelian Ionescu for testing and providing feedback! + + (defstruct fuzzy-matching): New `package-name' slot. + (make-fuzzy-matching): Updated for new slot. + (format-completion-result): Renamed to `fuzzy-format-matching'. + (%fuzzy-extract-matching-info): Helper for `fuzzy-format-matching'. + + (fuzzy-completion-set): Convert the matchings after they got + truncated to the passed completion-set limit from Emacs. + I.e. `slime-fuzzy-completion-limit' This means a huge + computational reduction. + + (fuzzy-create-completion-set): Renamed to `fuzzy-generate-matchings'. + (fuzzy-generate-matchings): Returns the fuzzy matchings + themselves, do not yet convert them for Emacs. Do not perform two + sorts on the generated matchings (first alphabetically, then per + score), but just one with an appropriate predicate that sorts per + score, unless matchings are equal, then sort alphabetically. Prune + matchings with symbols which are found in a differenta package + than their home package when the home package is among the matched + packages. Try to take the time needed to sort the generated + matchings into account for the time-limit. + (%guess-sort-duration): Helper. + Tries to guess how long the sort will take. + (%make-duplicate-symbols-filter): Helper. + Used for pruning of matchings. + (fuzzy-matching-greaterp): New testing predicate for sorting. + + (fuzzy-find-matching-symbols): Now takes a :filter keyarg; only + considers symbols that pass through the filter. + (fuzzy-find-matching-packages): Do not return matchings for all + nicknames of package, but just the one that matches best. + 2007-09-11 Tobias C. Rittweiler * slime-editing-commands.el: Automatically bind the editing From trittweiler at common-lisp.net Sat Sep 15 11:09:36 2007 From: trittweiler at common-lisp.net (trittweiler) Date: Sat, 15 Sep 2007 07:09:36 -0400 (EDT) Subject: [slime-cvs] CVS slime/contrib Message-ID: <20070915110936.0DBFF650D3@common-lisp.net> Update of /project/slime/cvsroot/slime/contrib In directory clnet:/tmp/cvs-serv28484 Modified Files: slime-parse.el Log Message: * slime-parse.el: Fix extended arglist display on misbalanced expressions like `(defun foo | ... (defun bar () 'bar)' Reported by Ariel Badichi. (slime-inside-string-p): Use `beginning-of-defun' directly than relying on `slime-region-for-defun-at-point' (as this one uses `end-of-defun' which signals an error on misbalanced expressions.) --- /project/slime/cvsroot/slime/contrib/slime-parse.el 2007/09/11 17:04:17 1.6 +++ /project/slime/cvsroot/slime/contrib/slime-parse.el 2007/09/15 11:09:36 1.7 @@ -220,7 +220,14 @@ representation of a form, the string representation of this form is stripped from the form. This can be important to avoid mutual recursion between this function, `slime-enclosing-form-specs' and -`slime-parse-extended-operator-name'." +`slime-parse-extended-operator-name'. + +Examples: + + \"(foo (bar 1 (baz :quux)) 'toto)\" + + => (\"foo\" (\"bar\" \"1\" (\"baz\" \":quux\")) \"'toto\") +" (cond ((slime-length= string 0) "") ((equal string "()") '()) (t @@ -267,9 +274,9 @@ parens. \(See SWANK::PARSE-FORM-SPEC for more information about what -exactly constitutes a ``raw form specs'' +exactly constitutes a ``raw form specs'') -Example:) +Examples: A return value like the following @@ -355,7 +362,7 @@ (if (listp thing) thing (list thing))) (defun slime-inside-string-p () - (let* ((toplevel-begin (first (slime-region-for-defun-at-point))) + (let* ((toplevel-begin (save-excursion (beginning-of-defun) (point))) (parse-result (parse-partial-sexp toplevel-begin (point))) (inside-string-p (nth 3 parse-result)) (string-start-pos (nth 8 parse-result))) From trittweiler at common-lisp.net Sat Sep 15 11:11:43 2007 From: trittweiler at common-lisp.net (trittweiler) Date: Sat, 15 Sep 2007 07:11:43 -0400 (EDT) Subject: [slime-cvs] CVS slime/contrib Message-ID: <20070915111143.997B174016@common-lisp.net> Update of /project/slime/cvsroot/slime/contrib In directory clnet:/tmp/cvs-serv28705 Modified Files: ChangeLog Log Message: * slime-parse.el: Fix extended arglist display on misbalanced expressions like `(defun foo | ... (defun bar () 'bar)' Reported by Ariel Badichi. (slime-inside-string-p): Use `beginning-of-defun' directly than relying on `slime-region-for-defun-at-point' (as this one uses `end-of-defun' which signals an error on misbalanced expressions.) --- /project/slime/cvsroot/slime/contrib/ChangeLog 2007/09/14 23:24:19 1.48 +++ /project/slime/cvsroot/slime/contrib/ChangeLog 2007/09/15 11:11:43 1.49 @@ -1,5 +1,16 @@ 2007-09-15 Tobias C. Rittweiler + * slime-parse.el: Fix extended arglist display on misbalanced + expressions like `(defun foo | ... (defun bar () 'bar)' + Reported by Ariel Badichi. + + (slime-inside-string-p): Use `beginning-of-defun' directly than + relying on `slime-region-for-defun-at-point' (as this one uses + `end-of-defun' which signals an error on misbalanced expressions.) + + +2007-09-15 Tobias C. Rittweiler + * swank-fuzzy.lisp: Code reorganization and cleanup; making it compute less and couple of other minor issues fixed on the way. Thanks to Stelian Ionescu for testing and providing feedback! From trittweiler at common-lisp.net Sat Sep 15 11:29:22 2007 From: trittweiler at common-lisp.net (trittweiler) Date: Sat, 15 Sep 2007 07:29:22 -0400 (EDT) Subject: [slime-cvs] CVS slime/contrib Message-ID: <20070915112922.D1F41111D1@common-lisp.net> Update of /project/slime/cvsroot/slime/contrib In directory clnet:/tmp/cvs-serv31534/contrib Modified Files: swank-fancy-inspector.lisp Log Message: * swank-fancy-inspector.lisp (inspect-for-emacs package): When inspecting a package, the links in the use list and the used-by list lead to inspecting package names, rather than the packages themselves. Fix that. --- /project/slime/cvsroot/slime/contrib/swank-fancy-inspector.lisp 2007/08/23 19:04:15 1.2 +++ /project/slime/cvsroot/slime/contrib/swank-fancy-inspector.lisp 2007/09/15 11:29:22 1.3 @@ -470,8 +470,8 @@ (declare (ignore inspector)) (let ((package-name (package-name package)) (package-nicknames (package-nicknames package)) - (package-use-list (mapcar #'package-name (package-use-list package))) - (package-used-by-list (mapcar #'package-name (package-used-by-list package))) + (package-use-list (package-use-list package)) + (package-used-by-list (package-used-by-list package)) (shadowed-symbols (package-shadowing-symbols package)) (present-symbols '()) (present-symbols-length 0) (internal-symbols '()) (internal-symbols-length 0) @@ -486,8 +486,8 @@ (progn (push sym external-symbols) (incf external-symbols-length)))))) (setf package-nicknames (sort (copy-list package-nicknames) #'string<) - package-use-list (sort (copy-list package-use-list) #'string<) - package-used-by-list (sort (copy-list package-used-by-list) #'string<) + package-use-list (sort (copy-list package-use-list) #'string< :key #'package-name) + package-used-by-list (sort (copy-list package-used-by-list) #'string< :key #'package-name) shadowed-symbols (sort (copy-list shadowed-symbols) #'string<)) (setf present-symbols (sort present-symbols #'string<) ; SORT + STRING-LESSP From trittweiler at common-lisp.net Sat Sep 15 11:30:33 2007 From: trittweiler at common-lisp.net (trittweiler) Date: Sat, 15 Sep 2007 07:30:33 -0400 (EDT) Subject: [slime-cvs] CVS slime/contrib Message-ID: <20070915113033.F163A1D113@common-lisp.net> Update of /project/slime/cvsroot/slime/contrib In directory clnet:/tmp/cvs-serv31691/contrib Modified Files: ChangeLog Log Message: * swank-fancy-inspector.lisp (inspect-for-emacs package): When inspecting a package, the links in the use list and the used-by list lead to inspecting package names, rather than the packages themselves. Fix that. --- /project/slime/cvsroot/slime/contrib/ChangeLog 2007/09/15 11:11:43 1.49 +++ /project/slime/cvsroot/slime/contrib/ChangeLog 2007/09/15 11:30:33 1.50 @@ -1,3 +1,10 @@ +2007-09-15 Ariel Badichi + + * swank-fancy-inspector.lisp (inspect-for-emacs package): When + inspecting a package, the links in the use list and the used-by + list lead to inspecting package names, rather than the packages + themselves. Fix that. + 2007-09-15 Tobias C. Rittweiler * slime-parse.el: Fix extended arglist display on misbalanced @@ -7,7 +14,6 @@ (slime-inside-string-p): Use `beginning-of-defun' directly than relying on `slime-region-for-defun-at-point' (as this one uses `end-of-defun' which signals an error on misbalanced expressions.) - 2007-09-15 Tobias C. Rittweiler From trittweiler at common-lisp.net Sat Sep 15 12:52:02 2007 From: trittweiler at common-lisp.net (trittweiler) Date: Sat, 15 Sep 2007 08:52:02 -0400 (EDT) Subject: [slime-cvs] CVS slime Message-ID: <20070915125202.EC12932015@common-lisp.net> Update of /project/slime/cvsroot/slime In directory clnet:/tmp/cvs-serv23118 Modified Files: slime.el Log Message: * slime.el (slime-split-string): New semi-portability function. The behaviour of `split-string' changed between Emacs21 and Emacs22. Thanks to Christophe Rhodes for reporting this. (slime-file-name-merge-source-root): Use `slime-split-string'. (slime-highlight-differences-in-dirname): Likewise. --- /project/slime/cvsroot/slime/slime.el 2007/09/14 13:36:23 1.860 +++ /project/slime/cvsroot/slime/slime.el 2007/09/15 12:52:01 1.861 @@ -4552,8 +4552,8 @@ ==> \"/usr/local/src/joe/hacked/sbcl/code/late-extensions.lisp\" " - (let ((target-dirs (split-string (file-name-directory target-filename) "/" t)) - (buffer-dirs (split-string (file-name-directory buffer-filename) "/" t))) + (let ((target-dirs (slime-split-string (file-name-directory target-filename) "/" t)) + (buffer-dirs (slime-split-string (file-name-directory buffer-filename) "/" t))) ;; Starting from the end, we look if one of the TARGET-DIRS exists ;; in BUFFER-FILENAME---if so, it and everything left from that dirname ;; is considered to be the source root directory of BUFFER-FILENAME. @@ -4577,13 +4577,15 @@ "Returns a copy of BASE-DIRNAME where all differences between BASE-DIRNAME and CONTRAST-DIRNAME are propertized with a highlighting face." + (setq base-dirname (file-name-as-directory base-dirname)) + (setq contrast-dirname (file-name-as-directory contrast-dirname)) (flet ((insert-dir (dirname) (insert (file-name-as-directory dirname))) (insert-dir/propzd (dirname) (slime-insert-propertized '(face highlight) dirname) (insert "/"))) ; Not exactly portable (to VMS...) - (let ((base-dirs (split-string (file-name-as-directory base-dirname) "/" t)) - (contrast-dirs (split-string (file-name-as-directory contrast-dirname) "/" t))) + (let ((base-dirs (slime-split-string base-dirname "/" t)) + (contrast-dirs (slime-split-string contrast-dirname "/" t))) (with-temp-buffer (loop initially (insert (file-name-as-directory "/")) for base-dir in base-dirs do @@ -9034,6 +9036,21 @@ (or (< n 0) (and seq t))) (sequence (> (length seq) n)))) +(defun slime-split-string (string &optional separators omit-nulls) + "This is like `split-string' in Emacs22, but also works in +Emacs20 and 21." + (let ((splits (split-string string separators))) + (if omit-nulls + (setq splits (remove "" splits)) + ;; SPLIT-STRING in Emacs before 22.x automatically removed nulls + ;; at beginning and end, so we gotta add them here again. + (when (or (slime-emacs-20-p) (slime-emacs-21-p)) + (when (find (elt string 0) separators) + (push "" splits)) + (when (find (elt string (1- (length string))) separators) + (setq splits (append splits (list "")))))) + splits)) + ;;;;; Buffer related (defun slime-buffer-narrowed-p (&optional buffer) @@ -9058,7 +9075,7 @@ (save-match-data (end-of-defun) (let ((end (point))) - (beginning-of-defun) + (beginning-of-sexp) (list (point) end))))) (defun slime-beginning-of-symbol () @@ -9402,6 +9419,10 @@ (and (not (featurep 'xemacs)) (= emacs-major-version 20))) +(defun slime-emacs-21-p () + (and (not (featurep 'xemacs)) + (= emacs-major-version 21))) + (when (featurep 'xemacs) (add-hook 'sldb-hook 'sldb-xemacs-emulate-point-entered-hook)) From trittweiler at common-lisp.net Sat Sep 15 12:52:59 2007 From: trittweiler at common-lisp.net (trittweiler) Date: Sat, 15 Sep 2007 08:52:59 -0400 (EDT) Subject: [slime-cvs] CVS slime Message-ID: <20070915125259.0DB6D586E9@common-lisp.net> Update of /project/slime/cvsroot/slime In directory clnet:/tmp/cvs-serv23236 Modified Files: ChangeLog Log Message: * slime.el (slime-split-string): New semi-portability function. The behaviour of `split-string' changed between Emacs21 and Emacs22. Thanks to Christophe Rhodes for reporting this. (slime-file-name-merge-source-root): Use `slime-split-string'. (slime-highlight-differences-in-dirname): Likewise. --- /project/slime/cvsroot/slime/ChangeLog 2007/09/14 13:36:23 1.1216 +++ /project/slime/cvsroot/slime/ChangeLog 2007/09/15 12:52:58 1.1217 @@ -1,3 +1,11 @@ +2007-09-15 Tobias C. Rittweiler + + * slime.el (slime-split-string): New semi-portability function. + The behaviour of `split-string' changed between Emacs21 and + Emacs22. Thanks to Christophe Rhodes for reporting this. + (slime-file-name-merge-source-root): Use `slime-split-string'. + (slime-highlight-differences-in-dirname): Likewise. + 2007-09-14 Helmut Eller Some cleanups for the REPL. From trittweiler at common-lisp.net Sat Sep 15 14:23:43 2007 From: trittweiler at common-lisp.net (trittweiler) Date: Sat, 15 Sep 2007 10:23:43 -0400 (EDT) Subject: [slime-cvs] CVS slime Message-ID: <20070915142343.E19481903C@common-lisp.net> Update of /project/slime/cvsroot/slime In directory clnet:/tmp/cvs-serv8050 Modified Files: slime.el Log Message: * slime.el (slime-maybe-warn-for-different-source-root): Catch returned NIL from `slime-file-name-merge-source-root' if the two filenames don't share a common source root. Reported by Frank Goenninger. --- /project/slime/cvsroot/slime/slime.el 2007/09/15 12:52:01 1.861 +++ /project/slime/cvsroot/slime/slime.el 2007/09/15 14:23:43 1.862 @@ -4546,6 +4546,8 @@ "Returns a filename where the source root directory of TARGET-FILENAME is replaced with the source root directory of BUFFER-FILENAME. +If no common source root could be determined, return NIL. + E.g. (slime-file-name-merge-source-root \"/usr/local/src/joe/upstream/sbcl/code/late-extensions.lisp\" \"/usr/local/src/joe/hacked/sbcl/compiler/deftype.lisp\") @@ -4622,7 +4624,8 @@ (when slime-warn-when-possibly-tricked-by-M-. (let ((guessed-target (slime-file-name-merge-source-root target-filename buffer-filename))) - (when (and (not (equal guessed-target target-filename)) + (when (and guessed-target + (not (equal guessed-target target-filename)) (or t (file-exists-p guessed-target))) (slime-message "Attention: This is `%s'." (concat (slime-highlight-differences-in-dirname From trittweiler at common-lisp.net Sat Sep 15 14:24:31 2007 From: trittweiler at common-lisp.net (trittweiler) Date: Sat, 15 Sep 2007 10:24:31 -0400 (EDT) Subject: [slime-cvs] CVS slime Message-ID: <20070915142431.8607F1D10F@common-lisp.net> Update of /project/slime/cvsroot/slime In directory clnet:/tmp/cvs-serv8110 Modified Files: ChangeLog Log Message: * slime.el (slime-maybe-warn-for-different-source-root): Catch returned NIL from `slime-file-name-merge-source-root' if the two filenames don't share a common source root. Reported by Frank Goenninger. --- /project/slime/cvsroot/slime/ChangeLog 2007/09/15 12:52:58 1.1217 +++ /project/slime/cvsroot/slime/ChangeLog 2007/09/15 14:24:31 1.1218 @@ -1,5 +1,12 @@ 2007-09-15 Tobias C. Rittweiler + * slime.el (slime-maybe-warn-for-different-source-root): Catch + returned NIL from `slime-file-name-merge-source-root' if the two + filenames don't share a common source root. + Reported by Frank Goenninger. + +2007-09-15 Tobias C. Rittweiler + * slime.el (slime-split-string): New semi-portability function. The behaviour of `split-string' changed between Emacs21 and Emacs22. Thanks to Christophe Rhodes for reporting this. From trittweiler at common-lisp.net Sat Sep 15 14:29:02 2007 From: trittweiler at common-lisp.net (trittweiler) Date: Sat, 15 Sep 2007 10:29:02 -0400 (EDT) Subject: [slime-cvs] CVS slime Message-ID: <20070915142902.13B4C2B129@common-lisp.net> Update of /project/slime/cvsroot/slime In directory clnet:/tmp/cvs-serv8497 Modified Files: slime.el Log Message: * slime.el (slime-maybe-warn-for-different-source-root): Catch returned NIL from `slime-file-name-merge-source-root' if the two filenames don't share a common source root. Reported by Frank Goenninger. --- /project/slime/cvsroot/slime/slime.el 2007/09/15 14:23:43 1.862 +++ /project/slime/cvsroot/slime/slime.el 2007/09/15 14:29:01 1.863 @@ -4626,7 +4626,7 @@ buffer-filename))) (when (and guessed-target (not (equal guessed-target target-filename)) - (or t (file-exists-p guessed-target))) + (file-exists-p guessed-target)) (slime-message "Attention: This is `%s'." (concat (slime-highlight-differences-in-dirname (file-name-directory target-filename) From heller at common-lisp.net Sat Sep 15 15:15:27 2007 From: heller at common-lisp.net (heller) Date: Sat, 15 Sep 2007 11:15:27 -0400 (EDT) Subject: [slime-cvs] CVS slime Message-ID: <20070915151527.065C11903D@common-lisp.net> Update of /project/slime/cvsroot/slime In directory clnet:/tmp/cvs-serv15559 Modified Files: ChangeLog slime.el slime-autoloads.el Log Message: Let slime-setup load contribs. * slime.el (slime-setup): Take a list of contribs to load as argument. * slime-autoloads.el (slime-setup): Ditto, but delay the actual loading until slime is loaded. (slime-setup-contribs): New function. Add the necessary hooks when loading some contribs, so that those contribs can be easily loaded with slime-setup. * slime-highlight-edits.el (slime-highlight-edits-mode-on): New function. Add this to slime-mode-hook by default. * slime-autodoc.el (slime-use-autodoc-mode): Change default to t. --- /project/slime/cvsroot/slime/ChangeLog 2007/09/15 14:24:31 1.1218 +++ /project/slime/cvsroot/slime/ChangeLog 2007/09/15 15:15:25 1.1219 @@ -1,3 +1,14 @@ +2007-09-15 Helmut Eller + + Let slime-setup load contribs. + + * slime.el (slime-setup): Take a list of contribs to load as + argument. + + * slime-autoloads.el (slime-setup): Ditto, but delay the actual + loading until slime is loaded. + (slime-setup-contribs): New function. + 2007-09-15 Tobias C. Rittweiler * slime.el (slime-maybe-warn-for-different-source-root): Catch --- /project/slime/cvsroot/slime/slime.el 2007/09/15 14:29:01 1.863 +++ /project/slime/cvsroot/slime/slime.el 2007/09/15 15:15:25 1.864 @@ -68,16 +68,14 @@ "When non-nil highlight buffers with compilation notes, warnings and errors." ) -(defun* slime-setup (&key autodoc typeout-frame highlight-edits) - "Setup Emacs so that lisp-mode buffers always use SLIME." +(defun slime-setup (&optional contribs) + "Setup Emacs so that lisp-mode buffers always use SLIME. +CONTRIBS is a list of contrib packages to load." (when (member 'lisp-mode slime-lisp-modes) (add-hook 'lisp-mode-hook 'slime-lisp-mode-hook)) (when (member 'scheme-mode slime-lisp-modes) (add-hook 'scheme-mode-hook 'slime-scheme-mode-hook)) - (when typeout-frame - (add-hook 'slime-connected-hook 'slime-ensure-typeout-frame)) - (setq slime-use-autodoc-mode autodoc) - (setq slime-use-highlight-edits-mode highlight-edits)) + (mapc #'require contribs)) (defun slime-shared-lisp-mode-hook () (slime-mode 1)) @@ -6345,7 +6343,7 @@ (remap 'undo '(lambda (&optional arg) (interactive) (let ((buffer-read-only nil)) - (when slime-use-highlight-edits-mode + (when (fboundp 'slime-remove-edits) (slime-remove-edits (point-min) (point-max))) (undo arg))))) @@ -6406,7 +6404,7 @@ (lambda (expansion) (with-current-buffer buffer (let ((buffer-read-only nil)) - (when slime-use-highlight-edits-mode + (when (fboundp 'slime-remove-edits) (slime-remove-edits (point-min) (point-max))) (goto-char start) (delete-region start end) --- /project/slime/cvsroot/slime/slime-autoloads.el 2007/01/30 22:22:25 1.1 +++ /project/slime/cvsroot/slime/slime-autoloads.el 2007/09/15 15:15:26 1.2 @@ -28,20 +28,18 @@ (defvar slime-lisp-modes '(lisp-mode)) -(defun slime-setup (&rest options) +(defun slime-setup (&optional contribs) "Setup Emacs so that lisp-mode buffers always use SLIME. -OPTIONS is a keyword list (&key AUTODOC TYPEOUT-FRAME HIGHLIGHT-EDITS): -AUTODOC and HIGHLIGHT-EDITS enable `slime-autodoc-mode' resp. -`slime-highlight-edits-mode'. -If TYPEOUT-FRAME is true, the SLIME will use the typeout window." +CONTRIBS is a list of contrib packages to load." (when (member 'lisp-mode slime-lisp-modes) (add-hook 'lisp-mode-hook 'slime-lisp-mode-hook)) (when (member 'scheme-mode slime-lisp-modes) (add-hook 'scheme-mode-hook 'slime-scheme-mode-hook)) - (when (plist-get options :typeout-frame) - (add-hook 'slime-connected-hook 'slime-ensure-typeout-frame)) - (setq slime-use-autodoc-mode (plist-get options :autodoc)) - (setq slime-use-highlight-edits-mode (plist-get options :highlight-edits))) + (setq slime-setup-contribs contribs) + (add-hook 'slime-load-hook 'slime-setup-contribs)) + +(defvar slime-setup-contribs nil) +(defun slime-setup-contribs () (mapc #'require slime-setup-contribs)) (provide 'slime-autoloads) From heller at common-lisp.net Sat Sep 15 15:15:27 2007 From: heller at common-lisp.net (heller) Date: Sat, 15 Sep 2007 11:15:27 -0400 (EDT) Subject: [slime-cvs] CVS slime/contrib Message-ID: <20070915151527.4B8D01C0CC@common-lisp.net> Update of /project/slime/cvsroot/slime/contrib In directory clnet:/tmp/cvs-serv15559/contrib Modified Files: ChangeLog slime-autodoc.el slime-highlight-edits.el Log Message: Let slime-setup load contribs. * slime.el (slime-setup): Take a list of contribs to load as argument. * slime-autoloads.el (slime-setup): Ditto, but delay the actual loading until slime is loaded. (slime-setup-contribs): New function. Add the necessary hooks when loading some contribs, so that those contribs can be easily loaded with slime-setup. * slime-highlight-edits.el (slime-highlight-edits-mode-on): New function. Add this to slime-mode-hook by default. * slime-autodoc.el (slime-use-autodoc-mode): Change default to t. --- /project/slime/cvsroot/slime/contrib/ChangeLog 2007/09/15 11:30:33 1.50 +++ /project/slime/cvsroot/slime/contrib/ChangeLog 2007/09/15 15:15:27 1.51 @@ -1,5 +1,15 @@ +2007-09-15 Helmut Eller + + Add the necessary hooks when loading some contribs, so that those + contribs can be easily loaded with slime-setup. + + * slime-highlight-edits.el (slime-highlight-edits-mode-on): New + function. Add this to slime-mode-hook by default. + + * slime-autodoc.el (slime-use-autodoc-mode): Change default to t. + 2007-09-15 Ariel Badichi - + * swank-fancy-inspector.lisp (inspect-for-emacs package): When inspecting a package, the links in the use list and the used-by list lead to inspecting package names, rather than the packages --- /project/slime/cvsroot/slime/contrib/slime-autodoc.el 2007/08/31 14:07:54 1.2 +++ /project/slime/cvsroot/slime/contrib/slime-autodoc.el 2007/09/15 15:15:27 1.3 @@ -18,10 +18,9 @@ (require 'slime-parse) -(defvar slime-use-autodoc-mode nil +(defvar slime-use-autodoc-mode t "When non-nil always enable slime-autodoc-mode in slime-mode.") - (defun slime-fontify-string (string) "Fontify STRING as `font-lock-mode' does in Lisp mode." (with-current-buffer (get-buffer-create " *slime-fontify*") --- /project/slime/cvsroot/slime/contrib/slime-highlight-edits.el 2007/08/24 13:43:03 1.1 +++ /project/slime/cvsroot/slime/contrib/slime-highlight-edits.el 2007/09/15 15:15:27 1.2 @@ -1,4 +1,4 @@ -;;; slme-higlight-edits --- highlight edited, i.e. not yet compiled, code +;;; slime-higlight-edits --- highlight edited, i.e. not yet compiled, code ;; ;; Author: William Bland and others ;; License: GNU GPL (same license as Emacs) @@ -88,4 +88,8 @@ (skip-chars-forward " \n\t\r" end) (<= end (point)))) +(defun slime-highlight-edits-mode-on () (slime-highlight-edits-mode 1)) + +(add-hook 'slime-mode-hook 'slime-highlight-edits-mode-on) + (provide 'slime-highlight-edits) \ No newline at end of file From trittweiler at common-lisp.net Sat Sep 15 22:21:22 2007 From: trittweiler at common-lisp.net (trittweiler) Date: Sat, 15 Sep 2007 18:21:22 -0400 (EDT) Subject: [slime-cvs] CVS slime/contrib Message-ID: <20070915222122.17F864407F@common-lisp.net> Update of /project/slime/cvsroot/slime/contrib In directory clnet:/tmp/cvs-serv31659/contrib Modified Files: swank-fuzzy.lisp Log Message: * swank-fuzzy.lisp: Fix regression that would not allow to fuzzy complete on inputs without package qualifier like "app". Reported by David J. Neu. (%make-duplicate-symbols-filter): Return complement. (fuzzy-find-matching-symbols): Treat passed filter as an acceptor predicate, not as a rejector. --- /project/slime/cvsroot/slime/contrib/swank-fuzzy.lisp 2007/09/14 23:24:09 1.5 +++ /project/slime/cvsroot/slime/contrib/swank-fuzzy.lisp 2007/09/15 22:21:21 1.6 @@ -225,6 +225,10 @@ for package = (find-package (fuzzy-matching.package-name package-matching)) while (or (not time-limit) (> rest-time-limit 0)) do (multiple-value-bind (matchings remaining-time) + ;; The filter removes all those symbols which are also present + ;; in one of the other packages, specifically if such a package + ;; represents the home package of the symbol, because that one + ;; is deemed to be the best match. (find-symbols parsed-symbol-name package rest-time-limit (%make-duplicate-symbols-filter (remove package-matching found-packages))) @@ -258,13 +262,13 @@ (defun %make-duplicate-symbols-filter (fuzzy-package-matchings) ;; Returns a filter function that takes a symbol and which returns T - ;; if one of FUZZY-PACKAGE-MATCHINGS represents the home-package of - ;; the symbol. + ;; only if no matching in FUZZY-PACKAGE-MATCHINGS represents the + ;; home-package of the. (let ((packages (mapcar #'(lambda (m) (find-package (fuzzy-matching.package-name m))) (coerce fuzzy-package-matchings 'list)))) #'(lambda (symbol) - (member (symbol-package symbol) packages)))) + (not (member (symbol-package symbol) packages))))) (defun fuzzy-matching-greaterp (m1 m2) "Returns T if fuzzy-matching M1 should be sorted before M2. @@ -292,7 +296,7 @@ symbols in PACKAGE, using the fuzzy completion algorithm, and the remaining time limit. -Only those symbols are considered of which FILTER does not return T. +Only those symbols are considered of which FILTER does return T. If EXTERNAL-ONLY is true, only external symbols are considered. A TIME-LIMIT-IN-MSEC of NIL is considered no limit; if it's zero or @@ -327,19 +331,19 @@ (recompute-remaining-time rest-time-limit) (setf rest-time-limit remaining-time) (cond (exhausted? (return-from loop)) - ((funcall filter symbol) :continue) ((or (not external-only) (symbol-external-p symbol package)) - (if (string= "" string) ; "" matches always - (vector-push-extend (make-fuzzy-matching symbol package-name - 0.0 '() '()) - completions) - (multiple-value-bind (match-result score) - (perform-fuzzy-match string (symbol-name symbol)) - (when match-result - (vector-push-extend - (make-fuzzy-matching symbol package-name score - '() match-result) - completions))))))))) + (when (funcall filter symbol) + (if (string= "" string) ; "" matches always + (vector-push-extend (make-fuzzy-matching symbol package-name + 0.0 '() '()) + completions) + (multiple-value-bind (match-result score) + (perform-fuzzy-match string (symbol-name symbol)) + (when match-result + (vector-push-extend + (make-fuzzy-matching symbol package-name score + '() match-result) + completions)))))))))) (values completions rest-time-limit))))) From trittweiler at common-lisp.net Sat Sep 15 22:21:31 2007 From: trittweiler at common-lisp.net (trittweiler) Date: Sat, 15 Sep 2007 18:21:31 -0400 (EDT) Subject: [slime-cvs] CVS slime/contrib Message-ID: <20070915222131.7937B44085@common-lisp.net> Update of /project/slime/cvsroot/slime/contrib In directory clnet:/tmp/cvs-serv31681/contrib Modified Files: ChangeLog Log Message: * swank-fuzzy.lisp: Fix regression that would not allow to fuzzy complete on inputs without package qualifier like "app". Reported by David J. Neu. (%make-duplicate-symbols-filter): Return complement. (fuzzy-find-matching-symbols): Treat passed filter as an acceptor predicate, not as a rejector. --- /project/slime/cvsroot/slime/contrib/ChangeLog 2007/09/15 15:15:27 1.51 +++ /project/slime/cvsroot/slime/contrib/ChangeLog 2007/09/15 22:21:30 1.52 @@ -1,3 +1,13 @@ +2007-09-16 Tobias C. Rittweiler + + * swank-fuzzy.lisp: Fix regression that would not allow to fuzzy + complete on inputs without package qualifier like "app". + Reported by David J. Neu. + + (%make-duplicate-symbols-filter): Return complement. + (fuzzy-find-matching-symbols): Treat passed filter as an acceptor + predicate, not as a rejector. + 2007-09-15 Helmut Eller Add the necessary hooks when loading some contribs, so that those @@ -15,7 +25,7 @@ list lead to inspecting package names, rather than the packages themselves. Fix that. -2007-09-15 Tobias C. Rittweiler + * slime-parse.el: Fix extended arglist display on misbalanced expressions like `(defun foo | ... (defun bar () 'bar)' From trittweiler at common-lisp.net Sat Sep 15 22:43:59 2007 From: trittweiler at common-lisp.net (trittweiler) Date: Sat, 15 Sep 2007 18:43:59 -0400 (EDT) Subject: [slime-cvs] CVS slime/contrib Message-ID: <20070915224359.53B7A1D11F@common-lisp.net> Update of /project/slime/cvsroot/slime/contrib In directory clnet:/tmp/cvs-serv3793/contrib Modified Files: ChangeLog Log Message: * swank-fuzzy.lisp: Fix regression that would not allow to fuzzy complete on inputs without package qualifier like "app". Reported by David J. Neu. (%make-duplicate-symbols-filter): Return complement. (fuzzy-find-matching-symbols): Treat passed filter as an acceptor predicate, not as a rejector. --- /project/slime/cvsroot/slime/contrib/ChangeLog 2007/09/15 22:21:30 1.52 +++ /project/slime/cvsroot/slime/contrib/ChangeLog 2007/09/15 22:43:59 1.53 @@ -25,7 +25,7 @@ list lead to inspecting package names, rather than the packages themselves. Fix that. - +2007-09-15 Tobias C. Rittweiler * slime-parse.el: Fix extended arglist display on misbalanced expressions like `(defun foo | ... (defun bar () 'bar)' From heller at common-lisp.net Sun Sep 16 16:41:56 2007 From: heller at common-lisp.net (heller) Date: Sun, 16 Sep 2007 12:41:56 -0400 (EDT) Subject: [slime-cvs] CVS slime/doc Message-ID: <20070916164156.D379B1C@common-lisp.net> Update of /project/slime/cvsroot/slime/doc In directory clnet:/tmp/cvs-serv25401 Modified Files: slime.texi Log Message: doc/slime.texi: Add a section Setup Tuning. --- /project/slime/cvsroot/slime/doc/slime.texi 2007/08/26 18:42:23 1.55 +++ /project/slime/cvsroot/slime/doc/slime.texi 2007/09/16 16:41:56 1.56 @@ -8,9 +8,9 @@ @end direntry @c %**end of header - at set EDITION 2.0 + at set EDITION 3.0-alpha @c @set UPDATED @today{} - at set UPDATED @code{$Date: 2007/08/26 18:42:23 $} + at set UPDATED @code{$Date: 2007/09/16 16:41:56 $} @set TITLE SLIME User Manual @settitle @value{TITLE}, version @value{EDITION} @@ -90,20 +90,20 @@ @top SLIME @SLIME{} is the ``Superior Lisp Interaction Mode for Emacs''. This is -the manual for version 1.2. +the manual for version 3.0-alpha. @end ifinfo @menu -* Introduction:: +* Introduction:: * Getting started:: -* slime-mode:: +* slime-mode:: * REPL:: * Debugger:: * Extras:: * Customization:: * Tips and Tricks:: * Credits:: -* Index to Functions:: +* Index to Functions:: @end menu @c ----------------------- @@ -112,9 +112,9 @@ @SLIME{} is the ``Superior Lisp Interaction Mode for Emacs.'' - at SLIME{} extends Emacs with new support for interactive programming in -Common Lisp. The features are centered around @code{slime-mode}, an Emacs -minor-mode that complements the standard @code{lisp-mode}. While + at SLIME{} extends Emacs with support for interactive programming in +Common Lisp. The features are centered around @code{slime-mode}, an +Emacs minor-mode that complements the standard @code{lisp-mode}. While @code{lisp-mode} supports editing Lisp source files, @code{slime-mode} adds support for interacting with a running Common Lisp process for compilation, debugging, documentation lookup, and so on. @@ -145,15 +145,16 @@ * Downloading:: * Installation:: * Running:: +* Setup Tuning:: @end menu @c ----------------------- - at node Platforms, Downloading, Getting started, Getting started + at node Platforms @section Supported Platforms @SLIME{} supports a wide range of operating systems and Lisp implementations. @SLIME{} runs on Unix systems, Mac OSX, and Microsoft -Windows. GNU Emacs versions 20 and 21 and XEmacs version 21 are +Windows. GNU Emacs versions 20, 21 and 22 and XEmacs version 21 are supported. The supported Lisp implementations, roughly ordered from the @@ -161,9 +162,9 @@ @itemize @bullet @item -CMU Common Lisp (@acronym{CMUCL}), 18e or newer +CMU Common Lisp (@acronym{CMUCL}), 19d or newer @item -Steel Bank Common Lisp (@acronym{SBCL}), latest official release +Steel Bank Common Lisp (@acronym{SBCL}), 1.0 or newer @item OpenMCL, version 0.14.3 or newer @item @@ -171,11 +172,12 @@ @item Allegro Common Lisp (@acronym{ACL}), version 6 or newer @item - at acronym{CLISP}, version 2.33.2 or newer + at acronym{CLISP}, version 2.35 or newer @item Armed Bear Common Lisp (@acronym{ABCL}) @item -Corman Common Lisp (@acronym{CCL}), version 2.51 or newer with the patches from @url{http://www.grumblesmurf.org/lisp/corman-patches}) +Corman Common Lisp (@acronym{CCL}), version 2.51 or newer with the +patches from @url{http://www.grumblesmurf.org/lisp/corman-patches}) @item Scieneer Common Lisp (@acronym{SCL}), version 1.2.7 or newer @end itemize @@ -186,7 +188,7 @@ commands (like ``restart frame''). @c ----------------------- - at node Downloading, Installation, Platforms, Getting started + at node Downloading @section Downloading SLIME You can choose between using a released version of @SLIME{} or @@ -204,7 +206,7 @@ @end menu @c ----------------------- - at node CVS, CVS Incantations, Downloading, Downloading + at node CVS @subsection Downloading from CVS @SLIME{} is available from the @CVS{} repository on @@ -222,15 +224,14 @@ If you checkout from @CVS{} then remember to @code{cvs update} occasionally. Improvements are continually being committed, and the - at code{FAIRLY-STABLE} tag is moved forward from time to time (about -once per month). + at code{FAIRLY-STABLE} tag is moved forward from time to time. @menu * CVS Incantations:: @end menu @c ----------------------- - at node CVS Incantations, , CVS, Downloading + at node CVS Incantations @subsection CVS incantations To download @SLIME{} you first configure your @code{CVSROOT} and login @@ -262,7 +263,7 @@ @end example @c ----------------------- - at node Installation, Running, Downloading, Getting started + at node Installation @section Installation With a Lisp implementation that can be started from the command-line, @@ -287,7 +288,7 @@ work correctly for a Lisp process started by @SLIME{}. @c ----------------------- - at node Running, , Installation, Getting started + at node Running @section Running SLIME @SLIME{} is started with the Emacs command @kbd{M-x slime}. This uses @@ -303,6 +304,130 @@ @fcnanchor{slime-restart-inferior-lisp} @end table + at node Setup Tuning + at section Setup Tuning + +This section explains ways to reduce @SLIME{}'s startup time and how +to configure @SLIME{} for multiple Lisp systems. + +Please proceed with this section only if your basic setup works. If +you are happy with the basic setup, skip this section. + + at menu +* Autoloading:: +* Multiple Lisps:: +* Loading Swank faster:: +* Loading Contribs:: + at end menu + + at node Autoloading + at subsection Autoloading + +The basic setup loads @SLIME{} always, even if you don't use @SLIME{}. +Emacs will start up a little faster if we load @SLIME{} only on +demand. To achieve that, you have to change your @file{~/.emacs} +slightly: + + at example +(setq inferior-lisp-program "@emph{the path to your Lisp system}") +(add-to-list 'load-path "@emph{the path of your @file{slime} directory}") +(require 'slime-autoloads) +(slime-setup) + at end example + +The only difference compared to the basic setup is the line + at code{(require 'slime-autoloads)}. It tells Emacs that the rest of + at SLIME{} should be loaded when one of the commands @kbd{M-x slime} or + at kbd{M-x slime-connect} is executed the first time. + + at node Multiple Lisps + at subsection Multiple Lisps + +By default, the command @kbd{M-x slime} starts the program specified +with @code{inferior-lisp-program}. If you invoke @kbd{M-x slime} with +a prefix argument, Emacs prompts for the program which should be +started instead. If you need that frequently or if the command +involves long filenames it's more convenient to set the + at code{slime-lisp-implementations} variable in your @file{.emacs}. For +example here we define two programs: + + at lisp +(setq slime-lisp-implementations + '((cmucl ("cmucl" "-quiet")) + (sbcl ("/opt/sbcl/bin/sbcl") :coding-system utf-8-unix))) + at end lisp + +This variable holds a list of programs and if you invoke @SLIME{} with +a negative prefix argument, @kbd{M-- M-x slime}, you can select a +program from that list. The elements of the list should look like + + at lisp +(NAME (PROGRAM PROGRAM-ARGS...) &key CODING-SYSTEM INIT INIT-FUNCTION) + at end lisp + + at table @code + at item NAME +is a symbol and is used to identify the program. + at item PROGRAM +is the filename of the program. Note that the filename can contain +spaces. + at item PROGRAM-ARGS +is a list of command line arguments. + at item CODING-SYSTEM +the coding system for the connection. + at item INIT + at itemx INIT-FUNCTION + ... to be written ... + at end table + + at node Loading Swank faster + at subsection Loading Swank faster + +For SBCL, we recommend that you create a custom core file with socket +support and @acronym{POSIX} bindings included because those modules +take the most time to load. To create such a core, execute the +following steps: + + at example +shell$ sbcl +* (mapc 'require '(sb-bsd-sockets sb-posix sb-introspect sb-cltl2 asdf)) +* (save-lisp-and-die "sbcl.core-for-slime") + at end example + +After that, add something like this to your @file{.emacs}: + + at lisp +(setq slime-lisp-implementations + '((sbcl ("sbcl" "--core" "sbcl.core-for-slime")))) + at end lisp + +For maximum startup speed you can include the Swank server directly in +a core file. The disadvantage of this approach is that the setup is a +bit more involved and that you need to create a new core file when you +want to update @SLIME{} or @acronym{SBCL}. The steps to execute are: + + at example +shell$ sbcl +* (load ".../slime/swank-loader.lisp") +* (save-lisp-and-die "sbcl.core-with-slime") + at end example + + at noindent +Then add this to your @file{.emacs}: + + at lisp +(setq slime-lisp-implementations + '((sbcl ("sbcl" "--core" "sbcl.core-with-slime") + :init (lambda (port-file _) + (format "(swank:start-server %S)\n" port-file))))) + at end lisp + + at noindent +Similar setups should also work for other Lisp implementations. + + at node Loading Contribs + at subsection Loading Contribs +... to be written ... @c ----------------------- @node slime-mode, REPL, Getting started, Top @@ -365,10 +490,10 @@ @node Inferior-lisp, Multithreading, Temporary buffers, User-interface conventions @subsection @code{*inferior-lisp*} buffer - at SLIME{} internally uses the @code{inferior-lisp} package to start -Lisp processes. This has a few user-visible consequences, some good -and some not-so-terribly. To avoid confusion it is useful to -understand the interactions. + at SLIME{} internally uses the @code{comint} package to start Lisp +processes. This has a few user-visible consequences, some good and +some not-so-terribly. To avoid confusion it is useful to understand +the interactions. The buffer @code{*inferior-lisp*} contains the Lisp process's own top-level. This direct access to Lisp is useful for troubleshooting, @@ -377,18 +502,6 @@ the fully-integrated @SLIME{} @REPL{} and ignoring the @code{*inferior-lisp*} buffer. -An unfortunate property of @code{inferior-lisp} is it inserts some -commands of its own directly into the @code{lisp-mode} keymap, such -that they aren't easily disabled. This makes Lisp source buffers -slightly schizophrenic, having both @SLIME{} and @code{inferior-lisp} -commands bound to keys and operating independently. - - at SLIME{} overrides most key bindings, so in practice you are unlikely -to accidentally use an @code{inferior-lisp} command. If you do find a -command that pops up the @code{*inferior-lisp*} buffer, that command -doesn't belong to @SLIME{}, and you should probably lookup our -equivalent. - @c ----------------------- @node Multithreading, , Inferior-lisp, User-interface conventions @subsection Multithreading @@ -447,14 +560,18 @@ @end table - at emph{Note:} In this documentation the designation @kbd{C-h} is a @dfn{cannonical key} which might actually mean Ctrl-h, or F1, or whatever you have @code{help-command} bound to in your @code{.emacs}. Here is a common situation: + at emph{Note:} In this documentation the designation @kbd{C-h} is a + at dfn{cannonical key} which might actually mean Ctrl-h, or F1, or +whatever you have @code{help-command} bound to in your + at code{.emacs}. Here is a common situation: @example (global-set-key [f1] 'help-command) (global-set-key "\C-h" 'delete-backward-char) @end example - at noindent In this situation everywhere you see @kbd{C-h} in the documentation you would substitute @kbd{F1}. + at noindent In this situation everywhere you see @kbd{C-h} in the +documentation you would substitute @kbd{F1}. In general we try to make our key bindings fit with the overall Emacs style. We also have the following somewhat unusual convention of our @@ -474,8 +591,8 @@ C-h} will actually list the bindings for all documentation commands. This feature is just a bit too useful to clobber! -You can assign or change default key bindings globally using the @code{global-set-key} -function in your @file{~/.emacs} file like this: +You can assign or change default key bindings globally using the + at code{global-set-key} function in your @file{~/.emacs} file like this: @example (global-set-key "\C-c s" 'slime-selector) @end example @@ -483,8 +600,8 @@ which binds @kbd{C-c s} to the function @code{slime-selector}. Alternatively, if you want to assign or change a key binding in just a -particular slime mode, you can use the @code{global-set-key} function in -your @file{~/.emacs} file like this: +particular slime mode, you can use the @code{global-set-key} function +in your @file{~/.emacs} file like this: @example (define-key slime-repl-mode-map (kbd "C-c ;") 'slime-insert-balanced-comments) @@ -504,13 +621,13 @@ to Functions}). @menu -* Programming:: +* Programming:: * Compilation:: -* Evaluation:: +* Evaluation:: * Recovery:: * Inspector:: * Profiling:: -* Other:: +* Other:: @end menu @c ----------------------- @@ -524,8 +641,8 @@ @menu * Completion:: -* Closure:: -* Indentation:: +* Closure:: +* Indentation:: * Documentation:: * Cross-reference:: * Finding definitions:: @@ -544,14 +661,15 @@ @table @kbd @anchor{slime-complete-symbol} - at itemx M-TAB - at item C-c C-i - at item C-M-i - at code{slime-complete-symbol}@* -Complete the symbol at point. Note that three styles of completion are -available in @SLIME{}, and the default differs from normal Emacs -completion (@pxref{slime-complete-symbol-function}). - at xref{Emacs-side customization}. [140 lines skipped] From heller at common-lisp.net Mon Sep 17 13:44:48 2007 From: heller at common-lisp.net (heller) Date: Mon, 17 Sep 2007 09:44:48 -0400 (EDT) Subject: [slime-cvs] CVS slime/doc Message-ID: <20070917134448.BF584620C9@common-lisp.net> Update of /project/slime/cvsroot/slime/doc In directory clnet:/tmp/cvs-serv18363 Modified Files: slime.texi Log Message: Add keystroke, variable indices and use the built-in command index. Disable the previous function index. --- /project/slime/cvsroot/slime/doc/slime.texi 2007/09/16 16:41:56 1.56 +++ /project/slime/cvsroot/slime/doc/slime.texi 2007/09/17 13:44:48 1.57 @@ -1,33 +1,41 @@ -\input texinfo @c -*-texinfo-*- - at c %**start of header - at setfilename slime.info +\input texinfo +- at c %**start of header + at setfilename slime.info @settitle The Superior Lisp Interaction Mode for Emacs + @dircategory Emacs @direntry * SLIME: (slime). Superior Lisp Interaction Mode for Emacs. @end direntry - at c %**end of header +- at c %**end of header @set EDITION 3.0-alpha + at set SLIMEVER 3.0-alpha @c @set UPDATED @today{} - at set UPDATED @code{$Date: 2007/09/16 16:41:56 $} + at set UPDATED @code{$Date: 2007/09/17 13:44:48 $} @set TITLE SLIME User Manual @settitle @value{TITLE}, version @value{EDITION} + at copying +Written by Luke Gorrie. + +Additional contributions: Jeff Cunningham, + +This file has been placed in the public domain. + at end copying + @titlepage @title @value{TITLE} @titlefont{version @value{EDITION}} @sp 2 - at image{slime-small} + at center @image{slime-small} @sp 4 @subtitle Compiled: @value{UPDATED} - at end titlepage - at c Written by Luke Gorrie. - at c - at c Additional contributions: Jeff Cunningham, - at c - at c This file has been placed in the public domain. + at page + at insertcopying + + at end titlepage @macro SLIME @@ -48,13 +56,26 @@ @macro kbditem{key, command} @item \key\ - at code{\command\}@* + at itemx M-x \command\ + at kindex \key\ + at findex \command\ + at c @end macro - at macro kbdanchor{key, command} - at anchor{\command\} - at item \key\ - at code{\command\}@* + at macro kbditempair{key1, key2, command1, command2} + at item \key1\, M-x \command1\ + at itemx \key2\, M-x \command2\ + at kindex \key1\ + at kindex \key2\ + at findex \command1\ + at findex \command2\ + at c + at end macro + + at macro cmditem{command} + at item M-x \command\ + at findex \command\ + at c @end macro @macro kbdanchorc{key, command, comment} @@ -64,35 +85,25 @@ @i{\comment\}@* @end macro - at macro kbdindex{key, command} - at item \key\ - at xref{\command\}. - at end macro - - at macro fcnanchor{name} - at anchor{\name\} - at item M-x - at code{\name\}@* - at end macro - @macro fcnindex{name} @item \name\ @xref{\name\}. @end macro @c @setchapternewpage off + at c @shortcontents @contents - at c ----------------------- - at node Top, Introduction, (dir), (dir) - - at ifinfo + at ifnottex + at node Top @top SLIME @SLIME{} is the ``Superior Lisp Interaction Mode for Emacs''. This is -the manual for version 3.0-alpha. +the manual for version @value{SLIMEVER}. + + at insertcopying + at end ifnottex - at end ifinfo @menu * Introduction:: * Getting started:: @@ -103,11 +114,14 @@ * Customization:: * Tips and Tricks:: * Credits:: -* Index to Functions:: + at c * Index to Functions:: +* Key Index:: +* Command Index:: +* Variable Index:: @end menu @c ----------------------- - at node Introduction, Getting started, Top, Top + at node Introduction @chapter Introduction @SLIME{} is the ``Superior Lisp Interaction Mode for Emacs.'' @@ -135,7 +149,7 @@ implementation. This makes @SLIME{} readily portable. @c ----------------------- - at node Getting started, slime-mode, Introduction, Top + at node Getting started @chapter Getting started This chapter tells you how to get @SLIME{} up and running. @@ -269,7 +283,9 @@ With a Lisp implementation that can be started from the command-line, installation just requires a few lines in your @file{~/.emacs}: - at example + at vindex inferior-lisp-program + at vindex load-path + at example (setq inferior-lisp-program "@emph{the path to your Lisp system}") (add-to-list 'load-path "@emph{the path of your @file{slime} directory}") (require 'slime) @@ -301,7 +317,7 @@ You can restart the @code{inferior-lisp} process using the function: @table @kbd - at fcnanchor{slime-restart-inferior-lisp} + at cmditem{slime-restart-inferior-lisp} @end table @node Setup Tuning @@ -351,6 +367,7 @@ @code{slime-lisp-implementations} variable in your @file{.emacs}. For example here we define two programs: + at vindex slime-lisp-implementations @lisp (setq slime-lisp-implementations '((cmucl ("cmucl" "-quiet")) @@ -429,9 +446,7 @@ @subsection Loading Contribs ... to be written ... - at c ----------------------- - at node slime-mode, REPL, Getting started, Top - at c @chapter @code{slime-mode} + at node slime-mode @chapter Using slime-mode @SLIME{}'s commands are provided via @code{slime-mode}, a minor-mode @@ -447,7 +462,7 @@ @end menu @c ----------------------- - at node User-interface conventions, Key bindings, slime-mode, slime-mode + at node User-interface conventions @section User-interface conventions To use @SLIME{} comfortably it is important to understand a few @@ -461,7 +476,7 @@ @end menu @c ----------------------- - at node Temporary buffers, Inferior-lisp, User-interface conventions, User-interface conventions + at node Temporary buffers @subsection Temporary buffers Some @SLIME{} commands create temporary buffers to display their @@ -487,7 +502,7 @@ function definitions, and so on. @c ----------------------- - at node Inferior-lisp, Multithreading, Temporary buffers, User-interface conventions + at node Inferior-lisp @subsection @code{*inferior-lisp*} buffer @SLIME{} internally uses the @code{comint} package to start Lisp @@ -503,7 +518,7 @@ @code{*inferior-lisp*} buffer. @c ----------------------- - at node Multithreading, , Inferior-lisp, User-interface conventions + at node Multithreading @subsection Multithreading If the Lisp system supports multithreading, SLIME spawns a new thread @@ -530,7 +545,7 @@ @end example @c ----------------------- - at node Key bindings, Commands, User-interface conventions, slime-mode + at node Key bindings @section Key bindings @quotation @@ -555,8 +570,11 @@ @kbdanchorc{C-h l, view-lossage, ``Woah at comma{} what key chord did I just do?''} Shows you the literal sequence of keys you've pressed in order. - at kbdanchorc{ l, , ``What starts with?''} -Lists all keybindings that begin with @code{} for the focus buffer mode. + + at c is breaks links PDF, despite that it's not l it's C-h + at c @kbdanchorc{ l, , ``What starts with?''} + at c Lists all keybindings that begin with @code{} for the focus buffer mode. + @end table @@ -611,14 +629,14 @@ @code{slime-insert-balanced-comments} in the REPL buffer. @c ----------------------- - at node Commands, Semantic indentation, Key bindings, slime-mode + at node Commands @section Commands @acronym{SLIME} commands are divided into the following general categories: @strong{Programming, Compilation, Evaluation, Recovery, Inspector, and Profiling}, discussed in separate sections below. There -are also comprehensive indices to commands by function (@pxref{Index -to Functions}). +are also comprehensive indices to commands by function +(@pxref{Command Index}). @menu * Programming:: @@ -631,7 +649,7 @@ @end menu @c ----------------------- - at node Programming, Compilation, , Commands + at node Programming @subsection Programming commands Programming commands are divided into the following categories: @@ -651,7 +669,7 @@ @end menu @c ----------------------- - at node Completion, Closure, , Programming + at node Completion @subsubsection Completion commands Completion commands are used to complete a symbol or form based on @@ -660,18 +678,15 @@ completion tries harder. @table @kbd - at anchor{slime-complete-symbol} - at item M-TAB + at kbditem{M-TAB,slime-complete-symbol} @itemx ESC TAB @itemx C-c C-i @itemx C-M-i - at code{slime-complete-symbol}@* Complete the symbol at point. Note that -three styles of completion are available in @SLIME{}, and the default -differs from normal Emacs completion -(@pxref{slime-complete-symbol-function}). @xref{Emacs-side -customization}. +Complete the symbol at point. Note that three styles of completion are +available in @SLIME{}, and the default differs from normal Emacs +completion (@pxref{slime-complete-symbol-function}). - at kbdanchor{C-c C-s, slime-complete-form} + at kbditem{C-c C-s, slime-complete-form} Looks up and inserts into the current buffer the argument list for the function at point, if there is one. More generally, the command completes an incomplete form with a template for the missing arguments. @@ -699,7 +714,8 @@ --inserts--> :bar bar :blub blub initargs...) @end example - at kbdanchor{C-c M-i, slime-fuzzy-complete-symbol} + at anchor{slime-fuzzy-complete-symbol} + at kbditem{C-c M-i, slime-fuzzy-complete-symbol} Presents a list of likely completions to choose from for an abbreviation at point. This is a third completion method and it is very different from the more traditional completion to which @@ -710,24 +726,24 @@ selected as the method of completion used for @code{slime-complete-symbol}. - at fcnanchor{slime-fuzzy-completions-mode} - at fcnanchor{slime-fuzzy-abort} + at cmditem{slime-fuzzy-completions-mode} + at cmditem{slime-fuzzy-abort} @end table @c ----------------------- - at node Closure, Indentation, Completion, Programming + at node Closure @subsubsection Closure commands Closure commands are used to fill in missing parenthesis. @table @kbd - at kbdanchor{C-c C-q, slime-close-parens-at-point} + at kbditem{C-c C-q, slime-close-parens-at-point} Closes parentheses at point to complete the top-level-form by inserting ')' characters at until @code{beginning-of-defun} and @code{end-of-defun} execute without errors, or @code{slime-close-parens-limit} is exceeded. - at kbdanchor{C-], slime-close-all-sexp} + at kbditem{C-], slime-close-all-sexp} Balance parentheses of open s-expressions at point. Insert enough right-parentheses to balance unmatched left-parentheses. Delete extra left-parentheses. Reformat trailing parentheses @@ -739,11 +755,11 @@ @c ----------------------- - at node Indentation, Documentation, Closure, Programming + at node Indentation @subsubsection Indentation commands @table @kbd - at kbdanchor{C-c M-q, slime-reindent-defun} + at kbditem{C-c M-q, slime-reindent-defun} Re-indents the current defun, or refills the current paragraph. If point is inside a comment block, the text around point will be treated as a paragraph and will be filled with @code{fill-paragraph}. @@ -751,7 +767,7 @@ will be reindented. If the current defun has unbalanced parens, an attempt will be made to fix it before reindenting. - at kbdanchor{C-M-q, indent-sexp} + at kbditem{C-M-q, indent-sexp} Indents the list immediately following point to match the level at point. When given a prefix argument, the text around point will always @@ -760,7 +776,7 @@ @c ----------------------- - at node Documentation, Cross-reference, Indentation, Programming + at node Documentation @subsubsection Documentation commands @SLIME{}'s online documentation commands follow the example of Emacs @@ -769,31 +785,31 @@ @table @kbd - at kbdanchor{SPC, slime-space} + at kbditem{SPC, slime-space} The space key inserts a space, but also looks up and displays the argument list for the function at point, if there is one. - at kbdanchor{C-c C-d d, slime-describe-symbol} + at kbditem{C-c C-d d, slime-describe-symbol} Describe the symbol at point. [1045 lines skipped] From heller at common-lisp.net Mon Sep 17 13:45:19 2007 From: heller at common-lisp.net (heller) Date: Mon, 17 Sep 2007 09:45:19 -0400 (EDT) Subject: [slime-cvs] CVS slime/doc Message-ID: <20070917134519.3C3BA1704E@common-lisp.net> Update of /project/slime/cvsroot/slime/doc In directory clnet:/tmp/cvs-serv18527 Modified Files: Makefile Log Message: New target: html/index.html --- /project/slime/cvsroot/slime/doc/Makefile 2006/11/22 06:27:38 1.9 +++ /project/slime/cvsroot/slime/doc/Makefile 2007/09/17 13:45:19 1.10 @@ -16,7 +16,7 @@ TEXI = slime.texi contributors.texi -all: slime.ps slime.info slime.html slime.pdf +all: slime.info slime.pdf html/index.html slime.dvi: $(TEXI) texi2dvi slime.texi @@ -30,6 +30,9 @@ slime.html: $(TEXI) texi2html $< +html/index.html: $(TEXI) + makeinfo -o html --html $< + slime.pdf: $(TEXI) texi2pdf $< @@ -89,20 +92,6 @@ clean: rm -f contributors.texi - rm -f slime.aux - rm -f slime.cp - rm -f slime.dvi - rm -f slime.fn - rm -f slime.ky - rm -f slime.log - rm -f slime.pg - rm -f slime.tmp - rm -f slime.toc - rm -f slime.tp - rm -f slime.vr - -really_clean: clean - rm -f slime.info - rm -f slime.pdf - rm -f slime.ps - rm -f slime.html + rm -f slime.{aux,cp,cps,dvi,fn,fns,ilg,ind,ky,kys,log,pg,tmp,toc,tp,vr} + rm -f slime.{info,pdf,ps,html} + rm -rf html From heller at common-lisp.net Mon Sep 17 14:03:53 2007 From: heller at common-lisp.net (heller) Date: Mon, 17 Sep 2007 10:03:53 -0400 (EDT) Subject: [slime-cvs] CVS slime/doc Message-ID: <20070917140353.E855E481A4@common-lisp.net> Update of /project/slime/cvsroot/slime/doc In directory clnet:/tmp/cvs-serv21364 Modified Files: Makefile Log Message: *** empty log message *** --- /project/slime/cvsroot/slime/doc/Makefile 2007/09/17 13:45:19 1.10 +++ /project/slime/cvsroot/slime/doc/Makefile 2007/09/17 14:03:53 1.11 @@ -92,6 +92,6 @@ clean: rm -f contributors.texi - rm -f slime.{aux,cp,cps,dvi,fn,fns,ilg,ind,ky,kys,log,pg,tmp,toc,tp,vr} + rm -f slime.{aux,cp,cps,dvi,fn,fns,ky,kys,log,pg,tmp,toc,tp,vr,vrs} rm -f slime.{info,pdf,ps,html} rm -rf html From heller at common-lisp.net Mon Sep 17 14:04:27 2007 From: heller at common-lisp.net (heller) Date: Mon, 17 Sep 2007 10:04:27 -0400 (EDT) Subject: [slime-cvs] CVS slime/doc Message-ID: <20070917140427.A0500481A5@common-lisp.net> Update of /project/slime/cvsroot/slime/doc In directory clnet:/tmp/cvs-serv21407 Modified Files: Makefile Log Message: *** empty log message *** --- /project/slime/cvsroot/slime/doc/Makefile 2007/09/17 14:03:53 1.11 +++ /project/slime/cvsroot/slime/doc/Makefile 2007/09/17 14:04:27 1.12 @@ -92,6 +92,6 @@ clean: rm -f contributors.texi - rm -f slime.{aux,cp,cps,dvi,fn,fns,ky,kys,log,pg,tmp,toc,tp,vr,vrs} - rm -f slime.{info,pdf,ps,html} + rm -f slime.{aux,cp,cps,fn,fns,ky,kys,log,pg,tmp,toc,tp,vr,vrs} + rm -f slime.{info,pdf,dvi,ps,html} rm -rf html From heller at common-lisp.net Wed Sep 19 11:08:27 2007 From: heller at common-lisp.net (heller) Date: Wed, 19 Sep 2007 07:08:27 -0400 (EDT) Subject: [slime-cvs] CVS slime Message-ID: <20070919110827.23F017E0BA@common-lisp.net> Update of /project/slime/cvsroot/slime In directory clnet:/tmp/cvs-serv9945 Modified Files: HACKING Log Message: *** empty log message *** --- /project/slime/cvsroot/slime/HACKING 2006/12/19 11:03:58 1.7 +++ /project/slime/cvsroot/slime/HACKING 2007/09/19 11:08:27 1.8 @@ -35,18 +35,6 @@ http://www.gnu.org/software/emacs/manual/html_node/emacs_333.html#SEC333 http://www.gnu.org/software/emacs/manual/html_node/emacs_156.html#SEC156 -** You may want to add this to your init.el - -(defun update-change-log () - (interactive) - (vc-update-change-log "-u" "alendvai Attila Lendvai attila.lendvai at gmail.com" - "-u" "mbaringer Marco Baringer mb at bese.it" - "-u" "heller Helmut Eller heller at common-lisp.net")) - -(add-hook 'change-log-mode-hook - (lambda () - (define-key change-log-mode-map (kbd "C-M-u") 'update-change-log))) - * Sending Patches If you would like to send us improvements you can create a patch with @@ -132,14 +120,17 @@ * Coding style We like the fact that each function in SLIME will fit on a single -screen, and would like to preserve this property! Beyond that we're -not dogmatic :-) +screen (80x20), and would like to preserve this property! Beyond that +we're not dogmatic :-) In early discussions we all made happy noises about the advice in Norvig and Pitman's _Tutorial on Good Lisp Programming Style_: http://www.norvig.com/luv-slides.ps +For Emacs Lisp, we try to follow the _Tips and Conventions_ in +Appendix D of the GNU Emacs Lisp Reference Manual (see Info file +`elisp', node `Tips'). + Remember that to rewrite a program better is the sincerest form of code appreciation. When you can see a way to rewrite a part of SLIME better, please do so! - From heller at common-lisp.net Wed Sep 19 11:12:08 2007 From: heller at common-lisp.net (heller) Date: Wed, 19 Sep 2007 07:12:08 -0400 (EDT) Subject: [slime-cvs] CVS slime Message-ID: <20070919111208.3F7FF49114@common-lisp.net> Update of /project/slime/cvsroot/slime In directory clnet:/tmp/cvs-serv10577 Modified Files: ChangeLog swank.lisp Log Message: Fix close-connection. * swank.lisp (close-connection): Use *log-output* instead of *debug-io* (which could be redirected to the to-be-closed connection). --- /project/slime/cvsroot/slime/ChangeLog 2007/09/15 15:15:25 1.1219 +++ /project/slime/cvsroot/slime/ChangeLog 2007/09/19 11:12:07 1.1220 @@ -1,3 +1,9 @@ +2007-09-19 Helmut Eller + + * swank.lisp (close-connection): Use *log-output* instead of + *debug-io* (which could be redirected to the to-be-closed + connection). + 2007-09-15 Helmut Eller Let slime-setup load contribs. --- /project/slime/cvsroot/slime/swank.lisp 2007/09/10 15:39:05 1.510 +++ /project/slime/cvsroot/slime/swank.lisp 2007/09/19 11:12:07 1.511 @@ -676,8 +676,8 @@ (defun simple-announce-function (port) (when *swank-debug-p* - (format *debug-io* "~&;; Swank started at port: ~D.~%" port) - (force-output *debug-io*))) + (format *log-output* "~&;; Swank started at port: ~D.~%" port) + (force-output *log-output*))) (defun open-streams (connection) "Return the 5 streams for IO redirection: @@ -773,7 +773,7 @@ (connection.socket-io *emacs-connection*)) (defun close-connection (c &optional condition backtrace) - (format *debug-io* "~&;; swank:close-connection: ~A~%" condition) + (format *log-output* "~&;; swank:close-connection: ~A~%" condition) (let ((cleanup (connection.cleanup c))) (when cleanup (funcall cleanup c))) @@ -783,10 +783,10 @@ (setf *connections* (remove c *connections*)) (run-hook *connection-closed-hook* c) (when (and condition (not (typep condition 'end-of-file))) - (finish-output *debug-io*) - (format *debug-io* "~&;; Event history start:~%") - (dump-event-history *debug-io*) - (format *debug-io* ";; Event history end.~%~ + (finish-output *log-output*) + (format *log-output* "~&;; Event history start:~%") + (dump-event-history *log-output*) + (format *log-output* ";; Event history end.~%~ ;; Backtrace:~%~{~A~%~}~ ;; Connection to Emacs lost. [~%~ ;; condition: ~A~%~ @@ -798,7 +798,7 @@ (ignore-errors (stream-external-format (connection.socket-io c))) (connection.communication-style c) *use-dedicated-output-stream*) - (finish-output *debug-io*))) + (finish-output *log-output*))) (defvar *debug-on-swank-error* nil "When non-nil internal swank errors will drop to a @@ -807,17 +807,18 @@ (defmacro with-reader-error-handler ((connection) &body body) (let ((con (gensym)) - (block (gensym))) + (blck (gensym))) `(let ((,con ,connection)) - (block ,block + (block ,blck (handler-bind ((swank-error (lambda (e) (if *debug-on-swank-error* (invoke-debugger e) - (return-from ,block - (close-connection ,con - (swank-error.condition e) - (swank-error.backtrace e))))))) + (return-from ,blck + (close-connection + ,con + (swank-error.condition e) + (swank-error.backtrace e))))))) (progn , at body)))))) (defslimefun simple-break () @@ -1251,6 +1252,7 @@ (defun update-redirection-after-close (closed-connection) "Update redirection after a connection closes." + (check-type closed-connection connection) (when (eq *global-stdio-connection* closed-connection) (if (and (default-connection) *globally-redirect-io*) ;; Redirect to another connection. @@ -1688,9 +1690,7 @@ (let ((i (car values))) (format nil "~A~D (#x~X, #o~O, #b~B)" *echo-area-prefix* i i i i))) - (t (with-output-to-string (s) - (pprint-logical-block (s () :prefix *echo-area-prefix*) - (format s "~{~S~^, ~}" values)))))))) + (t (format nil "~a~{~S~^, ~}" *echo-area-prefix* values)))))) (defslimefun interactive-eval (string) (with-buffer-syntax () From heller at common-lisp.net Wed Sep 19 11:21:44 2007 From: heller at common-lisp.net (heller) Date: Wed, 19 Sep 2007 07:21:44 -0400 (EDT) Subject: [slime-cvs] CVS slime Message-ID: <20070919112144.DABFA49123@common-lisp.net> Update of /project/slime/cvsroot/slime In directory clnet:/tmp/cvs-serv13142 Modified Files: ChangeLog slime.el Log Message: Remove explicit support for Scheme mode. * slime.el (slime-scheme-mode-hook, slime-shared-lisp-mode-hook) Deleted. (slime-indentation-update-hooks): New hook. (slime-handle-indentation-update): Use it. --- /project/slime/cvsroot/slime/ChangeLog 2007/09/19 11:12:07 1.1220 +++ /project/slime/cvsroot/slime/ChangeLog 2007/09/19 11:21:44 1.1221 @@ -1,5 +1,14 @@ 2007-09-19 Helmut Eller + Remove explicit support for Scheme mode. + + * slime.el (slime-scheme-mode-hook, slime-shared-lisp-mode-hook) + Deleted. + (slime-indentation-update-hooks): New hook. + (slime-handle-indentation-update): Use it. + + Fix close-connection. + * swank.lisp (close-connection): Use *log-output* instead of *debug-io* (which could be redirected to the to-be-closed connection). --- /project/slime/cvsroot/slime/slime.el 2007/09/15 15:15:25 1.864 +++ /project/slime/cvsroot/slime/slime.el 2007/09/19 11:21:44 1.865 @@ -68,26 +68,20 @@ "When non-nil highlight buffers with compilation notes, warnings and errors." ) +(defvar slime-lisp-modes '(lisp-mode)) + (defun slime-setup (&optional contribs) "Setup Emacs so that lisp-mode buffers always use SLIME. CONTRIBS is a list of contrib packages to load." (when (member 'lisp-mode slime-lisp-modes) (add-hook 'lisp-mode-hook 'slime-lisp-mode-hook)) - (when (member 'scheme-mode slime-lisp-modes) - (add-hook 'scheme-mode-hook 'slime-scheme-mode-hook)) (mapc #'require contribs)) -(defun slime-shared-lisp-mode-hook () - (slime-mode 1)) - (defun slime-lisp-mode-hook () - (slime-shared-lisp-mode-hook) + (slime-mode 1) (set (make-local-variable 'lisp-indent-function) 'common-lisp-indent-function)) -(defun slime-scheme-mode-hook () - (slime-shared-lisp-mode-hook)) - (eval-and-compile (defvar slime-path (let ((path (or (locate-library "slime") load-file-name))) @@ -3992,8 +3986,6 @@ (interactive) (slime-compile-file t)) -(defvar slime-lisp-modes '(lisp-mode)) - (defun slime-compile-file (&optional load) "Compile current buffer's file and highlight resulting compiler notes. @@ -8010,6 +8002,8 @@ (interactive) (slime-eval-async '(swank:update-indentation-information))) +(defvar slime-indentation-update-hooks) + (defun slime-handle-indentation-update (alist) "Update Lisp indent information. @@ -8017,22 +8011,14 @@ settings for `common-lisp-indent-function'. The appropriate property is setup, unless the user already set one explicitly." (dolist (info alist) - (let ((symbol-name (car info))) - (unless (and slime-conservative-indentation - (string-match "^\\(def\\|\\with-\\)" symbol-name)) - (let ((symbol (intern symbol-name)) - (indent (cdr info))) - (let ((old-slime-indent (get symbol 'slime-indent))) - (flet ((update (indent-function) - ;; Does the symbol have an indentation value - ;; that we set? - (when (equal (get symbol indent-function) - old-slime-indent) - (put symbol 'slime-indent indent) - (put symbol indent-function indent)))) - (update 'common-lisp-indent-function) - (when (member 'scheme-mode slime-lisp-modes) - (update 'scheme-indent-function))))))))) + (let ((symbol (intern (car info))) + (indent (cdr info))) + ;; Does the symbol have an indentation value that we set? + (when (equal (get symbol 'common-lisp-indent-function) + (get symbol 'slime-indent)) + (put symbol 'slime-indent indent) + (put symbol 'common-lisp-indent-function indent)) + (run-hook-with-args 'slime-indentation-update-hooks symbol indent)))) ;;;; Cheat Sheet From heller at common-lisp.net Wed Sep 19 11:26:48 2007 From: heller at common-lisp.net (heller) Date: Wed, 19 Sep 2007 07:26:48 -0400 (EDT) Subject: [slime-cvs] CVS slime Message-ID: <20070919112648.E359B49126@common-lisp.net> Update of /project/slime/cvsroot/slime In directory clnet:/tmp/cvs-serv13498 Modified Files: ChangeLog slime.el Log Message: Simplify slime-length=. * slime.el (slime-length=, slime-length>): No need for vectors. --- /project/slime/cvsroot/slime/ChangeLog 2007/09/19 11:21:44 1.1221 +++ /project/slime/cvsroot/slime/ChangeLog 2007/09/19 11:26:48 1.1222 @@ -1,5 +1,9 @@ 2007-09-19 Helmut Eller + Simplify slime-length=. + + * slime.el (slime-length=, slime-length>): No need for vectors. + Remove explicit support for Scheme mode. * slime.el (slime-scheme-mode-hook, slime-shared-lisp-mode-hook) --- /project/slime/cvsroot/slime/slime.el 2007/09/19 11:21:44 1.865 +++ /project/slime/cvsroot/slime/slime.el 2007/09/19 11:26:48 1.866 @@ -9003,25 +9003,14 @@ ;;;;; Misc. -(defun slime-length= (seq n) - "Test for whether SEQ contains N number of elements. I.e. it's equivalent - to (= (LENGTH SEQ) N), but besides being more concise, it may also be more - efficiently implemented." - (etypecase seq - (list (do ((i n (1- i)) - (list seq (cdr list))) - ((or (<= i 0) (null list)) - (and (zerop i) (null list))))) - (sequence (= (length seq) n)))) - -(defun slime-length> (seq n) - "Test if (length SEQ) is greater than N." - (etypecase seq - (list (while (and (> n 0) seq) - (setq seq (cdr seq)) - (decf n)) - (or (< n 0) (and seq t))) - (sequence (> (length seq) n)))) +(defun slime-length= (list n) + "Return t if (= (length LIST) N)." + (setq list (nthcdr (1- n) list)) + (and list (null (cdr list)))) + +(defun slime-length> (list n) + "Return non-nil if (> (length LIST) N)." + (nthcdr n list)) (defun slime-split-string (string &optional separators omit-nulls) "This is like `split-string' in Emacs22, but also works in From heller at common-lisp.net Wed Sep 19 11:29:49 2007 From: heller at common-lisp.net (heller) Date: Wed, 19 Sep 2007 07:29:49 -0400 (EDT) Subject: [slime-cvs] CVS slime Message-ID: <20070919112949.C0F015310E@common-lisp.net> Update of /project/slime/cvsroot/slime In directory clnet:/tmp/cvs-serv13763 Modified Files: slime.el Log Message: Introduce a slime-start-and-init function. * slime.el (slime-start-and-load, slime-lisp-options): New functions. (slime-start-and-load): Use it. --- /project/slime/cvsroot/slime/slime.el 2007/09/19 11:26:48 1.866 +++ /project/slime/cvsroot/slime/slime.el 2007/09/19 11:29:49 1.867 @@ -1321,8 +1321,8 @@ (interactive) (let ((inferior-lisp-program (or command inferior-lisp-program)) (slime-net-coding-system (or coding-system slime-net-coding-system))) - (apply #'slime-start (slime-read-interactive-args)))) - + (slime-start* (slime-read-interactive-args)))) + (defun slime-read-interactive-args () "Return the list of args which should be passed to `slime-start'. @@ -1342,14 +1342,7 @@ - If the prefix-arg is positive, read the command to start the process." (let ((table slime-lisp-implementations)) - (cond ((not current-prefix-arg) - (cond (table - (slime-lookup-lisp-implementation - table (or slime-default-lisp (car (first table))))) - (t - (destructuring-bind (program &rest args) - (split-string inferior-lisp-program) - (list :program program :program-args args))))) + (cond ((not current-prefix-arg) (slime-lisp-options)) ((eq current-prefix-arg '-) (let ((key (completing-read "Lisp name: " (mapcar (lambda (x) @@ -1370,6 +1363,16 @@ (list :program program :program-args program-args :coding-system coding-system))))))) +(defun slime-lisp-options (&optional name) + (let ((table slime-lisp-implementations)) + (assert (or (not name) table)) + (cond (table (slime-lookup-lisp-implementation slime-lisp-implementations + (or name slime-default-lisp + (car (car table))))) + (t (destructuring-bind (program &rest args) + (split-string inferior-lisp-program) + (list :program program :program-args args)))))) + (defun slime-lookup-lisp-implementation (table name) (destructuring-bind (name (prog &rest args) &rest keys) (assoc name table) (list* :name name :program prog :program-args args keys))) @@ -1392,6 +1395,9 @@ (slime-inferior-connect proc args) (pop-to-buffer (process-buffer proc))))) +(defun slime-start* (options) + (apply #'slime-start options)) + (defun slime-connect (host port &optional coding-system) "Connect to a running Swank server." (interactive (list (read-from-minibuffer "Host: " slime-lisp-host) @@ -1414,12 +1420,15 @@ (cond ((slime-connected-p) (slime-load-file-set-package filename package)) (t - (lexical-let ((hook nil) (package package) (filename filename)) - (setq hook (lambda () - (remove-hook 'slime-connected-hook hook) - (slime-load-file-set-package filename package))) - (add-hook 'slime-connected-hook hook) - (slime))))) + (slime-start-and-init (slime-lisp-options) + #'slime-start-and-load filename package)))) + +(defun slime-start-and-init (options fun &rest args) + (lexical-let* ((fun fun) (args args) + (rest (plist-get options :init-function)) + (init (cond (rest (lambda () (funcall rest) (apply fun args))) + (t (lambda () (apply fun args)))))) + (slime-start* (plist-put (copy-list options) :init-function init)))) (defun slime-load-file-set-package (filename package) (let ((filename (slime-to-lisp-filename filename))) From heller at common-lisp.net Wed Sep 19 11:30:31 2007 From: heller at common-lisp.net (heller) Date: Wed, 19 Sep 2007 07:30:31 -0400 (EDT) Subject: [slime-cvs] CVS slime Message-ID: <20070919113031.45299590AE@common-lisp.net> Update of /project/slime/cvsroot/slime In directory clnet:/tmp/cvs-serv13960 Modified Files: ChangeLog Log Message: *** empty log message *** --- /project/slime/cvsroot/slime/ChangeLog 2007/09/19 11:26:48 1.1222 +++ /project/slime/cvsroot/slime/ChangeLog 2007/09/19 11:30:31 1.1223 @@ -1,5 +1,11 @@ 2007-09-19 Helmut Eller + Introduce a slime-start-and-init function. + + * slime.el (slime-start-and-init, slime-lisp-options): New + functions. + (slime-start-and-load): Use it. + Simplify slime-length=. * slime.el (slime-length=, slime-length>): No need for vectors. From heller at common-lisp.net Wed Sep 19 11:32:35 2007 From: heller at common-lisp.net (heller) Date: Wed, 19 Sep 2007 07:32:35 -0400 (EDT) Subject: [slime-cvs] CVS slime Message-ID: <20070919113235.D9478650D3@common-lisp.net> Update of /project/slime/cvsroot/slime In directory clnet:/tmp/cvs-serv14168 Modified Files: ChangeLog slime.el Log Message: Remove define-slime-dialect. * slime.el (define-slime-dialect): Deleted. Use slime-lisp-implementations instead. --- /project/slime/cvsroot/slime/ChangeLog 2007/09/19 11:30:31 1.1223 +++ /project/slime/cvsroot/slime/ChangeLog 2007/09/19 11:32:35 1.1224 @@ -1,5 +1,10 @@ 2007-09-19 Helmut Eller + Remove define-slime-dialect. + + * slime.el (define-slime-dialect): Deleted. Use + slime-lisp-implementations instead. + Introduce a slime-start-and-init function. * slime.el (slime-start-and-init, slime-lisp-options): New --- /project/slime/cvsroot/slime/slime.el 2007/09/19 11:29:49 1.867 +++ /project/slime/cvsroot/slime/slime.el 2007/09/19 11:32:35 1.868 @@ -1437,23 +1437,6 @@ (when package (slime-repl-set-package (second package))))))) -(defmacro define-slime-dialect (name &optional program hook) - "Define a command slime-dialect-NAME to start a specific Lisp. -PROGRAM is the command to start the inferior process. -HOOK is function which is run before the process is started." - (let ((funsym (intern (format "slime-dialect-%s" name))) - (hooksym (intern (format "slime-dialect-%s-hook" name))) - (progsym (intern (format "slime-dialect-%s-program" name)))) - `(progn - (defvar ,progsym ,program) - (defvar ,hooksym ,hook) - (defun ,funsym () - ,(format "Start up slime according to `%s'." progsym) - (interactive) - (let ((inferior-lisp-program ,progsym)) - (run-hooks ',hooksym) - (call-interactively 'slime)))))) - ;;;;; Start inferior lisp ;;; ;;; Here is the protocol for starting SLIME: From heller at common-lisp.net Wed Sep 19 11:36:47 2007 From: heller at common-lisp.net (heller) Date: Wed, 19 Sep 2007 07:36:47 -0400 (EDT) Subject: [slime-cvs] CVS slime Message-ID: <20070919113647.7B1126B5CF@common-lisp.net> Update of /project/slime/cvsroot/slime In directory clnet:/tmp/cvs-serv14579 Modified Files: ChangeLog slime.el Log Message: Fix apropos in Emacs 22. * slime.el (slime-print-apropos): Add button props for Emacs 22. (slime-call-describer): ARG is a marker in Emacs 22. (def-slime-selector-method ?c): Wait until slime-list-threads returns. --- /project/slime/cvsroot/slime/ChangeLog 2007/09/19 11:32:35 1.1224 +++ /project/slime/cvsroot/slime/ChangeLog 2007/09/19 11:36:47 1.1225 @@ -1,5 +1,13 @@ 2007-09-19 Helmut Eller + Fix apropos in Emacs 22. + + * slime.el (slime-print-apropos): Add button props for Emacs 22. + (slime-call-describer): ARG is a marker in Emacs 22. + + (def-slime-selector-method ?c): Wait until slime-list-threads + returns. + Remove define-slime-dialect. * slime.el (define-slime-dialect): Deleted. Use --- /project/slime/cvsroot/slime/slime.el 2007/09/19 11:32:35 1.868 +++ /project/slime/cvsroot/slime/slime.el 2007/09/19 11:36:47 1.869 @@ -6048,12 +6048,17 @@ (princ (etypecase value (string value) ((member :not-documented) "(not documented)"))) - (put-text-property start (point) 'type prop) - (put-text-property start (point) 'action 'slime-call-describer) + (add-text-properties + start (point) + (list 'type prop 'action 'slime-call-describer + 'button t 'apropos-label namespace + 'item (plist-get plist :designator))) (terpri))))))) -(defun slime-call-describer (item) - (let ((type (get-text-property (point) 'type))) +(defun slime-call-describer (arg) + (let* ((pos (if (markerp arg) arg (point))) + (type (get-text-property pos 'type)) + (item (get-text-property pos 'item))) (slime-eval-describe `(swank:describe-definition-for-emacs ,item ,type)))) @@ -7909,6 +7914,7 @@ (def-slime-selector-method ?t "SLIME threads buffer." (slime-list-threads) + (slime-eval `(cl:quote nil)) ;wait until slime-list-threads returns "*slime-threads*") (defun slime-recently-visited-buffer (mode) From heller at common-lisp.net Wed Sep 19 11:40:34 2007 From: heller at common-lisp.net (heller) Date: Wed, 19 Sep 2007 07:40:34 -0400 (EDT) Subject: [slime-cvs] CVS slime Message-ID: <20070919114034.21BE41139@common-lisp.net> Update of /project/slime/cvsroot/slime In directory clnet:/tmp/cvs-serv15857 Modified Files: ChangeLog slime.el Log Message: Reorder some devfars and menus code so that the compiler doesn't complain about free variables. --- /project/slime/cvsroot/slime/ChangeLog 2007/09/19 11:36:47 1.1225 +++ /project/slime/cvsroot/slime/ChangeLog 2007/09/19 11:40:33 1.1226 @@ -1,5 +1,8 @@ 2007-09-19 Helmut Eller + * slime.el: Reorder some devfars and menus code so that the + compiler doesn't complain about free variables. + Fix apropos in Emacs 22. * slime.el (slime-print-apropos): Add button props for Emacs 22. --- /project/slime/cvsroot/slime/slime.el 2007/09/19 11:36:47 1.869 +++ /project/slime/cvsroot/slime/slime.el 2007/09/19 11:40:33 1.870 @@ -1,4 +1,4 @@ -;;; slime.el -- Superior Lisp Interaction Mode for Emacs +;;; slime.el --- Superior Lisp Interaction Mode for Emacs ;; ;;;; License ;; Copyright (C) 2003 Eric Marsden, Luke Gorrie, Helmut Eller @@ -64,10 +64,6 @@ (require 'overlay)) (require 'easymenu) -(defvar slime-highlight-compiler-notes t - "When non-nil highlight buffers with compilation notes, warnings and errors." - ) - (defvar slime-lisp-modes '(lisp-mode)) (defun slime-setup (&optional contribs) @@ -228,20 +224,6 @@ slime-find-tag-if-tags-table-visited find-tag)) -(defcustom slime-compilation-finished-hook 'slime-maybe-list-compiler-notes - "Hook called with a list of compiler notes after a compilation." - :group 'slime-mode - :type 'hook - :options '(slime-maybe-list-compiler-notes - slime-list-compiler-notes - slime-maybe-show-xrefs-for-notes)) - -(defcustom slime-goto-first-note-after-compilation nil - "When T next-note will always goto to the first note in a -final, no matter where the point is." - :group 'slime-mode - :type 'boolean) - (defcustom slime-complete-symbol-function 'slime-simple-complete-symbol "*Function to perform symbol completion." :group 'slime-mode @@ -511,7 +493,7 @@ (slime-pretty-package-name package))))))) (defun slime-pretty-package-name (name) - "Return a pretty version of a package name designator (as a string)." + "Return a pretty version of a package name NAME." (let ((name (cond ((string-match "^:\\(.*\\)$" name) (match-string 1 name)) ((string-match "^\"\\(.*\\)\"$" name) @@ -522,7 +504,6 @@ (when slime-update-modeline-package (run-with-idle-timer 0.2 0.2 'slime-update-modeline-package)) - ;; Setup the mode-line to say when we're in slime-mode, and which CL ;; package we think the current buffer belongs to. (add-to-list 'minor-mode-alist @@ -591,10 +572,6 @@ ("\M-m" slime-macroexpand-all :prefixed t :inferior t) ("\M-0" slime-restore-window-configuration :prefixed t :inferior t) ([(control meta ?\.)] slime-next-location :inferior t) - ;; Emacs20 on LinuxPPC signals a - ;; "Invalid character: 400000040, 2147479172, 0xffffffd8" - ;; for "\C- ". - ;; ("\C- " slime-next-location :prefixed t :inferior t) ("~" slime-sync-package-and-default-directory :prefixed t :inferior t) ("\M-p" slime-repl-set-package :prefixed t :inferior t) ;; Cross reference @@ -605,9 +582,10 @@ ("\C-]" slime-close-all-parens-in-sexp :prefixed t :inferior t :sldb t) ("\C-xt" slime-list-threads :prefixed t :inferior t :sldb t) ("\C-xc" slime-list-connections :prefixed t :inferior t :sldb t) - ;; Shadow unwanted bindings from inf-lisp - ("\C-a" slime-nop :prefixed t :inferior t :sldb t) - ("\C-v" slime-nop :prefixed t :inferior t :sldb t))) + ;; ;; Shadow unwanted bindings from inf-lisp + ;; ("\C-a" slime-nop :prefixed t :inferior t :sldb t) + ;; ("\C-v" slime-nop :prefixed t :inferior t :sldb t) + )) (defun slime-nop () "The null command. Used to shadow currently-unused keybindings." @@ -684,142 +662,6 @@ (slime-init-keymaps) -;;;;; Pull-down menu - -(defvar slime-easy-menu - (let ((C '(slime-connected-p))) - `("SLIME" - [ "Edit Definition..." slime-edit-definition ,C ] - [ "Return From Definition" slime-pop-find-definition-stack ,C ] - [ "Complete Symbol" slime-complete-symbol ,C ] - [ "Show REPL" slime-switch-to-output-buffer ,C ] - "--" - ("Evaluation" - [ "Eval Defun" slime-eval-defun ,C ] - [ "Eval Last Expression" slime-eval-last-expression ,C ] - [ "Eval And Pretty-Print" slime-pprint-eval-last-expression ,C ] - [ "Eval Region" slime-eval-region ,C ] - [ "Interactive Eval..." slime-interactive-eval ,C ] - [ "Edit Lisp Value..." slime-edit-value ,C ] - [ "Call Defun" slime-call-defun ,C ]) - ("Debugging" - [ "Macroexpand Once..." slime-macroexpand-1 ,C ] - [ "Macroexpand All..." slime-macroexpand-all ,C ] - [ "Create Trace Buffer" slime-redirect-trace-output ,C ] - [ "Toggle Trace..." slime-toggle-trace-fdefinition ,C ] - [ "Untrace All" slime-untrace-all ,C] - [ "Disassemble..." slime-disassemble-symbol ,C ] - [ "Inspect..." slime-inspect ,C ]) - ("Compilation" - [ "Compile Defun" slime-compile-defun ,C ] - [ "Compile/Load File" slime-compile-and-load-file ,C ] - [ "Compile File" slime-compile-file ,C ] - [ "Compile Region" slime-compile-region ,C ] - "--" - [ "Next Note" slime-next-note t ] - [ "Previous Note" slime-previous-note t ] - [ "Remove Notes" slime-remove-notes t ] - [ "List Notes" slime-list-compiler-notes ,C ]) - ("Cross Reference" - [ "Who Calls..." slime-who-calls ,C ] - [ "Who References... " slime-who-references ,C ] - [ "Who Sets..." slime-who-sets ,C ] - [ "Who Binds..." slime-who-binds ,C ] - [ "Who Macroexpands..." slime-who-macroexpands ,C ] - [ "Who Specializes..." slime-who-specializes ,C ] - [ "List Callers..." slime-list-callers ,C ] - [ "List Callees..." slime-list-callees ,C ] - [ "Next Location" slime-next-location t ]) - ("Editing" - [ "Check Parens" check-parens t] - [ "Update Indentation" slime-update-indentation ,C] - [ "Select Buffer" slime-selector t]) - ("Profiling" - [ "Toggle Profiling..." slime-toggle-profile-fdefinition ,C ] - [ "Profile Package" slime-profile-package ,C] - [ "Unprofile All" slime-unprofile-all ,C ] - [ "Show Profiled" slime-profiled-functions ,C ] - "--" - [ "Report" slime-profile-report ,C ] - [ "Reset Counters" slime-profile-reset ,C ]) - ("Documentation" - [ "Describe Symbol..." slime-describe-symbol ,C ] - [ "Apropos..." slime-apropos ,C ] - [ "Apropos all..." slime-apropos-all ,C ] - [ "Apropos Package..." slime-apropos-package ,C ] - [ "Hyperspec..." slime-hyperspec-lookup t ]) - "--" - [ "Interrupt Command" slime-interrupt ,C ] - [ "Abort Async. Command" slime-quit ,C ] - [ "Sync Package & Directory" slime-sync-package-and-default-directory ,C] - [ "Set Package in REPL" slime-repl-set-package ,C]))) - -(defvar slime-repl-easy-menu - (let ((C '(slime-connected-p))) - `("REPL" - [ "Send Input" slime-repl-return ,C ] - [ "Close and Send Input " slime-repl-closing-return ,C ] - [ "Interrupt Lisp process" slime-interrupt ,C ] - "--" - [ "Previous Input" slime-repl-previous-input t ] - [ "Next Input" slime-repl-next-input t ] - [ "Goto Previous Prompt " slime-repl-previous-prompt t ] - [ "Goto Next Prompt " slime-repl-next-prompt t ] - [ "Clear Last Output" slime-repl-clear-output t ] - [ "Clear Buffer " slime-repl-clear-buffer t ] - [ "Kill Current Input" slime-repl-kill-input t ]))) - -(defvar slime-sldb-easy-menu - (let ((C '(slime-connected-p))) - `("SLDB" - [ "Next Frame" sldb-down t ] - [ "Previous Frame" sldb-up t ] - [ "Toggle Frame Details" sldb-toggle-details t ] - [ "Next Frame (Details)" sldb-details-down t ] - [ "Previous Frame (Details)" sldb-details-up t ] - "--" - [ "Eval Expression..." slime-interactive-eval ,C ] - [ "Eval in Frame..." sldb-eval-in-frame ,C ] - [ "Eval in Frame (pretty print)..." sldb-pprint-eval-in-frame ,C ] - [ "Inspect In Frame..." sldb-inspect-in-frame ,C ] - [ "Inspect Condition Object" sldb-inspect-condition ,C ] - [ "Print Condition to REPL" sldb-print-condition t ] - "--" - [ "Restart Frame" sldb-restart-frame ,C ] - [ "Return from Frame..." sldb-return-from-frame ,C ] - ("Invoke Restart" - [ "Continue" sldb-continue ,C ] - [ "Abort" sldb-abort ,C ] - [ "Step" sldb-step ,C ] - [ "Step next" sldb-next ,C ] - [ "Step out" sldb-out ,C ] - ) - "--" - [ "Quit (throw)" sldb-quit ,C ] - [ "Break With Default Debugger" sldb-break-with-default-debugger ,C ]))) - - -(easy-menu-define menubar-slime slime-mode-map "SLIME" slime-easy-menu) - -(add-hook 'slime-mode-hook - (defun slime-add-easy-menu () - (easy-menu-add slime-easy-menu 'slime-mode-map))) - -(add-hook 'slime-repl-mode-hook - (defun slime-repl-add-easy-menu () - (easy-menu-define menubar-slime-repl slime-repl-mode-map - "REPL" slime-repl-easy-menu) - (easy-menu-define menubar-slime slime-repl-mode-map - "SLIME" slime-easy-menu) - (easy-menu-add slime-repl-easy-menu 'slime-repl-mode-map))) - -(add-hook 'sldb-mode-hook - (defun slime-sldb-add-easy-menu () - (easy-menu-define menubar-slime-sldb sldb-mode-map - "SLDB" slime-sldb-easy-menu) - (easy-menu-add slime-sldb-easy-menu 'sldb-mode-map))) - - ;;;; Setup initial `slime-mode' hooks (make-variable-buffer-local @@ -1035,21 +877,6 @@ "Insert all ARGS and then add text-PROPS to the inserted text." (slime-propertize-region props (apply #'insert args))) -(defun slime-indent-and-complete-symbol () - "Indent the current line and perform symbol completion. First -indent the line. If indenting doesn't move point, complete the -symbol. If there's no symbol at the point, show the arglist for the -most recently enclosed macro or function." - (interactive) - (let ((pos (point))) - (unless (get-text-property (line-beginning-position) 'slime-repl-prompt) - (lisp-indent-line)) - (when (= pos (point)) - (cond ((save-excursion (re-search-backward "[^() \n\t\r]+\\=" nil t)) - (slime-complete-symbol)) - ((memq (char-before) '(?\t ?\ )) - (slime-echo-arglist)))))) - (defmacro slime-with-rigid-indentation (level &rest body) "Execute BODY and then rigidly indent its text insertions. Assumes all insertions are made at point." @@ -1308,20 +1135,49 @@ ;;;;; Entry points -(defvar slime-inferior-lisp-program-history '() - "History list of command strings. Used by `slime'.") - ;; We no longer load inf-lisp, but we use this variable for backward ;; compatibility. (defvar inferior-lisp-program "lisp" "*Program name for invoking an inferior Lisp with for Inferior Lisp mode.") +(defvar slime-lisp-implementations nil + "*A list of known Lisp implementations. +The list should have the form: + ((NAME (PROGRAM PROGRAM-ARGS...) &key INIT CODING-SYSTEM) ...) + +NAME is a symbol for the implementation. +PROGRAM and PROGRAM-ARGS are strings used to start the Lisp process. +INIT is a function that should return a string to load and start + Swank. The function will be called with the PORT-FILENAME and ENCODING as + arguments. INIT defaults to `slime-init-command'. +CODING-SYSTEM a symbol for the coding system. The default is + slime-net-coding-system + +Here's an example: + ((cmucl (\"/opt/cmucl/bin/lisp\" \"-quiet\") :init slime-init-command) + (acl (\"acl7\") :coding-system emacs-mule))") + +(defvar slime-default-lisp nil + "*The name of the default Lisp implementation. +See `slime-lisp-implementations'") + +(defvar slime-lisp-host "127.0.0.1" + "The default hostname (or IP address) to connect to.") + +;; dummy definitions for the compiler +(defvar slime-net-coding-system) +(defvar slime-net-processes) +(defvar slime-default-connection) + (defun slime (&optional command coding-system) "Start an inferior^_superior Lisp and connect to its Swank server." (interactive) (let ((inferior-lisp-program (or command inferior-lisp-program)) (slime-net-coding-system (or coding-system slime-net-coding-system))) (slime-start* (slime-read-interactive-args)))) + +(defvar slime-inferior-lisp-program-history '() + "History list of command strings. Used by `slime'.") (defun slime-read-interactive-args () "Return the list of args which should be passed to `slime-start'. @@ -1704,9 +1560,6 @@ ;;; here. They are defined elsewhere by the event-dispatching ;;; functions in this file and in swank.lisp. -(defvar slime-lisp-host "127.0.0.1" - "The default hostname (or IP address) to connect to.") - (defvar slime-net-processes nil "List of processes (sockets) connected to Lisps.") @@ -2467,6 +2320,9 @@ (slime-rex-continuations) :key #'car))) +;; dummy defvar for compiler +(defvar slime-repl-read-mode) + (defun slime-reading-p () "True if Lisp is currently reading input from the REPL." (with-current-buffer (slime-output-buffer) @@ -2651,18 +2507,12 @@ (defvar slime-output-end nil "Marker for end of output. New output is inserted at this mark.")) -(defun slime-reset-repl-markers () - (dolist (markname '(slime-output-start - slime-output-end - slime-repl-prompt-start-mark - slime-repl-input-start-mark - slime-repl-input-end-mark - slime-repl-last-input-start-mark)) - (set markname (make-marker)) - (set-marker (symbol-value markname) (point))) - ;; (set-marker-insertion-type slime-output-end t) - (set-marker-insertion-type slime-repl-input-end-mark t) - (set-marker-insertion-type slime-repl-prompt-start-mark t)) +;; dummy definitions for the compiler +(defvar slime-repl-package-stack) +(defvar slime-repl-directory-stack) +(defvar slime-repl-input-start-mark) +(defvar slime-repl-prompt-start-mark) + (defun slime-output-buffer (&optional noprompt) "Return the output buffer, create it if necessary." @@ -2960,6 +2810,19 @@ This property value must be unique to avoid having adjacent inputs be joined together.")) +(defun slime-reset-repl-markers () + (dolist (markname '(slime-output-start + slime-output-end + slime-repl-prompt-start-mark + slime-repl-input-start-mark + slime-repl-input-end-mark + slime-repl-last-input-start-mark)) + (set markname (make-marker)) + (set-marker (symbol-value markname) (point))) + ;; (set-marker-insertion-type slime-output-end t) + (set-marker-insertion-type slime-repl-input-end-mark t) + (set-marker-insertion-type slime-repl-prompt-start-mark t)) + ;;;;; REPL mode setup (defvar slime-repl-mode-map) @@ -3378,15 +3241,12 @@ (delete-region slime-repl-input-start-mark slime-repl-input-end-mark)) (defun slime-repl-kill-input () - "Kill all text from the prompt to point and reset repl history -navigation state. If point is right after the prompt then delete -the entire input." + "Kill all text from the prompt to point." (interactive) - (cond ((> (point) (marker-position slime-repl-input-start-mark)) + (cond ((< (marker-position slime-repl-input-start-mark) (point)) (kill-region slime-repl-input-start-mark (point))) ((= (point) (marker-position slime-repl-input-start-mark)) - (slime-repl-delete-current-input))) - (setf slime-repl-input-history-position -1)) + (slime-repl-delete-current-input)))) (defun slime-repl-replace-input (string) (slime-repl-delete-current-input) @@ -3424,6 +3284,21 @@ (goto-char start) (insert ";;; output flushed")))))) +(defun slime-indent-and-complete-symbol () + "Indent the current line and perform symbol completion. +First indent the line. If indenting doesn't move point, complete +the symbol. If there's no symbol at the point, show the arglist +for the most recently enclosed macro or function." + (interactive) + (let ((pos (point))) + (unless (get-text-property (line-beginning-position) 'slime-repl-prompt) + (lisp-indent-line)) + (when (= pos (point)) + (cond ((save-excursion (re-search-backward "[^() \n\t\r]+\\=" nil t)) + (slime-complete-symbol)) [381 lines skipped] From heller at common-lisp.net Wed Sep 19 11:46:07 2007 From: heller at common-lisp.net (heller) Date: Wed, 19 Sep 2007 07:46:07 -0400 (EDT) Subject: [slime-cvs] CVS slime Message-ID: <20070919114607.7F8222E205@common-lisp.net> Update of /project/slime/cvsroot/slime In directory clnet:/tmp/cvs-serv17131 Modified Files: ChangeLog Removed Files: tree-widget.el Log Message: * tree-widget.el: Delete file. Only needed by contribs and is distributed with Emacs 21. --- /project/slime/cvsroot/slime/ChangeLog 2007/09/19 11:40:33 1.1226 +++ /project/slime/cvsroot/slime/ChangeLog 2007/09/19 11:46:07 1.1227 @@ -1,5 +1,10 @@ 2007-09-19 Helmut Eller + * bridge.el: moved to contrib. + + * tree-widget.el: File deleted. Only needed by contribs and is + distributed with Emacs 21. + * slime.el: Reorder some devfars and menus code so that the compiler doesn't complain about free variables. From heller at common-lisp.net Wed Sep 19 11:47:03 2007 From: heller at common-lisp.net (heller) Date: Wed, 19 Sep 2007 07:47:03 -0400 (EDT) Subject: [slime-cvs] CVS slime/contrib Message-ID: <20070919114703.A9A442F00A@common-lisp.net> Update of /project/slime/cvsroot/slime/contrib In directory clnet:/tmp/cvs-serv17335/contrib Added Files: bridge.el Log Message: * bridge.el: Move file to contrib. --- /project/slime/cvsroot/slime/contrib/bridge.el 2007/09/19 11:47:03 NONE +++ /project/slime/cvsroot/slime/contrib/bridge.el 2007/09/19 11:47:03 1.1 ;;; -*-Emacs-Lisp-*- ;;;%Header ;;; Bridge process filter, V1.0 ;;; Copyright (C) 1991 Chris McConnell, ccm at cs.cmu.edu ;;; ;;; Send mail to ilisp at cons.org if you have problems. ;;; ;;; Send mail to majordomo at cons.org if you want to be on the ;;; ilisp mailing list. ;;; This file is part of GNU Emacs. ;;; GNU Emacs is distributed in the hope that it will be useful, ;;; but WITHOUT ANY WARRANTY. No author or distributor ;;; accepts responsibility to anyone for the consequences of using it ;;; or for whether it serves any particular purpose or works at all, ;;; unless he says so in writing. Refer to the GNU Emacs General Public ;;; License for full details. ;;; Everyone is granted permission to copy, modify and redistribute ;;; GNU Emacs, but only under the conditions described in the ;;; GNU Emacs General Public License. A copy of this license is ;;; supposed to have been given to you along with GNU Emacs so you ;;; can know your rights and responsibilities. It should be in a ;;; file named COPYING. Among other things, the copyright notice ;;; and this notice must be preserved on all copies. ;;; Send any bugs or comments. Thanks to Todd Kaufmann for rewriting ;;; the process filter for continuous handlers. ;;; USAGE: M-x install-bridge will add a process output filter to the ;;; current buffer. Any output that the process does between ;;; bridge-start-regexp and bridge-end-regexp will be bundled up and ;;; passed to the first handler on bridge-handlers that matches the ;;; output using string-match. If bridge-prompt-regexp shows up ;;; before bridge-end-regexp, the bridge will be cancelled. If no ;;; handler matches the output, the first symbol in the output is ;;; assumed to be a buffer name and the rest of the output will be ;;; sent to that buffer's process. This can be used to communicate ;;; between processes or to set up two way interactions between Emacs ;;; and an inferior process. ;;; You can write handlers that process the output in special ways. ;;; See bridge-send-handler for the default handler. The command ;;; hand-bridge is useful for testing. Keep in mind that all ;;; variables are buffer local. ;;; YOUR .EMACS FILE: ;;; ;;; ;;; Set up load path to include bridge ;;; (setq load-path (cons "/bridge-directory/" load-path)) ;;; (autoload 'install-bridge "bridge" "Install a process bridge." t) ;;; (setq bridge-hook ;;; '(lambda () ;;; ;; Example options ;;; (setq bridge-source-insert nil) ;Don't insert in source buffer ;;; (setq bridge-destination-insert nil) ;Don't insert in dest buffer ;;; ;; Handle copy-it messages yourself ;;; (setq bridge-handlers ;;; '(("copy-it" . my-copy-handler))))) ;;; EXAMPLE: ;;; # This pipes stdin to the named buffer in a Unix shell ;;; alias devgnu '(echo -n "\!* "; cat -; echo -n "")' ;;; ;;; ls | devgnu *scratch* (eval-when-compile (require 'cl)) ;;;%Parameters (defvar bridge-hook nil "Hook called when a bridge is installed by install-hook.") (defvar bridge-start-regexp "" "*Regular expression to match the start of a process bridge in process output. It should be followed by a buffer name, the data to be sent and a bridge-end-regexp.") (defvar bridge-end-regexp "" "*Regular expression to match the end of a process bridge in process output.") (defvar bridge-prompt-regexp nil "*Regular expression for detecting a prompt. If there is a comint-prompt-regexp, it will be initialized to that. A prompt before a bridge-end-regexp will stop the process bridge.") (defvar bridge-handlers nil "Alist of (regexp . handler) for handling process output delimited by bridge-start-regexp and bridge-end-regexp. The first entry on the list whose regexp matches the output will be called on the process and the delimited output.") (defvar bridge-source-insert t "*T to insert bridge input in the source buffer minus delimiters.") (defvar bridge-destination-insert t "*T for bridge-send-handler to insert bridge input into the destination buffer minus delimiters.") (defvar bridge-chunk-size 512 "*Long inputs send to comint processes are broken up into chunks of this size. If your process is choking on big inputs, try lowering the value.") ;;;%Internal variables (defvar bridge-old-filter nil "Old filter for a bridged process buffer.") (defvar bridge-string nil "The current output in the process bridge.") (defvar bridge-in-progress nil "The current handler function, if any, that bridge passes strings on to, or nil if none.") (defvar bridge-leftovers nil "Because of chunking you might get an incomplete bridge signal - start but the end is in the next packet. Save the overhanging text here.") (defvar bridge-send-to-buffer nil "The buffer that the default bridge-handler (bridge-send-handler) is currently sending to, or nil if it hasn't started yet. Your handler function can use this variable also.") (defvar bridge-last-failure () "Last thing that broke the bridge handler. First item is function call (eval'able); last item is error condition which resulted. This is provided to help handler-writers in their debugging.") ;;;%Utilities (defun bridge-insert (output) "Insert process OUTPUT into the current buffer." (if output (let* ((buffer (current-buffer)) (process (get-buffer-process buffer)) (mark (process-mark process)) (window (selected-window)) (at-end nil)) (if (eq (window-buffer window) buffer) (setq at-end (= (point) mark)) (setq window (get-buffer-window buffer))) (save-excursion (goto-char mark) (insert output) (set-marker mark (point))) (if window (progn (if at-end (goto-char mark)) (if (not (pos-visible-in-window-p (point) window)) (let ((original (selected-window))) (save-excursion (select-window window) (recenter '(center)) (select-window original))))))))) ;;; ;(defun bridge-send-string (process string) ; "Send PROCESS the contents of STRING as input. ;This is equivalent to process-send-string, except that long input strings ;are broken up into chunks of size comint-input-chunk-size. Processes ;are given a chance to output between chunks. This can help prevent processes ;from hanging when you send them long inputs on some OS's." ; (let* ((len (length string)) ; (i (min len bridge-chunk-size))) ; (process-send-string process (substring string 0 i)) ; (while (< i len) ; (let ((next-i (+ i bridge-chunk-size))) ; (accept-process-output) ; (process-send-string process (substring string i (min len next-i))) ; (setq i next-i))))) ;;; (defun bridge-call-handler (handler proc string) "Funcall HANDLER on PROC, STRING carefully. Error is caught if happens, and user is signaled. State is put in bridge-last-failure. Returns t if handler executed without error." (let ((inhibit-quit nil) (failed nil)) (condition-case err (funcall handler proc string) (error (ding) (setq failed t) (message "bridge-handler \"%s\" failed %s (see bridge-last-failure)" handler err) (setq bridge-last-failure (` ((funcall '(, handler) '(, proc) (, string)) "Caused: " (, err)))))) (not failed))) ;;;%Handlers (defun bridge-send-handler (process input) "Send PROCESS INPUT to the buffer name found at the start of the input. The input after the buffer name is sent to the buffer's process if it has one. If bridge-destination-insert is T, the input will be inserted into the buffer. If it does not have a process, it will be inserted at the end of the buffer." (if (null input) (setq bridge-send-to-buffer nil) ; end of bridge (let (buffer-and-start buffer-name dest to) ;; if this is first time, get the buffer out of the first line (cond ((not bridge-send-to-buffer) (setq buffer-and-start (read-from-string input) buffer-name (format "%s" (car (read-from-string input))) dest (get-buffer buffer-name) to (get-buffer-process dest) input (substring input (cdr buffer-and-start))) (setq bridge-send-to-buffer dest)) (t (setq buffer-name bridge-send-to-buffer dest (get-buffer buffer-name) to (get-buffer-process dest) ))) (if dest (let ((buffer (current-buffer))) (if bridge-destination-insert (unwind-protect (progn (set-buffer dest) (if to (bridge-insert process input) (goto-char (point-max)) (insert input))) (set-buffer buffer))) (if to ;; (bridge-send-string to input) (process-send-string to input) )) (error "%s is not a buffer" buffer-name))))) ;;;%Filter (defun bridge-filter (process output) "Given PROCESS and some OUTPUT, check for the presence of bridge-start-regexp. Everything prior to this will be passed to the normal filter function or inserted in the buffer if it is nil. The output up to bridge-end-regexp will be sent to the first handler on bridge-handlers that matches the string. If no handlers match, the input will be sent to bridge-send-handler. If bridge-prompt-regexp is encountered before the bridge-end-regexp, the bridge will be cancelled." (let ((inhibit-quit t) (match-data (match-data)) (buffer (current-buffer)) (process-buffer (process-buffer process)) (case-fold-search t) (start 0) (end 0) function b-start b-start-end b-end) (set-buffer process-buffer) ;; access locals ;; Handle bridge messages that straddle a packet by prepending ;; them to this packet. (when bridge-leftovers (setq output (concat bridge-leftovers output)) (setq bridge-leftovers nil)) (setq function bridge-in-progress) ;; How it works: ;; ;; start, end delimit the part of string we are interested in; ;; initially both 0; after an iteration we move them to next string. ;; b-start, b-end delimit part of string to bridge (possibly whole string); ;; this will be string between corresponding regexps. ;; There are two main cases when we come into loop: ;; bridge in progress ;;0 setq b-start = start ;;1 setq b-end (or end-pattern end) ;;4 process string ;;5 remove handler if end found ;; no bridge in progress ;;0 setq b-start if see start-pattern ;;1 setq b-end if bstart to (or end-pattern end) ;;2 send (substring start b-start) to normal place ;;3 find handler (in b-start, b-end) if not set ;;4 process string ;;5 remove handler if end found ;; equivalent sections have the same numbers here; ;; we fold them together in this code. (block bridge-filter (unwind-protect (while (< end (length output)) ;;0 setq b-start if find (setq b-start (cond (bridge-in-progress (setq b-start-end start) start) ((string-match bridge-start-regexp output start) (setq b-start-end (match-end 0)) (match-beginning 0)) (t nil))) ;;1 setq b-end (setq b-end (if b-start (let ((end-seen (string-match bridge-end-regexp output b-start-end))) (if end-seen (setq end (match-end 0))) end-seen))) ;; Detect and save partial bridge messages (when (and b-start b-start-end (not b-end)) (setq bridge-leftovers (substring output b-start)) ) (if (and b-start (not b-end)) (setq end b-start) (if (not b-end) (setq end (length output)))) ;;1.5 - if see prompt before end, remove current (if (and b-start b-end) (let ((prompt (string-match bridge-prompt-regexp output b-start-end))) (if (and prompt (<= (match-end 0) b-end)) (setq b-start nil ; b-start-end start b-end start end (match-end 0) bridge-in-progress nil )))) ;;2 send (substring start b-start) to old filter, if any (when (not (equal start (or b-start end))) ; don't bother on empty string (let ((pass-on (substring output start (or b-start end)))) (if bridge-old-filter (let ((old bridge-old-filter)) (store-match-data match-data) (funcall old process pass-on) ;; if filter changed, re-install ourselves (let ((new (process-filter process))) (if (not (eq new 'bridge-filter)) (progn (setq bridge-old-filter new) (set-process-filter process 'bridge-filter))))) (set-buffer process-buffer) (bridge-insert pass-on)))) (if (and b-start-end (not b-end)) (return-from bridge-filter t) ; when last bit has prematurely ending message, exit early. (progn ;;3 find handler (in b-start, b-end) if none current (if (and b-start (not bridge-in-progress)) (let ((handlers bridge-handlers)) (while (and handlers (not function)) (let* ((handler (car handlers)) (m (string-match (car handler) output b-start-end))) (if (and m (< m b-end)) (setq function (cdr handler)) (setq handlers (cdr handlers))))) ;; Set default handler if none (if (null function) (setq function 'bridge-send-handler)) (setq bridge-in-progress function))) ;;4 process strin (if function (let ((ok t)) (if (/= b-start-end b-end) (let ((send (substring output b-start-end b-end))) ;; also, insert the stuff in buffer between ;; iff bridge-source-insert. (if bridge-source-insert (bridge-insert send)) ;; call handler on string (setq ok (bridge-call-handler function process send)))) ;;5 remove handler if end found ;; if function removed then tell it that's all (if (or (not ok) (/= b-end end)) ;; saw end before end-of-string (progn (bridge-call-handler function process nil) ;; have to remove function too for next time around (setq function nil bridge-in-progress nil) )) )) ;; continue looping, in case there's more string (setq start end)) )) ;; protected forms: restore buffer, match-data (set-buffer buffer) (store-match-data match-data) )))) ;;;%Interface (defun install-bridge () "Set up a process bridge in the current buffer." (interactive) (if (not (get-buffer-process (current-buffer))) (error "%s does not have a process" (buffer-name (current-buffer))) (make-local-variable 'bridge-start-regexp) (make-local-variable 'bridge-end-regexp) (make-local-variable 'bridge-prompt-regexp) [67 lines skipped] From heller at common-lisp.net Wed Sep 19 11:47:30 2007 From: heller at common-lisp.net (heller) Date: Wed, 19 Sep 2007 07:47:30 -0400 (EDT) Subject: [slime-cvs] CVS slime Message-ID: <20070919114730.7A295330CA@common-lisp.net> Update of /project/slime/cvsroot/slime In directory clnet:/tmp/cvs-serv17447 Removed Files: bridge.el Log Message: moved to contrib From heller at common-lisp.net Wed Sep 19 11:48:54 2007 From: heller at common-lisp.net (heller) Date: Wed, 19 Sep 2007 07:48:54 -0400 (EDT) Subject: [slime-cvs] CVS slime Message-ID: <20070919114854.EDE3944060@common-lisp.net> Update of /project/slime/cvsroot/slime In directory clnet:/tmp/cvs-serv17575 Modified Files: ChangeLog Removed Files: swank-version.el Log Message: * swank-version.el: Delete file. No longer used. --- /project/slime/cvsroot/slime/ChangeLog 2007/09/19 11:46:07 1.1227 +++ /project/slime/cvsroot/slime/ChangeLog 2007/09/19 11:48:54 1.1228 @@ -1,6 +1,8 @@ 2007-09-19 Helmut Eller - * bridge.el: moved to contrib. + * swank-version.el: Delete file. No longer used. + + * bridge.el: Moved to contrib. * tree-widget.el: File deleted. Only needed by contribs and is distributed with Emacs 21. From heller at common-lisp.net Wed Sep 19 11:55:46 2007 From: heller at common-lisp.net (heller) Date: Wed, 19 Sep 2007 07:55:46 -0400 (EDT) Subject: [slime-cvs] CVS slime Message-ID: <20070919115546.2F31165119@common-lisp.net> Update of /project/slime/cvsroot/slime In directory clnet:/tmp/cvs-serv18141 Modified Files: ChangeLog slime.el Log Message: * slime-c-p-c.el (slime-complete-symbol*-fancy): Move defcustom from slime.el to contrib/slime-c-p-c.el. --- /project/slime/cvsroot/slime/ChangeLog 2007/09/19 11:48:54 1.1228 +++ /project/slime/cvsroot/slime/ChangeLog 2007/09/19 11:55:45 1.1229 @@ -1,5 +1,8 @@ 2007-09-19 Helmut Eller + * slime.el (slime-complete-symbol*-fancy): Move defcustom to + contrib/slime-c-p-c.el + * swank-version.el: Delete file. No longer used. * bridge.el: Moved to contrib. --- /project/slime/cvsroot/slime/slime.el 2007/09/19 11:40:33 1.870 +++ /project/slime/cvsroot/slime/slime.el 2007/09/19 11:55:45 1.871 @@ -236,21 +236,11 @@ :group 'slime-mode :type 'boolean) -(defcustom slime-complete-symbol*-fancy nil - "Use information from argument lists for DWIM'ish symbol completion." - :group 'slime-mode - :type 'boolean) - (defcustom slime-space-information-p t "Have the SPC key offer arglist information." :type 'boolean :group 'slime-mode) -(defcustom slime-display-compilation-output t - "Display the REPL buffer before compiling files." - :type '(choice (const :tag "Enable" t) (const :tag "Disable" nil)) - :group 'slime-mode) - ;;;;; slime-mode-faces (defgroup slime-mode-faces nil @@ -3841,6 +3831,11 @@ (defvar slime-highlight-compiler-notes t "*When non-nil annotate buffers with compilation notes etc.") +(defcustom slime-display-compilation-output t + "Display the REPL buffer before compiling files." + :type '(choice (const :tag "Enable" t) (const :tag "Disable" nil)) + :group 'slime-mode) + (defvar slime-before-compile-functions nil "A list of function called before compiling a buffer or region. The function receive two arguments: the beginning and the end of the From heller at common-lisp.net Wed Sep 19 11:55:46 2007 From: heller at common-lisp.net (heller) Date: Wed, 19 Sep 2007 07:55:46 -0400 (EDT) Subject: [slime-cvs] CVS slime/contrib Message-ID: <20070919115546.6A16C68220@common-lisp.net> Update of /project/slime/cvsroot/slime/contrib In directory clnet:/tmp/cvs-serv18141/contrib Modified Files: ChangeLog slime-c-p-c.el Log Message: * slime-c-p-c.el (slime-complete-symbol*-fancy): Move defcustom from slime.el to contrib/slime-c-p-c.el. --- /project/slime/cvsroot/slime/contrib/ChangeLog 2007/09/15 22:43:59 1.53 +++ /project/slime/cvsroot/slime/contrib/ChangeLog 2007/09/19 11:55:46 1.54 @@ -1,3 +1,8 @@ +2007-09-19 Helmut Eller + + * slime-c-p-c.el (slime-complete-symbol*-fancy): Move defcustom + from slime.el to contrib/slime-c-p-c.el. + 2007-09-16 Tobias C. Rittweiler * swank-fuzzy.lisp: Fix regression that would not allow to fuzzy --- /project/slime/cvsroot/slime/contrib/slime-c-p-c.el 2007/09/05 18:57:25 1.6 +++ /project/slime/cvsroot/slime/contrib/slime-c-p-c.el 2007/09/19 11:55:46 1.7 @@ -27,6 +27,11 @@ :type 'boolean :group 'slime-ui) +(defcustom slime-complete-symbol*-fancy nil + "Use information from argument lists for DWIM'ish symbol completion." + :group 'slime-mode + :type 'boolean) + (defun slime-complete-symbol* () "Expand abbreviations and complete the symbol at point." ;; NB: It is only the name part of the symbol that we actually want From heller at common-lisp.net Wed Sep 19 11:58:21 2007 From: heller at common-lisp.net (heller) Date: Wed, 19 Sep 2007 07:58:21 -0400 (EDT) Subject: [slime-cvs] CVS slime Message-ID: <20070919115821.070BC16@common-lisp.net> Update of /project/slime/cvsroot/slime In directory clnet:/tmp/cvs-serv18383 Modified Files: ChangeLog slime.el Log Message: Simplify slime-compile-file. * slime.el (slime-compile-file): Don't save window config. (slime-curry, slime-rcurry): New functions. --- /project/slime/cvsroot/slime/ChangeLog 2007/09/19 11:55:45 1.1229 +++ /project/slime/cvsroot/slime/ChangeLog 2007/09/19 11:58:20 1.1230 @@ -1,5 +1,10 @@ 2007-09-19 Helmut Eller + Simplify slime-compile-file. + + * slime.el (slime-compile-file): Don't save window config. + (slime-curry, slime-rcurry): New functions. + * slime.el (slime-complete-symbol*-fancy): Move defcustom to contrib/slime-c-p-c.el --- /project/slime/cvsroot/slime/slime.el 2007/09/19 11:55:45 1.871 +++ /project/slime/cvsroot/slime/slime.el 2007/09/19 11:58:20 1.872 @@ -892,6 +892,12 @@ (slime-with-rigid-indentation nil (apply #'insert strings))) +(defun slime-curry (fun &rest args) + `(lambda (&rest more) (apply ',fun (append ',args more)))) + +(defun slime-rcurry (fun &rest args) + `(lambda (&rest more) (apply ',fun (append more ',args)))) + ;;;;; Snapshots of current Emacs state ;;; Window configurations do not save (and hence not restore) @@ -1267,13 +1273,13 @@ (slime-load-file-set-package filename package)) (t (slime-start-and-init (slime-lisp-options) - #'slime-start-and-load filename package)))) + (slime-curry #'slime-start-and-load + filename package))))) -(defun slime-start-and-init (options fun &rest args) - (lexical-let* ((fun fun) (args args) - (rest (plist-get options :init-function)) - (init (cond (rest (lambda () (funcall rest) (apply fun args))) - (t (lambda () (apply fun args)))))) +(defun slime-start-and-init (options fun) + (let* ((rest (plist-get options :init-function)) + (init (cond (rest `(lambda () (funcall ',rest) (funcall ',fun))) + (t fun)))) (slime-start* (plist-put (copy-list options) :init-function init)))) (defun slime-load-file-set-package (filename package) @@ -3879,19 +3885,14 @@ (y-or-n-p (format "Save file %s? " (buffer-file-name)))) (save-buffer)) (run-hook-with-args 'slime-before-compile-functions (point-min) (point-max)) - (let ((lisp-filename (slime-to-lisp-filename (buffer-file-name))) - (snapshot (slime-current-emacs-snapshot))) - (slime-insert-transcript-delimiter - (format "Compile file %s" lisp-filename)) - ;; The following may alter the current window configuration, so we saved - ;; it above to pass it on for it to be properly restored! + (let ((file (slime-to-lisp-filename (buffer-file-name)))) + (slime-insert-transcript-delimiter (format "Compile file %s" file)) (when slime-display-compilation-output (slime-display-output-buffer)) - (slime-eval-async - `(swank:compile-file-for-emacs - ,lisp-filename ,(if load t nil)) - (slime-make-compilation-finished-continuation (current-buffer) snapshot)) - (message "Compiling %s.." lisp-filename))) + (slime-eval-async + `(swank:compile-file-for-emacs ,file ,(if load t nil)) + (slime-rcurry #'slime-compilation-finished (current-buffer))) + (message "Compiling %s..." file))) (defun slime-compile-defun () "Compile the current toplevel form." From heller at common-lisp.net Thu Sep 20 14:55:54 2007 From: heller at common-lisp.net (heller) Date: Thu, 20 Sep 2007 10:55:54 -0400 (EDT) Subject: [slime-cvs] CVS slime/contrib Message-ID: <20070920145554.26FA11B01E@common-lisp.net> Update of /project/slime/cvsroot/slime/contrib In directory clnet:/tmp/cvs-serv27001 Modified Files: ChangeLog slime-asdf.el slime-autodoc.el slime-banner.el slime-c-p-c.el slime-editing-commands.el slime-fancy-inspector.el slime-fancy.el slime-fuzzy.el slime-highlight-edits.el slime-presentations.el slime-references.el slime-scratch.el slime-typeout-frame.el swank-fancy-inspector.lisp Log Message: Separate loading from initialization for many contribs. --- /project/slime/cvsroot/slime/contrib/ChangeLog 2007/09/19 11:55:46 1.54 +++ /project/slime/cvsroot/slime/contrib/ChangeLog 2007/09/20 14:55:53 1.55 @@ -1,3 +1,24 @@ +2007-09-20 Helmut Eller + + Separate loading from initialization for many contribs. + + * slime-asdf.el + * slime-autodoc.el + * slime-banner.el + * slime-c-p-c.el + * slime-editing-commands.el + * slime-fancy-inspector.el + * slime-fuzzy.el + * slime-highlight-edits.el + * slime-presentations.el + * slime-references.el + * slime-scratch.el + * slime-typeout-frame.el + * swank-fancy-inspector.lisp + + * slime-fancy.el: As an exception, call the respective init + function when loading. + 2007-09-19 Helmut Eller * slime-c-p-c.el (slime-complete-symbol*-fancy): Move defcustom --- /project/slime/cvsroot/slime/contrib/slime-asdf.el 2007/09/04 10:32:07 1.1 +++ /project/slime/cvsroot/slime/contrib/slime-asdf.el 2007/09/20 14:55:53 1.2 @@ -104,6 +104,10 @@ (defun slime-asdf-on-connect () (slime-eval-async '(swank:swank-require :swank-asdf))) -(add-hook 'slime-connected-hook 'slime-asdf-on-connect) +(defun slime-adsf-init () + (add-hook 'slime-connected-hook 'slime-asdf-on-connect)) + +(defun slime-adsf-unload () + (remove-hook 'slime-connected-hook 'slime-asdf-on-connect)) (provide 'slime-asdf) --- /project/slime/cvsroot/slime/contrib/slime-autodoc.el 2007/09/15 15:15:27 1.3 +++ /project/slime/cvsroot/slime/contrib/slime-autodoc.el 2007/09/20 14:55:53 1.4 @@ -263,6 +263,10 @@ (when slime-use-autodoc-mode (slime-autodoc-mode 1))) -(slime-autodoc-init) +(defun slime-autodoc-unload () + (setq slime-echo-arglist-function 'slime-show-arglist) + (remove-hook 'slime-connected-hook 'slime-autodoc-on-connect) + (dolist (h '(slime-mode-hook slime-repl-mode-hook sldb-mode-hook)) + (remove-hook h 'slime-autodoc-maybe-enable))) (provide 'slime-autodoc) --- /project/slime/cvsroot/slime/contrib/slime-banner.el 2007/09/08 22:23:46 1.3 +++ /project/slime/cvsroot/slime/contrib/slime-banner.el 2007/09/20 14:55:53 1.4 @@ -35,6 +35,10 @@ (animate-string welcome 0 0) (insert welcome))))) -(setq slime-repl-banner-function 'slime-startup-message) +(defun slime-banner-init () + (setq slime-repl-banner-function 'slime-startup-message)) + +(defun slime-banner-unload () + (setq slime-repl-banner-function 'slime-repl-insert-banner)) (provide 'slime-banner) --- /project/slime/cvsroot/slime/contrib/slime-c-p-c.el 2007/09/19 11:55:46 1.7 +++ /project/slime/cvsroot/slime/contrib/slime-c-p-c.el 2007/09/20 14:55:53 1.8 @@ -18,6 +18,7 @@ +(require 'slime) (require 'slime-parse) (require 'slime-editing-commands) @@ -173,16 +174,29 @@ ;;; Initialization +(defvar slime-c-p-c-init-undo-stack nil) + (defun slime-c-p-c-init () + ;; save current state for unload + (push + `(progn + (setq slime-complete-symbol-function ',slime-complete-symbol-function) + (remove-hook 'slime-connected-hook 'slime-c-p-c-on-connect) + (define-key slime-mode-map "\C-c\C-s" + ',(lookup-key slime-mode-map "\C-c\C-s")) + (define-key slime-repl-mode-map "\C-c\C-s" + ',(lookup-key slime-repl-mode-map "\C-c\C-s"))) + slime-c-p-c-init-undo-stack) (setq slime-complete-symbol-function 'slime-complete-symbol*) (add-hook 'slime-connected-hook 'slime-c-p-c-on-connect) (define-key slime-mode-map "\C-c\C-s" 'slime-complete-form) - (define-key slime-repl-mode-map "\C-c\C-s" 'slime-complete-form) - ) + (define-key slime-repl-mode-map "\C-c\C-s" 'slime-complete-form)) (defun slime-c-p-c-on-connect () (slime-eval-async '(swank:swank-require :swank-arglists))) -(slime-c-p-c-init) +(defun slime-c-p-c-unload () + (while slime-c-p-c-init-undo-stack + (eval (pop slime-c-p-c-init-undo-stack)))) (provide 'slime-c-p-c) --- /project/slime/cvsroot/slime/contrib/slime-editing-commands.el 2007/09/11 18:08:20 1.4 +++ /project/slime/cvsroot/slime/contrib/slime-editing-commands.el 2007/09/20 14:55:53 1.5 @@ -186,6 +186,4 @@ (define-key slime-mode-map "\M-\C-e" 'slime-end-of-defun) (define-key slime-mode-map "\C-c\M-q" 'slime-reindent-defun)) -(slime-editing-commands-init) - (provide 'slime-editing-commands) --- /project/slime/cvsroot/slime/contrib/slime-fancy-inspector.el 2007/08/23 17:46:31 1.1 +++ /project/slime/cvsroot/slime/contrib/slime-fancy-inspector.el 2007/09/20 14:55:53 1.2 @@ -9,11 +9,20 @@ ;; ;; (add-to-list 'load-path "") ;; (add-hook 'slime-load-hook (lambda () (require 'slime-fancy-inspector))) -;; - -(add-hook 'slime-connected-hook 'slime-install-fancy-inspector) +;; (add-hook 'slime-connected-hook 'slime-install-fancy-inspector) (defun slime-install-fancy-inspector () - (slime-eval-async '(swank:swank-require :swank-fancy-inspector))) + (slime-eval-async '(swank:swank-require :swank-fancy-inspector) + (lambda (_) + (slime-eval-async '(swank:fancy-inspector-init))))) + +(defun slime-deinstall-fancy-inspector () + (slime-eval-async '(swank:fancy-inspector-unload))) + +(defun slime-fancy-inspector-init () + (add-hook 'slime-connected-hook 'slime-install-fancy-inspector)) + +(defun slime-fancy-inspector-unload () + (remove-hook 'slime-connected-hook 'slime-install-fancy-inspector)) (provide 'slime-fancy-inspector) \ No newline at end of file --- /project/slime/cvsroot/slime/contrib/slime-fancy.el 2007/09/11 10:00:24 1.2 +++ /project/slime/cvsroot/slime/contrib/slime-fancy.el 2007/09/20 14:55:53 1.3 @@ -1,4 +1,4 @@ -;;; slime-fancy.el --- Load all stable fancy SLIME contribs +;;; slime-fancy.el --- Load and init some fancy SLIME contribs ;; ;; Authors: Matthias Koeppe ;; @@ -19,28 +19,35 @@ ;; Better arglist display, can be turned off by customization. (require 'slime-autodoc) +(slime-autodoc-init) ;; Adds new commands and installs compound-prefix-completion as ;; default completion command. Behaves similar to standard Emacs ;; completion, unless dashes are present. --mkoeppe (require 'slime-c-p-c) +(slime-c-p-c-init) -;; Just adds commands. +;; Just adds commands. (Well, shadows commands in lisp-mode-map) (require 'slime-editing-commands) +(slime-editing-commands-init) ;; Makes the inspector fancier. (require 'slime-fancy-inspector) +(slime-fancy-inspector-init) ;; Just adds the command C-c M-i. We do not make fuzzy completion the ;; default completion invoked by TAB. --mkoeppe (require 'slime-fuzzy) +(slime-fuzzy-init) (require 'slime-highlight-edits) +(slime-highlight-edits-init) ;; Load slime-presentations even though they seem to be a ;; controversial feature, as they can be easily turned off by ;; customizing swank:*record-repl-results*. --mkoeppe (require 'slime-presentations) +(slime-presentations-init) ;;; Do not load slime-presentation-streams, as this is an experimental ;;; feature that installs patches into some Lisps. --mkoeppe @@ -53,10 +60,11 @@ ;;(require 'slime-typeout-frame) ;; Just adds commands. -(require 'slime-xref-browser) +(when (locate-library "tree-widget") + (require 'slime-xref-browser)) ;; Puts clickable references to documentation into SBCL errors. (require 'slime-references) +(slime-references-init) (provide 'slime-fancy) - --- /project/slime/cvsroot/slime/contrib/slime-fuzzy.el 2007/09/10 11:01:01 1.3 +++ /project/slime/cvsroot/slime/contrib/slime-fuzzy.el 2007/09/20 14:55:53 1.4 @@ -595,6 +595,4 @@ (defun slime-fuzzy-on-connect () (slime-eval-async '(swank:swank-require :swank-fuzzy))) -(slime-fuzzy-init) - (provide 'slime-fuzzy) --- /project/slime/cvsroot/slime/contrib/slime-highlight-edits.el 2007/09/15 15:15:27 1.2 +++ /project/slime/cvsroot/slime/contrib/slime-highlight-edits.el 2007/09/20 14:55:53 1.3 @@ -90,6 +90,10 @@ (defun slime-highlight-edits-mode-on () (slime-highlight-edits-mode 1)) -(add-hook 'slime-mode-hook 'slime-highlight-edits-mode-on) +(defun slime-highlight-edits-init () + (add-hook 'slime-mode-hook 'slime-highlight-edits-mode-on)) + +(defun slime-highlight-edits-unload () + (remove-hook 'slime-mode-hook 'slime-highlight-edits-mode-on)) (provide 'slime-highlight-edits) \ No newline at end of file --- /project/slime/cvsroot/slime/contrib/slime-presentations.el 2007/09/06 21:22:26 1.7 +++ /project/slime/cvsroot/slime/contrib/slime-presentations.el 2007/09/20 14:55:53 1.8 @@ -626,7 +626,7 @@ ;;; Initialization -(defun slime-presentation-init () +(defun slime-presentations-init () (add-hook 'slime-repl-mode-hook (lambda () ;; Respect the syntax text properties of presentation. @@ -638,13 +638,12 @@ (add-hook 'slime-repl-return-hooks 'slime-presentation-on-return-pressed) (add-hook 'slime-repl-current-input-hooks 'slime-presentation-current-input) (add-hook 'slime-open-stream-hooks 'slime-presentation-on-stream-open) - (add-hook 'slime-repl-clear-buffer-hook 'slime-clear-presentations)) - -(slime-presentation-init) - -(add-hook 'slime-connected-hook 'slime-install-presentations) + (add-hook 'slime-repl-clear-buffer-hook 'slime-clear-presentations) + (add-hook 'slime-connected-hook 'slime-install-presentations)) (defun slime-install-presentations () (slime-eval-async '(swank:swank-require :swank-presentations))) +(slime-presentations-init) + (provide 'slime-presentations) --- /project/slime/cvsroot/slime/contrib/slime-references.el 2007/09/10 21:38:35 1.3 +++ /project/slime/cvsroot/slime/contrib/slime-references.el 2007/09/20 14:55:53 1.4 @@ -124,8 +124,12 @@ ;;; Initialization -(setq slime-tree-printer 'slime-tree-print-with-references) - -(add-hook 'sldb-extras-hooks 'sldb-maybe-insert-references) +(defun slime-references-init () + (setq slime-tree-printer 'slime-tree-print-with-references) + (add-hook 'sldb-extras-hooks 'sldb-maybe-insert-references)) +(defun slime-references-unload () + (setq slime-tree-printer 'slime-tree-default-printer) + (remove-hook 'sldb-extras-hooks 'sldb-maybe-insert-references)) + (provide 'slime-references) --- /project/slime/cvsroot/slime/contrib/slime-scratch.el 2007/09/04 10:18:44 1.3 +++ /project/slime/cvsroot/slime/contrib/slime-scratch.el 2007/09/20 14:55:53 1.4 @@ -40,8 +40,9 @@ (slime-define-keys slime-scratch-mode-map ("\C-j" 'slime-eval-print-last-expression)) -(def-slime-selector-method ?s - "*slime-scratch* buffer." - (slime-scratch-buffer)) +(defun slime-scratch-init () + (def-slime-selector-method ?s + "*slime-scratch* buffer." + (slime-scratch-buffer))) (provide 'slime-scratch) \ No newline at end of file --- /project/slime/cvsroot/slime/contrib/slime-typeout-frame.el 2007/09/01 05:37:19 1.2 +++ /project/slime/cvsroot/slime/contrib/slime-typeout-frame.el 2007/09/20 14:55:53 1.3 @@ -56,12 +56,25 @@ ;;; Initialization -(defun slime-install-typeout-frame () +(defvar slime-typeout-frame-unbind-stack ()) + +(defun slime-typeout-frame-init () (add-hook 'slime-connected-hook 'slime-ensure-typeout-frame) - (setq slime-message-function #'slime-typeout-message) - (setq slime-background-message-function #'slime-typeout-message) - (setq slime-autodoc-message-function #'slime-typeout-autodoc-message)) + (loop for (var value) in + '((slime-message-function #'slime-typeout-message) + (slime-background-message-function #'slime-typeout-message) + (slime-autodoc-message-function #'slime-typeout-autodoc-message)) + do (slime-typeout-frame-init-var var value))) -(slime-install-typeout-frame) +(defun slime-typeout-frame-init-var (var value) + (push (list var (if (boundp var) (symbol-value var) 'slime-unbound)) + slime-typeout-frame-unbind-stack) + (set var value)) +(defun slime-typeout-frame-unload () + (remove-hook 'slime-connected-hook 'slime-ensure-typeout-frame) + (loop for (var value) in slime-typeout-frame-unbind-stack + do (cond ((eq var 'slime-unbound) (makunbound var)) + (t (set var value))))) + (provide 'slime-typeout-frame) --- /project/slime/cvsroot/slime/contrib/swank-fancy-inspector.lisp 2007/09/15 11:29:22 1.3 +++ /project/slime/cvsroot/slime/contrib/swank-fancy-inspector.lisp 2007/09/20 14:55:53 1.4 @@ -721,6 +721,17 @@ content)) (values title content))))) -(setq *default-inspector* (make-instance 'fancy-inspector)) +(defvar *fancy-inpector-undo-list* nil) + +(defslimefun fancy-inspector-init () + (let ((i *default-inspector*)) + (push (lambda () (setq *default-inspector* i)) + *fancy-inpector-undo-list*)) + (setq *default-inspector* (make-instance 'fancy-inspector)) + t) + +(defslimefun fancy-inspector-unload () + (loop while *fancy-inpector-undo-list* do + (funcall (pop *fancy-inpector-undo-list*)))) (provide :swank-fancy-inspector) \ No newline at end of file From heller at common-lisp.net Thu Sep 20 14:59:08 2007 From: heller at common-lisp.net (heller) Date: Thu, 20 Sep 2007 10:59:08 -0400 (EDT) Subject: [slime-cvs] CVS slime Message-ID: <20070920145908.06A972F00A@common-lisp.net> Update of /project/slime/cvsroot/slime In directory clnet:/tmp/cvs-serv27320 Modified Files: ChangeLog slime-autoloads.el slime.el Log Message: * slime.el (slime-setup): Call the respective init functions of contribs. * slime-autoloads.el (slime-setup-contribs): Ditto. --- /project/slime/cvsroot/slime/ChangeLog 2007/09/19 11:58:20 1.1230 +++ /project/slime/cvsroot/slime/ChangeLog 2007/09/20 14:59:08 1.1231 @@ -1,3 +1,10 @@ +2007-09-20 Helmut Eller + + * slime.el (slime-setup): Call the respective init functions of + contribs. + + * slime-autoloads.el (slime-setup-contribs): Ditto. + 2007-09-19 Helmut Eller Simplify slime-compile-file. --- /project/slime/cvsroot/slime/slime-autoloads.el 2007/09/15 15:15:26 1.2 +++ /project/slime/cvsroot/slime/slime-autoloads.el 2007/09/20 14:59:08 1.3 @@ -33,13 +33,17 @@ CONTRIBS is a list of contrib packages to load." (when (member 'lisp-mode slime-lisp-modes) (add-hook 'lisp-mode-hook 'slime-lisp-mode-hook)) - (when (member 'scheme-mode slime-lisp-modes) - (add-hook 'scheme-mode-hook 'slime-scheme-mode-hook)) (setq slime-setup-contribs contribs) (add-hook 'slime-load-hook 'slime-setup-contribs)) (defvar slime-setup-contribs nil) -(defun slime-setup-contribs () (mapc #'require slime-setup-contribs)) + +(defun slime-setup-contribs () + (dolist (c slime-setup-contribs) + (require c) + (let ((init (intern (format "%s-init" c)))) + (when (fboundp init) + (funcall init))))) (provide 'slime-autoloads) --- /project/slime/cvsroot/slime/slime.el 2007/09/19 11:58:20 1.872 +++ /project/slime/cvsroot/slime/slime.el 2007/09/20 14:59:08 1.873 @@ -71,7 +71,11 @@ CONTRIBS is a list of contrib packages to load." (when (member 'lisp-mode slime-lisp-modes) (add-hook 'lisp-mode-hook 'slime-lisp-mode-hook)) - (mapc #'require contribs)) + (dolist (c contribs) + (require c) + (let ((init (intern (format "%s-init" c)))) + (when (fboundp init) + (funcall init))))) (defun slime-lisp-mode-hook () (slime-mode 1) @@ -9510,9 +9514,8 @@ slime-insert-propertized slime-tree-insert))) -(run-hooks 'slime-load-hook) - (provide 'slime) +(run-hooks 'slime-load-hook) ;; Local Variables: ;; outline-regexp: ";;;;+" From trittweiler at common-lisp.net Thu Sep 20 23:45:10 2007 From: trittweiler at common-lisp.net (trittweiler) Date: Thu, 20 Sep 2007 19:45:10 -0400 (EDT) Subject: [slime-cvs] CVS slime Message-ID: <20070920234510.CD20037104@common-lisp.net> Update of /project/slime/cvsroot/slime In directory clnet:/tmp/cvs-serv1474 Modified Files: slime.el Log Message: * slime.el (slime-length=, slime-length>): Restore support for vectors, as `slime-length=' was already used with strings in `slime-parse.el'. This broke extended arglist display. --- /project/slime/cvsroot/slime/slime.el 2007/09/20 14:59:08 1.873 +++ /project/slime/cvsroot/slime/slime.el 2007/09/20 23:45:10 1.874 @@ -9007,14 +9007,23 @@ ;;;;; Misc. -(defun slime-length= (list n) - "Return t if (= (length LIST) N)." - (setq list (nthcdr (1- n) list)) - (and list (null (cdr list)))) +(defun slime-length= (seq n) + "Test for whether SEQ contains N number of elements. I.e. it's equivalent + to (= (LENGTH SEQ) N), but besides being more concise, it may also be more + efficiently implemented." + (etypecase seq + (list + (let ((list seq)) + (setq list (nthcdr (1- n) list)) + (and list (null (cdr list))))) + (sequence + (= (length seq) n)))) -(defun slime-length> (list n) +(defun slime-length> (seq n) "Return non-nil if (> (length LIST) N)." - (nthcdr n list)) + (etypecase seq + (list (nthcdr n seq)) + (seq (> (length seq) n)))) (defun slime-split-string (string &optional separators omit-nulls) "This is like `split-string' in Emacs22, but also works in From trittweiler at common-lisp.net Thu Sep 20 23:45:41 2007 From: trittweiler at common-lisp.net (trittweiler) Date: Thu, 20 Sep 2007 19:45:41 -0400 (EDT) Subject: [slime-cvs] CVS slime Message-ID: <20070920234541.7CB7849099@common-lisp.net> Update of /project/slime/cvsroot/slime In directory clnet:/tmp/cvs-serv1637 Modified Files: ChangeLog Log Message: * slime.el (slime-length=, slime-length>): Restore support for vectors, as `slime-length=' was already used with strings in `slime-parse.el'. This broke extended arglist display. --- /project/slime/cvsroot/slime/ChangeLog 2007/09/20 14:59:08 1.1231 +++ /project/slime/cvsroot/slime/ChangeLog 2007/09/20 23:45:41 1.1232 @@ -1,3 +1,9 @@ +2007-09-21 Tobias C. Rittweiler + + * slime.el (slime-length=, slime-length>): Restore support for + vectors, as `slime-length=' was already used with strings in + `slime-parse.el'. This broke extended arglist display. + 2007-09-20 Helmut Eller * slime.el (slime-setup): Call the respective init functions of From heller at common-lisp.net Fri Sep 21 12:44:13 2007 From: heller at common-lisp.net (heller) Date: Fri, 21 Sep 2007 08:44:13 -0400 (EDT) Subject: [slime-cvs] CVS slime/contrib Message-ID: <20070921124413.A6EAC5832F@common-lisp.net> Update of /project/slime/cvsroot/slime/contrib In directory clnet:/tmp/cvs-serv13906 Modified Files: ChangeLog slime-asdf.el Log Message: Fix spelling of init/unload function names in slime-asdf. * slime-asdf.el (slime-asdf-init, slime-asdf-unload): Fix typos. Reported by Ariel Badichi. --- /project/slime/cvsroot/slime/contrib/ChangeLog 2007/09/20 14:55:53 1.55 +++ /project/slime/cvsroot/slime/contrib/ChangeLog 2007/09/21 12:44:13 1.56 @@ -1,3 +1,8 @@ +2007-09-21 Helmut Eller + + * slime-asdf.el (slime-asdf-init, slime-asdf-unload): Fix typos. + Reported + 2007-09-20 Helmut Eller Separate loading from initialization for many contribs. --- /project/slime/cvsroot/slime/contrib/slime-asdf.el 2007/09/20 14:55:53 1.2 +++ /project/slime/cvsroot/slime/contrib/slime-asdf.el 2007/09/21 12:44:13 1.3 @@ -104,10 +104,10 @@ (defun slime-asdf-on-connect () (slime-eval-async '(swank:swank-require :swank-asdf))) -(defun slime-adsf-init () +(defun slime-asdf-init () (add-hook 'slime-connected-hook 'slime-asdf-on-connect)) -(defun slime-adsf-unload () +(defun slime-asdf-unload () (remove-hook 'slime-connected-hook 'slime-asdf-on-connect)) (provide 'slime-asdf) From heller at common-lisp.net Fri Sep 21 12:44:37 2007 From: heller at common-lisp.net (heller) Date: Fri, 21 Sep 2007 08:44:37 -0400 (EDT) Subject: [slime-cvs] CVS slime/contrib Message-ID: <20070921124437.9F6505909A@common-lisp.net> Update of /project/slime/cvsroot/slime/contrib In directory clnet:/tmp/cvs-serv14629 Modified Files: ChangeLog Log Message: *** empty log message *** --- /project/slime/cvsroot/slime/contrib/ChangeLog 2007/09/21 12:44:13 1.56 +++ /project/slime/cvsroot/slime/contrib/ChangeLog 2007/09/21 12:44:37 1.57 @@ -1,7 +1,7 @@ 2007-09-21 Helmut Eller * slime-asdf.el (slime-asdf-init, slime-asdf-unload): Fix typos. - Reported + Reported by Ariel Badichi. 2007-09-20 Helmut Eller From mkoeppe at common-lisp.net Wed Sep 26 23:15:41 2007 From: mkoeppe at common-lisp.net (mkoeppe) Date: Wed, 26 Sep 2007 19:15:41 -0400 (EDT) Subject: [slime-cvs] CVS slime Message-ID: <20070926231541.9D0BF1B000@common-lisp.net> Update of /project/slime/cvsroot/slime In directory clnet:/tmp/cvs-serv21826 Modified Files: swank-allegro.lisp Log Message: swank-allegro.lisp (fspec-definition-locations): Allow the POSITION datum of :top-level-form fspecs to be missing. This apparently helpful for Allegro CL 8.1. Patch from Utz-Uwe Haus --- /project/slime/cvsroot/slime/swank-allegro.lisp 2007/09/10 15:39:05 1.97 +++ /project/slime/cvsroot/slime/swank-allegro.lisp 2007/09/26 23:15:41 1.98 @@ -402,7 +402,7 @@ (cond ((and (listp fspec) (eql (car fspec) :top-level-form)) - (destructuring-bind (top-level-form file position) fspec + (destructuring-bind (top-level-form file &optional position) fspec (list (list (list nil fspec) (make-location (list :buffer file) From mkoeppe at common-lisp.net Wed Sep 26 23:15:53 2007 From: mkoeppe at common-lisp.net (mkoeppe) Date: Wed, 26 Sep 2007 19:15:53 -0400 (EDT) Subject: [slime-cvs] CVS slime Message-ID: <20070926231553.2AF082E1D8@common-lisp.net> Update of /project/slime/cvsroot/slime In directory clnet:/tmp/cvs-serv21869 Modified Files: ChangeLog Log Message: *** empty log message *** --- /project/slime/cvsroot/slime/ChangeLog 2007/09/20 23:45:41 1.1232 +++ /project/slime/cvsroot/slime/ChangeLog 2007/09/26 23:15:52 1.1233 @@ -1,3 +1,9 @@ +2007-09-26 Utz-Uwe Haus + + * swank-allegro.lisp (fspec-definition-locations): Allow the + POSITION datum of :top-level-form fspecs to be missing. This + apparently helpful for Allegro CL 8.1. + 2007-09-21 Tobias C. Rittweiler * slime.el (slime-length=, slime-length>): Restore support for From trittweiler at common-lisp.net Thu Sep 27 12:56:13 2007 From: trittweiler at common-lisp.net (trittweiler) Date: Thu, 27 Sep 2007 08:56:13 -0400 (EDT) Subject: [slime-cvs] CVS slime Message-ID: <20070927125613.8DBF3620D6@common-lisp.net> Update of /project/slime/cvsroot/slime In directory clnet:/tmp/cvs-serv21992 Modified Files: ChangeLog Log Message: * slime.el (slime-filesystem-toplevel-directory): New function. Windows doesn't have a filesystem that is as hierarchical as the Unix' one. Reported by Carsten Blaauw and Stefan Kluehspies. (slime-file-name-merge-source-root): Use it. (slime-highlight-differences-in-dirname): Use it. --- /project/slime/cvsroot/slime/ChangeLog 2007/09/26 23:15:52 1.1233 +++ /project/slime/cvsroot/slime/ChangeLog 2007/09/27 12:56:13 1.1234 @@ -1,3 +1,11 @@ +2007-09-27 Tobias C. Rittweiler + + * slime.el (slime-filesystem-toplevel-directory): New function. + Windows doesn't have a filesystem that is as hierarchical as the + Unix' one. Reported by Carsten Blaauw and Stefan Kluehspies. + (slime-file-name-merge-source-root): Use it. + (slime-highlight-differences-in-dirname): Use it. + 2007-09-26 Utz-Uwe Haus * swank-allegro.lisp (fspec-definition-locations): Allow the From trittweiler at common-lisp.net Thu Sep 27 12:56:42 2007 From: trittweiler at common-lisp.net (trittweiler) Date: Thu, 27 Sep 2007 08:56:42 -0400 (EDT) Subject: [slime-cvs] CVS slime Message-ID: <20070927125642.1D3406824A@common-lisp.net> Update of /project/slime/cvsroot/slime In directory clnet:/tmp/cvs-serv22043 Modified Files: slime.el Log Message: * slime.el (slime-filesystem-toplevel-directory): New function. Windows doesn't have a filesystem that is as hierarchical as the Unix' one. Reported by Carsten Blaauw and Stefan Kluehspies. (slime-file-name-merge-source-root): Use it. (slime-highlight-differences-in-dirname): Use it. --- /project/slime/cvsroot/slime/slime.el 2007/09/20 23:45:10 1.874 +++ /project/slime/cvsroot/slime/slime.el 2007/09/27 12:56:40 1.875 @@ -4415,6 +4415,13 @@ (beginning-of-sexp)) (error (goto-char origin))))) +(defun slime-filesystem-toplevel-directory () + ;; Windows doesn't have a true toplevel root directory, and all + ;; filenames look like "c:/foo/bar/quux.baz" from an Emacs + ;; perspective anyway. + (if (memq system-type '(ms-dos windows-nt)) + "" + (file-name-as-directory "/"))) (defun slime-file-name-merge-source-root (target-filename buffer-filename) "Returns a filename where the source root directory of TARGET-FILENAME @@ -4444,7 +4451,7 @@ (push target-dir target-suffix-dirs) (let* ((target-suffix (concat-dirs target-suffix-dirs)) ; PUSH reversed for us! (buffer-root (concat-dirs (reverse (nthcdr pos buffer-dirs*))))) - (return (concat (file-name-as-directory "/") + (return (concat (slime-filesystem-toplevel-directory) buffer-root target-suffix (file-name-nondirectory target-filename)))))))))) @@ -4463,7 +4470,7 @@ (let ((base-dirs (slime-split-string base-dirname "/" t)) (contrast-dirs (slime-split-string contrast-dirname "/" t))) (with-temp-buffer - (loop initially (insert (file-name-as-directory "/")) + (loop initially (insert (slime-filesystem-toplevel-directory)) for base-dir in base-dirs do (let ((pos (position base-dir contrast-dirs :test #'equal))) (if (not pos) From trittweiler at common-lisp.net Fri Sep 28 13:05:35 2007 From: trittweiler at common-lisp.net (trittweiler) Date: Fri, 28 Sep 2007 09:05:35 -0400 (EDT) Subject: [slime-cvs] CVS slime/contrib Message-ID: <20070928130535.04BF056008@common-lisp.net> Update of /project/slime/cvsroot/slime/contrib In directory clnet:/tmp/cvs-serv3004 Modified Files: slime-fancy.el Log Message: * README: Updated. * slime-fancy.el: `slime-highlighting-edits' is not enabled by default anymore, as its functionality is controversial, and it's easier to explicitly enable it than it's disable it once it got globally activated. Better to be conservative. * slime-fancy.el: Not only load, but also enable `slime-scratch'. --- /project/slime/cvsroot/slime/contrib/slime-fancy.el 2007/09/20 14:55:53 1.3 +++ /project/slime/cvsroot/slime/contrib/slime-fancy.el 2007/09/28 13:05:35 1.4 @@ -40,8 +40,11 @@ (require 'slime-fuzzy) (slime-fuzzy-init) +;; Do not activate slime-highlighting-edits by default, as it's easier +;; to explictly activate it (if a user really wants it) than to explictly +;; deactivate it once it got globally enabled. -TCR. (require 'slime-highlight-edits) -(slime-highlight-edits-init) +;(slime-highlight-edits-init) ;; Load slime-presentations even though they seem to be a ;; controversial feature, as they can be easily turned off by @@ -54,6 +57,7 @@ ;;(require 'slime-presentation-streams) (require 'slime-scratch) +(slime-scratch-init) ;;; Do not load slime-typeout-frame, as simply loading causes display of a ;;; typeout frame, which cannot be turned off. --mkoeppe From trittweiler at common-lisp.net Fri Sep 28 13:05:44 2007 From: trittweiler at common-lisp.net (trittweiler) Date: Fri, 28 Sep 2007 09:05:44 -0400 (EDT) Subject: [slime-cvs] CVS slime/contrib Message-ID: <20070928130544.11753620C3@common-lisp.net> Update of /project/slime/cvsroot/slime/contrib In directory clnet:/tmp/cvs-serv3058 Modified Files: README Log Message: * README: Updated. * slime-fancy.el: `slime-highlighting-edits' is not enabled by default anymore, as its functionality is controversial, and it's easier to explicitly enable it than it's disable it once it got globally activated. Better to be conservative. * slime-fancy.el: Not only load, but also enable `slime-scratch'. --- /project/slime/cvsroot/slime/contrib/README 2007/08/23 12:58:52 1.2 +++ /project/slime/cvsroot/slime/contrib/README 2007/09/28 13:05:44 1.3 @@ -8,8 +8,23 @@ used without them. The code is maintained by the respective authors. To use the packages here, you should add this directory to your Emacs -load-path. E.g. for fuzzy completion add this to your .emacs: +load-path, require the contrib, and call the contrib's init function to +enable the functionality that's provided by the respective contrib. + +E.g. for fuzzy completion add this to your .emacs: (add-to-list 'load-path "") - (add-hook 'slime-load-hook (lambda () (require 'slime-fuzzy))) + (add-hook 'slime-load-hook (lambda () (require 'slime-fuzzy) + (slime-fuzzy-init))) + +Alternatively, you can use the `slime-setup' function which takes a +list of contrib names, and which loads and enables them automatically +for you: + + (slime-setup '(slime-fancy slime-asdf slime-tramp ...)) + +Finally, the contrib `slime-fancy' is specially noteworthy, as it +represents a meta-contrib that'll load a bunch of commonly used +contribs. Look into `slime-fancy.el' to find out which. + \ No newline at end of file From trittweiler at common-lisp.net Fri Sep 28 13:05:51 2007 From: trittweiler at common-lisp.net (trittweiler) Date: Fri, 28 Sep 2007 09:05:51 -0400 (EDT) Subject: [slime-cvs] CVS slime/contrib Message-ID: <20070928130551.68D78A15E@common-lisp.net> Update of /project/slime/cvsroot/slime/contrib In directory clnet:/tmp/cvs-serv3092 Modified Files: ChangeLog Log Message: * README: Updated. * slime-fancy.el: `slime-highlighting-edits' is not enabled by default anymore, as its functionality is controversial, and it's easier to explicitly enable it than it's disable it once it got globally activated. Better to be conservative. * slime-fancy.el: Not only load, but also enable `slime-scratch'. --- /project/slime/cvsroot/slime/contrib/ChangeLog 2007/09/21 12:44:37 1.57 +++ /project/slime/cvsroot/slime/contrib/ChangeLog 2007/09/28 13:05:51 1.58 @@ -1,3 +1,14 @@ +2007-09-28 Tobias C. Rittweiler + + * README: Updated. + + * slime-fancy.el: `slime-highlighting-edits' is not enabled by + default anymore, as its functionality is controversial, and it's + easier to explicitly enable it than it's disable it once it got + globally activated. Better to be conservative. + + * slime-fancy.el: Not only load, but also enable `slime-scratch'. + 2007-09-21 Helmut Eller * slime-asdf.el (slime-asdf-init, slime-asdf-unload): Fix typos. From trittweiler at common-lisp.net Fri Sep 28 13:06:30 2007 From: trittweiler at common-lisp.net (trittweiler) Date: Fri, 28 Sep 2007 09:06:30 -0400 (EDT) Subject: [slime-cvs] CVS slime/contrib Message-ID: <20070928130630.CC59F3616B@common-lisp.net> Update of /project/slime/cvsroot/slime/contrib In directory clnet:/tmp/cvs-serv3182 Modified Files: ChangeLog Log Message: fix typo in last ChangeLog entry. --- /project/slime/cvsroot/slime/contrib/ChangeLog 2007/09/28 13:05:51 1.58 +++ /project/slime/cvsroot/slime/contrib/ChangeLog 2007/09/28 13:06:30 1.59 @@ -4,7 +4,7 @@ * slime-fancy.el: `slime-highlighting-edits' is not enabled by default anymore, as its functionality is controversial, and it's - easier to explicitly enable it than it's disable it once it got + easier to explicitly enable it than to disable it once it got globally activated. Better to be conservative. * slime-fancy.el: Not only load, but also enable `slime-scratch'. From trittweiler at common-lisp.net Sun Sep 30 22:41:44 2007 From: trittweiler at common-lisp.net (trittweiler) Date: Sun, 30 Sep 2007 18:41:44 -0400 (EDT) Subject: [slime-cvs] CVS slime/contrib Message-ID: <20070930224144.6D56A25002@common-lisp.net> Update of /project/slime/cvsroot/slime/contrib In directory clnet:/tmp/cvs-serv30963/contrib Modified Files: slime-typeout-frame.el Log Message: * slime-typeout-frame.el (slime-typeout-frame-init): Fix quoted FUNCTION forms in literal. --- /project/slime/cvsroot/slime/contrib/slime-typeout-frame.el 2007/09/20 14:55:53 1.3 +++ /project/slime/cvsroot/slime/contrib/slime-typeout-frame.el 2007/09/30 22:41:44 1.4 @@ -61,9 +61,9 @@ (defun slime-typeout-frame-init () (add-hook 'slime-connected-hook 'slime-ensure-typeout-frame) (loop for (var value) in - '((slime-message-function #'slime-typeout-message) - (slime-background-message-function #'slime-typeout-message) - (slime-autodoc-message-function #'slime-typeout-autodoc-message)) + '((slime-message-function slime-typeout-message) + (slime-background-message-function slime-typeout-message) + (slime-autodoc-message-function slime-typeout-autodoc-message)) do (slime-typeout-frame-init-var var value))) (defun slime-typeout-frame-init-var (var value) From trittweiler at common-lisp.net Sun Sep 30 22:41:56 2007 From: trittweiler at common-lisp.net (trittweiler) Date: Sun, 30 Sep 2007 18:41:56 -0400 (EDT) Subject: [slime-cvs] CVS slime/contrib Message-ID: <20070930224156.699C93C015@common-lisp.net> Update of /project/slime/cvsroot/slime/contrib In directory clnet:/tmp/cvs-serv31002/contrib Modified Files: ChangeLog Log Message: * slime-typeout-frame.el (slime-typeout-frame-init): Fix quoted FUNCTION forms in literal. --- /project/slime/cvsroot/slime/contrib/ChangeLog 2007/09/28 13:06:30 1.59 +++ /project/slime/cvsroot/slime/contrib/ChangeLog 2007/09/30 22:41:56 1.60 @@ -1,3 +1,8 @@ +2007-09-30 Geoff Wozniak + + * slime-typeout-frame.el (slime-typeout-frame-init): Fix quoted + FUNCTION forms in literal. + 2007-09-28 Tobias C. Rittweiler * README: Updated.