From aruttenberg at common-lisp.net Thu Feb 2 02:45:11 2006 From: aruttenberg at common-lisp.net (aruttenberg) Date: Wed, 1 Feb 2006 20:45:11 -0600 (CST) Subject: [ubf-cvs] CVS %p Message-ID: <20060202024511.D7A992A5B5@common-lisp.net> Update of /project/slime/cvsroot/slime In directory common-lisp:/tmp/cvs-serv6807/slime Modified Files: swank-abcl.lisp ChangeLog Log Message: swank-abcl.lisp: define with-compilation-hooks (= funcall for now), so that you can do slime-oos From mbaringer at common-lisp.net Thu Feb 2 10:29:14 2006 From: mbaringer at common-lisp.net (mbaringer) Date: Thu, 2 Feb 2006 04:29:14 -0600 (CST) Subject: [ubf-cvs] CVS %p Message-ID: <20060202102914.7C8C71C792@common-lisp.net> Update of /project/slime/cvsroot//slime In directory common-lisp:/tmp/cvs-serv11761 Modified Files: swank-openmcl.lisp ChangeLog Log Message: From mkoeppe at common-lisp.net Sun Feb 5 02:21:09 2006 From: mkoeppe at common-lisp.net (mkoeppe) Date: Sat, 4 Feb 2006 20:21:09 -0600 (CST) Subject: [slime-cvs] CVS %p Message-ID: <20060205022109.2357D5D00B@common-lisp.net> Update of /project/slime/cvsroot/slime In directory common-lisp:/tmp/cvs-serv11079 Modified Files: slime.el Log Message: (slime-fontify-string): New. (slime-echo-arglist, slime-arglist, slime-autodoc): Use it here to fontify echo-area arglists. From mkoeppe at common-lisp.net Sun Feb 5 02:22:22 2006 From: mkoeppe at common-lisp.net (mkoeppe) Date: Sat, 4 Feb 2006 20:22:22 -0600 (CST) Subject: [slime-cvs] CVS %p Message-ID: <20060205022222.97F8260002@common-lisp.net> Update of /project/slime/cvsroot/slime In directory common-lisp:/tmp/cvs-serv11112 Modified Files: ChangeLog Log Message: *** empty log message *** From mkoeppe at common-lisp.net Mon Feb 6 03:36:13 2006 From: mkoeppe at common-lisp.net (mkoeppe) Date: Sun, 5 Feb 2006 21:36:13 -0600 (CST) Subject: [slime-cvs] CVS %p Message-ID: <20060206033613.A9E3A7300D@common-lisp.net> Update of /project/slime/cvsroot/slime In directory common-lisp:/tmp/cvs-serv31322 Modified Files: slime.el Log Message: (slime-complete-form): Indent the inserted template. From mkoeppe at common-lisp.net Mon Feb 6 03:36:22 2006 From: mkoeppe at common-lisp.net (mkoeppe) Date: Sun, 5 Feb 2006 21:36:22 -0600 (CST) Subject: [slime-cvs] CVS %p Message-ID: <20060206033622.C0BA075003@common-lisp.net> Update of /project/slime/cvsroot/slime In directory common-lisp:/tmp/cvs-serv31336 Modified Files: ChangeLog Log Message: *** empty log message *** From mkoeppe at common-lisp.net Mon Feb 6 18:33:25 2006 From: mkoeppe at common-lisp.net (mkoeppe) Date: Mon, 6 Feb 2006 12:33:25 -0600 (CST) Subject: [slime-cvs] CVS %p Message-ID: <20060206183325.ED4682A038@common-lisp.net> Update of /project/slime/cvsroot/slime In directory common-lisp:/tmp/cvs-serv15929 Modified Files: slime.el Log Message: (slime-enclosing-operator-names): Represent MAKE-INSTANCE calls by (:make-instance "CLASS-NAME"), handle DEFMETHOD too. From mkoeppe at common-lisp.net Mon Feb 6 18:42:10 2006 From: mkoeppe at common-lisp.net (mkoeppe) Date: Mon, 6 Feb 2006 12:42:10 -0600 (CST) Subject: [slime-cvs] CVS %p Message-ID: <20060206184210.0FE647300C@common-lisp.net> Update of /project/slime/cvsroot/slime In directory common-lisp:/tmp/cvs-serv16197 Modified Files: swank.lisp Log Message: (arglist-to-template-string): Unused, removed. (extra-keywords): Indicate which part of the actual arglist was used to determine the extra keywords. For MAKE-INSTANCE, don't signal an error if the class does not exist. (enrich-decoded-arglist-with-extra-keywords): Indicate which part of the actual arglist was used to determine the extra keywords, and whether any extra keywords were added. (form-completion): Generalize to handle display of enriched formal arglists. (read-incomplete-form-from-string): New, factored out from complete-form. Handle end-of-file. (complete-form): Use it here. (format-arglist-for-echo-area): Use form-completion, so as to show enriched formal arglists for MAKE-INSTANCE and DEFMETHOD calls. (arglist-for-echo-area): Handle MAKE-INSTANCE and DEFMETHOD calls. From mkoeppe at common-lisp.net Mon Feb 6 18:42:19 2006 From: mkoeppe at common-lisp.net (mkoeppe) Date: Mon, 6 Feb 2006 12:42:19 -0600 (CST) Subject: [slime-cvs] CVS %p Message-ID: <20060206184219.0DC3B76001@common-lisp.net> Update of /project/slime/cvsroot/slime In directory common-lisp:/tmp/cvs-serv16222 Modified Files: ChangeLog Log Message: *** empty log message *** From heller at common-lisp.net Fri Feb 10 16:50:59 2006 From: heller at common-lisp.net (heller) Date: Fri, 10 Feb 2006 10:50:59 -0600 (CST) Subject: [slime-cvs] CVS %p Message-ID: <20060210165059.8EE3947020@common-lisp.net> Update of /project/slime/cvsroot/slime In directory common-lisp:/tmp/cvs-serv15706 Modified Files: swank-loader.lisp Log Message: (Re)Introduce something like a SLIME version and put fasl files for different versions in different directories. A common problem is that newbies download the latest release and discover that it doesn't compile with the brand new CLISP or SBCL; then they download the CVS version but the loader doesn't recompile the needed files because time stamp of the borken fasl files are newer than source files in CVS. (default-fasl-directory): Include the SLIME version. (slime-version-string): New. From heller at common-lisp.net Fri Feb 10 16:54:01 2006 From: heller at common-lisp.net (heller) Date: Fri, 10 Feb 2006 10:54:01 -0600 (CST) Subject: [slime-cvs] CVS %p Message-ID: <20060210165401.CB79B4A00C@common-lisp.net> Update of /project/slime/cvsroot/slime In directory common-lisp:/tmp/cvs-serv15867 Modified Files: swank-allegro.lisp swank-lispworks.lisp Log Message: (inspect-for-emacs): Use the backend specific method to inspect standard-objects because {slot-boundp,slot-value}-using-class don't conform to the MOP spec in LW and ACL. From heller at common-lisp.net Fri Feb 10 16:54:58 2006 From: heller at common-lisp.net (heller) Date: Fri, 10 Feb 2006 10:54:58 -0600 (CST) Subject: [slime-cvs] CVS %p Message-ID: <20060210165458.C6EE25700B@common-lisp.net> Update of /project/slime/cvsroot/slime In directory common-lisp:/tmp/cvs-serv15948 Modified Files: swank.lisp Log Message: (macro-indentation): Don't count '&optional as argument. From heller at common-lisp.net Fri Feb 10 16:56:00 2006 From: heller at common-lisp.net (heller) Date: Fri, 10 Feb 2006 10:56:00 -0600 (CST) Subject: [slime-cvs] CVS %p Message-ID: <20060210165600.B8C295800C@common-lisp.net> Update of /project/slime/cvsroot/slime In directory common-lisp:/tmp/cvs-serv16042 Modified Files: ChangeLog Log Message: *** empty log message *** From heller at common-lisp.net Fri Feb 10 17:22:15 2006 From: heller at common-lisp.net (heller) Date: Fri, 10 Feb 2006 11:22:15 -0600 (CST) Subject: [slime-cvs] CVS %p Message-ID: <20060210172215.4092372006@common-lisp.net> Update of /project/slime/cvsroot/CVSROOT In directory common-lisp:/tmp/cvs-serv20420 Modified Files: loginfo Log Message: Use cvs-mailcommit. From heller at common-lisp.net Fri Feb 10 17:24:07 2006 From: heller at common-lisp.net (heller) Date: Fri, 10 Feb 2006 11:24:07 -0600 (CST) Subject: [slime-cvs] CVS %p Message-ID: <20060210172407.B0D9975003@common-lisp.net> Update of /project/slime/cvsroot/CVSROOT In directory common-lisp:/tmp/cvs-serv20496 Modified Files: config Log Message: Lets see what UseNewInfoFmtStrings=yes does. From heller at common-lisp.net Fri Feb 10 17:24:59 2006 From: heller at common-lisp.net (heller) Date: Fri, 10 Feb 2006 11:24:59 -0600 (CST) Subject: [slime-cvs] CVS slime Message-ID: <20060210172459.9FEF178005@common-lisp.net> Update of /project/slime/cvsroot/slime In directory common-lisp:/tmp/cvs-serv20522 Modified Files: slime.el Log Message: Test to see what UseNewInfoFmtStrings=yes does. --- /project/slime/cvsroot/slime/slime.el 2006/02/06 18:33:25 1.581 +++ /project/slime/cvsroot/slime/slime.el 2006/02/10 17:24:59 1.582 @@ -1532,7 +1532,7 @@ (t (when retries (decf retries)) (setq slime-connect-retry-timer - (run-with-timer 1.0 nil #'attempt-connection)))))) + (run-with-timer 0.2 nil #'attempt-connection)))))) (attempt-connection)))) (defun slime-read-swank-port () @@ -2591,7 +2591,8 @@ (setq slime-repl-directory-stack (list (expand-file-name default-directory))) (setq slime-repl-package-stack (list (slime-lisp-package))) - (slime-repl-update-banner))) + (slime-repl-update-banner) + )) (defvar slime-show-last-output-function 'slime-maybe-display-output-buffer From mkoeppe at common-lisp.net Fri Feb 17 01:30:21 2006 From: mkoeppe at common-lisp.net (mkoeppe) Date: Thu, 16 Feb 2006 19:30:21 -0600 (CST) Subject: [slime-cvs] CVS slime Message-ID: <20060217013021.991095D00D@common-lisp.net> Update of /project/slime/cvsroot/slime In directory common-lisp:/tmp/cvs-serv32175 Added Files: sbcl-pprint-patch.lisp Log Message: New file, adds the annotations feature to the SBCL pretty printer. This is needed for sending presentations through pretty-printing streams. --- /project/slime/cvsroot/slime/sbcl-pprint-patch.lisp 2006/02/17 01:30:21 NONE +++ /project/slime/cvsroot/slime/sbcl-pprint-patch.lisp 2006/02/17 01:30:21 1.1 ;; Pretty printer patch for SBCL, which adds the "annotations" feature ;; required for sending presentations through pretty-printing streams. ;; ;; The section marked "Changed functions" and the DEFSTRUCT ;; PRETTY-STREAM are based on SBCL's pprint.lisp. ;; ;; Public domain. (in-package "SB!PRETTY") (defstruct (annotation (:include queued-op)) (handler (constantly nil) :type function) (record)) (defstruct (pretty-stream (:include sb!kernel:ansi-stream (out #'pretty-out) (sout #'pretty-sout) (misc #'pretty-misc)) (:constructor make-pretty-stream (target)) (:copier nil)) ;; Where the output is going to finally go. (target (missing-arg) :type stream) ;; Line length we should format to. Cached here so we don't have to keep ;; extracting it from the target stream. (line-length (or *print-right-margin* (sb!impl::line-length target) default-line-length) :type column) ;; A simple string holding all the text that has been output but not yet ;; printed. (buffer (make-string initial-buffer-size) :type (simple-array character (*))) ;; The index into BUFFER where more text should be put. (buffer-fill-pointer 0 :type index) ;; Whenever we output stuff from the buffer, we shift the remaining noise ;; over. This makes it difficult to keep references to locations in ;; the buffer. Therefore, we have to keep track of the total amount of ;; stuff that has been shifted out of the buffer. (buffer-offset 0 :type posn) ;; The column the first character in the buffer will appear in. Normally ;; zero, but if we end up with a very long line with no breaks in it we ;; might have to output part of it. Then this will no longer be zero. (buffer-start-column (or (sb!impl::charpos target) 0) :type column) ;; The line number we are currently on. Used for *PRINT-LINES* ;; abbreviations and to tell when sections have been split across ;; multiple lines. (line-number 0 :type index) ;; the value of *PRINT-LINES* captured at object creation time. We ;; use this, instead of the dynamic *PRINT-LINES*, to avoid ;; weirdness like ;; (let ((*print-lines* 50)) ;; (pprint-logical-block .. ;; (dotimes (i 10) ;; (let ((*print-lines* 8)) ;; (print (aref possiblybigthings i) prettystream))))) ;; terminating the output of the entire logical blockafter 8 lines. (print-lines *print-lines* :type (or index null) :read-only t) ;; Stack of logical blocks in effect at the buffer start. (blocks (list (make-logical-block)) :type list) ;; Buffer holding the per-line prefix active at the buffer start. ;; Indentation is included in this. The length of this is stored ;; in the logical block stack. (prefix (make-string initial-buffer-size) :type (simple-array character (*))) ;; Buffer holding the total remaining suffix active at the buffer start. ;; The characters are right-justified in the buffer to make it easier ;; to output the buffer. The length is stored in the logical block ;; stack. (suffix (make-string initial-buffer-size) :type (simple-array character (*))) ;; Queue of pending operations. When empty, HEAD=TAIL=NIL. Otherwise, ;; TAIL holds the first (oldest) cons and HEAD holds the last (newest) ;; cons. Adding things to the queue is basically (setf (cdr head) (list ;; new)) and removing them is basically (pop tail) [except that care must ;; be taken to handle the empty queue case correctly.] (queue-tail nil :type list) (queue-head nil :type list) ;; Block-start queue entries in effect at the queue head. (pending-blocks nil :type list) ;; Queue of annotations to the buffer (annotations-tail nil :type list) (annotations-head nil :type list)) (defmacro enqueue (stream type &rest args) (let ((constructor (intern (concatenate 'string "MAKE-" (symbol-name type)) "SB-PRETTY"))) (once-only ((stream stream) (entry `(,constructor :posn (index-posn (pretty-stream-buffer-fill-pointer ,stream) ,stream) , at args)) (op `(list ,entry)) (head `(pretty-stream-queue-head ,stream))) `(progn (if ,head (setf (cdr ,head) ,op) (setf (pretty-stream-queue-tail ,stream) ,op)) (setf (pretty-stream-queue-head ,stream) ,op) ,entry)))) ;;; ;;; New helper functions ;;; (defun enqueue-annotation (stream handler record) (enqueue stream annotation :handler handler :record record)) (defun re-enqueue-annotation (stream annotation) (let* ((annotation-cons (list annotation)) (head (pretty-stream-annotations-head stream))) (if head (setf (cdr head) annotation-cons) (setf (pretty-stream-annotations-tail stream) annotation-cons)) (setf (pretty-stream-annotations-head stream) annotation-cons) nil)) (defun re-enqueue-annotations (stream end) (loop for tail = (pretty-stream-queue-tail stream) then (cdr tail) while (and tail (not (eql (car tail) end))) when (annotation-p (car tail)) do (re-enqueue-annotation stream (car tail)))) (defun dequeue-annotation (stream &key end-posn) (let ((next-annotation (car (pretty-stream-annotations-tail stream)))) (when next-annotation (when (or (not end-posn) (<= (annotation-posn next-annotation) end-posn)) (pop (pretty-stream-annotations-tail stream)) (unless (pretty-stream-annotations-tail stream) (setf (pretty-stream-annotations-head stream) nil)) next-annotation)))) (defun invoke-annotation (stream annotation truncatep) (let ((target (pretty-stream-target stream))) (funcall (annotation-handler annotation) (annotation-record annotation) target truncatep))) (defun output-buffer-with-annotations (stream end) (let ((target (pretty-stream-target stream)) (buffer (pretty-stream-buffer stream)) (end-posn (index-posn end stream)) (start 0)) (loop for annotation = (dequeue-annotation stream :end-posn end-posn) while annotation do (let ((annotation-index (posn-index (annotation-posn annotation) stream))) (when (> annotation-index start) (write-string buffer target :start start :end annotation-index) (setf start annotation-index)) (invoke-annotation stream annotation nil))) (when (> end start) (write-string buffer target :start start :end end)))) (defun flush-annotations (stream end truncatep) (let ((end-posn (index-posn end stream))) (loop for annotation = (dequeue-annotation stream :end-posn end-posn) while annotation do (invoke-annotation stream annotation truncatep)))) ;;; ;;; Changed functions ;;; (defun maybe-output (stream force-newlines-p) (declare (type pretty-stream stream)) (let ((tail (pretty-stream-queue-tail stream)) (output-anything nil)) (loop (unless tail (setf (pretty-stream-queue-head stream) nil) (return)) (let ((next (pop tail))) (etypecase next (newline (when (ecase (newline-kind next) ((:literal :mandatory :linear) t) (:miser (misering-p stream)) (:fill (or (misering-p stream) (> (pretty-stream-line-number stream) (logical-block-section-start-line (first (pretty-stream-blocks stream)))) (ecase (fits-on-line-p stream (newline-section-end next) force-newlines-p) ((t) nil) ((nil) t) (:dont-know (return)))))) (setf output-anything t) (output-line stream next))) (indentation (unless (misering-p stream) (set-indentation stream (+ (ecase (indentation-kind next) (:block (logical-block-start-column (car (pretty-stream-blocks stream)))) (:current (posn-column (indentation-posn next) stream))) (indentation-amount next))))) (block-start (ecase (fits-on-line-p stream (block-start-section-end next) force-newlines-p) ((t) ;; Just nuke the whole logical block and make it look like one ;; nice long literal. (But don't nuke annotations.) (let ((end (block-start-block-end next))) (expand-tabs stream end) (re-enqueue-annotations stream end) (setf tail (cdr (member end tail))))) ((nil) (really-start-logical-block stream (posn-column (block-start-posn next) stream) (block-start-prefix next) (block-start-suffix next))) (:dont-know (return)))) (block-end (really-end-logical-block stream)) (tab (expand-tabs stream next)) (annotation (re-enqueue-annotation stream next)))) (setf (pretty-stream-queue-tail stream) tail)) output-anything)) (defun output-line (stream until) (declare (type pretty-stream stream) (type newline until)) (let* ((target (pretty-stream-target stream)) (buffer (pretty-stream-buffer stream)) (kind (newline-kind until)) (literal-p (eq kind :literal)) (amount-to-consume (posn-index (newline-posn until) stream)) (amount-to-print (if literal-p amount-to-consume (let ((last-non-blank (position #\space buffer :end amount-to-consume :from-end t :test #'char/=))) (if last-non-blank (1+ last-non-blank) 0))))) (output-buffer-with-annotations stream amount-to-print) (flush-annotations stream amount-to-consume nil) (let ((line-number (pretty-stream-line-number stream))) (incf line-number) (when (and (not *print-readably*) (pretty-stream-print-lines stream) (>= line-number (pretty-stream-print-lines stream))) (write-string " .." target) (flush-annotations stream (pretty-stream-buffer-fill-pointer stream) t) (let ((suffix-length (logical-block-suffix-length (car (pretty-stream-blocks stream))))) (unless (zerop suffix-length) (let* ((suffix (pretty-stream-suffix stream)) (len (length suffix))) (write-string suffix target :start (- len suffix-length) :end len)))) (throw 'line-limit-abbreviation-happened t)) (setf (pretty-stream-line-number stream) line-number) (write-char #\newline target) (setf (pretty-stream-buffer-start-column stream) 0) (let* ((fill-ptr (pretty-stream-buffer-fill-pointer stream)) (block (first (pretty-stream-blocks stream))) (prefix-len (if literal-p (logical-block-per-line-prefix-end block) (logical-block-prefix-length block))) (shift (- amount-to-consume prefix-len)) (new-fill-ptr (- fill-ptr shift)) (new-buffer buffer) (buffer-length (length buffer))) (when (> new-fill-ptr buffer-length) (setf new-buffer (make-string (max (* buffer-length 2) (+ buffer-length (floor (* (- new-fill-ptr buffer-length) 5) 4))))) (setf (pretty-stream-buffer stream) new-buffer)) (replace new-buffer buffer :start1 prefix-len :start2 amount-to-consume :end2 fill-ptr) (replace new-buffer (pretty-stream-prefix stream) :end1 prefix-len) (setf (pretty-stream-buffer-fill-pointer stream) new-fill-ptr) (incf (pretty-stream-buffer-offset stream) shift) (unless literal-p (setf (logical-block-section-column block) prefix-len) (setf (logical-block-section-start-line block) line-number)))))) (defun output-partial-line (stream) (let* ((fill-ptr (pretty-stream-buffer-fill-pointer stream)) (tail (pretty-stream-queue-tail stream)) (count (if tail (posn-index (queued-op-posn (car tail)) stream) fill-ptr)) (new-fill-ptr (- fill-ptr count)) (buffer (pretty-stream-buffer stream))) (when (zerop count) (error "Output-partial-line called when nothing can be output.")) (output-buffer-with-annotations stream count) (incf (pretty-stream-buffer-start-column stream) count) (replace buffer buffer :end1 new-fill-ptr :start2 count :end2 fill-ptr) (setf (pretty-stream-buffer-fill-pointer stream) new-fill-ptr) (incf (pretty-stream-buffer-offset stream) count))) (defun force-pretty-output (stream) (maybe-output stream nil) (expand-tabs stream nil) (re-enqueue-annotations stream nil) (output-buffer-with-annotations stream (pretty-stream-buffer-fill-pointer stream))) From mkoeppe at common-lisp.net Fri Feb 17 01:33:20 2006 From: mkoeppe at common-lisp.net (mkoeppe) Date: Thu, 16 Feb 2006 19:33:20 -0600 (CST) Subject: [slime-cvs] CVS slime Message-ID: <20060217013320.7A98065005@common-lisp.net> Update of /project/slime/cvsroot/slime In directory common-lisp:/tmp/cvs-serv32300 Modified Files: present.lisp Log Message: [sbcl]: Load it here. (slime-stream-p, write-annotation) [sbcl]: Handle pretty-streams. --- /project/slime/cvsroot/slime/present.lisp 2005/09/21 20:33:46 1.17 +++ /project/slime/cvsroot/slime/present.lisp 2006/02/17 01:33:20 1.18 @@ -38,9 +38,24 @@ (presenting-object-1 ,object ,stream ,continue) (funcall ,continue))))) +;;; Get pretty printer patches for SBCL +#+sbcl +(eval-when (:compile-toplevel :load-toplevel :execute) + (handler-bind ((simple-error + (lambda (c) + (declare (ignore c)) + (let ((clobber-it (find-restart 'sb-kernel::clobber-it))) + (when clobber-it (invoke-restart clobber-it)))))) + (sb-ext:without-package-locks + (swank-backend::with-debootstrapping + (load (make-pathname + :name "sbcl-pprint-patch" + :type "lisp" + :directory (pathname-directory swank-loader:*source-directory*))))))) + (let ((last-stream nil) (last-answer nil)) - (defmethod slime-stream-p (stream) + (defun slime-stream-p (stream) "Check if stream is one of the slime streams, since if it isn't we don't want to present anything" (if (eq last-stream stream) @@ -68,8 +83,12 @@ ;; layout. (slime-stream-p (pretty-print::pretty-stream-target stream)))) #+sbcl - (and (typep stream 'sb-impl::indenting-stream) - (slime-stream-p (sb-impl::indenting-stream-stream stream))) + (or (and (typep stream 'sb-impl::indenting-stream) + (slime-stream-p (sb-impl::indenting-stream-stream stream))) + (and (typep stream 'sb-pretty::pretty-stream) + (fboundp 'sb-pretty::enqueue-annotation) + (not *use-dedicated-output-stream*) + (slime-stream-p (sb-pretty::pretty-stream-target stream)))) #+allegro (and (typep stream 'excl:xp-simple-stream) (slime-stream-p (excl::stream-output-handle stream))) @@ -97,7 +116,12 @@ (fboundp 'pp::enqueue-annotation)) (pp::enqueue-annotation stream function arg) (funcall function arg stream nil))) -#-(or allegro cmu) +#+sbcl +(defun write-annotation (stream function arg) + (if (typep stream 'sb-pretty::pretty-stream) + (sb-pretty::enqueue-annotation stream function arg) + (funcall function arg stream nil))) +#-(or allegro cmu sbcl) (defun write-annotation (stream function arg) (funcall function arg stream nil)) From mkoeppe at common-lisp.net Fri Feb 17 01:33:57 2006 From: mkoeppe at common-lisp.net (mkoeppe) Date: Thu, 16 Feb 2006 19:33:57 -0600 (CST) Subject: [slime-cvs] CVS slime Message-ID: <20060217013357.905AD67004@common-lisp.net> Update of /project/slime/cvsroot/slime In directory common-lisp:/tmp/cvs-serv32340 Modified Files: ChangeLog Log Message: --- /project/slime/cvsroot/slime/ChangeLog 2006/02/10 16:56:00 1.838 +++ /project/slime/cvsroot/slime/ChangeLog 2006/02/17 01:33:57 1.839 @@ -1,3 +1,11 @@ +2006-02-16 Matthias Koeppe + + * sbcl-pprint-patch.lisp: New file, adds the annotations feature + to the SBCL pretty printer. This is needed for sending + presentations through pretty-printing streams. + * present.lisp [sbcl]: Load it here. + (slime-stream-p, write-annotation) [sbcl]: Handle pretty-streams. + 2006-02-10 Helmut Eller * swank-allegro.lisp, swank-lispworks.lisp (inspect-for-emacs): From mbaringer at common-lisp.net Sat Feb 18 13:42:38 2006 From: mbaringer at common-lisp.net (mbaringer) Date: Sat, 18 Feb 2006 07:42:38 -0600 (CST) Subject: [slime-cvs] CVS /slime Message-ID: <20060218134238.C42CA72010@common-lisp.net> Update of /project/slime/cvsroot//slime In directory common-lisp:/tmp/cvs-serv29758 Modified Files: slime.el ChangeLog Log Message: --- /project/slime/cvsroot//slime/slime.el 2006/02/10 17:24:59 1.582 +++ /project/slime/cvsroot//slime/slime.el 2006/02/18 13:42:38 1.583 @@ -7068,18 +7068,30 @@ ;;;; Macroexpansion -(defun slime-eval-macroexpand (expander) - (let ((string (slime-sexp-at-point))) - (when (not string) - (error "No expression at point.")) - (lexical-let ((package (slime-current-package))) - (slime-eval-async - `(,expander ,string) - (lambda (expansion) - (slime-with-output-to-temp-buffer - ("*SLIME macroexpansion*" lisp-mode) package - (insert expansion) - (font-lock-fontify-buffer))))))) +(define-minor-mode slime-macroexpansion-minor-mode + "SLIME mode for macroexpansion" + nil + " temp" + '(("q" . slime-temp-buffer-quit) + ("g" . slime-macroexpand-again))) + +(defvar *slime-eval-macroexpand-expression* nil + "Specifies the last macroexpansion preformed. This variable + specifies both what was expanded and how.") + +(defun slime-eval-macroexpand (expander &optional string) + (unless string + (setf string (slime-sexp-at-point-or-error))) + (setf *slime-eval-macroexpand-expression* `(,expander ,string)) + (lexical-let ((package (slime-current-package))) + (slime-eval-async + *slime-eval-macroexpand-expression* + (lambda (expansion) + (slime-with-output-to-temp-buffer + ("*SLIME macroexpansion*" lisp-mode) package + (slime-macroexpansion-minor-mode) + (insert expansion) + (font-lock-fontify-buffer)))))) (defun slime-macroexpand-1 (&optional repeatedly) "Display the macro expansion of the form at point. The form is @@ -7104,6 +7116,12 @@ (interactive) (slime-eval-macroexpand 'swank:swank-compiler-macroexpand-1)) +(defun slime-macroexpand-again () + "Reperform the last macroexpansion." + (interactive) + (slime-eval-macroexpand (first *slime-eval-macroexpand-expression*) + (second *slime-eval-macroexpand-expression*))) + ;;;; Subprocess control @@ -9689,6 +9707,11 @@ (let ((string (thing-at-point 'sexp))) (if string (substring-no-properties string) nil))) +(defun slime-sexp-at-point-or-error () + "Return the sexp at point as a string, othwise signal an error." + (or (slime-sexp-at-point) + (error "No expression at point."))) + (defun slime-function-called-at-point/line () "Return the name of the function being called at point, provided the function call starts on the same line at the point itself." --- /project/slime/cvsroot//slime/ChangeLog 2006/02/17 01:33:57 1.839 +++ /project/slime/cvsroot//slime/ChangeLog 2006/02/18 13:42:38 1.840 @@ -1,3 +1,19 @@ +2006-02-18 mb + + * slime.el (slime-macroexpansion-minor-mode): New minor mode for + macroexpansion buffer. Exactly like slime-temp-buffer-mode but + with slime-macroexpand-again bound to "g". + (*slime-eval-macroexpand-expression*): New variable. introduced + for slime-macroexpand-again, used by slime-eval-macroexpand as + well. + (slime-eval-macroexpand): Added optional string argument which + defaults to (slime-sexp-at-point-or-error). + (slime-macroexpand-again): New function, redoes the last + macroexpansion. + (slime-sexp-at-point-or-error): New function. Like + slime-sexp-at-point but signals an error when slime-sexp-at-point + would return nil. + 2006-02-16 Matthias Koeppe * sbcl-pprint-patch.lisp: New file, adds the annotations feature From mbaringer at common-lisp.net Sat Feb 18 13:43:06 2006 From: mbaringer at common-lisp.net (mbaringer) Date: Sat, 18 Feb 2006 07:43:06 -0600 (CST) Subject: [slime-cvs] CVS /slime Message-ID: <20060218134306.0F3EC72011@common-lisp.net> Update of /project/slime/cvsroot//slime In directory common-lisp:/tmp/cvs-serv29797 Modified Files: ChangeLog Log Message: --- /project/slime/cvsroot//slime/ChangeLog 2006/02/18 13:42:38 1.840 +++ /project/slime/cvsroot//slime/ChangeLog 2006/02/18 13:43:05 1.841 @@ -1,4 +1,4 @@ -2006-02-18 mb +2006-02-18 Marco Baringer * slime.el (slime-macroexpansion-minor-mode): New minor mode for macroexpansion buffer. Exactly like slime-temp-buffer-mode but From mbaringer at common-lisp.net Sat Feb 18 13:44:10 2006 From: mbaringer at common-lisp.net (mbaringer) Date: Sat, 18 Feb 2006 07:44:10 -0600 (CST) Subject: [slime-cvs] CVS /slime Message-ID: <20060218134410.8E67975004@common-lisp.net> Update of /project/slime/cvsroot//slime In directory common-lisp:/tmp/cvs-serv29825 Modified Files: swank-openmcl.lisp ChangeLog Log Message: --- /project/slime/cvsroot//slime/swank-openmcl.lisp 2006/02/02 10:29:14 1.104 +++ /project/slime/cvsroot//slime/swank-openmcl.lisp 2006/02/18 13:44:10 1.105 @@ -110,10 +110,46 @@ (defun specializer-name (spec) (etypecase spec (cons spec) - (class (swank-mop:class-name spec)) - (swank-mop:eql-specializer `(eql ,(swank-mop:eql-specializer-object spec)))) - ) + (class (class-name spec)) + (ccl::eql-specializer `(eql ,(ccl::eql-specializer-object spec))))) +(defun swank-mop:compute-applicable-methods-using-classes (gf args) + (let* ((methods (ccl::%gf-methods gf)) + (args-length (length args)) + (bits (ccl::inner-lfun-bits gf)) + arg-count res) + (when methods + (setq arg-count (length (ccl::%method-specializers (car methods)))) + (unless (<= arg-count args-length) + (error "Too few args to ~s" gf)) + (unless (or (logbitp ccl::$lfbits-rest-bit bits) + (logbitp ccl::$lfbits-restv-bit bits) + (logbitp ccl::$lfbits-keys-bit bits) + (<= args-length + (+ (ldb ccl::$lfbits-numreq bits) (ldb ccl::$lfbits-numopt bits)))) + (error "Too many args to ~s" gf)) + (let ((cpls (make-list arg-count))) + (declare (dynamic-extent cpls)) + (do* ((args-tail args (cdr args-tail)) + (cpls-tail cpls (cdr cpls-tail))) + ((null cpls-tail)) + (setf (car cpls-tail) + (ccl::%class-precedence-list (car args-tail)))) + (flet ((%method-applicable-p (method args cpls) + (do* ((specs (ccl::%method-specializers method) (ccl::%cdr specs)) + (args args (ccl::%cdr args)) + (cpls cpls (ccl::%cdr cpls))) + ((null specs) t) + (let ((spec (ccl::%car specs))) + (if (typep spec 'ccl::eql-specializer) + (unless (subtypep (ccl::%car args) (class-of (ccl::eql-specializer-object spec))) + (return nil)) + (unless (ccl:memq spec (ccl::%car cpls)) + (return nil))))))) + (dolist (m methods) + (if (%method-applicable-p m args cpls) + (push m res)))) + (ccl::sort-methods res cpls (ccl::%gf-precedence-list gf)))))) ;;; TCP Server --- /project/slime/cvsroot//slime/ChangeLog 2006/02/18 13:43:05 1.841 +++ /project/slime/cvsroot//slime/ChangeLog 2006/02/18 13:44:10 1.842 @@ -1,3 +1,5 @@ +2006-02-18 mb + 2006-02-18 Marco Baringer * slime.el (slime-macroexpansion-minor-mode): New minor mode for @@ -13,6 +15,8 @@ (slime-sexp-at-point-or-error): New function. Like slime-sexp-at-point but signals an error when slime-sexp-at-point would return nil. + * swank-openmcl.lisp (swank-mop:compute-applicable-methods-using-classes): + Implement. 2006-02-16 Matthias Koeppe From mkoeppe at common-lisp.net Mon Feb 20 08:03:44 2006 From: mkoeppe at common-lisp.net (mkoeppe) Date: Mon, 20 Feb 2006 02:03:44 -0600 (CST) Subject: [slime-cvs] CVS slime Message-ID: <20060220080344.D96FE2A035@common-lisp.net> Update of /project/slime/cvsroot/slime In directory common-lisp:/tmp/cvs-serv22629 Modified Files: slime.el Log Message: (slime-expand-abbreviations-and-complete): Scroll the completions buffer if the TAB key is pressed another time, like Emacs minibuffer completion does. --- /project/slime/cvsroot/slime/slime.el 2006/02/18 13:42:38 1.583 +++ /project/slime/cvsroot/slime/slime.el 2006/02/20 08:03:44 1.584 @@ -5598,14 +5598,24 @@ (when (member completed-prefix completion-set) (slime-minibuffer-respecting-message "Complete but not unique")) - (let ((unambiguous-completion-length - (loop for c in completion-set - minimizing (or (mismatch completed-prefix c) - (length completed-prefix))))) - (goto-char (+ beg unambiguous-completion-length)) - (slime-display-completion-list completion-set - completed-prefix) - (slime-complete-delay-restoration))))))) + (if (and (eq last-command this-command) + (slime-completion-window-active-p)) + ;; Scroll the completions window only + (let ((window slime-completions-window)) + (with-current-buffer (window-buffer window) + (if (pos-visible-in-window-p (point-max) window) + (set-window-start window (point-min) nil) + (let ((other-window-scroll-buffer + (window-buffer window))) + (scroll-other-window))))) + (let ((unambiguous-completion-length + (loop for c in completion-set + minimizing (or (mismatch completed-prefix c) + (length completed-prefix))))) + (goto-char (+ beg unambiguous-completion-length)) + (slime-display-completion-list completion-set + completed-prefix) + (slime-complete-delay-restoration)))))))) (defun slime-complete-symbol*-fancy-bit () "Do fancy tricks after completing a symbol. From mkoeppe at common-lisp.net Mon Feb 20 08:04:49 2006 From: mkoeppe at common-lisp.net (mkoeppe) Date: Mon, 20 Feb 2006 02:04:49 -0600 (CST) Subject: [slime-cvs] CVS slime Message-ID: <20060220080449.F1CB82A035@common-lisp.net> Update of /project/slime/cvsroot/slime In directory common-lisp:/tmp/cvs-serv22665 Modified Files: ChangeLog Log Message: --- /project/slime/cvsroot/slime/ChangeLog 2006/02/18 13:44:10 1.842 +++ /project/slime/cvsroot/slime/ChangeLog 2006/02/20 08:04:49 1.843 @@ -1,4 +1,8 @@ -2006-02-18 mb +2006-02-19 Matthias Koeppe + + * slime.el (slime-expand-abbreviations-and-complete): Scroll the + completions buffer if the TAB key is pressed another time, like + Emacs minibuffer completion does. 2006-02-18 Marco Baringer From mkoeppe at common-lisp.net Tue Feb 21 06:44:26 2006 From: mkoeppe at common-lisp.net (mkoeppe) Date: Tue, 21 Feb 2006 00:44:26 -0600 (CST) Subject: [slime-cvs] CVS slime Message-ID: <20060221064426.561712A024@common-lisp.net> Update of /project/slime/cvsroot/slime In directory common-lisp:/tmp/cvs-serv21305 Modified Files: slime.el Log Message: (slime-complete-keywords-contextually): New customizable variable. (slime-enclosing-operator-names): New optional argument max-levels. (slime-completions-for-keyword): New. (slime-contextual-completions): New. (slime-expand-abbreviations-and-complete): Use it instead of slime-completions. --- /project/slime/cvsroot/slime/slime.el 2006/02/20 08:03:44 1.584 +++ /project/slime/cvsroot/slime/slime.el 2006/02/21 06:44:26 1.585 @@ -215,6 +215,12 @@ :group 'slime-mode :type 'boolean) +(defcustom slime-complete-keywords-contextually t + "Use information from the arglist of the surrounding function call +to complete keywords." + :group 'slime-mode + :type 'boolean) + (defcustom slime-space-information-p t "Have the SPC key offer arglist information." :type 'boolean @@ -5575,7 +5581,7 @@ (let* ((end (move-marker (make-marker) (slime-symbol-end-pos))) (beg (move-marker (make-marker) (slime-symbol-start-pos))) (prefix (buffer-substring-no-properties beg end)) - (completion-result (slime-completions prefix)) + (completion-result (slime-contextual-completions beg end)) (completion-set (first completion-result)) (completed-prefix (second completion-result))) (if (null completion-set) @@ -5717,12 +5723,37 @@ alist but ignores CDRs." (mapcar (lambda (x) (cons x nil)) list)) +(defun* slime-contextual-completions (beg end) + "Return a list of completions of the token from BEG to END in the +current buffer." + (let ((token (buffer-substring-no-properties beg end))) + (when (and (< beg (point-max)) + (string= (buffer-substring-no-properties beg (1+ beg)) ":")) + ;; Contextual keyword completion + (let ((operator-names (save-excursion + (goto-char beg) + (slime-enclosing-operator-names 1)))) + (when operator-names + (let ((completions + (slime-completions-for-keyword (first operator-names) token))) + (when (first completions) + (return-from slime-contextual-completions completions)) + ;; If no matching keyword was found, do regular symbol + ;; completion. + )))) + ;; Regular symbol completion + (slime-completions (buffer-substring-no-properties beg end)))) + (defun slime-completions (prefix) (slime-eval `(swank:completions ,prefix ',(slime-current-package)))) (defun slime-simple-completions (prefix) (slime-eval `(swank:simple-completions ,prefix ',(slime-current-package)))) +(defun slime-completions-for-keyword (operator-designator prefix) + (slime-eval `(swank:completions-for-keyword ',operator-designator + ,prefix))) + ;;;; Fuzzy completion @@ -9750,17 +9781,21 @@ (forward-char 1) (slime-symbol-name-at-point))))) -(defun slime-enclosing-operator-names () - "Return the list of operator names of the forms containing point." - (let ((result '())) +(defun slime-enclosing-operator-names (&optional max-levels) + "Return the list of operator names of the forms containing point. +When MAX-LEVELS is non-nil, go up at most this many levels of parens." + (let ((result '()) + (level 1)) (ignore-errors (save-restriction (narrow-to-region (save-excursion (beginning-of-defun) (point)) (point)) (save-excursion - (while t + (while (or (not max-levels) + (<= level max-levels)) (backward-up-list 1) (when (looking-at "(") + (incf level) (forward-char 1) (when-let (name (slime-symbol-name-at-point)) ;; Detect MAKE-INSTANCE forms and collect the class-name From mkoeppe at common-lisp.net Tue Feb 21 06:44:52 2006 From: mkoeppe at common-lisp.net (mkoeppe) Date: Tue, 21 Feb 2006 00:44:52 -0600 (CST) Subject: [slime-cvs] CVS slime Message-ID: <20060221064452.804AB66014@common-lisp.net> Update of /project/slime/cvsroot/slime In directory common-lisp:/tmp/cvs-serv21454 Modified Files: swank.lisp Log Message: (operator-designator-to-form): New, factored out from arglist-for-echo-area. (arglist-for-echo-area): Use it here. (completions-for-keyword): New. (find-matching-symbols-in-list): New. --- /project/slime/cvsroot/slime/swank.lisp 2006/02/10 16:54:58 1.361 +++ /project/slime/cvsroot/slime/swank.lisp 2006/02/21 06:44:52 1.362 @@ -1336,22 +1336,27 @@ (or (consp name) (valid-operator-name-p name))) names))) - (etypecase name - (cons - (destructure-case name - ((:make-instance class-name) - (format-arglist-for-echo-area - `(make-instance ',(parse-symbol class-name)))) - ((:defmethod generic-name) - (format-arglist-for-echo-area - `(defmethod ,(parse-symbol generic-name)))))) - (string - (let ((symbol (parse-symbol name))) - (format-arglist-for-echo-area `(,symbol) name))) - (null)))) + (when name + (multiple-value-bind (form operator-name) + (operator-designator-to-form name) + (format-arglist-for-echo-area form operator-name))))) (error (cond) (format nil "ARGLIST: ~A" cond)))) +(defun operator-designator-to-form (name) + (etypecase name + (cons + (destructure-case name + ((:make-instance class-name) + (values `(make-instance ',(parse-symbol class-name)) + 'make-instance)) + ((:defmethod generic-name) + (values `(defmethod ,(parse-symbol generic-name)) + 'defmethod)))) + (string + (values `(,(parse-symbol name)) + name)))) + (defun clean-arglist (arglist) "Remove &whole, &enviroment, and &aux elements from ARGLIST." (cond ((null arglist) '()) @@ -1857,6 +1862,33 @@ *package*))))))) nil) +(defslimefun completions-for-keyword (name keyword-string) + (with-buffer-syntax () + (let* ((form (operator-designator-to-form name)) + (operator-form (first form)) + (argument-forms (rest form)) + (arglist + (form-completion operator-form argument-forms + :remove-args nil))) + (unless (eql arglist :not-available) + (let* ((keywords + (mapcar #'keyword-arg.keyword + (arglist.keyword-args arglist))) + (keyword-name + (tokenize-symbol keyword-string)) + (matching-keywords + (find-matching-symbols-in-list keyword-name keywords + #'compound-prefix-match)) + (converter (output-case-converter keyword-string)) + (strings + (mapcar converter + (mapcar #'symbol-name matching-keywords))) + (completion-set + (format-completion-set strings nil ""))) + (list completion-set + (longest-completion completion-set))))))) + + ;;;; Recording and accessing results of computations @@ -2629,6 +2661,19 @@ (push symbol completions)))) (remove-duplicates completions))) +(defun find-matching-symbols-in-list (string list test) + "Return a list of symbols in LIST matching STRING. +TEST is called with two strings." + (let ((completions '()) + (converter (output-case-converter string))) + (flet ((symbol-matches-p (symbol) + (funcall test string + (funcall converter (symbol-name symbol))))) + (dolist (symbol list) + (when (symbol-matches-p symbol) + (push symbol completions)))) + (remove-duplicates completions))) + (defun symbol-external-p (symbol &optional (package (symbol-package symbol))) "True if SYMBOL is external in PACKAGE. If PACKAGE is not specified, the home package of SYMBOL is used." From mkoeppe at common-lisp.net Tue Feb 21 06:45:07 2006 From: mkoeppe at common-lisp.net (mkoeppe) Date: Tue, 21 Feb 2006 00:45:07 -0600 (CST) Subject: [slime-cvs] CVS slime Message-ID: <20060221064507.E5E676B010@common-lisp.net> Update of /project/slime/cvsroot/slime In directory common-lisp:/tmp/cvs-serv21883 Modified Files: ChangeLog Log Message: --- /project/slime/cvsroot/slime/ChangeLog 2006/02/20 08:04:49 1.843 +++ /project/slime/cvsroot/slime/ChangeLog 2006/02/21 06:45:07 1.844 @@ -1,3 +1,24 @@ +2006-02-20 Matthias Koeppe + + Use argument list information to complete keywords contextually. + Example: (find 1 '(1 2 3) :s --completes--> :start + rather than suggesting all ever-interned keywords starting with ":s". + + * slime.el (slime-complete-keywords-contextually): New + customizable variable. + (slime-enclosing-operator-names): New optional argument + max-levels. + (slime-completions-for-keyword): New. + (slime-contextual-completions): New. + (slime-expand-abbreviations-and-complete): Use it instead of + slime-completions. + + * swank.lisp (operator-designator-to-form): New, factored out from + arglist-for-echo-area. + (arglist-for-echo-area): Use it here. + (completions-for-keyword): New. + (find-matching-symbols-in-list): New. + 2006-02-19 Matthias Koeppe * slime.el (slime-expand-abbreviations-and-complete): Scroll the From mkoeppe at common-lisp.net Wed Feb 22 23:43:11 2006 From: mkoeppe at common-lisp.net (mkoeppe) Date: Wed, 22 Feb 2006 17:43:11 -0600 (CST) Subject: [slime-cvs] CVS slime Message-ID: <20060222234311.A07862A0FC@common-lisp.net> Update of /project/slime/cvsroot/slime In directory common-lisp:/tmp/cvs-serv4537 Modified Files: slime.el Log Message: (slime-repl-send-input): Don't include the final newline in the slime-repl-input-face overlay, thus avoid showing the "Evaluation aborted" message in boldface. Don't set non-existent "rear-nonsticky" overlay property; overlay stickiness is controlled by make-overlay arguments. --- /project/slime/cvsroot/slime/slime.el 2006/02/21 06:44:26 1.585 +++ /project/slime/cvsroot/slime/slime.el 2006/02/22 23:43:11 1.586 @@ -3474,19 +3474,20 @@ (when (< (point) slime-repl-input-start-mark) (error "No input at point.")) (goto-char slime-repl-input-end-mark) - (when newline - (insert "\n") - (slime-repl-show-maximum-output)) - (let ((inhibit-read-only t)) - (add-text-properties slime-repl-input-start-mark (point) - `(slime-repl-old-input - ,(incf slime-repl-old-input-counter)))) - (let ((overlay (make-overlay slime-repl-input-start-mark (point)))) - ;; These properties are on an overlay so that they won't be taken - ;; by kill/yank. - (overlay-put overlay 'read-only t) - (overlay-put overlay 'face 'slime-repl-input-face) - (overlay-put overlay 'rear-nonsticky '(face slime-repl-old-input-counter))) + (let ((end (point))) ; end of input, without the newline + (when newline + (insert "\n") + (slime-repl-show-maximum-output)) + (let ((inhibit-read-only t)) + (add-text-properties slime-repl-input-start-mark + (point) + `(slime-repl-old-input + ,(incf slime-repl-old-input-counter)))) + (let ((overlay (make-overlay slime-repl-input-start-mark end))) + ;; These properties are on an overlay so that they won't be taken + ;; by kill/yank. + (overlay-put overlay 'read-only t) + (overlay-put overlay 'face 'slime-repl-input-face))) (slime-repl-add-to-input-history (buffer-substring slime-repl-input-start-mark slime-repl-input-end-mark)) From mkoeppe at common-lisp.net Wed Feb 22 23:43:18 2006 From: mkoeppe at common-lisp.net (mkoeppe) Date: Wed, 22 Feb 2006 17:43:18 -0600 (CST) Subject: [slime-cvs] CVS slime Message-ID: <20060222234318.9FF7D2A387@common-lisp.net> Update of /project/slime/cvsroot/slime In directory common-lisp:/tmp/cvs-serv4568 Modified Files: ChangeLog Log Message: *** empty log message *** --- /project/slime/cvsroot/slime/ChangeLog 2006/02/21 06:45:07 1.844 +++ /project/slime/cvsroot/slime/ChangeLog 2006/02/22 23:43:18 1.845 @@ -1,3 +1,11 @@ +2006-02-22 Matthias Koeppe + + * slime.el (slime-repl-send-input): Don't include the final + newline in the slime-repl-input-face overlay, thus avoid showing the + "Evaluation aborted" message in boldface. Don't set non-existent + "rear-nonsticky" overlay property; overlay stickiness is + controlled by make-overlay arguments. + 2006-02-20 Matthias Koeppe Use argument list information to complete keywords contextually. From dcrosher at common-lisp.net Sat Feb 25 12:10:34 2006 From: dcrosher at common-lisp.net (dcrosher) Date: Sat, 25 Feb 2006 07:10:34 -0500 (EST) Subject: [slime-cvs] CVS slime Message-ID: <20060225121034.216713800F@common-lisp.net> Update of /project/slime/cvsroot/slime In directory clnet:/tmp/cvs-serv20405 Modified Files: ChangeLog swank-backend.lisp swank.lisp swank-scl.lisp Log Message: * swank-backend.lisp (operate-on-system): symbol case fix for SCL's lowercase mode. * swak.lisp (setup-stream-indirection) (globally-redirect-io-to-connection) (revert-global-io-redirection): symbol case fixes. * swank-scl.lisp: (inspect-for-emacs): Fixes for the inspect standard-objects, and inspect array. Plus misc symbol case fixes. --- /project/slime/cvsroot/slime/ChangeLog 2006/02/22 23:43:18 1.845 +++ /project/slime/cvsroot/slime/ChangeLog 2006/02/25 12:10:33 1.846 @@ -1,3 +1,14 @@ +2006-02-25 Douglas Crosher + * swank-backend.lisp (operate-on-system): symbol case fix for + SCL's lowercase mode. + + * swak.lisp (setup-stream-indirection) + (globally-redirect-io-to-connection) + (revert-global-io-redirection): symbol case fixes. + + * swank-scl.lisp: (inspect-for-emacs): Fixes for the inspect + standard-objects, and inspect array. Plus misc symbol case fixes. + 2006-02-22 Matthias Koeppe * slime.el (slime-repl-send-input): Don't include the final --- /project/slime/cvsroot/slime/swank-backend.lisp 2006/01/30 19:56:55 1.95 +++ /project/slime/cvsroot/slime/swank-backend.lisp 2006/02/25 12:10:33 1.96 @@ -315,7 +315,7 @@ (unless (member :asdf *features*) (error "ASDF is not loaded.")) (with-compilation-hooks () - (let ((operate (find-symbol "OPERATE" :asdf)) + (let ((operate (find-symbol (symbol-name '#:operate) :asdf)) (operation (find-symbol operation-name :asdf))) (when (null operation) (error "Couldn't find ASDF operation ~S" operation-name)) --- /project/slime/cvsroot/slime/swank.lisp 2006/02/21 06:44:52 1.362 +++ /project/slime/cvsroot/slime/swank.lisp 2006/02/25 12:10:33 1.363 @@ -902,8 +902,8 @@ effective global value for *STANDARD-INPUT*. This way we can assign the effective global value even when *STANDARD-INPUT* is shadowed by a dynamic binding." - (let ((real-stream-var (prefixed-var "REAL" stream-var)) - (current-stream-var (prefixed-var "CURRENT" stream-var))) + (let ((real-stream-var (prefixed-var '#:real stream-var)) + (current-stream-var (prefixed-var '#:current stream-var))) `(progn ;; Save the real stream value for the future. (defvar ,real-stream-var ,stream-var) @@ -945,7 +945,7 @@ "Set the standard I/O streams to redirect to CONNECTION. Assigns *CURRENT-* for all standard streams." (dolist (o *standard-output-streams*) - (set (prefixed-var "CURRENT" o) + (set (prefixed-var '#:current o) (connection.user-output connection))) ;; FIXME: If we redirect standard input to Emacs then we get the ;; regular Lisp top-level trying to read from our REPL. @@ -958,10 +958,10 @@ ;; Meanwhile we just leave *standard-input* alone. #+NIL (dolist (i *standard-input-streams*) - (set (prefixed-var "CURRENT" i) + (set (prefixed-var '#:current i) (connection.user-input connection))) (dolist (io *standard-io-streams*) - (set (prefixed-var "CURRENT" io) + (set (prefixed-var '#:current io) (connection.user-io connection)))) (defun revert-global-io-redirection () @@ -969,8 +969,8 @@ (dolist (stream-var (append *standard-output-streams* *standard-input-streams* *standard-io-streams*)) - (set (prefixed-var "CURRENT" stream-var) - (symbol-value (prefixed-var "REAL" stream-var))))) + (set (prefixed-var '#:current stream-var) + (symbol-value (prefixed-var '#:real stream-var))))) ;;;;; Global redirection hooks --- /project/slime/cvsroot/slime/swank-scl.lisp 2005/11/13 22:31:45 1.3 +++ /project/slime/cvsroot/slime/swank-scl.lisp 2006/02/25 12:10:33 1.4 @@ -1422,7 +1422,7 @@ (mapcar #'car (di:frame-catches (nth-frame index)))) (defimplementation return-from-frame (index form) - (let ((sym (find-symbol (string 'find-debug-tag-for-frame) + (let ((sym (find-symbol (symbol-name '#:find-debug-tag-for-frame) :debug-internals))) (if sym (let* ((frame (nth-frame index)) @@ -1567,7 +1567,8 @@ (list (1st sc))))))))) (defun mv-function-end-breakpoint-values (sigcontext) - (let ((sym (find-symbol "FUNCTION-END-BREAKPOINT-VALUES/STANDARD" :di))) + (let ((sym (find-symbol (symbol-name '#:function-end-breakpoint-values/standard) + :debug-internals))) (cond (sym (funcall sym sigcontext)) (t (di::get-function-end-breakpoint-values sigcontext))))) @@ -1746,8 +1747,29 @@ (t (scl-inspect o)))) +(defimplementation inspect-for-emacs ((o standard-object) + (inspector scl-inspector)) + (declare (ignore inspector)) + (let ((c (class-of o))) + (values "An object." + `("Class: " (:value ,c) (:newline) + "Slots:" (:newline) + ,@(loop for slotd in (clos:class-slots c) + for name = (clos:slot-definition-name slotd) + collect `(:value ,slotd ,(string name)) + collect " = " + collect (if (clos:slot-boundp-using-class c o name) + `(:value ,(clos:slot-value-using-class + c o name)) + "#") + collect '(:newline)))))) + (defun scl-inspect (o) - (destructuring-bind (text labeledp . parts) (inspect::describe-parts o) + (destructuring-bind (text labeledp . parts) + (inspect::describe-parts o) + (loop for value in parts + for i from 0 + do (format stream " ~S~%" (label-value-line i value))) (values (format nil "~A~%" text) (if labeledp (loop for (label . value) in parts @@ -1824,17 +1846,23 @@ (defmethod inspect-for-emacs ((o array) (inspector scl-inspector)) inspector - (values (format nil "~A is an array." o) - (label-value-line* - (:header (describe-primitive-type o)) - (:rank (array-rank o)) - (:fill-pointer (kernel:%array-fill-pointer o)) - (:fill-pointer-p (kernel:%array-fill-pointer-p o)) - (:elements (kernel:%array-available-elements o)) - (:data (kernel:%array-data-vector o)) - (:displacement (kernel:%array-displacement o)) - (:displaced-p (kernel:%array-displaced-p o)) - (:dimensions (array-dimensions o))))) + (cond ((kernel:array-header-p o) + (values (format nil "~A is an array." o) + (label-value-line* + (:header (describe-primitive-type o)) + (:rank (array-rank o)) + (:fill-pointer (kernel:%array-fill-pointer o)) + (:fill-pointer-p (kernel:%array-fill-pointer-p o)) + (:elements (kernel:%array-available-elements o)) + (:data (kernel:%array-data-vector o)) + (:displacement (kernel:%array-displacement o)) + (:displaced-p (kernel:%array-displaced-p o)) + (:dimensions (array-dimensions o))))) + (t + (values (format nil "~A is an simple-array." o) + (label-value-line* + (:header (describe-primitive-type o)) + (:length (length o))))))) (defmethod inspect-for-emacs ((o simple-vector) (inspector scl-inspector)) inspector From heller at common-lisp.net Sat Feb 25 14:57:21 2006 From: heller at common-lisp.net (heller) Date: Sat, 25 Feb 2006 09:57:21 -0500 (EST) Subject: [slime-cvs] CVS slime Message-ID: <20060225145721.1E74923009@common-lisp.net> Update of /project/slime/cvsroot/slime In directory clnet:/tmp/cvs-serv12800 Modified Files: swank-loader.lisp Log Message: (default-fasl-directory): Previously we return only the directory-namestring which breaks SCL, because it loses the host and device components. Return the complete pathname instead. Patch by Douglas Crosher. --- /project/slime/cvsroot/slime/swank-loader.lisp 2006/02/10 16:50:59 1.56 +++ /project/slime/cvsroot/slime/swank-loader.lisp 2006/02/25 14:57:21 1.57 @@ -14,7 +14,7 @@ ;; swank-loader package.) ;; E.g.: ;; -;; (make-package :swank-laoder) +;; (make-package :swank-loader) ;; (defparameter swank-loader::*fasl-directory* "/tmp/fasl/") ;; (load ".../swank-loader.lisp") @@ -28,8 +28,8 @@ (cl:in-package :swank-loader) (defvar *source-directory* - (let ((p (or *load-pathname* *default-pathname-defaults*))) - (if p (directory-namestring p))) + (make-pathname :name nil :type nil + :defaults (or *load-pathname* *default-pathname-defaults*)) "The directory where to look for the source.") (defparameter *sysdep-files* @@ -118,13 +118,12 @@ (t nil)))) (defun default-fasl-directory () - (directory-namestring - (merge-pathnames - (make-pathname - :directory `(:relative ".slime" "fasl" - ,@(if (slime-version-string) (list (slime-version-string))) - ,(unique-directory-name))) - (user-homedir-pathname)))) + (merge-pathnames + (make-pathname + :directory `(:relative ".slime" "fasl" + ,@(if (slime-version-string) (list (slime-version-string))) + ,(unique-directory-name))) + (user-homedir-pathname))) (defun binary-pathname (source-pathname binary-directory) "Return the pathname where SOURCE-PATHNAME's binary should be compiled." @@ -184,7 +183,7 @@ :directory (pathname-directory source-directory))) `("swank-backend" ,@*sysdep-files* "swank"))) -(defvar *fasl-directory* (directory-namestring (default-fasl-directory)) +(defvar *fasl-directory* (default-fasl-directory) "The directory where fasl files should be placed.") (defun load-swank (&key From heller at common-lisp.net Sat Feb 25 14:57:36 2006 From: heller at common-lisp.net (heller) Date: Sat, 25 Feb 2006 09:57:36 -0500 (EST) Subject: [slime-cvs] CVS slime Message-ID: <20060225145736.D71732300A@common-lisp.net> Update of /project/slime/cvsroot/slime In directory clnet:/tmp/cvs-serv12840 Modified Files: slime.el Log Message: (slime-lisp-host): New variable. Replace all references to "127.0.0.1" with the variable. --- /project/slime/cvsroot/slime/slime.el 2006/02/22 23:43:11 1.586 +++ /project/slime/cvsroot/slime/slime.el 2006/02/25 14:57:36 1.587 @@ -1321,7 +1321,7 @@ (defun slime-connect (host port &optional coding-system) "Connect to a running Swank server." - (interactive (list (read-from-minibuffer "Host: " "127.0.0.1") + (interactive (list (read-from-minibuffer "Host: " slime-lisp-host) (read-from-minibuffer "Port: " "4005" nil t))) (when (and (interactive-p) slime-net-processes (y-or-n-p "Close old connections first? ")) @@ -1530,7 +1530,7 @@ (let ((port (slime-read-swank-port)) (args (slime-inferior-lisp-args process))) (delete-file (slime-swank-port-file)) - (let ((c (slime-connect "127.0.0.1" port + (let ((c (slime-connect slime-lisp-host port (plist-get args :coding-system)))) (slime-set-inferior-process c process)))) ((and retries (zerop retries)) @@ -1610,6 +1610,9 @@ ;;; here. They are defined elsewhere by the event-dispatching ;;; functions in this file and in swank.lisp. +(defvar slime-lisp-host "127.0.0.1" + "The default hostname (or IP address) to connect to.") + (defvar slime-net-processes nil "List of processes (sockets) connected to Lisps.") @@ -2766,7 +2769,7 @@ (let ((stream (open-network-stream "*lisp-output-stream*" (slime-with-connection-buffer () (current-buffer)) - "127.0.0.1" port))) + slime-lisp-host port))) (when slime-kill-without-query-p (process-kill-without-query stream)) (set-process-filter stream 'slime-output-filter) From heller at common-lisp.net Sat Feb 25 15:00:22 2006 From: heller at common-lisp.net (heller) Date: Sat, 25 Feb 2006 10:00:22 -0500 (EST) Subject: [slime-cvs] CVS slime Message-ID: <20060225150022.CD03E29001@common-lisp.net> Update of /project/slime/cvsroot/slime In directory clnet:/tmp/cvs-serv14100 Modified Files: ChangeLog Log Message: *** empty log message *** --- /project/slime/cvsroot/slime/ChangeLog 2006/02/25 12:10:33 1.846 +++ /project/slime/cvsroot/slime/ChangeLog 2006/02/25 15:00:22 1.847 @@ -1,4 +1,15 @@ +2006-02-25 Helmut Eller + + * swank-loader.lisp (default-fasl-directory): Previously we return + only the directory-namestring which breaks SCL, because it loses + the host and device components. Return the complete pathname + instead. Patch by Douglas Crosher. + + * slime.el (slime-lisp-host): New variable. Replace all references + to "127.0.0.1" with the variable. + 2006-02-25 Douglas Crosher + * swank-backend.lisp (operate-on-system): symbol case fix for SCL's lowercase mode. From heller at common-lisp.net Sat Feb 25 15:15:55 2006 From: heller at common-lisp.net (heller) Date: Sat, 25 Feb 2006 10:15:55 -0500 (EST) Subject: [slime-cvs] CVS slime Message-ID: <20060225151555.A445932003@common-lisp.net> Update of /project/slime/cvsroot/slime In directory clnet:/tmp/cvs-serv16182 Modified Files: slime.el Log Message: Replace some occurrences of *VARNAME* with VARNAME which is more idiomatic Elisp. --- /project/slime/cvsroot/slime/slime.el 2006/02/25 14:57:36 1.587 +++ /project/slime/cvsroot/slime/slime.el 2006/02/25 15:15:55 1.588 @@ -7120,17 +7120,17 @@ '(("q" . slime-temp-buffer-quit) ("g" . slime-macroexpand-again))) -(defvar *slime-eval-macroexpand-expression* nil +(defvar slime-eval-macroexpand-expression nil "Specifies the last macroexpansion preformed. This variable specifies both what was expanded and how.") (defun slime-eval-macroexpand (expander &optional string) (unless string (setf string (slime-sexp-at-point-or-error))) - (setf *slime-eval-macroexpand-expression* `(,expander ,string)) + (setf slime-eval-macroexpand-expression `(,expander ,string)) (lexical-let ((package (slime-current-package))) (slime-eval-async - *slime-eval-macroexpand-expression* + slime-eval-macroexpand-expression (lambda (expansion) (slime-with-output-to-temp-buffer ("*SLIME macroexpansion*" lisp-mode) package @@ -7164,8 +7164,8 @@ (defun slime-macroexpand-again () "Reperform the last macroexpansion." (interactive) - (slime-eval-macroexpand (first *slime-eval-macroexpand-expression*) - (second *slime-eval-macroexpand-expression*))) + (slime-eval-macroexpand (first slime-eval-macroexpand-expression) + (second slime-eval-macroexpand-expression))) ;;;; Subprocess control @@ -8705,7 +8705,7 @@ ;;;; Editing commands -(defvar *slime-comment-start-regexp* +(defvar slime-comment-start-regexp "\\(\\(^\\|[^\n\\\\]\\)\\([\\\\][\\\\]\\)*\\);+[ \t]*" "Regexp to match the start of a comment.") @@ -8715,7 +8715,7 @@ Otherwise leave point unchanged and return NIL." (let ((boundary (point))) (beginning-of-line) - (cond ((re-search-forward *slime-comment-start-regexp* boundary t) + (cond ((re-search-forward slime-comment-start-regexp boundary t) (point)) (t (goto-char boundary) nil)))) From dcrosher at common-lisp.net Sat Feb 25 17:46:14 2006 From: dcrosher at common-lisp.net (dcrosher) Date: Sat, 25 Feb 2006 12:46:14 -0500 (EST) Subject: [slime-cvs] CVS slime Message-ID: <20060225174614.13C2B1203B@common-lisp.net> Update of /project/slime/cvsroot/slime In directory clnet:/tmp/cvs-serv3662 Modified Files: ChangeLog swank-scl.lisp Log Message: o swank-scl.lisp: Fix slime input stream reading. --- /project/slime/cvsroot/slime/ChangeLog 2006/02/25 15:00:22 1.847 +++ /project/slime/cvsroot/slime/ChangeLog 2006/02/25 17:46:13 1.848 @@ -1,3 +1,7 @@ +2006-02-26 Douglas Crosher + * swank-scl.lisp: (ext:stream-read-chars): Correct the updating of + the buffer index. Fixes slime input stream problems. + 2006-02-25 Helmut Eller * swank-loader.lisp (default-fasl-directory): Previously we return --- /project/slime/cvsroot/slime/swank-scl.lisp 2006/02/25 12:10:33 1.4 +++ /project/slime/cvsroot/slime/swank-scl.lisp 2006/02/25 17:46:13 1.5 @@ -192,6 +192,7 @@ (dotimes (i copy) (declare (type kernel:index i)) (setf (aref buffer (+ start i)) (aref input-buffer (+ index i)))) + (setf (slot-value stream 'index) (+ index copy)) (incf (slot-value stream 'position) copy) copy) (waitp @@ -206,7 +207,8 @@ (t (setf (slot-value stream 'buffer) new-input) (setf (slot-value stream 'index) 0) - (ext:stream-read-chars stream buffer start requested waitp)))))) + (ext:stream-read-chars stream buffer + start requested waitp)))))) (t 0)))) @@ -1767,9 +1769,6 @@ (defun scl-inspect (o) (destructuring-bind (text labeledp . parts) (inspect::describe-parts o) - (loop for value in parts - for i from 0 - do (format stream " ~S~%" (label-value-line i value))) (values (format nil "~A~%" text) (if labeledp (loop for (label . value) in parts From mbaringer at common-lisp.net Mon Feb 27 14:29:31 2006 From: mbaringer at common-lisp.net (mbaringer) Date: Mon, 27 Feb 2006 09:29:31 -0500 (EST) Subject: [slime-cvs] CVS /slime Message-ID: <20060227142931.B326A52011@common-lisp.net> Update of /project/slime/cvsroot//slime In directory clnet:/tmp/cvs-serv29026 Modified Files: ChangeLog Log Message: --- /project/slime/cvsroot//slime/ChangeLog 2006/02/25 17:46:13 1.848 +++ /project/slime/cvsroot//slime/ChangeLog 2006/02/27 14:29:31 1.849 @@ -1,3 +1,16 @@ +2006-02-27 Marco Baringer + + Provide functions for performing macroexpansion inplace, use these + functions in the *SLIME macroexpansion* buffer. + + * slime.el (slime-macroexpansion-minor-mode): Attempt to map + -inplace functions to the same keys as their regular contureparts + in slime-mode-map. + (slime-eval-macroexpand-inplace): New function. + (slime-macroexpand-1-inplace): New function. + (slime-macroexpand-all-inplace): New function. + * doc/slime.texi: Document new macroexpansion mode. + 2006-02-26 Douglas Crosher * swank-scl.lisp: (ext:stream-read-chars): Correct the updating of the buffer index. Fixes slime input stream problems. From mbaringer at common-lisp.net Mon Feb 27 14:30:07 2006 From: mbaringer at common-lisp.net (mbaringer) Date: Mon, 27 Feb 2006 09:30:07 -0500 (EST) Subject: [slime-cvs] CVS /slime Message-ID: <20060227143007.9BB7E650A2@common-lisp.net> Update of /project/slime/cvsroot//slime In directory clnet:/tmp/cvs-serv29070 Modified Files: slime.el Log Message: (slime-macroexpansion-minor-mode): Attempt to map -inplace functions to the same keys as their regular contureparts in slime-mode-map. (slime-eval-macroexpand-inplace): New function. (slime-macroexpand-1-inplace): New function. (slime-macroexpand-all-inplace): New function. --- /project/slime/cvsroot//slime/slime.el 2006/02/25 15:15:55 1.588 +++ /project/slime/cvsroot//slime/slime.el 2006/02/27 14:30:07 1.589 @@ -7118,7 +7118,14 @@ nil " temp" '(("q" . slime-temp-buffer-quit) - ("g" . slime-macroexpand-again))) + ("g" . slime-macroexpand-again)) + (flet ((remap (from to) + (dolist (mapping (where-is-internal from slime-mode-map)) + (define-key slime-macroexpansion-minor-mode-map + mapping + to)))) + (remap 'slime-macroexpand-1 'slime-macroexpand-1-inplace) + (remap 'slime-macroexpand-all 'slime-macroexpand-all-inplace))) (defvar slime-eval-macroexpand-expression nil "Specifies the last macroexpansion preformed. This variable @@ -7138,6 +7145,26 @@ (insert expansion) (font-lock-fontify-buffer)))))) +(defun slime-eval-macroexpand-inplace (expander) + "Substitutes the current sexp at place with its macroexpansion. + +NB: Does not affect *slime-eval-macroexpand-expression*" + (interactive) + (lexical-let* ((string (slime-sexp-at-point-or-error)) + (package (slime-current-package)) + (start (point)) + (end (+ start (length string))) + (buffer (current-buffer))) + (slime-eval-async + `(,expander ,string) + (lambda (expansion) + (with-current-buffer buffer + (let ((buffer-read-only nil)) + (goto-char start) + (delete-region start end) + (insert expansion) + (goto-char start))))))) + (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 @@ -7146,11 +7173,21 @@ (slime-eval-macroexpand (if repeatedly 'swank:swank-macroexpand 'swank:swank-macroexpand-1))) +(defun slime-macroexpand-1-inplace (&optional repeatedly) + (interactive "P") + (slime-eval-macroexpand-inplace + (if repeatedly 'swank:swank-macroexpand 'swank:swank-macroexpand-1))) + (defun slime-macroexpand-all () "Display the recursively macro expanded sexp at point." (interactive) (slime-eval-macroexpand 'swank:swank-macroexpand-all)) +(defun slime-macroexpand-all-inplace () + "Display the recursively macro expanded sexp at point." + (interactive) + (slime-eval-macroexpand-inplace 'swank:swank-macroexpand-all)) + (defun slime-compiler-macroexpand () "Display the compiler-macro expansion of sexp at point." (interactive) From mbaringer at common-lisp.net Mon Feb 27 14:30:32 2006 From: mbaringer at common-lisp.net (mbaringer) Date: Mon, 27 Feb 2006 09:30:32 -0500 (EST) Subject: [slime-cvs] CVS /slime/doc Message-ID: <20060227143032.BCB6F720A1@common-lisp.net> Update of /project/slime/cvsroot//slime/doc In directory clnet:/tmp/cvs-serv30317/doc Modified Files: slime.texi Log Message: Document new macroexpansion mode. --- /project/slime/cvsroot//slime/doc/slime.texi 2005/10/14 18:28:07 1.42 +++ /project/slime/cvsroot//slime/doc/slime.texi 2006/02/27 14:30:32 1.43 @@ -46,7 +46,7 @@ @end macro @set EDITION 1.2 - at set UPDATED @code{$Date: 2005/10/14 18:28:07 $} + at set UPDATED @code{$Date: 2006/02/27 14:30:32 $} @titlepage @title SLIME User Manual @@ -123,6 +123,13 @@ * Inspector:: * Profiling:: +Programming Helpers + +* Completion:: +* Macro Expansion:: +* Accessing Documentation:: +* Disassembly:: + REPL: the ``top level'' * REPL commands:: @@ -140,6 +147,7 @@ * slime-selector:: * slime-autodoc-mode:: +* slime-macroexpansion-minor-mode:: * Multiple connections:: * Typeout frames:: @@ -166,7 +174,7 @@ @SLIME{} is the ``Superior Lisp Interaction Mode for Emacs.'' @SLIME{} extends Emacs with new support for interactive programming in -Common Lisp. The features are centred around @code{slime-mode}, an Emacs +Common Lisp. The features are centered around @code{slime-mode}, an Emacs minor-mode that complements the standard @code{lisp-mode}. While @code{lisp-mode} supports editing Lisp source files, @code{slime-mode} adds support for interacting with a running Common Lisp process for @@ -620,6 +628,16 @@ @node Programming Helpers, Recovery, Documentation, Commands @subsection Programming Helpers + at menu +* Completion:: +* Macro Expansion:: +* Accessing Documentation:: +* Disassembly:: + at end menu + + at node Completion, Macro Expansion, Programming Helpers, Programming Helpers + at subsubsection Completion + @table @kbd @kbditem{M-TAB, slime-complete-symbol} Complete the symbol at point. Note that three styles of completion are @@ -638,10 +656,6 @@ selected as the method of completion used for @code{slime-complete-symbol}. - at kbditem{SPC, slime-space} -The space key inserts a space and also looks up and displays the -argument list for the function at point, if there is one. - @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 @@ -669,7 +683,14 @@ (make-instance 'foo --inserts--> :bar bar :blub blub initargs...) @end example + at end table + + at node Macro Expansion, Accessing Documentation, Completion, Programming Helpers + at subsubsection Macro Expansion + + at xref{slime-macroexpansion-minor-mode}. + at table @kbd @kbditem{C-c C-m, slime-macroexpand-1} Macroexpand the expression at point once. If invoked with a prefix argument, use macroexpand instead of macroexpand-1. @@ -681,10 +702,23 @@ Toggle tracing of the function at point. If invoked with a prefix argument, read additional information, like which particular method should be traced. + at end table + at node Accessing Documentation, Disassembly, Macro Expansion, Programming Helpers + at subsubsection Accessing Documentation + + at table @kbd + at kbditem{SPC, slime-space} +The space key inserts a space and also looks up and displays the +argument list for the function at point, if there is one. + at end table + + at node Disassembly, , Accessing Documentation, Programming Helpers + at subsubsection Disassembly + + at table @kbd @kbditem{C-c M-d, slime-disassemble-symbol} Disassemble the function definition of the symbol at point. - @end table @node Recovery, Cross-reference, Programming Helpers, Commands @@ -1094,6 +1128,7 @@ @menu * slime-selector:: * slime-autodoc-mode:: +* slime-macroexpansion-minor-mode:: * Multiple connections:: * Typeout frames:: @end menu @@ -1133,7 +1168,7 @@ The macro @code{def-slime-selector-method} can be used to define new buffers for @code{slime-selector} to find. - at node slime-autodoc-mode, Multiple connections, slime-selector, Extras + at node slime-autodoc-mode, slime-macroexpansion-minor-mode, slime-selector, Extras @section @code{slime-autodoc-mode} @code{slime-autodoc-mode} is an additional minor-mode for @@ -1149,7 +1184,26 @@ (slime-setup :autodoc t) @end example - at node Multiple connections, Typeout frames, slime-autodoc-mode, Extras + at node slime-macroexpansion-minor-mode, Multiple connections, slime-autodoc-mode, Extras + at section slime-macroexpansion-minor-mode + +Within a slime macroexpansion buffer some extra commands are provided +(these commands are always available but are only bound to keys in a +macroexpansion buffer). + + at table @kbd + at kbditem{C-c C-m, slime-macroexpand-1-inplace} +Just like slime-macroexpand-1 but the original form is replaced with the expansion. + + at kbditem{g, slime-macroexpand-1-inplace} +The last macroexpansion is performed again, the current contents of +the macroexpansion buffer are replaced with the new expansion. + + at kbditem{q, slime-temp-buffer-quit} +Close the expansion buffer. + at end table + + at node Multiple connections, Typeout frames, slime-macroexpansion-minor-mode, Extras @section Multiple connections @SLIME{} is able to connect to multiple Lisp processes at the same From mkoeppe at common-lisp.net Mon Feb 27 19:15:53 2006 From: mkoeppe at common-lisp.net (mkoeppe) Date: Mon, 27 Feb 2006 14:15:53 -0500 (EST) Subject: [slime-cvs] CVS slime Message-ID: <20060227191553.38E64690E7@common-lisp.net> Update of /project/slime/cvsroot/slime In directory clnet:/tmp/cvs-serv30469 Modified Files: slime.el Log Message: (slime-eval-macroexpand-inplace): Indent the inserted macroexpansion. --- /project/slime/cvsroot/slime/slime.el 2006/02/27 14:30:07 1.589 +++ /project/slime/cvsroot/slime/slime.el 2006/02/27 19:15:52 1.590 @@ -7163,7 +7163,8 @@ (goto-char start) (delete-region start end) (insert expansion) - (goto-char start))))))) + (goto-char start) + (indent-sexp))))))) (defun slime-macroexpand-1 (&optional repeatedly) "Display the macro expansion of the form at point. The form is From mkoeppe at common-lisp.net Mon Feb 27 19:16:01 2006 From: mkoeppe at common-lisp.net (mkoeppe) Date: Mon, 27 Feb 2006 14:16:01 -0500 (EST) Subject: [slime-cvs] CVS slime Message-ID: <20060227191601.E020A720A2@common-lisp.net> Update of /project/slime/cvsroot/slime In directory clnet:/tmp/cvs-serv30506 Modified Files: ChangeLog Log Message: *** empty log message *** --- /project/slime/cvsroot/slime/ChangeLog 2006/02/27 14:29:31 1.849 +++ /project/slime/cvsroot/slime/ChangeLog 2006/02/27 19:16:01 1.850 @@ -1,3 +1,8 @@ +2006-02-27 Matthias Koeppe + + * slime.el (slime-eval-macroexpand-inplace): Indent the inserted + macroexpansion. + 2006-02-27 Marco Baringer Provide functions for performing macroexpansion inplace, use these