From trittweiler at common-lisp.net Wed Jan 2 11:50:57 2008 From: trittweiler at common-lisp.net (trittweiler) Date: Wed, 2 Jan 2008 06:50:57 -0500 (EST) Subject: [slime-cvs] CVS slime Message-ID: <20080102115057.7E7114619A@common-lisp.net> Update of /project/slime/cvsroot/slime In directory clnet:/tmp/cvs-serv8717 Modified Files: slime.el Log Message: * slime.el (slime-apropos): Update docstring: Apropos doesn't match on regular expressions anymore since 2007-11-24. --- /project/slime/cvsroot/slime/slime.el 2007/12/14 08:46:49 1.886 +++ /project/slime/cvsroot/slime/slime.el 2008/01/02 11:50:57 1.887 @@ -5866,7 +5866,8 @@ (defun slime-apropos (string &optional only-external-p package case-sensitive-p) - "Show all bound symbols whose names match STRING, a regular expression." + "Show all bound symbols whose names match STRING. With prefix +arg, you're interactively asked for parameters of the search." (interactive (if current-prefix-arg (list (read-string "SLIME Apropos: ") @@ -5886,7 +5887,7 @@ (lambda (r) (slime-show-apropos r string package summary)))))) (defun slime-apropos-all () - "Shortcut for (slime-apropos nil nil)" + "Shortcut for (slime-apropos nil nil)" (interactive) (slime-apropos (read-string "SLIME Apropos: ") nil nil)) From trittweiler at common-lisp.net Wed Jan 2 11:51:27 2008 From: trittweiler at common-lisp.net (trittweiler) Date: Wed, 2 Jan 2008 06:51:27 -0500 (EST) Subject: [slime-cvs] CVS slime Message-ID: <20080102115127.196F95F05D@common-lisp.net> Update of /project/slime/cvsroot/slime In directory clnet:/tmp/cvs-serv8765 Modified Files: ChangeLog Log Message: * slime.el (slime-apropos): Update docstring: Apropos doesn't match on regular expressions anymore since 2007-11-24. --- /project/slime/cvsroot/slime/ChangeLog 2007/12/22 13:24:49 1.1260 +++ /project/slime/cvsroot/slime/ChangeLog 2008/01/02 11:51:26 1.1261 @@ -1,3 +1,8 @@ +2008-01-02 Tobias C. Rittweiler + + * slime.el (slime-apropos): Update docstring: Apropos doesn't + match on regular expressions anymore since 2007-11-24. + 2007-12-22 Douglas Crosher * swank-scl.lisp (set-stream-timeout, make-socket-io-stream): update From trittweiler at common-lisp.net Wed Jan 2 12:44:09 2008 From: trittweiler at common-lisp.net (trittweiler) Date: Wed, 2 Jan 2008 07:44:09 -0500 (EST) Subject: [slime-cvs] CVS slime Message-ID: <20080102124409.D4A552E1C9@common-lisp.net> Update of /project/slime/cvsroot/slime In directory clnet:/tmp/cvs-serv19931 Modified Files: slime.el Log Message: * slime.el (slime-print-apropos): Simplified: Don't insert action properties anymore for the symbol; they were ignored anyway, because `apropos-follow' (bound to RET in the resulting *SLIME Apropos* buffer) looks for buttons only. --- /project/slime/cvsroot/slime/slime.el 2008/01/02 11:50:57 1.887 +++ /project/slime/cvsroot/slime/slime.el 2008/01/02 12:44:09 1.888 @@ -5930,10 +5930,7 @@ (dolist (plist plists) (let ((designator (plist-get plist :designator))) (assert designator) - (slime-insert-propertized (list 'face apropos-symbol-face - 'item designator - 'action 'slime-describe-symbol) - designator)) + (slime-insert-propertized `(face ,apropos-symbol-face) designator)) (terpri) (let ((apropos-label-properties slime-apropos-label-properties)) (loop for (prop namespace) From trittweiler at common-lisp.net Wed Jan 2 12:44:41 2008 From: trittweiler at common-lisp.net (trittweiler) Date: Wed, 2 Jan 2008 07:44:41 -0500 (EST) Subject: [slime-cvs] CVS slime Message-ID: <20080102124441.09890450C9@common-lisp.net> Update of /project/slime/cvsroot/slime In directory clnet:/tmp/cvs-serv19997 Modified Files: ChangeLog Log Message: * slime.el (slime-print-apropos): Simplified: Don't insert action properties anymore for the symbol; they were ignored anyway, because `apropos-follow' (bound to RET in the resulting *SLIME Apropos* buffer) looks for buttons only. --- /project/slime/cvsroot/slime/ChangeLog 2008/01/02 11:51:26 1.1261 +++ /project/slime/cvsroot/slime/ChangeLog 2008/01/02 12:44:41 1.1262 @@ -1,5 +1,12 @@ 2008-01-02 Tobias C. Rittweiler + * slime.el (slime-print-apropos): Simplified: Don't insert action + properties anymore for the symbol; they were ignored anyway, + because `apropos-follow' (bound to RET in the resulting + *SLIME Apropos* buffer) looks for buttons only. + +2008-01-02 Tobias C. Rittweiler + * slime.el (slime-apropos): Update docstring: Apropos doesn't match on regular expressions anymore since 2007-11-24. From trittweiler at common-lisp.net Wed Jan 2 16:02:14 2008 From: trittweiler at common-lisp.net (trittweiler) Date: Wed, 2 Jan 2008 11:02:14 -0500 (EST) Subject: [slime-cvs] CVS slime Message-ID: <20080102160214.2CB07461B4@common-lisp.net> Update of /project/slime/cvsroot/slime In directory clnet:/tmp/cvs-serv4521 Modified Files: slime.el Log Message: Use sane default values for slime-repl-set-package. Previously, when typing `,!p' at the REPL, the current package would have been inserted as a default (although the whole intent was to /change/ the current package in the first place), now nothing is inserted anymore. * slime.el (slime-pretty-current-package): rename it to slime-pretty-find-buffer-package and make it use slime-find-buffer-package instead of slime-current-package. (slime-repl-set-package, slime-set-package): use new function. --- /project/slime/cvsroot/slime/slime.el 2008/01/02 12:44:09 1.888 +++ /project/slime/cvsroot/slime/slime.el 2008/01/02 16:02:13 1.889 @@ -495,9 +495,9 @@ (t name)))) (format "%s" (read name)))) -(defun slime-pretty-current-package () - "Retrun a prettied version of `slime-current-package'." - (let ((p (slime-current-package))) +(defun slime-pretty-find-buffer-package () + "Return a prettied version of `slime-find-buffer-package'." + (let ((p (slime-find-buffer-package))) (and p (slime-pretty-package-name p)))) (when slime-update-modeline-package @@ -3310,7 +3310,7 @@ (defun slime-repl-set-package (package) "Set the package of the REPL buffer to PACKAGE." (interactive (list (slime-read-package-name - "Package: " (slime-pretty-current-package)))) + "Package: " (slime-pretty-find-buffer-package)))) (with-current-buffer (slime-output-buffer) (let ((unfinished-input (slime-repl-current-input))) (destructuring-bind (name prompt-string) @@ -6389,8 +6389,8 @@ (message "Connection closed."))) (defun slime-set-package (package) - (interactive (list (slime-read-package-name "Package: " - (slime-pretty-current-package)))) + (interactive (list (slime-read-package-name + "Package: " (slime-pretty-find-buffer-package)))) (message "*package*: %s" (slime-eval `(swank:set-package ,package)))) (defun slime-set-default-directory (directory) From trittweiler at common-lisp.net Wed Jan 2 16:02:47 2008 From: trittweiler at common-lisp.net (trittweiler) Date: Wed, 2 Jan 2008 11:02:47 -0500 (EST) Subject: [slime-cvs] CVS slime Message-ID: <20080102160247.754425B069@common-lisp.net> Update of /project/slime/cvsroot/slime In directory clnet:/tmp/cvs-serv4575 Modified Files: ChangeLog Log Message: Use sane default values for slime-repl-set-package. Previously, when typing `,!p' at the REPL, the current package would have been inserted as a default (although the whole intent was to /change/ the current package in the first place), now nothing is inserted anymore. * slime.el (slime-pretty-current-package): rename it to slime-pretty-find-buffer-package and make it use slime-find-buffer-package instead of slime-current-package. (slime-repl-set-package, slime-set-package): use new function. --- /project/slime/cvsroot/slime/ChangeLog 2008/01/02 12:44:41 1.1262 +++ /project/slime/cvsroot/slime/ChangeLog 2008/01/02 16:02:47 1.1263 @@ -1,3 +1,17 @@ +2008-01-02 Lu?s Oliveira + + Use sane default values for slime-repl-set-package. + + Previously, when typing `,!p' at the REPL, the current package + would have been inserted as a default (although the whole intent + was to /change/ the current package in the first place), now + nothing is inserted anymore. + + * slime.el (slime-pretty-current-package): rename it to + slime-pretty-find-buffer-package and make it use + slime-find-buffer-package instead of slime-current-package. + (slime-repl-set-package, slime-set-package): use new function. + 2008-01-02 Tobias C. Rittweiler * slime.el (slime-print-apropos): Simplified: Don't insert action From jsnellman at common-lisp.net Fri Jan 4 03:34:37 2008 From: jsnellman at common-lisp.net (jsnellman) Date: Thu, 3 Jan 2008 22:34:37 -0500 (EST) Subject: [slime-cvs] CVS slime Message-ID: <20080104033437.3FB94140C1@common-lisp.net> Update of /project/slime/cvsroot/slime In directory clnet:/tmp/cvs-serv10873 Modified Files: ChangeLog swank-sbcl.lisp Log Message: * swank-sbcl.lisp (source-file-source-location): Use the debootstrap readtable when appropriate (fixes occasional reader errors when using "v" on debugger frames that point to functions defined in SBCL). Likewise for the debootstrapping packages. (code-location-debug-source-name): Ensure that we always return a physical namestring, Emacs won't like a pathname or a logical namestring. --- /project/slime/cvsroot/slime/ChangeLog 2008/01/02 16:02:47 1.1263 +++ /project/slime/cvsroot/slime/ChangeLog 2008/01/04 03:34:34 1.1264 @@ -1,3 +1,13 @@ +2008-01-04 Juho Snellman + + * swank-sbcl.lisp (source-file-source-location): Use the + debootstrap readtable when appropriate (fixes occasional reader + errors when using "v" on debugger frames that point to functions + defined in SBCL). Likewise for the debootstrapping packages. + (code-location-debug-source-name): Ensure that we always return a + physical namestring, Emacs won't like a pathname or a logical + namestring. + 2008-01-02 Lu?s Oliveira Use sane default values for slime-repl-set-package. --- /project/slime/cvsroot/slime/swank-sbcl.lisp 2007/09/11 19:31:03 1.185 +++ /project/slime/cvsroot/slime/swank-sbcl.lisp 2008/01/04 03:34:35 1.186 @@ -831,16 +831,19 @@ (defun source-file-source-location (code-location) (let* ((code-date (code-location-debug-source-created code-location)) (filename (code-location-debug-source-name code-location)) + (*readtable* (guess-readtable-for-filename filename)) (source-code (get-source-code filename code-date))) - (with-input-from-string (s source-code) - (let* ((pos (stream-source-position code-location s)) - (snippet (read-snippet s pos))) - (make-location `(:file ,filename) - `(:position ,(1+ pos)) - `(:snippet ,snippet)))))) + (with-debootstrapping + (with-input-from-string (s source-code) + (let* ((pos (stream-source-position code-location s)) + (snippet (read-snippet s pos))) + (make-location `(:file ,filename) + `(:position ,(1+ pos)) + `(:snippet ,snippet))))))) (defun code-location-debug-source-name (code-location) - (sb-c::debug-source-name (sb-di::code-location-debug-source code-location))) + (namestring (truename (sb-c::debug-source-name + (sb-di::code-location-debug-source code-location))))) (defun code-location-debug-source-created (code-location) (sb-c::debug-source-created From mkoeppe at common-lisp.net Wed Jan 9 17:08:33 2008 From: mkoeppe at common-lisp.net (mkoeppe) Date: Wed, 9 Jan 2008 12:08:33 -0500 (EST) Subject: [slime-cvs] CVS slime Message-ID: <20080109170833.643D3A17E@common-lisp.net> Update of /project/slime/cvsroot/slime In directory clnet:/tmp/cvs-serv32011 Modified Files: slime.el Log Message: (slime-repl-mode-map): Bind C-c C-t to slime-toggle-trace-fdefinition (as in Lisp buffers) instead of slime-repl-clear-buffer. This binding is useful for untracing functions directly from the trace output. Move slime-repl-clear-buffer to the keybinding C-c M-o. --- /project/slime/cvsroot/slime/slime.el 2008/01/02 16:02:13 1.889 +++ /project/slime/cvsroot/slime/slime.el 2008/01/09 17:08:32 1.890 @@ -2874,7 +2874,8 @@ ("\C-c\C-w" slime-who-map) ("\C-\M-x" 'slime-eval-defun) ("\C-c\C-o" 'slime-repl-clear-output) - ("\C-c\C-t" 'slime-repl-clear-buffer) + ("\C-c\M-o" 'slime-repl-clear-buffer) + ("\C-c\C-t" 'slime-toggle-trace-fdefinition) ("\C-c\C-u" 'slime-repl-kill-input) ("\C-c\C-n" 'slime-repl-next-prompt) ("\C-c\C-p" 'slime-repl-previous-prompt) From mkoeppe at common-lisp.net Wed Jan 9 17:09:00 2008 From: mkoeppe at common-lisp.net (mkoeppe) Date: Wed, 9 Jan 2008 12:09:00 -0500 (EST) Subject: [slime-cvs] CVS slime Message-ID: <20080109170900.315291603D@common-lisp.net> Update of /project/slime/cvsroot/slime In directory clnet:/tmp/cvs-serv32107 Modified Files: ChangeLog Log Message: *** empty log message *** --- /project/slime/cvsroot/slime/ChangeLog 2008/01/04 03:34:34 1.1264 +++ /project/slime/cvsroot/slime/ChangeLog 2008/01/09 17:08:59 1.1265 @@ -1,3 +1,11 @@ +2008-01-09 Matthias Koeppe + + * slime.el (slime-repl-mode-map): Bind C-c C-t to + slime-toggle-trace-fdefinition (as in Lisp buffers) instead of + slime-repl-clear-buffer. This binding is useful for untracing + functions directly from the trace output. Move + slime-repl-clear-buffer to the keybinding C-c M-o. + 2008-01-04 Juho Snellman * swank-sbcl.lisp (source-file-source-location): Use the From mkoeppe at common-lisp.net Wed Jan 9 18:30:26 2008 From: mkoeppe at common-lisp.net (mkoeppe) Date: Wed, 9 Jan 2008 13:30:26 -0500 (EST) Subject: [slime-cvs] CVS slime/contrib Message-ID: <20080109183026.EDB9C4322E@common-lisp.net> Update of /project/slime/cvsroot/slime/contrib In directory clnet:/tmp/cvs-serv25365 Added Files: slime-scheme.el Log Message: Restore support for Scheme programs that was removed from core SLIME on 2007-09-19, as a "slime-scheme" contrib. --- /project/slime/cvsroot/slime/contrib/slime-scheme.el 2008/01/09 18:30:26 NONE +++ /project/slime/cvsroot/slime/contrib/slime-scheme.el 2008/01/09 18:30:26 1.1 ;;; slime-scheme.el --- Support Scheme programs running under Common Lisp ;; ;; Authors: Matthias Koeppe ;; ;; License: GNU GPL (same license as Emacs) ;; ;;; Installation: ;; ;; Add this to your .emacs: ;; ;; (add-to-list 'load-path "") ;; (add-hook 'slime-load-hook (lambda () (require 'slime-scheme))) ;; (defun slime-scheme-mode-hook () (slime-mode 1)) (defun slime-scheme-indentation-update (symbol indent) ;; Does the symbol have an indentation value that we set? (when (equal (get symbol 'scheme-indent-function) (get symbol 'slime-scheme-indent)) (put symbol 'slime-scheme-indent indent) (put symbol 'scheme-indent-function indent))) ;;; Initialization (defun slime-scheme-init () (add-hook 'scheme-mode-hook 'slime-scheme-mode-hook) (add-hook 'slime-indentation-update-hooks 'slime-scheme-indentation-update) (add-to-list 'slime-lisp-modes 'scheme-mode)) (defun slime-scheme-unload () (remove-hook 'scheme-mode-hook 'slime-scheme-mode-hook) (remove-hook 'slime-indentation-update-hooks 'slime-scheme-indentation-update) (setq slime-lisp-modes (remove 'scheme-mode slime-lisp-modes))) (provide 'slime-scheme) From mkoeppe at common-lisp.net Wed Jan 9 18:30:32 2008 From: mkoeppe at common-lisp.net (mkoeppe) Date: Wed, 9 Jan 2008 13:30:32 -0500 (EST) Subject: [slime-cvs] CVS slime/contrib Message-ID: <20080109183032.B75D04322E@common-lisp.net> Update of /project/slime/cvsroot/slime/contrib In directory clnet:/tmp/cvs-serv25420 Modified Files: ChangeLog Log Message: *** empty log message *** --- /project/slime/cvsroot/slime/contrib/ChangeLog 2007/12/30 11:32:06 1.69 +++ /project/slime/cvsroot/slime/contrib/ChangeLog 2008/01/09 18:30:32 1.70 @@ -1,3 +1,10 @@ +2008-01-09 Matthias Koeppe + + Restore support for Scheme programs that was removed from core + SLIME on 2007-09-19, as a "slime-scheme" contrib. + + * slime-scheme.el: New file. + 2007-12-30 Tobias C. Rittweiler * swank-arglists.lisp: Fix for `(cerror "FOO" 'type-error ...)' From trittweiler at common-lisp.net Thu Jan 10 00:39:19 2008 From: trittweiler at common-lisp.net (trittweiler) Date: Wed, 9 Jan 2008 19:39:19 -0500 (EST) Subject: [slime-cvs] CVS slime/contrib Message-ID: <20080110003919.70E8F64042@common-lisp.net> Update of /project/slime/cvsroot/slime/contrib In directory clnet:/tmp/cvs-serv8108 Modified Files: slime-fuzzy.el Log Message: * slime-fuzzy.el (slime-fuzzy-completion-time-limit-in-msec): Update docstring: Its value isn't rounded to nearest second, but is really interpreted as msecs. * swank-fuzzy.el: Updated some comments. (fuzzy-generate-matchings): Sort package matchings before traversal, such that they're traversed in the order of their score. (Important with time limit exhausts during traversal.) --- /project/slime/cvsroot/slime/contrib/slime-fuzzy.el 2007/11/24 08:15:20 1.5 +++ /project/slime/cvsroot/slime/contrib/slime-fuzzy.el 2008/01/10 00:39:19 1.6 @@ -30,8 +30,8 @@ :type 'integer) (defcustom slime-fuzzy-completion-time-limit-in-msec 1500 - "Limit the time spent (given in msec) in swank while gathering comletitions. -\(NOTE: currently it's rounded up the nearest second)" + "Limit the time spent (given in msec) in swank while gathering +comletitions." :group 'slime-mode :type 'integer) From trittweiler at common-lisp.net Thu Jan 10 00:39:37 2008 From: trittweiler at common-lisp.net (trittweiler) Date: Wed, 9 Jan 2008 19:39:37 -0500 (EST) Subject: [slime-cvs] CVS slime/contrib Message-ID: <20080110003937.9A2057323A@common-lisp.net> Update of /project/slime/cvsroot/slime/contrib In directory clnet:/tmp/cvs-serv8181 Modified Files: swank-fuzzy.lisp Log Message: * slime-fuzzy.el (slime-fuzzy-completion-time-limit-in-msec): Update docstring: Its value isn't rounded to nearest second, but is really interpreted as msecs. * swank-fuzzy.el: Updated some comments. (fuzzy-generate-matchings): Sort package matchings before traversal, such that they're traversed in the order of their score. (Important with time limit exhausts during traversal.) --- /project/slime/cvsroot/slime/contrib/swank-fuzzy.lisp 2007/09/15 22:21:21 1.6 +++ /project/slime/cvsroot/slime/contrib/swank-fuzzy.lisp 2008/01/10 00:39:37 1.7 @@ -220,15 +220,20 @@ ;; relative to all the packages found. (multiple-value-bind (found-packages rest-time-limit) (find-packages parsed-package-name time-limit-in-msec) + ;; We want to traverse the found packages in the order of their score, + ;; since those with higher score presumably represent better choices. + ;; (This is important because some packages may never be looked at if + ;; time limit exhausts during traversal.) + (setf found-packages (sort found-packages #'fuzzy-matching-greaterp)) (loop for package-matching across found-packages for package = (find-package (fuzzy-matching.package-name package-matching)) while (or (not time-limit) (> rest-time-limit 0)) do (multiple-value-bind (matchings remaining-time) - ;; The filter removes all those symbols which are also present - ;; in one of the other packages, specifically if such a package - ;; represents the home package of the symbol, because that one - ;; is deemed to be the best match. + ;; The duplication filter removes all those symbols which are + ;; present in more than one package match. Specifically if such a + ;; package match represents the home package of the symbol, it's + ;; the one kept because this one is deemed to be the best match. (find-symbols parsed-symbol-name package rest-time-limit (%make-duplicate-symbols-filter (remove package-matching found-packages))) @@ -261,9 +266,9 @@ (* 1000 (* comparasions (expt 10 -7)))))) ; msecs (defun %make-duplicate-symbols-filter (fuzzy-package-matchings) - ;; Returns a filter function that takes a symbol and which returns T - ;; only if no matching in FUZZY-PACKAGE-MATCHINGS represents the - ;; home-package of the. + ;; Returns a filter function that takes a symbol, and which returns T + ;; if and only if /no/ matching in FUZZY-PACKAGE-MATCHINGS represents + ;; the home-package of the symbol passed. (let ((packages (mapcar #'(lambda (m) (find-package (fuzzy-matching.package-name m))) (coerce fuzzy-package-matchings 'list)))) @@ -285,7 +290,7 @@ (name2 (symbol-name (fuzzy-matching.symbol m2)))) (string< name1 name2)))))) - +(declaim (ftype (function () (integer 0)) get-real-time-msecs)) (defun get-real-time-in-msecs () (let ((units-per-msec (max 1 (floor internal-time-units-per-second 1000)))) (values (floor (get-internal-real-time) units-per-msec)))) ; return just one value! From trittweiler at common-lisp.net Thu Jan 10 00:43:03 2008 From: trittweiler at common-lisp.net (trittweiler) Date: Wed, 9 Jan 2008 19:43:03 -0500 (EST) Subject: [slime-cvs] CVS slime/contrib Message-ID: <20080110004303.5529764042@common-lisp.net> Update of /project/slime/cvsroot/slime/contrib In directory clnet:/tmp/cvs-serv10626 Modified Files: swank-arglists.lisp Log Message: * swank-arglists.lisp (read-form-spec): Changed "cons" clause to "list" clause in etypecase. Fix for error on arglist display on `(declare (ftype (|)))', | being point. --- /project/slime/cvsroot/slime/contrib/swank-arglists.lisp 2007/12/30 11:31:55 1.16 +++ /project/slime/cvsroot/slime/contrib/swank-arglists.lisp 2008/01/10 00:43:03 1.17 @@ -222,7 +222,7 @@ (push sexp result) (when newly-interned? (push sexp newly-interned-symbols)))) - (cons + (list (multiple-value-bind (read-spec interned-symbols) (read-form-spec element reader) (push read-spec result) From trittweiler at common-lisp.net Thu Jan 10 00:43:14 2008 From: trittweiler at common-lisp.net (trittweiler) Date: Wed, 9 Jan 2008 19:43:14 -0500 (EST) Subject: [slime-cvs] CVS slime/contrib Message-ID: <20080110004314.11ED06F24D@common-lisp.net> Update of /project/slime/cvsroot/slime/contrib In directory clnet:/tmp/cvs-serv10689 Modified Files: ChangeLog Log Message: * swank-arglists.lisp (read-form-spec): Changed "cons" clause to "list" clause in etypecase. Fix for error on arglist display on `(declare (ftype (|)))', | being point. --- /project/slime/cvsroot/slime/contrib/ChangeLog 2008/01/09 18:30:32 1.70 +++ /project/slime/cvsroot/slime/contrib/ChangeLog 2008/01/10 00:43:14 1.71 @@ -1,3 +1,20 @@ +2008-01-10 Tobias C. Rittweiler + + * swank-arglists.lisp (read-form-spec): Changed "cons" clause to + "list" clause in etypecase. Fix for error on arglist display on + `(declare (ftype (|)))', | being point. + +2008-01-10 Tobias C. Rittweiler + + * slime-fuzzy.el (slime-fuzzy-completion-time-limit-in-msec): + Update docstring: Its value isn't rounded to nearest second, but + is really interpreted as msecs. + + * swank-fuzzy.el: Updated some comments. + (fuzzy-generate-matchings): Sort package matchings before + traversal, such that they're traversed in the order of their + score. (Important with time limit exhausts during traversal.) + 2008-01-09 Matthias Koeppe Restore support for Scheme programs that was removed from core From trittweiler at common-lisp.net Thu Jan 10 12:59:19 2008 From: trittweiler at common-lisp.net (trittweiler) Date: Thu, 10 Jan 2008 07:59:19 -0500 (EST) Subject: [slime-cvs] CVS slime/contrib Message-ID: <20080110125919.3DFDD5C17D@common-lisp.net> Update of /project/slime/cvsroot/slime/contrib In directory clnet:/tmp/cvs-serv9790 Modified Files: slime-parse.el Log Message: * swank-parse.lisp (slime-incomplete-form-at-point): Take the arglist index there user's point is located at correctly into account. Previously `C-c C-s' on `(defun |foo' would have inserted `args body...)', now it inserts `name args body...)' --- /project/slime/cvsroot/slime/contrib/slime-parse.el 2007/09/15 11:09:36 1.7 +++ /project/slime/cvsroot/slime/contrib/slime-parse.el 2008/01/10 12:59:18 1.8 @@ -16,14 +16,28 @@ (slime-enclosing-form-specs) (if (null operators) "" - (let ((op (first operators))) + (let ((op (first operators)) + (op-start (first points)) + (arg-index (first arg-indices))) (destructure-case (slime-ensure-list op) ((:declaration declspec) op) ((:type-specifier typespec) op) - (t (slime-ensure-list - (save-excursion (goto-char (first points)) - (slime-parse-sexp-at-point - (1+ (first arg-indices))))))))))) + (t + (let ((user-point (point))) + (save-excursion + (goto-char op-start) + ;; `arg-index' represents to the number of full sexps that + ;; come to the left of the sexp user's point is at. + (let ((full-sexps (slime-ensure-list + (slime-parse-sexp-at-point arg-index)))) + (forward-sexp arg-index) + (slime-forward-blanks) + (assert (<= (point) user-point)) + (let ((incomplete-sexp + (buffer-substring-no-properties (point) user-point))) + (if (string= incomplete-sexp "") + full-sexps + (append full-sexps (list incomplete-sexp))))))))))))) ;; XXX: unused function (defun slime-cl-symbol-external-ref-p (symbol) From trittweiler at common-lisp.net Thu Jan 10 12:59:33 2008 From: trittweiler at common-lisp.net (trittweiler) Date: Thu, 10 Jan 2008 07:59:33 -0500 (EST) Subject: [slime-cvs] CVS slime/contrib Message-ID: <20080110125933.71E526911A@common-lisp.net> Update of /project/slime/cvsroot/slime/contrib In directory clnet:/tmp/cvs-serv9852 Modified Files: ChangeLog Log Message: * swank-parse.lisp (slime-incomplete-form-at-point): Take the arglist index there user's point is located at correctly into account. Previously `C-c C-s' on `(defun |foo' would have inserted `args body...)', now it inserts `name args body...)' --- /project/slime/cvsroot/slime/contrib/ChangeLog 2008/01/10 00:43:14 1.71 +++ /project/slime/cvsroot/slime/contrib/ChangeLog 2008/01/10 12:59:33 1.72 @@ -1,5 +1,12 @@ 2008-01-10 Tobias C. Rittweiler + * swank-parse.lisp (slime-incomplete-form-at-point): Take the + arglist index there user's point is located at correctly into + account. Previously `C-c C-s' on `(defun |foo' would have inserted + `args body...)', now it inserts `name args body...)' + +2008-01-10 Tobias C. Rittweiler + * swank-arglists.lisp (read-form-spec): Changed "cons" clause to "list" clause in etypecase. Fix for error on arglist display on `(declare (ftype (|)))', | being point. From mkoeppe at common-lisp.net Thu Jan 10 13:48:48 2008 From: mkoeppe at common-lisp.net (mkoeppe) Date: Thu, 10 Jan 2008 08:48:48 -0500 (EST) Subject: [slime-cvs] CVS slime/contrib Message-ID: <20080110134848.2F0DF81008@common-lisp.net> Update of /project/slime/cvsroot/slime/contrib In directory clnet:/tmp/cvs-serv31769 Modified Files: slime-presentations.el Log Message: (slime-presentation-around-or-before-point-or-error): New function. (slime-inspect-presentation): New function, factored out from slime-inspect-presentation-at-mouse. (slime-inspect-presentation-at-mouse): Use it here. (slime-inspect-presentation-at-point): New command. (slime-copy-presentation-to-repl): New function, factored out from slime-copy-presentation-at-mouse. (slime-copy-presentation-at-mouse-to-repl): Renamed from slime-copy-presentation-at-mouse; use the new function slime-copy-presentation-to-repl. (slime-copy-presentation-at-point-to-repl): New command. (slime-copy-presentation-to-kill-ring): New function, factored out from slime-copy-presentation-at-mouse-to-kill-ring. (slime-copy-presentation-at-point-to-kill-ring): New command. (slime-describe-presentation): New function, factored out from slime-describe-presentation-at-mouse. (slime-describe-presentation-at-mouse): Use it here. (slime-describe-presentation-at-point): New command. (slime-pretty-print-presentation): New function, factored out from slime-pretty-print-presentation-at-mouse. (slime-pretty-print-presentation-at-mouse): Use it here. (slime-pretty-print-presentation-at-point): New command. (slime-mark-presentation): New command. (slime-previous-presentation, slime-next-presentation): New commands. (slime-presentation-command-map, slime-presentation-bindings): New variables. (slime-presentation-init-keymaps): New function. (slime-presentation-around-or-before-point-p): New function. (slime-presentation-easy-menu): New variable. (slime-presentation-add-easy-menu): New function. (slime-clear-presentations): Make interactive, remove presentation markup from all presentations in the REPL buffer. (slime-presentations-init): Call slime-presentation-init-keymaps and slime-presentation-add-easy-menu. --- /project/slime/cvsroot/slime/contrib/slime-presentations.el 2007/09/20 14:55:53 1.8 +++ /project/slime/cvsroot/slime/contrib/slime-presentations.el 2008/01/10 13:48:47 1.9 @@ -275,6 +275,13 @@ (values presentation start end whole-p) (slime-presentation-around-point (1- point) object))))) +(defun slime-presentation-around-or-before-point-or-error (point) + (multiple-value-bind (presentation start end whole-p) + (slime-presentation-around-or-before-point point) + (unless presentation + (error "No presentation at point")) + (values presentation start end whole-p))) + (defun* slime-for-each-presentation-in-region (from to function &optional (object (current-buffer))) "Call `function' with arguments `presentation', `start', `end', `whole-p' for every presentation in the region `from'--`to' in the @@ -348,37 +355,55 @@ (slime-copy-presentation-at-mouse event) (slime-inspect-presentation-at-mouse event)))) +(defun slime-inspect-presentation (presentation start end buffer) + (let ((reset-p + (with-current-buffer buffer + (not (eq major-mode 'slime-inspector-mode))))) + (slime-eval-async `(swank:inspect-presentation ',(slime-presentation-id presentation) ,reset-p) + 'slime-open-inspector))) + (defun slime-inspect-presentation-at-mouse (event) (interactive "e") (multiple-value-bind (presentation start end buffer) (slime-presentation-around-click event) - (let ((reset-p - (with-current-buffer buffer - (not (eq major-mode 'slime-inspector-mode))))) - (slime-eval-async `(swank:inspect-presentation ',(slime-presentation-id presentation) ,reset-p) - 'slime-open-inspector)))) + (slime-inspect-presentation presentation start end buffer))) + +(defun slime-inspect-presentation-at-point (point) + (interactive "d") + (multiple-value-bind (presentation start end) + (slime-presentation-around-or-before-point-or-error point) + (slime-inspect-presentation presentation start end (current-buffer)))) + +(defun slime-copy-presentation-to-repl (presentation start end buffer) + (let ((presentation-text + (with-current-buffer buffer + (buffer-substring start end)))) + (unless (eql major-mode 'slime-repl-mode) + (slime-switch-to-output-buffer)) + (flet ((do-insertion () + (when (not (string-match "\\s-" + (buffer-substring (1- (point)) (point)))) + (insert " ")) + (insert presentation-text) + (when (and (not (eolp)) (not (looking-at "\\s-"))) + (insert " ")))) + (if (>= (point) slime-repl-prompt-start-mark) + (do-insertion) + (save-excursion + (goto-char (point-max)) + (do-insertion)))))) -(defun slime-copy-presentation-at-mouse (event) +(defun slime-copy-presentation-at-mouse-to-repl (event) (interactive "e") (multiple-value-bind (presentation start end buffer) (slime-presentation-around-click event) - (let ((presentation-text - (with-current-buffer buffer - (buffer-substring start end)))) - (unless (eql major-mode 'slime-repl-mode) - (slime-switch-to-output-buffer)) - (flet ((do-insertion () - (when (not (string-match "\\s-" - (buffer-substring (1- (point)) (point)))) - (insert " ")) - (insert presentation-text) - (when (and (not (eolp)) (not (looking-at "\\s-"))) - (insert " ")))) - (if (>= (point) slime-repl-prompt-start-mark) - (do-insertion) - (save-excursion - (goto-char (point-max)) - (do-insertion))))))) + (slime-copy-presentation-to-repl presentation start end buffer))) + +(defun slime-copy-presentation-at-point-to-repl (point) + (interactive "d") + (multiple-value-bind (presentation start end) + (slime-presentation-around-or-before-point-or-error point) + (slime-copy-presentation-to-repl presentation start end (current-buffer)))) (defun slime-copy-presentation-at-mouse-to-point (event) (interactive "e") @@ -395,29 +420,94 @@ (when (and (not (eolp)) (not (looking-at "\\s-"))) (insert " "))))) +(defun slime-copy-presentation-to-kill-ring (presentation start end buffer) + (let ((presentation-text + (with-current-buffer buffer + (buffer-substring start end)))) + (kill-new presentation-text) + (message "Saved presentation \"%s\" to kill ring" presentation-text))) + (defun slime-copy-presentation-at-mouse-to-kill-ring (event) (interactive "e") (multiple-value-bind (presentation start end buffer) (slime-presentation-around-click event) - (let ((presentation-text - (with-current-buffer buffer - (buffer-substring start end)))) - (kill-new presentation-text)))) + (slime-copy-presentation-to-kill-ring presentation start end buffer))) + +(defun slime-copy-presentation-at-point-to-kill-ring (point) + (interactive "d") + (multiple-value-bind (presentation start end) + (slime-presentation-around-or-before-point-or-error point) + (slime-copy-presentation-to-kill-ring presentation start end (current-buffer)))) +(defun slime-describe-presentation (presentation) + (slime-eval-describe + `(swank::describe-to-string + (swank::lookup-presented-object ',(slime-presentation-id presentation))))) + (defun slime-describe-presentation-at-mouse (event) (interactive "@e") (multiple-value-bind (presentation) (slime-presentation-around-click event) - (slime-eval-describe - `(swank::describe-to-string - (swank::lookup-presented-object ',(slime-presentation-id presentation)))))) + (slime-describe-presentation presentation))) + +(defun slime-describe-presentation-at-point (point) + (interactive "d") + (multiple-value-bind (presentation) + (slime-presentation-around-or-before-point-or-error point) + (slime-describe-presentation presentation))) + +(defun slime-pretty-print-presentation (presentation) + (slime-eval-describe + `(swank::swank-pprint + (cl:list + (swank::lookup-presented-object ',(slime-presentation-id presentation)))))) (defun slime-pretty-print-presentation-at-mouse (event) (interactive "@e") (multiple-value-bind (presentation) (slime-presentation-around-click event) - (slime-eval-describe - `(swank::swank-pprint - (cl:list - (swank::lookup-presented-object ',(slime-presentation-id presentation))))))) + (slime-pretty-print-presentation presentation))) + +(defun slime-pretty-print-presentation-at-point (point) + (interactive "d") + (multiple-value-bind (presentation) + (slime-presentation-around-or-before-point-or-error point) + (slime-pretty-print-presentation presentation))) + +(defun slime-mark-presentation (point) + (interactive "d") + (multiple-value-bind (presentation start end) + (slime-presentation-around-or-before-point-or-error point) + (goto-char start) + (push-mark end nil t))) + +(defun slime-previous-presentation () + "Move point to the beginning of the first presentation before point." + (interactive) + ;; First skip outside the current surrounding presentation (if any) + (multiple-value-bind (presentation start end) + (slime-presentation-around-point (point)) + (when presentation + (goto-char start))) + (let ((p (previous-single-property-change (point) 'slime-repl-presentation))) + (unless p + (error "No previous presentation")) + (multiple-value-bind (presentation start end) + (slime-presentation-around-or-before-point-or-error p) + (goto-char start)))) + +(defun slime-next-presentation () + "Move point to the beginning of the next presentation after point." + (interactive) + ;; First skip outside the current surrounding presentation (if any) + (multiple-value-bind (presentation start end) + (slime-presentation-around-point (point)) + (when presentation + (goto-char end))) + (let ((p (next-single-property-change (point) 'slime-repl-presentation))) + (unless p + (error "No next presentation")) + (multiple-value-bind (presentation start end) + (slime-presentation-around-or-before-point-or-error p) + (goto-char start)))) (defvar slime-presentation-map (make-sparse-keymap)) @@ -451,7 +541,7 @@ ("Inspect" . ,(savel 'slime-inspect-presentation-at-mouse)) ("Describe" . ,(savel 'slime-describe-presentation-at-mouse)) ("Pretty-print" . ,(savel 'slime-pretty-print-presentation-at-mouse)) - ("Copy to REPL" . ,(savel 'slime-copy-presentation-at-mouse)) + ("Copy to REPL" . ,(savel 'slime-copy-presentation-at-mouse-to-repl)) ("Copy to kill ring" . ,(savel 'slime-copy-presentation-at-mouse-to-kill-ring)) ,@(unless buffer-read-only `(("Copy to point" . ,(savel 'slime-copy-presentation-at-mouse-to-point)))) @@ -541,6 +631,62 @@ (let ((inhibit-read-only t)) (insert old-output))))) +;;; Presentation-related key bindings, non-context menu + +(defvar slime-presentation-command-map (make-sparse-keymap) + "Keymap for presentation-related commands. Bound to a prefix key.") + +(defvar slime-presentation-bindings + '((?i slime-inspect-presentation-at-point) + (?d slime-describe-presentation-at-point) + (?w slime-copy-presentation-at-point-to-kill-ring) + (?r slime-copy-presentation-at-point-to-repl) + (?p slime-previous-presentation) + (?n slime-next-presentation) + (? slime-mark-presentation) + (?\M-o slime-clear-presentations))) + +(defun slime-presentation-init-keymaps () + (setq slime-presentation-command-map (make-sparse-keymap)) + (loop for (key command) in slime-presentation-bindings + do (progn + ;; We bind both unmodified and with control. + (define-key slime-presentation-command-map (vector key) command) + (let ((modified (slime-control-modified-char key))) + (define-key slime-presentation-command-map (vector modified) command)))) + ;; C-c C-v is the prefix for the presentation-command map. + (slime-define-key "\C-v" slime-presentation-command-map :prefixed t :inferior t) + (define-key slime-repl-mode-map "\C-c\C-v" slime-presentation-command-map) + (define-key sldb-mode-map "\C-c\C-v" slime-presentation-command-map) + (define-key slime-inspector-mode-map "\C-c\C-v" slime-presentation-command-map)) + +(defun slime-presentation-around-or-before-point-p () + (multiple-value-bind (presentation beg end) + (slime-presentation-around-or-before-point (point)) + presentation)) + +(defvar slime-presentation-easy-menu + (let ((P '(slime-presentation-around-or-before-point-p))) + `("Presentations" + [ "Inspect" slime-inspect-presentation-at-point ,P ] + [ "Describe" slime-describe-presentation-at-point ,P ] + [ "Pretty-print" slime-pretty-print-presentation-at-point ,P ] + [ "Copy to REPL" slime-copy-presentation-at-point-to-repl ,P ] + [ "Copy to kill ring" slime-copy-presentation-at-point-to-kill-ring ,P ] + [ "Mark" slime-mark-presentation ,P ] + "--" + [ "Previous presentation" slime-previous-presentation ] + [ "Next presentation" slime-next-presentation ] + "--" + [ "Clear all presentations" slime-clear-presentations ]))) + +(defun slime-presentation-add-easy-menu () + (easy-menu-define menubar-slime-presentation slime-mode-map "Presentations" slime-presentation-easy-menu) + (easy-menu-define menubar-slime-presentation slime-repl-mode-map "Presentations" slime-presentation-easy-menu) + (easy-menu-define menubar-slime-presentation sldb-mode-map "Presentations" slime-presentation-easy-menu) + (easy-menu-add slime-presentation-easy-menu 'slime-mode-map) + (easy-menu-add slime-presentation-easy-menu 'slime-repl-mode-map) + (easy-menu-add slime-presentation-easy-menu 'sldb-mode-map)) ;;; hook functions (hard to isolate stuff) @@ -622,7 +768,17 @@ bridge-handlers))) (defun slime-clear-presentations () - (slime-eval-async `(swank:clear-repl-results))) + "Forget all objects associated to SLIME presentations. +This allows the garbage collector to remove these objects +even on Common Lisp implementations without weak hash tables." + (interactive) + (slime-eval-async `(swank:clear-repl-results)) + (unless (eql major-mode 'slime-repl-mode) + (slime-switch-to-output-buffer)) + (slime-for-each-presentation-in-region 1 (1+ (buffer-size)) + (lambda (presentation from to whole-p) + (slime-remove-presentation-properties from to + presentation)))) ;;; Initialization @@ -639,7 +795,9 @@ (add-hook 'slime-repl-current-input-hooks 'slime-presentation-current-input) (add-hook 'slime-open-stream-hooks 'slime-presentation-on-stream-open) (add-hook 'slime-repl-clear-buffer-hook 'slime-clear-presentations) - (add-hook 'slime-connected-hook 'slime-install-presentations)) + (add-hook 'slime-connected-hook 'slime-install-presentations) + (slime-presentation-init-keymaps) + (slime-presentation-add-easy-menu)) (defun slime-install-presentations () (slime-eval-async '(swank:swank-require :swank-presentations))) From mkoeppe at common-lisp.net Thu Jan 10 13:48:55 2008 From: mkoeppe at common-lisp.net (mkoeppe) Date: Thu, 10 Jan 2008 08:48:55 -0500 (EST) Subject: [slime-cvs] CVS slime/contrib Message-ID: <20080110134855.35F758100A@common-lisp.net> Update of /project/slime/cvsroot/slime/contrib In directory clnet:/tmp/cvs-serv31810 Modified Files: ChangeLog Log Message: *** empty log message *** --- /project/slime/cvsroot/slime/contrib/ChangeLog 2008/01/10 12:59:33 1.72 +++ /project/slime/cvsroot/slime/contrib/ChangeLog 2008/01/10 13:48:55 1.73 @@ -1,3 +1,48 @@ +2008-01-10 Matthias Koeppe + + Add keyboard commands (starting with C-c C-v) and a top-level menu + for presentation-related commands. Add a command (C-c C-v M-o) to + forget all objects associated with presentations, without + clearing the REPL buffer. + + * slime-presentations.el + (slime-presentation-around-or-before-point-or-error): New + function. + (slime-inspect-presentation): New function, factored out from + slime-inspect-presentation-at-mouse. + (slime-inspect-presentation-at-mouse): Use it here. + (slime-inspect-presentation-at-point): New command. + (slime-copy-presentation-to-repl): New function, factored out + from slime-copy-presentation-at-mouse. + (slime-copy-presentation-at-mouse-to-repl): Renamed from + slime-copy-presentation-at-mouse; use the new function + slime-copy-presentation-to-repl. + (slime-copy-presentation-at-point-to-repl): New command. + (slime-copy-presentation-to-kill-ring): New function, factored + out from slime-copy-presentation-at-mouse-to-kill-ring. + (slime-copy-presentation-at-point-to-kill-ring): New command. + (slime-describe-presentation): New function, factored out from + slime-describe-presentation-at-mouse. + (slime-describe-presentation-at-mouse): Use it here. + (slime-describe-presentation-at-point): New command. + (slime-pretty-print-presentation): New function, factored out + from slime-pretty-print-presentation-at-mouse. + (slime-pretty-print-presentation-at-mouse): Use it here. + (slime-pretty-print-presentation-at-point): New command. + (slime-mark-presentation): New command. + (slime-previous-presentation, slime-next-presentation): New + commands. + (slime-presentation-command-map, slime-presentation-bindings): + New variables. + (slime-presentation-init-keymaps): New function. + (slime-presentation-around-or-before-point-p): New function. + (slime-presentation-easy-menu): New variable. + (slime-presentation-add-easy-menu): New function. + (slime-clear-presentations): Make interactive, remove + presentation markup from all presentations in the REPL buffer. + (slime-presentations-init): Call slime-presentation-init-keymaps + and slime-presentation-add-easy-menu. + 2008-01-10 Tobias C. Rittweiler * swank-parse.lisp (slime-incomplete-form-at-point): Take the From trittweiler at common-lisp.net Thu Jan 10 14:07:11 2008 From: trittweiler at common-lisp.net (trittweiler) Date: Thu, 10 Jan 2008 09:07:11 -0500 (EST) Subject: [slime-cvs] CVS slime/contrib Message-ID: <20080110140711.B3EC781006@common-lisp.net> Update of /project/slime/cvsroot/slime/contrib In directory clnet:/tmp/cvs-serv6016 Modified Files: slime-parse.el Log Message: * swank-parse.lisp (slime-incomplete-form-at-point): Hopefully better fix than before. --- /project/slime/cvsroot/slime/contrib/slime-parse.el 2008/01/10 12:59:18 1.8 +++ /project/slime/cvsroot/slime/contrib/slime-parse.el 2008/01/10 14:07:11 1.9 @@ -23,21 +23,8 @@ ((:declaration declspec) op) ((:type-specifier typespec) op) (t - (let ((user-point (point))) - (save-excursion - (goto-char op-start) - ;; `arg-index' represents to the number of full sexps that - ;; come to the left of the sexp user's point is at. - (let ((full-sexps (slime-ensure-list - (slime-parse-sexp-at-point arg-index)))) - (forward-sexp arg-index) - (slime-forward-blanks) - (assert (<= (point) user-point)) - (let ((incomplete-sexp - (buffer-substring-no-properties (point) user-point))) - (if (string= incomplete-sexp "") - full-sexps - (append full-sexps (list incomplete-sexp))))))))))))) + (slime-make-form-spec-from-string + (concat (slime-incomplete-sexp-at-point) ")")))))))) ;; XXX: unused function (defun slime-cl-symbol-external-ref-p (symbol) From trittweiler at common-lisp.net Thu Jan 10 14:07:18 2008 From: trittweiler at common-lisp.net (trittweiler) Date: Thu, 10 Jan 2008 09:07:18 -0500 (EST) Subject: [slime-cvs] CVS slime/contrib Message-ID: <20080110140718.1480F81008@common-lisp.net> Update of /project/slime/cvsroot/slime/contrib In directory clnet:/tmp/cvs-serv6059 Modified Files: ChangeLog Log Message: * swank-parse.lisp (slime-incomplete-form-at-point): Hopefully better fix than before. --- /project/slime/cvsroot/slime/contrib/ChangeLog 2008/01/10 13:48:55 1.73 +++ /project/slime/cvsroot/slime/contrib/ChangeLog 2008/01/10 14:07:18 1.74 @@ -1,3 +1,8 @@ +2008-01-10 Tobias C. Rittweiler + + * swank-parse.lisp (slime-incomplete-form-at-point): Hopefully + better fix than before. + 2008-01-10 Matthias Koeppe Add keyboard commands (starting with C-c C-v) and a top-level menu From trittweiler at common-lisp.net Thu Jan 10 15:30:05 2008 From: trittweiler at common-lisp.net (trittweiler) Date: Thu, 10 Jan 2008 10:30:05 -0500 (EST) Subject: [slime-cvs] CVS slime Message-ID: <20080110153005.683505F070@common-lisp.net> Update of /project/slime/cvsroot/slime In directory clnet:/tmp/cvs-serv29816 Modified Files: slime.el Log Message: * slime.el (slime-delete-and-extract-region): New function. Portable version of `delete-and-extract-region' which returned NIL instead of "", as experienced by Matthias Koeppe. --- /project/slime/cvsroot/slime/slime.el 2008/01/09 17:08:32 1.890 +++ /project/slime/cvsroot/slime/slime.el 2008/01/10 15:30:02 1.891 @@ -6321,6 +6321,7 @@ (indent-sexp) (goto-char point)))))))) + (defun slime-macroexpand-1 (&optional repeatedly) "Display the macro expansion of the form at point. The form is expanded with CL:MACROEXPAND-1 or, if a prefix argument is given, with @@ -9074,21 +9075,6 @@ (list (nthcdr n seq)) (seq (> (length seq) n)))) -(defun slime-split-string (string &optional separators omit-nulls) - "This is like `split-string' in Emacs22, but also works in -Emacs20 and 21." - (let ((splits (split-string string separators))) - (if omit-nulls - (setq splits (remove "" splits)) - ;; SPLIT-STRING in Emacs before 22.x automatically removed nulls - ;; at beginning and end, so we gotta add them here again. - (when (or (slime-emacs-20-p) (slime-emacs-21-p)) - (when (find (elt string 0) separators) - (push "" splits)) - (when (find (elt string (1- (length string))) separators) - (setq splits (append splits (list "")))))) - splits)) - ;;;;; Buffer related (defun slime-buffer-narrowed-p (&optional buffer) @@ -9186,6 +9172,32 @@ (when (featurep 'xemacs) (require 'overlay)) +(defun slime-split-string (string &optional separators omit-nulls) + "This is like `split-string' in Emacs22, but also works in +Emacs20 and 21." + (let ((splits (split-string string separators))) + (if omit-nulls + (setq splits (remove "" splits)) + ;; SPLIT-STRING in Emacs before 22.x automatically removed nulls + ;; at beginning and end, so we gotta add them here again. + (when (or (slime-emacs-20-p) (slime-emacs-21-p)) + (when (find (elt string 0) separators) + (push "" splits)) + (when (find (elt string (1- (length string))) separators) + (setq splits (append splits (list "")))))) + splits)) + +(defun slime-delete-and-extract-region (start end) + "Like `delete-and-extract-region' except that it is guaranteed +to return a string. At least Emacs 21.3.50 returned `nil' on +\(delete-and-extract-region (point) (point)), this function +will return \"\"." + (let ((result (delete-and-extract-region start end))) + (if (null result) + "" + (assert (stringp result)) + result))) + (defmacro slime-defun-if-undefined (name &rest rest) ;; We can't decide at compile time whether NAME is properly ;; bound. So we delay the decision to runtime to ensure some From trittweiler at common-lisp.net Thu Jan 10 15:30:24 2008 From: trittweiler at common-lisp.net (trittweiler) Date: Thu, 10 Jan 2008 10:30:24 -0500 (EST) Subject: [slime-cvs] CVS slime Message-ID: <20080110153024.9E4276911A@common-lisp.net> Update of /project/slime/cvsroot/slime In directory clnet:/tmp/cvs-serv29960 Modified Files: ChangeLog Log Message: * slime.el (slime-delete-and-extract-region): New function. Portable version of `delete-and-extract-region' which returned NIL instead of "", as experienced by Matthias Koeppe. --- /project/slime/cvsroot/slime/ChangeLog 2008/01/09 17:08:59 1.1265 +++ /project/slime/cvsroot/slime/ChangeLog 2008/01/10 15:30:24 1.1266 @@ -1,3 +1,9 @@ +2008-01-10 Tobias C. Rittweiler + + * slime.el (slime-delete-and-extract-region): New + function. Portable version of `delete-and-extract-region' which + returned NIL instead of "", as experienced by Matthias Koeppe. + 2008-01-09 Matthias Koeppe * slime.el (slime-repl-mode-map): Bind C-c C-t to From trittweiler at common-lisp.net Thu Jan 10 15:32:09 2008 From: trittweiler at common-lisp.net (trittweiler) Date: Thu, 10 Jan 2008 10:32:09 -0500 (EST) Subject: [slime-cvs] CVS slime/contrib Message-ID: <20080110153209.8286881003@common-lisp.net> Update of /project/slime/cvsroot/slime/contrib In directory clnet:/tmp/cvs-serv30245/contrib Modified Files: slime-editing-commands.el Log Message: * slime-editing-commands.el (slime-close-all-parens-in-sexp): Use new portability function `slime-delete-and-extract-region'. --- /project/slime/cvsroot/slime/contrib/slime-editing-commands.el 2007/09/20 14:55:53 1.5 +++ /project/slime/cvsroot/slime/contrib/slime-editing-commands.el 2008/01/10 15:32:08 1.6 @@ -69,7 +69,7 @@ (setq point (point)) ;; count sexps until either '(' or comment is found at first column (while (and (not (looking-at "^[(;]")) - (ignore-errors (backward-up-list 1) t)) + (ignore-errors (backward-up-list 1) t)) (incf sexp-level)))) (when (> sexp-level 0) ;; insert correct number of right parens @@ -79,7 +79,7 @@ (setq point (point)) (skip-chars-forward " \t\n)") (skip-chars-backward " \t\n") - (let* ((deleted-region (delete-and-extract-region point (point))) + (let* ((deleted-region (slime-delete-and-extract-region point (point))) (deleted-text (substring-no-properties deleted-region)) (prior-parens-count (count ?\) deleted-text))) ;; Remember: we always insert as many parentheses as necessary From trittweiler at common-lisp.net Thu Jan 10 15:32:19 2008 From: trittweiler at common-lisp.net (trittweiler) Date: Thu, 10 Jan 2008 10:32:19 -0500 (EST) Subject: [slime-cvs] CVS slime/contrib Message-ID: <20080110153219.858A87914E@common-lisp.net> Update of /project/slime/cvsroot/slime/contrib In directory clnet:/tmp/cvs-serv30287/contrib Modified Files: ChangeLog Log Message: * slime-editing-commands.el (slime-close-all-parens-in-sexp): Use new portability function `slime-delete-and-extract-region'. --- /project/slime/cvsroot/slime/contrib/ChangeLog 2008/01/10 14:07:18 1.74 +++ /project/slime/cvsroot/slime/contrib/ChangeLog 2008/01/10 15:32:19 1.75 @@ -1,5 +1,10 @@ 2008-01-10 Tobias C. Rittweiler + * slime-editing-commands.el (slime-close-all-parens-in-sexp): Use + new portability function `slime-delete-and-extract-region'. + +2008-01-10 Tobias C. Rittweiler + * swank-parse.lisp (slime-incomplete-form-at-point): Hopefully better fix than before. From mkoeppe at common-lisp.net Thu Jan 10 18:29:53 2008 From: mkoeppe at common-lisp.net (mkoeppe) Date: Thu, 10 Jan 2008 13:29:53 -0500 (EST) Subject: [slime-cvs] CVS slime/contrib Message-ID: <20080110182953.D5D806912C@common-lisp.net> Update of /project/slime/cvsroot/slime/contrib In directory clnet:/tmp/cvs-serv11042 Modified Files: slime-presentations.el Log Message: (slime-presentation-bindings, slime-presentation-init-keymaps): Don't try to bind the control-key version of C-c C-v M-o. --- /project/slime/cvsroot/slime/contrib/slime-presentations.el 2008/01/10 13:48:47 1.9 +++ /project/slime/cvsroot/slime/contrib/slime-presentations.el 2008/01/10 18:29:53 1.10 @@ -643,8 +643,7 @@ (?r slime-copy-presentation-at-point-to-repl) (?p slime-previous-presentation) (?n slime-next-presentation) - (? slime-mark-presentation) - (?\M-o slime-clear-presentations))) + (? slime-mark-presentation))) (defun slime-presentation-init-keymaps () (setq slime-presentation-command-map (make-sparse-keymap)) @@ -654,6 +653,7 @@ (define-key slime-presentation-command-map (vector key) command) (let ((modified (slime-control-modified-char key))) (define-key slime-presentation-command-map (vector modified) command)))) + (define-key slime-presentation-command-map "\M-o" 'slime-clear-presentations) ;; C-c C-v is the prefix for the presentation-command map. (slime-define-key "\C-v" slime-presentation-command-map :prefixed t :inferior t) (define-key slime-repl-mode-map "\C-c\C-v" slime-presentation-command-map) From trittweiler at common-lisp.net Thu Jan 10 20:00:04 2008 From: trittweiler at common-lisp.net (trittweiler) Date: Thu, 10 Jan 2008 15:00:04 -0500 (EST) Subject: [slime-cvs] CVS slime/contrib Message-ID: <20080110200004.9BC08481A1@common-lisp.net> Update of /project/slime/cvsroot/slime/contrib In directory clnet:/tmp/cvs-serv30402/contrib Modified Files: slime-parse.el Log Message: * slime-parse.el (slime-make-form-spec-from-string): Correctly handle quoted things and other non-proper "(...)" forms. --- /project/slime/cvsroot/slime/contrib/slime-parse.el 2008/01/10 14:07:11 1.9 +++ /project/slime/cvsroot/slime/contrib/slime-parse.el 2008/01/10 20:00:04 1.10 @@ -229,9 +229,11 @@ => (\"foo\" (\"bar\" \"1\" (\"baz\" \":quux\")) \"'toto\") " - (cond ((slime-length= string 0) "") - ((equal string "()") '()) - (t + (cond ((slime-length= string 0) "") ; "" + ((equal string "()") '()) ; "()" + ((eql (char-syntax (aref string 0)) ?\') string) ; "'(foo)", "#(foo)" &c + ((not (eql (aref string 0) ?\()) string) ; "foo" + (t ; "(op arg1 arg2 ...)" (with-temp-buffer ;; Do NEVER ever try to activate `lisp-mode' here with ;; `slime-use-autodoc-mode' enabled, as this function is used @@ -247,17 +249,18 @@ (delete-region (point-min) (point)) (insert "("))) (goto-char (1- (point-max))) ; `(OP arg1 ... argN|)' + (assert (eql (char-after) ?\))) (multiple-value-bind (forms indices points) (slime-enclosing-form-specs 1) (if (null forms) string (let ((n (first (last indices)))) - (goto-char (1+ (point-min))) ; `(|OP arg1 ... argN)' - (mapcar #'(lambda (s) - (assert (not (equal s string))) ; trap against - (slime-make-form-spec-from-string s)) ; endless recursion. - (slime-ensure-list - (slime-parse-sexp-at-point (1+ n) t)))))))))) + (goto-char (1+ (point-min))) ; `(|OP arg1 ... argN)' + (mapcar #'(lambda (s) + (assert (not (equal s string))) ; trap against + (slime-make-form-spec-from-string s)) ; endless recursion. + (slime-ensure-list + (slime-parse-sexp-at-point (1+ n) t)))))))))) (defun slime-enclosing-form-specs (&optional max-levels) From trittweiler at common-lisp.net Thu Jan 10 20:00:17 2008 From: trittweiler at common-lisp.net (trittweiler) Date: Thu, 10 Jan 2008 15:00:17 -0500 (EST) Subject: [slime-cvs] CVS slime/contrib Message-ID: <20080110200017.801935C181@common-lisp.net> Update of /project/slime/cvsroot/slime/contrib In directory clnet:/tmp/cvs-serv31092/contrib Modified Files: swank-arglists.lisp Log Message: * swank-arglist.lisp (read-form-spec): Added assertion against receiving junk form specs from Emacs. --- /project/slime/cvsroot/slime/contrib/swank-arglists.lisp 2008/01/10 00:43:03 1.17 +++ /project/slime/cvsroot/slime/contrib/swank-arglists.lisp 2008/01/10 20:00:17 1.18 @@ -239,7 +239,8 @@ the flag if a symbol had to be interned." (multiple-value-bind (sexp pos interned?) (read-softly-from-string string) - (declare (ignore pos)) + ;; To make sure that we haven't got any junk from Emacs. + (assert (= pos (length string))) (values sexp interned?))) From trittweiler at common-lisp.net Thu Jan 10 20:00:28 2008 From: trittweiler at common-lisp.net (trittweiler) Date: Thu, 10 Jan 2008 15:00:28 -0500 (EST) Subject: [slime-cvs] CVS slime/contrib Message-ID: <20080110200028.2DF7E6F24A@common-lisp.net> Update of /project/slime/cvsroot/slime/contrib In directory clnet:/tmp/cvs-serv31662/contrib Modified Files: ChangeLog Log Message: * slime-parse.el (slime-make-form-spec-from-string): Correctly handle quoted things and other non-proper "(...)" forms. * swank-arglist.lisp (read-form-spec): Added assertion against receiving junk form specs from Emacs. --- /project/slime/cvsroot/slime/contrib/ChangeLog 2008/01/10 15:32:19 1.75 +++ /project/slime/cvsroot/slime/contrib/ChangeLog 2008/01/10 20:00:28 1.76 @@ -1,5 +1,13 @@ 2008-01-10 Tobias C. Rittweiler + * slime-parse.el (slime-make-form-spec-from-string): Correctly + handle quoted things and other non-proper "(...)" forms. + + * swank-arglist.lisp (read-form-spec): Added assertion against + receiving junk form specs from Emacs. + +2008-01-10 Tobias C. Rittweiler + * slime-editing-commands.el (slime-close-all-parens-in-sexp): Use new portability function `slime-delete-and-extract-region'. From trittweiler at common-lisp.net Thu Jan 10 20:23:42 2008 From: trittweiler at common-lisp.net (trittweiler) Date: Thu, 10 Jan 2008 15:23:42 -0500 (EST) Subject: [slime-cvs] CVS slime/contrib Message-ID: <20080110202342.B22CD3108F@common-lisp.net> Update of /project/slime/cvsroot/slime/contrib In directory clnet:/tmp/cvs-serv6422 Modified Files: ChangeLog Log Message: * ChangeLog: fixed typos. --- /project/slime/cvsroot/slime/contrib/ChangeLog 2008/01/10 20:00:28 1.76 +++ /project/slime/cvsroot/slime/contrib/ChangeLog 2008/01/10 20:23:41 1.77 @@ -64,7 +64,7 @@ 2008-01-10 Tobias C. Rittweiler * swank-parse.lisp (slime-incomplete-form-at-point): Take the - arglist index there user's point is located at correctly into + arglist index the user's point is located at correctly into account. Previously `C-c C-s' on `(defun |foo' would have inserted `args body...)', now it inserts `name args body...)' @@ -83,7 +83,7 @@ * swank-fuzzy.el: Updated some comments. (fuzzy-generate-matchings): Sort package matchings before traversal, such that they're traversed in the order of their - score. (Important with time limit exhausts during traversal.) + score. (Important when time limit exhausts during traversal.) 2008-01-09 Matthias Koeppe From mkoeppe at common-lisp.net Fri Jan 11 13:06:35 2008 From: mkoeppe at common-lisp.net (mkoeppe) Date: Fri, 11 Jan 2008 08:06:35 -0500 (EST) Subject: [slime-cvs] CVS slime/contrib Message-ID: <20080111130635.B595D1135@common-lisp.net> Update of /project/slime/cvsroot/slime/contrib In directory clnet:/tmp/cvs-serv21706/contrib Modified Files: slime-presentations.el Log Message: (slime-copy-or-inspect-presentation-at-mouse): Call slime-copy-presentation-at-mouse-to-repl rather than slime-copy-presentation-at-mouse. --- /project/slime/cvsroot/slime/contrib/slime-presentations.el 2008/01/10 18:29:53 1.10 +++ /project/slime/cvsroot/slime/contrib/slime-presentations.el 2008/01/11 13:06:35 1.11 @@ -352,7 +352,7 @@ (slime-presentation-around-click event) (if (with-current-buffer buffer (eq major-mode 'slime-repl-mode)) - (slime-copy-presentation-at-mouse event) + (slime-copy-presentation-at-mouse-to-repl event) (slime-inspect-presentation-at-mouse event)))) (defun slime-inspect-presentation (presentation start end buffer) From mkoeppe at common-lisp.net Fri Jan 11 13:06:45 2008 From: mkoeppe at common-lisp.net (mkoeppe) Date: Fri, 11 Jan 2008 08:06:45 -0500 (EST) Subject: [slime-cvs] CVS slime/contrib Message-ID: <20080111130645.34CE7111D9@common-lisp.net> Update of /project/slime/cvsroot/slime/contrib In directory clnet:/tmp/cvs-serv21728/contrib Modified Files: ChangeLog Log Message: --- /project/slime/cvsroot/slime/contrib/ChangeLog 2008/01/10 20:23:41 1.77 +++ /project/slime/cvsroot/slime/contrib/ChangeLog 2008/01/11 13:06:45 1.78 @@ -1,3 +1,10 @@ +2008-01-11 Stelian Ionescu + + * slime-presentations.el + (slime-copy-or-inspect-presentation-at-mouse): Call + slime-copy-presentation-at-mouse-to-repl rather than + slime-copy-presentation-at-mouse. + 2008-01-10 Tobias C. Rittweiler * slime-parse.el (slime-make-form-spec-from-string): Correctly From trittweiler at common-lisp.net Mon Jan 14 12:08:44 2008 From: trittweiler at common-lisp.net (trittweiler) Date: Mon, 14 Jan 2008 07:08:44 -0500 (EST) Subject: [slime-cvs] CVS slime Message-ID: <20080114120844.795F74F019@common-lisp.net> Update of /project/slime/cvsroot/slime In directory clnet:/tmp/cvs-serv9347 Modified Files: slime.el Log Message: * slime.el (sldb-mode): Add `sldb-quit' to `kill-buffer-hook' to close the debugging machinery on swank side when the SLDB buffer is killed. (Notice that killing the SLDB buffer manually will not restore window configuration in contrast to typing `q'.) --- /project/slime/cvsroot/slime/slime.el 2008/01/10 15:30:02 1.891 +++ /project/slime/cvsroot/slime/slime.el 2008/01/14 12:08:44 1.892 @@ -6527,7 +6527,8 @@ (slime-set-truncate-lines) ;; Make original slime-connection "sticky" for SLDB commands in this buffer (setq slime-buffer-connection (slime-connection)) - (add-local-hook 'kill-buffer-hook 'sldb-delete-overlays)) + (add-local-hook 'kill-buffer-hook 'sldb-delete-overlays) + (add-local-hook 'kill-buffer-hook 'sldb-quit)) (slime-define-keys sldb-mode-map ("h" 'describe-mode) From trittweiler at common-lisp.net Mon Jan 14 12:08:52 2008 From: trittweiler at common-lisp.net (trittweiler) Date: Mon, 14 Jan 2008 07:08:52 -0500 (EST) Subject: [slime-cvs] CVS slime Message-ID: <20080114120852.A2C315624B@common-lisp.net> Update of /project/slime/cvsroot/slime In directory clnet:/tmp/cvs-serv9396 Modified Files: ChangeLog Log Message: * slime.el (sldb-mode): Add `sldb-quit' to `kill-buffer-hook' to close the debugging machinery on swank side when the SLDB buffer is killed. (Notice that killing the SLDB buffer manually will not restore window configuration in contrast to typing `q'.) --- /project/slime/cvsroot/slime/ChangeLog 2008/01/10 15:30:24 1.1266 +++ /project/slime/cvsroot/slime/ChangeLog 2008/01/14 12:08:52 1.1267 @@ -1,3 +1,10 @@ +2008-01-14 Tobias C. Rittweiler + + * slime.el (sldb-mode): Add `sldb-quit' to `kill-buffer-hook' to + close the debugging machinery on swank side when the SLDB buffer + is killed. (Notice that killing the SLDB buffer manually will not + restore window configuration in contrast to typing `q'.) + 2008-01-10 Tobias C. Rittweiler * slime.el (slime-delete-and-extract-region): New From nsiivola at common-lisp.net Thu Jan 17 05:53:44 2008 From: nsiivola at common-lisp.net (nsiivola) Date: Thu, 17 Jan 2008 00:53:44 -0500 (EST) Subject: [slime-cvs] CVS slime Message-ID: <20080117055344.E4CFE72129@common-lisp.net> Update of /project/slime/cvsroot/slime In directory clnet:/tmp/cvs-serv32204 Modified Files: ChangeLog swank-sbcl.lisp Log Message: * swank-sbcl.lisp (sbcl-source-file-p): When a buffer is not associated with any file, M-. for names defined there ends up calling SBCL-SOURCE-FILE-P with NIL -- guard against that. --- /project/slime/cvsroot/slime/ChangeLog 2008/01/14 12:08:52 1.1267 +++ /project/slime/cvsroot/slime/ChangeLog 2008/01/17 05:53:44 1.1268 @@ -1,3 +1,9 @@ +2008-01-17 Nikodemus Siivola + + * swank-sbcl.lisp (sbcl-source-file-p): When a buffer is not + associated with any file, M-. for names defined there ends up + calling SBCL-SOURCE-FILE-P with NIL -- guard against that. + 2008-01-14 Tobias C. Rittweiler * slime.el (sldb-mode): Add `sldb-quit' to `kill-buffer-hook' to --- /project/slime/cvsroot/slime/swank-sbcl.lisp 2008/01/04 03:34:35 1.186 +++ /project/slime/cvsroot/slime/swank-sbcl.lisp 2008/01/17 05:53:44 1.187 @@ -236,8 +236,9 @@ (eql (mismatch "SB-" name) 3))) (defun sbcl-source-file-p (filename) - (loop for (_ pattern) in (logical-pathname-translations "SYS") - thereis (pathname-match-p filename pattern))) + (when filename + (loop for (_ pattern) in (logical-pathname-translations "SYS") + thereis (pathname-match-p filename pattern)))) (defun guess-readtable-for-filename (filename) (if (sbcl-source-file-p filename) From heller at common-lisp.net Sat Jan 19 14:08:28 2008 From: heller at common-lisp.net (heller) Date: Sat, 19 Jan 2008 09:08:28 -0500 (EST) Subject: [slime-cvs] CVS slime/contrib Message-ID: <20080119140828.8573825140@common-lisp.net> Update of /project/slime/cvsroot/slime/contrib In directory clnet:/tmp/cvs-serv20851 Modified Files: ChangeLog Added Files: swank-goo.goo swank-kawa.scm Log Message: swank-goo.goo: New file. swank-kawa.scm: New file. --- /project/slime/cvsroot/slime/contrib/ChangeLog 2008/01/11 13:06:45 1.78 +++ /project/slime/cvsroot/slime/contrib/ChangeLog 2008/01/19 14:08:27 1.79 @@ -1,3 +1,8 @@ +2008-01-19 Helmut Eller + + * swank-goo.goo: New file. + * swank-kawa.scm: New file. + 2008-01-11 Stelian Ionescu * slime-presentations.el --- /project/slime/cvsroot/slime/contrib/swank-goo.goo 2008/01/19 14:08:28 NONE +++ /project/slime/cvsroot/slime/contrib/swank-goo.goo 2008/01/19 14:08:28 1.1 ;;;; swank-goo.goo --- Swank server for GOO ;;; ;;; Copyright (C) 2005 Helmut Eller ;;; ;;; This file is licensed under the terms of the GNU General Public ;;; License as distributed with Emacs (press C-h C-c to view it). ;;;; Installation ;; ;; 1. Add something like this to your .emacs: ;; ;; (setq slime-lisp-implementations ;; '((goo ("g2c") :init goo-slime-init))) ;; ;; (defun goo-slime-init (file _) ;; (format "%S\n%S\n" ;; `(set goo/system:*module-search-path* ;; (cat '(".../slime/contrib/") ;; goo/system:*module-search-path*)) ;; `(swank-goo:start-swank ,file))) ;; ;; 2. Start everything with M-- M-x slime goo ;; ;;;; Code (use goo) (use goo/boot) (use goo/x) (use goo/io/port) (use goo/io/write) (use goo/eval) (use goo/system) (use goo/conditions) (use goo/fun) (use goo/loc) (use goo/chr) (use eval/module) (use eval/ast) (use eval/g2c) ;;;; server setup (df create-server (port-number) (setup-server port-number announce-port)) (df start-swank (port-file) (setup-server 0 (fun (s) (write-port-file (%local-port s) port-file)))) (df setup-server (port-number announce) (let ((s (create-socket port-number))) (fin (seq (announce s) (let ((c (accept s))) ;;(post "connection: %s" c) (fin (serve-requests c) (%close (@fd c))))) (post "closing socket: %s" s) (%close s)))) (df announce-port (socket) (post "Listening on port: %d\n" (%local-port socket))) (df write-port-file (port-number filename) (with-port (file (open filename)) (msg file "%d\n" port-number))) (dc ()) (dc ()) (dp @socket ( => )) (dp @in ( => )) (dp @out ( => )) (dv emacs-connection|(t? ) #f) (df serve-requests (socket) (dlet ((emacs-connection (new @socket socket @out (new @socket socket) @in (new @socket socket)))) (dlet ((out (@out emacs-connection)) (in (@in emacs-connection))) (while #t (simple-restart "SLIME top-level" (fun () (process-next-event socket))))))) (d. (t= 'nil)) (d. t #t) (d. cons pair) (dv tag-counter| 0) (df process-next-event (port) (dispatch-event (decode-message port) port)) (df dispatch-event (event port) ;; (post "%=\n" event) (match event ((:emacs-rex ,form ,package ,_thread-id ,id) (eval-for-emacs form package port id)) ((:read-string ,_) (def tag (incf tag-counter)) (encode-message `(:read-string ,_ ,tag) port) (rep loop () (match (decode-message port) ((:emacs-return-string ,_ ,rtag ,str) (assert (= tag rtag) "Unexpected reply tag: %d" rtag) str) ((, at evt) (try-recover (fun () (dispatch-event evt port)) (fun () (encode-message `(:read-aborted ,_ ,tag) port))) (loop))))) ((:emacs-return-string ,_ ,rtag ,str) (error "Unexpected event: %=" event)) ((, at _) (encode-message event port)))) (dc ()) (dp @module ( => )) (dp @id ( => )) (dp @port ( => )) (dp @prev ( => (t? ))) ;; should be ddv (dv eval-context|(t? ) #f) (df buffer-module () (@module eval-context)) (df eval-for-emacs (form| package|(t+ ) port id|) (try-recover (fun () (try debugger-hook (dlet ((eval-context (new @module (find-buffer-module package) @id id @port port @prev eval-context))) (def result (eval (frob-form-for-eval form) 'swank-goo)) (force-out out) (dispatch-event `(:return (:ok ,result) ,id) port)))) (fun () (dispatch-event `(:return (:abort) ,id) port)))) (dm find-buffer-module (name| => ) (or (elt-or (all-modules) (as-sym name) #f) (find-buffer-module 'nil))) (dm find-buffer-module (name| => ) default-module) (dv default-module| (runtime-module 'goo/user)) (d. slimefuns (fab 100)) (ds defslimefun (,name ,args , at body) `(set (elt slimefuns ',name) (df ,(cat-sym 'swank@ name) ,args , at body))) (df slimefun (name) (or (elt-or slimefuns name #f) (error "Undefined slimefun: %=" name))) ;; rewrite (swank:foo ...) to ((slimefun 'foo) ...) (df frob-form-for-eval (form) (match form ((,op , at args) (match (map as-sym (split (sym-name op) #\:)) ((swank ,name) `((slimefun ',name) , at args)))))) ;;;; debugger (dc ()) (dp @level ( => )) (dp @top-frame ( => )) (dp @restarts ( => )) (dp @condition ( => )) (dp @eval-context ( => (t? ))) (dv sldb-context|(t? ) #f) (df debugger-hook (c| resume) (let ((tf (find-top-frame 'debugger-hook 2)) (rs (compute-restarts c)) (l (if sldb-context (1+ (@level sldb-context)) 1))) (cond ((> l 10) (emergency-abort c)) (#t (dlet ((sldb-context (new @level l @top-frame tf @restarts rs @condition c @eval-context eval-context))) (let ((bt (compute-backtrace tf 0 10))) (force-out out) (dispatch-event `(:debug 0 ,l ,@(debugger-info c rs bt eval-context)) (@port eval-context)) (sldb-loop l (@port eval-context)))))))) (df emergency-abort (c) (post "Maximum debug level reached aborting...\n") (post "%s\n" (describe-condition c)) (do-stack-frames (fun (f args) (msg out " %= %=\n" f args))) (invoke-handler-interactively (find-restart ) in out)) (df sldb-loop (level port) (fin (while #t (dispatch-event `(:debug-activate 0 ,level) port) (simple-restart (msg-to-str "Return to SLDB level %s" level) (fun () (process-next-event port)))) (dispatch-event `(:debug-return 0 ,level nil) port))) (defslimefun backtrace (start| end|(t+ )) (backtrace-for-emacs (compute-backtrace (@top-frame sldb-context) start (if (isa? end ) end #f)))) (defslimefun throw-to-toplevel () (invoke-handler-interactively (find-restart ) in out)) (defslimefun invoke-nth-restart-for-emacs (sldb-level| n|) (when (= (@level sldb-context) sldb-level) (invoke-handler-interactively (elt (@restarts sldb-context) n) in out))) (defslimefun debugger-info-for-emacs (start end) (debugger-info (@condition sldb-context) (@restarts sldb-context) (compute-backtrace (@top-frame sldb-context) start (if (isa? end ) end #f)))) (defslimefun frame-locals-for-emacs (frame-idx) (def frame (nth-frame frame-idx)) (map-keyed (fun (i name) (lst ':name (sym-name name) ':id 0 ':value (safe-write-to-string (frame-var-value frame i)))) (frame-var-names frame))) (defslimefun frame-catch-tags-for-emacs (frame-idx) '()) (defslimefun inspect-frame-var (frame-idx var-idx) (reset-inspector) (inspect-object (frame-var-value (nth-frame frame-idx) var-idx))) (defslimefun inspect-current-condition () (reset-inspector) (inspect-object (@condition sldb-context))) (defslimefun frame-source-location-for-emacs (frame-idx) (match (nth-frame frame-idx) ((,f , at _) (or (emacs-src-loc f) `(:error ,(msg-to-str "No src-loc available for: %s" f)))))) (defslimefun eval-string-in-frame (string frame-idx) (def frame (nth-frame frame-idx)) (let ((names (frame-var-names frame)) (values (frame-var-values frame))) (write-to-string (app (eval `(fun ,names ,(read-from-string string)) (module-name (buffer-module))) values)))) (df debugger-info (condition restarts backtrace eval-context) (lst `(,(try-or (fun () (describe-condition condition)) "<...>") ,(cat " [class: " (class-name-str condition) "]") ()) (restarts-for-emacs restarts) (backtrace-for-emacs backtrace) (pending-continuations eval-context))) (df backtrace-for-emacs (backtrace) (map (fun (f) (match f ((,idx (,f , at args)) (lst idx (cat (if (fun-name f) (sym-name (fun-name f)) (safe-write-to-string f)) (safe-write-to-string args)))))) backtrace)) (df restarts-for-emacs (restarts) (map (fun (x) `(,(sym-name (class-name (%handler-condition-type x))) ,(describe-restart x))) restarts)) (df describe-restart (restart) (describe-handler (%handler-info restart) (%handler-condition-type restart))) (df compute-restarts (condition) (packing (%do-handlers-of-type (fun (c) (pack c))))) (df find-restart (type) (esc ret (%do-handlers-of-type type ret) #f)) (df pending-continuations (context|(t? )) (if context (pair (@id context) (pending-continuations (@prev context))) '())) (df find-top-frame (fname| offset|) (esc ret (let ((top-seen? #f)) (do-stack-frames (fun (f args) (cond (top-seen? (cond ((== offset 0) (ret (pair f args))) (#t (decf offset)))) ((== (fun-name f) fname) (set top-seen? #t)))))))) (df compute-backtrace (top-frame start| end) (packing (esc break (do-user-frames (fun (idx f args) (when (and end (<= end idx)) (break #f)) (when (<= start idx) (pack (lst idx (pair f args))))) top-frame)))) (df nth-frame (n|) (esc ret (do-user-frames (fun (idx f args) (when (= idx n) (ret (pair f args)))) (@top-frame sldb-context)))) (df frame-var-value (frame var-idx) (match frame ((,f , at args) (def sig (fun-sig f)) (def arity (sig-arity sig)) (def nary? (sig-nary? sig)) (cond ((< var-idx arity) (elt args var-idx)) (nary? (sub* args arity)))))) (df frame-var-names (frame) (match frame ((,f , at _) (fun-info-names (fun-info f))))) (df frame-var-values (frame) (map (curry frame-var-value frame) (keys (frame-var-names frame)))) (df do-user-frames (f| top-frame) (let ((idx -1) (top-seen? #f)) (do-stack-frames (fun (ffun args) (cond (top-seen? (incf idx) (f idx ffun (rev args))) ((= (pair ffun args) top-frame) (set top-seen? #t))))))) ;;;; Write some classes a little less verbose ;; (dm recurring-write (port| x d| recur|) ;; (msg port "#{%s &%s}" (class-name-str x) ;; (num-to-str-base (address-of x) 16))) (dm recurring-write (port| x| d| recur|) (msg port "#{%s %s}" (class-name-str x) (module-name x))) (dm recurring-write (port| x| d| recur|) (msg port "#{%s %s}" (class-name-str x) (binding-name x))) (dm recurring-write (port| x| d| recur|) (msg port "#{%s %s}" (class-name-str x) (len x))) (dm recurring-write (port| x| d| recur|) (msg port "#{%s}" (class-name-str x))) (dm recurring-write (port| x| d| recur|) (msg port "#{%s}" (class-name-str x))) (dm recurring-write (port| x| d| recur|) (msg port "#{%s %s:%=}" (class-name-str x) (src-loc-file x) (src-loc-line x))) ;;;; Inspector (dc ()) [602 lines skipped] --- /project/slime/cvsroot/slime/contrib/swank-kawa.scm 2008/01/19 14:08:28 NONE +++ /project/slime/cvsroot/slime/contrib/swank-kawa.scm 2008/01/19 14:08:28 1.1 [2466 lines skipped] From gcarncross at common-lisp.net Sat Jan 19 15:09:33 2008 From: gcarncross at common-lisp.net (gcarncross) Date: Sat, 19 Jan 2008 10:09:33 -0500 (EST) Subject: [slime-cvs] CVS slime Message-ID: <20080119150933.40E6428298@common-lisp.net> Update of /project/slime/cvsroot/slime In directory clnet:/tmp/cvs-serv30670 Modified Files: ChangeLog swank-ecl.lisp Log Message: Make ELC inspection better; should be able to handle all builtin types and CLOS objects now. --- /project/slime/cvsroot/slime/ChangeLog 2008/01/17 05:53:44 1.1268 +++ /project/slime/cvsroot/slime/ChangeLog 2008/01/19 15:09:31 1.1269 @@ -1,3 +1,8 @@ +2008-01-19 Geo Carncross + + * swank-ecl.lisp (inspect-for-emacs): Make ECL inspection better; + should be able to handle all builtin types and CLOS objects now. + 2008-01-17 Nikodemus Siivola * swank-sbcl.lisp (sbcl-source-file-p): When a buffer is not --- /project/slime/cvsroot/slime/swank-ecl.lisp 2007/12/22 02:53:58 1.10 +++ /project/slime/cvsroot/slime/swank-ecl.lisp 2008/01/19 15:09:33 1.11 @@ -254,6 +254,53 @@ (defimplementation make-default-inspector () (make-instance 'ecl-inspector)) +(defmethod inspect-for-emacs ((o t) (inspector backend-inspector)) + ; ecl clos support leaves some to be desired + (cond + ((streamp o) + (values + (format nil "~S is an ordinary stream" o) + (append + (list + "Open for " + (cond + ((ignore-errors (interactive-stream-p o)) "Interactive") + ((and (input-stream-p o) (output-stream-p o)) "Input and output") + ((input-stream-p o) "Input") + ((output-stream-p o) "Output")) + `(:newline) `(:newline)) + (label-value-line* + ("Element type" (stream-element-type o)) + ("External format" (stream-external-format o))) + (ignore-errors (label-value-line* + ("Broadcast streams" (broadcast-stream-streams o)))) + (ignore-errors (label-value-line* + ("Concatenated streams" (concatenated-stream-streams o)))) + (ignore-errors (label-value-line* + ("Echo input stream" (echo-stream-input-stream o)))) + (ignore-errors (label-value-line* + ("Echo output stream" (echo-stream-output-stream o)))) + (ignore-errors (label-value-line* + ("Output String" (get-output-stream-string o)))) + (ignore-errors (label-value-line* + ("Synonym symbol" (synonym-stream-symbol o)))) + (ignore-errors (label-value-line* + ("Input stream" (two-way-stream-input-stream o)))) + (ignore-errors (label-value-line* + ("Output stream" (two-way-stream-output-stream o))))))) + (t + (let* ((cl (si:instance-class o)) + (slots (clos:class-slots cl))) + (values (format nil "~S is an instance of class ~A" + o (clos::class-name cl)) + (loop for x in slots append + (let* ((name (clos:slot-definition-name x)) + (value (clos::slot-value o name))) + (list + (format nil "~S: " name) + `(:value ,value) + `(:newline))))))))) + ;;;; Definitions (defimplementation find-definitions (name) nil) From mkoeppe at common-lisp.net Sun Jan 20 13:31:05 2008 From: mkoeppe at common-lisp.net (mkoeppe) Date: Sun, 20 Jan 2008 08:31:05 -0500 (EST) Subject: [slime-cvs] CVS slime/doc Message-ID: <20080120133105.E74CD76358@common-lisp.net> Update of /project/slime/cvsroot/slime/doc In directory clnet:/tmp/cvs-serv18226 Modified Files: slime.texi Log Message: (Presentations): Improve documentation of presentations. --- /project/slime/cvsroot/slime/doc/slime.texi 2007/11/27 13:16:52 1.61 +++ /project/slime/cvsroot/slime/doc/slime.texi 2008/01/20 13:31:05 1.62 @@ -12,7 +12,7 @@ @set EDITION 3.0-alpha @set SLIMEVER 3.0-alpha @c @set UPDATED @today{} - at set UPDATED @code{$Date: 2007/11/27 13:16:52 $} + at set UPDATED @code{$Date: 2008/01/20 13:31:05 $} @set TITLE SLIME User Manual @settitle @value{TITLE}, version @value{EDITION} @@ -1347,7 +1347,7 @@ @c @kbditem{C-c M-g, slime-quit} @c Quit slime. - at kbditem{C-c C-t, slime-repl-clear-buffer} + at kbditem{C-c M-o, slime-repl-clear-buffer} Clear the entire buffer, leaving only a prompt. @kbditem{C-c C-o, slime-repl-clear-output} @@ -2188,7 +2188,7 @@ @node Contributed Packages @chapter Contributed Packages -In version 3.0 we moved some functionility to separate packages. This +In version 3.0 we moved some functionality to separate packages. This chapter tells you how to load contrib modules and describes what the particular packages do. @@ -2237,7 +2237,7 @@ available. @node Compound Completion - at section Compund Completion + at section Compound Completion @anchor{slime-complete-symbol*} The package @code{slime-c-p-c} provides a different symbol completion @@ -2472,26 +2472,127 @@ Right-clicking on the text brings up a menu with operations for the particular object. Some operations, like inspecting, are available for all objects, but the object may also have specialized operations. -E.g. pathnames have a dired operation. +For instance, pathnames have a dired operation. + +More importantly, it is possible to cut and paste presentations (i.e., +Lisp objects, not just their printed presentation), using all standard +Emacs commands. This way it is possible to cut and paste the results of +previous computations in the REPL. This is of particular importance for +unreadable objects. The package @code{slime-presentations} installs presentations in the -REPL, i.e. the results of evaluation commands become presentations. +REPL, i.e. the results of evaluation commands become presentations. In +this way, presentations generalize the use of the standard Common Lisp +REPL history variables @code{*}, @code{**}, @code{***}. Example: + + at example +CL-USER> (find-class 'standard-class) + at emph{#} +CL-USER> + at end example + +Presentations appear in red color in the buffer. +(In this manual, we indicate the presentations @emph{like this}.) +Using standard Emacs +commands, the presentation can be copied to a new input in the REPL: + + at example +CL-USER> (eql '@emph{#} '@emph{#}) + at emph{T} + at end example + +When you copy an incomplete presentation or edit the text within a +presentation, the presentation changes to plain text, losing the +association with a Lisp object. In the buffer, this is indicated by +changing the color of the text from red to black. This can be undone. + +For some implementations you can also install the package + at code{slime-presentation-streams}, which enables presentations on the +Lisp @code{*standard-output*} stream. This means that not only results +of computations, but also some objects that are printed to the standard +output (as a side-effect of the computation) are associated with +presentations. Currently, all unreadable objects +and pathnames get printed as presentations. + + at example +CL-USER> (describe (find-class 'standard-object)) + at emph{#} is an instance of + @emph{#}: + The following slots have :INSTANCE allocation: + PLIST NIL + FLAGS 1 + DIRECT-METHODS ((@emph{#} + ... + at end example + +Again, this makes it possible to inspect and copy-paste these objects. + +In addition to the standard Emacs commands, there are several keyboard +commands, a menu-bar menu, and a context menu to operate on +presentations. We describe the keyboard commands below; they are also +shown in the menu-bar menu. + + at table @kbd + at kbditem{C-c C-v SPC, slime-mark-presentation} +If point is within a presentation, move point to the beginning of the +presentation and mark to the end of the presentation. +This makes it possible to copy the presentation. + + at kbditem{C-c C-v w, slime-copy-presentation-at-point-to-kill-ring} +If point is within a presentation, copy the surrounding presentation +to the kill ring. + + at kbditem{C-c C-v r, slime-copy-presentation-at-point-to-repl} +If point is within a presentation, copy the surrounding presentation +to the REPL. + + at kbditem{C-c C-v d, slime-describe-presentation-at-point} +If point is within a presentation, describe the associated object. + + at kbditem{C-c C-v i, slime-inspect-presentation-at-point} +If point is within a presentation, inspect the associated object with +the SLIME inspector. + + at kbditem{C-c C-v n, slime-next-presentation} +Move point to the next presentation in the buffer. + + at kbditem{C-c C-v p, slime-previous-presentation} +Move point to the previous presentation in the buffer. -For some implementations you can also install - at code{slime-presentation-streams} which enables presentations on the -Lisp @code{*standard-output*} stream. E.g. printing a list to such a -stream will create presentions in the Emacs buffer. - - at table @kbd - at cmditem{slime-copy-or-inspect-presentation-at-mouse} - at cmditem{slime-inspect-presentation-at-mouse} - at cmditem{slime-copy-presentation-at-mouse} - at cmditem{slime-copy-presentation-at-mouse-to-point} - at cmditem{slime-copy-presentation-at-mouse-to-kill-ring} - at cmditem{slime-describe-presentation-at-mouse} - at cmditem{slime-pretty-print-presentation-at-mouse} - at cmditem{slime-clear-presentations} @end table +Similar operations are also possible from the context menu of every +presentation. Using @kbd{mouse-3} on a presentation, the context menu +opens and offers various commands. For some objects, specialized +commands are also offered. Users can define additional specialized +commands by defining a method for + at code{swank::menu-choices-for-presentation}. + + + at strong{Warning:} On Lisp implementations without weak hash tables, +all objects associated with presentations are protected from garbage +collection. If your Lisp image grows too large because of that, +use @kbd{C-c C-v M-o} (@code{slime-clear-presentations}) to remove these +associations. You can also use the command @kbd{C-c M-o} +(@code{slime-repl-clear-buffer}), which both clears the REPL buffer and +removes all associations of objects with presentations. + + at strong{Warning:} Presentations can confuse new users. + + at example +CL-USER> (cons 1 2) + at emph{(1 . 2)} +CL-USER> (eq '@emph{(1 . 2)} '@emph{(1 . 2)}) + at emph{T} + at end example + +One could have expected @code{NIL} here, because it looks like two +fresh cons cells are compared regarding object identity. +However, in the example the presentation @code{@emph{(1 . 2)}} was copied twice +to the REPL. Thus @code{EQ} is really invoked with the same object, +namely the cons cell that was returned by the first form entered in the +REPL. @node Typeout frames @section Typeout frames From mkoeppe at common-lisp.net Sun Jan 20 13:31:19 2008 From: mkoeppe at common-lisp.net (mkoeppe) Date: Sun, 20 Jan 2008 08:31:19 -0500 (EST) Subject: [slime-cvs] CVS slime Message-ID: <20080120133119.53F717635C@common-lisp.net> Update of /project/slime/cvsroot/slime In directory clnet:/tmp/cvs-serv18269 Modified Files: ChangeLog Log Message: *** empty log message *** --- /project/slime/cvsroot/slime/ChangeLog 2008/01/19 15:09:31 1.1269 +++ /project/slime/cvsroot/slime/ChangeLog 2008/01/20 13:31:18 1.1270 @@ -1,3 +1,8 @@ +2008-01-20 Matthias Koeppe + + * doc/slime.texi (Presentations): Improve documentation of + presentations. + 2008-01-19 Geo Carncross * swank-ecl.lisp (inspect-for-emacs): Make ECL inspection better; From mkoeppe at common-lisp.net Sun Jan 20 16:14:45 2008 From: mkoeppe at common-lisp.net (mkoeppe) Date: Sun, 20 Jan 2008 11:14:45 -0500 (EST) Subject: [slime-cvs] CVS slime/contrib Message-ID: <20080120161445.42815620C7@common-lisp.net> Update of /project/slime/cvsroot/slime/contrib In directory clnet:/tmp/cvs-serv24014/contrib Modified Files: slime-presentations.el Log Message: (slime-presentation-add-easy-menu): Install presentation menu also in the debugger and inspector. (slime-presentation-inspector-insert-ispec): New. (slime-presentation-sldb-insert-frame-variable-value): New. (slime-presentations-init): Install these functions as slime-inspector-insert-ispec-function and sldb-insert-frame-variable-value-function. --- /project/slime/cvsroot/slime/contrib/slime-presentations.el 2008/01/11 13:06:35 1.11 +++ /project/slime/cvsroot/slime/contrib/slime-presentations.el 2008/01/20 16:14:45 1.12 @@ -684,9 +684,11 @@ (easy-menu-define menubar-slime-presentation slime-mode-map "Presentations" slime-presentation-easy-menu) (easy-menu-define menubar-slime-presentation slime-repl-mode-map "Presentations" slime-presentation-easy-menu) (easy-menu-define menubar-slime-presentation sldb-mode-map "Presentations" slime-presentation-easy-menu) + (easy-menu-define menubar-slime-presentation slime-inspector-mode-map "Presentations" slime-presentation-easy-menu) (easy-menu-add slime-presentation-easy-menu 'slime-mode-map) (easy-menu-add slime-presentation-easy-menu 'slime-repl-mode-map) - (easy-menu-add slime-presentation-easy-menu 'sldb-mode-map)) + (easy-menu-add slime-presentation-easy-menu 'sldb-mode-map) + (easy-menu-add slime-presentation-easy-menu 'slime-inspector-mode-map)) ;;; hook functions (hard to isolate stuff) @@ -780,6 +782,27 @@ (slime-remove-presentation-properties from to presentation)))) +(defun slime-presentation-inspector-insert-ispec (ispec) + (if (stringp ispec) + (insert ispec) + (destructure-case ispec + ((:value string id) + (slime-propertize-region + (list 'slime-part-number id + 'mouse-face 'highlight + 'face 'slime-inspector-value-face) + (slime-insert-presentation string `(:inspected-part ,id) t))) + ((:action string id) + (slime-insert-propertized (list 'slime-action-number id + 'mouse-face 'highlight + 'face 'slime-inspector-action-face) + string))))) + +(defun slime-presentation-sldb-insert-frame-variable-value (value frame index) + (slime-insert-presentation + (in-sldb-face local-value value) + `(:frame-var ,slime-current-thread ,(car frame) ,i) t)) + ;;; Initialization (defun slime-presentations-init () @@ -796,6 +819,9 @@ (add-hook 'slime-open-stream-hooks 'slime-presentation-on-stream-open) (add-hook 'slime-repl-clear-buffer-hook 'slime-clear-presentations) (add-hook 'slime-connected-hook 'slime-install-presentations) + (setq slime-inspector-insert-ispec-function 'slime-presentation-inspector-insert-ispec) + (setq sldb-insert-frame-variable-value-function + 'slime-presentation-sldb-insert-frame-variable-value) (slime-presentation-init-keymaps) (slime-presentation-add-easy-menu)) From mkoeppe at common-lisp.net Sun Jan 20 16:15:26 2008 From: mkoeppe at common-lisp.net (mkoeppe) Date: Sun, 20 Jan 2008 11:15:26 -0500 (EST) Subject: [slime-cvs] CVS slime/doc Message-ID: <20080120161526.0C53817041@common-lisp.net> Update of /project/slime/cvsroot/slime/doc In directory clnet:/tmp/cvs-serv24243/doc Modified Files: slime.texi Log Message: Document presentations in debugger and inspector --- /project/slime/cvsroot/slime/doc/slime.texi 2008/01/20 13:31:05 1.62 +++ /project/slime/cvsroot/slime/doc/slime.texi 2008/01/20 16:15:25 1.63 @@ -12,7 +12,7 @@ @set EDITION 3.0-alpha @set SLIMEVER 3.0-alpha @c @set UPDATED @today{} - at set UPDATED @code{$Date: 2008/01/20 13:31:05 $} + at set UPDATED @code{$Date: 2008/01/20 16:15:25 $} @set TITLE SLIME User Manual @settitle @value{TITLE}, version @value{EDITION} @@ -2506,9 +2506,20 @@ association with a Lisp object. In the buffer, this is indicated by changing the color of the text from red to black. This can be undone. -For some implementations you can also install the package +Presentations are also available in the inspector (all inspectable parts +are presentations) and the debugger (all local variables are +presentations). This makes it possible to evaluate expressions in the +REPL using objects that appear in local variables of some active +debugger frame; this can be more convenient than using @code{M-x +sldb-eval-in-frame}. @strong{Warning:} The presentations that stem from +the inspector and debugger are only valid as long as the corresponding +buffers are open. Using them later can cause errors or confusing +behavior. + +For some Lisp implementations you can also install the package @code{slime-presentation-streams}, which enables presentations on the -Lisp @code{*standard-output*} stream. This means that not only results +Lisp @code{*standard-output*} stream and similar streams. This means +that not only results of computations, but also some objects that are printed to the standard output (as a side-effect of the computation) are associated with presentations. Currently, all unreadable objects From mkoeppe at common-lisp.net Sun Jan 20 16:15:49 2008 From: mkoeppe at common-lisp.net (mkoeppe) Date: Sun, 20 Jan 2008 11:15:49 -0500 (EST) Subject: [slime-cvs] CVS slime Message-ID: <20080120161549.877DD28278@common-lisp.net> Update of /project/slime/cvsroot/slime In directory clnet:/tmp/cvs-serv24313 Modified Files: slime.el Log Message: (sldb-insert-frame-variable-value-function): New variable. (sldb-insert-frame-variable-value): New function, default value for sldb-insert-frame-variable-value-function. (sldb-insert-locals): Use it here. (slime-inspector-insert-ispec-function): New variable. (slime-open-inspector): Use it here. --- /project/slime/cvsroot/slime/slime.el 2008/01/14 12:08:44 1.892 +++ /project/slime/cvsroot/slime/slime.el 2008/01/20 16:15:49 1.893 @@ -7057,6 +7057,8 @@ (destructuring-bind (start end) (sldb-frame-region) (list start end frame locals catches)))) +(defvar sldb-insert-frame-variable-value-function 'sldb-insert-frame-variable-value) + (defun sldb-insert-locals (vars prefix frame) "Insert VARS and add PREFIX at the beginning of each inserted line. VAR should be a plist with the keys :name, :id, and :value." @@ -7069,7 +7071,11 @@ (in-sldb-face local-name (concat name (if (zerop id) "" (format "#%d" id)))) " = ") - (insert (in-sldb-face local-value value) "\n"))))) + (funcall sldb-insert-frame-variable-value-function value frame i) + (insert "\n"))))) + +(defun sldb-insert-frame-variable-value (value frame index) + (insert (in-sldb-face local-value value))) (defun sldb-hide-frame-details () ;; delete locals and catch tags, but keep the function name and args. @@ -7500,6 +7506,8 @@ (defmacro slime-inspector-fontify (face string) `(slime-add-face ',(intern (format "slime-inspector-%s-face" face)) ,string)) +(defvar slime-inspector-insert-ispec-function 'slime-inspector-insert-ispec) + (defun slime-open-inspector (inspected-parts &optional point) "Display INSPECTED-PARTS in a new inspector window. Optionally set point to POINT." @@ -7519,7 +7527,7 @@ (backward-delete-char 1)) (insert "\n" (fontify label "--------------------") "\n") (save-excursion - (mapc #'slime-inspector-insert-ispec content)) + (mapc slime-inspector-insert-ispec-function content)) (pop-to-buffer (current-buffer)) (when point (check-type point cons) From mkoeppe at common-lisp.net Sun Jan 20 16:18:49 2008 From: mkoeppe at common-lisp.net (mkoeppe) Date: Sun, 20 Jan 2008 11:18:49 -0500 (EST) Subject: [slime-cvs] CVS slime/contrib Message-ID: <20080120161849.685912F00A@common-lisp.net> Update of /project/slime/cvsroot/slime/contrib In directory clnet:/tmp/cvs-serv24670/contrib Modified Files: ChangeLog Log Message: --- /project/slime/cvsroot/slime/contrib/ChangeLog 2008/01/19 14:08:27 1.79 +++ /project/slime/cvsroot/slime/contrib/ChangeLog 2008/01/20 16:18:49 1.80 @@ -1,3 +1,16 @@ +2008-01-20 Matthias Koeppe + + Hook presentations into debugger and inspector, restoring + features that were removed on 2007-08-27. + + * slime-presentations.el (slime-presentation-add-easy-menu): + Install presentation menu also in the debugger and inspector. + (slime-presentation-inspector-insert-ispec): New. + (slime-presentation-sldb-insert-frame-variable-value): New. + (slime-presentations-init): Install these functions as + slime-inspector-insert-ispec-function and + sldb-insert-frame-variable-value-function. + 2008-01-19 Helmut Eller * swank-goo.goo: New file. From mkoeppe at common-lisp.net Sun Jan 20 16:19:00 2008 From: mkoeppe at common-lisp.net (mkoeppe) Date: Sun, 20 Jan 2008 11:19:00 -0500 (EST) Subject: [slime-cvs] CVS slime Message-ID: <20080120161900.56338330C9@common-lisp.net> Update of /project/slime/cvsroot/slime In directory clnet:/tmp/cvs-serv24715 Modified Files: ChangeLog Log Message: --- /project/slime/cvsroot/slime/ChangeLog 2008/01/20 13:31:18 1.1270 +++ /project/slime/cvsroot/slime/ChangeLog 2008/01/20 16:18:59 1.1271 @@ -1,5 +1,19 @@ 2008-01-20 Matthias Koeppe + New hooks that allow the slime-presentations contrib to hook + into the debugger and inspector. + + * slime.el (sldb-insert-frame-variable-value-function): New + variable. + (sldb-insert-frame-variable-value): New function, default value + for sldb-insert-frame-variable-value-function. + (sldb-insert-locals): Use it here. + + * slime.el (slime-inspector-insert-ispec-function): New variable. + (slime-open-inspector): Use it here. + +2008-01-20 Matthias Koeppe + * doc/slime.texi (Presentations): Improve documentation of presentations. From mkoeppe at common-lisp.net Sun Jan 20 16:57:49 2008 From: mkoeppe at common-lisp.net (mkoeppe) Date: Sun, 20 Jan 2008 11:57:49 -0500 (EST) Subject: [slime-cvs] CVS slime/doc Message-ID: <20080120165749.6DFF632016@common-lisp.net> Update of /project/slime/cvsroot/slime/doc In directory clnet:/tmp/cvs-serv1129 Modified Files: slime.texi Log Message: Improve documentation for slime-c-p-c contrib. --- /project/slime/cvsroot/slime/doc/slime.texi 2008/01/20 16:15:25 1.63 +++ /project/slime/cvsroot/slime/doc/slime.texi 2008/01/20 16:57:49 1.64 @@ -12,7 +12,7 @@ @set EDITION 3.0-alpha @set SLIMEVER 3.0-alpha @c @set UPDATED @today{} - at set UPDATED @code{$Date: 2008/01/20 16:15:25 $} + at set UPDATED @code{$Date: 2008/01/20 16:57:49 $} @set TITLE SLIME User Manual @settitle @value{TITLE}, version @value{EDITION} @@ -2270,14 +2270,40 @@ @code{slime-c-p-c-unambiguous-prefix-p} is nil, point moves to the end of the inserted text, after the @code{o} in this case. +In addition, @code{slime-c-p-c} provides completion for character names +(mostly useful for Unicode-aware implementations): + + at example +CL-USER> #\Sp + at end example + +Here SLIME will usually complete the character to @code{#\Space}, but +in a Unicode-aware implementation, this might provide the following completions: + at example +Space Space +Sparkle Spherical_Angle +Spherical_Angle_Opening_Left Spherical_Angle_Opening_Up + at end example + +The package @code{slime-c-p-c} also provides context-sensitive completion for keywords. +Example: + + at example +CL-USER> (find 1 '(1 2 3) :s + at end example + +Here SLIME will complete @code{:start}, rather than suggesting all +ever-interned keywords starting with @code{:s}. + + @table @kbd @kbditem{C-c C-s, slime-complete-form} Looks up and inserts into the current buffer the argument list for the function at point, if there is one. More generally, the command completes an incomplete form with a template for the missing arguments. There is special code for discovering extra keywords of generic -functions and for handling @code{make-instance} and - at code{defmethod}. Examples: +functions and for handling @code{make-instance}, + at code{defmethod}, and many other functions. Examples: @example (subseq "abc" From heller at common-lisp.net Mon Jan 21 11:51:07 2008 From: heller at common-lisp.net (heller) Date: Mon, 21 Jan 2008 06:51:07 -0500 (EST) Subject: [slime-cvs] CVS slime Message-ID: <20080121115107.E465B1203D@common-lisp.net> Update of /project/slime/cvsroot/slime In directory clnet:/tmp/cvs-serv8859 Modified Files: slime.el ChangeLog Log Message: Fix debugger bug. * slime.el (sldb-mode): Don't throw to toplevel in the kill-buffer-hook, since the buffer can be killed for other reasons too. (test break): Test BREAK and CONTINUE in a loop. (slime-wait-condition): Display the current time. --- /project/slime/cvsroot/slime/slime.el 2008/01/20 16:15:49 1.893 +++ /project/slime/cvsroot/slime/slime.el 2008/01/21 11:51:06 1.894 @@ -6527,8 +6527,7 @@ (slime-set-truncate-lines) ;; Make original slime-connection "sticky" for SLDB commands in this buffer (setq slime-buffer-connection (slime-connection)) - (add-local-hook 'kill-buffer-hook 'sldb-delete-overlays) - (add-local-hook 'kill-buffer-hook 'sldb-quit)) + (add-local-hook 'kill-buffer-hook 'sldb-delete-overlays)) (slime-define-keys sldb-mode-map ("h" 'describe-mode) @@ -8436,6 +8435,9 @@ (defun slime-wait-condition (name predicate timeout) (let ((end (time-add (current-time) (seconds-to-time timeout)))) (while (not (funcall predicate)) + (let ((now (current-time))) + (message "waiting for condition: %s [%s.%06d]" name + (format-time-string "%H:%M:%S" now) (third now))) (cond ((time-less-p end (current-time)) (error "Timeout waiting for condition: %S" name)) (t @@ -8653,9 +8655,9 @@ (sldb-quit) ;; Going down - enter another recursive debug ;; Recursively debug. - (slime-eval-async 'no-such-variable))))))) + (slime-eval-async '(error)))))))) (let ((sldb-hook (cons debug-hook sldb-hook))) - (slime-eval-async 'no-such-variable) + (slime-eval-async '(error)) (slime-sync-to-top-level 5) (slime-check-top-level) (slime-check ("Maximum depth reached (%S) is %S." @@ -8968,24 +8970,31 @@ (not (not (get-buffer-window (current-buffer))))))) (def-slime-test break - () + (times) "Test if BREAK invokes SLDB." - '(()) + '((1) (2) (3)) (slime-accept-process-output nil 1) (slime-check-top-level) - (slime-compile-string (prin1-to-string '(cl:defun cl-user::foo () - (cl:break))) - 0) + (slime-compile-string + (prin1-to-string `(defun cl-user::foo () + (dotimes (i ,times) + (break) + (sleep 0.2)))) + 0) (slime-sync-to-top-level 2) (slime-eval-async '(cl-user::foo)) - (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-quit)) - (slime-accept-process-output nil 1) + (dotimes (i times) + (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 "sldb closed" + (lambda () (not (sldb-get-default-buffer))) + 0.2)) (slime-sync-to-top-level 5)) (def-slime-test interrupt-at-toplevel --- /project/slime/cvsroot/slime/ChangeLog 2008/01/20 16:18:59 1.1271 +++ /project/slime/cvsroot/slime/ChangeLog 2008/01/21 11:51:07 1.1272 @@ -1,3 +1,11 @@ +2008-01-21 Helmut Eller + + * slime.el (sldb-mode): Don't throw to toplevel in the + kill-buffer-hook, since the buffer can be killed for other reasons + too. + (test break): Test BREAK and CONTINUE in a loop. + (slime-wait-condition): Display the current time. + 2008-01-20 Matthias Koeppe New hooks that allow the slime-presentations contrib to hook @@ -94,7 +102,7 @@ * swank.lisp (read-softly-from-string): Now actually returns all three values as explained in its docstring. - + 2007-12-14 Tobias C. Rittweiler * slime.el (slime-insert-xref-location): New function. Tries to From heller at common-lisp.net Sun Jan 27 10:13:19 2008 From: heller at common-lisp.net (heller) Date: Sun, 27 Jan 2008 05:13:19 -0500 (EST) Subject: [slime-cvs] CVS slime/contrib Message-ID: <20080127101319.E4C791703F@common-lisp.net> Update of /project/slime/cvsroot/slime/contrib In directory clnet:/tmp/cvs-serv3479 Modified Files: ChangeLog slime-autodoc.el Log Message: Use slime-require instead of a connected-hook. * slime-autodoc.el (slime-autodoc-on-connect): Deleted. --- /project/slime/cvsroot/slime/contrib/ChangeLog 2008/01/20 16:18:49 1.80 +++ /project/slime/cvsroot/slime/contrib/ChangeLog 2008/01/27 10:13:07 1.81 @@ -1,3 +1,9 @@ +2008-01-27 Helmut Eller + + Use slime-require instead of a connected-hook. + + * slime-autodoc.el (slime-autodoc-on-connect): Deleted. + 2008-01-20 Matthias Koeppe Hook presentations into debugger and inspector, restoring --- /project/slime/cvsroot/slime/contrib/slime-autodoc.el 2007/10/01 13:37:10 1.5 +++ /project/slime/cvsroot/slime/contrib/slime-autodoc.el 2008/01/27 10:13:09 1.6 @@ -253,21 +253,18 @@ (defun slime-autodoc-init () (setq slime-echo-arglist-function 'slime-autodoc) - (add-hook 'slime-connected-hook 'slime-autodoc-on-connect) (dolist (h '(slime-mode-hook slime-repl-mode-hook sldb-mode-hook)) (add-hook h 'slime-autodoc-maybe-enable))) -(defun slime-autodoc-on-connect () - (slime-eval-async '(swank:swank-require :swank-arglists))) - (defun slime-autodoc-maybe-enable () (when slime-use-autodoc-mode (slime-autodoc-mode 1))) (defun slime-autodoc-unload () (setq slime-echo-arglist-function 'slime-show-arglist) - (remove-hook 'slime-connected-hook 'slime-autodoc-on-connect) (dolist (h '(slime-mode-hook slime-repl-mode-hook sldb-mode-hook)) (remove-hook h 'slime-autodoc-maybe-enable))) +(slime-require :swank-arglists) + (provide 'slime-autodoc) From heller at common-lisp.net Sun Jan 27 10:16:01 2008 From: heller at common-lisp.net (heller) Date: Sun, 27 Jan 2008 05:16:01 -0500 (EST) Subject: [slime-cvs] CVS slime Message-ID: <20080127101601.9B26E15011@common-lisp.net> Update of /project/slime/cvsroot/slime In directory clnet:/tmp/cvs-serv4185 Modified Files: ChangeLog swank-source-path-parser.lisp slime.el Log Message: Fix source-path mapping for #+#.'(:and). Patch by Luis Oliveira. * swank-source-path-parser.lisp (make-source-recording-readtable): don't suppress the #. reader macro. (read-and-record-source-map): don't bind *read-eval* to nil. (suppress-sharp-dot): unused, delete it. * slime.el (test compile-defun): test with #+#.'(:and). --- /project/slime/cvsroot/slime/ChangeLog 2008/01/21 11:51:07 1.1272 +++ /project/slime/cvsroot/slime/ChangeLog 2008/01/27 10:15:48 1.1273 @@ -1,3 +1,12 @@ +2008-01-22 Lu?s Oliveira + + * swank-source-path-parser.lisp (make-source-recording-readtable): + don't suppress the #. reader macro. + (read-and-record-source-map): don't bind *read-eval* to nil. + (suppress-sharp-dot): unused, delete it. + + * slime.el (test compile-defun): test with #+#.'(:and). + 2008-01-21 Helmut Eller * slime.el (sldb-mode): Don't throw to toplevel in the --- /project/slime/cvsroot/slime/swank-source-path-parser.lisp 2006/06/25 08:33:16 1.17 +++ /project/slime/cvsroot/slime/swank-source-path-parser.lisp 2008/01/27 10:15:52 1.18 @@ -56,20 +56,8 @@ (when fn (set-macro-character char (make-source-recorder fn source-map) term tab))))) - (suppress-sharp-dot tab) tab)) -(defun suppress-sharp-dot (readtable) - (when (get-macro-character #\# readtable) - (let ((sharp-dot (get-dispatch-macro-character #\# #\. readtable))) - (set-dispatch-macro-character #\# #\. (lambda (&rest args) - (let ((*read-suppress* t)) - (apply sharp-dot args)) - (if *read-suppress* - (values) - (list (gensym "#.")))) - readtable)))) - (defun read-and-record-source-map (stream) "Read the next object from STREAM. Return the object together with a hashtable that maps @@ -90,8 +78,7 @@ (let ((*read-suppress* t)) (dotimes (i n) (read stream))) - (let ((*read-suppress* nil) - (*read-eval* nil)) + (let ((*read-suppress* nil)) (read-and-record-source-map stream))) (defun source-path-stream-position (path stream) --- /project/slime/cvsroot/slime/slime.el 2008/01/21 11:51:06 1.894 +++ /project/slime/cvsroot/slime/slime.el 2008/01/27 10:15:52 1.895 @@ -8623,7 +8623,10 @@ (cl-user::bar)) " - (cl-user::bar))) + (cl-user::bar)) + ("(defun foo () + #+#.'(:and) (/ 1 0))" + (/ 1 0))) (slime-check-top-level) (with-temp-buffer (lisp-mode) From heller at common-lisp.net Sun Jan 27 10:17:35 2008 From: heller at common-lisp.net (heller) Date: Sun, 27 Jan 2008 05:17:35 -0500 (EST) Subject: [slime-cvs] CVS slime/contrib Message-ID: <20080127101735.BFC7D4C006@common-lisp.net> Update of /project/slime/cvsroot/slime/contrib In directory clnet:/tmp/cvs-serv4721 Modified Files: ChangeLog slime-autodoc.el slime-typeout-frame.el Log Message: Make autodoc use the correct width of the typeout-window. * slime-autodoc.el (slime-autodoc-dimensions-function): New variable. (slime-autodoc-message-dimensions): Use it. * slime-typeout-frame.el (slime-typeout-autodoc-dimensions): New function. (slime-typeout-frame-init): Use it. --- /project/slime/cvsroot/slime/contrib/ChangeLog 2008/01/27 10:13:07 1.81 +++ /project/slime/cvsroot/slime/contrib/ChangeLog 2008/01/27 10:17:34 1.82 @@ -1,5 +1,17 @@ 2008-01-27 Helmut Eller + Make autodoc use the correct width of the typeout-window. + + * slime-autodoc.el (slime-autodoc-dimensions-function): New + variable. + (slime-autodoc-message-dimensions): Use it. + + * slime-typeout-frame.el (slime-typeout-autodoc-dimensions): New + function. + (slime-typeout-frame-init): Use it. + +2008-01-27 Helmut Eller + Use slime-require instead of a connected-hook. * slime-autodoc.el (slime-autodoc-on-connect): Deleted. --- /project/slime/cvsroot/slime/contrib/slime-autodoc.el 2008/01/27 10:13:09 1.6 +++ /project/slime/cvsroot/slime/contrib/slime-autodoc.el 2008/01/27 10:17:34 1.7 @@ -116,10 +116,14 @@ (setq slime-autodoc-last-message doc) (message "%s" doc)) +(defvar slime-autodoc-dimensions-function nil) + (defun slime-autodoc-message-dimensions () "Return the available width and height for pretty printing autodoc messages." (cond + (slime-autodoc-dimensions-function + (funcall slime-autodoc-dimensions-function)) (slime-autodoc-use-multiline-p ;; Use the full width of the minibuffer; ;; minibuffer will grow vertically if necessary --- /project/slime/cvsroot/slime/contrib/slime-typeout-frame.el 2007/10/01 11:50:06 1.5 +++ /project/slime/cvsroot/slime/contrib/slime-typeout-frame.el 2008/01/27 10:17:34 1.6 @@ -64,6 +64,12 @@ (setq slime-autodoc-last-message "") (slime-typeout-message-aux "%s" doc)) +(defun slime-typeout-autodoc-dimensions () + (cond ((slime-typeout-active-p) + (list (window-width slime-typeout-window) nil)) + (t + (list 75 nil)))) + ;;; Initialization @@ -74,7 +80,8 @@ (loop for (var value) in '((slime-message-function slime-typeout-message) (slime-background-message-function slime-typeout-message) - (slime-autodoc-message-function slime-typeout-autodoc-message)) + (slime-autodoc-message-function slime-typeout-autodoc-message) + (slime-autodoc-dimensions-function slime-typeout-autodoc-dimensions)) do (slime-typeout-frame-init-var var value))) (defun slime-typeout-frame-init-var (var value) @@ -86,6 +93,7 @@ (remove-hook 'slime-connected-hook 'slime-ensure-typeout-frame) (loop for (var value) in slime-typeout-frame-unbind-stack do (cond ((eq var 'slime-unbound) (makunbound var)) - (t (set var value))))) + (t (set var value)))) + (setq slime-typeout-frame-unbind-stack nil)) (provide 'slime-typeout-frame) From heller at common-lisp.net Sun Jan 27 15:34:30 2008 From: heller at common-lisp.net (heller) Date: Sun, 27 Jan 2008 10:34:30 -0500 (EST) Subject: [slime-cvs] CVS slime Message-ID: <20080127153430.BBFED4F019@common-lisp.net> Update of /project/slime/cvsroot/slime In directory clnet:/tmp/cvs-serv21255 Modified Files: ChangeLog slime.el Log Message: Make it easier to start a non-default Lisp from ELisp code. * slime.el (slime): If the argument is a symbol start the corresponding entry in slime-lisp-implementations. Typical use is something like: (defun cmucl () (interactive) (slime 'cmucl)) --- /project/slime/cvsroot/slime/ChangeLog 2008/01/27 10:15:48 1.1273 +++ /project/slime/cvsroot/slime/ChangeLog 2008/01/27 15:34:27 1.1274 @@ -1,3 +1,12 @@ +2008-01-27 Helmut Eller + + Make it easier to start a non-default Lisp from ELisp code. + + * slime.el (slime): If the argument is a symbol start the + corresponding entry in slime-lisp-implementations. + Typical use is something like: + (defun cmucl () (interactive) (slime 'cmucl)) + 2008-01-22 Lu?s Oliveira * swank-source-path-parser.lisp (make-source-recording-readtable): --- /project/slime/cvsroot/slime/slime.el 2008/01/27 10:15:52 1.895 +++ /project/slime/cvsroot/slime/slime.el 2008/01/27 15:34:27 1.896 @@ -1179,7 +1179,9 @@ (interactive) (let ((inferior-lisp-program (or command inferior-lisp-program)) (slime-net-coding-system (or coding-system slime-net-coding-system))) - (slime-start* (slime-read-interactive-args)))) + (slime-start* (cond ((and command (symbolp command)) + (slime-lisp-options command)) + (t (slime-read-interactive-args)))))) (defvar slime-inferior-lisp-program-history '() "History list of command strings. Used by `slime'.")