From nsiivola at common-lisp.net Mon Sep 11 08:02:00 2006 From: nsiivola at common-lisp.net (nsiivola) Date: Mon, 11 Sep 2006 04:02:00 -0400 (EDT) Subject: [slime-cvs] CVS slime Message-ID: <20060911080200.4972115012@common-lisp.net> Update of /project/slime/cvsroot/slime In directory clnet:/tmp/cvs-serv3506 Modified Files: ChangeLog slime.el swank-sbcl.lisp Log Message: REPL history with paredit &al, stepping in the REPL with SBCL. --- /project/slime/cvsroot/slime/ChangeLog 2006/08/27 11:03:37 1.936 +++ /project/slime/cvsroot/slime/ChangeLog 2006/09/11 08:01:58 1.937 @@ -1,3 +1,13 @@ +2006-09-1 Nikodemus Siivola + + * slime.el (slime-repl-matching-input-regexp): Use the portion + between slime-repl-input-mark and point for history search, not + the entire input. Patch by Ivan Shvedunov. + + * swank-sbcl.lisp: Declaim SB-C:INSERT-STEP-CONDITIONS 0 for to + hide Swank while stepping and avoid endless mutex-acquisition + loops. + 2006-08-27 Helmut Eller * swank.lisp (input-available-p, process-available-input): Use --- /project/slime/cvsroot/slime/slime.el 2006/08/26 12:11:06 1.643 +++ /project/slime/cvsroot/slime/slime.el 2006/09/11 08:01:58 1.644 @@ -3864,7 +3864,11 @@ (if (memq last-command '(slime-repl-previous-input slime-repl-next-input)) slime-repl-history-pattern - (concat "^" (regexp-quote (slime-repl-current-input))))) + (concat "^" (regexp-quote (slime-buffer-substring-with-reified-output + slime-repl-input-start-mark + (if (> (point) slime-repl-input-start-mark) + (point) + slime-repl-input-end-mark)))))) (defun slime-repl-previous-input () (interactive) --- /project/slime/cvsroot/slime/swank-sbcl.lisp 2006/08/10 11:53:35 1.160 +++ /project/slime/cvsroot/slime/swank-sbcl.lisp 2006/09/11 08:01:59 1.161 @@ -18,7 +18,7 @@ (require 'sb-introspect) (require 'sb-posix)) -(declaim (optimize (debug 2))) +(declaim (optimize (debug 2) (sb-c:insert-step-conditions 0))) (import-from :sb-gray *gray-stream-symbols* :swank-backend) From mbaringer at common-lisp.net Wed Sep 13 14:30:34 2006 From: mbaringer at common-lisp.net (mbaringer) Date: Wed, 13 Sep 2006 10:30:34 -0400 (EDT) Subject: [slime-cvs] CVS slime Message-ID: <20060913143034.6F5106D027@common-lisp.net> Update of /project/slime/cvsroot/slime In directory clnet:/tmp/cvs-serv20336 Modified Files: ChangeLog Log Message: --- /project/slime/cvsroot/slime/ChangeLog 2006/09/11 08:01:58 1.937 +++ /project/slime/cvsroot/slime/ChangeLog 2006/09/13 14:30:34 1.938 @@ -1,4 +1,19 @@ -2006-09-1 Nikodemus Siivola +2006-09-13 Marco Baringer + + * slime.el (slime-open-inspector): Added a slime-part-number + property to the topline so that you can slime-inspector-copy-down + the object being inspected. There are some cases where we have an + object in the inspector and we'd like to dump it to the repl but + we can't get at it through other means (like in back-traces). + + * swank.lisp (format-arglist-for-echo-area): Instead of using + let+first+rest to destructure a form use destructuring-bind. + (lookup-presented-object): Added (declare (special + *inspectee-parts*)) to silence openmcl's compiler. + (inspect-object): Generate, and send to emacs, an ID for the + object being inspected. + +2006-09-01 Nikodemus Siivola * slime.el (slime-repl-matching-input-regexp): Use the portion between slime-repl-input-mark and point for history search, not From mbaringer at common-lisp.net Wed Sep 13 14:31:18 2006 From: mbaringer at common-lisp.net (mbaringer) Date: Wed, 13 Sep 2006 10:31:18 -0400 (EDT) Subject: [slime-cvs] CVS slime Message-ID: <20060913143118.8CD0674181@common-lisp.net> Update of /project/slime/cvsroot/slime In directory clnet:/tmp/cvs-serv20410 Modified Files: slime.el Log Message: (slime-open-inspector): Added a slime-part-number property to the topline so that you can slime-inspector-copy-down the object being inspected. There are some cases where we have an object in the inspector and we'd like to dump it to the repl but we can't get at it through other means (like in back-traces). --- /project/slime/cvsroot/slime/slime.el 2006/09/11 08:01:58 1.644 +++ /project/slime/cvsroot/slime/slime.el 2006/09/13 14:31:17 1.645 @@ -873,8 +873,7 @@ [ "Interrupt Command" slime-interrupt ,C ] [ "Abort Async. Command" slime-quit ,C ] [ "Sync Package & Directory" slime-sync-package-and-default-directory ,C] - [ "Set Package in REPL" slime-repl-set-package ,C] - ))) + [ "Set Package in REPL" slime-repl-set-package ,C]))) (defvar slime-repl-easy-menu (let ((C '(slime-connected-p))) @@ -2717,8 +2716,7 @@ (setq slime-repl-directory-stack (list (expand-file-name default-directory))) (setq slime-repl-package-stack (list (slime-lisp-package))) - (slime-repl-update-banner) - )) + (slime-repl-update-banner))) (defvar slime-show-last-output-function 'slime-maybe-display-output-buffer @@ -8688,10 +8686,13 @@ (setq slime-buffer-connection (slime-current-connection)) (let ((inhibit-read-only t)) (erase-buffer) - (destructuring-bind (&key title type content) inspected-parts + (destructuring-bind (&key title type content id) inspected-parts (macrolet ((fontify (face string) - `(slime-inspector-fontify ,face ,string))) - (insert (fontify topline title)) + `(slime-inspector-fontify ,face ,string))) + (slime-propertize-region (list 'slime-part-number id + 'mouse-face 'highlight + 'face 'slime-inspector-action-face) + (slime-insert-presentation title `(:inspected-part ,id))) (while (eq (char-before) ?\n) (backward-delete-char 1)) (insert "\n [" (fontify label "type:") " " (fontify type type) "]\n" @@ -9703,8 +9704,7 @@ (cl-user::bar)) " - (cl-user::bar)) - ) + (cl-user::bar))) (slime-check-top-level) (with-temp-buffer (lisp-mode) @@ -9847,13 +9847,11 @@ ("(princ 10)" "SWANK> (princ 10) 10 10 -SWANK> " - ) +SWANK> ") ("(princ 10)(princ 20)" "SWANK> (princ 10)(princ 20) 1020 20 -SWANK> " - ) +SWANK> ") ("(dotimes (i 10 77) (princ i) (terpri))" "SWANK> (dotimes (i 10 77) (princ i) (terpri)) 0 @@ -9867,9 +9865,7 @@ 8 9 77 -SWANK> " - ) - ) +SWANK> ")) (with-current-buffer (slime-output-buffer) (setf (slime-lisp-package-prompt-string) "SWANK")) (kill-buffer (slime-output-buffer)) @@ -9897,9 +9893,7 @@ ("(+ 1\n" "2)" "SWANK> (+ 1 2) 3 -SWANK> ") - -) +SWANK> ")) (with-current-buffer (slime-output-buffer) (setf (slime-lisp-package-prompt-string) "SWANK")) (kill-buffer (slime-output-buffer)) @@ -9930,8 +9924,7 @@ \(+ 2 3 4) \(+ 2 3 4) -SWANK> ") - ) +SWANK> ")) (slime-sync-to-top-level 2) (with-current-buffer (slime-output-buffer) (setf (slime-lisp-package-prompt-string) "SWANK")) From mbaringer at common-lisp.net Wed Sep 13 14:31:42 2006 From: mbaringer at common-lisp.net (mbaringer) Date: Wed, 13 Sep 2006 10:31:42 -0400 (EDT) Subject: [slime-cvs] CVS slime Message-ID: <20060913143142.841BF30D3@common-lisp.net> Update of /project/slime/cvsroot/slime In directory clnet:/tmp/cvs-serv20454 Modified Files: swank.lisp Log Message: (format-arglist-for-echo-area): Instead of using let+first+rest to destructure a form use destructuring-bind. (lookup-presented-object): Added (declare (special *inspectee-parts*)) to silence openmcl's compiler. (inspect-object): Generate, and send to emacs, an ID for the object being inspected. --- /project/slime/cvsroot/slime/swank.lisp 2006/08/27 11:01:43 1.396 +++ /project/slime/cvsroot/slime/swank.lisp 2006/09/13 14:31:41 1.397 @@ -2195,8 +2195,8 @@ highlight) "Return the arglist for FORM as a string." (when (consp form) - (let ((operator-form (first form)) - (argument-forms (rest form))) + (destructuring-bind (operator-form &rest argument-forms) + form (let ((form-completion (form-completion operator-form argument-forms :remove-args nil))) @@ -2317,7 +2317,8 @@ (defvar *nil-surrogate* (make-symbol "nil-surrogate")) -;; XXX thread safety? +;; XXX thread safety? [2006-09-13] mb: not in the slightest (fwiw the +;; rest of slime isn't thread safe either), do we really care? (defun save-presented-object (object) "Save OBJECT and return the assigned id. If OBJECT was saved previously return the old id." @@ -2359,6 +2360,7 @@ (:no-error (value) (values value t)))) ((:inspected-part part-index) + (declare (special *inspectee-parts*)) (if (< part-index (length *inspectee-parts*)) (values (inspector-nth-part part-index) t) (values nil nil))))))) @@ -4027,10 +4029,7 @@ (loop for key being the hash-keys of ht for value being the hash-values of ht repeat (or *slime-inspect-contents-limit* most-positive-fixnum) - append `((:value ,key) " = " (:value ,value) (:newline)) - ) - - ))) + append `((:value ,key) " = " (:value ,value) (:newline)))))) (defmethod inspect-bigger-piece-actions (thing size) (append @@ -4048,8 +4047,7 @@ (let ((*slime-inspect-contents-limit* nil)) (values (swank::inspect-object thing) - :replace) - )))) + :replace))))) (defmethod inspect-show-more-action (thing) `(:action ,(format nil "~a elements shown. Prompt for how many to inspect..." @@ -4059,9 +4057,7 @@ (progn (format t "How many elements should be shown? ") (read)))) (values (swank::inspect-object thing) - :replace) - )) - )) + :replace))))) (defmethod inspect-for-emacs ((array array) inspector) (declare (ignore inspector)) @@ -4661,7 +4657,8 @@ (inspect-for-emacs object inspector) (list :title title :type (to-string (type-of object)) - :content (inspector-content-for-emacs content))))) + :content (inspector-content-for-emacs content) + :id (assign-index object *inspectee-parts*))))) (defslimefun inspector-nth-part (index) (aref *inspectee-parts* index)) From mbaringer at common-lisp.net Wed Sep 13 14:37:47 2006 From: mbaringer at common-lisp.net (mbaringer) Date: Wed, 13 Sep 2006 10:37:47 -0400 (EDT) Subject: [slime-cvs] CVS slime Message-ID: <20060913143747.3CD181400C@common-lisp.net> Update of /project/slime/cvsroot/slime In directory clnet:/tmp/cvs-serv20988 Modified Files: ChangeLog Log Message: --- /project/slime/cvsroot/slime/ChangeLog 2006/09/13 14:30:34 1.938 +++ /project/slime/cvsroot/slime/ChangeLog 2006/09/13 14:37:45 1.939 @@ -1,3 +1,7 @@ +2006-09-13 Daniel Koning + + * slime.el (slime-repl-disconnect): New repl shortcut. + 2006-09-13 Marco Baringer * slime.el (slime-open-inspector): Added a slime-part-number From mbaringer at common-lisp.net Wed Sep 13 14:38:11 2006 From: mbaringer at common-lisp.net (mbaringer) Date: Wed, 13 Sep 2006 10:38:11 -0400 (EDT) Subject: [slime-cvs] CVS slime Message-ID: <20060913143811.4FC5F16034@common-lisp.net> Update of /project/slime/cvsroot/slime In directory clnet:/tmp/cvs-serv21038 Modified Files: slime.el Log Message: Added disconnect, a new repl shortcut. --- /project/slime/cvsroot/slime/slime.el 2006/09/13 14:31:17 1.645 +++ /project/slime/cvsroot/slime/slime.el 2006/09/13 14:38:11 1.646 @@ -4229,6 +4229,10 @@ (slime-repl-send-input))) (:one-liner "Resend the last form.")) +(defslime-repl-shortcut slime-repl-disconnect ("disconnect") + (:handler 'slime-disconnect) + (:one-liner "Disconnect all connections.")) + (defslime-repl-shortcut slime-repl-sayoonara ("sayoonara") (:handler (lambda () (interactive) From mbaringer at common-lisp.net Wed Sep 13 14:56:41 2006 From: mbaringer at common-lisp.net (mbaringer) Date: Wed, 13 Sep 2006 10:56:41 -0400 (EDT) Subject: [slime-cvs] CVS slime Message-ID: <20060913145641.83AAB6302F@common-lisp.net> Update of /project/slime/cvsroot/slime In directory clnet:/tmp/cvs-serv24782 Modified Files: slime.el Log Message: Fixup (push|pop)-directory and (push|pop)-package. --- /project/slime/cvsroot/slime/slime.el 2006/09/13 14:38:11 1.646 +++ /project/slime/cvsroot/slime/slime.el 2006/09/13 14:56:40 1.647 @@ -2711,11 +2711,9 @@ (defun slime-init-output-buffer (connection) (with-current-buffer (slime-output-buffer t) - (setq slime-buffer-connection connection) - ;; set the directory stack - (setq slime-repl-directory-stack - (list (expand-file-name default-directory))) - (setq slime-repl-package-stack (list (slime-lisp-package))) + (setq slime-buffer-connection connection + slime-repl-directory-stack '() + slime-repl-package-stack '()) (slime-repl-update-banner))) (defvar slime-show-last-output-function @@ -4183,24 +4181,28 @@ (message "Directory %s" dir)))) (:one-liner "Show the current directory.")) -(defslime-repl-shortcut slime-repl-push-directory ("push-directory" "+d" - "pushd") +(defslime-repl-shortcut slime-repl-push-directory + ("push-directory" "+d" "pushd") (:handler (lambda (directory) (interactive - (list (read-directory-name + (list (read-directory-name "Push directory: " - (slime-eval '(swank:default-directory)) nil nil ""))) - (push directory slime-repl-directory-stack) + (slime-eval '(swank:default-directory)) + nil nil ""))) + (push (slime-eval '(swank:default-directory)) + slime-repl-directory-stack) (slime-set-default-directory directory))) - (:one-liner "Push a new directory onto the directory stack.")) + (:one-liner "Save the current directory and set it to a new one.")) -(defslime-repl-shortcut slime-repl-pop-directory ("pop-directory" "-d") +(defslime-repl-shortcut slime-repl-pop-directory + ("pop-directory" "-d" "popd") (:handler (lambda () (interactive) - (unless (= 1 (length slime-repl-directory-stack)) - (pop slime-repl-directory-stack)) - (slime-set-default-directory (car slime-repl-directory-stack)))) - (:one-liner "Pop the current directory.")) + (if (null slime-repl-directory-stack) + (message "Directory stack is empty.") + (slime-set-default-directory + (pop slime-repl-directory-stack))))) + (:one-liner "Restore the last saved directory.")) (defslime-repl-shortcut nil ("change-package" "!p" "in-package" "in") (:handler 'slime-repl-set-package) @@ -4209,17 +4211,18 @@ (defslime-repl-shortcut slime-repl-push-package ("push-package" "+p") (:handler (lambda (package) (interactive (list (slime-read-package-name "Package: "))) - (push package slime-repl-package-stack) + (push (slime-lisp-package) slime-repl-package-stack) (slime-repl-set-package package))) - (:one-liner "Push a package onto the package stack.")) + (:one-liner "Save the current package and set it to a new one.")) (defslime-repl-shortcut slime-repl-pop-package ("pop-package" "-p") (:handler (lambda () (interactive) - (unless (= 1 (length slime-repl-package-stack)) - (pop slime-repl-package-stack)) - (slime-repl-set-package (car slime-repl-package-stack)))) - (:one-liner "Pop the top of the package stack.")) + (if (null slime-repl-package-stack) + (message "Package stack is empty.") + (slime-repl-set-package + (pop slime-repl-package-stack))))) + (:one-liner "Restore the last saved package.")) (defslime-repl-shortcut slime-repl-resend ("resend-form") (:handler (lambda () From mbaringer at common-lisp.net Wed Sep 13 14:56:49 2006 From: mbaringer at common-lisp.net (mbaringer) Date: Wed, 13 Sep 2006 10:56:49 -0400 (EDT) Subject: [slime-cvs] CVS slime Message-ID: <20060913145649.EAA5B6D030@common-lisp.net> Update of /project/slime/cvsroot/slime In directory clnet:/tmp/cvs-serv24841 Modified Files: ChangeLog Log Message: --- /project/slime/cvsroot/slime/ChangeLog 2006/09/13 14:37:45 1.939 +++ /project/slime/cvsroot/slime/ChangeLog 2006/09/13 14:56:49 1.940 @@ -1,3 +1,13 @@ +2006-09-13 Taylor R Campbell + + * slime.el (slime-init-output-buffer): Initial directory and + package stacks should be empty. + (slime-repl-push-package): Push the current package, as opposed to + the new package, and set the new package to whatever the user + specified. + (slime-repl-pop-package): Set the current package to the top of + the package stack, unless it's empty. + 2006-09-13 Daniel Koning * slime.el (slime-repl-disconnect): New repl shortcut. From mbaringer at common-lisp.net Wed Sep 13 15:13:53 2006 From: mbaringer at common-lisp.net (mbaringer) Date: Wed, 13 Sep 2006 11:13:53 -0400 (EDT) Subject: [slime-cvs] CVS slime Message-ID: <20060913151353.8E2262017@common-lisp.net> Update of /project/slime/cvsroot/slime In directory clnet:/tmp/cvs-serv28577 Modified Files: ChangeLog Log Message: --- /project/slime/cvsroot/slime/ChangeLog 2006/09/13 14:56:49 1.940 +++ /project/slime/cvsroot/slime/ChangeLog 2006/09/13 15:13:53 1.941 @@ -1,3 +1,8 @@ +2006-09-13 Marco Baringer + + * slime.el (slime-insert-xrefs): Specify which file the item is + in (when that information is available). + 2006-09-13 Taylor R Campbell * slime.el (slime-init-output-buffer): Initial directory and From mbaringer at common-lisp.net Wed Sep 13 15:18:35 2006 From: mbaringer at common-lisp.net (mbaringer) Date: Wed, 13 Sep 2006 11:18:35 -0400 (EDT) Subject: [slime-cvs] CVS slime Message-ID: <20060913151835.76EC178036@common-lisp.net> Update of /project/slime/cvsroot/slime In directory clnet:/tmp/cvs-serv29576 Modified Files: slime.el Log Message: (slime-insert-xrefs): Specify which file the item is in (when that information is available). --- /project/slime/cvsroot/slime/slime.el 2006/09/13 14:56:40 1.647 +++ /project/slime/cvsroot/slime/slime.el 2006/09/13 15:18:35 1.648 @@ -7260,11 +7260,17 @@ (loop for (group . refs) in xrefs do (progn (slime-insert-propertized '(face bold) group "\n") - (loop for (label . location) in refs do - (slime-insert-propertized + (loop + for (label . location) in refs + do (slime-insert-propertized (list 'slime-location location 'face 'font-lock-keyword-face) - " " (slime-one-line-ify label) "\n")))) + " " (slime-one-line-ify label)) + do (insert " - " (if (and (eql :location (car location)) + (assoc :file (cdr location))) + (second (assoc :file (cdr location))) + "file unknown") + "\n")))) ;; Remove the final newline to prevent accidental window-scrolling (backward-char 1) (delete-char 1)) From mbaringer at common-lisp.net Wed Sep 13 15:25:17 2006 From: mbaringer at common-lisp.net (mbaringer) Date: Wed, 13 Sep 2006 11:25:17 -0400 (EDT) Subject: [slime-cvs] CVS slime Message-ID: <20060913152517.F1E6219000@common-lisp.net> Update of /project/slime/cvsroot/slime In directory clnet:/tmp/cvs-serv31709 Modified Files: swank.lisp Log Message: (format-iso8601-time): Properly handle non integer time zones. --- /project/slime/cvsroot/slime/swank.lisp 2006/09/13 14:31:41 1.397 +++ /project/slime/cvsroot/slime/swank.lisp 2006/09/13 15:25:17 1.398 @@ -4503,7 +4503,7 @@ ;; Tricky. Sign of time zone is reversed in ISO 8601 ;; relative to Common Lisp convention! (format nil "~:[+~;-~]~2,'0D:~2,'0D" - (> zone 0) h (round m)))))) + (> zone 0) h (round (* 60 m))))))) (multiple-value-bind (second minute hour day month year dow dst zone) (decode-universal-time time-value) (declare (ignore dow dst)) From mbaringer at common-lisp.net Wed Sep 13 15:25:30 2006 From: mbaringer at common-lisp.net (mbaringer) Date: Wed, 13 Sep 2006 11:25:30 -0400 (EDT) Subject: [slime-cvs] CVS slime Message-ID: <20060913152530.0D0171A006@common-lisp.net> Update of /project/slime/cvsroot/slime In directory clnet:/tmp/cvs-serv31756 Modified Files: ChangeLog Log Message: --- /project/slime/cvsroot/slime/ChangeLog 2006/09/13 15:13:53 1.941 +++ /project/slime/cvsroot/slime/ChangeLog 2006/09/13 15:25:29 1.942 @@ -1,3 +1,8 @@ +2006-09-13 Bob Halley + + * swank.lisp (format-iso8601-time): Properly handle non integer + time zones. + 2006-09-13 Marco Baringer * slime.el (slime-insert-xrefs): Specify which file the item is From mbaringer at common-lisp.net Wed Sep 13 15:26:06 2006 From: mbaringer at common-lisp.net (mbaringer) Date: Wed, 13 Sep 2006 11:26:06 -0400 (EDT) Subject: [slime-cvs] CVS slime Message-ID: <20060913152606.DC75E30015@common-lisp.net> Update of /project/slime/cvsroot/slime In directory clnet:/tmp/cvs-serv31851 Modified Files: ChangeLog Log Message: --- /project/slime/cvsroot/slime/ChangeLog 2006/09/13 15:25:29 1.942 +++ /project/slime/cvsroot/slime/ChangeLog 2006/09/13 15:26:05 1.943 @@ -3,11 +3,6 @@ * swank.lisp (format-iso8601-time): Properly handle non integer time zones. -2006-09-13 Marco Baringer - - * slime.el (slime-insert-xrefs): Specify which file the item is - in (when that information is available). - 2006-09-13 Taylor R Campbell * slime.el (slime-init-output-buffer): Initial directory and @@ -29,6 +24,8 @@ the object being inspected. There are some cases where we have an object in the inspector and we'd like to dump it to the repl but we can't get at it through other means (like in back-traces). + (slime-insert-xrefs): Specify which file the item is in (when that + information is available). * swank.lisp (format-arglist-for-echo-area): Instead of using let+first+rest to destructure a form use destructuring-bind. From mbaringer at common-lisp.net Wed Sep 13 15:36:50 2006 From: mbaringer at common-lisp.net (mbaringer) Date: Wed, 13 Sep 2006 11:36:50 -0400 (EDT) Subject: [slime-cvs] CVS slime Message-ID: <20060913153650.E346B53013@common-lisp.net> Update of /project/slime/cvsroot/slime In directory clnet:/tmp/cvs-serv882 Modified Files: slime.el Log Message: --- /project/slime/cvsroot/slime/slime.el 2006/09/13 15:18:35 1.648 +++ /project/slime/cvsroot/slime/slime.el 2006/09/13 15:36:50 1.649 @@ -193,7 +193,7 @@ (push (list \"^soren$\" (lambda (emacs-filename) - (subseq (length \"/ssh:animaliter at soren:\") emacs-filename)) + (subseq emacs-filename (length \"/ssh:animaliter at soren:\"))) (lambda (lisp-filename) (concat \"/ssh:animaliter at soren:\" lisp-filename))) slime-filename-translations) From mbaringer at common-lisp.net Wed Sep 13 15:36:59 2006 From: mbaringer at common-lisp.net (mbaringer) Date: Wed, 13 Sep 2006 11:36:59 -0400 (EDT) Subject: [slime-cvs] CVS slime Message-ID: <20060913153659.099CE59081@common-lisp.net> Update of /project/slime/cvsroot/slime In directory clnet:/tmp/cvs-serv934 Modified Files: ChangeLog Log Message: --- /project/slime/cvsroot/slime/ChangeLog 2006/09/13 15:26:05 1.943 +++ /project/slime/cvsroot/slime/ChangeLog 2006/09/13 15:36:58 1.944 @@ -1,3 +1,7 @@ +2006-09-13 Brandon Bergren + + * slime.el (slime-filename-translations): Fix docstring + 2006-09-13 Bob Halley * swank.lisp (format-iso8601-time): Properly handle non integer From dcrosher at common-lisp.net Wed Sep 13 22:56:15 2006 From: dcrosher at common-lisp.net (dcrosher) Date: Wed, 13 Sep 2006 18:56:15 -0400 (EDT) Subject: [slime-cvs] CVS slime Message-ID: <20060913225615.49A174F006@common-lisp.net> Update of /project/slime/cvsroot/slime In directory clnet:/tmp/cvs-serv5492 Modified Files: ChangeLog swank-scl.lisp Log Message: * Update for the SCL. --- /project/slime/cvsroot/slime/ChangeLog 2006/09/13 15:36:58 1.944 +++ /project/slime/cvsroot/slime/ChangeLog 2006/09/13 22:56:14 1.945 @@ -1,3 +1,7 @@ +2006-09-14 Douglas Crosher + + * swank-scl (arglist, function-arglist, spawn): update for the SCL. + 2006-09-13 Brandon Bergren * slime.el (slime-filename-translations): Fix docstring --- /project/slime/cvsroot/slime/swank-scl.lisp 2006/08/10 11:53:35 1.10 +++ /project/slime/cvsroot/slime/swank-scl.lisp 2006/09/13 22:56:14 1.11 @@ -1172,14 +1172,12 @@ ;;;;; Argument lists (defimplementation arglist (fun) - (cond ((and (symbolp fun) (macro-function fun)) - (arglist (macro-function fun))) - ((fboundp fun) - (function-arglist (fdefinition fun))) - (t - :not-available))) + (etypecase fun + (function (function-arglist fun)) + (symbol (function-arglist (or (macro-function fun) + (symbol-function fun)))))) -(defun function-arglist (fun function) +(defun function-arglist (fun) (flet ((compiled-function-arglist (x) (let ((args (kernel:%function-arglist x))) (if args @@ -1918,8 +1916,8 @@ ;;;; Multiprocessing -(defimplementation spawn (fn &key (name "Anonymous")) - (thread:thread-create fn :name name)) +(defimplementation spawn (fn &key name) + (thread:thread-create fn :name (or name "Anonymous"))) (defvar *thread-id-counter* 0) (defvar *thread-id-counter-lock* (thread:make-lock "Thread ID counter")) From mbaringer at common-lisp.net Mon Sep 18 21:25:24 2006 From: mbaringer at common-lisp.net (mbaringer) Date: Mon, 18 Sep 2006 17:25:24 -0400 (EDT) Subject: [slime-cvs] CVS slime Message-ID: <20060918212524.F080E69142@common-lisp.net> Update of /project/slime/cvsroot/slime In directory clnet:/tmp/cvs-serv11301 Modified Files: ChangeLog Log Message: --- /project/slime/cvsroot/slime/ChangeLog 2006/09/13 22:56:14 1.945 +++ /project/slime/cvsroot/slime/ChangeLog 2006/09/18 21:25:24 1.946 @@ -1,3 +1,25 @@ +2006-09-18 Dan Weinreb + + For those cases where SLIME can't complete a user request (like + loading an asdf system without asdf or describing an inexistent + symbol) instead of signaling an error SWANK should politely inform + the user and return normally. + + * swank.lisp (eval-for-emacs): Handle request-abort conditions. + (decode-keyword-arg, get-repl-result, parse-symbol-or-lose): Use + abort-request instead of error. + + * swank-backend.lisp (request-abort): New condition. + (abort-request): Convenience function for signaling request-abort + conditions. + (operate-on-system): Use abort-request instead of error + (:swank-backend): Export the symbols abort-request and + request-abort. + + * slime.el (slime-rex): Update docstring. + (slime-eval, slime-eval-async): Added new REASON parameter sent + along with :abort message. + 2006-09-14 Douglas Crosher * swank-scl (arglist, function-arglist, spawn): update for the SCL. From mbaringer at common-lisp.net Mon Sep 18 21:26:14 2006 From: mbaringer at common-lisp.net (mbaringer) Date: Mon, 18 Sep 2006 17:26:14 -0400 (EDT) Subject: [slime-cvs] CVS slime Message-ID: <20060918212614.0AFF469142@common-lisp.net> Update of /project/slime/cvsroot/slime In directory clnet:/tmp/cvs-serv11388 Modified Files: slime.el Log Message: (slime-rex): Update docstring. (slime-eval, slime-eval-async): Added new REASON parameter sent along with :abort message. --- /project/slime/cvsroot/slime/slime.el 2006/09/13 15:36:50 1.649 +++ /project/slime/cvsroot/slime/slime.el 2006/09/18 21:26:13 1.650 @@ -2335,10 +2335,11 @@ PACKAGE is evaluated and Lisp binds *BUFFER-PACKAGE* to this package. The default value is (slime-current-package). -CLAUSES is a list of patterns with same syntax as `destructure-case'. -The result of the evaluation is dispatched on CLAUSES. The result is -either a sexp of the form (:ok VALUE) or (:abort). CLAUSES is -executed asynchronously. +CLAUSES is a list of patterns with same syntax as +`destructure-case'. The result of the evaluation of SEXP is +dispatched on CLAUSES. The result is either a sexp of the +form (:ok VALUE) or (:abort REASON). CLAUSES is executed +asynchronously. Note: don't use backquote syntax for SEXP, because Emacs20 cannot deal with that." @@ -2418,8 +2419,8 @@ (error "tag = %S eval-tags = %S sexp = %S" tag slime-stack-eval-tags sexp)) (throw tag (list #'identity value))) - ((:abort) - (throw tag (list #'error "Synchronous Lisp Evaluation aborted.")))) + ((:abort &optional reason) + (throw tag (list #'error (or reason "Synchronous Lisp Evaluation aborted."))))) (let ((debug-on-quit t) (inhibit-quit nil) (conn (slime-connection))) @@ -2434,8 +2435,8 @@ (sexp (or package (slime-current-package))) ((:ok result) (when cont (funcall cont result))) - ((:abort) - (message "Evaluation aborted.")))) + ((:abort &optional reason) + (message (or reason "Evaluation aborted."))))) ;;; These functions can be handy too: From mbaringer at common-lisp.net Mon Sep 18 21:27:04 2006 From: mbaringer at common-lisp.net (mbaringer) Date: Mon, 18 Sep 2006 17:27:04 -0400 (EDT) Subject: [slime-cvs] CVS slime Message-ID: <20060918212704.C8A7C70212@common-lisp.net> Update of /project/slime/cvsroot/slime In directory clnet:/tmp/cvs-serv11483 Modified Files: swank-backend.lisp Log Message: (request-abort): New condition. (abort-request): Convenience function for signaling request-abort conditions. (operate-on-system): Use abort-request instead of error (:swank-backend): Export the symbols abort-request and request-abort. --- /project/slime/cvsroot/slime/swank-backend.lisp 2006/08/10 11:53:35 1.101 +++ /project/slime/cvsroot/slime/swank-backend.lisp 2006/09/18 21:27:04 1.102 @@ -15,6 +15,8 @@ (:export #:sldb-condition #:original-condition #:compiler-condition + #:abort-request + #:request-abort #:message #:short-message #:condition @@ -159,6 +161,20 @@ (warn "DEFIMPLEMENTATION of undefined interface (~S)" ',name)) ',name)) +(define-condition request-abort (error) + ((reason :initarg :reason :reader reason)) + (:report (lambda (condition stream) + (princ (reason condition) stream))) + (:documentation "Condition signalled when SLIME wasn't able to +complete a user request due to bad data. This condition is not +for real errors but for situations where SLIME has to give up and +return control back to the user.")) + +(defun abort-request (reason-control &rest reason-args) + "Abort whatever swank is currently do and send a message to the +user." + (error 'request-abort :reason (apply #'format nil reason-control reason-args))) + (defun warn-unimplemented-interfaces () "Warn the user about unimplemented backend features. The portable code calls this function at startup." @@ -346,12 +362,12 @@ Example: \(operate-on-system \"SWANK\" \"COMPILE-OP\" :force t)" (unless (member :asdf *features*) - (error "ASDF is not loaded.")) + (abort-request "ASDF is not loaded.")) (with-compilation-hooks () (let ((operate (find-symbol (symbol-name '#:operate) :asdf)) (operation (find-symbol operation-name :asdf))) (when (null operation) - (error "Couldn't find ASDF operation ~S" operation-name)) + (abort-request "Couldn't find ASDF operation ~S" operation-name)) (apply operate operation system-name keyword-args)))) (definterface swank-compile-file (filename load-p &optional external-format) From mbaringer at common-lisp.net Mon Sep 18 21:27:49 2006 From: mbaringer at common-lisp.net (mbaringer) Date: Mon, 18 Sep 2006 17:27:49 -0400 (EDT) Subject: [slime-cvs] CVS slime Message-ID: <20060918212749.BE43ED004@common-lisp.net> Update of /project/slime/cvsroot/slime In directory clnet:/tmp/cvs-serv11546 Modified Files: swank.lisp Log Message: (eval-for-emacs): Handle request-abort conditions. (decode-keyword-arg, get-repl-result, parse-symbol-or-lose): Use abort-request instead of error. --- /project/slime/cvsroot/slime/swank.lisp 2006/09/13 15:25:17 1.398 +++ /project/slime/cvsroot/slime/swank.lisp 2006/09/18 21:27:49 1.399 @@ -1349,7 +1349,7 @@ (multiple-value-bind (symbol status) (parse-symbol string package) (if status (values symbol status) - (error "Unknown symbol: ~A [in ~A]" string package)))) + (abort-request "Unknown symbol: ~A [in ~A]" string package)))) ;; FIXME: interns the name (defun parse-package (string) @@ -1608,7 +1608,7 @@ (car arg) (cadr arg))) (t - (error "Bad keyword item of formal argument list")))) + (abort-request "Bad keyword item of formal argument list")))) (defun encode-keyword-arg (arg) (cond @@ -2369,7 +2369,7 @@ "Get the result of the previous REPL evaluation with ID." (multiple-value-bind (object foundp) (lookup-presented-object id) (cond (foundp object) - (t (error "Attempt to access unrecorded object (id ~D)." id))))) + (t (abort-request "Attempt to access unrecorded object (id ~D)." id))))) (defslimefun clear-repl-results () "Forget the results of all previous REPL evaluations." @@ -2395,7 +2395,7 @@ (call-with-debugger-hook #'swank-debugger-hook (lambda () - (let (ok result) + (let (ok result reason) (unwind-protect (let ((*buffer-package* (guess-buffer-package buffer-package)) (*buffer-readtable* (guess-buffer-readtable buffer-package)) @@ -2404,13 +2404,20 @@ (check-type *buffer-readtable* readtable) ;; APPLY would be cleaner than EVAL. ;;(setq result (apply (car form) (cdr form))) - (setq result (eval form)) - (finish-output) - (run-hook *pre-reply-hook*) - (setq ok t)) + (handler-case + (progn + (setq result (eval form)) + (run-hook *pre-reply-hook*) + (finish-output) + (setq ok t)) + (request-abort (c) + (setf ok nil + reason (list (slot-value c 'swank-backend::reason)))))) (force-user-output) (send-to-emacs `(:return ,(current-thread) - ,(if ok `(:ok ,result) '(:abort)) + ,(if ok + `(:ok ,result) + `(:abort , at reason)) ,id))))))) (defvar *echo-area-prefix* "=> " @@ -3666,7 +3673,7 @@ The result is a list of property lists." (let ((package (if package (or (find-package (string-to-package-designator package)) - (error "No such package: ~S" package))))) + (abort-request "No such package: ~S" package))))) (mapcan (listify #'briefly-describe-symbol-for-emacs) (sort (remove-duplicates (apropos-symbols name external-only case-sensitive package)) From jsnellman at common-lisp.net Mon Sep 18 21:56:14 2006 From: jsnellman at common-lisp.net (jsnellman) Date: Mon, 18 Sep 2006 17:56:14 -0400 (EDT) Subject: [slime-cvs] CVS slime Message-ID: <20060918215614.4282D49039@common-lisp.net> Update of /project/slime/cvsroot/slime In directory clnet:/tmp/cvs-serv16073 Modified Files: ChangeLog slime.el swank-backend.lisp swank-sbcl.lisp swank.lisp Log Message: sbcl single-stepper --- /project/slime/cvsroot/slime/ChangeLog 2006/09/18 21:25:24 1.946 +++ /project/slime/cvsroot/slime/ChangeLog 2006/09/18 21:56:13 1.947 @@ -1,3 +1,33 @@ +2006-09-19 Juho Snellman + + Extend the stepper protocol to work nicely with the SBCL stepper. + + If sldb is invoked on a condition that's sldb-stepper-condition-p, + the sldb functions sldb-step, sldb-next and sldb-out will invoke + the matching backend functions for stepping into the stepped form, + to the next form, or out of the current function. Otherwise the + functions will behave like sldb-step used to (call active-stepping and + select the continue restart). + + * swank-backend.lisp (sldb-stepper-condition-p, sldb-step-into, + sldb-step-next, sldb-step-out): New interface functions + + * swank-sbcl.lisp (activate-stepper, condition-extras, + sldb-stepper-condition-p, sldb-step-into, sldb-step-next, + sldb-step-out): Implemented (conditional on CVS SBCL) + (call-with-debugger-hook): bind sb-ext:*stepper-hook* to + a function that binds *stack-top-hint* and invokes the debugger + (conditional on CVS SBCL) + + * swank.lisp (define-stepper-function): new macro for defining + stepper-related functions, since they all follow the same form + (sldb-step): redefine with define-stepper-function + (sldb-next, sldb-out): new functions + (*sldb-stepping-p*): typo in docstring + + * slime.el (sldb-next, sldb-out): New commands + (sldb-mode-map): bind sldb-next to "x" and sldb-out to "o" + 2006-09-18 Dan Weinreb For those cases where SLIME can't complete a user request (like --- /project/slime/cvsroot/slime/slime.el 2006/09/18 21:26:13 1.650 +++ /project/slime/cvsroot/slime/slime.el 2006/09/18 21:56:13 1.651 @@ -912,7 +912,10 @@ ("Invoke Restart" [ "Continue" sldb-continue ,C ] [ "Abort" sldb-abort ,C ] - [ "Step" sldb-step ,C ]) + [ "Step" sldb-step ,C ] + [ "Step next" sldb-next ,C ] + [ "Step out" sldb-out ,C ] + ) "--" [ "Quit (throw)" sldb-quit ,C ] [ "Break With Default Debugger" sldb-break-with-default-debugger ,C ]))) @@ -7742,6 +7745,8 @@ ("R" 'sldb-return-from-frame) ("c" 'sldb-continue) ("s" 'sldb-step) + ("x" 'sldb-next) + ("o" 'sldb-out) ("b" 'sldb-break-on-return) ("a" 'sldb-abort) ("q" 'sldb-quit) @@ -8385,6 +8390,18 @@ (let ((frame (sldb-frame-number-at-point))) (slime-eval-async `(swank:sldb-step ,frame)))) +(defun sldb-next () + "Select the \"continue\" restart and set a new break point." + (interactive) + (let ((frame (sldb-frame-number-at-point))) + (slime-eval-async `(swank:sldb-next ,frame)))) + +(defun sldb-out () + "Select the \"continue\" restart and set a new break point." + (interactive) + (let ((frame (sldb-frame-number-at-point))) + (slime-eval-async `(swank:sldb-out ,frame)))) + (defun sldb-break-on-return () "Set a breakpoint at the current frame. The debugger is entered when the frame exits." --- /project/slime/cvsroot/slime/swank-backend.lisp 2006/09/18 21:27:04 1.102 +++ /project/slime/cvsroot/slime/swank-backend.lisp 2006/09/18 21:56:13 1.103 @@ -636,6 +636,21 @@ (definterface sldb-break-at-start (symbol) "Set a breakpoint on the beginning of the function for SYMBOL.") +(definterface sldb-stepper-condition-p (condition) + "Return true if SLDB was invoked due to a single-stepping condition, +false otherwise. " + (declare (ignore condition)) + nil) + +(definterface sldb-step-into () + "Step into the current single-stepper form.") + +(definterface sldb-step-next () + "Step to the next form in the current function.") + +(definterface sldb-step-out () + "Stop single-stepping temporarily, but resume it once the current function +returns.") ;;;; Definition finding --- /project/slime/cvsroot/slime/swank-sbcl.lisp 2006/09/11 08:01:59 1.161 +++ /project/slime/cvsroot/slime/swank-sbcl.lisp 2006/09/18 21:56:13 1.162 @@ -583,11 +583,24 @@ ;;; Debugging +(eval-when (:compile-toplevel :load-toplevel :execute) + ;; Generate a form suitable for testing for stepper support (0.9.17) + ;; with #+. + (defun sbcl-with-new-stepper-p () + (if (find-symbol "ENABLE-STEPPING" "SB-IMPL") + '(and) + '(or)))) + (defvar *sldb-stack-top*) (defimplementation install-debugger-globally (function) (setq sb-ext:*invoke-debugger-hook* function)) +#+#.(swank-backend::sbcl-with-new-stepper-p) +(defimplementation condition-extras (condition) + (when (typep condition 'sb-impl::step-form-condition) + `((:short-frame-source 0)))) + (defimplementation call-with-debugging-environment (debugger-loop-fn) (declare (type function debugger-loop-fn)) (let* ((*sldb-stack-top* (or sb-debug:*stack-top-hint* (sb-di:top-frame))) @@ -599,8 +612,28 @@ :original-condition condition))))) (funcall debugger-loop-fn)))) +#+#.(swank-backend::sbcl-with-new-stepper-p) +(progn + (defimplementation activate-stepping (frame) + (declare (ignore frame)) + (sb-impl::enable-stepping)) + (defimplementation sldb-stepper-condition-p (condition) + (typep condition 'sb-ext:step-form-condition)) + (defimplementation sldb-step-into () + (invoke-restart 'sb-ext:step-into)) + (defimplementation sldb-step-next () + (invoke-restart 'sb-ext:step-next)) + (defimplementation sldb-step-out () + (invoke-restart 'sb-ext:step-out))) + (defimplementation call-with-debugger-hook (hook fun) - (let ((sb-ext:*invoke-debugger-hook* hook)) + (let ((sb-ext:*invoke-debugger-hook* hook) + #+#.(swank-backend::sbcl-with-new-stepper-p) + (sb-ext:*stepper-hook* + (lambda (condition) + (when (typep condition 'sb-ext:step-form-condition) + (let ((sb-debug:*stack-top-hint* (sb-di::find-stepped-frame))) + (sb-impl::invoke-debugger condition)))))) (funcall fun))) (defun nth-frame (index) --- /project/slime/cvsroot/slime/swank.lisp 2006/09/18 21:27:49 1.399 +++ /project/slime/cvsroot/slime/swank.lisp 2006/09/18 21:56:13 1.400 @@ -2697,7 +2697,7 @@ "The list of currenlty active restarts.") (defvar *sldb-stepping-p* nil - "True when during execution of a stepp command.") + "True during execution of a step command.") (defvar *sldb-quit-restart* 'abort-request "What restart should swank attempt to invoke when the user sldb-quits.") @@ -2887,13 +2887,21 @@ (with-buffer-syntax () (sldb-break-at-start (read-from-string name)))) -(defslimefun sldb-step (frame) - (cond ((find-restart 'continue) +(defmacro define-stepper-function (name backend-function-name) + `(defslimefun ,name (frame) + (cond ((sldb-stepper-condition-p *swank-debugger-condition*) + (setq *sldb-stepping-p* t) + (,backend-function-name)) + ((find-restart 'continue) (activate-stepping frame) (setq *sldb-stepping-p* t) (continue)) (t - (error "No continue restart.")))) + (error "Not currently single-stepping, and no continue restart available."))))) + +(define-stepper-function sldb-step sldb-step-into) +(define-stepper-function sldb-next sldb-step-next) +(define-stepper-function sldb-out sldb-step-out) ;;;; Compilation Commands. From jsnellman at common-lisp.net Tue Sep 19 11:56:38 2006 From: jsnellman at common-lisp.net (jsnellman) Date: Tue, 19 Sep 2006 07:56:38 -0400 (EDT) Subject: [slime-cvs] CVS slime Message-ID: <20060919115638.A2F751C014@common-lisp.net> Update of /project/slime/cvsroot/slime In directory clnet:/tmp/cvs-serv11713 Modified Files: ChangeLog swank-sbcl.lisp Log Message: fix stepper on threaded SBCL --- /project/slime/cvsroot/slime/ChangeLog 2006/09/18 21:56:13 1.947 +++ /project/slime/cvsroot/slime/ChangeLog 2006/09/19 11:56:38 1.948 @@ -1,3 +1,10 @@ +2006-09-19 Juho Snellman + + * swank-backend.lisp (call-with-debugger-hook): make the stepper + also work with a threaded SBCL, by binding a handler for + sb-ext:stepper-condition instead of relying on the one that SBCL + establishes on the toplevel + 2006-09-19 Juho Snellman Extend the stepper protocol to work nicely with the SBCL stepper. --- /project/slime/cvsroot/slime/swank-sbcl.lisp 2006/09/18 21:56:13 1.162 +++ /project/slime/cvsroot/slime/swank-sbcl.lisp 2006/09/19 11:56:38 1.163 @@ -137,7 +137,7 @@ (return (sb-bsd-sockets:socket-accept socket)) (sb-bsd-sockets:interrupted-error ())))) -(defimplementation call-without-interrupts (fn) +(defimplementation call-without-interrupts (fn) (declare (type function fn)) (sb-sys:without-interrupts (funcall fn))) @@ -634,7 +634,10 @@ (when (typep condition 'sb-ext:step-form-condition) (let ((sb-debug:*stack-top-hint* (sb-di::find-stepped-frame))) (sb-impl::invoke-debugger condition)))))) - (funcall fun))) + (handler-bind ((sb-ext:step-condition + (lambda (condition) + (funcall sb-ext:*stepper-hook* condition)))) + (funcall fun)))) (defun nth-frame (index) (do ((frame *sldb-stack-top* (sb-di:frame-down frame)) From jsnellman at common-lisp.net Wed Sep 20 17:52:32 2006 From: jsnellman at common-lisp.net (jsnellman) Date: Wed, 20 Sep 2006 13:52:32 -0400 (EDT) Subject: [slime-cvs] CVS slime Message-ID: <20060920175232.EE5B73A00A@common-lisp.net> Update of /project/slime/cvsroot/slime In directory clnet:/tmp/cvs-serv3576 Modified Files: swank-sbcl.lisp ChangeLog Log Message: use INVOKE-STEPPER rather than funcalling *STEPPER-HOOK* --- /project/slime/cvsroot/slime/swank-sbcl.lisp 2006/09/19 11:56:38 1.163 +++ /project/slime/cvsroot/slime/swank-sbcl.lisp 2006/09/20 17:52:32 1.164 @@ -631,12 +631,12 @@ #+#.(swank-backend::sbcl-with-new-stepper-p) (sb-ext:*stepper-hook* (lambda (condition) - (when (typep condition 'sb-ext:step-form-condition) - (let ((sb-debug:*stack-top-hint* (sb-di::find-stepped-frame))) - (sb-impl::invoke-debugger condition)))))) - (handler-bind ((sb-ext:step-condition - (lambda (condition) - (funcall sb-ext:*stepper-hook* condition)))) + (typecase condition + (sb-ext:step-form-condition + (let ((sb-debug:*stack-top-hint* (sb-di::find-stepped-frame))) + (sb-impl::invoke-debugger condition))))))) + (handler-bind (#+#.(swank-backend::sbcl-with-new-stepper-p) + (sb-ext:step-condition #'sb-impl::invoke-stepper)) (funcall fun)))) (defun nth-frame (index) --- /project/slime/cvsroot/slime/ChangeLog 2006/09/19 11:56:38 1.948 +++ /project/slime/cvsroot/slime/ChangeLog 2006/09/20 17:52:32 1.949 @@ -1,6 +1,11 @@ +2006-09-20 Juho Snellman + + * swank-sbcl.lisp (call-with-debugger-hook): use INVOKE-STEPPER + instead of calling the stepper hook manually + 2006-09-19 Juho Snellman - * swank-backend.lisp (call-with-debugger-hook): make the stepper + * swank-sbcl.lisp (call-with-debugger-hook): make the stepper also work with a threaded SBCL, by binding a handler for sb-ext:stepper-condition instead of relying on the one that SBCL establishes on the toplevel From mbaringer at common-lisp.net Wed Sep 20 18:35:04 2006 From: mbaringer at common-lisp.net (mbaringer) Date: Wed, 20 Sep 2006 14:35:04 -0400 (EDT) Subject: [slime-cvs] CVS slime Message-ID: <20060920183504.9A4644E000@common-lisp.net> Update of /project/slime/cvsroot/slime In directory clnet:/tmp/cvs-serv8095 Modified Files: ChangeLog Log Message: --- /project/slime/cvsroot/slime/ChangeLog 2006/09/20 17:52:32 1.949 +++ /project/slime/cvsroot/slime/ChangeLog 2006/09/20 18:35:04 1.950 @@ -1,3 +1,8 @@ +2006-09-20 Marco Baringer + + * slime.el (slime-read-package-name): Set require to T. It doesn't + make any sense to switch to an inexistent package. + 2006-09-20 Juho Snellman * swank-sbcl.lisp (call-with-debugger-hook): use INVOKE-STEPPER From mbaringer at common-lisp.net Wed Sep 20 18:35:21 2006 From: mbaringer at common-lisp.net (mbaringer) Date: Wed, 20 Sep 2006 14:35:21 -0400 (EDT) Subject: [slime-cvs] CVS slime Message-ID: <20060920183521.9659858326@common-lisp.net> Update of /project/slime/cvsroot/slime In directory clnet:/tmp/cvs-serv8161 Modified Files: ChangeLog Log Message: --- /project/slime/cvsroot/slime/ChangeLog 2006/09/20 18:35:04 1.950 +++ /project/slime/cvsroot/slime/ChangeLog 2006/09/20 18:35:21 1.951 @@ -1,7 +1,8 @@ 2006-09-20 Marco Baringer - * slime.el (slime-read-package-name): Set require to T. It doesn't - make any sense to switch to an inexistent package. + * slime.el (slime-read-package-name): Set require to T in the cal + to completing read, it doesn't make any sense to switch to an + inexistent package. 2006-09-20 Juho Snellman From mbaringer at common-lisp.net Wed Sep 20 18:35:29 2006 From: mbaringer at common-lisp.net (mbaringer) Date: Wed, 20 Sep 2006 14:35:29 -0400 (EDT) Subject: [slime-cvs] CVS slime Message-ID: <20060920183529.2BE5D60004@common-lisp.net> Update of /project/slime/cvsroot/slime In directory clnet:/tmp/cvs-serv8194 Modified Files: ChangeLog Log Message: --- /project/slime/cvsroot/slime/ChangeLog 2006/09/20 18:35:21 1.951 +++ /project/slime/cvsroot/slime/ChangeLog 2006/09/20 18:35:29 1.952 @@ -1,6 +1,6 @@ 2006-09-20 Marco Baringer - * slime.el (slime-read-package-name): Set require to T in the cal + * slime.el (slime-read-package-name): Set require to T in the call to completing read, it doesn't make any sense to switch to an inexistent package. From mbaringer at common-lisp.net Wed Sep 20 18:35:36 2006 From: mbaringer at common-lisp.net (mbaringer) Date: Wed, 20 Sep 2006 14:35:36 -0400 (EDT) Subject: [slime-cvs] CVS slime Message-ID: <20060920183536.3EFB2710D2@common-lisp.net> Update of /project/slime/cvsroot/slime In directory clnet:/tmp/cvs-serv8221 Modified Files: slime.el Log Message: --- /project/slime/cvsroot/slime/slime.el 2006/09/18 21:56:13 1.651 +++ /project/slime/cvsroot/slime/slime.el 2006/09/20 18:35:36 1.652 @@ -1128,7 +1128,7 @@ (completing-read prompt (slime-bogus-completion-alist (slime-eval `(swank:list-all-package-names t))) - nil nil initial-value))) + nil t initial-value))) ;; Interface (defun slime-read-symbol-name (prompt &optional query) From mbaringer at common-lisp.net Wed Sep 20 18:37:01 2006 From: mbaringer at common-lisp.net (mbaringer) Date: Wed, 20 Sep 2006 14:37:01 -0400 (EDT) Subject: [slime-cvs] CVS slime Message-ID: <20060920183701.B7D8775026@common-lisp.net> Update of /project/slime/cvsroot/slime In directory clnet:/tmp/cvs-serv8255 Modified Files: swank-sbcl.lisp Log Message: --- /project/slime/cvsroot/slime/swank-sbcl.lisp 2006/09/20 17:52:32 1.164 +++ /project/slime/cvsroot/slime/swank-sbcl.lisp 2006/09/20 18:37:01 1.165 @@ -309,7 +309,7 @@ (make-location (list :source-form source) (list :position 1))) (t - (error "unhandled case")))) + (error "unhandled case in compiler note ~S ~S ~S" file source-path source)))) (defun brief-compiler-message-for-emacs (condition) "Briefly describe a compiler error for Emacs. @@ -692,7 +692,7 @@ (defun fallback-source-location (code-location) (let ((fun (code-location-debug-fun-fun code-location))) (cond (fun (function-source-location fun)) - (t (error "Cannot find source location for: ~A " code-location))))) + (t (abort-request "Cannot find source location for: ~A " code-location))))) (defun lisp-source-location (code-location) (let ((source (prin1-to-string From mbaringer at common-lisp.net Wed Sep 20 18:37:09 2006 From: mbaringer at common-lisp.net (mbaringer) Date: Wed, 20 Sep 2006 14:37:09 -0400 (EDT) Subject: [slime-cvs] CVS slime Message-ID: <20060920183709.214582018@common-lisp.net> Update of /project/slime/cvsroot/slime In directory clnet:/tmp/cvs-serv8278 Modified Files: ChangeLog Log Message: --- /project/slime/cvsroot/slime/ChangeLog 2006/09/20 18:35:29 1.952 +++ /project/slime/cvsroot/slime/ChangeLog 2006/09/20 18:37:08 1.953 @@ -1,5 +1,10 @@ 2006-09-20 Marco Baringer + * swank-sbcl.lisp (fallback-source-location): Use abort-request + instead of error. + (locate-compiler-note): Say, in the error message, what data + caused the error. + * slime.el (slime-read-package-name): Set require to T in the call to completing read, it doesn't make any sense to switch to an inexistent package. From mbaringer at common-lisp.net Wed Sep 20 18:37:47 2006 From: mbaringer at common-lisp.net (mbaringer) Date: Wed, 20 Sep 2006 14:37:47 -0400 (EDT) Subject: [slime-cvs] CVS slime/doc Message-ID: <20060920183747.9098178001@common-lisp.net> Update of /project/slime/cvsroot/slime/doc In directory clnet:/tmp/cvs-serv8318/doc Modified Files: slime.texi Log Message: --- /project/slime/cvsroot/slime/doc/slime.texi 2006/04/20 05:46:50 1.47 +++ /project/slime/cvsroot/slime/doc/slime.texi 2006/09/20 18:37:47 1.48 @@ -34,7 +34,7 @@ @end macro @set EDITION 2.0 - at set UPDATED @code{$Date: 2006/04/20 05:46:50 $} + at set UPDATED @code{$Date: 2006/09/20 18:37:47 $} @titlepage @title SLIME User Manual @@ -64,96 +64,8 @@ * Debugger:: * Extras:: * Customization:: +* Tips and Tricks:: * Credits:: - - at detailmenu - --- The Detailed Node Listing --- - -Getting started - -* Platforms:: -* Downloading:: -* Installation:: -* Running:: - -Downloading SLIME - -* CVS:: -* CVS Incantations:: - -Downloading from CVS - -* CVS Incantations:: - - at code{slime-mode} - -* User-interface conventions:: -* Commands:: -* Semantic indentation:: -* Reader conditionals:: - -User-interface conventions - -* Temporary buffers:: -* Key bindings:: -* inferior-lisp:: -* Multithreading:: - -Commands - -* Compilation:: -* Finding definitions:: -* Lisp Evaluation:: -* Documentation:: -* Programming Helpers:: -* Recovery:: -* Cross-reference:: -* Inspector:: -* Profiling:: - -Programming Helpers - -* Completion:: -* Macro Expansion:: -* Accessing Documentation:: -* Disassembly:: - -REPL: the ``top level'' - -* REPL commands:: -* Input Navigation:: -* Shortcuts:: - -SLDB: the SLIME debugger - -* Examining frames:: -* Restarts:: -* Frame Navigation:: -* Miscellaneous:: - -Extras - -* slime-selector:: -* slime-autodoc-mode:: -* slime-macroexpansion-minor-mode:: -* Multiple connections:: -* Typeout frames:: - -Customization - -* Emacs-side customization:: -* Lisp-side:: - -Emacs-side - -* Hooks:: - -Lisp-side (Swank) - -* Communication style:: -* Other configurables:: - - at end detailmenu @end menu @node Introduction, Getting started, Top, Top @@ -1271,7 +1183,7 @@ (add-hook 'slime-connected-hook 'slime-ensure-typeout-frame) @end example - at node Customization, Credits, Extras, Top + at node Customization, Tips and Tricks, Extras, Top @chapter Customization @menu @@ -1334,7 +1246,7 @@ This variable controls filename translation between Emacs and the Lisp system. It is useful if you run Emacs and Lisp on separate machines which don't share a common file system or if they share the filessytem -but have different layouts, os is the case with @acronym{SMB}-based +but have different layouts, as is the case with @acronym{SMB}-based file sharing. @item slime-net-coding-system @@ -1508,7 +1420,162 @@ @end table - at node Credits, , Customization, Top + at node Tips and Tricks, Credits, Customization, Top + at chapter Tips and Tricks + + at menu +* Connecting to a remote lisp:: +* Global IO Redirection:: +* Auto-SLIME:: + at end menu + + at node Connecting to a remote lisp + at section Connecting to a remote lisp + +One of the advantages to the way @SLIME{} is implemented is that we +can easily run the Emacs side (slime.el) on one machine and the lisp +backend (swank) on another. The basic idea is to start up lisp on the +remote machine, load swank and wait for incoming slime connections. On +the local machine we start up emacs and tell slime to connect to the +remote machine. The details are a bit messier but the underlying idea +is that simple. + + at menu +* Setting up the lisp image:: +* Setting up Emacs:: +* Setting up pathname translations:: + at end menu + + at node Setting up the lisp image + at subsection Setting up the lisp image + + +When you want to load swank without gonig through the normal, Emacs +based, process just load the @file{swank-loader.lisp} file. Just +execute + + at example +(load "/path/to/swank-loader.lisp") + at end example + +inside a running lisp image at footnote{@SLIME{} also provides an + at acronym{ASDF} system definiton which does the same thing}. Now all we +need to do is startup our swank server. This example assumes we're +using the default settings, if you need to do anything particular +(like be able to reconnect to swank after you're done, look into + at code{swank:create-server}'s other arguments). + + at example +(swank:create-server) + at end example + +Since we're going to be tunneling our connection via +ssh at footnote{there is a way to connect without an ssh tunnel, but it +has the side-effect of giving the entire world access to your lisp +image, se we're not gonig to talk about it} and we'll only have on +port open we want to tell swank to not use an extra connection for +output: + + at example +(setf swank:*use-dedicated-output-stream* nil) + at end example + + at node Setting up Emacs + at subsection Setting up Emacs + +Now we need to create the tunnel between the local machine and the +remote machine. + + at example +ssh -L4005:127.0.0.1:4005 username@@remote.example.com + at end example + +That ssh invocation creates an ssh tunnel between the port 4005 on our +local machine and the port 4005 on the remote machine at footnote{By +default swank listens for incoming connections on port 4005, had we +passed a @code{:port} parameter to @code{swank:create-server} we'd be +using that port number instead}. + +Finally we can start @SLIME{}: + + at example +M-x slime-connect RET RET + at end example + +The @kbd{RET RET} sequence just means that we want to use the default +host (@code{127.0.0.1}) and the default port (@code{4005}). Even +though we're connecting to a remote machine the ssh tunnel fools Emacs +into thinking it's actually @code{127.0.0.1}. + + at node Setting up pathname translations + at subsection Setting up pathname translations + +One of the main problems with running swank remotely is that Emacs +assumes the files can be found using normal filenames. if we want +things like @code{slime-compile-and-load-file} (@kbd{C-c C-k}) and + at code{slime-edit-definition} (@kbd{M-.}) to work correctly we need to +find a way to let our local Emacs refer to remote files. + +There are, mainly, two ways to do this. The first is to mount, using +NFS or similar, the remote machine's hard disk on the local machine's +file system in such a fashion that a filename like + at file{/opt/project/source.lisp} refers to the same file on both +machines. Unfortunetly NFS is usually slow, often buggy, and not +always feasable, fortunetely we have an ssh connection and Emacs' + at code{tramp-mode} can do the rest. + +What we do is teach Emacs how to take a filename on the remote machine +and translate it into something that tramp can understand and access +(and vice-versa). Assuming the remote machine's host name is + at code{remote.example.com}, @code{cl:machine-instance} returns +``remote'' and we login as the user ``user'' we can use @SLIME{}'s +built-in mechanism to setup the proper transaltions by simply doing: + + at example +(push (slime-create-filename-translator :machine-instance "remote.example.com" + :remote-host "remote" + :username "user") + slime-filename-translations) + at end example + + at node Global IO Redirection + at section Globally redirecting all IO to the REPL + +By default @SLIME{} does not change @code{*standard-output*} and +friends outside of the @REPL{}. If you have any other threads which +call @code{format}, @code{write-string}, etc. that output will be seen +only in the @code{*inferior-lisp*} buffer or on the terminal, more +often than not this inconvenient. So, if you want code such as this: + + at example +(run-in-new-thread + (lambda () + (write-line "In some random thread.~%" *standard-output*))) + at end example + +to send its output to @SLIME{}'s repl buffer, as opposed to + at code{*inferior-lisp*}, set @code{swank:*globally-redirect-io*} to T. + +Note that the value of this variable is only checked when swank +accepts the connection so you should set it via + at file{~/.swank.lisp}. Otherwise you will need to call + at code{swank::globally-redirect-io-to-connection} yourself, but you +shouldn't do that unless you know what you're doing. + + at node Auto-SLIME + at section Connecting to SLIME automatically + +To making @SLIME{} connect to your lisp whenever you open a lisp file +just add this to your @file{.emacs}: + + at example +(add-hook 'slime-mode-hook + (lambda () + (unless (slime-connected-p) + (save-excursion (slime))))) + at end example + + at node Credits, , Tips and Tricks, Top @chapter Credits @emph{The soppy ending...} From mbaringer at common-lisp.net Wed Sep 20 18:37:57 2006 From: mbaringer at common-lisp.net (mbaringer) Date: Wed, 20 Sep 2006 14:37:57 -0400 (EDT) Subject: [slime-cvs] CVS slime Message-ID: <20060920183757.5E98717039@common-lisp.net> Update of /project/slime/cvsroot/slime In directory clnet:/tmp/cvs-serv8371 Modified Files: ChangeLog Log Message: --- /project/slime/cvsroot/slime/ChangeLog 2006/09/20 18:37:08 1.953 +++ /project/slime/cvsroot/slime/ChangeLog 2006/09/20 18:37:57 1.954 @@ -1,5 +1,8 @@ 2006-09-20 Marco Baringer + * doc/slime.texi: Added "Tips and Tricks" chapter (need a better + name for this). + * swank-sbcl.lisp (fallback-source-location): Use abort-request instead of error. (locate-compiler-note): Say, in the error message, what data From mbaringer at common-lisp.net Wed Sep 20 19:28:57 2006 From: mbaringer at common-lisp.net (mbaringer) Date: Wed, 20 Sep 2006 15:28:57 -0400 (EDT) Subject: [slime-cvs] CVS slime Message-ID: <20060920192857.9C9AD232B3@common-lisp.net> Update of /project/slime/cvsroot/slime In directory clnet:/tmp/cvs-serv14780 Modified Files: ChangeLog Log Message: --- /project/slime/cvsroot/slime/ChangeLog 2006/09/20 18:37:57 1.954 +++ /project/slime/cvsroot/slime/ChangeLog 2006/09/20 19:28:57 1.955 @@ -1,5 +1,9 @@ 2006-09-20 Marco Baringer + * slime.el (slime-cheat-sheet): New function. + (slime-cheat-sheet-table): New variable which specifies what the + cheat sheet should list. + * doc/slime.texi: Added "Tips and Tricks" chapter (need a better name for this). From mbaringer at common-lisp.net Wed Sep 20 19:29:04 2006 From: mbaringer at common-lisp.net (mbaringer) Date: Wed, 20 Sep 2006 15:29:04 -0400 (EDT) Subject: [slime-cvs] CVS slime Message-ID: <20060920192904.0CCF924009@common-lisp.net> Update of /project/slime/cvsroot/slime In directory clnet:/tmp/cvs-serv14821 Modified Files: slime.el Log Message: --- /project/slime/cvsroot/slime/slime.el 2006/09/20 18:35:36 1.652 +++ /project/slime/cvsroot/slime/slime.el 2006/09/20 19:29:03 1.653 @@ -9336,6 +9336,92 @@ (indent-region start end nil))))) +;;;; Cheat Sheet + +(defun slime-cheat-sheet () + (interactive) + (switch-to-buffer-other-frame (get-buffer-create "*SLIME Cheat Sheet*")) + (setq buffer-read-only nil) + (delete-region (point-min) (point-max)) + (goto-char (point-min)) + (insert "SLIME: The Superior Lisp Interaction Mode for Emacs (minor-mode).\n\n") + (dolist (mode slime-cheat-sheet-table) + (let ((title (getf mode :title)) + (mode-map (getf mode :map)) + (mode-keys (getf mode :bindings))) + (insert title) + (insert ":\n") + (insert (make-string (1+ (length title)) ?-)) + (insert "\n") + (let ((keys '()) + (descriptions '())) + (dolist (func mode-keys) + ;; func is eithor the function name or a list (NAME DESCRIPTION) + (push (if (symbolp func) + (prin1-to-string func) + (second func)) + descriptions) + (push (key-description (where-is-internal (if (symbolp func) + func + (first func)) + (symbol-value mode-map) + t)) + + keys)) + (loop + with key-length = (apply 'max (mapcar 'length keys)) + with desc-length = (apply 'max (mapcar 'length descriptions)) + for key in (nreverse keys) + for desc in (nreverse descriptions) + do (insert desc) + do (insert (make-string (- desc-length (length desc)) ? )) + do (insert " => ") + do (insert (if (string= "" key) + "" + key)) + do (insert "\n") + finally do (insert "\n"))))) + (setq buffer-read-only t) + (goto-char (point-min))) + +(defvar slime-cheat-sheet-table + '((:title "Evaluating lisp code" + :map slime-mode-map + :bindings (slime-eval-defun + slime-compile-defun + slime-interactive-eval + slime-compile-and-load-file)) + (:title "Finding Definitions" + :map slime-mode-map + :bindings (slime-edit-definition + slime-pop-find-definition-stack)) + (:title "Completion" + :map slime-mode-map + :bindings (slime-indent-and-complete-symbol + slime-fuzzy-complete-symbol)) + (:title "At the REPL" + :map slime-repl-mode-map + :bindings (slime-repl-clear-buffer + slime-describe-symbol)) + (:title "Within SLDB buffers" + :map sldb-mode-map + :bindings ((sldb-toggle-details "Toggle frame details visualization") + (sldb-quit "Quit to REPL") + (sldb-abort "Invoke ABORT restart") + (sldb-continue "Invoke CONTINUE restart (if available)") + (sldb-show-source "Jump to frame's source code") + (sldb-eval-in-frame "Evaluate in frame at point") + (sldb-inspect-in-frame "Evaluate in frame at point and inspect result"))) + (:title "Within the Inspector" + :map slime-inspector-mode-map + :bindings ((slime-inspector-next-inspectable-object "Jump to next inspectable object") + (slime-inspector-operate-on-point "Inspect object or execute action at point") + (slime-inspector-reinspect "Reinspect current object") + (slime-inspector-pop "Return to previous object") + (slime-inspector-copy-down "Send object at point to REPL") + (slime-inspector-quit "Quit"))))) + + ;;;; Test suite (defstruct (slime-test (:conc-name slime-test.)) @@ -10630,3 +10716,4 @@ ;; unibyte: t ;; End: ;;; slime.el ends here +( \ No newline at end of file From mbaringer at common-lisp.net Wed Sep 20 21:25:09 2006 From: mbaringer at common-lisp.net (mbaringer) Date: Wed, 20 Sep 2006 17:25:09 -0400 (EDT) Subject: [slime-cvs] CVS slime Message-ID: <20060920212509.A9F1716033@common-lisp.net> Update of /project/slime/cvsroot/slime In directory clnet:/tmp/cvs-serv26530 Modified Files: slime.el Log Message: --- /project/slime/cvsroot/slime/slime.el 2006/09/20 19:29:03 1.653 +++ /project/slime/cvsroot/slime/slime.el 2006/09/20 21:25:09 1.654 @@ -10716,4 +10716,3 @@ ;; unibyte: t ;; End: ;;; slime.el ends here -( \ No newline at end of file From mbaringer at common-lisp.net Thu Sep 21 16:54:13 2006 From: mbaringer at common-lisp.net (mbaringer) Date: Thu, 21 Sep 2006 12:54:13 -0400 (EDT) Subject: [slime-cvs] CVS slime Message-ID: <20060921165413.5B74F34001@common-lisp.net> Update of /project/slime/cvsroot/slime In directory clnet:/tmp/cvs-serv28729 Modified Files: ChangeLog Log Message: --- /project/slime/cvsroot/slime/ChangeLog 2006/09/20 19:28:57 1.955 +++ /project/slime/cvsroot/slime/ChangeLog 2006/09/21 16:54:13 1.956 @@ -1,9 +1,31 @@ +2006-09-21 Marco Baringer + + * swank.lisp (find-definitions-for-emacs): Don't return locations + whose CAR is :error. + (xref): Process whatever is returned by the various xref functions + with the new sanitize-xrefs functions. + (sanitize-xrefs): Clean up the list of xrefs to remove duplicates. + Patch by Dan Weinreb + + * slime.el (slime-goto-first-note-after-compilation): New + variable. This controls the behaviour of (next|prev)-note + immediatly after a slime-compile-and-load-file. + (slime-compilation-just-finished): New variable. + (slime-compilation-finished): Update slime-compilation-finished. + (slime-next-note, slime-previous-note): Respect + slime-compilation-just-finished. + (slime-autodoc-use-multiline-p): Specify the type. + (slime-repl-grab-old-input): Typo in docstring. + 2006-09-20 Marco Baringer * slime.el (slime-cheat-sheet): New function. (slime-cheat-sheet-table): New variable which specifies what the cheat sheet should list. - + (slime-read-package-name): Set require to T in the call to + completing read, it doesn't make any sense to switch to an + inexistent package. + * doc/slime.texi: Added "Tips and Tricks" chapter (need a better name for this). @@ -12,10 +34,6 @@ (locate-compiler-note): Say, in the error message, what data caused the error. - * slime.el (slime-read-package-name): Set require to T in the call - to completing read, it doesn't make any sense to switch to an - inexistent package. - 2006-09-20 Juho Snellman * swank-sbcl.lisp (call-with-debugger-hook): use INVOKE-STEPPER From mbaringer at common-lisp.net Thu Sep 21 16:55:18 2006 From: mbaringer at common-lisp.net (mbaringer) Date: Thu, 21 Sep 2006 12:55:18 -0400 (EDT) Subject: [slime-cvs] CVS slime Message-ID: <20060921165518.63C683A00C@common-lisp.net> Update of /project/slime/cvsroot/slime In directory clnet:/tmp/cvs-serv28970 Modified Files: slime.el Log Message: (slime-goto-first-note-after-compilation): New variable. This controls the behaviour of (next|prev)-note immediatly after a slime-compile-and-load-file. (slime-compilation-just-finished): New variable. (slime-compilation-finished): Update slime-compilation-finished. (slime-next-note, slime-previous-note): Respect slime-compilation-just-finished. (slime-autodoc-use-multiline-p): Specify the type. (slime-repl-grab-old-input): Typo in docstring. --- /project/slime/cvsroot/slime/slime.el 2006/09/20 21:25:09 1.654 +++ /project/slime/cvsroot/slime/slime.el 2006/09/21 16:55:18 1.655 @@ -235,6 +235,12 @@ slime-list-compiler-notes slime-maybe-show-xrefs-for-notes)) +(defcustom slime-goto-first-note-after-compilation nil + "When T next-note will always goto to the first note in a +final, no matter where the point is." + :group 'slime-mode + :type 'boolean) + (defcustom slime-complete-symbol-function 'slime-complete-symbol* "*Function to perform symbol completion." :group 'slime-mode @@ -3676,7 +3682,7 @@ (defun slime-repl-grab-old-input (replace) "Resend the old REPL input at point. -If replace it non-nil the current input is replaced with the old +If replace is non-nil the current input is replaced with the old input; otherwise the new input is appended. The old input has the text property `slime-repl-old-input'." (multiple-value-bind (beg end) (slime-property-bounds 'slime-repl-old-input) @@ -4542,6 +4548,7 @@ (defun slime-compilation-finished (result buffer) (let ((notes (slime-compiler-notes))) (with-current-buffer buffer + (setf slime-compilation-just-finished t) (multiple-value-bind (result secs) result (slime-show-note-counts notes secs) (slime-highlight-notes notes))) @@ -5257,21 +5264,40 @@ ;;;;; Visiting and navigating the overlays of compiler notes +(defvar slime-compilation-just-finished nil + "A buffer local variable which is T when we've just compiled a +buffer and haven't yet started navigating its notes.") +(make-variable-buffer-local 'slime-compilation-just-finished) + (defun slime-next-note () "Go to and describe the next compiler note in the buffer." (interactive) - (slime-find-next-note) - (if (slime-note-at-point) - (slime-show-note (slime-note-at-point)) - (message "No next note."))) + (let ((here (point))) + (when (and slime-goto-first-note-after-compilation + slime-compilation-just-finished) + (goto-char (point-min)) + (setf slime-compilation-just-finished nil)) + (slime-find-next-note) + (if (slime-note-at-point) + (slime-show-note (slime-note-at-point)) + (progn + (goto-char here) + (message "No next note."))))) (defun slime-previous-note () "Go to and describe the previous compiler note in the buffer." (interactive) - (slime-find-previous-note) - (if (slime-note-at-point) - (slime-show-note (slime-note-at-point)) - (message "No previous note."))) + (let ((here (point))) + (when (and slime-goto-first-note-after-compilation + slime-compilation-just-finished) + (goto-char (point-max)) + (setf slime-compilation-just-finished nil)) + (slime-find-previous-note) + (if (slime-note-at-point) + (slime-show-note (slime-note-at-point)) + (progn + (goto-char here) + (message "No previous note."))))) (defun slime-remove-notes () "Remove compiler-note annotations from the current buffer." @@ -5470,6 +5496,7 @@ (defcustom slime-autodoc-use-multiline-p nil "If non-nil, allow long autodoc messages to resize echo area display." + :type 'boolean :group 'slime-ui) (defun slime-autodoc-message (doc) From mbaringer at common-lisp.net Thu Sep 21 16:56:07 2006 From: mbaringer at common-lisp.net (mbaringer) Date: Thu, 21 Sep 2006 12:56:07 -0400 (EDT) Subject: [slime-cvs] CVS slime Message-ID: <20060921165607.D78167C032@common-lisp.net> Update of /project/slime/cvsroot/slime In directory clnet:/tmp/cvs-serv29079 Modified Files: swank.lisp Log Message: (find-definitions-for-emacs): Don't return locations whose CAR is :error. (xref): Process whatever is returned by the various xref functions with the new sanitize-xrefs functions. (sanitize-xrefs): Clean up the list of xrefs to remove duplicates. Patch by Dan Weinreb --- /project/slime/cvsroot/slime/swank.lisp 2006/09/18 21:56:13 1.400 +++ /project/slime/cvsroot/slime/swank.lisp 2006/09/21 16:56:07 1.401 @@ -3874,7 +3874,8 @@ (ignore-errors (values (from-string name))) (cond (error '()) (t (loop for (dspec loc) in (find-definitions sexp) - collect (list (to-string dspec) loc)))))) + unless (eql :error (first loc)) + collect (list (to-string dspec) loc)))))) (defun alistify (list key test) "Partition the elements of LIST into an alist. KEY extracts the key @@ -3939,16 +3940,27 @@ (defslimefun xref (type symbol-name) (let ((symbol (parse-symbol-or-lose symbol-name *buffer-package*))) (group-xrefs - (ecase type - (:calls (who-calls symbol)) - (:calls-who (calls-who symbol)) - (:references (who-references symbol)) - (:binds (who-binds symbol)) - (:sets (who-sets symbol)) - (:macroexpands (who-macroexpands symbol)) - (:specializes (who-specializes symbol)) - (:callers (list-callers symbol)) - (:callees (list-callees symbol)))))) + (sanitize-xrefs + (ecase type + (:calls (who-calls symbol)) + (:calls-who (calls-who symbol)) + (:references (who-references symbol)) + (:binds (who-binds symbol)) + (:sets (who-sets symbol)) + (:macroexpands (who-macroexpands symbol)) + (:specializes (who-specializes symbol)) + (:callers (list-callers symbol)) + (:callees (list-callees symbol))))))) + +(defun sanitize-xrefs (x) + (remove-duplicates + (remove-if (lambda (f) + (member f '(nil #+sbcl sb-c::step-form))) + x + :key #'car) + :test (lambda (a b) + (and (eq (first a) (first b)) + (equal (second a) (second b)))))) ;;;; Inspecting From mbaringer at common-lisp.net Thu Sep 21 17:36:18 2006 From: mbaringer at common-lisp.net (mbaringer) Date: Thu, 21 Sep 2006 13:36:18 -0400 (EDT) Subject: [slime-cvs] CVS slime Message-ID: <20060921173618.AB8CB83002@common-lisp.net> Update of /project/slime/cvsroot/slime In directory clnet:/tmp/cvs-serv3954 Modified Files: ChangeLog Log Message: --- /project/slime/cvsroot/slime/ChangeLog 2006/09/21 16:54:13 1.956 +++ /project/slime/cvsroot/slime/ChangeLog 2006/09/21 17:36:18 1.957 @@ -16,6 +16,8 @@ slime-compilation-just-finished. (slime-autodoc-use-multiline-p): Specify the type. (slime-repl-grab-old-input): Typo in docstring. + (slime-cheat-sheet): Deal with multiple-bindings + (slime-cheat-sheet-table): Update as per #lisp's suggestions. 2006-09-20 Marco Baringer From mbaringer at common-lisp.net Thu Sep 21 17:36:30 2006 From: mbaringer at common-lisp.net (mbaringer) Date: Thu, 21 Sep 2006 13:36:30 -0400 (EDT) Subject: [slime-cvs] CVS slime Message-ID: <20060921173630.263C952004@common-lisp.net> Update of /project/slime/cvsroot/slime In directory clnet:/tmp/cvs-serv4008 Modified Files: slime.el Log Message: --- /project/slime/cvsroot/slime/slime.el 2006/09/21 16:55:18 1.655 +++ /project/slime/cvsroot/slime/slime.el 2006/09/21 17:36:29 1.656 @@ -9388,13 +9388,16 @@ (prin1-to-string func) (second func)) descriptions) - (push (key-description (where-is-internal (if (symbolp func) - func - (first func)) - (symbol-value mode-map) - t)) - - keys)) + (let ((all-bindings (where-is-internal (if (symbolp func) + func + (first func)) + (symbol-value mode-map))) + (key-bindings '())) + (dolist (binding all-bindings) + (when (and (vectorp binding) + (integerp (aref binding 0))) + (push binding key-bindings))) + (push (mapconcat 'key-description key-bindings " or ") keys))) (loop with key-length = (apply 'max (mapcar 'length keys)) with desc-length = (apply 'max (mapcar 'length descriptions)) @@ -9412,16 +9415,16 @@ (goto-char (point-min))) (defvar slime-cheat-sheet-table - '((:title "Evaluating lisp code" - :map slime-mode-map - :bindings (slime-eval-defun - slime-compile-defun - slime-interactive-eval - slime-compile-and-load-file)) - (:title "Finding Definitions" + '((:title "Editing lisp code" :map slime-mode-map - :bindings (slime-edit-definition - slime-pop-find-definition-stack)) + :bindings ((slime-eval-defun "Evaluate current top level form") + (slime-compile-defun "Compile current top level form") + (slime-interactive-eval "Prompt for form and eval it") + (slime-compile-and-load-file "Compile and load current file") + (slime-sync-package-and-default-directory "Synch default package and directory with current buffer") + (slime-next-note "Next compiler note") + (slime-previous-note "Previous compiler note") + (slime-remove-notes "Remove notes"))) (:title "Completion" :map slime-mode-map :bindings (slime-indent-and-complete-symbol @@ -9432,7 +9435,8 @@ slime-describe-symbol)) (:title "Within SLDB buffers" :map sldb-mode-map - :bindings ((sldb-toggle-details "Toggle frame details visualization") + :bindings ((sldb-default-action "Do 'whatever' with thing at point") + (sldb-toggle-details "Toggle frame details visualization") (sldb-quit "Quit to REPL") (sldb-abort "Invoke ABORT restart") (sldb-continue "Invoke CONTINUE restart (if available)") @@ -9446,7 +9450,11 @@ (slime-inspector-reinspect "Reinspect current object") (slime-inspector-pop "Return to previous object") (slime-inspector-copy-down "Send object at point to REPL") - (slime-inspector-quit "Quit"))))) + (slime-inspector-quit "Quit"))) + (:title "Finding Definitions" + :map slime-mode-map + :bindings (slime-edit-definition + slime-pop-find-definition-stack)))) ;;;; Test suite From mbaringer at common-lisp.net Thu Sep 21 17:44:35 2006 From: mbaringer at common-lisp.net (mbaringer) Date: Thu, 21 Sep 2006 13:44:35 -0400 (EDT) Subject: [slime-cvs] CVS slime Message-ID: <20060921174435.14E025F000@common-lisp.net> Update of /project/slime/cvsroot/slime In directory clnet:/tmp/cvs-serv6358 Modified Files: slime.el Log Message: --- /project/slime/cvsroot/slime/slime.el 2006/09/21 17:36:29 1.656 +++ /project/slime/cvsroot/slime/slime.el 2006/09/21 17:44:34 1.657 @@ -9424,7 +9424,8 @@ (slime-sync-package-and-default-directory "Synch default package and directory with current buffer") (slime-next-note "Next compiler note") (slime-previous-note "Previous compiler note") - (slime-remove-notes "Remove notes"))) + (slime-remove-notes "Remove notes") + slime-hyperspec-lookup)) (:title "Completion" :map slime-mode-map :bindings (slime-indent-and-complete-symbol From jsnellman at common-lisp.net Sun Sep 24 21:52:55 2006 From: jsnellman at common-lisp.net (jsnellman) Date: Sun, 24 Sep 2006 17:52:55 -0400 (EDT) Subject: [slime-cvs] CVS slime Message-ID: <20060924215255.57FF433024@common-lisp.net> Update of /project/slime/cvsroot/slime In directory clnet:/tmp/cvs-serv21946 Modified Files: swank.lisp swank-sbcl.lisp swank-backend.lisp ChangeLog Log Message: fix SBCL 0.9.17 --- /project/slime/cvsroot/slime/swank.lisp 2006/09/21 16:56:07 1.401 +++ /project/slime/cvsroot/slime/swank.lisp 2006/09/24 21:52:54 1.402 @@ -3955,7 +3955,7 @@ (defun sanitize-xrefs (x) (remove-duplicates (remove-if (lambda (f) - (member f '(nil #+sbcl sb-c::step-form))) + (member f (ignored-xref-function-names))) x :key #'car) :test (lambda (a b) --- /project/slime/cvsroot/slime/swank-sbcl.lisp 2006/09/20 18:37:01 1.165 +++ /project/slime/cvsroot/slime/swank-sbcl.lisp 2006/09/24 21:52:55 1.166 @@ -22,6 +22,16 @@ (import-from :sb-gray *gray-stream-symbols* :swank-backend) +;;; backwards compability tests + +(eval-when (:compile-toplevel :load-toplevel :execute) + ;; Generate a form suitable for testing for stepper support (0.9.17) + ;; with #+. + (defun sbcl-with-new-stepper-p () + (if (find-symbol "ENABLE-STEPPING" "SB-IMPL") + '(and) + '(or)))) + ;;; swank-mop (import-swank-mop-symbols :sb-mop '(:slot-definition-documentation)) @@ -568,6 +578,10 @@ (let ((fn (fdefinition symbol))) (mapcar #'function-dspec (sb-introspect:find-function-callees fn)))) +#-#.(swank-backend::sbcl-with-new-stepper-p) +(defimplementation ignored-xref-function-names () + '(nil sb-c::step-form sb-c::step-values)) + (defun function-dspec (fn) "Describe where the function FN was defined. Return a list of the form (NAME LOCATION)." @@ -583,14 +597,6 @@ ;;; Debugging -(eval-when (:compile-toplevel :load-toplevel :execute) - ;; Generate a form suitable for testing for stepper support (0.9.17) - ;; with #+. - (defun sbcl-with-new-stepper-p () - (if (find-symbol "ENABLE-STEPPING" "SB-IMPL") - '(and) - '(or)))) - (defvar *sldb-stack-top*) (defimplementation install-debugger-globally (function) --- /project/slime/cvsroot/slime/swank-backend.lisp 2006/09/18 21:56:13 1.103 +++ /project/slime/cvsroot/slime/swank-backend.lisp 2006/09/24 21:52:55 1.104 @@ -732,6 +732,12 @@ "List the functions called by FUNCTION-NAME. See LIST-CALLERS for a description of the return value.") +;;; Utilities + +(definterface ignored-xref-function-names () + "List of function names that SANITIZE-XREFS should remove." + '(nil)) + ;;;; Profiling --- /project/slime/cvsroot/slime/ChangeLog 2006/09/21 17:36:18 1.957 +++ /project/slime/cvsroot/slime/ChangeLog 2006/09/24 21:52:55 1.958 @@ -1,3 +1,18 @@ +2006-09-25 Juho Snellman + + Fix Slime on SBCL 0.9.17. + + * swank-backend.lisp (ignored-xref-function-names): New interface + + * swank.lisp (sanitize-xrefs): Use ignored-xref-function-names + instead of having a #+sbcl special case. + + * swank-sbcl.lisp (ignored-xref-function-names): Implement. + Filter out SB-C::STEP-VALUES, not just SB-C::STEP-FORM, as done by + the old sanitize-xrefs. Don't implement the interface at all if + SBCL is sufficiently new (those symbols don't exist any more, and + there's nothing in their place to be ignored). + 2006-09-21 Marco Baringer * swank.lisp (find-definitions-for-emacs): Don't return locations From mbaringer at common-lisp.net Wed Sep 27 10:42:07 2006 From: mbaringer at common-lisp.net (mbaringer) Date: Wed, 27 Sep 2006 06:42:07 -0400 (EDT) Subject: [slime-cvs] CVS slime Message-ID: <20060927104207.8B44F2200D@common-lisp.net> Update of /project/slime/cvsroot/slime In directory clnet:/tmp/cvs-serv21498 Modified Files: swank.lisp Log Message: (*globally-redirect-io*): Change default value to T. --- /project/slime/cvsroot/slime/swank.lisp 2006/09/24 21:52:54 1.402 +++ /project/slime/cvsroot/slime/swank.lisp 2006/09/27 10:42:07 1.403 @@ -922,7 +922,7 @@ ;;; variables, so they can always be assigned to affect a global ;;; change. -(defvar *globally-redirect-io* nil +(defvar *globally-redirect-io* t "When non-nil globally redirect all standard streams to Emacs.") (defmacro setup-stream-indirection (stream-var) From mbaringer at common-lisp.net Wed Sep 27 10:42:17 2006 From: mbaringer at common-lisp.net (mbaringer) Date: Wed, 27 Sep 2006 06:42:17 -0400 (EDT) Subject: [slime-cvs] CVS slime Message-ID: <20060927104217.19C602200E@common-lisp.net> Update of /project/slime/cvsroot/slime In directory clnet:/tmp/cvs-serv21555 Modified Files: ChangeLog Log Message: --- /project/slime/cvsroot/slime/ChangeLog 2006/09/24 21:52:55 1.958 +++ /project/slime/cvsroot/slime/ChangeLog 2006/09/27 10:42:16 1.959 @@ -1,3 +1,7 @@ +2006-09-27 Marco Baringer + + * swank.lisp (*globally-redirect-io*): Change default value to T. + 2006-09-25 Juho Snellman Fix Slime on SBCL 0.9.17. From mbaringer at common-lisp.net Wed Sep 27 22:52:26 2006 From: mbaringer at common-lisp.net (mbaringer) Date: Wed, 27 Sep 2006 18:52:26 -0400 (EDT) Subject: [slime-cvs] CVS slime Message-ID: <20060927225226.2E81347156@common-lisp.net> Update of /project/slime/cvsroot/slime In directory clnet:/tmp/cvs-serv4425 Modified Files: swank-loader.lisp Log Message: (compile-files-if-needed-serially): Don't ignore compile-time errors but drop into a debugger (it's not a slime debugger but it's certainly better than ignoring the error). --- /project/slime/cvsroot/slime/swank-loader.lisp 2006/04/13 10:41:59 1.59 +++ /project/slime/cvsroot/slime/swank-loader.lisp 2006/09/27 22:52:26 1.60 @@ -142,22 +142,26 @@ (dolist (source-pathname files) (let ((binary-pathname (binary-pathname source-pathname fasl-directory))) - (handler-case - (progn - (when (or needs-recompile - (not (probe-file binary-pathname)) - (file-newer-p source-pathname binary-pathname)) - (ensure-directories-exist binary-pathname) - (compile-file source-pathname :output-file binary-pathname - :print nil :verbose t) - (setq needs-recompile t)) - (load binary-pathname :verbose t)) - #+(or) - (error () - ;; If an error occurs compiling, load the source instead - ;; so we can try to debug it. - (load source-pathname)) - )))))) + (when (or needs-recompile + (not (probe-file binary-pathname)) + (file-newer-p source-pathname binary-pathname)) + ;; need a to recompile source-pathname, so we'll + ;; nede to recompile everything after this too. + (setq needs-recompile t) + (ensure-directories-exist binary-pathname) + (multiple-value-bind (output-file warningsp failurep) + (compile-file source-pathname :output-file binary-pathname + :print nil + :verbose t) + (declare (ignore output-file warningsp)) + (when failurep + ;; If an error occurs compiling, load the source + ;; instead so we can try to debug it (this next + ;; call should, unless things are really broken, + ;; signal an error). + (format *error-output* ";; ERROR wihle compiling ~S." source-pathname) + (load source-pathname)))) + (load binary-pathname :verbose t)))))) #+(or cormanlisp ecl) (defun compile-files-if-needed-serially (files fasl-directory) From mbaringer at common-lisp.net Wed Sep 27 22:53:46 2006 From: mbaringer at common-lisp.net (mbaringer) Date: Wed, 27 Sep 2006 18:53:46 -0400 (EDT) Subject: [slime-cvs] CVS slime Message-ID: <20060927225346.27CCA48143@common-lisp.net> Update of /project/slime/cvsroot/slime In directory clnet:/tmp/cvs-serv4476 Modified Files: ChangeLog Log Message: --- /project/slime/cvsroot/slime/ChangeLog 2006/09/27 10:42:16 1.959 +++ /project/slime/cvsroot/slime/ChangeLog 2006/09/27 22:53:45 1.960 @@ -1,3 +1,9 @@ +2006-09-28 Marco Baringer + + * swank-loader.lisp (compile-files-if-needed-serially): Don't + ignore compile-time errors but drop into a debugger (it's not a + slime debugger but it's certainly better than ignoring the error). + 2006-09-27 Marco Baringer * swank.lisp (*globally-redirect-io*): Change default value to T.