From mbaringer at common-lisp.net Fri Feb 2 11:52:37 2007 From: mbaringer at common-lisp.net (mbaringer) Date: Fri, 2 Feb 2007 06:52:37 -0500 (EST) Subject: [slime-cvs] CVS slime Message-ID: <20070202115237.E4225671C2@common-lisp.net> Update of /project/slime/cvsroot/slime In directory clnet:/tmp/cvs-serv15574 Modified Files: slime.el Log Message: (slime-inferior-connect): Warn, as oposed to bailing out with an error, when deleting the port file fails. Patch by: Samium Gromoff <_deepfire at feelingofgreen.ru> --- /project/slime/cvsroot/slime/slime.el 2007/01/31 13:23:39 1.756 +++ /project/slime/cvsroot/slime/slime.el 2007/02/02 11:52:37 1.757 @@ -1595,8 +1595,7 @@ (defun slime-inferior-connect (process args) "Start a Swank server in the inferior Lisp and connect." - (when (file-regular-p (slime-swank-port-file)) - (delete-file (slime-swank-port-file))) + (slime-delete-swank-port-file) (slime-start-swank-server process args) (slime-read-port-and-connect process nil)) @@ -1641,6 +1640,15 @@ (t "/tmp/"))) (format "slime.%S" (emacs-pid)))) +(defun slime-delete-swank-port-file () + (when (file-regular-p (slime-swank-port-file)) + (condition-case nil + (delete-file (slime-swank-port-file)) + (error + (display-warning 'slime + (format "Unable to delete wank port file located at %s" + (slime-swank-port-file))))))) + (defun slime-read-port-and-connect (inferior-process retries) (lexical-let ((process inferior-process) (retries retries) @@ -1662,7 +1670,7 @@ (cond ((file-exists-p (slime-swank-port-file)) (let ((port (slime-read-swank-port)) (args (slime-inferior-lisp-args process))) - (delete-file (slime-swank-port-file)) + (slime-delete-swank-port-file) (let ((c (slime-connect slime-lisp-host port (plist-get args :coding-system)))) (slime-set-inferior-process c process)))) From mbaringer at common-lisp.net Fri Feb 2 11:55:16 2007 From: mbaringer at common-lisp.net (mbaringer) Date: Fri, 2 Feb 2007 06:55:16 -0500 (EST) Subject: [slime-cvs] CVS slime Message-ID: <20070202115516.E156D702E2@common-lisp.net> Update of /project/slime/cvsroot/slime In directory clnet:/tmp/cvs-serv15911 Modified Files: ChangeLog Log Message: --- /project/slime/cvsroot/slime/ChangeLog 2007/01/31 13:23:52 1.1062 +++ /project/slime/cvsroot/slime/ChangeLog 2007/02/02 11:55:16 1.1063 @@ -1,3 +1,9 @@ +2007-02-02 Marco Baringer + + * slime.el (slime-inferior-connect): Warn, as oposed to bailing + out with an error, when deleting the port file fails. Patch by: + Samium Gromoff <_deepfire at feelingofgreen.ru> + 2007-01-31 Marco Baringer * slime.el (slime-repl-update-banner): Restore animation. From mbaringer at common-lisp.net Sat Feb 3 13:33:54 2007 From: mbaringer at common-lisp.net (mbaringer) Date: Sat, 3 Feb 2007 08:33:54 -0500 (EST) Subject: [slime-cvs] CVS slime Message-ID: <20070203133354.0322F50021@common-lisp.net> Update of /project/slime/cvsroot/slime In directory clnet:/tmp/cvs-serv18297 Modified Files: slime.el Log Message: (slime-delete-swank-port-file): Fix typo in warning message. --- /project/slime/cvsroot/slime/slime.el 2007/02/02 11:52:37 1.757 +++ /project/slime/cvsroot/slime/slime.el 2007/02/03 13:33:54 1.758 @@ -1646,7 +1646,7 @@ (delete-file (slime-swank-port-file)) (error (display-warning 'slime - (format "Unable to delete wank port file located at %s" + (format "Unable to delete swank port file located at %s" (slime-swank-port-file))))))) (defun slime-read-port-and-connect (inferior-process retries) From mbaringer at common-lisp.net Sat Feb 3 13:34:06 2007 From: mbaringer at common-lisp.net (mbaringer) Date: Sat, 3 Feb 2007 08:34:06 -0500 (EST) Subject: [slime-cvs] CVS slime Message-ID: <20070203133406.C4A79650D3@common-lisp.net> Update of /project/slime/cvsroot/slime In directory clnet:/tmp/cvs-serv18379 Modified Files: ChangeLog Log Message: --- /project/slime/cvsroot/slime/ChangeLog 2007/02/02 11:55:16 1.1063 +++ /project/slime/cvsroot/slime/ChangeLog 2007/02/03 13:34:06 1.1064 @@ -1,8 +1,17 @@ +2007-02-03 Marco Baringer + + * slime.el (slime-delete-swank-port-file): Fix typo in + warning message. + 2007-02-02 Marco Baringer - * slime.el (slime-inferior-connect): Warn, as oposed to bailing - out with an error, when deleting the port file fails. Patch by: - Samium Gromoff <_deepfire at feelingofgreen.ru> + Warn, as oposed to bailing out with an error, when deleting the + port file fails. Patch by: Samium Gromoff + <_deepfire at feelingofgreen.ru> + + * slime.el (slime-delete-swank-port-file): New function. + (slime-inferior-connect): Use slime-delete-swank-port-file. + (slime-read-port-and-connect): Use slime-delete-swank-port-file. 2007-01-31 Marco Baringer From mkoeppe at common-lisp.net Sun Feb 4 19:12:48 2007 From: mkoeppe at common-lisp.net (mkoeppe) Date: Sun, 4 Feb 2007 14:12:48 -0500 (EST) Subject: [slime-cvs] CVS slime Message-ID: <20070204191248.840EE7D0B9@common-lisp.net> Update of /project/slime/cvsroot/slime In directory clnet:/tmp/cvs-serv8691 Modified Files: slime.el Log Message: (slime-write-string): When writing a :repl-result, update the slime-output-end marker for the purpose of asynchronous output (when *use-dedicated-output-stream* is true). Reported by Madhu . --- /project/slime/cvsroot/slime/slime.el 2007/02/03 13:33:54 1.758 +++ /project/slime/cvsroot/slime/slime.el 2007/02/04 19:12:48 1.759 @@ -3020,11 +3020,15 @@ (:repl-result (with-current-buffer (slime-output-buffer) (goto-char (point-max)) - ;;(unless (bolp) (insert "\n")) - (if id - (slime-insert-presentation string id) - (slime-propertize-region `(face slime-repl-result-face) - (insert string))))))) + (let ((result-start (point))) + (if id + (slime-insert-presentation string id) + (slime-propertize-region `(face slime-repl-result-face) + (insert string))) + (if (>= (marker-position slime-output-end) (point)) + ;; If the output-end marker was moved by our insertion, + ;; set it back to the beginning of the REPL result. + (set-marker slime-output-end result-start))))))) (defun slime-switch-to-output-buffer (&optional connection) "Select the output buffer, preferably in a different window." From mkoeppe at common-lisp.net Sun Feb 4 19:13:13 2007 From: mkoeppe at common-lisp.net (mkoeppe) Date: Sun, 4 Feb 2007 14:13:13 -0500 (EST) Subject: [slime-cvs] CVS slime Message-ID: <20070204191313.ECCD67D164@common-lisp.net> Update of /project/slime/cvsroot/slime In directory clnet:/tmp/cvs-serv8750 Modified Files: ChangeLog Log Message: --- /project/slime/cvsroot/slime/ChangeLog 2007/02/03 13:34:06 1.1064 +++ /project/slime/cvsroot/slime/ChangeLog 2007/02/04 19:13:13 1.1065 @@ -1,3 +1,10 @@ +2007-02-04 Matthias Koeppe + + * slime.el (slime-write-string): When writing a :repl-result, + update the slime-output-end marker for the purpose of asynchronous + output (when *use-dedicated-output-stream* is true). + Reported by Madhu . + 2007-02-03 Marco Baringer * slime.el (slime-delete-swank-port-file): Fix typo in From mbaringer at common-lisp.net Sun Feb 4 22:28:51 2007 From: mbaringer at common-lisp.net (mbaringer) Date: Sun, 4 Feb 2007 17:28:51 -0500 (EST) Subject: [slime-cvs] CVS slime Message-ID: <20070204222851.A572C2B115@common-lisp.net> Update of /project/slime/cvsroot/slime In directory clnet:/tmp/cvs-serv3839 Modified Files: swank-lispworks.lisp Log Message: (dspec-file-position): Bind *compile-file-pathname*, *compile-file-truename*, *load-pathname* and *load-truename* in dspec-file-position. --- /project/slime/cvsroot/slime/swank-lispworks.lisp 2006/12/15 12:40:47 1.89 +++ /project/slime/cvsroot/slime/swank-lispworks.lisp 2007/02/04 22:28:51 1.90 @@ -485,13 +485,17 @@ (check-dspec form)))))) (defun dspec-file-position (file dspec) - (with-open-file (stream file) - (let ((pos - #-(or lispworks4.1 lispworks4.2) - (dspec-stream-position stream dspec))) - (if pos - (list :position (1+ pos) t) - (dspec-buffer-position dspec 1))))) + (let* ((*compile-file-pathname* (pathname file)) + (*compile-file-truename* (truename *compile-file-pathname*)) + (*load-pathname* *compile-file-pathname*) + (*load-truename* *compile-file-truename*)) + (with-open-file (stream file) + (let ((pos + #-(or lispworks4.1 lispworks4.2) + (dspec-stream-position stream dspec))) + (if pos + (list :position (1+ pos) t) + (dspec-buffer-position dspec 1)))))) (defun emacs-buffer-location-p (location) (and (consp location) From mbaringer at common-lisp.net Sun Feb 4 22:29:39 2007 From: mbaringer at common-lisp.net (mbaringer) Date: Sun, 4 Feb 2007 17:29:39 -0500 (EST) Subject: [slime-cvs] CVS slime Message-ID: <20070204222939.E91BC3201C@common-lisp.net> Update of /project/slime/cvsroot/slime In directory clnet:/tmp/cvs-serv3878 Modified Files: ChangeLog Log Message: --- /project/slime/cvsroot/slime/ChangeLog 2007/02/04 19:13:13 1.1065 +++ /project/slime/cvsroot/slime/ChangeLog 2007/02/04 22:29:39 1.1066 @@ -1,3 +1,9 @@ +2007-02-04 Antonio Menezes Leitao + + * swank-lispworks.lisp (dspec-file-position): Bind + *compile-file-pathname*, *compile-file-truename*, *load-pathname* + and *load-truename* in dspec-file-position. + 2007-02-04 Matthias Koeppe * slime.el (slime-write-string): When writing a :repl-result, From mkoeppe at common-lisp.net Mon Feb 5 16:25:19 2007 From: mkoeppe at common-lisp.net (mkoeppe) Date: Mon, 5 Feb 2007 11:25:19 -0500 (EST) Subject: [slime-cvs] CVS slime Message-ID: <20070205162519.1FA172E1C5@common-lisp.net> Update of /project/slime/cvsroot/slime In directory clnet:/tmp/cvs-serv19103 Modified Files: slime.el Log Message: (sldb-insert-locals): Repair presentation markup of frame locals. --- /project/slime/cvsroot/slime/slime.el 2007/02/04 19:12:48 1.759 +++ /project/slime/cvsroot/slime/slime.el 2007/02/05 16:25:18 1.760 @@ -8600,7 +8600,7 @@ " = ") (slime-insert-presentation (in-sldb-face local-value value) - `(:frame-var ,frame ,i)) + `(:frame-var ,(car frame) ,i)) (insert "\n"))))) (defun sldb-hide-frame-details () From mkoeppe at common-lisp.net Mon Feb 5 16:25:46 2007 From: mkoeppe at common-lisp.net (mkoeppe) Date: Mon, 5 Feb 2007 11:25:46 -0500 (EST) Subject: [slime-cvs] CVS slime Message-ID: <20070205162546.538AE3201C@common-lisp.net> Update of /project/slime/cvsroot/slime In directory clnet:/tmp/cvs-serv19178 Modified Files: ChangeLog Log Message: --- /project/slime/cvsroot/slime/ChangeLog 2007/02/04 22:29:39 1.1066 +++ /project/slime/cvsroot/slime/ChangeLog 2007/02/05 16:25:46 1.1067 @@ -1,3 +1,8 @@ +2007-02-05 Matthias Koeppe + + * slime.el (sldb-insert-locals): Repair presentation markup of + frame locals. + 2007-02-04 Antonio Menezes Leitao * swank-lispworks.lisp (dspec-file-position): Bind From mkoeppe at common-lisp.net Sat Feb 17 18:17:23 2007 From: mkoeppe at common-lisp.net (mkoeppe) Date: Sat, 17 Feb 2007 13:17:23 -0500 (EST) Subject: [slime-cvs] CVS slime Message-ID: <20070217181723.76A3C59001@common-lisp.net> Update of /project/slime/cvsroot/slime In directory clnet:/tmp/cvs-serv18307 Modified Files: slime.el Log Message: (slime-find-tag-if-tags-table-visited): New function. (slime-edit-definition-fallback-function): Offer it as a value for customization. --- /project/slime/cvsroot/slime/slime.el 2007/02/05 16:25:18 1.760 +++ /project/slime/cvsroot/slime/slime.el 2007/02/17 18:17:23 1.761 @@ -238,12 +238,14 @@ "Function to call when edit-definition fails to find the source itself. The function is called with the definition name, a string, as its argument. -If you want to fallback on TAGS you can set this to `find-tag' or +If you want to fallback on TAGS you can set this to `find-tag', +`slime-find-tag-if-tags-table-visited', or `slime-edit-definition-with-etags'." :type 'symbol :group 'slime-mode-mode :options '(nil slime-edit-definition-with-etags + slime-find-tag-if-tags-table-visited find-tag)) (defcustom slime-compilation-finished-hook 'slime-maybe-list-compiler-notes @@ -6763,6 +6765,14 @@ (t (slime-goto-definition name definitions where))))) +(defun slime-find-tag-if-tags-table-visited (name) + "Find tag (in current tags table) whose name contains NAME. +If no tags table is visited, don't offer to visit one; +just signal that no definition is known." + (if tags-table-list + (find-tag name) + (error "No known definition for: %s; use M-x visit-tags-table RET" name))) + (defun slime-goto-definition (name definitions &optional where) (slime-push-definition-stack) (let ((all-locations-equal From mkoeppe at common-lisp.net Sat Feb 17 18:17:41 2007 From: mkoeppe at common-lisp.net (mkoeppe) Date: Sat, 17 Feb 2007 13:17:41 -0500 (EST) Subject: [slime-cvs] CVS slime Message-ID: <20070217181741.58BB861046@common-lisp.net> Update of /project/slime/cvsroot/slime In directory clnet:/tmp/cvs-serv18365 Modified Files: ChangeLog Log Message: --- /project/slime/cvsroot/slime/ChangeLog 2007/02/05 16:25:46 1.1067 +++ /project/slime/cvsroot/slime/ChangeLog 2007/02/17 18:17:41 1.1068 @@ -1,3 +1,9 @@ +2007-02-17 Matthias Koeppe + + * slime.el (slime-find-tag-if-tags-table-visited): New function. + (slime-edit-definition-fallback-function): Offer it as a value + for customization. + 2007-02-05 Matthias Koeppe * slime.el (sldb-insert-locals): Repair presentation markup of From mbaringer at common-lisp.net Wed Feb 21 12:06:04 2007 From: mbaringer at common-lisp.net (mbaringer) Date: Wed, 21 Feb 2007 07:06:04 -0500 (EST) Subject: [slime-cvs] CVS slime Message-ID: <20070221120604.97DB154136@common-lisp.net> Update of /project/slime/cvsroot/slime In directory clnet:/tmp/cvs-serv21702 Modified Files: slime.el Log Message: (slime-start): Added :directory argument and pass it to slime-maybe-start-lisp. (slime-maybe-start-lisp): Added directory argument and pass it to slime-start-lisp (but not slime-reinitialize-inferior-lisp-p) (slime-start-lisp): Added directory argument. Used to set buffer's directory before starting the inferior lisp. --- /project/slime/cvsroot/slime/slime.el 2007/02/17 18:17:23 1.761 +++ /project/slime/cvsroot/slime/slime.el 2007/02/21 12:06:03 1.762 @@ -1437,7 +1437,7 @@ (destructuring-bind (name (prog &rest args) &rest keys) (assoc name table) (list* :name name :program prog :program-args args keys))) -(defun* slime-start (&key (program inferior-lisp-program) program-args +(defun* slime-start (&key (program inferior-lisp-program) program-args directory (coding-system slime-net-coding-system) (init 'slime-init-command) name @@ -1449,7 +1449,7 @@ (slime-check-coding-system coding-system) (when (slime-bytecode-stale-p) (slime-urge-bytecode-recompile)) - (let ((proc (slime-maybe-start-lisp program program-args buffer))) + (let ((proc (slime-maybe-start-lisp program program-args directory buffer))) (slime-inferior-connect proc args) (pop-to-buffer (process-buffer proc))))) @@ -1565,10 +1565,10 @@ ;;; Starting the inferior Lisp and loading Swank: -(defun slime-maybe-start-lisp (program program-args buffer) +(defun slime-maybe-start-lisp (program program-args directory buffer) "Return a new or existing inferior lisp process." (cond ((not (comint-check-proc buffer)) - (slime-start-lisp program program-args buffer)) + (slime-start-lisp program program-args directory buffer)) ((slime-reinitialize-inferior-lisp-p program program-args buffer) (when-let (conn (find (get-buffer-process buffer) slime-net-processes :key #'slime-inferior-process)) @@ -1583,10 +1583,11 @@ (equal (plist-get args :program-args) program-args) (not (y-or-n-p "Create an additional *inferior-lisp*? "))))) -(defun slime-start-lisp (program program-args buffer) +(defun slime-start-lisp (program program-args directory buffer) "Does the same as `inferior-lisp' but less ugly. Return the created process." (with-current-buffer (get-buffer-create buffer) + (cd (expand-file-name directory)) (comint-mode) (comint-exec (current-buffer) "inferior-lisp" program nil program-args) (lisp-mode-variables t) From mbaringer at common-lisp.net Wed Feb 21 12:06:17 2007 From: mbaringer at common-lisp.net (mbaringer) Date: Wed, 21 Feb 2007 07:06:17 -0500 (EST) Subject: [slime-cvs] CVS slime Message-ID: <20070221120617.8FA305C179@common-lisp.net> Update of /project/slime/cvsroot/slime In directory clnet:/tmp/cvs-serv21738 Modified Files: ChangeLog Log Message: --- /project/slime/cvsroot/slime/ChangeLog 2007/02/17 18:17:41 1.1068 +++ /project/slime/cvsroot/slime/ChangeLog 2007/02/21 12:06:17 1.1069 @@ -1,3 +1,12 @@ +2007-02-21 Marco Baringer + + * slime.el (slime-start): Added :directory argument and pass it to + slime-maybe-start-lisp. + (slime-maybe-start-lisp): Added directory argument and pass it to + slime-start-lisp (but not slime-reinitialize-inferior-lisp-p) + (slime-start-lisp): Added directory argument. Used to set buffer's + directory before starting the inferior lisp. + 2007-02-17 Matthias Koeppe * slime.el (slime-find-tag-if-tags-table-visited): New function. From mbaringer at common-lisp.net Wed Feb 21 12:06:47 2007 From: mbaringer at common-lisp.net (mbaringer) Date: Wed, 21 Feb 2007 07:06:47 -0500 (EST) Subject: [slime-cvs] CVS slime Message-ID: <20070221120647.342136209D@common-lisp.net> Update of /project/slime/cvsroot/slime In directory clnet:/tmp/cvs-serv21775 Modified Files: ChangeLog Log Message: --- /project/slime/cvsroot/slime/ChangeLog 2007/02/21 12:06:17 1.1069 +++ /project/slime/cvsroot/slime/ChangeLog 2007/02/21 12:06:46 1.1070 @@ -38,7 +38,7 @@ 2007-02-02 Marco Baringer - Warn, as oposed to bailing out with an error, when deleting the + Warn, as opposed to bailing out with an error, when deleting the port file fails. Patch by: Samium Gromoff <_deepfire at feelingofgreen.ru> From jsnellman at common-lisp.net Thu Feb 22 13:51:02 2007 From: jsnellman at common-lisp.net (jsnellman) Date: Thu, 22 Feb 2007 08:51:02 -0500 (EST) Subject: [slime-cvs] CVS slime Message-ID: <20070222135102.952A42F054@common-lisp.net> Update of /project/slime/cvsroot/slime In directory clnet:/tmp/cvs-serv21803 Modified Files: slime.el ChangeLog Log Message: * slime.el (slime-start-lisp): Don't cd if no directory was specified. --- /project/slime/cvsroot/slime/slime.el 2007/02/21 12:06:03 1.762 +++ /project/slime/cvsroot/slime/slime.el 2007/02/22 13:50:53 1.763 @@ -1587,7 +1587,8 @@ "Does the same as `inferior-lisp' but less ugly. Return the created process." (with-current-buffer (get-buffer-create buffer) - (cd (expand-file-name directory)) + (when directory + (cd (expand-file-name directory))) (comint-mode) (comint-exec (current-buffer) "inferior-lisp" program nil program-args) (lisp-mode-variables t) --- /project/slime/cvsroot/slime/ChangeLog 2007/02/21 12:06:46 1.1070 +++ /project/slime/cvsroot/slime/ChangeLog 2007/02/22 13:50:53 1.1071 @@ -1,3 +1,7 @@ +2007-02-22 Juho Snellman + + * slime.el (slime-start-lisp): Don't cd if no directory was specified. + 2007-02-21 Marco Baringer * slime.el (slime-start): Added :directory argument and pass it to From jsnellman at common-lisp.net Thu Feb 22 14:10:07 2007 From: jsnellman at common-lisp.net (jsnellman) Date: Thu, 22 Feb 2007 09:10:07 -0500 (EST) Subject: [slime-cvs] CVS slime Message-ID: <20070222141007.0F5B11B000@common-lisp.net> Update of /project/slime/cvsroot/slime In directory clnet:/tmp/cvs-serv27475 Modified Files: slime.el ChangeLog Log Message: * slime.el (slime-maybe-start-lisp): Pass directory argument to slime-start-lisp also in other cond branch. (slime-restart-sentinel): Pass a NIL directory to slime-start-lisp. --- /project/slime/cvsroot/slime/slime.el 2007/02/22 13:50:53 1.763 +++ /project/slime/cvsroot/slime/slime.el 2007/02/22 14:10:06 1.764 @@ -1574,7 +1574,8 @@ :key #'slime-inferior-process)) (slime-net-close conn)) (get-buffer-process buffer)) - (t (slime-start-lisp program program-args + (t (slime-start-lisp program program-args + directory (generate-new-buffer-name buffer))))) (defun slime-reinitialize-inferior-lisp-p (program program-args buffer) @@ -4470,6 +4471,7 @@ (buffer-window (get-buffer-window buffer)) (new-proc (slime-start-lisp (plist-get args :program) (plist-get args :program-args) + nil buffer)) (repl-buffer (slime-repl-buffer nil process)) (repl-window (and repl-buffer (get-buffer-window repl-buffer)))) --- /project/slime/cvsroot/slime/ChangeLog 2007/02/22 13:50:53 1.1071 +++ /project/slime/cvsroot/slime/ChangeLog 2007/02/22 14:10:06 1.1072 @@ -1,6 +1,9 @@ 2007-02-22 Juho Snellman * slime.el (slime-start-lisp): Don't cd if no directory was specified. + (slime-maybe-start-lisp): Pass directory argument to slime-start-lisp + also in other cond branch. + (slime-restart-sentinel): Pass a NIL directory to slime-start-lisp. 2007-02-21 Marco Baringer From heller at common-lisp.net Sun Feb 25 09:16:31 2007 From: heller at common-lisp.net (heller) Date: Sun, 25 Feb 2007 04:16:31 -0500 (EST) Subject: [slime-cvs] CVS slime Message-ID: <20070225091631.2C8BA586AB@common-lisp.net> Update of /project/slime/cvsroot/slime In directory clnet:/tmp/cvs-serv20483 Modified Files: swank.lisp Log Message: (guess-package): Renamed from guess-package-from-string. (set-package): Use it. --- /project/slime/cvsroot/slime/swank.lisp 2007/01/24 22:54:08 1.458 +++ /project/slime/cvsroot/slime/swank.lisp 2007/02/25 09:16:30 1.459 @@ -1446,32 +1446,32 @@ ;; this is intended for package or symbol names (subseq (prin1-to-string (make-symbol string)) 2)) -(defun guess-package-from-string (name &optional (default-package *package*)) - (or (and name - (or (parse-package name) - (find-package (string-upcase name)) - (parse-package (substitute #\- #\! name)))) - default-package)) +(defun guess-package (string) + "Guess which package corresponds to STRING. +Return nil if no package matches." + (or (find-package string) + (parse-package string) + (if (find #\! string) ; for SBCL + (guess-package (substitute #\- #\! string))))) (defvar *readtable-alist* (default-readtable-alist) "An alist mapping package names to readtables.") -(defun guess-buffer-readtable (package-name &optional (default *readtable*)) - (let ((package (guess-package-from-string package-name))) - (if package - (or (cdr (assoc (package-name package) *readtable-alist* - :test #'string=)) - default) - default))) +(defun guess-buffer-readtable (package-name) + (let ((package (guess-package package-name))) + (or (and package + (cdr (assoc (package-name package) *readtable-alist* + :test #'string=))) + *readtable*))) (defun valid-operator-symbol-p (symbol) - "Test if SYMBOL names a function, macro, or special-operator." + "Is SYMBOL the name of a function, a macro, or a special-operator?" (or (fboundp symbol) (macro-function symbol) (special-operator-p symbol))) (defun valid-operator-name-p (string) - "Test if STRING names a function, macro, or special-operator." + "Is STRING the name of a function, macro, or special-operator?" (let ((symbol (parse-symbol string))) (valid-operator-symbol-p symbol))) @@ -2468,7 +2468,7 @@ (defun guess-buffer-package (string) "Return a package for STRING. Fall back to the the current if no such package exists." - (or (guess-package-from-string string nil) + (or (and string (guess-package string)) *package*)) (defun eval-for-emacs (form buffer-package id) @@ -2664,10 +2664,11 @@ (with-buffer-syntax () (swank-pprint (multiple-value-list (eval (read-from-string string)))))) -(defslimefun set-package (package) - "Set *package* to PACKAGE. -Return its name and the string to use in the prompt." - (let ((p (parse-package package))) +(defslimefun set-package (name) + "Set *package* to the package named NAME. +Return the full package-name and the string to use in the prompt." + (let ((p (guess-package name))) + (assert (packagep p)) (setq *package* p) (list (package-name p) (package-string-for-prompt p)))) @@ -3295,8 +3296,7 @@ *buffer-package*. NAME and DEFAULT-PACKAGE-NAME can be nil." (let ((string (cond ((equal name "") "KEYWORD") (t (or name default-package-name))))) - (if string - (guess-package-from-string string nil) + (or (and string (guess-package string)) *buffer-package*))) ;;;;; Format completion results @@ -3613,7 +3613,7 @@ completion algorithm." (let ((converter (completion-output-package-converter name)) (completions (make-array 32 :adjustable t :fill-pointer 0))) - (declare (optimize (speed 3)) + (declare ;;(optimize (speed 3)) (type function converter)) (loop for package in (list-all-packages) for package-name = (concatenate 'string From heller at common-lisp.net Sun Feb 25 09:17:33 2007 From: heller at common-lisp.net (heller) Date: Sun, 25 Feb 2007 04:17:33 -0500 (EST) Subject: [slime-cvs] CVS slime Message-ID: <20070225091733.08D8D19014@common-lisp.net> Update of /project/slime/cvsroot/slime In directory clnet:/tmp/cvs-serv20593 Modified Files: slime.el Log Message: (slime-delete-swank-port-file): Don't use display-warning; that's not available everywhere. (slime-repl-update-banner): Insert the date only if the buffer is empty. --- /project/slime/cvsroot/slime/slime.el 2007/02/22 14:10:06 1.764 +++ /project/slime/cvsroot/slime/slime.el 2007/02/25 09:17:32 1.765 @@ -1646,13 +1646,10 @@ (format "slime.%S" (emacs-pid)))) (defun slime-delete-swank-port-file () - (when (file-regular-p (slime-swank-port-file)) - (condition-case nil - (delete-file (slime-swank-port-file)) - (error - (display-warning 'slime - (format "Unable to delete swank port file located at %s" - (slime-swank-port-file))))))) + (condition-case nil + (delete-file (slime-swank-port-file)) + (error (message "Unable to delete swank port file located at %s" + (slime-swank-port-file))))) (defun slime-read-port-and-connect (inferior-process retries) (lexical-let ((process inferior-process) @@ -2735,10 +2732,16 @@ (boundp 'header-line-format))) ;; and dancing text (animantep (and (fboundp 'animate-string) - slime-startup-animation - (zerop (buffer-size))))) + slime-startup-animation))) (when use-header-p (setq header-line-format banner)) + (when (zerop (buffer-size)) + (let ((hello-message (concat "; SLIME " + (or (slime-changelog-date) + "- ChangeLog file not found")))) + (if animantep + (animate-string hello-message 0 0) + (insert hello-message)))) (pop-to-buffer (current-buffer)) (let ((slime-hello-message (concat "; SLIME " (or (slime-changelog-date) @@ -10281,7 +10284,7 @@ "Lookup the argument list for FUNCTION-NAME. Confirm that EXPECTED-ARGLIST is displayed." '(("swank:start-server" - "(swank:start-server port-file &key \\((style swank:\\*communication-style\\*)\\|style\\)[ \n]+dont-close[ \n]+(external-format swank::\\*coding-system\\*))") + "(swank:start-server port-file &key \\((style swank:\\*communication-style\\*)\\|style\\)[ \n]+dont-close[ \n]+(coding-system swank::\\*coding-system\\*))") ("swank::compound-prefix-match" "(swank::compound-prefix-match prefix target)") ("swank::create-socket" @@ -10679,7 +10682,7 @@ (slime-accept-process-output nil 1) (slime-sync-to-top-level 5)) -(def-slime-test user-interrupt +(def-slime-test interrupt-at-toplevel () "Let's see what happens if we send a user interrupt at toplevel." '(()) @@ -10694,6 +10697,37 @@ (sldb-quit)) (slime-sync-to-top-level 5)) +(def-slime-test interrupt-in-blocking-read + () + "Let's see what happens if we interrupt a blocking read operation." + '(()) + (slime-check-top-level) + (when (slime-output-buffer) + (setf (slime-lisp-package-prompt-string) "SWANK") + (kill-buffer (slime-output-buffer))) + (with-current-buffer (slime-output-buffer) + (insert "(read-char)") + (call-interactively 'slime-repl-return)) + (slime-wait-condition "reading" #'slime-reading-p 5) + (slime-interrupt) + (slime-wait-condition "Debugger visible" + (lambda () + (and (slime-sldb-level= 1) + (get-buffer-window (sldb-get-default-buffer)))) + 5) + (with-current-buffer (sldb-get-default-buffer) + (sldb-continue)) + (slime-wait-condition "reading" #'slime-reading-p 5) + (with-current-buffer (slime-output-buffer) + (insert "X") + (call-interactively 'slime-repl-return) + (slime-sync-to-top-level 5) + (slime-test-expect "Buffer contains result" + "SWANK> (read-char) +X +#\\X +SWANK> " (buffer-string)))) + (def-slime-test disconnect () "Close the connetion. From heller at common-lisp.net Sun Feb 25 09:18:32 2007 From: heller at common-lisp.net (heller) Date: Sun, 25 Feb 2007 04:18:32 -0500 (EST) Subject: [slime-cvs] CVS slime Message-ID: <20070225091832.58C9128238@common-lisp.net> Update of /project/slime/cvsroot/slime In directory clnet:/tmp/cvs-serv20688 Modified Files: ChangeLog Log Message: *** empty log message *** --- /project/slime/cvsroot/slime/ChangeLog 2007/02/22 14:10:06 1.1072 +++ /project/slime/cvsroot/slime/ChangeLog 2007/02/25 09:18:32 1.1073 @@ -1,3 +1,14 @@ +2007-02-25 Helmut Eller + + * slime.el (slime-delete-swank-port-file): Don't use + display-warning; that's not available everywhere. + (slime-repl-update-banner): Insert the date only if the buffer is + empty. + + * swank.lisp (guess-package): Renamed from + guess-package-from-string. + (set-package): Use it. + 2007-02-22 Juho Snellman * slime.el (slime-start-lisp): Don't cd if no directory was specified. From heller at common-lisp.net Sun Feb 25 15:59:36 2007 From: heller at common-lisp.net (heller) Date: Sun, 25 Feb 2007 10:59:36 -0500 (EST) Subject: [slime-cvs] CVS slime Message-ID: <20070225155936.0D559A190@common-lisp.net> Update of /project/slime/cvsroot/slime In directory clnet:/tmp/cvs-serv13179 Modified Files: slime.el Log Message: (slime-list-compiler-notes): Fetch the notes only if called interactively. (slime-set-query-on-exit-flag): New function, to avoid compiler warnings about obsolete function process-kill-without-query. (slime-defun-if-undefined): Perform the test at runtime not at compile time. Reported by Lennart Staflin. --- /project/slime/cvsroot/slime/slime.el 2007/02/25 09:17:32 1.765 +++ /project/slime/cvsroot/slime/slime.el 2007/02/25 15:59:34 1.766 @@ -71,7 +71,8 @@ "When non-nil always enable slime-highlight-edits-mode in slime-mode") (defvar slime-highlight-compiler-notes t - "When non-nil highlight buffers with compilation notes, warnings and errors.") + "When non-nil highlight buffers with compilation notes, warnings and errors." + ) (defun* slime-setup (&key autodoc typeout-frame highlight-edits) "Setup Emacs so that lisp-mode buffers always use SLIME." @@ -1437,7 +1438,8 @@ (destructuring-bind (name (prog &rest args) &rest keys) (assoc name table) (list* :name name :program prog :program-args args keys))) -(defun* slime-start (&key (program inferior-lisp-program) program-args directory +(defun* slime-start (&key (program inferior-lisp-program) program-args + directory (coding-system slime-net-coding-system) (init 'slime-init-command) name @@ -1449,7 +1451,8 @@ (slime-check-coding-system coding-system) (when (slime-bytecode-stale-p) (slime-urge-bytecode-recompile)) - (let ((proc (slime-maybe-start-lisp program program-args directory buffer))) + (let ((proc (slime-maybe-start-lisp program program-args + directory buffer))) (slime-inferior-connect proc args) (pop-to-buffer (process-buffer proc))))) @@ -1594,8 +1597,7 @@ (comint-exec (current-buffer) "inferior-lisp" program nil program-args) (lisp-mode-variables t) (let ((proc (get-buffer-process (current-buffer)))) - (when slime-kill-without-query-p - (process-kill-without-query proc)) + (slime-set-query-on-exit-flag proc) proc))) (defun slime-inferior-connect (process args) @@ -1784,8 +1786,7 @@ (set-process-buffer proc buffer) (set-process-filter proc 'slime-net-filter) (set-process-sentinel proc 'slime-net-sentinel) - (when slime-kill-without-query-p - (process-kill-without-query proc)) + (slime-set-query-on-exit-flag proc) (when (fboundp 'set-process-coding-system) (slime-check-coding-system coding-system) (set-process-coding-system proc coding-system coding-system)) @@ -1800,6 +1801,15 @@ (buffer-disable-undo)) buffer)) +(defun slime-set-query-on-exit-flag (process) + "Set PROCESS's query-on-exit-flag to `slime-kill-without-query-p'." + (when slime-kill-without-query-p + ;; avoid byte-compiler warnings + (let ((fun (if (fboundp 'set-process-query-on-exit-flag) + 'set-process-query-on-exit-flag + 'process-kill-without-query))) + (funcall fun process nil)))) + ;;;;; Coding system madness (defvar slime-net-valid-coding-systems @@ -2743,12 +2753,6 @@ (animate-string hello-message 0 0) (insert hello-message)))) (pop-to-buffer (current-buffer)) - (let ((slime-hello-message (concat "; SLIME " - (or (slime-changelog-date) - "- ChangeLog file not found")))) - (if animantep - (animate-string slime-hello-message 0 0) - (insert slime-hello-message))) (slime-repl-insert-prompt))) (defun slime-init-output-buffer (connection) @@ -2960,8 +2964,7 @@ (slime-with-connection-buffer () (current-buffer)) slime-lisp-host port))) - (when slime-kill-without-query-p - (process-kill-without-query stream)) + (slime-set-query-on-exit-flag stream) (set-process-filter stream 'slime-output-filter) (when slime-repl-enable-presentations (require 'bridge) @@ -4810,23 +4813,22 @@ (unless (every #'slime-note-has-location-p notes) (slime-list-compiler-notes notes))) -(defun slime-list-compiler-notes (&optional notes) +(defun slime-list-compiler-notes (notes) "Show the compiler notes NOTES in tree view." - (interactive) + (interactive (list (slime-compiler-notes))) (with-temp-message "Preparing compiler note tree..." - (let ((notes (or notes (slime-compiler-notes)))) - (with-current-buffer - (slime-get-temp-buffer-create "*compiler notes*" - :mode 'slime-compiler-notes-mode) - (let ((inhibit-read-only t)) - (erase-buffer) - (when (null notes) - (insert "[no notes]")) - (dolist (tree (slime-compiler-notes-to-tree notes)) - (slime-tree-insert tree "") - (insert "\n"))) - (setq buffer-read-only t) - (goto-char (point-min)))))) + (with-current-buffer + (slime-get-temp-buffer-create "*compiler notes*" + :mode 'slime-compiler-notes-mode) + (let ((inhibit-read-only t)) + (erase-buffer) + (when (null notes) + (insert "[no notes]")) + (dolist (tree (slime-compiler-notes-to-tree notes)) + (slime-tree-insert tree "") + (insert "\n"))) + (setq buffer-read-only t) + (goto-char (point-min))))) (defun slime-alistify (list key test) "Partition the elements of LIST into an alist. KEY extracts the key @@ -7488,7 +7490,8 @@ (defun slime-show-apropos (plists string package summary) (if (null plists) (message "No apropos matches for %S" string) - (slime-with-output-to-temp-buffer ("*SLIME Apropos*" :mode apropos-mode) package + (slime-with-output-to-temp-buffer ("*SLIME Apropos*" :mode apropos-mode) + package (set-syntax-table lisp-mode-syntax-table) (slime-mode t) (if (boundp 'header-line-format) @@ -7503,7 +7506,7 @@ (cond ((and (boundp 'apropos-label-properties) (symbol-value 'apropos-label-properties))) ((boundp 'apropos-label-face) - (typecase (symbol-value 'apropos-label-face) + (etypecase (symbol-value 'apropos-label-face) (symbol `(face ,(or (symbol-value 'apropos-label-face) 'italic) mouse-face highlight)) @@ -10998,8 +11001,11 @@ (require 'overlay)) (defmacro slime-defun-if-undefined (name &rest rest) - (unless (fboundp name) - `(defun ,name , at rest))) + ;; We can't decide at compile time whether NAME is properly + ;; bound. So we delay the decision to runtime to ensure some + ;; definition + `(unless (fboundp ',name) + (defun ,name , at rest))) (put 'slime-defun-if-undefined 'lisp-indent-function 2) From heller at common-lisp.net Sun Feb 25 16:00:41 2007 From: heller at common-lisp.net (heller) Date: Sun, 25 Feb 2007 11:00:41 -0500 (EST) Subject: [slime-cvs] CVS slime Message-ID: <20070225160041.A6BE419019@common-lisp.net> Update of /project/slime/cvsroot/slime In directory clnet:/tmp/cvs-serv13319 Modified Files: ChangeLog Log Message: *** empty log message *** --- /project/slime/cvsroot/slime/ChangeLog 2007/02/25 09:18:32 1.1073 +++ /project/slime/cvsroot/slime/ChangeLog 2007/02/25 16:00:41 1.1074 @@ -4,7 +4,13 @@ display-warning; that's not available everywhere. (slime-repl-update-banner): Insert the date only if the buffer is empty. - + (slime-list-compiler-notes): Fetch the notes only if called + interactively. + (slime-set-query-on-exit-flag): New function, to avoid compiler + warnings about obsolete function process-kill-without-query. + (slime-defun-if-undefined): Perform the test at runtime not at + compile time. Reported by Lennart Staflin. + * swank.lisp (guess-package): Renamed from guess-package-from-string. (set-package): Use it. From mbaringer at common-lisp.net Sun Feb 25 18:19:55 2007 From: mbaringer at common-lisp.net (mbaringer) Date: Sun, 25 Feb 2007 13:19:55 -0500 (EST) Subject: [slime-cvs] CVS slime Message-ID: <20070225181955.6B01A74181@common-lisp.net> Update of /project/slime/cvsroot/slime In directory clnet:/tmp/cvs-serv9224 Modified Files: swank-backend.lisp Log Message: (inspect-for-emacs): Remove reference to inexistent argument from docstring. --- /project/slime/cvsroot/slime/swank-backend.lisp 2006/12/19 10:47:36 1.113 +++ /project/slime/cvsroot/slime/swank-backend.lisp 2007/02/25 18:19:55 1.114 @@ -837,9 +837,6 @@ the internals of OBJECT, it is usually an implementation specific class used simply for dispatching to the proper method. -The orgument INSPECTION-MODE is an object specifying how, and -what, to show to the user. - Returns two values: a string which will be used as the title of the inspector buffer and a list specifying how to render the object for inspection. From mbaringer at common-lisp.net Sun Feb 25 18:22:43 2007 From: mbaringer at common-lisp.net (mbaringer) Date: Sun, 25 Feb 2007 13:22:43 -0500 (EST) Subject: [slime-cvs] CVS slime Message-ID: <20070225182243.58BE3100B@common-lisp.net> Update of /project/slime/cvsroot/slime In directory clnet:/tmp/cvs-serv11050 Modified Files: ChangeLog Log Message: --- /project/slime/cvsroot/slime/ChangeLog 2007/02/25 16:00:41 1.1074 +++ /project/slime/cvsroot/slime/ChangeLog 2007/02/25 18:22:42 1.1075 @@ -1,3 +1,8 @@ +2007-02-25 Tobias C. Rittweiler + + * swank-backend.lisp (inspect-for-emacs): Remove reference to + inexistent argument from docstring. + 2007-02-25 Helmut Eller * slime.el (slime-delete-swank-port-file): Don't use From nsiivola at common-lisp.net Mon Feb 26 09:56:06 2007 From: nsiivola at common-lisp.net (nsiivola) Date: Mon, 26 Feb 2007 04:56:06 -0500 (EST) Subject: [slime-cvs] CVS slime Message-ID: <20070226095606.BF2EB111CC@common-lisp.net> Update of /project/slime/cvsroot/slime In directory clnet:/tmp/cvs-serv15154 Modified Files: ChangeLog swank.lisp Log Message: inspecting NaNs and infinities --- /project/slime/cvsroot/slime/ChangeLog 2007/02/25 18:22:42 1.1075 +++ /project/slime/cvsroot/slime/ChangeLog 2007/02/26 09:56:06 1.1076 @@ -1,3 +1,8 @@ +2007-02-26 Nikodemus Siivola + + * swank.lisp (inspect-for-emacs): Add support for inspecting + non-decodable float entities like NaNs and infinities. + 2007-02-25 Tobias C. Rittweiler * swank-backend.lisp (inspect-for-emacs): Remove reference to --- /project/slime/cvsroot/slime/swank.lisp 2007/02/25 09:16:30 1.459 +++ /project/slime/cvsroot/slime/swank.lisp 2007/02/26 09:56:06 1.460 @@ -4807,16 +4807,24 @@ (defmethod inspect-for-emacs ((f float) inspector) (declare (ignore inspector)) - (multiple-value-bind (significand exponent sign) (decode-float f) - (values "A floating point number." - (append - `("Scientific: " ,(format nil "~E" f) (:newline) - "Decoded: " - (:value ,sign) " * " - (:value ,significand) " * " - (:value ,(float-radix f)) "^" (:value ,exponent) (:newline)) - (label-value-line "Digits" (float-digits f)) - (label-value-line "Precision" (float-precision f)))))) + (values "A floating point number." + (cond + ((> f most-positive-long-float) + (list "Positive infinity.")) + ((< f most-negative-long-float) + (list "Negative infinity.")) + ((not (= f f)) + (list "Not a Number.")) + (t + (multiple-value-bind (significand exponent sign) (decode-float f) + (append + `("Scientific: " ,(format nil "~E" f) (:newline) + "Decoded: " + (:value ,sign) " * " + (:value ,significand) " * " + (:value ,(float-radix f)) "^" (:value ,exponent) (:newline)) + (label-value-line "Digits" (float-digits f)) + (label-value-line "Precision" (float-precision f)))))))) (defmethod inspect-for-emacs ((stream file-stream) inspector) (declare (ignore inspector))