From trittweiler at common-lisp.net Sun Jan 3 10:05:05 2010 From: trittweiler at common-lisp.net (CVS User trittweiler) Date: Sun, 03 Jan 2010 05:05:05 -0500 Subject: [slime-cvs] CVS slime Message-ID: Update of /project/slime/cvsroot/slime In directory cl-net:/tmp/cvs-serv9369 Modified Files: ChangeLog slime.el swank-sbcl.lisp Log Message: * slime.el (compile-defun [test]): Also test proper notification after reader-error. Additionally: bind font-lock-verbose to nil to prevent annoying font-lock messages during the test. * swank-sbcl.lisp (signal-compiler-condition): Make sure READER-ERROR comes before ERROR in typecase. (swank-compile-file): Remove handling FATAL-COMPILER-HANDLER because a) this handling prevents sbcl from printing the diagnostics to the repl, and b) sbcl itself should handle this and translate it into proper return value for compile-file. --- /project/slime/cvsroot/slime/ChangeLog 2009/12/23 08:52:01 1.1948 +++ /project/slime/cvsroot/slime/ChangeLog 2010/01/03 10:05:04 1.1949 @@ -1,3 +1,16 @@ +2010-01-03 Tobias C. Rittweiler + + * slime.el (compile-defun [test]): Also test proper notification + after reader-error. Additionally: bind font-lock-verbose to nil to + prevent annoying font-lock messages during the test. + + * swank-sbcl.lisp (signal-compiler-condition): Make sure + READER-ERROR comes before ERROR in typecase. + (swank-compile-file): Remove handling FATAL-COMPILER-HANDLER + because a) this handling prevents sbcl from printing the + diagnostics to the repl, and b) sbcl itself should handle this and + translate it into proper return value for compile-file. + 2009-12-23 Tobias C. Rittweiler * slime.el (complete-symbol [test]): Fix test case. --- /project/slime/cvsroot/slime/slime.el 2009/12/23 08:52:01 1.1259 +++ /project/slime/cvsroot/slime/slime.el 2010/01/03 10:05:04 1.1260 @@ -7704,20 +7704,24 @@ (cl-user::bar)) ("(defun foo () #+#.'(:and) (/ 1 0))" - (/ 1 0))) + (/ 1 0)) + ("(defun foo () pkg-does-not-exist:symbol)" + pkg-does-not-exist:symbol) + ("(defun foo () swank:symbol-does-not-exist)" + swank:symbol-does-not-exist)) (slime-check-top-level) - (with-temp-buffer + (with-temp-buffer (lisp-mode) (insert program) - (setq slime-buffer-package ":swank") - (slime-compile-string (buffer-string) 1) - (setq slime-buffer-package ":cl-user") - (slime-sync-to-top-level 5) - (goto-char (point-max)) - (slime-previous-note) - (slime-check error-location-correct - (equal (read (current-buffer)) - subform))) + (let ((font-lock-verbose nil)) + (setq slime-buffer-package ":swank") + (slime-compile-string (buffer-string) 1) + (setq slime-buffer-package ":cl-user") + (slime-sync-to-top-level 5) + (goto-char (point-max)) + (slime-previous-note) + (slime-check error-location-correct + (equal (read (current-buffer)) subform)))) (slime-check-top-level)) (def-slime-test (compile-file (:fails-for "allegro" "lispworks" "clisp")) --- /project/slime/cvsroot/slime/swank-sbcl.lisp 2009/12/19 14:56:06 1.263 +++ /project/slime/cvsroot/slime/swank-sbcl.lisp 2010/01/03 10:05:05 1.264 @@ -430,10 +430,10 @@ 'compiler-condition :original-condition condition :severity (etypecase condition - (sb-c:compiler-error :error) (sb-ext:compiler-note :note) - (error :error) + (sb-c:compiler-error :error) (reader-error :read-error) + (error :error) #+#.(swank-backend:with-symbol redefinition-warning sb-kernel) (sb-kernel:redefinition-warning :redefinition) @@ -556,20 +556,17 @@ (defimplementation swank-compile-file (input-file output-file load-p external-format) - (handler-case - (multiple-value-bind (output-file warnings-p failure-p) - (with-compilation-hooks () - (compile-file input-file :output-file output-file - :external-format external-format)) - (values output-file warnings-p - (or failure-p - (when load-p - ;; Cache the latest source file for definition-finding. - (source-cache-get input-file - (file-write-date input-file)) - (not (load output-file)))))) - ;; N.B. This comes through despite of WITH-COMPILATION-HOOKS. - (sb-c:fatal-compiler-error () (values nil nil t)))) + (multiple-value-bind (output-file warnings-p failure-p) + (with-compilation-hooks () + (compile-file input-file :output-file output-file + :external-format external-format)) + (values output-file warnings-p + (or failure-p + (when load-p + ;; Cache the latest source file for definition-finding. + (source-cache-get input-file + (file-write-date input-file)) + (not (load output-file))))))) ;;;; compile-string From sboukarev at common-lisp.net Sun Jan 3 14:18:26 2010 From: sboukarev at common-lisp.net (CVS User sboukarev) Date: Sun, 03 Jan 2010 09:18:26 -0500 Subject: [slime-cvs] CVS slime/contrib Message-ID: Update of /project/slime/cvsroot/slime/contrib In directory cl-net:/tmp/cvs-serv14867/contrib Modified Files: ChangeLog swank-asdf.lisp Log Message: swank-asdf.lisp(asdf-system-loaded-p): Don't return a generalized boolean, because numbers may be too large for Emacs. --- /project/slime/cvsroot/slime/contrib/ChangeLog 2009/12/30 10:30:13 1.325 +++ /project/slime/cvsroot/slime/contrib/ChangeLog 2010/01/03 14:18:26 1.326 @@ -1,3 +1,8 @@ +2010-01-03 Stas Boukarev + + * swank-asdf.lisp (asdf-system-loaded-p): Don't return a + generalized boolean, because numbers may be too large for Emacs. + 2009-12-30 Tobias C. Rittweiler * slime-c-p-c.el (complete-form [test]): Set --- /project/slime/cvsroot/slime/contrib/swank-asdf.lisp 2009/12/19 14:56:07 1.25 +++ /project/slime/cvsroot/slime/contrib/swank-asdf.lisp 2010/01/03 14:18:26 1.26 @@ -134,8 +134,9 @@ files))) (defslimefun asdf-system-loaded-p (name) - (gethash 'asdf:load-op - (asdf::component-operation-times (asdf:find-system name)))) + (and (gethash 'asdf:load-op + (asdf::component-operation-times (asdf:find-system name))) + t)) (defslimefun asdf-system-directory (name) (cl:directory-namestring From trittweiler at common-lisp.net Sun Jan 3 14:22:23 2010 From: trittweiler at common-lisp.net (CVS User trittweiler) Date: Sun, 03 Jan 2010 09:22:23 -0500 Subject: [slime-cvs] CVS slime Message-ID: Update of /project/slime/cvsroot/slime In directory cl-net:/tmp/cvs-serv17487 Modified Files: ChangeLog slime.el Log Message: * slime.el (slime-next-read-or-lose): Call `debug' with the error condition, so we can see what actually caused the losage. --- /project/slime/cvsroot/slime/ChangeLog 2010/01/03 10:05:04 1.1949 +++ /project/slime/cvsroot/slime/ChangeLog 2010/01/03 14:22:22 1.1950 @@ -1,5 +1,10 @@ 2010-01-03 Tobias C. Rittweiler + * slime.el (slime-next-read-or-lose): Call `debug' with the error + condition, so we can see what actually caused the losage. + +2010-01-03 Tobias C. Rittweiler + * slime.el (compile-defun [test]): Also test proper notification after reader-error. Additionally: bind font-lock-verbose to nil to prevent annoying font-lock messages during the test. --- /project/slime/cvsroot/slime/slime.el 2010/01/03 10:05:04 1.1260 +++ /project/slime/cvsroot/slime/slime.el 2010/01/03 14:22:22 1.1261 @@ -1660,7 +1660,7 @@ (condition-case error (slime-net-read) (error - (debug) + (debug 'error error) (slime-net-close process t) (error "net-read error: %S" error)))) From trittweiler at common-lisp.net Sun Jan 3 14:25:13 2010 From: trittweiler at common-lisp.net (CVS User trittweiler) Date: Sun, 03 Jan 2010 09:25:13 -0500 Subject: [slime-cvs] CVS slime/contrib Message-ID: Update of /project/slime/cvsroot/slime/contrib In directory cl-net:/tmp/cvs-serv17722/contrib Modified Files: ChangeLog Removed Files: slime-indentation-fu.el swank-indentation-fu.lisp Log Message: * slime-indentation-fu.el, swank-indentation-fu.lisp: Delete contrib. Never worked quite right, and the necessary infrastructure has since been gone. --- /project/slime/cvsroot/slime/contrib/ChangeLog 2010/01/03 14:18:26 1.326 +++ /project/slime/cvsroot/slime/contrib/ChangeLog 2010/01/03 14:25:12 1.327 @@ -1,3 +1,9 @@ +2010-01-03 Tobias C. Rittweiler + + * slime-indentation-fu.el, swank-indentation-fu.lisp: Delete + contrib. Never worked quite right, and the necessary + infrastructure has since been gone. + 2010-01-03 Stas Boukarev * swank-asdf.lisp (asdf-system-loaded-p): Don't return a From trittweiler at common-lisp.net Sun Jan 3 15:34:54 2010 From: trittweiler at common-lisp.net (CVS User trittweiler) Date: Sun, 03 Jan 2010 10:34:54 -0500 Subject: [slime-cvs] CVS slime/contrib Message-ID: Update of /project/slime/cvsroot/slime/contrib In directory cl-net:/tmp/cvs-serv4015/contrib Modified Files: ChangeLog slime-autodoc.el swank-arglists.lisp Log Message: * swank-arglists.lisp (arglist-index): Return NIL if more arguments were provided than are allowed. (form-path-to-arglist-path): Adapted accordingly. * slime-autodoc.el (autodoc.1 [test]): Add relevant test cases. --- /project/slime/cvsroot/slime/contrib/ChangeLog 2010/01/03 14:25:12 1.327 +++ /project/slime/cvsroot/slime/contrib/ChangeLog 2010/01/03 15:34:54 1.328 @@ -1,5 +1,13 @@ 2010-01-03 Tobias C. Rittweiler + * swank-arglists.lisp (arglist-index): Return NIL if more + arguments were provided than are allowed. + (form-path-to-arglist-path): Adapted accordingly. + + * slime-autodoc.el (autodoc.1 [test]): Add relevant test cases. + +2010-01-03 Tobias C. Rittweiler + * slime-indentation-fu.el, swank-indentation-fu.lisp: Delete contrib. Never worked quite right, and the necessary infrastructure has since been gone. --- /project/slime/cvsroot/slime/contrib/slime-autodoc.el 2009/12/29 19:41:05 1.28 +++ /project/slime/cvsroot/slime/contrib/slime-autodoc.el 2010/01/03 15:34:54 1.29 @@ -246,9 +246,11 @@ (buffer-sexpr wished-arglist &optional skip-trailing-test-p) "" '(("(swank::emacs-connected*HERE*" "(emacs-connected)") + ("(swank::emacs-connected *HERE*" "(emacs-connected)") ("(swank::create-socket*HERE*" "(create-socket host port)") ("(swank::create-socket *HERE*" "(create-socket ===> host <=== port)") ("(swank::create-socket foo *HERE*" "(create-socket host ===> port <===)") + ("(swank::create-socket foo bar *HERE*" "(create-socket host port)") ("#'(lambda () (swank::create-socket*HERE*" "(create-socket host port)") ("`(lambda () ,(swank::create-socket*HERE*" "(create-socket host port)") --- /project/slime/cvsroot/slime/contrib/swank-arglists.lisp 2009/12/30 10:25:04 1.53 +++ /project/slime/cvsroot/slime/contrib/swank-arglists.lisp 2010/01/03 15:34:54 1.54 @@ -1348,15 +1348,21 @@ nil (let* ((idx (car path)) (idx* (arglist-index idx args arglist)) - (arglist* (arglist-ref arglist idx*)) - (args* (provided-arguments-ref args arglist idx*))) + (arglist* (and idx* (arglist-ref arglist idx*))) + (args* (and idx* (provided-arguments-ref args + arglist + idx*)))) ;; The FORM-PATH may be more detailed than ARGLIST; ;; consider (defun foo (x y) ...), a form path may ;; point into the function's lambda-list, but the ;; arglist of DEFUN won't contain as much information. - (if (arglist-p arglist*) - (cons idx* (convert (cdr path) args* arglist*)) - (list idx*)))))) + ;; So we only recurse if possible. + (cond ((null idx*) + nil) + ((arglist-p arglist*) + (cons idx* (convert (cdr path) args* arglist*))) + (t + (list idx*))))))) (convert ;; FORM contains irrelevant operator. Adjust FORM-PATH. (cond ((null form-path) nil) @@ -1372,19 +1378,22 @@ to the argument (NTH `provided-argument-index' `provided-arguments')." (let ((positional-args# (positional-args-number arglist)) (arg-index provided-argument-index)) - (cond - ((< arg-index positional-args#) ; required + optional - arg-index) - ((not (arglist.key-p arglist)) ; rest + body - (assert (arglist.rest arglist)) - positional-args#) - (t ; key - ;; Find last provided &key parameter - (let* ((argument (nth arg-index provided-arguments)) - (provided-keys (subseq provided-arguments positional-args#))) - (loop for (key value) on provided-keys by #'cddr - when (eq value argument) - return key)))))) + (with-struct (arglist. key-p rest) arglist + (cond + ((< arg-index positional-args#) ; required + optional + arg-index) + ((and (not key-p) (not rest)) ; more provided than allowed + nil) + ((not key-p) ; rest + body + (assert (arglist.rest arglist)) + positional-args#) + (t ; key + ;; Find last provided &key parameter + (let* ((argument (nth arg-index provided-arguments)) + (provided-keys (subseq provided-arguments positional-args#))) + (loop for (key value) on provided-keys by #'cddr + when (eq value argument) + return key))))))) (defun arglist-ref (arglist &rest indices) "Returns the parameter in ARGLIST along the INDICIES path. Numbers From trittweiler at common-lisp.net Sun Jan 3 15:46:44 2010 From: trittweiler at common-lisp.net (CVS User trittweiler) Date: Sun, 03 Jan 2010 10:46:44 -0500 Subject: [slime-cvs] CVS slime Message-ID: Update of /project/slime/cvsroot/slime In directory cl-net:/tmp/cvs-serv7891 Modified Files: ChangeLog swank.lisp Log Message: * swank.lisp (with-swank-protocol-error-handler): Remove debugging bits. --- /project/slime/cvsroot/slime/ChangeLog 2010/01/03 14:22:22 1.1950 +++ /project/slime/cvsroot/slime/ChangeLog 2010/01/03 15:46:44 1.1951 @@ -1,5 +1,10 @@ 2010-01-03 Tobias C. Rittweiler + * swank.lisp (with-swank-protocol-error-handler): Remove debugging + bits. + +2010-01-03 Tobias C. Rittweiler + * slime.el (slime-next-read-or-lose): Call `debug' with the error condition, so we can see what actually caused the losage. --- /project/slime/cvsroot/slime/swank.lisp 2009/12/22 09:31:15 1.681 +++ /project/slime/cvsroot/slime/swank.lisp 2010/01/03 15:46:44 1.682 @@ -359,11 +359,7 @@ (handler-case (handler-bind ((swank-protocol-error (lambda (condition) - (format t "~&+++ SWANK-PROTOCOL-ERROR: ~S ~S~%" - *debug-on-swank-protocol-error* - condition) (when *debug-on-swank-protocol-error* - (format t "~&+++ INVOKE-DEFAULT-DEBUGGER +++ ~S~%" condition) (invoke-default-debugger condition))))) (progn , at body)) (swank-protocol-error (condition) From sboukarev at common-lisp.net Sun Jan 3 15:58:29 2010 From: sboukarev at common-lisp.net (CVS User sboukarev) Date: Sun, 03 Jan 2010 10:58:29 -0500 Subject: [slime-cvs] CVS slime Message-ID: Update of /project/slime/cvsroot/slime In directory cl-net:/tmp/cvs-serv9550 Modified Files: ChangeLog swank-backend.lisp swank-ccl.lisp swank-sbcl.lisp Log Message: * contrib/slime-repl.el (sldb-insert-frame-call-to-repl): New function for inserting a call to a frame into the REPL. Bound to C-y in SLDB. * swank-backend.lisp (frame-call): New function. Returns a string representing a call to the entry point of a frame. * swank-ccl.lisp (frame-call): Implementation of the above. * swank-sbcl.lisp (frame-call): Ditto. --- /project/slime/cvsroot/slime/ChangeLog 2010/01/03 15:46:44 1.1951 +++ /project/slime/cvsroot/slime/ChangeLog 2010/01/03 15:58:29 1.1952 @@ -1,3 +1,10 @@ +2010-01-03 Stas Boukarev + + * swank-backend.lisp (frame-call): New function. + Returns a string representing a call to the entry point of a frame. + * swank-ccl.lisp (frame-call): Implementation of the above. + * swank-sbcl.lisp (frame-call): Ditto. + 2010-01-03 Tobias C. Rittweiler * swank.lisp (with-swank-protocol-error-handler): Remove debugging --- /project/slime/cvsroot/slime/swank-backend.lisp 2009/12/22 09:31:15 1.188 +++ /project/slime/cvsroot/slime/swank-backend.lisp 2010/01/03 15:58:29 1.189 @@ -747,6 +747,9 @@ The return value is the result of evaulating FORM in the appropriate context.") +(definterface frame-call (frame-number) + "Return a string representing a call to the entry point of a frame.") + (definterface return-from-frame (frame-number form) "Unwind the stack to the frame FRAME-NUMBER and return the value(s) produced by evaluating FORM in the frame context to its caller. --- /project/slime/cvsroot/slime/swank-ccl.lisp 2009/11/02 09:20:33 1.12 +++ /project/slime/cvsroot/slime/swank-ccl.lisp 2010/01/03 15:58:29 1.13 @@ -434,10 +434,15 @@ (format stream " ~s" arg))))) (format stream ")")))) +(defimplementation frame-call (frame-number) + (with-frame (p context) frame-number + (with-output-to-string (stream) + (print-frame (list :frame p context) stream)))) + (defun call/frame (frame-number if-found) (map-backtrace (lambda (p context) - (return-from call/frame + (return-from call/frame (funcall if-found p context))) frame-number)) --- /project/slime/cvsroot/slime/swank-sbcl.lisp 2010/01/03 10:05:05 1.264 +++ /project/slime/cvsroot/slime/swank-sbcl.lisp 2010/01/03 15:58:29 1.265 @@ -1011,6 +1011,19 @@ #+#.(swank-backend::sbcl-with-restart-frame) (not (null (sb-debug:frame-has-debug-tag-p frame)))) +(defimplementation frame-call (frame-number) + (multiple-value-bind (name args) + (sb-debug::frame-call (nth-frame frame-number)) + (with-output-to-string (stream) + (pprint-logical-block (stream nil :prefix "(" :suffix ")") + (let ((*print-length* nil) + (*print-level* nil)) + (prin1 (sb-debug::ensure-printable-object name) stream)) + (let ((args (sb-debug::ensure-printable-object args))) + (if (listp args) + (format stream "~{ ~_~S~}" args) + (format stream " ~S" args))))))) + ;;;; Code-location -> source-location translation ;;; If debug-block info is avaibale, we determine the file position of From sboukarev at common-lisp.net Sun Jan 3 15:58:29 2010 From: sboukarev at common-lisp.net (CVS User sboukarev) Date: Sun, 03 Jan 2010 10:58:29 -0500 Subject: [slime-cvs] CVS slime/contrib Message-ID: Update of /project/slime/cvsroot/slime/contrib In directory cl-net:/tmp/cvs-serv9550/contrib Modified Files: ChangeLog slime-repl.el Log Message: * contrib/slime-repl.el (sldb-insert-frame-call-to-repl): New function for inserting a call to a frame into the REPL. Bound to C-y in SLDB. * swank-backend.lisp (frame-call): New function. Returns a string representing a call to the entry point of a frame. * swank-ccl.lisp (frame-call): Implementation of the above. * swank-sbcl.lisp (frame-call): Ditto. --- /project/slime/cvsroot/slime/contrib/ChangeLog 2010/01/03 15:34:54 1.328 +++ /project/slime/cvsroot/slime/contrib/ChangeLog 2010/01/03 15:58:29 1.329 @@ -1,3 +1,8 @@ +2010-01-03 Stas Boukarev + + * slime-repl.el (sldb-insert-frame-call-to-repl): New function + for inserting a call to a frame into the REPL. Bound to C-y in SLDB. + 2010-01-03 Tobias C. Rittweiler * swank-arglists.lisp (arglist-index): Return NIL if more --- /project/slime/cvsroot/slime/contrib/slime-repl.el 2009/11/30 14:47:40 1.33 +++ /project/slime/cvsroot/slime/contrib/slime-repl.el 2010/01/03 15:58:29 1.34 @@ -457,6 +457,9 @@ (slime-define-keys slime-inspector-mode-map ((kbd "M-RET") 'slime-inspector-copy-down-to-repl)) +(slime-define-keys sldb-mode-map + ("\C-y" 'sldb-insert-frame-call-to-repl)) + (def-slime-selector-method ?r "SLIME Read-Eval-Print-Loop." (slime-output-buffer)) @@ -1465,6 +1468,18 @@ (slime-repl-send-string (format "%s" `(swank:inspector-nth-part ,number))) (slime-repl)) +(defun sldb-insert-frame-call-to-repl () + "Insert a call to a frame at point." + (interactive) + (let ((call (slime-eval `(swank-backend::frame-call + ,(sldb-frame-number-at-point))))) + (slime-switch-to-output-buffer) + (if (>= (point) slime-repl-prompt-start-mark) + (insert call) + (save-excursion + (goto-char (point-max)) + (insert call)))) + (slime-repl)) (defun slime-set-default-directory (directory) "Make DIRECTORY become Lisp's current directory." From trittweiler at common-lisp.net Sun Jan 3 16:54:40 2010 From: trittweiler at common-lisp.net (CVS User trittweiler) Date: Sun, 03 Jan 2010 11:54:40 -0500 Subject: [slime-cvs] CVS slime/contrib Message-ID: Update of /project/slime/cvsroot/slime/contrib In directory cl-net:/tmp/cvs-serv29834/contrib Modified Files: ChangeLog slime-autodoc.el Log Message: * slime-autodoc.el (slime-autodoc): Renamed from `slime-compute-autodoc'; now also interactive. (slime-autodoc-mode): Implement toggling properly. Make modeline string "Autodoc" rather than "Eldoc". (slime-autodoc-maybe-enable): Adapted accordingly. --- /project/slime/cvsroot/slime/contrib/ChangeLog 2010/01/03 15:58:29 1.329 +++ /project/slime/cvsroot/slime/contrib/ChangeLog 2010/01/03 16:54:40 1.330 @@ -1,3 +1,11 @@ +2010-01-03 Tobias C. Rittweiler + + * slime-autodoc.el (slime-autodoc): Renamed from + `slime-compute-autodoc'; now also interactive. + (slime-autodoc-mode): Implement toggling properly. Make modeline + string "Autodoc" rather than "Eldoc". + (slime-autodoc-maybe-enable): Adapted accordingly. + 2010-01-03 Stas Boukarev * slime-repl.el (sldb-insert-frame-call-to-repl): New function --- /project/slime/cvsroot/slime/contrib/slime-autodoc.el 2010/01/03 15:34:54 1.29 +++ /project/slime/cvsroot/slime/contrib/slime-autodoc.el 2010/01/03 16:54:40 1.30 @@ -154,9 +154,10 @@ ;;;; slime-autodoc-mode -(defun slime-compute-autodoc () +(defun slime-autodoc () "Returns the cached arglist information as string, or nil. If it's not in the cache, the cache will be updated asynchronously." + (interactive) (save-excursion ;; Save match data just in case. This is automatically run in ;; background, so it'd be rather disastrous if it touched match @@ -185,19 +186,16 @@ (make-variable-buffer-local (defvar slime-autodoc-mode nil)) (defun slime-autodoc-mode (&optional arg) - (interactive "P") + (interactive (list (or current-prefix-arg 'toggle))) (make-local-variable 'eldoc-documentation-function) (make-local-variable 'eldoc-idle-delay) - (setq eldoc-documentation-function 'slime-compute-autodoc) + (make-local-variable 'eldoc-minor-mode-string) + (setq eldoc-documentation-function 'slime-autodoc) (setq eldoc-idle-delay slime-autodoc-delay) - (eldoc-mode arg) - (cond (eldoc-mode - (setq slime-echo-arglist-function - (lambda () (eldoc-message (slime-compute-autodoc)))) - (setq slime-autodoc-mode t)) - (t - (setq slime-echo-arglist-function 'slime-show-arglist) - (setq slime-autodoc-mode nil)))) + (setq eldoc-minor-mode-string " Autodoc") + (setq slime-autodoc-mode (eldoc-mode arg)) + (message (format "Slime autodoc mode %s" + (if slime-autodoc-mode "enabled" "disabled")))) (defadvice eldoc-display-message-no-interference-p (after slime-autodoc-message-ok-p) @@ -220,8 +218,13 @@ (add-hook h 'slime-autodoc-maybe-enable))) (defun slime-autodoc-maybe-enable () - (when slime-use-autodoc-mode - (slime-autodoc-mode 1))) + (when slime-use-autodoc-mode + (slime-autodoc-mode 1) + (setq slime-echo-arglist-function + (lambda () + (if slime-autodoc-mode + (eldoc-message (slime-autodoc)) + (slime-show-arglist)))))) ;;; FIXME: This doesn't disable eldoc-mode in existing buffers. (defun slime-autodoc-unload () @@ -231,8 +234,6 @@ (slime-require :swank-arglists) - - ;;;; Test cases (defun slime-check-autodoc-at-point (arglist) From trittweiler at common-lisp.net Sun Jan 3 20:50:42 2010 From: trittweiler at common-lisp.net (CVS User trittweiler) Date: Sun, 03 Jan 2010 15:50:42 -0500 Subject: [slime-cvs] CVS slime/contrib Message-ID: Update of /project/slime/cvsroot/slime/contrib In directory cl-net:/tmp/cvs-serv26096/contrib Modified Files: ChangeLog slime-autodoc.el Log Message: * slime-autodoc.el (slime-autodoc-mode): Only display "enabled"/"disabled" message if called interactively. --- /project/slime/cvsroot/slime/contrib/ChangeLog 2010/01/03 16:54:40 1.330 +++ /project/slime/cvsroot/slime/contrib/ChangeLog 2010/01/03 20:50:42 1.331 @@ -1,5 +1,10 @@ 2010-01-03 Tobias C. Rittweiler + * slime-autodoc.el (slime-autodoc-mode): Only display + "enabled"/"disabled" message if called interactively. + +2010-01-03 Tobias C. Rittweiler + * slime-autodoc.el (slime-autodoc): Renamed from `slime-compute-autodoc'; now also interactive. (slime-autodoc-mode): Implement toggling properly. Make modeline --- /project/slime/cvsroot/slime/contrib/slime-autodoc.el 2010/01/03 16:54:40 1.30 +++ /project/slime/cvsroot/slime/contrib/slime-autodoc.el 2010/01/03 20:50:42 1.31 @@ -194,8 +194,9 @@ (setq eldoc-idle-delay slime-autodoc-delay) (setq eldoc-minor-mode-string " Autodoc") (setq slime-autodoc-mode (eldoc-mode arg)) - (message (format "Slime autodoc mode %s" - (if slime-autodoc-mode "enabled" "disabled")))) + (when (interactive-p) + (message (format "Slime autodoc mode %s." + (if slime-autodoc-mode "enabled" "disabled"))))) (defadvice eldoc-display-message-no-interference-p (after slime-autodoc-message-ok-p) From heller at common-lisp.net Tue Jan 5 09:00:05 2010 From: heller at common-lisp.net (CVS User heller) Date: Tue, 05 Jan 2010 04:00:05 -0500 Subject: [slime-cvs] CVS slime Message-ID: Update of /project/slime/cvsroot/slime In directory cl-net:/tmp/cvs-serv29406 Modified Files: ChangeLog slime.el Log Message: Stop the beeping on restart. * slime.el (slime-quit-lisp-internal): Don't kill already dead processes. --- /project/slime/cvsroot/slime/ChangeLog 2010/01/03 15:58:29 1.1952 +++ /project/slime/cvsroot/slime/ChangeLog 2010/01/05 09:00:04 1.1953 @@ -1,3 +1,10 @@ +2010-01-05 Helmut Eller + + Stop the beeping on restart. + + * slime.el (slime-quit-lisp-internal): Don't kill already dead + processes. + 2010-01-03 Stas Boukarev * swank-backend.lisp (frame-call): New function. --- /project/slime/cvsroot/slime/slime.el 2010/01/03 14:22:22 1.1261 +++ /project/slime/cvsroot/slime/slime.el 2010/01/05 09:00:05 1.1262 @@ -5228,7 +5228,8 @@ (set-process-sentinel connection sentinel) (when (and kill process) (sleep-for 0.2) - (kill-process process))))) + (unless (memq (process-status process) '(exit signal)) + (kill-process process)))))) (defun slime-quit-sentinel (process message) (assert (process-status process) 'closed) From heller at common-lisp.net Tue Jan 5 09:00:15 2010 From: heller at common-lisp.net (CVS User heller) Date: Tue, 05 Jan 2010 04:00:15 -0500 Subject: [slime-cvs] CVS slime Message-ID: Update of /project/slime/cvsroot/slime In directory cl-net:/tmp/cvs-serv30503 Modified Files: ChangeLog slime.el Log Message: Add "quit" and "other window prefix" buffer selectors. * slime.el (slime-selector-other-window): New variable. (slime-selector): Bind it as need. (def-slime-selector-method): Use the other window if so indicated. ([selector] 4): New key binding. ([selector] q): New key binding. just abort. --- /project/slime/cvsroot/slime/ChangeLog 2010/01/05 09:00:04 1.1953 +++ /project/slime/cvsroot/slime/ChangeLog 2010/01/05 09:00:15 1.1954 @@ -1,5 +1,15 @@ 2010-01-05 Helmut Eller + Add "quit" and "other window prefix" buffer selectors. + + * slime.el (slime-selector-other-window): New variable. + (slime-selector): Bind it as need. + (def-slime-selector-method): Use the other window if so indicated. + ([selector] 4): New key binding. + ([selector] q): New key binding. just abort. + +2010-01-05 Helmut Eller + Stop the beeping on restart. * slime.el (slime-quit-lisp-internal): Don't kill already dead --- /project/slime/cvsroot/slime/slime.el 2010/01/05 09:00:05 1.1262 +++ /project/slime/cvsroot/slime/slime.el 2010/01/05 09:00:15 1.1263 @@ -6689,7 +6689,10 @@ Each element is a list (KEY DESCRIPTION FUNCTION). DESCRIPTION is a one-line description of what the key selects.") -(defun slime-selector () +(defvar slime-selector-other-window nil + "If non-nil use switch-to-buffer-other-window.") + +(defun slime-selector (&optional other-window) "Select a new buffer by type, indicated by a single character. The user is prompted for a single character indicating the method by which to choose a new buffer. The `?' character describes the @@ -6699,18 +6702,19 @@ (interactive) (message "Select [%s]: " (apply #'string (mapcar #'car slime-selector-methods))) - (let* ((ch (save-window-excursion + (let* ((slime-selector-other-window other-window) + (ch (save-window-excursion (select-window (minibuffer-window)) (read-char))) (method (find ch slime-selector-methods :key #'car))) - (cond ((null method) + (cond (method + (funcall (third method))) + (t (message "No method for character: ?\\%c" ch) (ding) (sleep-for 1) (discard-input) - (slime-selector)) - (t - (funcall (third method)))))) + (slime-selector))))) (defmacro def-slime-selector-method (key description &rest body) "Define a new `slime-select' buffer selection method. @@ -6730,6 +6734,8 @@ (ding)) ((get-buffer-window buffer) (select-window (get-buffer-window buffer))) + (slime-selector-other-window + (switch-to-buffer-other-window buffer)) (t (switch-to-buffer buffer))))))) `(setq slime-selector-methods @@ -6743,13 +6749,18 @@ (insert "Select Methods:\n\n") (loop for (key line function) in slime-selector-methods do (insert (format "%c:\t%s\n" key line))) + (goto-char (point-min)) (help-mode) - (display-buffer (current-buffer) t) - (shrink-window-if-larger-than-buffer - (get-buffer-window (current-buffer)))) + (display-buffer (current-buffer) t)) (slime-selector) (current-buffer)) +(pushnew (list ?4 "Select in other window" (lambda () (slime-selector t))) + slime-selector-methods :key #'car) + +(def-slime-selector-method ?q "Abort." + (top-level)) + (def-slime-selector-method ?i "*inferior-lisp* buffer." (cond ((and (slime-connected-p) (slime-process)) From heller at common-lisp.net Tue Jan 5 09:00:23 2010 From: heller at common-lisp.net (CVS User heller) Date: Tue, 05 Jan 2010 04:00:23 -0500 Subject: [slime-cvs] CVS slime Message-ID: Update of /project/slime/cvsroot/slime In directory cl-net:/tmp/cvs-serv31270 Modified Files: ChangeLog swank-cmucl.lisp Log Message: Slightly better error message when CMUCL fails to find defstructs. * swank-cmucl.lisp (struct-constructor, setf-definitions): Don't use COERCE which gives confusing error message. --- /project/slime/cvsroot/slime/ChangeLog 2010/01/05 09:00:15 1.1954 +++ /project/slime/cvsroot/slime/ChangeLog 2010/01/05 09:00:22 1.1955 @@ -1,5 +1,12 @@ 2010-01-05 Helmut Eller + Slightly better error message when CMUCL fails to find defstructs. + + * swank-cmucl.lisp (struct-constructor, setf-definitions): Don't + use COERCE which gives confusing error message. + +2010-01-05 Helmut Eller + Add "quit" and "other window prefix" buffer selectors. * slime.el (slime-selector-other-window): New variable. --- /project/slime/cvsroot/slime/swank-cmucl.lisp 2009/12/22 09:31:15 1.216 +++ /project/slime/cvsroot/slime/swank-cmucl.lisp 2010/01/05 09:00:22 1.217 @@ -1017,14 +1017,12 @@ (defun struct-constructor (dd) "Return a constructor function from a defstruct definition. Signal an error if no constructor can be found." - (let ((constructor (or (kernel:dd-default-constructor dd) - (car (kernel::dd-constructors dd))))) - (when (or (null constructor) - (and (consp constructor) (null (car constructor)))) - (error "Cannot find structure's constructor: ~S" - (kernel::dd-name dd))) - (coerce (if (consp constructor) (first constructor) constructor) - 'function))) + (let* ((constructor (or (kernel:dd-default-constructor dd) + (car (kernel::dd-constructors dd)))) + (sym (if (consp constructor) (car constructor) constructor))) + (unless sym + (error "Cannot find structure's constructor: ~S" (kernel::dd-name dd))) + (coerce sym 'function))) ;;;;;; Generic functions and methods @@ -1197,15 +1195,15 @@ (null `(:error ,(format nil "Cannot resolve: ~S" source))))))))) (defun setf-definitions (name) - (let ((function (or (ext:info :setf :inverse name) - (ext:info :setf :expander name) - (and (symbolp name) - (fboundp `(setf ,name)) - (fdefinition `(setf ,name)))))) - (if function - (list (list `(setf ,name) - (function-location (coerce function 'function))))))) - + (let ((f (or (ext:info :setf :inverse name) + (ext:info :setf :expander name) + (and (symbolp name) + (fboundp `(setf ,name)) + (fdefinition `(setf ,name)))))) + (if f + `(((setf ,name) ,(function-location (cond ((functionp f) f) + ((macro-function f)) + ((fdefinition f))))))))) (defun variable-location (symbol) (multiple-value-bind (location foundp) From heller at common-lisp.net Tue Jan 5 09:00:31 2010 From: heller at common-lisp.net (CVS User heller) Date: Tue, 05 Jan 2010 04:00:31 -0500 Subject: [slime-cvs] CVS slime Message-ID: Update of /project/slime/cvsroot/slime In directory cl-net:/tmp/cvs-serv31768 Modified Files: ChangeLog swank-cmucl.lisp Log Message: Fix M-. bug related to CMUCL's multi-file compilation units. * swank-cmucl.lisp (code-location-stream-position): Require the "root-number" as argument and subtract it from the TLF number. (location-in-file): Pass the root number along. (code-location-string-offset): Use 0 as root number. --- /project/slime/cvsroot/slime/ChangeLog 2010/01/05 09:00:22 1.1955 +++ /project/slime/cvsroot/slime/ChangeLog 2010/01/05 09:00:30 1.1956 @@ -1,5 +1,14 @@ 2010-01-05 Helmut Eller + Fix M-. bug related to CMUCL's multi-file compilation units. + + * swank-cmucl.lisp (code-location-stream-position): Require the + "root-number" as argument and subtract it from the TLF number. + (location-in-file): Pass the root number along. + (code-location-string-offset): Use 0 as root number. + +2010-01-05 Helmut Eller + Slightly better error message when CMUCL fails to find defstructs. * swank-cmucl.lisp (struct-constructor, setf-definitions): Don't --- /project/slime/cvsroot/slime/swank-cmucl.lisp 2010/01/05 09:00:22 1.217 +++ /project/slime/cvsroot/slime/swank-cmucl.lisp 2010/01/05 09:00:30 1.218 @@ -791,11 +791,12 @@ (defun location-in-file (filename code-location debug-source) "Resolve the source location for CODE-LOCATION in FILENAME." (let* ((code-date (di:debug-source-created debug-source)) + (root-number (di:debug-source-root-number debug-source)) (source-code (get-source-code filename code-date))) (with-input-from-string (s source-code) (make-location (list :file (unix-truename filename)) (list :position (1+ (code-location-stream-position - code-location s))) + code-location s root-number))) `(:snippet ,(read-snippet s)))))) (defun location-in-stream (code-location debug-source) @@ -848,14 +849,15 @@ ;;;;; Groveling source-code for positions -(defun code-location-stream-position (code-location stream) +(defun code-location-stream-position (code-location stream root) "Return the byte offset of CODE-LOCATION in STREAM. Extract the toplevel-form-number and form-number from CODE-LOCATION and use that to find the position of the corresponding form. Finish with STREAM positioned at the start of the code location." (let* ((location (debug::maybe-block-start-location code-location)) - (tlf-offset (di:code-location-top-level-form-offset location)) + (tlf-offset (- (di:code-location-top-level-form-offset location) + root)) (form-number (di:code-location-form-number location))) (let ((pos (form-number-stream-position tlf-offset form-number stream))) (file-position stream pos) @@ -877,7 +879,7 @@ "Return the byte offset of CODE-LOCATION in STRING. See CODE-LOCATION-STREAM-POSITION." (with-input-from-string (s string) - (code-location-stream-position code-location s))) + (code-location-stream-position code-location s 0))) ;;;; Finding definitions From heller at common-lisp.net Tue Jan 5 09:00:39 2010 From: heller at common-lisp.net (CVS User heller) Date: Tue, 05 Jan 2010 04:00:39 -0500 Subject: [slime-cvs] CVS slime Message-ID: Update of /project/slime/cvsroot/slime In directory cl-net:/tmp/cvs-serv32359 Modified Files: ChangeLog swank-backend.lisp Log Message: Provide default implementation for all-threads. * swank-backend.lisp (all-threads): Just return (). Patch from Terje Norderhaug. --- /project/slime/cvsroot/slime/ChangeLog 2010/01/05 09:00:30 1.1956 +++ /project/slime/cvsroot/slime/ChangeLog 2010/01/05 09:00:39 1.1957 @@ -1,3 +1,9 @@ +2010-01-05 Terje Norderhaug + + Provide default implementation for all-threads. + + * swank-backend.lisp (all-threads): Just return (). + 2010-01-05 Helmut Eller Fix M-. bug related to CMUCL's multi-file compilation units. --- /project/slime/cvsroot/slime/swank-backend.lisp 2010/01/03 15:58:29 1.189 +++ /project/slime/cvsroot/slime/swank-backend.lisp 2010/01/05 09:00:39 1.190 @@ -1076,7 +1076,8 @@ 0) (definterface all-threads () - "Return a fresh list of all threads.") + "Return a fresh list of all threads." + '()) (definterface thread-alive-p (thread) "Test if THREAD is termintated." From heller at common-lisp.net Tue Jan 5 09:33:08 2010 From: heller at common-lisp.net (CVS User heller) Date: Tue, 05 Jan 2010 04:33:08 -0500 Subject: [slime-cvs] CVS slime Message-ID: Update of /project/slime/cvsroot/slime In directory cl-net:/tmp/cvs-serv12314 Modified Files: ChangeLog Log Message: * slime.texi (inferior-slime-mode): Fix thinko. --- /project/slime/cvsroot/slime/ChangeLog 2010/01/05 09:00:39 1.1957 +++ /project/slime/cvsroot/slime/ChangeLog 2010/01/05 09:33:08 1.1958 @@ -1,3 +1,7 @@ +2010-01-05 Cecil Westerhof + + * slime.texi (inferior-slime-mode): Fix thinko. + 2010-01-05 Terje Norderhaug Provide default implementation for all-threads. From heller at common-lisp.net Tue Jan 5 09:33:09 2010 From: heller at common-lisp.net (CVS User heller) Date: Tue, 05 Jan 2010 04:33:09 -0500 Subject: [slime-cvs] CVS slime/doc Message-ID: Update of /project/slime/cvsroot/slime/doc In directory cl-net:/tmp/cvs-serv12314/doc Modified Files: slime.texi Log Message: * slime.texi (inferior-slime-mode): Fix thinko. --- /project/slime/cvsroot/slime/doc/slime.texi 2009/12/17 10:15:18 1.92 +++ /project/slime/cvsroot/slime/doc/slime.texi 2010/01/05 09:33:09 1.93 @@ -12,7 +12,7 @@ @set EDITION 3.0-alpha @set SLIMEVER 3.0-alpha @c @set UPDATED @today{} - at set UPDATED @code{$Date: 2009/12/17 10:15:18 $} + at set UPDATED @code{$Date: 2010/01/05 09:33:09 $} @set TITLE SLIME User Manual @settitle @value{TITLE}, version @value{EDITION} @@ -2371,7 +2371,7 @@ To install it, add something like this to user @file{.emacs}: @example -(slime-setup '(inferior-slime-mode)) +(slime-setup '(inferior-slime)) @end example @table @kbd From heller at common-lisp.net Tue Jan 5 10:03:03 2010 From: heller at common-lisp.net (CVS User heller) Date: Tue, 05 Jan 2010 05:03:03 -0500 Subject: [slime-cvs] CVS slime/contrib Message-ID: Update of /project/slime/cvsroot/slime/contrib In directory cl-net:/tmp/cvs-serv25900/contrib Modified Files: ChangeLog inferior-slime.el Log Message: Fix "other window" selector in inferior-slime-mode. * inferior-slime.el ([selector-method] r): Return the buffer instead of switching directly. --- /project/slime/cvsroot/slime/contrib/ChangeLog 2010/01/03 20:50:42 1.331 +++ /project/slime/cvsroot/slime/contrib/ChangeLog 2010/01/05 10:03:02 1.332 @@ -1,3 +1,10 @@ +2010-01-05 Helmut Eller + + Fix "other window" selector in inferior-slime-mode. + + * inferior-slime.el ([selector-method] r): Return the buffer + instead of switching directly. + 2010-01-03 Tobias C. Rittweiler * slime-autodoc.el (slime-autodoc-mode): Only display --- /project/slime/cvsroot/slime/contrib/inferior-slime.el 2009/08/27 20:15:43 1.8 +++ /project/slime/cvsroot/slime/contrib/inferior-slime.el 2010/01/05 10:03:02 1.9 @@ -122,6 +122,6 @@ (add-hook 'slime-transcript-stop-hook 'inferior-slime-stop-transcript) (def-slime-selector-method ?r "SLIME Read-Eval-Print-Loop." - (inferior-slime-switch-to-repl-buffer))) + (process-buffer (slime-inferior-process)))) (provide 'inferior-slime) From sboukarev at common-lisp.net Tue Jan 5 19:53:17 2010 From: sboukarev at common-lisp.net (CVS User sboukarev) Date: Tue, 05 Jan 2010 14:53:17 -0500 Subject: [slime-cvs] CVS slime/contrib Message-ID: Update of /project/slime/cvsroot/slime/contrib In directory cl-net:/tmp/cvs-serv21365/contrib Modified Files: ChangeLog slime-asdf.el Log Message: contrib/slime-asdf.el(slime-save-system): New function for saving system's files. --- /project/slime/cvsroot/slime/contrib/ChangeLog 2010/01/05 10:03:02 1.332 +++ /project/slime/cvsroot/slime/contrib/ChangeLog 2010/01/05 19:53:17 1.333 @@ -1,3 +1,8 @@ +2010-01-05 Stas Boukarev + + * slime-asdf.el (slime-save-system): New function for saving + system's files. + 2010-01-05 Helmut Eller Fix "other window" selector in inferior-slime-mode. --- /project/slime/cvsroot/slime/contrib/slime-asdf.el 2009/12/19 10:11:27 1.25 +++ /project/slime/cvsroot/slime/contrib/slime-asdf.el 2010/01/05 19:53:17 1.26 @@ -215,6 +215,20 @@ (interactive (list (slime-read-system-name))) (slime-xref :depends-on system-name)) +(defun slime-save-system (system) + "Save files belonging to an ASDF system." + (interactive (list (slime-read-system-name))) + (slime-eval-async + `(swank:asdf-system-files ,system) + (lambda (files) + (dolist (file files) + (let ((buffer (find file (buffer-list) + :test 'equal :key 'buffer-file-name))) + (when buffer + (with-current-buffer buffer + (save-buffer buffer))))) + (message "Done.")))) + ;;; REPL shortcuts From sboukarev at common-lisp.net Tue Jan 5 19:58:57 2010 From: sboukarev at common-lisp.net (CVS User sboukarev) Date: Tue, 05 Jan 2010 14:58:57 -0500 Subject: [slime-cvs] CVS slime/contrib Message-ID: Update of /project/slime/cvsroot/slime/contrib In directory cl-net:/tmp/cvs-serv21980/contrib Modified Files: slime-asdf.el Log Message: slime-asdf.el(slime-save-system): Use get-file-buffer. --- /project/slime/cvsroot/slime/contrib/slime-asdf.el 2010/01/05 19:53:17 1.26 +++ /project/slime/cvsroot/slime/contrib/slime-asdf.el 2010/01/05 19:58:57 1.27 @@ -222,8 +222,7 @@ `(swank:asdf-system-files ,system) (lambda (files) (dolist (file files) - (let ((buffer (find file (buffer-list) - :test 'equal :key 'buffer-file-name))) + (let ((buffer (get-file-buffer file))) (when buffer (with-current-buffer buffer (save-buffer buffer))))) From trittweiler at common-lisp.net Tue Jan 5 21:17:52 2010 From: trittweiler at common-lisp.net (CVS User trittweiler) Date: Tue, 05 Jan 2010 16:17:52 -0500 Subject: [slime-cvs] CVS slime Message-ID: Update of /project/slime/cvsroot/slime In directory cl-net:/tmp/cvs-serv14084 Modified Files: ChangeLog slime.el Log Message: * slime.el (compile-defun [test]): Add two cases. --- /project/slime/cvsroot/slime/ChangeLog 2010/01/05 09:33:08 1.1958 +++ /project/slime/cvsroot/slime/ChangeLog 2010/01/05 21:17:52 1.1959 @@ -1,3 +1,7 @@ +2010-01-05 Tobias C. Rittweiler + + * slime.el (compile-defun [test]): Add two cases. + 2010-01-05 Cecil Westerhof * slime.texi (inferior-slime-mode): Fix thinko. --- /project/slime/cvsroot/slime/slime.el 2010/01/05 09:00:15 1.1263 +++ /project/slime/cvsroot/slime/slime.el 2010/01/05 21:17:52 1.1264 @@ -7720,7 +7720,9 @@ ("(defun foo () pkg-does-not-exist:symbol)" pkg-does-not-exist:symbol) ("(defun foo () swank:symbol-does-not-exist)" - swank:symbol-does-not-exist)) + swank:symbol-does-not-exist) + ("(defun foo (x) ,x)" \,x) + ("(defun foo () #@foo)" @foo)) (slime-check-top-level) (with-temp-buffer (lisp-mode) From trittweiler at common-lisp.net Tue Jan 5 21:20:38 2010 From: trittweiler at common-lisp.net (CVS User trittweiler) Date: Tue, 05 Jan 2010 16:20:38 -0500 Subject: [slime-cvs] CVS slime Message-ID: Update of /project/slime/cvsroot/slime In directory cl-net:/tmp/cvs-serv15879 Modified Files: ChangeLog swank-sbcl.lisp Log Message: * swank-sbcl.lisp (compiler-note-location): Add missing return-from. --- /project/slime/cvsroot/slime/ChangeLog 2010/01/05 21:17:52 1.1959 +++ /project/slime/cvsroot/slime/ChangeLog 2010/01/05 21:20:38 1.1960 @@ -1,5 +1,9 @@ 2010-01-05 Tobias C. Rittweiler + * swank-sbcl.lisp (compiler-note-location): Add missing return-from. + +2010-01-05 Tobias C. Rittweiler + * slime.el (compile-defun [test]): Add two cases. 2010-01-05 Cecil Westerhof --- /project/slime/cvsroot/slime/swank-sbcl.lisp 2010/01/03 15:58:29 1.265 +++ /project/slime/cvsroot/slime/swank-sbcl.lisp 2010/01/05 21:20:38 1.266 @@ -457,7 +457,8 @@ (defun compiler-note-location (condition context) (flet ((bailout () - (list :error "No error location available"))) + (return-from compiler-note-location + (make-error-location "No error location available")))) (cond (context (locate-compiler-note (sb-c::compiler-error-context-file-name context) @@ -483,7 +484,10 @@ (t (bailout))))) (defun compiling-from-buffer-p (filename) - (and (not (eq filename :lisp)) *buffer-name*)) + (and *buffer-name* + ;; The following is to trigger COMPILING-FROM-GENERATED-CODE-P + ;; in LOCATE-COMPILER-NOTE. + (not (eq filename :lisp)))) (defun compiling-from-file-p (filename) (and (pathnamep filename) (null *buffer-name*))) From trittweiler at common-lisp.net Wed Jan 6 14:13:48 2010 From: trittweiler at common-lisp.net (CVS User trittweiler) Date: Wed, 06 Jan 2010 09:13:48 -0500 Subject: [slime-cvs] CVS slime/contrib Message-ID: Update of /project/slime/cvsroot/slime/contrib In directory cl-net:/tmp/cvs-serv16658/contrib Modified Files: swank-arglists.lisp slime-autodoc.el ChangeLog Log Message: * swank-backend (declaration-arglist): Normalize declaration specifiers to contain `variables' rather than `vars'. * swank-arglists.lisp (arglist-dispatch ['declare]): Normalize `vars' to `variables'. (arglist-for-type-declaration): Ditto. * slime-autodoc (autodoc.1 [test]): Reorganize test, add comments, add cases to test declarations. --- /project/slime/cvsroot/slime/contrib/swank-arglists.lisp 2010/01/03 15:34:54 1.54 +++ /project/slime/cvsroot/slime/contrib/swank-arglists.lisp 2010/01/06 14:13:48 1.55 @@ -1016,7 +1016,7 @@ (make-arglist :required-args (list (make-arglist :required-args (list typespec-arglist) - :rest '#:vars))))) + :rest '#:variables))))) (('declare (decl-identifier . decl-args)) (decoded-arglist-for-declaration decl-identifier decl-args)) (_ (make-arglist :rest '#:declaration-specifiers)))))) @@ -1045,7 +1045,7 @@ (make-arglist :required-args (list (make-arglist :required-args (list typespec-arglist) - :rest '#:vars))))) + :rest '#:variables))))) (_ :not-available)))) (defun decoded-arglist-for-declaration (decl-identifier decl-args) --- /project/slime/cvsroot/slime/contrib/slime-autodoc.el 2010/01/03 20:50:42 1.31 +++ /project/slime/cvsroot/slime/contrib/slime-autodoc.el 2010/01/06 14:13:48 1.32 @@ -247,46 +247,61 @@ (def-slime-test autodoc.1 (buffer-sexpr wished-arglist &optional skip-trailing-test-p) "" - '(("(swank::emacs-connected*HERE*" "(emacs-connected)") - ("(swank::emacs-connected *HERE*" "(emacs-connected)") + '( + ;; Test basics + ("(swank::emacs-connected*HERE*" "(emacs-connected)") + ("(swank::emacs-connected *HERE*" "(emacs-connected)") ("(swank::create-socket*HERE*" "(create-socket host port)") ("(swank::create-socket *HERE*" "(create-socket ===> host <=== port)") ("(swank::create-socket foo *HERE*" "(create-socket host ===> port <===)") + + ;; Test if cursor is on non-existing required parameter ("(swank::create-socket foo bar *HERE*" "(create-socket host port)") + ;; Test cursor in front of opening parenthesis + ("(swank::with-struct *HERE*(foo. x y) *struct* body1)" + "(with-struct (conc-name &rest names) obj &body body)" + t) + + ;; Test variable content display + ("(progn swank::default-server-port*HERE*" "DEFAULT-SERVER-PORT => 4005") + + ;; Test with syntactic sugar ("#'(lambda () (swank::create-socket*HERE*" "(create-socket host port)") ("`(lambda () ,(swank::create-socket*HERE*" "(create-socket host port)") + ("(remove-if #'(lambda () (swank::create-socket*HERE*" "(create-socket host port)") + ("`(remove-if #'(lambda () ,@(swank::create-socket*HERE*" "(create-socket host port)") - ("(remove-if #'(lambda () (swank::create-socket*HERE*" - "(create-socket host port)") - ("`(remove-if #'(lambda () ,@(swank::create-socket*HERE*" - "(create-socket host port)") - + ;; Test &optional ("(swank::symbol-status foo *HERE*" "(symbol-status symbol &optional ===> (package (symbol-package symbol)) <===)") + ;; Test context-sensitive autodoc ("(defmethod swank::arglist-dispatch (*HERE*" "(defmethod arglist-dispatch (===> operator <=== arguments) &body body)") ("(apply 'swank::eval-for-emacs*HERE*" "(apply 'eval-for-emacs &optional form buffer-package id &rest args)") - ("(apply #'swank::eval-for-emacs*HERE*" "(apply #'eval-for-emacs &optional form buffer-package id &rest args)") - ("(apply 'swank::eval-for-emacs foo *HERE*" "(apply 'eval-for-emacs &optional form ===> buffer-package <=== id &rest args)") - ("(apply #'swank::eval-for-emacs foo *HERE*" "(apply #'eval-for-emacs &optional form ===> buffer-package <=== id &rest args)") - + + ;; Test &KEY and nested arglists ("(swank::with-retry-restart (:msg *HERE*" "(with-retry-restart (&key ===> (msg \"Retry.\") <===) &body body)") ("(swank::start-server \"/tmp/foo\" :coding-system *HERE*" "(start-server port-file &key (style swank:*communication-style*) (dont-close swank:*dont-close*) ===> (coding-system swank::*coding-system*) <===)") - - ("(swank::with-struct *HERE*(foo. x y) *struct* body1)" - "(with-struct (conc-name &rest names) obj &body body)" - t)) + + ;; Test declarations and type specifiers + ("(declare (string *HERE*" + "(declare (string &rest ===> variables <===))") + ("(declare ((string *HERE*" + "(declare ((string &optional ===> size <===) &rest variables))") + ("(declare (type (string *HERE*" + "(declare (type (string &optional ===> size <===) &rest variables))") + ) (slime-check-top-level) (with-temp-buffer (setq slime-buffer-package "COMMON-LISP-USER") --- /project/slime/cvsroot/slime/contrib/ChangeLog 2010/01/05 19:53:17 1.333 +++ /project/slime/cvsroot/slime/contrib/ChangeLog 2010/01/06 14:13:48 1.334 @@ -1,3 +1,12 @@ +2010-01-06 Tobias C. Rittweiler + + * swank-arglists.lisp (arglist-dispatch ['declare]): Normalize + `vars' to `variables'. + (arglist-for-type-declaration): Ditto. + + * slime-autodoc (autodoc.1 [test]): Reorganize test, add comments, + add cases to test declarations. + 2010-01-05 Stas Boukarev * slime-asdf.el (slime-save-system): New function for saving From trittweiler at common-lisp.net Wed Jan 6 14:13:49 2010 From: trittweiler at common-lisp.net (CVS User trittweiler) Date: Wed, 06 Jan 2010 09:13:49 -0500 Subject: [slime-cvs] CVS slime Message-ID: Update of /project/slime/cvsroot/slime In directory cl-net:/tmp/cvs-serv16658 Modified Files: swank-backend.lisp ChangeLog Log Message: * swank-backend (declaration-arglist): Normalize declaration specifiers to contain `variables' rather than `vars'. * swank-arglists.lisp (arglist-dispatch ['declare]): Normalize `vars' to `variables'. (arglist-for-type-declaration): Ditto. * slime-autodoc (autodoc.1 [test]): Reorganize test, add comments, add cases to test declarations. --- /project/slime/cvsroot/slime/swank-backend.lisp 2010/01/05 09:00:39 1.190 +++ /project/slime/cvsroot/slime/swank-backend.lisp 2010/01/06 14:13:48 1.191 @@ -542,10 +542,10 @@ additional information on the specifiers defined in ANSI Common Lisp.") (:method (decl-identifier) (case decl-identifier - (dynamic-extent '(&rest vars)) - (ignore '(&rest vars)) - (ignorable '(&rest vars)) - (special '(&rest vars)) + (dynamic-extent '(&rest variables)) + (ignore '(&rest variables)) + (ignorable '(&rest variables)) + (special '(&rest variables)) (inline '(&rest function-names)) (notinline '(&rest function-names)) (declaration '(&rest names)) @@ -555,9 +555,9 @@ (otherwise (flet ((typespec-p (symbol) (member :type (describe-symbol-for-emacs symbol)))) (cond ((and (symbolp decl-identifier) (typespec-p decl-identifier)) - '(&rest vars)) + '(&rest variables)) ((and (listp decl-identifier) (typespec-p (first decl-identifier))) - '(&rest vars)) + '(&rest variables)) (t :not-available))))))) (defgeneric type-specifier-arglist (typespec-operator) --- /project/slime/cvsroot/slime/ChangeLog 2010/01/05 21:20:38 1.1960 +++ /project/slime/cvsroot/slime/ChangeLog 2010/01/06 14:13:48 1.1961 @@ -1,3 +1,8 @@ +2010-01-06 Tobias C. Rittweiler + + * swank-backend (declaration-arglist): Normalize declaration + specifiers to contain `variables' rather than `vars'. + 2010-01-05 Tobias C. Rittweiler * swank-sbcl.lisp (compiler-note-location): Add missing return-from. From trittweiler at common-lisp.net Wed Jan 6 14:40:20 2010 From: trittweiler at common-lisp.net (CVS User trittweiler) Date: Wed, 06 Jan 2010 09:40:20 -0500 Subject: [slime-cvs] CVS slime/contrib Message-ID: Update of /project/slime/cvsroot/slime/contrib In directory cl-net:/tmp/cvs-serv24052/contrib Modified Files: swank-arglists.lisp ChangeLog Log Message: * swank-arglists.lisp (extract-cursor-marker): Make sure to recurse only if the form, to be recursed into, is a cons. Reported by Johannes Gr??dem. --- /project/slime/cvsroot/slime/contrib/swank-arglists.lisp 2010/01/06 14:13:48 1.55 +++ /project/slime/cvsroot/slime/contrib/swank-arglists.lisp 2010/01/06 14:40:20 1.56 @@ -1254,18 +1254,18 @@ (values (nreconc result-form cdr) last (nreverse path)))) - (t + ((consp car) (multiple-value-bind (new-car new-last new-path) (grovel car last (cons 0 path)) - (when new-path + (when new-path ; CAR contained cursor-marker? (return-from grovel (values (nreconc (cons new-car result-form) cdr) new-last - new-path)))) - (push car result-form) - (setq last car) - (incf (first path)))) + new-path)))))) + (push car result-form) + (setq last car) + (incf (first path)) finally (return-from grovel (values (nreverse result-form) nil nil)))))) --- /project/slime/cvsroot/slime/contrib/ChangeLog 2010/01/06 14:13:48 1.334 +++ /project/slime/cvsroot/slime/contrib/ChangeLog 2010/01/06 14:40:20 1.335 @@ -1,5 +1,12 @@ 2010-01-06 Tobias C. Rittweiler + * swank-arglists.lisp (extract-cursor-marker): Make sure to + recurse only if the form, to be recursed into, is a cons. + + Reported by Johannes Gr??dem. + +2010-01-06 Tobias C. Rittweiler + * swank-arglists.lisp (arglist-dispatch ['declare]): Normalize `vars' to `variables'. (arglist-for-type-declaration): Ditto. From trittweiler at common-lisp.net Wed Jan 6 14:55:46 2010 From: trittweiler at common-lisp.net (CVS User trittweiler) Date: Wed, 06 Jan 2010 09:55:46 -0500 Subject: [slime-cvs] CVS slime/contrib Message-ID: Update of /project/slime/cvsroot/slime/contrib In directory cl-net:/tmp/cvs-serv31043/contrib Modified Files: slime-autodoc.el ChangeLog Log Message: * slime-autodoc.el (slime-check-autodoc-at-point): Bind `slime-autodoc-use-multiline-p' to nil for normalized test results. --- /project/slime/cvsroot/slime/contrib/slime-autodoc.el 2010/01/06 14:13:48 1.32 +++ /project/slime/cvsroot/slime/contrib/slime-autodoc.el 2010/01/06 14:55:45 1.33 @@ -238,11 +238,12 @@ ;;;; Test cases (defun slime-check-autodoc-at-point (arglist) - (slime-test-expect (format "Autodoc in `%s' (at %d) is as expected" - (buffer-string) (point)) - arglist - (slime-eval (second (slime-make-autodoc-rpc-form))) - 'equal)) + (let ((slime-autodoc-use-multiline-p nil)) + (slime-test-expect (format "Autodoc in `%s' (at %d) is as expected" + (buffer-string) (point)) + arglist + (slime-eval (second (slime-make-autodoc-rpc-form))) + 'equal))) (def-slime-test autodoc.1 (buffer-sexpr wished-arglist &optional skip-trailing-test-p) --- /project/slime/cvsroot/slime/contrib/ChangeLog 2010/01/06 14:40:20 1.335 +++ /project/slime/cvsroot/slime/contrib/ChangeLog 2010/01/06 14:55:45 1.336 @@ -1,5 +1,11 @@ 2010-01-06 Tobias C. Rittweiler + * slime-autodoc.el (slime-check-autodoc-at-point): Bind + `slime-autodoc-use-multiline-p' to nil for normalized test + results. + +2010-01-06 Tobias C. Rittweiler + * swank-arglists.lisp (extract-cursor-marker): Make sure to recurse only if the form, to be recursed into, is a cons. From trittweiler at common-lisp.net Wed Jan 6 18:23:45 2010 From: trittweiler at common-lisp.net (CVS User trittweiler) Date: Wed, 06 Jan 2010 13:23:45 -0500 Subject: [slime-cvs] CVS slime/contrib Message-ID: Update of /project/slime/cvsroot/slime/contrib In directory cl-net:/tmp/cvs-serv25115/contrib Modified Files: swank-arglists.lisp slime-autodoc.el ChangeLog Log Message: * swank-arglists.lisp (interesting-variable-p): Exclude keywords from being candidates for "display variable content" autodoc feature. (print-decoded-arglist): Slightly better arglist printing if `slime-autodoc-use-multiline-p' is true. (parse-raw-form): Make it able to parse strings. * slime-autodoc.el (autodoc.1 [test]): Add more cases. --- /project/slime/cvsroot/slime/contrib/swank-arglists.lisp 2010/01/06 14:40:20 1.56 +++ /project/slime/cvsroot/slime/contrib/swank-arglists.lisp 2010/01/06 18:23:44 1.57 @@ -72,7 +72,8 @@ (and symbol (symbolp symbol) (boundp symbol) - (not (memq symbol '(cl:t cl:nil))))) + (not (memq symbol '(cl:t cl:nil))) + (not (keywordp symbol)))) (defmacro multiple-value-or (&rest forms) (if (null forms) @@ -155,7 +156,6 @@ (and (arglist-dummy-p dummy) (zerop (length (arglist-dummy.string-representation dummy))))) - (eval-when (:compile-toplevel :load-toplevel :execute) (defparameter +lambda-list-keywords+ '(&provided &required &optional &rest &key &any))) @@ -251,7 +251,8 @@ (let ((index 0)) (pprint-logical-block (nil nil :prefix "(" :suffix ")") (when operator - (princ-arg operator)) + (princ-arg operator) + (pprint-indent :current 1)) ; 1 due to possibly added space (do-decoded-arglist (remove-given-args arglist provided-args) (&provided (arg) (space) @@ -279,7 +280,8 @@ (incf index)) (&key :initially (when (arglist.key-p arglist) - (space) (princ '&key))) + (space) + (princ '&key))) (&key (keyword arg init) (space) (if (arglist-p arg) @@ -317,6 +319,7 @@ ;; FIXME: add &UNKNOWN-JUNK? ))))) + (defun princ-arg (arg) (princ (if (arglist-dummy-p arg) (arglist-dummy.string-representation arg) @@ -1473,20 +1476,29 @@ datum for subsequent logics to rely on." (let* ((string (string-left-trim '(#\Space #\Tab #\Newline) string)) (length (length string)) - (prefix (cond ((zerop length) nil) - ((eql (aref string 0) #\') :quote) - ((search "#'" string :end2 (min length 2)) :sharpquote) - (t nil)))) + (type (cond ((zerop length) nil) + ((eql (aref string 0) #\') + :quoted-symbol) + ((search "#'" string :end2 (min length 2)) + :sharpquoted-symbol) + ((and (eql (aref string 0) #\") + (eql (aref string (1- length)) #\")) + :string) + (t + :symbol)))) (multiple-value-bind (symbol found?) - (parse-symbol (case prefix - (:quote (subseq string 1)) - (:sharpquote (subseq string 2)) - (t string))) + (case type + (:symbol (parse-symbol string)) + (:quoted-symbol (parse-symbol (subseq string 1))) + (:sharpquoted-symbol (parse-symbol (subseq string 2))) + (:string (values string t)) + (t (values string nil))) (if found? - (case prefix - (:quote `(quote ,symbol)) - (:sharpquote `(function ,symbol)) - (t symbol)) + (ecase type + (:symbol symbol) + (:quoted-symbol `(quote ,symbol)) + (:sharpquoted-symbol `(function ,symbol)) + (:string string)) (make-arglist-dummy string))))) (defun test-print-arglist () --- /project/slime/cvsroot/slime/contrib/slime-autodoc.el 2010/01/06 14:55:45 1.33 +++ /project/slime/cvsroot/slime/contrib/slime-autodoc.el 2010/01/06 18:23:44 1.34 @@ -256,6 +256,9 @@ ("(swank::create-socket *HERE*" "(create-socket ===> host <=== port)") ("(swank::create-socket foo *HERE*" "(create-socket host ===> port <===)") + ;; Test that autodoc differentiates between exported and unexported symbols. + ("(swank:create-socket*HERE*" :not-available) + ;; Test if cursor is on non-existing required parameter ("(swank::create-socket foo bar *HERE*" "(create-socket host port)") @@ -267,6 +270,10 @@ ;; Test variable content display ("(progn swank::default-server-port*HERE*" "DEFAULT-SERVER-PORT => 4005") + ;; Test that "variable content display" is not triggered for trivial constants. + ("(swank::create-socket t*HERE*" "(create-socket ===> host <=== port)") + ("(swank::create-socket :foo*HERE*" "(create-socket ===> host <=== port)") + ;; Test with syntactic sugar ("#'(lambda () (swank::create-socket*HERE*" "(create-socket host port)") ("`(lambda () ,(swank::create-socket*HERE*" "(create-socket host port)") @@ -277,9 +284,11 @@ ("(swank::symbol-status foo *HERE*" "(symbol-status symbol &optional ===> (package (symbol-package symbol)) <===)") - ;; Test context-sensitive autodoc + ;; Test context-sensitive autodoc (DEFMETHOD) ("(defmethod swank::arglist-dispatch (*HERE*" "(defmethod arglist-dispatch (===> operator <=== arguments) &body body)") + + ;; Test context-sensitive autodoc (APPLY) ("(apply 'swank::eval-for-emacs*HERE*" "(apply 'eval-for-emacs &optional form buffer-package id &rest args)") ("(apply #'swank::eval-for-emacs*HERE*" @@ -288,6 +297,12 @@ "(apply 'eval-for-emacs &optional form ===> buffer-package <=== id &rest args)") ("(apply #'swank::eval-for-emacs foo *HERE*" "(apply #'eval-for-emacs &optional form ===> buffer-package <=== id &rest args)") + + ;; Test context-sensitive autodoc (ERROR, CERROR) + ("(error 'simple-condition*HERE*" + "(error 'simple-condition &rest arguments &key format-arguments format-control)") + ("(cerror \"Foo\" 'simple-condition*HERE*" + "(cerror \"Foo\" 'simple-condition &rest arguments &key format-arguments format-control)") ;; Test &KEY and nested arglists ("(swank::with-retry-restart (:msg *HERE*" --- /project/slime/cvsroot/slime/contrib/ChangeLog 2010/01/06 14:55:45 1.336 +++ /project/slime/cvsroot/slime/contrib/ChangeLog 2010/01/06 18:23:44 1.337 @@ -1,5 +1,16 @@ 2010-01-06 Tobias C. Rittweiler + * swank-arglists.lisp (interesting-variable-p): Exclude keywords + from being candidates for "display variable content" autodoc + feature. + (print-decoded-arglist): Slightly better arglist printing if + `slime-autodoc-use-multiline-p' is true. + (parse-raw-form): Make it able to parse strings. + + * slime-autodoc.el (autodoc.1 [test]): Add more cases. + +2010-01-06 Tobias C. Rittweiler + * slime-autodoc.el (slime-check-autodoc-at-point): Bind `slime-autodoc-use-multiline-p' to nil for normalized test results. From sboukarev at common-lisp.net Fri Jan 8 10:59:46 2010 From: sboukarev at common-lisp.net (CVS User sboukarev) Date: Fri, 08 Jan 2010 05:59:46 -0500 Subject: [slime-cvs] CVS slime/contrib Message-ID: Update of /project/slime/cvsroot/slime/contrib In directory cl-net:/tmp/cvs-serv31885/contrib Modified Files: ChangeLog swank-asdf.lisp Log Message: contrib/swank-asdf.lisp: Doing list-all-systems-in-central-registry might be quite slow since it accesses a file-system, so run it once at the background to initialize fs caches. --- /project/slime/cvsroot/slime/contrib/ChangeLog 2010/01/06 18:23:44 1.337 +++ /project/slime/cvsroot/slime/contrib/ChangeLog 2010/01/08 10:59:46 1.338 @@ -1,3 +1,9 @@ +2010-01-08 Stas Boukarev + + * swank-asdf.lisp: Doing list-all-systems-in-central-registry + might be quite slow since it accesses a file-system, + so run it once at the background to initialize fs caches. + 2010-01-06 Tobias C. Rittweiler * swank-arglists.lisp (interesting-variable-p): Exclude keywords --- /project/slime/cvsroot/slime/contrib/swank-asdf.lisp 2010/01/03 14:18:26 1.26 +++ /project/slime/cvsroot/slime/contrib/swank-asdf.lisp 2010/01/08 10:59:46 1.27 @@ -199,4 +199,13 @@ (let ((*recompile-system* (asdf:find-system name))) (operate-on-system-for-emacs name 'asdf:load-op))) +;; Doing list-all-systems-in-central-registry might be quite slow +;; since it accesses a file-system, so run it once at the background +;; to initialize caches. +(eval-when (:load-toplevel :execute) + (when (eql *communication-style* :spawn) + (spawn (lambda () + (ignore-errors (list-all-systems-in-central-registry))) + :name "init-asdf-fs-caches"))) + (provide :swank-asdf) From mevenson at common-lisp.net Mon Jan 11 13:23:08 2010 From: mevenson at common-lisp.net (CVS User mevenson) Date: Mon, 11 Jan 2010 08:23:08 -0500 Subject: [slime-cvs] CVS slime Message-ID: Update of /project/slime/cvsroot/slime In directory cl-net:/tmp/cvs-serv4954 Modified Files: ChangeLog swank-abcl.lisp Log Message: * swank-abcl.lisp (emacs-inspect): Implementation for Java objects. Fix compiler warning about *ABCL-SIGNALED-CONDITIONS*. --- /project/slime/cvsroot/slime/ChangeLog 2010/01/06 14:13:48 1.1961 +++ /project/slime/cvsroot/slime/ChangeLog 2010/01/11 13:23:08 1.1962 @@ -1,3 +1,10 @@ +2010-01-11 Mark Evenson + + * swank-abcl.lisp (emacs-inspect): Implementation for Java + objects. + + Fix compiler warning about *ABCL-SIGNALED-CONDITIONS*. + 2010-01-06 Tobias C. Rittweiler * swank-backend (declaration-arglist): Normalize declaration --- /project/slime/cvsroot/slime/swank-abcl.lisp 2009/12/19 14:56:06 1.78 +++ /project/slime/cvsroot/slime/swank-abcl.lisp 2010/01/11 13:23:08 1.79 @@ -390,6 +390,8 @@ (in-package :swank-backend) +(defvar *abcl-signaled-conditions*) + (defun handle-compiler-warning (condition) (let ((loc (when (and jvm::*compile-file-pathname* system::*source-position*) @@ -416,8 +418,6 @@ (list :file (namestring *compile-filename*)) (list :position 1))))))))) -(defvar *abcl-signaled-conditions*) - (defimplementation swank-compile-file (input-file output-file load-p external-format) (declare (ignore external-format)) @@ -516,35 +516,35 @@ ;;;; Inspecting (defmethod emacs-inspect ((slot mop::slot-definition)) - `("Name: " (:value ,(mop::%slot-definition-name slot)) - (:newline) - "Documentation:" (:newline) - ,@(when (slot-definition-documentation slot) - `((:value ,(slot-definition-documentation slot)) (:newline))) - "Initialization:" (:newline) - " Args: " (:value ,(mop::%slot-definition-initargs slot)) (:newline) - " Form: " ,(if (mop::%slot-definition-initfunction slot) - `(:value ,(mop::%slot-definition-initform slot)) - "#") (:newline) - " Function: " (:value ,(mop::%slot-definition-initfunction slot)) - (:newline))) + `("Name: " (:value ,(mop::%slot-definition-name slot)) + (:newline) + "Documentation:" (:newline) + ,@(when (slot-definition-documentation slot) + `((:value ,(slot-definition-documentation slot)) (:newline))) + "Initialization:" (:newline) + " Args: " (:value ,(mop::%slot-definition-initargs slot)) (:newline) + " Form: " ,(if (mop::%slot-definition-initfunction slot) + `(:value ,(mop::%slot-definition-initform slot)) + "#") (:newline) + " Function: " (:value ,(mop::%slot-definition-initfunction slot)) + (:newline))) (defmethod emacs-inspect ((f function)) - `(,@(when (function-name f) - `("Name: " - ,(princ-to-string (function-name f)) (:newline))) - ,@(multiple-value-bind (args present) - (sys::arglist f) - (when present `("Argument list: " ,(princ-to-string args) (:newline)))) - (:newline) - #+nil,@(when (documentation f t) - `("Documentation:" (:newline) ,(documentation f t) (:newline))) - ,@(when (function-lambda-expression f) - `("Lambda expression:" - (:newline) ,(princ-to-string (function-lambda-expression f)) (:newline))))) + `(,@(when (function-name f) + `("Name: " + ,(princ-to-string (function-name f)) (:newline))) + ,@(multiple-value-bind (args present) + (sys::arglist f) + (when present `("Argument list: " ,(princ-to-string args) (:newline)))) + (:newline) + #+nil,@(when (documentation f t) + `("Documentation:" (:newline) ,(documentation f t) (:newline))) + ,@(when (function-lambda-expression f) + `("Lambda expression:" + (:newline) ,(princ-to-string (function-lambda-expression f)) (:newline))))) #| - +;;; XXX -- the default SLIME implementation looks ok. Remove? --ME 20100111 (defmethod emacs-inspect ((o t)) (let* ((class (class-of o)) (slots (mop::class-slots class))) @@ -555,6 +555,12 @@ slots))) |# +(defmethod emacs-inspect ((o java:java-object)) + (append + (label-value-line "toString()" (java:jcall "toString" o)) + (loop :for (label . value) :in (sys:inspected-parts o) + :appending (label-value-line label value)))) + ;;;; Multithreading #+#.(cl:if (cl:find-package :threads) '(:and) '(:or)) From trittweiler at common-lisp.net Wed Jan 13 13:45:49 2010 From: trittweiler at common-lisp.net (CVS User trittweiler) Date: Wed, 13 Jan 2010 08:45:49 -0500 Subject: [slime-cvs] CVS slime Message-ID: Update of /project/slime/cvsroot/slime In directory cl-net:/tmp/cvs-serv5248 Modified Files: ChangeLog swank.lisp Log Message: * swank.lisp (*swank-state-stack*): Delete. Not needed anymore. (defslimefun state-stack): Delete. (decode-message): Adapted. (debug-in-emacs): Adapted. --- /project/slime/cvsroot/slime/ChangeLog 2010/01/11 13:23:08 1.1962 +++ /project/slime/cvsroot/slime/ChangeLog 2010/01/13 13:45:49 1.1963 @@ -1,3 +1,10 @@ +2010-01-13 Tobias C. Rittweiler + + * swank.lisp (*swank-state-stack*): Delete. Not needed anymore. + (defslimefun state-stack): Delete. + (decode-message): Adapted. + (debug-in-emacs): Adapted. + 2010-01-11 Mark Evenson * swank-abcl.lisp (emacs-inspect): Implementation for Java --- /project/slime/cvsroot/slime/swank.lisp 2010/01/03 15:46:44 1.682 +++ /project/slime/cvsroot/slime/swank.lisp 2010/01/13 13:45:49 1.683 @@ -312,10 +312,6 @@ (defvar *emacs-connection* nil "The connection to Emacs currently in use.") -(defvar *swank-state-stack* '() - "A list of symbols describing the current state. Used for debugging -and to detect situations where interrupts can be ignored.") - (defun default-connection () "Return the 'default' Emacs connection. This connection can be used to talk with Emacs when no specific @@ -325,10 +321,6 @@ recently established one." (first *connections*)) -(defslimefun state-stack () - "Return the value of *SWANK-STATE-STACK*." - *swank-state-stack*) - (defslimefun ping (tag) tag) @@ -1738,12 +1730,11 @@ (defun decode-message (stream) "Read an S-expression from STREAM using the SLIME protocol." ;;(log-event "decode-message~%") - (let ((*swank-state-stack* (cons :read-next-form *swank-state-stack*))) - (handler-bind ((error (lambda (c) (error (make-swank-protocol-error c))))) - (let ((packet (read-packet stream))) - (handler-case (values (read-form packet) nil) - (reader-error (c) - `(:reader-error ,packet ,c))))))) + (handler-bind ((error (lambda (c) (error (make-swank-protocol-error c))))) + (let ((packet (read-packet stream))) + (handler-case (values (read-form packet) nil) + (reader-error (c) + `(:reader-error ,packet ,c)))))) ;; use peek-char to detect EOF, read-sequence may return 0 instead of ;; signaling a condition. @@ -2554,8 +2545,7 @@ (symbol-value '*buffer-package*)) *package*)) (*sldb-level* (1+ *sldb-level*)) - (*sldb-stepping-p* nil) - (*swank-state-stack* (cons :swank-debugger-hook *swank-state-stack*))) + (*sldb-stepping-p* nil)) (force-user-output) (call-with-debugging-environment (lambda () From sboukarev at common-lisp.net Thu Jan 14 14:33:59 2010 From: sboukarev at common-lisp.net (CVS User sboukarev) Date: Thu, 14 Jan 2010 09:33:59 -0500 Subject: [slime-cvs] CVS slime Message-ID: Update of /project/slime/cvsroot/slime In directory cl-net:/tmp/cvs-serv22095 Modified Files: ChangeLog Log Message: doc/slime.texi(Setting up the lisp image): (swank-loader:init) is also needed for loading swank. Reported by Evgeny Bahvalov. --- /project/slime/cvsroot/slime/ChangeLog 2010/01/13 13:45:49 1.1963 +++ /project/slime/cvsroot/slime/ChangeLog 2010/01/14 14:33:58 1.1964 @@ -1,3 +1,9 @@ +2010-01-14 Stas Boukarev + + * doc/slime.texi (Setting up the lisp image): + (swank-loader:init) is also needed for loading swank. + Reported by Evgeny Bahvalov. + 2010-01-13 Tobias C. Rittweiler * swank.lisp (*swank-state-stack*): Delete. Not needed anymore. From sboukarev at common-lisp.net Thu Jan 14 14:33:59 2010 From: sboukarev at common-lisp.net (CVS User sboukarev) Date: Thu, 14 Jan 2010 09:33:59 -0500 Subject: [slime-cvs] CVS slime/doc Message-ID: Update of /project/slime/cvsroot/slime/doc In directory cl-net:/tmp/cvs-serv22095/doc Modified Files: slime.texi Log Message: doc/slime.texi(Setting up the lisp image): (swank-loader:init) is also needed for loading swank. Reported by Evgeny Bahvalov. --- /project/slime/cvsroot/slime/doc/slime.texi 2010/01/05 09:33:09 1.93 +++ /project/slime/cvsroot/slime/doc/slime.texi 2010/01/14 14:33:59 1.94 @@ -12,7 +12,7 @@ @set EDITION 3.0-alpha @set SLIMEVER 3.0-alpha @c @set UPDATED @today{} - at set UPDATED @code{$Date: 2010/01/05 09:33:09 $} + at set UPDATED @code{$Date: 2010/01/14 14:33:59 $} @set TITLE SLIME User Manual @settitle @value{TITLE}, version @value{EDITION} @@ -1929,13 +1929,13 @@ @node Setting up the lisp image @subsection Setting up the lisp image - When you want to load swank without going through the normal, Emacs based, process just load the @file{swank-loader.lisp} file. Just execute @example (load "/path/to/swank-loader.lisp") +(swank-loader:init) @end example inside a running lisp image at footnote{@SLIME{} also provides an From sboukarev at common-lisp.net Thu Jan 14 15:53:33 2010 From: sboukarev at common-lisp.net (CVS User sboukarev) Date: Thu, 14 Jan 2010 10:53:33 -0500 Subject: [slime-cvs] CVS slime/contrib Message-ID: Update of /project/slime/cvsroot/slime/contrib In directory cl-net:/tmp/cvs-serv13317 Modified Files: ChangeLog slime-repl.el Log Message: * contrib/slime-repl.el (slime-repl-mode-map): Use both `slime-editing-map' and `lisp-mode-map' as parent keymaps. (slime-repl-mode): Don't use `slime-editing-mode' because its keymap is already used above. That way `slime-repl-mode-map' takes precedence of. `slime-editing-map'. --- /project/slime/cvsroot/slime/contrib/ChangeLog 2010/01/08 10:59:46 1.338 +++ /project/slime/cvsroot/slime/contrib/ChangeLog 2010/01/14 15:53:33 1.339 @@ -1,3 +1,12 @@ +2010-01-14 Stas Boukarev + + * slime-repl.el (slime-repl-mode-map): Use both + `slime-editing-map' and `lisp-mode-map' as parent keymaps. + (slime-repl-mode): Don't use `slime-editing-mode' because + its keymap is already used above. + That way `slime-repl-mode-map' takes precedence of. + `slime-editing-map'. + 2010-01-08 Stas Boukarev * swank-asdf.lisp: Doing list-all-systems-in-central-registry --- /project/slime/cvsroot/slime/contrib/slime-repl.el 2010/01/03 15:58:29 1.34 +++ /project/slime/cvsroot/slime/contrib/slime-repl.el 2010/01/14 15:53:33 1.35 @@ -413,7 +413,8 @@ (defvar slime-repl-mode-map (let ((map (make-sparse-keymap))) - (set-keymap-parent map lisp-mode-map) + (set-keymap-parent map + (append slime-editing-map lisp-mode-map)) map)) (slime-define-keys slime-prefix-map @@ -492,7 +493,6 @@ 'slime-repl-mode-beginning-of-defun) (set (make-local-variable 'end-of-defun-function) 'slime-repl-mode-end-of-defun) - (slime-editing-mode 1) (slime-run-mode-hooks 'slime-repl-mode-hook)) (defun slime-repl-buffer (&optional create connection) From sboukarev at common-lisp.net Thu Jan 14 21:53:11 2010 From: sboukarev at common-lisp.net (CVS User sboukarev) Date: Thu, 14 Jan 2010 16:53:11 -0500 Subject: [slime-cvs] CVS slime/contrib Message-ID: Update of /project/slime/cvsroot/slime/contrib In directory cl-net:/tmp/cvs-serv17185 Modified Files: ChangeLog slime-repl.el Log Message: * contrib/slime-repl.el: Revert the previous change because it didn't work in some cases. (slime-repl-map-mode): New minor mode which sole purpose is to enable `slime-repl-mode-map'. (slime-repl-mode): Enable `slime-repl-map-mode' after enabling `slime-editing-map'. This will finally allow `slime-repl-mode-map' to take precedence of `slime-editing-map'. --- /project/slime/cvsroot/slime/contrib/ChangeLog 2010/01/14 15:53:33 1.339 +++ /project/slime/cvsroot/slime/contrib/ChangeLog 2010/01/14 21:53:11 1.340 @@ -1,10 +1,21 @@ 2010-01-14 Stas Boukarev + * slime-repl.el: Revert the previous change because it + didn't work in some cases. + (slime-repl-map-mode): New minor mode which sole purpose is to + enable `slime-repl-mode-map'. + (slime-repl-mode): Enable `slime-repl-map-mode' after enabling + `slime-editing-map'. + This will finally allow `slime-repl-mode-map' to take precedence of + `slime-editing-map'. + +2010-01-14 Stas Boukarev + * slime-repl.el (slime-repl-mode-map): Use both `slime-editing-map' and `lisp-mode-map' as parent keymaps. (slime-repl-mode): Don't use `slime-editing-mode' because its keymap is already used above. - That way `slime-repl-mode-map' takes precedence of. + That way `slime-repl-mode-map' takes precedence of `slime-editing-map'. 2010-01-08 Stas Boukarev --- /project/slime/cvsroot/slime/contrib/slime-repl.el 2010/01/14 15:53:33 1.35 +++ /project/slime/cvsroot/slime/contrib/slime-repl.el 2010/01/14 21:53:11 1.36 @@ -413,8 +413,7 @@ (defvar slime-repl-mode-map (let ((map (make-sparse-keymap))) - (set-keymap-parent map - (append slime-editing-map lisp-mode-map)) + (set-keymap-parent map lisp-mode-map) map)) (slime-define-keys slime-prefix-map @@ -465,6 +464,13 @@ "SLIME Read-Eval-Print-Loop." (slime-output-buffer)) +(define-minor-mode slime-repl-map-mode + "Minor mode which makes slime-repl-mode-map available. +\\{slime-repl-mode-map}" + nil + nil + slime-repl-mode-map) + (defun slime-repl-mode () "Major mode for interacting with a superior Lisp. \\{slime-repl-mode-map}" @@ -472,6 +478,8 @@ (kill-all-local-variables) (setq major-mode 'slime-repl-mode) (use-local-map slime-repl-mode-map) + (slime-editing-mode 1) + (slime-repl-map-mode 1) (lisp-mode-variables t) (set (make-local-variable 'lisp-indent-function) 'common-lisp-indent-function) From tnorderhaug at common-lisp.net Mon Jan 18 23:20:34 2010 From: tnorderhaug at common-lisp.net (CVS User tnorderhaug) Date: Mon, 18 Jan 2010 18:20:34 -0500 Subject: [slime-cvs] CVS slime Message-ID: Update of /project/slime/cvsroot/slime In directory cl-net:/tmp/cvs-serv28544 Modified Files: swank-loader.lisp Added Files: swank-rpc.lisp Log Message: Refactorizing RPC layer into new module. --- /project/slime/cvsroot/slime/swank-loader.lisp 2009/12/03 15:41:05 1.96 +++ /project/slime/cvsroot/slime/swank-loader.lisp 2010/01/18 23:20:34 1.97 @@ -182,7 +182,7 @@ :defaults src-dir)) names)) -(defvar *swank-files* `(swank-backend ,@*sysdep-files* swank-match swank)) +(defvar *swank-files* `(swank-backend ,@*sysdep-files* swank-match swank swank-rpc)) (defvar *contribs* '(swank-c-p-c swank-arglists swank-fuzzy swank-fancy-inspector --- /project/slime/cvsroot/slime/swank-rpc.lisp 2010/01/18 23:20:35 NONE +++ /project/slime/cvsroot/slime/swank-rpc.lisp 2010/01/18 23:20:35 1.1 ;;; -*- indent-tabs-mode:nil coding:latin-1-unix -*- ;;; ;;; swank-rpc.lisp -- Pass remote calls and responses between lisp systems. ;;; ;;; Created 2010, Terje Norderhaug ;;; ;;; This code has been placed in the Public Domain. All warranties ;;; are disclaimed. ;;; (in-package :swank) ;;;;; Input (defun simple-read () "Reads a form that conforms to the protocol, otherwise signalling an error." (let ((c (read-char))) (case c (#\" (with-output-to-string (*standard-output*) (loop for c = (read-char) do (case c (#\" (return)) (#\\ (write-char (read-char))) (t (write-char c)))))) (#\( (loop collect (simple-read) while (ecase (read-char) (#\) nil) (#\space t)))) (#\' `(quote ,(simple-read))) (t (let ((string (with-output-to-string (*standard-output*) (loop for ch = c then (read-char nil nil) do (case ch ((nil) (return)) (#\\ (write-char (read-char))) ((#\space #\)) (unread-char ch)(return)) (t (write-char ch))))))) (cond ((digit-char-p c) (parse-integer string)) ((intern string)))))))) (defun decode-message (stream) "Read an S-expression from STREAM using the SLIME protocol." ;;(log-event "decode-message~%") (handler-bind ((error (lambda (c) (error (make-swank-protocol-error c))))) (let ((packet (read-packet stream))) (handler-case (values (read-form packet) nil) (reader-error (c) `(:reader-error ,packet ,c)))))) ;; use peek-char to detect EOF, read-sequence may return 0 instead of ;; signaling a condition. (defun read-packet (stream) (peek-char nil stream) (let* ((header (read-chunk stream 6)) (length (parse-integer header :radix #x10)) (payload (read-chunk stream length))) (log-event "READ: ~S~%" payload) payload)) (defun read-chunk (stream length) (let* ((buffer (make-string length)) (count (read-sequence buffer stream))) (assert (= count length) () "Short read: length=~D count=~D" length count) buffer)) (defvar *swank-io-package* (let ((package (make-package :swank-io-package :use '()))) (import '(nil t quote) package) package)) (defparameter *validate-input* NIL "Set to true to require input that strictly conforms to the protocol") (defun read-form (string) (with-standard-io-syntax (let ((*package* *swank-io-package*)) (if *validate-input* (with-input-from-string (*standard-input* string) (simple-read)) (read-from-string string))))) ;;;;; Output (defun encode-message (message stream) (handler-bind ((error (lambda (c) (error (make-swank-protocol-error c))))) (let* ((string (prin1-to-string-for-emacs message)) (length (length string))) (log-event "WRITE: ~A~%" string) (let ((*print-pretty* nil)) (format stream "~6,'0x" length)) (write-string string stream) (finish-output stream)))) (defun prin1-to-string-for-emacs (object) (with-standard-io-syntax (let ((*print-case* :downcase) (*print-readably* nil) (*print-pretty* nil) (*package* *swank-io-package*)) (prin1-to-string object)))) ;;;;; message decomposition (defmacro destructure-case (value &rest patterns) "Dispatch VALUE to one of PATTERNS. A cross between `case' and `destructuring-bind'. The pattern syntax is: ((HEAD . ARGS) . BODY) The list of patterns is searched for a HEAD `eq' to the car of VALUE. If one is found, the BODY is executed with ARGS bound to the corresponding values in the CDR of VALUE." (let ((operator (gensym "op-")) (operands (gensym "rand-")) (tmp (gensym "tmp-"))) `(let* ((,tmp ,value) (,operator (car ,tmp)) (,operands (cdr ,tmp))) (case ,operator ,@(loop for (pattern . body) in patterns collect (if (eq pattern t) `(t , at body) (destructuring-bind (op &rest rands) pattern `(,op (destructuring-bind ,rands ,operands , at body))))) ,@(if (eq (caar (last patterns)) t) '() `((t (error "destructure-case failed: ~S" ,tmp)))))))) ;;;;; Error handling ;; A condition to include backtrace information (define-condition swank-protocol-error (error) ((condition :initarg :condition :reader swank-protocol-error.condition) (backtrace :initarg :backtrace :reader swank-protocol-error.backtrace)) (:report (lambda (condition stream) (princ (swank-protocol-error.condition condition) stream)))) (defun make-swank-protocol-error (condition) (make-condition 'swank-protocol-error :condition condition :backtrace (safe-backtrace))) ;;;;; Logging (defvar *log-events* nil) (defvar *log-output* nil) ; should be nil for image dumpers (defun init-log-output () (unless *log-output* (setq *log-output* (real-output-stream *error-output*)))) (defun real-input-stream (stream) (typecase stream (synonym-stream (real-input-stream (symbol-value (synonym-stream-symbol stream)))) (two-way-stream (real-input-stream (two-way-stream-input-stream stream))) (t stream))) (defun real-output-stream (stream) (typecase stream (synonym-stream (real-output-stream (symbol-value (synonym-stream-symbol stream)))) (two-way-stream (real-output-stream (two-way-stream-output-stream stream))) (t stream))) (defvar *event-history* (make-array 40 :initial-element nil) "A ring buffer to record events for better error messages.") (defvar *event-history-index* 0) (defvar *enable-event-history* t) (defun log-event (format-string &rest args) "Write a message to *terminal-io* when *log-events* is non-nil. Useful for low level debugging." (with-standard-io-syntax (let ((*print-readably* nil) (*print-pretty* nil) (*package* *swank-io-package*)) (when *enable-event-history* (setf (aref *event-history* *event-history-index*) (format nil "~?" format-string args)) (setf *event-history-index* (mod (1+ *event-history-index*) (length *event-history*)))) (when *log-events* (write-string (escape-non-ascii (format nil "~?" format-string args)) *log-output*) (force-output *log-output*))))) (defun event-history-to-list () "Return the list of events (older events first)." (let ((arr *event-history*) (idx *event-history-index*)) (concatenate 'list (subseq arr idx) (subseq arr 0 idx)))) (defun clear-event-history () (fill *event-history* nil) (setq *event-history-index* 0)) (defun dump-event-history (stream) (dolist (e (event-history-to-list)) (dump-event e stream))) (defun dump-event (event stream) (cond ((stringp event) (write-string (escape-non-ascii event) stream)) ((null event)) (t (write-string (escape-non-ascii (format nil "Unexpected event: ~A~%" event)) stream)))) (defun escape-non-ascii (string) "Return a string like STRING but with non-ascii chars escaped." (cond ((ascii-string-p string) string) (t (with-output-to-string (out) (loop for c across string do (cond ((ascii-char-p c) (write-char c out)) (t (format out "\\x~4,'0X" (char-code c))))))))) (defun ascii-string-p (o) (and (stringp o) (every #'ascii-char-p o))) (defun ascii-char-p (c) (<= (char-code c) 127)) #| TEST/DEMO: (setf *log-events* T) (defparameter *transport* (with-output-to-string (out) (encode-message '(:message (hello "world")) out) (encode-message '(:return 5) out) (encode-message '(:emacs-rex NIL) out))) *transport* (with-input-from-string (in *transport*) (loop while (peek-char T in NIL) collect (decode-message in))) |# From tnorderhaug at common-lisp.net Tue Jan 19 18:22:19 2010 From: tnorderhaug at common-lisp.net (CVS User tnorderhaug) Date: Tue, 19 Jan 2010 13:22:19 -0500 Subject: [slime-cvs] CVS slime Message-ID: Update of /project/slime/cvsroot/slime In directory cl-net:/tmp/cvs-serv17560 Modified Files: .cvsignore Log Message: CVS ignores .DS_Store files on Macintosh --- /project/slime/cvsroot/slime/.cvsignore 2007/04/08 19:23:57 1.5 +++ /project/slime/cvsroot/slime/.cvsignore 2010/01/19 18:22:19 1.6 @@ -4,3 +4,4 @@ *.lx64fsl *.elc _darcs +.DS_Store \ No newline at end of file From tnorderhaug at common-lisp.net Tue Jan 19 19:41:01 2010 From: tnorderhaug at common-lisp.net (CVS User tnorderhaug) Date: Tue, 19 Jan 2010 14:41:01 -0500 Subject: [slime-cvs] CVS slime Message-ID: Update of /project/slime/cvsroot/slime In directory cl-net:/tmp/cvs-serv4556 Modified Files: swank-loader.lisp swank-rpc.lisp swank.lisp Log Message: New swank-rpc package Use swank-rpc in swank package. --- /project/slime/cvsroot/slime/swank-loader.lisp 2010/01/18 23:20:34 1.97 +++ /project/slime/cvsroot/slime/swank-loader.lisp 2010/01/19 19:41:00 1.98 @@ -182,7 +182,7 @@ :defaults src-dir)) names)) -(defvar *swank-files* `(swank-backend ,@*sysdep-files* swank-match swank swank-rpc)) +(defvar *swank-files* `(swank-backend ,@*sysdep-files* swank-match swank-rpc swank)) (defvar *contribs* '(swank-c-p-c swank-arglists swank-fuzzy swank-fancy-inspector --- /project/slime/cvsroot/slime/swank-rpc.lisp 2010/01/18 23:20:34 1.1 +++ /project/slime/cvsroot/slime/swank-rpc.lisp 2010/01/19 19:41:01 1.2 @@ -8,7 +8,39 @@ ;;; are disclaimed. ;;; -(in-package :swank) +(defpackage :swank-rpc + (:export + ; export everything for compatibility, need to be trimmed down! + #:decode-message + #:read-packet + #:read-chunk + #:*swank-io-package* + #:read-form + #:encode-message + #:prin1-to-string-for-emacs + #:destructure-case + #:swank-protocol-error + #:swank-protocol-error.condition + #:swank-protocol-error.backtrace + #:make-swank-protocol-error + #:*log-events* + #:*log-output* + #:init-log-output + #:real-input-stream + #:real-output-stream + #:*event-history* + #:*event-history-index* + #:*enable-event-history* + #:log-event + #:event-history-to-list + #:clear-event-history + #:dump-event-history + #:dump-event + #:escape-non-ascii + #:ascii-string-p + #:ascii-char-p)) + +(in-package :swank-rpc) ;;;;; Input @@ -135,8 +167,9 @@ (princ (swank-protocol-error.condition condition) stream)))) (defun make-swank-protocol-error (condition) - (make-condition 'swank-protocol-error :condition condition - :backtrace (safe-backtrace))) + (make-condition 'swank-protocol-error :condition condition + ; should be eliminated from here and covered in swank module: + :backtrace (funcall (intern "SAFE-BACKTRACE" "SWANK")))) ;;;;; Logging --- /project/slime/cvsroot/slime/swank.lisp 2010/01/13 13:45:49 1.683 +++ /project/slime/cvsroot/slime/swank.lisp 2010/01/19 19:41:01 1.684 @@ -13,7 +13,7 @@ ;;; available to us here via the `SWANK-BACKEND' package. (defpackage :swank - (:use :cl :swank-backend :swank-match) + (:use :cl :swank-backend :swank-match :swank-rpc) (:export #:startup-multiprocessing #:start-server #:create-server From sboukarev at common-lisp.net Tue Jan 19 20:13:59 2010 From: sboukarev at common-lisp.net (CVS User sboukarev) Date: Tue, 19 Jan 2010 15:13:59 -0500 Subject: [slime-cvs] CVS slime Message-ID: Update of /project/slime/cvsroot/slime In directory cl-net:/tmp/cvs-serv16048 Modified Files: ChangeLog swank-rpc.lisp Log Message: * swank-rpc.lisp (:swank-rpc): (:use :cl), SBCL doesn't use it by default. --- /project/slime/cvsroot/slime/ChangeLog 2010/01/14 14:33:58 1.1964 +++ /project/slime/cvsroot/slime/ChangeLog 2010/01/19 20:13:58 1.1965 @@ -1,3 +1,8 @@ +2010-01-19 Stas Boukarev + + * swank-rpc.lisp (:swank-rpc): (:use :cl), SBCL + doesn't use it by default. + 2010-01-14 Stas Boukarev * doc/slime.texi (Setting up the lisp image): --- /project/slime/cvsroot/slime/swank-rpc.lisp 2010/01/19 19:41:01 1.2 +++ /project/slime/cvsroot/slime/swank-rpc.lisp 2010/01/19 20:13:58 1.3 @@ -9,6 +9,7 @@ ;;; (defpackage :swank-rpc + (:use :cl) (:export ; export everything for compatibility, need to be trimmed down! #:decode-message From tnorderhaug at common-lisp.net Tue Jan 19 21:14:23 2010 From: tnorderhaug at common-lisp.net (CVS User tnorderhaug) Date: Tue, 19 Jan 2010 16:14:23 -0500 Subject: [slime-cvs] CVS slime Message-ID: Update of /project/slime/cvsroot/slime In directory cl-net:/tmp/cvs-serv528 Modified Files: swank.lisp Log Message: Deleted redundant definitions covered by swank-rpc. --- /project/slime/cvsroot/slime/swank.lisp 2010/01/19 19:41:01 1.684 +++ /project/slime/cvsroot/slime/swank.lisp 2010/01/19 21:14:23 1.685 @@ -82,11 +82,6 @@ (defvar *auto-abbreviate-dotted-packages* t "Abbreviate dotted package names to their last component if T.") -(defvar *swank-io-package* - (let ((package (make-package :swank-io-package :use '()))) - (import '(nil t quote) package) - package)) - (defconstant default-server-port 4005 "The default TCP port for the server (when started manually).") @@ -324,17 +319,6 @@ (defslimefun ping (tag) tag) -;; A condition to include backtrace information -(define-condition swank-protocol-error (error) - ((condition :initarg :condition :reader swank-protocol-error.condition) - (backtrace :initarg :backtrace :reader swank-protocol-error.backtrace)) - (:report (lambda (condition stream) - (princ (swank-protocol-error.condition condition) stream)))) - -(defun make-swank-protocol-error (condition) - (make-condition 'swank-protocol-error :condition condition - :backtrace (safe-backtrace))) - (defun safe-backtrace () (ignore-errors (call-with-debugging-environment @@ -452,31 +436,6 @@ (check-type msg string) `(call-with-retry-restart ,msg #'(lambda () , at body))) -(defmacro destructure-case (value &rest patterns) - "Dispatch VALUE to one of PATTERNS. -A cross between `case' and `destructuring-bind'. -The pattern syntax is: - ((HEAD . ARGS) . BODY) -The list of patterns is searched for a HEAD `eq' to the car of -VALUE. If one is found, the BODY is executed with ARGS bound to the -corresponding values in the CDR of VALUE." - (let ((operator (gensym "op-")) - (operands (gensym "rand-")) - (tmp (gensym "tmp-"))) - `(let* ((,tmp ,value) - (,operator (car ,tmp)) - (,operands (cdr ,tmp))) - (case ,operator - ,@(loop for (pattern . body) in patterns collect - (if (eq pattern t) - `(t , at body) - (destructuring-bind (op &rest rands) pattern - `(,op (destructuring-bind ,rands ,operands - , at body))))) - ,@(if (eq (caar (last patterns)) t) - '() - `((t (error "destructure-case failed: ~S" ,tmp)))))))) - (defmacro with-struct* ((conc-name get obj) &body body) (let ((var (gensym))) `(let ((,var ,obj)) @@ -520,91 +479,8 @@ ;;;;; Logging -(defvar *log-events* nil) -(defvar *log-output* nil) ; should be nil for image dumpers - -(defun init-log-output () - (unless *log-output* - (setq *log-output* (real-output-stream *error-output*)))) - -(defun real-input-stream (stream) - (typecase stream - (synonym-stream - (real-input-stream (symbol-value (synonym-stream-symbol stream)))) - (two-way-stream - (real-input-stream (two-way-stream-input-stream stream))) - (t stream))) - -(defun real-output-stream (stream) - (typecase stream - (synonym-stream - (real-output-stream (symbol-value (synonym-stream-symbol stream)))) - (two-way-stream - (real-output-stream (two-way-stream-output-stream stream))) - (t stream))) - (add-hook *after-init-hook* 'init-log-output) -(defvar *event-history* (make-array 40 :initial-element nil) - "A ring buffer to record events for better error messages.") -(defvar *event-history-index* 0) -(defvar *enable-event-history* t) - -(defun log-event (format-string &rest args) - "Write a message to *terminal-io* when *log-events* is non-nil. -Useful for low level debugging." - (with-standard-io-syntax - (let ((*print-readably* nil) - (*print-pretty* nil) - (*package* *swank-io-package*)) - (when *enable-event-history* - (setf (aref *event-history* *event-history-index*) - (format nil "~?" format-string args)) - (setf *event-history-index* - (mod (1+ *event-history-index*) (length *event-history*)))) - (when *log-events* - (write-string (escape-non-ascii (format nil "~?" format-string args)) - *log-output*) - (force-output *log-output*))))) - -(defun event-history-to-list () - "Return the list of events (older events first)." - (let ((arr *event-history*) - (idx *event-history-index*)) - (concatenate 'list (subseq arr idx) (subseq arr 0 idx)))) - -(defun clear-event-history () - (fill *event-history* nil) - (setq *event-history-index* 0)) - -(defun dump-event-history (stream) - (dolist (e (event-history-to-list)) - (dump-event e stream))) - -(defun dump-event (event stream) - (cond ((stringp event) - (write-string (escape-non-ascii event) stream)) - ((null event)) - (t - (write-string - (escape-non-ascii (format nil "Unexpected event: ~A~%" event)) - stream)))) - -(defun escape-non-ascii (string) - "Return a string like STRING but with non-ascii chars escaped." - (cond ((ascii-string-p string) string) - (t (with-output-to-string (out) - (loop for c across string do - (cond ((ascii-char-p c) (write-char c out)) - (t (format out "\\x~4,'0X" (char-code c))))))))) - -(defun ascii-string-p (o) - (and (stringp o) - (every #'ascii-char-p o))) - -(defun ascii-char-p (c) - (<= (char-code c) 127)) - ;;;;; Symbols @@ -1727,36 +1603,6 @@ -(defun decode-message (stream) - "Read an S-expression from STREAM using the SLIME protocol." - ;;(log-event "decode-message~%") - (handler-bind ((error (lambda (c) (error (make-swank-protocol-error c))))) - (let ((packet (read-packet stream))) - (handler-case (values (read-form packet) nil) - (reader-error (c) - `(:reader-error ,packet ,c)))))) - -;; use peek-char to detect EOF, read-sequence may return 0 instead of -;; signaling a condition. -(defun read-packet (stream) - (peek-char nil stream) - (let* ((header (read-chunk stream 6)) - (length (parse-integer header :radix #x10)) - (payload (read-chunk stream length))) - (log-event "READ: ~S~%" payload) - payload)) - -(defun read-chunk (stream length) - (let* ((buffer (make-string length)) - (count (read-sequence buffer stream))) - (assert (= count length) () "Short read: length=~D count=~D" length count) - buffer)) - -(defun read-form (string) - (with-standard-io-syntax - (let ((*package* *swank-io-package*)) - (read-from-string string)))) - (defun input-available-p (stream) ;; return true iff we can read from STREAM without waiting or if we ;; hit EOF @@ -1773,24 +1619,6 @@ (defun send-oob-to-emacs (object) (send-to-emacs object)) -(defun encode-message (message stream) - (handler-bind ((error (lambda (c) (error (make-swank-protocol-error c))))) - (let* ((string (prin1-to-string-for-emacs message)) - (length (length string))) - (log-event "WRITE: ~A~%" string) - (let ((*print-pretty* nil)) - (format stream "~6,'0x" length)) - (write-string string stream) - (finish-output stream)))) - -(defun prin1-to-string-for-emacs (object) - (with-standard-io-syntax - (let ((*print-case* :downcase) - (*print-readably* nil) - (*print-pretty* nil) - (*package* *swank-io-package*)) - (prin1-to-string object)))) - (defun force-user-output () (force-output (connection.user-io *emacs-connection*))) From tnorderhaug at common-lisp.net Tue Jan 19 21:18:46 2010 From: tnorderhaug at common-lisp.net (CVS User tnorderhaug) Date: Tue, 19 Jan 2010 16:18:46 -0500 Subject: [slime-cvs] CVS slime Message-ID: Update of /project/slime/cvsroot/slime In directory cl-net:/tmp/cvs-serv1456 Modified Files: ChangeLog Log Message: Note refactorization of swank.lisp into new swank-rpc module. --- /project/slime/cvsroot/slime/ChangeLog 2010/01/19 20:13:58 1.1965 +++ /project/slime/cvsroot/slime/ChangeLog 2010/01/19 21:18:46 1.1966 @@ -3,6 +3,10 @@ * swank-rpc.lisp (:swank-rpc): (:use :cl), SBCL doesn't use it by default. +2010-01-19 Terje Norderhaug + + * Refactorized parts of slime.lisp into a new swank-rpc module. + 2010-01-14 Stas Boukarev * doc/slime.texi (Setting up the lisp image): From sboukarev at common-lisp.net Wed Jan 20 14:11:06 2010 From: sboukarev at common-lisp.net (CVS User sboukarev) Date: Wed, 20 Jan 2010 09:11:06 -0500 Subject: [slime-cvs] CVS slime Message-ID: Update of /project/slime/cvsroot/slime In directory cl-net:/tmp/cvs-serv11465 Modified Files: ChangeLog slime.el Log Message: * slime.el (slime-thread-kill): If the region is active, then kill all threads in the region. --- /project/slime/cvsroot/slime/ChangeLog 2010/01/19 21:18:46 1.1966 +++ /project/slime/cvsroot/slime/ChangeLog 2010/01/20 14:11:06 1.1967 @@ -1,3 +1,8 @@ +2010-01-20 Stas Boukarev + + * slime.el (slime-thread-kill): If the region is active, then + kill all threads in the region. + 2010-01-19 Stas Boukarev * swank-rpc.lisp (:swank-rpc): (:use :cl), SBCL @@ -5,8 +10,8 @@ 2010-01-19 Terje Norderhaug - * Refactorized parts of slime.lisp into a new swank-rpc module. - + * Refactorized parts of slime.lisp into a new swank-rpc module. + 2010-01-14 Stas Boukarev * doc/slime.texi (Setting up the lisp image): --- /project/slime/cvsroot/slime/slime.el 2010/01/05 21:17:52 1.1264 +++ /project/slime/cvsroot/slime/slime.el 2010/01/20 14:11:06 1.1265 @@ -6202,10 +6202,27 @@ (defun slime-thread-kill () (interactive) - (let ((id (get-text-property (point) 'thread-id))) - (slime-eval `(swank:kill-nth-thread ,id))) + (slime-eval `(cl:mapc 'swank:kill-nth-thread + ',(slime-get-properties 'thread-id))) (call-interactively 'slime-list-threads)) +(defun slime-get-region-properties (prop start end) + (loop for position = (if (get-text-property start prop) + start + (next-single-property-change start prop)) + then (next-single-property-change position prop) + while (<= position end) + collect (get-text-property position prop))) + +(defun slime-get-properties (prop) + (if (use-region-p) + (slime-get-region-properties prop + (region-beginning) + (region-end)) + (let ((value (get-text-property (point) prop))) + (when value + (list value))))) + (defun slime-thread-attach () (interactive) (let ((id (get-text-property (point) 'thread-id)) From tnorderhaug at common-lisp.net Wed Jan 20 18:10:40 2010 From: tnorderhaug at common-lisp.net (CVS User tnorderhaug) Date: Wed, 20 Jan 2010 13:10:40 -0500 Subject: [slime-cvs] CVS slime Message-ID: Update of /project/slime/cvsroot/slime In directory cl-net:/tmp/cvs-serv9556 Modified Files: swank.lisp Log Message: Refactoring to eliminate use of swank-protocol-error.backtrace. --- /project/slime/cvsroot/slime/swank.lisp 2010/01/19 21:14:23 1.685 +++ /project/slime/cvsroot/slime/swank.lisp 2010/01/20 18:10:40 1.686 @@ -330,18 +330,21 @@ to T unless you want to debug swank internals.") (defmacro with-swank-protocol-error-handler ((connection) &body body) - (let ((var (gensym))) - `(let ((,var ,connection)) + (let ((var (gensym)) + (backtrace (gensym))) + `(let ((,var ,connection) + (,backtrace)) (handler-case (handler-bind ((swank-protocol-error (lambda (condition) + (setf ,backtrace (safe-backtrace)) (when *debug-on-swank-protocol-error* (invoke-default-debugger condition))))) (progn , at body)) (swank-protocol-error (condition) (close-connection ,var (swank-protocol-error.condition condition) - (swank-protocol-error.backtrace condition))))))) + ,backtrace)))))) (defmacro with-panic-handler ((connection) &body body) (let ((var (gensym))) From tnorderhaug at common-lisp.net Wed Jan 20 18:32:28 2010 From: tnorderhaug at common-lisp.net (CVS User tnorderhaug) Date: Wed, 20 Jan 2010 13:32:28 -0500 Subject: [slime-cvs] CVS slime Message-ID: Update of /project/slime/cvsroot/slime In directory cl-net:/tmp/cvs-serv13011 Modified Files: swank-rpc.lisp Log Message: Eliminate swank-protocol-error.backtrace and call to safe-backtrace from swank-rpc. --- /project/slime/cvsroot/slime/swank-rpc.lisp 2010/01/19 20:13:58 1.3 +++ /project/slime/cvsroot/slime/swank-rpc.lisp 2010/01/20 18:32:28 1.4 @@ -22,7 +22,6 @@ #:destructure-case #:swank-protocol-error #:swank-protocol-error.condition - #:swank-protocol-error.backtrace #:make-swank-protocol-error #:*log-events* #:*log-output* @@ -160,17 +159,13 @@ ;;;;; Error handling -;; A condition to include backtrace information (define-condition swank-protocol-error (error) - ((condition :initarg :condition :reader swank-protocol-error.condition) - (backtrace :initarg :backtrace :reader swank-protocol-error.backtrace)) + ((condition :initarg :condition :reader swank-protocol-error.condition)) (:report (lambda (condition stream) (princ (swank-protocol-error.condition condition) stream)))) (defun make-swank-protocol-error (condition) - (make-condition 'swank-protocol-error :condition condition - ; should be eliminated from here and covered in swank module: - :backtrace (funcall (intern "SAFE-BACKTRACE" "SWANK")))) + (make-condition 'swank-protocol-error :condition condition)) ;;;;; Logging From sboukarev at common-lisp.net Thu Jan 21 23:21:26 2010 From: sboukarev at common-lisp.net (CVS User sboukarev) Date: Thu, 21 Jan 2010 18:21:26 -0500 Subject: [slime-cvs] CVS slime Message-ID: Update of /project/slime/cvsroot/slime In directory cl-net:/tmp/cvs-serv12597 Modified Files: ChangeLog swank-ccl.lisp Log Message: * swank-ccl.lisp (with-frame): Put this macro before it's used. --- /project/slime/cvsroot/slime/ChangeLog 2010/01/20 14:11:06 1.1967 +++ /project/slime/cvsroot/slime/ChangeLog 2010/01/21 23:21:26 1.1968 @@ -1,3 +1,7 @@ +2010-01-21 Stas Boukarev + + * swank-ccl.lisp (with-frame): Put this macro before it's used. + 2010-01-20 Stas Boukarev * slime.el (slime-thread-kill): If the region is active, then --- /project/slime/cvsroot/slime/swank-ccl.lisp 2010/01/03 15:58:29 1.13 +++ /project/slime/cvsroot/slime/swank-ccl.lisp 2010/01/21 23:21:26 1.14 @@ -434,6 +434,9 @@ (format stream " ~s" arg))))) (format stream ")")))) +(defmacro with-frame ((p context) frame-number &body body) + `(call/frame ,frame-number (lambda (,p ,context) . ,body))) + (defimplementation frame-call (frame-number) (with-frame (p context) frame-number (with-output-to-string (stream) @@ -446,8 +449,6 @@ (funcall if-found p context))) frame-number)) -(defmacro with-frame ((p context) frame-number &body body) - `(call/frame ,frame-number (lambda (,p ,context) . ,body))) (defimplementation frame-var-value (frame var) (with-frame (p context) frame From tnorderhaug at common-lisp.net Fri Jan 22 00:02:08 2010 From: tnorderhaug at common-lisp.net (CVS User tnorderhaug) Date: Thu, 21 Jan 2010 19:02:08 -0500 Subject: [slime-cvs] CVS slime Message-ID: Update of /project/slime/cvsroot/slime In directory cl-net:/tmp/cvs-serv14727 Modified Files: ChangeLog Log Message: Log refactoring that eliminated dependency on swank:safe-backtrace in swank-rpc.lisp. --- /project/slime/cvsroot/slime/ChangeLog 2010/01/21 23:21:26 1.1968 +++ /project/slime/cvsroot/slime/ChangeLog 2010/01/22 00:02:08 1.1969 @@ -2,6 +2,14 @@ * swank-ccl.lisp (with-frame): Put this macro before it's used. +2010-01-20 Terje Norderhaug + + * swank.lisp (with-swank-protocol-error-handler): Refactor using safe-backtrace. + * swank-rpc.lisp (make-swank-protocol-error): Delete call to swank:safe-backtrace + to eliminate dependency on swank.lisp module. + * swank-rpc.lisp (swank-protocol-error): Remove swank-protocol-error.backtrace + as the capture of a safe-backtrace is covered by with-swank-protocol-error-handler. + 2010-01-20 Stas Boukarev * slime.el (slime-thread-kill): If the region is active, then @@ -14,7 +22,7 @@ 2010-01-19 Terje Norderhaug - * Refactorized parts of slime.lisp into a new swank-rpc module. + * Refactorized parts of swank.lisp into a new swank-rpc module. 2010-01-14 Stas Boukarev From trittweiler at common-lisp.net Mon Jan 25 10:50:10 2010 From: trittweiler at common-lisp.net (CVS User trittweiler) Date: Mon, 25 Jan 2010 05:50:10 -0500 Subject: [slime-cvs] CVS slime Message-ID: Update of /project/slime/cvsroot/slime In directory cl-net:/tmp/cvs-serv7802 Modified Files: ChangeLog swank-allegro.lisp Log Message: * swank-allegro.lisp (redefinition-p, redefinition): New. (handle-compiler-warning): Add :severity for redefinitions, style-warnings, errors. --- /project/slime/cvsroot/slime/ChangeLog 2010/01/22 00:02:08 1.1969 +++ /project/slime/cvsroot/slime/ChangeLog 2010/01/25 10:50:10 1.1970 @@ -1,3 +1,9 @@ +2010-01-25 Tobias C. Rittweiler + + * swank-allegro.lisp (redefinition-p, redefinition): New. + (handle-compiler-warning): Add :severity for redefinitions, + style-warnings, errors. + 2010-01-21 Stas Boukarev * swank-ccl.lisp (with-frame): Put this macro before it's used. --- /project/slime/cvsroot/slime/swank-allegro.lisp 2009/12/11 03:37:17 1.130 +++ /project/slime/cvsroot/slime/swank-allegro.lisp 2010/01/25 10:50:10 1.131 @@ -233,12 +233,19 @@ (defun compiler-note-p (object) (member (type-of object) '(excl::compiler-note compiler::compiler-note))) +(defun redefinition-p (condition) + (and (typep condition 'style-warning) + (every #'char-equal "redefin" (princ-to-string condition)))) + (defun compiler-undefined-functions-called-warning-p (object) (typep object 'excl:compiler-undefined-functions-called-warning)) (deftype compiler-note () `(satisfies compiler-note-p)) +(deftype redefinition () + `(satisfies redefinition-p)) + (defun signal-compiler-condition (&rest args) (signal (apply #'make-condition 'compiler-condition args))) @@ -251,9 +258,12 @@ (signal-compiler-condition :original-condition condition :severity (etypecase condition - (warning :warning) + (redefinition :redefinition) + (style-warning :style-warning) + (warning :warning) (compiler-note :note) - (reader-error :read-error)) + (reader-error :read-error) + (error :error)) :message (format nil "~A" condition) :location (if (typep condition 'reader-error) (location-for-reader-error condition) From sboukarev at common-lisp.net Mon Jan 25 13:26:16 2010 From: sboukarev at common-lisp.net (CVS User sboukarev) Date: Mon, 25 Jan 2010 08:26:16 -0500 Subject: [slime-cvs] CVS slime/contrib Message-ID: Update of /project/slime/cvsroot/slime/contrib In directory cl-net:/tmp/cvs-serv4132 Modified Files: ChangeLog slime-package-fu.el Log Message: * contrib/slime-package-fu.el (slime-goto-next-export-clause): Use " \n\t" for `skip-chars-forward' instead of [:alpha:], because it doesn't work for some reason. (slime-search-exports-in-defpackage): take #:symbol and :symbol into account too. --- /project/slime/cvsroot/slime/contrib/ChangeLog 2010/01/14 21:53:11 1.340 +++ /project/slime/cvsroot/slime/contrib/ChangeLog 2010/01/25 13:26:15 1.341 @@ -1,3 +1,11 @@ +2010-01-25 Stas Boukarev + + * slime-package-fu.el (slime-goto-next-export-clause): Use + " \n\t" for `skip-chars-forward' instead of [:alpha:], + because it doesn't work for some reason. + (slime-search-exports-in-defpackage): take #:symbol and :symbol + into account too. + 2010-01-14 Stas Boukarev * slime-repl.el: Revert the previous change because it --- /project/slime/cvsroot/slime/contrib/slime-package-fu.el 2009/12/21 13:31:56 1.7 +++ /project/slime/cvsroot/slime/contrib/slime-package-fu.el 2010/01/25 13:26:16 1.8 @@ -94,7 +94,7 @@ (save-excursion (block nil (while (ignore-errors (slime-forward-sexp) t) - (skip-chars-forward "[:space:]") + (skip-chars-forward " \n\t") (when (slime-at-expression-p '(:export *)) (setq point (point)) (return))))) @@ -105,14 +105,17 @@ (defun slime-search-exports-in-defpackage (symbol-name) "Look if `symbol-name' is mentioned in one of the :EXPORT clauses." ;; Assumes we're inside the beginning of a DEFPACKAGE form. - (save-excursion - (block nil - (while (ignore-errors (slime-goto-next-export-clause) t) - (let ((clause-end (save-excursion (forward-sexp) (point)))) - (when (and (search-forward symbol-name clause-end t) - (equal (slime-symbol-at-point) symbol-name)) - (return (point)))))))) - + (flet ((target-symbol-p (symbol) + (string-match-p (format "^\\(\\(#:\\)\\|:\\)?%s$" + (regexp-quote symbol-name)) + symbol))) + (save-excursion + (block nil + (while (ignore-errors (slime-goto-next-export-clause) t) + (let ((clause-end (save-excursion (forward-sexp) (point)))) + (when (and (search-forward symbol-name clause-end t) + (target-symbol-p (slime-symbol-at-point))) + (return (point))))))))) (defun slime-frob-defpackage-form (current-package do-what symbol) "Adds/removes `symbol' from the DEFPACKAGE form of `current-package' From mevenson at common-lisp.net Tue Jan 26 13:29:58 2010 From: mevenson at common-lisp.net (CVS User mevenson) Date: Tue, 26 Jan 2010 08:29:58 -0500 Subject: [slime-cvs] CVS slime Message-ID: Update of /project/slime/cvsroot/slime In directory cl-net:/tmp/cvs-serv24250 Modified Files: ChangeLog swank-abcl.lisp Log Message: * swank-abcl.lisp (import-to-swank-mop): Import MOP::COMPUTE-APPLICABLE-METHODS-USING-CLASSES if it exists in the ABCL implementation. --- /project/slime/cvsroot/slime/ChangeLog 2010/01/25 10:50:10 1.1970 +++ /project/slime/cvsroot/slime/ChangeLog 2010/01/26 13:29:57 1.1971 @@ -1,3 +1,9 @@ +2010-01-26 Mark Evenson + + * swank-abcl.lisp (import-to-swank-mop): Import + MOP::COMPUTE-APPLICABLE-METHODS-USING-CLASSES if it exists in the + ABCL implementation. + 2010-01-25 Tobias C. Rittweiler * swank-allegro.lisp (redefinition-p, redefinition): New. @@ -15,7 +21,7 @@ to eliminate dependency on swank.lisp module. * swank-rpc.lisp (swank-protocol-error): Remove swank-protocol-error.backtrace as the capture of a safe-backtrace is covered by with-swank-protocol-error-handler. - + 2010-01-20 Stas Boukarev * slime.el (slime-thread-kill): If the region is active, then --- /project/slime/cvsroot/slime/swank-abcl.lisp 2010/01/11 13:23:08 1.79 +++ /project/slime/cvsroot/slime/swank-abcl.lisp 2010/01/26 13:29:58 1.80 @@ -95,6 +95,8 @@ standard-slot-definition ;;dummy cl:method cl:standard-class + #+#.(swank-backend:with-symbol 'compute-applicable-methods-using-classes 'mop) + mop::compute-applicable-methods-using-classes ;; standard-class readers mop::class-default-initargs mop::class-direct-default-initargs From sboukarev at common-lisp.net Wed Jan 27 06:38:27 2010 From: sboukarev at common-lisp.net (CVS User sboukarev) Date: Wed, 27 Jan 2010 01:38:27 -0500 Subject: [slime-cvs] CVS slime Message-ID: Update of /project/slime/cvsroot/slime In directory cl-net:/tmp/cvs-serv6353 Modified Files: ChangeLog swank-rpc.lisp Log Message: * swank-rpc.lisp: NIL -> nil (for unusual readtable settings). Spotted by Harald Hanche-Olsen. --- /project/slime/cvsroot/slime/ChangeLog 2010/01/26 13:29:57 1.1971 +++ /project/slime/cvsroot/slime/ChangeLog 2010/01/27 06:38:27 1.1972 @@ -1,3 +1,8 @@ +2010-01-27 Stas Boukarev + + * swank-rpc.lisp: NIL -> nil (for unusual readtable settings). + Spotted by Harald Hanche-Olsen. + 2010-01-26 Mark Evenson * swank-abcl.lisp (import-to-swank-mop): Import --- /project/slime/cvsroot/slime/swank-rpc.lisp 2010/01/20 18:32:28 1.4 +++ /project/slime/cvsroot/slime/swank-rpc.lisp 2010/01/27 06:38:27 1.5 @@ -99,7 +99,7 @@ (import '(nil t quote) package) package)) -(defparameter *validate-input* NIL +(defparameter *validate-input* nil "Set to true to require input that strictly conforms to the protocol") (defun read-form (string) From mevenson at common-lisp.net Thu Jan 28 09:52:19 2010 From: mevenson at common-lisp.net (CVS User mevenson) Date: Thu, 28 Jan 2010 04:52:19 -0500 Subject: [slime-cvs] CVS slime Message-ID: Update of /project/slime/cvsroot/slime In directory cl-net:/tmp/cvs-serv22368 Modified Files: ChangeLog swank-abcl.lisp Log Message: * swank-abcl.lisp (emacs-inspect): Make inspection of Java objects toString() results dependent on explicit user request to avoid potentially computationally expensive opreations. Tidy up previous ChangeLog entry to allow the Emacs cross-reference function to work. --- /project/slime/cvsroot/slime/ChangeLog 2010/01/27 06:38:27 1.1972 +++ /project/slime/cvsroot/slime/ChangeLog 2010/01/28 09:52:18 1.1973 @@ -1,3 +1,9 @@ +2010-01-28 Mark Evenson + + * swank-abcl.lisp (emacs-inspect): Make inspection of Java objects + toString() results dependent on explicit user request to avoid + potentially computationally expensive opreations. + 2010-01-27 Stas Boukarev * swank-rpc.lisp: NIL -> nil (for unusual readtable settings). @@ -5,7 +11,7 @@ 2010-01-26 Mark Evenson - * swank-abcl.lisp (import-to-swank-mop): Import + * swank-abcl.lisp: Import MOP::COMPUTE-APPLICABLE-METHODS-USING-CLASSES if it exists in the ABCL implementation. --- /project/slime/cvsroot/slime/swank-abcl.lisp 2010/01/26 13:29:58 1.80 +++ /project/slime/cvsroot/slime/swank-abcl.lisp 2010/01/28 09:52:19 1.81 @@ -557,11 +557,26 @@ slots))) |# + +;;; Although by convention toString() is supposed to be a +;;; non-computationally expensive operation this isn't always the +;;; case, so make its computation a user interaction. +(defparameter *to-string-hashtable* (make-hash-table)) (defmethod emacs-inspect ((o java:java-object)) - (append - (label-value-line "toString()" (java:jcall "toString" o)) - (loop :for (label . value) :in (sys:inspected-parts o) - :appending (label-value-line label value)))) + (let ((to-string (lambda () + (handler-case + (setf (gethash o *to-string-hashtable*) + (java:jcall "toString" o)) + (t (e) + (setf (gethash o *to-string-hashtable*) + (format nil "Could not invoke toString(): ~A" + e))))))) + (append + (if (gethash o *to-string-hashtable*) + (label-value-line "toString()" (gethash o *to-string-hashtable*)) + `((:action "[compute toString()]" ,to-string) (:newline))) + (loop :for (label . value) :in (sys:inspected-parts o) + :appending (label-value-line label value))))) ;;;; Multithreading From sboukarev at common-lisp.net Sat Jan 30 15:44:51 2010 From: sboukarev at common-lisp.net (CVS User sboukarev) Date: Sat, 30 Jan 2010 10:44:51 -0500 Subject: [slime-cvs] CVS slime Message-ID: Update of /project/slime/cvsroot/slime In directory cl-net:/tmp/cvs-serv4559 Modified Files: ChangeLog swank.lisp Log Message: * swank.lisp (pathname-as-directory): Treat "/foo/bar" and "/foo/bar/" the same. (compile-file-output): Use the above function. --- /project/slime/cvsroot/slime/ChangeLog 2010/01/28 09:52:18 1.1973 +++ /project/slime/cvsroot/slime/ChangeLog 2010/01/30 15:44:50 1.1974 @@ -1,3 +1,9 @@ +2010-01-30 Stas Boukarev + + * swank.lisp (pathname-as-directory): Treat "/foo/bar" and "/foo/bar/" + the same. + (compile-file-output): Use the above function. + 2010-01-28 Mark Evenson * swank-abcl.lisp (emacs-inspect): Make inspection of Java objects --- /project/slime/cvsroot/slime/swank.lisp 2010/01/20 18:10:40 1.686 +++ /project/slime/cvsroot/slime/swank.lisp 2010/01/30 15:44:50 1.687 @@ -2670,8 +2670,13 @@ (defvar *fasl-pathname-function* nil "In non-nil, use this function to compute the name for fasl-files.") +(defun pathname-as-directory (pathname) + (append (pathname-directory pathname) + (when (pathname-name pathname) + (list (file-namestring pathname))))) + (defun compile-file-output (file directory) - (make-pathname :directory directory + (make-pathname :directory (pathname-as-directory directory) :defaults (compile-file-pathname file))) (defun fasl-pathname (input-file options) From sboukarev at common-lisp.net Sat Jan 30 15:59:52 2010 From: sboukarev at common-lisp.net (CVS User sboukarev) Date: Sat, 30 Jan 2010 10:59:52 -0500 Subject: [slime-cvs] CVS slime Message-ID: Update of /project/slime/cvsroot/slime In directory cl-net:/tmp/cvs-serv8234 Modified Files: ChangeLog slime.el Log Message: * slime.el (slime-cycle-connections): Change docstring, it doesn't make connection buffer-local. * doc/slime.texi (Multiple connections): document slime-cycle-connections. --- /project/slime/cvsroot/slime/ChangeLog 2010/01/30 15:44:50 1.1974 +++ /project/slime/cvsroot/slime/ChangeLog 2010/01/30 15:59:52 1.1975 @@ -1,5 +1,10 @@ 2010-01-30 Stas Boukarev + * slime.el (slime-cycle-connections): Change docstring, it + doesn't make connection buffer-local. + * doc/slime.texi (Multiple connections): document + slime-cycle-connections. + * swank.lisp (pathname-as-directory): Treat "/foo/bar" and "/foo/bar/" the same. (compile-file-output): Use the above function. @@ -8,7 +13,7 @@ * swank-abcl.lisp (emacs-inspect): Make inspection of Java objects toString() results dependent on explicit user request to avoid - potentially computationally expensive opreations. + potentially computationally expensive operations. 2010-01-27 Stas Boukarev --- /project/slime/cvsroot/slime/slime.el 2010/01/20 14:11:06 1.1265 +++ /project/slime/cvsroot/slime/slime.el 2010/01/30 15:59:52 1.1266 @@ -1822,7 +1822,7 @@ (setq slime-default-connection process)) (defun slime-cycle-connections () - "Change current slime connection, and make it buffer local." + "Change current slime connection cycling through all connection." (interactive) (let* ((tail (or (cdr (member (slime-current-connection) slime-net-processes)) From sboukarev at common-lisp.net Sat Jan 30 15:59:52 2010 From: sboukarev at common-lisp.net (CVS User sboukarev) Date: Sat, 30 Jan 2010 10:59:52 -0500 Subject: [slime-cvs] CVS slime/doc Message-ID: Update of /project/slime/cvsroot/slime/doc In directory cl-net:/tmp/cvs-serv8234/doc Modified Files: slime.texi Log Message: * slime.el (slime-cycle-connections): Change docstring, it doesn't make connection buffer-local. * doc/slime.texi (Multiple connections): document slime-cycle-connections. --- /project/slime/cvsroot/slime/doc/slime.texi 2010/01/14 14:33:59 1.94 +++ /project/slime/cvsroot/slime/doc/slime.texi 2010/01/30 15:59:52 1.95 @@ -12,7 +12,7 @@ @set EDITION 3.0-alpha @set SLIMEVER 3.0-alpha @c @set UPDATED @today{} - at set UPDATED @code{$Date: 2010/01/14 14:33:59 $} + at set UPDATED @code{$Date: 2010/01/30 15:59:52 $} @set TITLE SLIME User Manual @settitle @value{TITLE}, version @value{EDITION} @@ -1589,7 +1589,9 @@ @table @kbd @kbditem{C-c C-x c, slime-list-connections} Pop up a buffer listing the established connections. - +It's also avaiable from (@pxref{slime-selector}) by the key @kbd{c} + at kbditem{, slime-cycle-connections} +Change current slime connection cycling through all connection. @kbditem{C-c C-x t, slime-list-threads} Pop up a buffer listing the current threads. From trittweiler at common-lisp.net Sun Jan 31 19:07:54 2010 From: trittweiler at common-lisp.net (CVS User trittweiler) Date: Sun, 31 Jan 2010 14:07:54 -0500 Subject: [slime-cvs] CVS slime Message-ID: Update of /project/slime/cvsroot/slime In directory cl-net:/tmp/cvs-serv23088 Modified Files: ChangeLog hyperspec.el Log Message: * hyperspec.el: When using C-c C-d ~ TAB, previously there were entries for "C" and "C: Character", which unpleasingly crowded the completion buffer, so I made it show one entry ("C - Character") only. RIP, erik. --- /project/slime/cvsroot/slime/ChangeLog 2010/01/30 15:59:52 1.1975 +++ /project/slime/cvsroot/slime/ChangeLog 2010/01/31 19:07:54 1.1976 @@ -1,3 +1,10 @@ +2010-01-31 Tobias C. Rittweiler + + * hyperspec.el: When using C-c C-d ~ TAB, previously there were + entries for "C" and "C: Character", which unpleasingly crowded the + completion buffer, so I made it show one entry ("C - Character") + only. RIP, erik. + 2010-01-30 Stas Boukarev * slime.el (slime-cycle-connections): Change docstring, it --- /project/slime/cvsroot/slime/hyperspec.el 2009/03/09 11:06:38 1.15 +++ /project/slime/cvsroot/slime/hyperspec.el 2010/01/31 19:07:54 1.16 @@ -1257,54 +1257,60 @@ (eval-when (load eval) (defalias 'hyperspec-lookup-format 'common-lisp-hyperspec-format)) +;;; Previously there were entries for "C" and "C: Character", +;;; which unpleasingly crowded the completion buffer, so I made +;;; it show one entry ("C - Character") only. +;;; +;;; 20100131 Tobias C Rittweiler + +(defun intern-clhs-format-directive (char section &optional summary) + (let* ((designator (if summary (format "%s - %s" char summary) char)) + (symbol (intern designator common-lisp-hyperspec-format-characters))) + (if (boundp symbol) + (pushnew section (symbol-value symbol) :test 'equal) + (set symbol (list section))))) + (mapcar (lambda (entry) - (let ((symbol (intern (car entry) - common-lisp-hyperspec-format-characters))) - (if (boundp symbol) - (pushnew (cadr entry) (symbol-value symbol) :test 'equal) - (set symbol (cdr entry)))) - (when (and (= 1 (length (car entry))) - (not (string-equal (car entry) (upcase (car entry))))) - (let ((symbol (intern (upcase (car entry)) - common-lisp-hyperspec-format-characters))) - (if (boundp symbol) - (pushnew (cadr entry) (symbol-value symbol) :test 'equal) - (set symbol (cdr entry)))))) - '(("c" (22 3 1 1)) ("C: Character" (22 3 1 1)) - ("%" (22 3 1 2)) ("Percent: Newline" (22 3 1 2)) - ("&" (22 3 1 3)) ("Ampersand: Fresh-line" (22 3 1 3)) - ("|" (22 3 1 4)) ("Vertical-Bar: Page" (22 3 1 4)) - ("~" (22 3 1 5)) ("Tilde: Tilde" (22 3 1 5)) - ("r" (22 3 2 1)) ("R: Radix" (22 3 2 1)) - ("d" (22 3 2 2)) ("D: Decimal" (22 3 2-2)) - ("b" (22 3 2 3)) ("B: Binary" (22 3 2 3)) - ("o" (22 3 2 4)) ("O: Octal" (22 3 2 4)) - ("x" (22 3 2 5)) ("X: Hexadecimal" (22 3 2 5)) - ("f" (22 3 3 1)) ("F: Fixed-Format Floating-Point" (22 3 3 1)) - ("e" (22 3 3 2)) ("E: Exponential Floating-Point" (22 3 3 2)) - ("g" (22 3 3 3)) ("G: General Floating-Point" (22 3 3 3)) - ("$" (22 3 3 4)) ("Dollarsign: Monetary Floating-Point" (22 3 3 4)) - ("a" (22 3 4 1)) ("A: Aesthetic" (22 3 4 1)) - ("s" (22 3 4 2)) ("S: Standard" (22 3 4 2)) - ("w" (22 3 4 3)) ("W: Write" (22 3 4 3)) - ("_" (22 3 5 1)) ("Underscore: Conditional Newline" (22 3 5 1)) - ("<" (22 3 5 2)) ("Less-Than-Sign: Logical Block" (22 3 5 2)) - ("i" (22 3 5 3)) ("I: Indent" (22 3 5 3)) - ("/" (22 3 5 4)) ("Slash: Call Function" (22 3 5 4)) - ("t" (22 3 6 1)) ("T: Tabulate" (22 3 6 1)) - ("<" (22 3 6 2)) ("Less-Than-Sign: Justification" (22 3 6 2)) - (">" (22 3 6 3)) ("Greater-Than-Sign: End of Justification" (22 3 6 3)) - ("*" (22 3 7 1)) ("Asterisk: Go-To" (22 3 7 1)) - ("[" (22 3 7 2)) ("Left-Bracket: Conditional Expression" (22 3 7 2)) - ("]" (22 3 7 3)) ("Right-Bracket: End of Conditional Expression" (22 3 7 3)) - ("{" (22 3 7 4)) ("Left-Brace: Iteration" (22 3 7 4)) - ("}" (22 3 7 5)) ("Right-Brace: End of Iteration" (22 3 7 5)) - ("?" (22 3 7 6)) ("Question-Mark: Recursive Processing" (22 3 7 6)) - ("(" (22 3 8 1)) ("Left-Paren: Case Conversion" (22 3 8 1)) - (")" (22 3 8 2)) ("Right-Paren: End of Case Conversion" (22 3 8 2)) - ("p" (22 3 8 3)) ("P: Plural" (22 3 8-3)) - (";" (22 3 9 1)) ("Semicolon: Clause Separator" (22 3 9 1)) - ("^" (22 3 9 2)) ("Circumflex: Escape Upward" (22 3 9 2)) + (destructuring-bind (char section &optional summary) entry + (intern-clhs-format-directive char section summary) + (when (and (= 1 (length char)) + (not (string-equal char (upcase char)))) + (intern-clhs-format-directive (upcase char) section summary)))) + '(("c" (22 3 1 1) "Character") + ("%" (22 3 1 2) "Newline") + ("&" (22 3 1 3) "Fresh-line") + ("|" (22 3 1 4) "Page") + ("~" (22 3 1 5) "Tilde") + ("r" (22 3 2 1) "Radix") + ("d" (22 3 2 2) "Decimal") + ("b" (22 3 2 3) "Binary") + ("o" (22 3 2 4) "Octal") + ("x" (22 3 2 5) "Hexadecimal") + ("f" (22 3 3 1) "Fixed-Format Floating-Point") + ("e" (22 3 3 2) "Exponential Floating-Point") + ("g" (22 3 3 3) "General Floating-Point") + ("$" (22 3 3 4) "Monetary Floating-Point") + ("a" (22 3 4 1) "Aesthetic") + ("s" (22 3 4 2) "Standard") + ("w" (22 3 4 3) "Write") + ("_" (22 3 5 1) "Conditional Newline") + ("<" (22 3 5 2) "Logical Block") + ("i" (22 3 5 3) "Indent") + ("/" (22 3 5 4) "Call Function") + ("t" (22 3 6 1) "Tabulate") + ("<" (22 3 6 2) "Justification") + (">" (22 3 6 3) "End of Justification") + ("*" (22 3 7 1) "Go-To") + ("[" (22 3 7 2) "Conditional Expression") + ("]" (22 3 7 3) "End of Conditional Expression") + ("{" (22 3 7 4) "Iteration") + ("}" (22 3 7 5) "End of Iteration") + ("?" (22 3 7 6) "Recursive Processing") + ("(" (22 3 8 1) "Case Conversion") + (")" (22 3 8 2) "End of Case Conversion") + ("p" (22 3 8 3) "Plural") + (";" (22 3 9 1) "Clause Separator") + ("^" (22 3 9 2) "Escape Upward") ("Newline: Ignored Newline" (22 3 9 3)) ("Nesting of FORMAT Operations" (22 3 10 1)) ("Missing and Additional FORMAT Arguments" (22 3 10 2)) From sboukarev at common-lisp.net Sun Jan 31 20:17:27 2010 From: sboukarev at common-lisp.net (CVS User sboukarev) Date: Sun, 31 Jan 2010 15:17:27 -0500 Subject: [slime-cvs] CVS slime/contrib Message-ID: Update of /project/slime/cvsroot/slime/contrib In directory cl-net:/tmp/cvs-serv14750 Modified Files: ChangeLog slime-repl.el Log Message: * slime-repl.el (slime-repl-mode): Don't do (use-local-map slime-repl-mode-map) because it will be used through slime-repl-map-mode minor mode. This fixes double entries in the menu bar. Reported by RaceCondition from #lisp. --- /project/slime/cvsroot/slime/contrib/ChangeLog 2010/01/25 13:26:15 1.341 +++ /project/slime/cvsroot/slime/contrib/ChangeLog 2010/01/31 20:17:27 1.342 @@ -1,3 +1,11 @@ +2010-01-31 Stas Boukarev + + * slime-repl.el (slime-repl-mode): Don't do + (use-local-map slime-repl-mode-map) because it will be used + through slime-repl-map-mode minor mode. + This fixes double entries in the menu bar. + Reported by RaceCondition from #lisp. + 2010-01-25 Stas Boukarev * slime-package-fu.el (slime-goto-next-export-clause): Use --- /project/slime/cvsroot/slime/contrib/slime-repl.el 2010/01/14 21:53:11 1.36 +++ /project/slime/cvsroot/slime/contrib/slime-repl.el 2010/01/31 20:17:27 1.37 @@ -477,7 +477,6 @@ (interactive) (kill-all-local-variables) (setq major-mode 'slime-repl-mode) - (use-local-map slime-repl-mode-map) (slime-editing-mode 1) (slime-repl-map-mode 1) (lisp-mode-variables t)