From alendvai at common-lisp.net Wed Jan 3 10:56:14 2007 From: alendvai at common-lisp.net (alendvai) Date: Wed, 3 Jan 2007 05:56:14 -0500 (EST) Subject: [slime-cvs] CVS slime Message-ID: <20070103105614.8B45331035@common-lisp.net> Update of /project/slime/cvsroot/slime In directory clnet:/tmp/cvs-serv24330 Modified Files: slime.el swank.lisp Log Message: Handle better the case when swank can not read anything from the string sent to be inspected. Only bring up the debugger when the inspect command is prefixed. --- /project/slime/cvsroot/slime/slime.el 2006/12/29 18:39:15 1.728 +++ /project/slime/cvsroot/slime/slime.el 2007/01/03 10:56:14 1.729 @@ -9133,11 +9133,13 @@ :reset ,(not no-reset) :eval ,eval :dwim-mode ,dwim-mode) - (with-lexical-bindings (thread package) + (with-lexical-bindings (thread package form) (lambda (thing) - (slime-open-inspector thing - :thread thread - :package package))))) + (if thing + (slime-open-inspector thing + :thread thread + :package package) + (message "Couldn't read anything from '%s' (hint: prefix for debugger with details)" form)))))) (defun* slime-read-object (prompt &key return-names-unconfirmed) "Read a Common Lisp expression from the minibuffer, providing --- /project/slime/cvsroot/slime/swank.lisp 2006/12/31 12:28:28 1.445 +++ /project/slime/cvsroot/slime/swank.lisp 2007/01/03 10:56:14 1.446 @@ -4880,30 +4880,38 @@ (with-buffer-syntax () (when reset (reset-inspector)) - (let* ((form (read-from-string string)) - (value (cond - (dwim-mode - (let ((things (loop for hook :in *inspector-dwim-lookup-hooks* - for (result foundp) = (multiple-value-list - (funcall hook form)) - when foundp - append (if (consp result) - result - (list result))))) - (if (rest things) - things - (first things)))) - (eval (eval form)) - (t form)))) - (when (and dwim-mode - form - value) - ;; push the form to the inspector stack, so you can go back to it - ;; with slime-inspector-pop if dwim missed the intention - (push form *inspector-stack*)) - (inspect-object (if dwim-mode - (or value form) - value))))) + (let* ((form (block reading + (handler-bind + ((error (lambda (e) + (declare (ignore e)) + (when dwim-mode + (return-from reading 'nothing))))) + (read-from-string string nil 'nothing)))) + (value)) + (unless (eq form 'nothing) + (setf value (cond + (dwim-mode + (let ((things (loop for hook :in *inspector-dwim-lookup-hooks* + for (result foundp) = (multiple-value-list + (funcall hook form)) + when foundp + append (if (consp result) + result + (list result))))) + (if (rest things) + things + (first things)))) + (eval (eval form)) + (t form))) + (when (and dwim-mode + form + value) + ;; push the form to the inspector stack, so you can go back to it + ;; with slime-inspector-pop if dwim missed the intention + (push form *inspector-stack*)) + (inspect-object (if dwim-mode + (or value form) + value)))))) (defun print-part-to-string (value) (let ((string (to-string value)) From alendvai at common-lisp.net Wed Jan 3 11:02:52 2007 From: alendvai at common-lisp.net (alendvai) Date: Wed, 3 Jan 2007 06:02:52 -0500 (EST) Subject: [slime-cvs] CVS slime Message-ID: <20070103110252.F237971121@common-lisp.net> Update of /project/slime/cvsroot/slime In directory clnet:/tmp/cvs-serv27499 Modified Files: slime.el Log Message: Use set-parent-keymaps when available (xemacs only for now) when setting up slime-read-expression-map. The effect of this is that the minibuffer will have all the slime-mode-map keys where minibuffer-local-map is not overriding. --- /project/slime/cvsroot/slime/slime.el 2007/01/03 10:56:14 1.729 +++ /project/slime/cvsroot/slime/slime.el 2007/01/03 11:02:52 1.730 @@ -6249,15 +6249,19 @@ (minibuffer-message text)) (message "%s" text)))) -(defvar slime-read-expression-map (make-sparse-keymap) +(defvar slime-read-expression-map + (let ((map (make-sparse-keymap))) + (if (fboundp 'set-keymap-parents) ; xemacs only at the time of writing + (set-keymap-parents map (list minibuffer-local-map slime-mode-map)) + (progn + (set-keymap-parent map minibuffer-local-map) + (define-key map (kbd "\t") 'slime-complete-symbol) + (define-key map (kbd "\M-\t") 'slime-complete-symbol))) + map) "Minibuffer keymap used for reading CL expressions.") -(set-keymap-parent slime-read-expression-map minibuffer-local-map) (set-keymap-parent slime-repl-history-map slime-read-expression-map) -(define-key slime-read-expression-map "\t" 'slime-complete-symbol) -(define-key slime-read-expression-map "\M-\t" 'slime-complete-symbol) - (defvar slime-read-expression-history '() "History list of expressions read from the minibuffer.") From alendvai at common-lisp.net Wed Jan 3 11:04:54 2007 From: alendvai at common-lisp.net (alendvai) Date: Wed, 3 Jan 2007 06:04:54 -0500 (EST) Subject: [slime-cvs] CVS slime Message-ID: <20070103110454.B2C9817038@common-lisp.net> Update of /project/slime/cvsroot/slime In directory clnet:/tmp/cvs-serv28031 Modified Files: slime.el Log Message: Convert some minibuffer reading defun's to defun* and use keywords. Support extra arguments. --- /project/slime/cvsroot/slime/slime.el 2007/01/03 11:02:52 1.730 +++ /project/slime/cvsroot/slime/slime.el 2007/01/03 11:04:54 1.731 @@ -1247,7 +1247,7 @@ This function avoids mistaking the REPL prompt for a symbol." (cond ((or current-prefix-arg query (not (slime-symbol-name-at-point))) - (slime-read-from-minibuffer prompt (slime-symbol-name-at-point))) + (slime-read-from-minibuffer prompt :initial-value (slime-symbol-name-at-point))) (t (slime-symbol-name-at-point)))) ;; Interface @@ -4149,7 +4149,8 @@ slime-repl-history-pattern (catch 'continue (slime-read-from-minibuffer - prompt (slime-symbol-name-at-point) slime-repl-history-map))))) + prompt :initial-value (slime-symbol-name-at-point) + :keymap slime-repl-history-map))))) (when (and regexp (> (length regexp) 0)) (when (slime-repl-history-replace direction regexp t) (setf this-command command))))) @@ -6265,7 +6266,8 @@ (defvar slime-read-expression-history '() "History list of expressions read from the minibuffer.") -(defun slime-read-from-minibuffer (prompt &optional initial-value keymap) +(defun* slime-read-from-minibuffer (prompt &key initial-value keymap + (history 'slime-read-expression-history)) "Read a string from the minibuffer, prompting with PROMPT. If INITIAL-VALUE is non-nil, it is inserted into the minibuffer before reading input. The result is a string (\"\" if no input was given)." @@ -6279,7 +6281,7 @@ minibuffer-setup-hook))) (read-from-minibuffer prompt initial-value (or keymap slime-read-expression-map) - nil 'slime-read-expression-history))) + nil history))) (defun slime-bogus-completion-alist (list) "Make an alist out of list. @@ -7155,7 +7157,7 @@ in Lisp when committed with \\[slime-edit-value-commit]." (interactive (list (slime-read-from-minibuffer "Edit value (evaluated): " - (slime-sexp-at-point)))) + :initial-value (slime-sexp-at-point)))) (slime-eval-async `(swank:value-for-editing ,form-string) (lexical-let ((form-string form-string) (package (slime-current-package))) @@ -7219,16 +7221,16 @@ (cond ((null spec) (slime-read-from-minibuffer "(Un)trace: ")) ((symbolp spec) - (slime-read-from-minibuffer "(Un)trace: " (symbol-name spec))) + (slime-read-from-minibuffer "(Un)trace: " :initial-value (symbol-name spec))) (t (destructure-case spec ((setf n) - (slime-read-from-minibuffer "(Un)trace: " (prin1-to-string spec))) + (slime-read-from-minibuffer "(Un)trace: " :initial-value (prin1-to-string spec))) (((:defun :defmacro) n) - (slime-read-from-minibuffer "(Un)trace: " (prin1-to-string n))) + (slime-read-from-minibuffer "(Un)trace: " :initial-value (prin1-to-string n))) ((:defgeneric n) (let* ((name (prin1-to-string n)) - (answer (slime-read-from-minibuffer "(Un)trace: " name))) + (answer (slime-read-from-minibuffer "(Un)trace: " :initial-value name))) (cond ((and (string= name answer) (y-or-n-p (concat "(Un)trace also all " "methods implementing " @@ -7237,12 +7239,12 @@ (t answer)))) ((:defmethod &rest _) - (slime-read-from-minibuffer "(Un)trace: " (prin1-to-string spec))) + (slime-read-from-minibuffer "(Un)trace: " :initial-value (prin1-to-string spec))) ((:call caller callee) (let* ((callerstr (prin1-to-string caller)) (calleestr (prin1-to-string callee)) (answer (slime-read-from-minibuffer "(Un)trace: " - calleestr))) + :initial-value calleestr))) (cond ((and (string= calleestr answer) (y-or-n-p (concat "(Un)trace only when " calleestr " is called by " callerstr "? "))) @@ -7251,7 +7253,7 @@ answer)))) (((:labels :flet) &rest _) (slime-read-from-minibuffer "(Un)trace local function: " - (prin1-to-string spec))))))) + :initial-value (prin1-to-string spec))))))) (defun slime-extract-context () "Parse the context for the symbol at point. @@ -7395,7 +7397,8 @@ (defun slime-toggle-profile-fdefinition (fname-string) "Toggle profiling for FNAME-STRING." (interactive (list (slime-read-from-minibuffer - "(Un)Profile: " (slime-symbol-name-at-point)))) + "(Un)Profile: " + :initial-value (slime-symbol-name-at-point)))) (slime-eval-async `(swank:toggle-profile-fdefinition ,fname-string) (lambda (r) (message "%s" r)))) @@ -9145,7 +9148,8 @@ :package package) (message "Couldn't read anything from '%s' (hint: prefix for debugger with details)" form)))))) -(defun* slime-read-object (prompt &key return-names-unconfirmed) +(defun* slime-read-object (prompt &key return-names-unconfirmed + initial-value (history 'slime-read-expression-history)) "Read a Common Lisp expression from the minibuffer, providing defaults from the s-expression at point. If point is within a presentation, don't prompt, just return the presentation." @@ -9160,7 +9164,9 @@ (and (string-match "\\([-|.:0-9a-zA-Z]*\\)" sexp) (= (match-end 0) (length sexp)))) sexp - (slime-read-from-minibuffer prompt sexp)))))) + (slime-read-from-minibuffer prompt + :initial-value (or initial-value sexp) + :history history)))))) (define-derived-mode slime-inspector-mode fundamental-mode "Slime-Inspector" (set-syntax-table lisp-mode-syntax-table) @@ -9469,7 +9475,7 @@ "Show the xref graph of a function in a tree widget." (interactive (list (slime-read-from-minibuffer "Name: " - (slime-symbol-name-at-point)) + :initial-value (slime-symbol-name-at-point)) (read (completing-read "Type: " (slime-bogus-completion-alist '(":callers" ":callees" ":calls")) nil t ":")))) From alendvai at common-lisp.net Wed Jan 3 11:07:24 2007 From: alendvai at common-lisp.net (alendvai) Date: Wed, 3 Jan 2007 06:07:24 -0500 (EST) Subject: [slime-cvs] CVS slime Message-ID: <20070103110724.4AAD919001@common-lisp.net> Update of /project/slime/cvsroot/slime In directory clnet:/tmp/cvs-serv28364 Modified Files: slime.el Log Message: FIX: older Emacsen have no line-number-at-pos --- /project/slime/cvsroot/slime/slime.el 2007/01/03 11:04:54 1.731 +++ /project/slime/cvsroot/slime/slime.el 2007/01/03 11:07:23 1.732 @@ -9241,9 +9241,11 @@ ;; narrowed the buffer. (save-restriction (widen) - (cons (if (fboundp 'line-number) - (line-number) ; XEmacs - (line-number-at-pos)) ; Emacs + (cons (cond ((fboundp 'line-number) + (line-number)) ; XEmacs + ((fboundp 'line-number-at-pos) + (line-number-at-pos)) ; Recent GNU Emacs + (t (1+ (count-lines 1 (point-at-bol))))) (current-column)))) (defun slime-inspector-operate-on-point () From alendvai at common-lisp.net Wed Jan 3 11:09:29 2007 From: alendvai at common-lisp.net (alendvai) Date: Wed, 3 Jan 2007 06:09:29 -0500 (EST) Subject: [slime-cvs] CVS slime Message-ID: <20070103110929.8C4CB1A007@common-lisp.net> Update of /project/slime/cvsroot/slime In directory clnet:/tmp/cvs-serv28605 Modified Files: swank.lisp Log Message: FIX: keyword symbols keep their : when travelling from swank to slime --- /project/slime/cvsroot/slime/swank.lisp 2007/01/03 10:56:14 1.446 +++ /project/slime/cvsroot/slime/swank.lisp 2007/01/03 11:09:29 1.447 @@ -1207,7 +1207,7 @@ Characters are converted emacs' ? notaion, strings are left as they are (except for espacing any nested \" chars, numbers are -printed in base 10 and symbols are printed as their symbol-nome +printed in base 10 and symbols are printed as their symbol-name converted to lower case." (etypecase form (string (format nil "~S" form)) @@ -1215,7 +1215,10 @@ (process-form-for-emacs (car form)) (process-form-for-emacs (cdr form)))) (character (format nil "?~C" form)) - (symbol (string-downcase (symbol-name form))) + (symbol (concatenate 'string (when (eq (symbol-package form) + #.(find-package "KEYWORD")) + ":") + (string-downcase (symbol-name form)))) (number (let ((*print-base* 10)) (princ-to-string form))))) From alendvai at common-lisp.net Wed Jan 3 11:18:44 2007 From: alendvai at common-lisp.net (alendvai) Date: Wed, 3 Jan 2007 06:18:44 -0500 (EST) Subject: [slime-cvs] CVS slime Message-ID: <20070103111844.7CD1222013@common-lisp.net> Update of /project/slime/cvsroot/slime In directory clnet:/tmp/cvs-serv29885 Modified Files: swank.lisp Log Message: FIX: drop extra "Slots: " from standard-object's inspector presentation --- /project/slime/cvsroot/slime/swank.lisp 2007/01/03 11:09:29 1.447 +++ /project/slime/cvsroot/slime/swank.lisp 2007/01/03 11:18:44 1.448 @@ -4426,12 +4426,11 @@ (swank-mop:method-qualifiers method) (method-specializers-for-inspect method))) -(defmethod inspect-for-emacs ((o standard-object) inspector) - (let ((c (class-of o))) +(defmethod inspect-for-emacs ((object standard-object) inspector) + (let ((class (class-of object))) (values "An object." - `("Class: " (:value ,c) (:newline) - "Slots:" (:newline) - ,@(all-slots-for-inspector o inspector))))) + `("Class: " (:value ,class) (:newline) + ,@(all-slots-for-inspector object inspector))))) (defvar *gf-method-getter* 'methods-by-applicability "This function is called to get the methods of a generic function. @@ -4496,7 +4495,7 @@ (defgeneric all-slots-for-inspector (object inspector) (:method ((object standard-object) inspector) (declare (ignore inspector)) - (append '("------------------------------" (:newline) + (append '("--------------------" (:newline) "All Slots:" (:newline)) (let* ((class (class-of object)) (direct-slots (swank-mop:class-direct-slots class)) From alendvai at common-lisp.net Wed Jan 3 11:44:51 2007 From: alendvai at common-lisp.net (alendvai) Date: Wed, 3 Jan 2007 06:44:51 -0500 (EST) Subject: [slime-cvs] CVS slime Message-ID: <20070103114451.8E3664818A@common-lisp.net> Update of /project/slime/cvsroot/slime In directory clnet:/tmp/cvs-serv4040 Modified Files: ChangeLog Log Message: changelog --- /project/slime/cvsroot/slime/ChangeLog 2006/12/31 12:29:07 1.1033 +++ /project/slime/cvsroot/slime/ChangeLog 2007/01/03 11:44:50 1.1034 @@ -1,3 +1,25 @@ +2007-01-03 Attila Lendvai + + * swank.lisp: FIX: drop extra "Slots: " from standard-object's + inspector presentation + + * swank.lisp: FIX: keyword symbols keep their : when travelling + from swank to slime + + * slime.el: FIX: older Emacsen have no line-number-at-pos. + + * slime.el: Convert some minibuffer reading defun's to defun* and + use keywords. Support extra arguments. + + * slime.el: Use set-parent-keymaps when available (xemacs only for + now) when setting up slime-read-expression-map. The effect of this + is that the minibuffer will have all the slime-mode-map keys where + minibuffer-local-map is not overriding. + + * slime.el, swank.lisp: Handle better the case when swank can not + read anything from the string sent to be inspected. Only bring up + the debugger when the inspect command is prefixed. + 2006-12-31 Matthias Koeppe Restore the nested-presentations feature. From alendvai at common-lisp.net Thu Jan 4 16:25:53 2007 From: alendvai at common-lisp.net (alendvai) Date: Thu, 4 Jan 2007 11:25:53 -0500 (EST) Subject: [slime-cvs] CVS slime Message-ID: <20070104162553.EF37C702FE@common-lisp.net> Update of /project/slime/cvsroot/slime In directory clnet:/tmp/cvs-serv6708 Modified Files: swank.lisp Log Message: FIX: bind *sldb-printer-bindings* also in frame-locals-for-emacs --- /project/slime/cvsroot/slime/swank.lisp 2007/01/03 11:18:44 1.448 +++ /project/slime/cvsroot/slime/swank.lisp 2007/01/04 16:25:53 1.449 @@ -2957,11 +2957,12 @@ (defslimefun frame-locals-for-emacs (index) "Return a property list ((&key NAME ID VALUE) ...) describing the local variables in the frame INDEX." - (mapcar (lambda (frame-locals) - (destructuring-bind (&key name id value) frame-locals - (list :name (prin1-to-string name) :id id - :value (to-string value)))) - (frame-locals index))) + (with-bindings *sldb-printer-bindings* + (mapcar (lambda (frame-locals) + (destructuring-bind (&key name id value) frame-locals + (list :name (prin1-to-string name) :id id + :value (to-string value)))) + (frame-locals index)))) (defslimefun frame-catch-tags-for-emacs (frame-index) (mapcar #'to-string (frame-catch-tags frame-index))) From alendvai at common-lisp.net Thu Jan 4 16:27:05 2007 From: alendvai at common-lisp.net (alendvai) Date: Thu, 4 Jan 2007 11:27:05 -0500 (EST) Subject: [slime-cvs] CVS slime Message-ID: <20070104162705.F3B957208F@common-lisp.net> Update of /project/slime/cvsroot/slime In directory clnet:/tmp/cvs-serv6875 Modified Files: swank.lisp Log Message: FIX: sort is destructive, call copy-seq at a few places --- /project/slime/cvsroot/slime/swank.lisp 2007/01/04 16:25:53 1.449 +++ /project/slime/cvsroot/slime/swank.lisp 2007/01/04 16:27:05 1.450 @@ -4454,13 +4454,12 @@ `method-specializer<' is used for sorting." ;; FIXME: argument-precedence-order and qualifiers are ignored. - (let ((methods (copy-list (swank-mop:generic-function-methods gf)))) - (labels ((method< (meth1 meth2) - (loop for s1 in (swank-mop:method-specializers meth1) - for s2 in (swank-mop:method-specializers meth2) - do (cond ((specializer< s2 s1) (return nil)) - ((specializer< s1 s2) (return t)))))) - (stable-sort methods #'method<)))) + (labels ((method< (meth1 meth2) + (loop for s1 in (swank-mop:method-specializers meth1) + for s2 in (swank-mop:method-specializers meth2) + do (cond ((specializer< s2 s1) (return nil)) + ((specializer< s1 s2) (return t)))))) + (stable-sort (copy-seq (swank-mop:generic-function-methods gf)) #'method<))) (defun abbrev-doc (doc &optional (maxlen 80)) "Return the first sentence of DOC, but not more than MAXLAN characters." @@ -4500,7 +4499,7 @@ "All Slots:" (:newline)) (let* ((class (class-of object)) (direct-slots (swank-mop:class-direct-slots class)) - (effective-slots (sort (swank-mop:class-slots class) + (effective-slots (sort (copy-seq (swank-mop:class-slots class)) #'string< :key #'swank-mop:slot-definition-name)) (slot-presentations (loop for effective-slot :in effective-slots collect (inspect-slot-for-emacs @@ -4616,7 +4615,7 @@ ,@(when (swank-mop:specializer-direct-methods class) `("It is used as a direct specializer in the following methods:" (:newline) ,@(loop - for method in (sort (copy-list (swank-mop:specializer-direct-methods class)) + for method in (sort (copy-seq (swank-mop:specializer-direct-methods class)) #'string< :key (lambda (x) (symbol-name (let ((name (swank-mop::generic-function-name @@ -4673,11 +4672,11 @@ ,@(when (documentation package t) `("Documentation:" (:newline) ,(documentation package t) (:newline))) - "Use list: " ,@(common-seperated-spec (sort (package-use-list package) #'string-lessp :key #'package-name) + "Use list: " ,@(common-seperated-spec (sort (copy-seq (package-use-list package)) #'string-lessp :key #'package-name) (lambda (pack) `(:value ,pack ,(inspector-princ (package-name pack))))) (:newline) - "Used by list: " ,@(common-seperated-spec (sort (package-used-by-list package) #'string-lessp :key #'package-name) + "Used by list: " ,@(common-seperated-spec (sort (copy-seq (package-used-by-list package)) #'string-lessp :key #'package-name) (lambda (pack) `(:value ,pack ,(inspector-princ (package-name pack))))) (:newline) From alendvai at common-lisp.net Thu Jan 4 16:30:09 2007 From: alendvai at common-lisp.net (alendvai) Date: Thu, 4 Jan 2007 11:30:09 -0500 (EST) Subject: [slime-cvs] CVS slime Message-ID: <20070104163009.D8AC414007@common-lisp.net> Update of /project/slime/cvsroot/slime In directory clnet:/tmp/cvs-serv7082 Modified Files: slime.el Log Message: Added slime-insert-possibly-as-rectangle and use it when inserting things here and there. The effect of this is that multi-line strings coming from swank (e.g. stuff in sldb) are inserted with insert-rectangle, so they are properly indented. --- /project/slime/cvsroot/slime/slime.el 2007/01/03 11:07:23 1.732 +++ /project/slime/cvsroot/slime/slime.el 2007/01/04 16:30:09 1.733 @@ -1265,7 +1265,7 @@ ;; Interface (defsubst slime-insert-propertized (props &rest args) "Insert all ARGS and then add text-PROPS to the inserted text." - (slime-propertize-region props (apply #'insert args))) + (slime-propertize-region props (apply #'slime-insert-possibly-as-rectangle args))) (defun slime-indent-and-complete-symbol () "Indent the current line and perform symbol completion. First @@ -3021,24 +3021,26 @@ (when (eq (overlay-get overlay 'slime-repl-presentation) presentation) (delete-overlay overlay))))) +(defun slime-insert-possibly-as-rectangle (&rest strings) + (if (zerop (current-column)) + (apply #'insert strings) + (dolist (string strings) + (if (string= string "\n") + (newline) + (let ((lines (split-string string "\n"))) + (when (rest lines) + (save-excursion + (dotimes (i (1- (length lines))) + (newline)))) + (insert-rectangle lines)))))) + (defun slime-insert-presentation (string output-id) - (flet ((insert-it () - (let ((lines (split-string string "\n"))) - (if (cdr lines) - (progn - (save-excursion - (dolist (line lines) - (newline))) - (insert-rectangle lines) - (forward-char) - (delete-backward-char 1)) - (insert string))))) - (cond ((not slime-repl-enable-presentations) - (insert-it)) - (t - (let ((start (point))) - (insert-it) - (slime-add-presentation-properties start (point) output-id t)))))) + (cond ((not slime-repl-enable-presentations) + (slime-insert-possibly-as-rectangle string)) + (t + (let ((start (point))) + (slime-insert-possibly-as-rectangle string) + (slime-add-presentation-properties start (point) output-id t))))) (defun slime-open-stream-to-lisp (port) (let ((stream (open-network-stream "*lisp-output-stream*" @@ -3104,7 +3106,8 @@ (slime-with-output-end-mark (if id (slime-insert-presentation string id) - (slime-insert-propertized '(face slime-repl-output-face) string)) + (slime-propertize-region '(face slime-repl-output-face) + (insert string))) (when (and (= (point) slime-repl-prompt-start-mark) (not (bolp))) (insert "\n") @@ -3115,7 +3118,8 @@ ;;(unless (bolp) (insert "\n")) (if id (slime-insert-presentation string id) - (slime-insert-propertized `(face slime-repl-result-face) string)))))) + (slime-propertize-region `(face slime-repl-result-face) + (insert string))))))) (defun slime-switch-to-output-buffer (&optional connection) "Select the output buffer, preferably in a different window." @@ -8268,9 +8272,9 @@ (setq sldb-restarts restarts) (setq sldb-continuations conts) (sldb-insert-condition condition) - (insert (in-sldb-face section "Restarts:") "\n") + (insert "\n\n" (in-sldb-face section "Restarts:") "\n") (sldb-insert-restarts restarts) - (insert "\n" (in-sldb-face section "Backtrace:") "\n") + (insert "\n\n" (in-sldb-face section "Backtrace:") "\n") (setq sldb-backtrace-start-marker (point-marker)) (sldb-insert-frames (sldb-prune-initial-frames frames) nil) (run-hooks 'sldb-hook) @@ -8310,8 +8314,7 @@ (slime-insert-propertized '(sldb-default-action sldb-inspect-condition) (in-sldb-face topline message) "\n" - (in-sldb-face condition type) - "\n\n") + (in-sldb-face condition type)) (when references (insert "See also:\n") (slime-with-rigid-indentation 2 @@ -8392,16 +8395,19 @@ (defun sldb-insert-restarts (restarts) (loop for (name string) in restarts - for number from 0 - do (progn (slime-insert-propertized - `(restart-number ,number - sldb-default-action sldb-invoke-restart - mouse-face highlight) - " " - (in-sldb-face restart-number (number-to-string number)) - ": [" (in-sldb-face restart-type name) "] " - (in-sldb-face restart string)) - (insert "\n")))) + for number from 0 + for first-time-p = t then nil + do (progn + (unless first-time-p + (newline)) + (slime-insert-propertized + `(restart-number ,number + sldb-default-action sldb-invoke-restart + mouse-face highlight) + " " + (in-sldb-face restart-number (number-to-string number)) + ": [" (in-sldb-face restart-type name) "] " + (in-sldb-face restart string))))) (defun sldb-add-face (face string) (if sldb-enable-styled-backtrace @@ -8422,13 +8428,15 @@ (defun sldb-insert-frame (frame &optional detailedp) (destructuring-bind (number string) frame - (slime-insert-propertized - `(frame ,frame sldb-default-action sldb-toggle-details) - " " (in-sldb-face frame-label (format "%2d" number)) ": " - (if detailedp - (in-sldb-face detailed-frame-line string) - (in-sldb-face frame-line string)) - "\n"))) + (let ((props `(frame ,frame sldb-default-action sldb-toggle-details))) + (save-excursion + (slime-insert-propertized props "\n")) + (slime-propertize-region props + (insert " " (in-sldb-face frame-label (format "%2d:" number)) " ") + (slime-insert-possibly-as-rectangle + (if detailedp + (in-sldb-face detailed-frame-line string) + (in-sldb-face frame-line string))))))) (defun sldb-insert-frames (frames maximum-length) "Insert FRAMES into buffer. @@ -8437,7 +8445,10 @@ (when maximum-length (assert (<= (length frames) maximum-length))) (save-excursion - (mapc #'sldb-insert-frame frames) + (mapc (lambda (frame) + (sldb-insert-frame frame) + (newline)) + frames) (let ((number (sldb-previous-frame-number))) (cond ((and maximum-length (< (length frames) maximum-length))) (t @@ -8567,41 +8578,45 @@ (interactive) (sldb-frame-number-at-point) (let ((inhibit-read-only t) - (column (current-column))) + (point (point))) (if (or on (not (sldb-frame-details-visible-p))) (sldb-show-frame-details) (sldb-hide-frame-details)) - (move-to-column column))) + (goto-char point))) (defun sldb-frame-details-visible-p () (and (get-text-property (point) 'frame) (get-text-property (point) 'details-visible-p))) (defun sldb-show-frame-details () - (multiple-value-bind (start end) (sldb-frame-region) - (save-excursion - (goto-char start) - (let* ((props (text-properties-at (point))) - (frame (plist-get props 'frame)) - (frame-number (car frame)) - (standard-output (current-buffer)) - (indent1 " ") - (indent2 " ")) - (delete-region start end) - (slime-propertize-region `(frame ,frame details-visible-p t) - (sldb-insert-frame frame t) - (insert indent1 (in-sldb-face section "Locals:") "\n") - (sldb-insert-locals frame-number indent2) - (when sldb-show-catch-tags - (let ((catchers (sldb-catch-tags frame-number))) - (when catchers - (insert indent1 "Catch-tags:\n") - (dolist (tag catchers) - (slime-insert-propertized - '(catch-tag ,tag) - indent2 - (in-sldb-face catch-tag (format "%s\n" tag))))))))))) - (apply #'sldb-maybe-recenter-region (sldb-frame-region))) + (let* ((props (text-properties-at (point))) + (frame (plist-get props 'frame)) + (frame-number (car frame)) + (catch-tags (when sldb-show-catch-tags + (sldb-catch-tags frame-number))) + (local-vars (sldb-frame-locals frame-number))) + (if (or catch-tags local-vars) + (multiple-value-bind (start end) (sldb-frame-region) + (save-excursion + (goto-char start) + (let* ((standard-output (current-buffer)) + (indent1 " ") + (indent2 " ")) + (delete-region start end) + (slime-propertize-region `(frame ,frame details-visible-p t) + (sldb-insert-frame frame t) + (when local-vars + (insert "\n" indent1 (in-sldb-face section "Locals:")) + (sldb-insert-locals frame-number indent2 local-vars)) + (when catch-tags + (insert "\n" indent1 (in-sldb-face section "Catch-tags:")) + (dolist (tag catch-tags) + (slime-insert-propertized '(catch-tag ,tag) + "\n" + indent2 + (in-sldb-face catch-tag (format "%s" tag))))))))) + (message "Nothing to display") + (apply #'sldb-maybe-recenter-region (sldb-frame-region))))) (defun sldb-frame-region () (save-excursion @@ -8711,9 +8726,10 @@ (defun sldb-frame-locals (frame) (slime-eval `(swank:frame-locals-for-emacs ,frame))) -(defun sldb-insert-locals (frame prefix) - (loop for i from 0 - for var in (sldb-frame-locals frame) do +(defun* sldb-insert-locals (frame prefix &optional (vars (sldb-frame-locals frame))) + (loop for i from 0 + for var in vars do + (newline) (destructuring-bind (&key name id value) var (slime-propertize-region (list 'sldb-default-action 'sldb-inspect-var 'var i) @@ -8723,8 +8739,7 @@ (insert " = ") (slime-insert-presentation (in-sldb-face local-value value) - `(:frame-var ,frame ,i))) - (newline)))) + `(:frame-var ,frame ,i)))))) (defun sldb-inspect-var () (let ((frame (sldb-frame-number-at-point)) @@ -11268,6 +11283,7 @@ slime-print-apropos slime-show-note-counts slime-insert-propertized + slime-insert-possibly-as-rectangle slime-tree-insert slime-enclosing-operator-names))) From alendvai at common-lisp.net Thu Jan 4 16:36:28 2007 From: alendvai at common-lisp.net (alendvai) Date: Thu, 4 Jan 2007 11:36:28 -0500 (EST) Subject: [slime-cvs] CVS slime Message-ID: <20070104163628.EBA9A24007@common-lisp.net> Update of /project/slime/cvsroot/slime In directory clnet:/tmp/cvs-serv7576 Modified Files: ChangeLog Log Message: changelog --- /project/slime/cvsroot/slime/ChangeLog 2007/01/03 11:44:50 1.1034 +++ /project/slime/cvsroot/slime/ChangeLog 2007/01/04 16:36:28 1.1035 @@ -1,3 +1,14 @@ +2007-01-04 Attila Lendvai + + * slime.el: Added slime-insert-possibly-as-rectangle and use it + when inserting things here and there. The effect of this is that + multi-line strings coming from swank (e.g. stuff in sldb) are + inserted with insert-rectangle, so they are properly indented. + + * swank.lisp: FIX: sort is destructive, call copy-seq at a few + places. FIX: bind *sldb-printer-bindings* also in + frame-locals-for-emacs. + 2007-01-03 Attila Lendvai * swank.lisp: FIX: drop extra "Slots: " from standard-object's From alendvai at common-lisp.net Fri Jan 5 16:27:36 2007 From: alendvai at common-lisp.net (alendvai) Date: Fri, 5 Jan 2007 11:27:36 -0500 (EST) Subject: [slime-cvs] CVS slime Message-ID: <20070105162736.29FB39@common-lisp.net> Update of /project/slime/cvsroot/slime In directory clnet:/tmp/cvs-serv1526 Modified Files: slime.el swank.lisp Log Message: FIX: slime-insert-possibly-as-rectange and sldb stuff on newer emacsen --- /project/slime/cvsroot/slime/slime.el 2007/01/04 16:30:09 1.733 +++ /project/slime/cvsroot/slime/slime.el 2007/01/05 16:27:35 1.734 @@ -3030,9 +3030,12 @@ (let ((lines (split-string string "\n"))) (when (rest lines) (save-excursion - (dotimes (i (1- (length lines))) + (dotimes (i (length lines)) (newline)))) - (insert-rectangle lines)))))) + (insert-rectangle lines) + (when (rest lines) + (forward-char 1) + (delete-backward-char 1))))))) (defun slime-insert-presentation (string output-id) (cond ((not slime-repl-enable-presentations) @@ -8428,15 +8431,19 @@ (defun sldb-insert-frame (frame &optional detailedp) (destructuring-bind (number string) frame - (let ((props `(frame ,frame sldb-default-action sldb-toggle-details))) - (save-excursion - (slime-insert-propertized props "\n")) + (let ((props `(frame ,frame sldb-default-action sldb-toggle-details)) + (frame-end-marker (point-marker))) + (set-marker-insertion-type frame-end-marker t) (slime-propertize-region props + (save-excursion + (newline)) (insert " " (in-sldb-face frame-label (format "%2d:" number)) " ") (slime-insert-possibly-as-rectangle (if detailedp (in-sldb-face detailed-frame-line string) - (in-sldb-face frame-line string))))))) + (in-sldb-face frame-line string))) + (goto-char frame-end-marker)) + (set-marker frame-end-marker nil)))) (defun sldb-insert-frames (frames maximum-length) "Insert FRAMES into buffer. @@ -8445,10 +8452,7 @@ (when maximum-length (assert (<= (length frames) maximum-length))) (save-excursion - (mapc (lambda (frame) - (sldb-insert-frame frame) - (newline)) - frames) + (mapc #'sldb-insert-frame frames) (let ((number (sldb-previous-frame-number))) (cond ((and maximum-length (< (length frames) maximum-length))) (t @@ -8596,28 +8600,41 @@ (sldb-catch-tags frame-number))) (local-vars (sldb-frame-locals frame-number))) (if (or catch-tags local-vars) - (multiple-value-bind (start end) (sldb-frame-region) - (save-excursion - (goto-char start) + (save-excursion + (multiple-value-bind (start end) (sldb-frame-region) (let* ((standard-output (current-buffer)) (indent1 " ") (indent2 " ")) (delete-region start end) + (goto-char start) (slime-propertize-region `(frame ,frame details-visible-p t) (sldb-insert-frame frame t) (when local-vars - (insert "\n" indent1 (in-sldb-face section "Locals:")) + (insert indent1 (in-sldb-face section "Locals:")) (sldb-insert-locals frame-number indent2 local-vars)) (when catch-tags - (insert "\n" indent1 (in-sldb-face section "Catch-tags:")) + (when local-vars + (insert "\n")) + (insert indent1 (in-sldb-face section "Catch-tags:")) (dolist (tag catch-tags) (slime-insert-propertized '(catch-tag ,tag) "\n" indent2 - (in-sldb-face catch-tag (format "%s" tag))))))))) + (in-sldb-face catch-tag (format "%s" tag))))) + (newline))))) (message "Nothing to display") (apply #'sldb-maybe-recenter-region (sldb-frame-region))))) +(defun sldb-hide-frame-details () + (save-excursion + (multiple-value-bind (start end) (sldb-frame-region) + (goto-char start) + (let* ((props (text-properties-at (point))) + (frame (plist-get props 'frame))) + (delete-region start end) + (slime-propertize-region (plist-put props 'details-visible-p nil) + (sldb-insert-frame frame)))))) + (defun sldb-frame-region () (save-excursion (goto-char (next-single-property-change (point) 'frame nil (point-max))) @@ -8635,16 +8652,6 @@ (recenter (max (- (window-height) lines 4) 0))) (t (recenter 1))))))) -(defun sldb-hide-frame-details () - (save-excursion - (multiple-value-bind (start end) (sldb-frame-region) - (goto-char start) - (let* ((props (text-properties-at (point))) - (frame (plist-get props 'frame))) - (delete-region start end) - (slime-propertize-region (plist-put props 'details-visible-p nil) - (sldb-insert-frame frame)))))) - (defun sldb-eval-in-frame (string) "Prompt for an expression and evaluate it in the selected frame." --- /project/slime/cvsroot/slime/swank.lisp 2007/01/04 16:27:05 1.450 +++ /project/slime/cvsroot/slime/swank.lisp 2007/01/05 16:27:35 1.451 @@ -4487,7 +4487,6 @@ (not (string= value-string ""))) (setf (swank-mop:slot-value-using-class class object slot) (eval (read-from-string value-string)))))))) - " " ,@(when boundp `(" " (:action "[make unbound]" ,(lambda () (swank-mop:slot-makunbound-using-class class object slot))))))))) @@ -4667,7 +4666,8 @@ (values "A package." `("Name: " (:value ,(package-name package)) (:newline) - "Nick names: " ,@(common-seperated-spec (sort (package-nicknames package) #'string-lessp)) + "Nick names: " ,@(common-seperated-spec (sort (copy-seq (package-nicknames package)) + #'string-lessp)) (:newline) ,@(when (documentation package t) `("Documentation:" (:newline) From alendvai at common-lisp.net Sat Jan 6 12:59:09 2007 From: alendvai at common-lisp.net (alendvai) Date: Sat, 6 Jan 2007 07:59:09 -0500 (EST) Subject: [slime-cvs] CVS slime Message-ID: <20070106125909.BCFCE111CC@common-lisp.net> Update of /project/slime/cvsroot/slime In directory clnet:/tmp/cvs-serv8135 Modified Files: slime.el Log Message: Added set-keymap-parents when not available (GNU Emacs). Result: slime bindings while reading expressions from the minibuffer. --- /project/slime/cvsroot/slime/slime.el 2007/01/05 16:27:35 1.734 +++ /project/slime/cvsroot/slime/slime.el 2007/01/06 12:59:09 1.735 @@ -1044,16 +1044,27 @@ ;;;; Emacs compatibility +;;; Stuff only available in XEmacs (or (fboundp 'add-local-hook) (defun add-local-hook (hook function &optional append) (make-local-hook hook) (add-hook hook function append t))) (or (fboundp 'remove-local-hook) - (defun remove-local-hook (hook function) - (if (local-variable-p hook (current-buffer)) - (remove-hook hook function t)))) - + (defun remove-local-hook (hook function) + (if (local-variable-p hook (current-buffer)) + (remove-hook hook function t)))) + +(or (fboundp 'set-keymap-parents) + (defun set-keymap-parents (m parents) + (set-keymap-parent + m + (cond + ((not (consp parents)) parents) + ((not (cdr parents)) (car parents)) + (t (let ((m (copy-keymap (pop parents)))) + (set-keymap-parents m parents) + m)))))) ;;;; Setup initial `slime-mode' hooks @@ -4641,9 +4652,10 @@ ;;;; Scratch -(defvar slime-scratch-mode-map) -(setq slime-scratch-mode-map (make-sparse-keymap)) -(set-keymap-parent slime-scratch-mode-map lisp-mode-map) +(defvar slime-scratch-mode-map + (let ((map (make-sparse-keymap))) + (set-keymap-parent map slime-mode-map) + map)) (defun slime-scratch-buffer () "Return the scratch buffer, create it if necessary." @@ -6259,12 +6271,7 @@ (defvar slime-read-expression-map (let ((map (make-sparse-keymap))) - (if (fboundp 'set-keymap-parents) ; xemacs only at the time of writing - (set-keymap-parents map (list minibuffer-local-map slime-mode-map)) - (progn - (set-keymap-parent map minibuffer-local-map) - (define-key map (kbd "\t") 'slime-complete-symbol) - (define-key map (kbd "\M-\t") 'slime-complete-symbol))) + (set-keymap-parents map (list minibuffer-local-map slime-mode-map)) map) "Minibuffer keymap used for reading CL expressions.") @@ -8621,9 +8628,9 @@ "\n" indent2 (in-sldb-face catch-tag (format "%s" tag))))) - (newline))))) - (message "Nothing to display") - (apply #'sldb-maybe-recenter-region (sldb-frame-region))))) + (newline)))) + (apply #'sldb-maybe-recenter-region (sldb-frame-region))) + (message "Nothing to display")))) (defun sldb-hide-frame-details () (save-excursion From alendvai at common-lisp.net Sat Jan 6 13:03:15 2007 From: alendvai at common-lisp.net (alendvai) Date: Sat, 6 Jan 2007 08:03:15 -0500 (EST) Subject: [slime-cvs] CVS slime Message-ID: <20070106130315.F2E0F3601E@common-lisp.net> Update of /project/slime/cvsroot/slime In directory clnet:/tmp/cvs-serv12797 Modified Files: ChangeLog Log Message: changelog --- /project/slime/cvsroot/slime/ChangeLog 2007/01/04 16:36:28 1.1035 +++ /project/slime/cvsroot/slime/ChangeLog 2007/01/06 13:03:07 1.1036 @@ -1,3 +1,12 @@ +2007-01-06 Attila Lendvai + + * slime.el: Added set-keymap-parents when not available (GNU + Emacs). Result: slime bindings while reading expressions from the + minibuffer. + + * slime.el, swank.lisp: FIX: slime-insert-possibly-as-rectange and + sldb stuff on newer emacsen + 2007-01-04 Attila Lendvai * slime.el: Added slime-insert-possibly-as-rectangle and use it From heller at common-lisp.net Sun Jan 7 11:43:32 2007 From: heller at common-lisp.net (heller) Date: Sun, 7 Jan 2007 06:43:32 -0500 (EST) Subject: [slime-cvs] CVS slime Message-ID: <20070107114332.9980A3E054@common-lisp.net> Update of /project/slime/cvsroot/slime In directory clnet:/tmp/cvs-serv12958 Modified Files: swank.lisp Log Message: (open-streams): Don't pass nil to make-fn-streams; use a dummy function as workaround. Both arguments must be functions and CMUCL checks the types. --- /project/slime/cvsroot/slime/swank.lisp 2007/01/05 16:27:35 1.451 +++ /project/slime/cvsroot/slime/swank.lisp 2007/01/07 11:43:32 1.452 @@ -537,7 +537,10 @@ (let* ((repl-results-fn (make-output-function-for-target connection :repl-result)) (repl-results - (nth-value 1 (make-fn-streams nil repl-results-fn)))) + (nth-value 1 (make-fn-streams + (lambda () + (error "Should never be called")) + repl-results-fn)))) (values dedicated-output in out io repl-results)))))))) (defun make-output-function (connection) From heller at common-lisp.net Sun Jan 7 11:45:46 2007 From: heller at common-lisp.net (heller) Date: Sun, 7 Jan 2007 06:45:46 -0500 (EST) Subject: [slime-cvs] CVS slime Message-ID: <20070107114546.616E349050@common-lisp.net> Update of /project/slime/cvsroot/slime In directory clnet:/tmp/cvs-serv13143 Modified Files: ChangeLog Log Message: *** empty log message *** --- /project/slime/cvsroot/slime/ChangeLog 2007/01/06 13:03:07 1.1036 +++ /project/slime/cvsroot/slime/ChangeLog 2007/01/07 11:45:46 1.1037 @@ -1,3 +1,9 @@ +2007-01-07 Helmut Eller + + * swank.lisp (open-streams): Don't pass nil to make-fn-streams; + use a dummy function as workaround. Both arguments must be + functions and CMUCL checks the types. + 2007-01-06 Attila Lendvai * slime.el: Added set-keymap-parents when not available (GNU From jsnellman at common-lisp.net Tue Jan 9 03:36:15 2007 From: jsnellman at common-lisp.net (jsnellman) Date: Mon, 8 Jan 2007 22:36:15 -0500 (EST) Subject: [slime-cvs] CVS slime Message-ID: <20070109033615.C5EB921013@common-lisp.net> Update of /project/slime/cvsroot/slime In directory clnet:/tmp/cvs-serv12008 Modified Files: swank-sbcl.lisp Log Message: SBCL 1.0.1.15 supports restart-frame natively, and uses a different debug catch tag interface than earlier versions. * swank-sbcl (sbcl-with-restart-frame): New function, detects SBCL 1.0.1.15 or later. (return-from-frame): Another version for 1.0.1.15, using sb-debug:unwind-to-frame-and-call (restart-frame): Another version for 1.0.1.15, using sb-debug:unwind-to-frame-and-call --- /project/slime/cvsroot/slime/swank-sbcl.lisp 2006/12/19 10:47:36 1.173 +++ /project/slime/cvsroot/slime/swank-sbcl.lisp 2007/01/09 03:36:15 1.174 @@ -29,18 +29,23 @@ ;; with #+. (defun sbcl-with-new-stepper-p () (if (find-symbol "ENABLE-STEPPING" "SB-IMPL") - '(and) - '(or))) + '(:and) + '(:or))) ;; Ditto for weak hash-tables (defun sbcl-with-weak-hash-tables () (if (find-symbol "HASH-TABLE-WEAKNESS" "SB-EXT") - '(and) - '(or))) + '(:and) + '(:or))) ;; And for xref support (1.0.1) (defun sbcl-with-xref-p () (if (find-symbol "WHO-CALLS" "SB-INTROSPECT") - '(and) - '(or)))) + '(:and) + '(:or))) + ;; ... for restart-frame support (1.0.2) + (defun sbcl-with-restart-frame () + (if (find-symbol "FRAME-HAS-DEBUG-TAG-P" "SB-DEBUG") + '(:and) + '(:or)))) ;;; swank-mop @@ -875,24 +880,49 @@ (sb-di:frame-code-location frame))) frame))) -(defun sb-debug-catch-tag-p (tag) - (and (symbolp tag) - (not (symbol-package tag)) - (string= tag :sb-debug-catch-tag))) - -(defimplementation return-from-frame (index form) - (let* ((frame (nth-frame index)) - (probe (assoc-if #'sb-debug-catch-tag-p - (sb-di::frame-catches frame)))) - (cond (probe (throw (car probe) (eval-in-frame form index))) - (t (format nil "Cannot return from frame: ~S" frame))))) +#+#.(swank-backend::sbcl-with-restart-frame) +(progn + (defimplementation return-from-frame (index form) + (let* ((frame (nth-frame index))) + (cond ((sb-debug:frame-has-debug-tag-p frame) + (let ((values (multiple-value-list (eval-in-frame form index)))) + (sb-debug:unwind-to-frame-and-call frame + (lambda () + (values-list values))))) + (t (format nil "Cannot return from frame: ~S" frame))))) + + (defimplementation restart-frame (index) + (let* ((frame (nth-frame index))) + (cond ((sb-debug:frame-has-debug-tag-p frame) + (let* ((call-list (sb-debug::frame-call-as-list frame)) + (fun (fdefinition (car call-list))) + (thunk (lambda () + ;; Ensure that the thunk gets tail-call-optimized + (declare (optimize (debug 1))) + (apply fun (cdr call-list))))) + (sb-debug:unwind-to-frame-and-call frame thunk))) + (t (format nil "Cannot restart frame: ~S" frame)))))) ;; FIXME: this implementation doesn't unwind the stack before ;; re-invoking the function, but it's better than no implementation at ;; all. -(defimplementation restart-frame (index) - (let ((frame (nth-frame index))) - (return-from-frame index (sb-debug::frame-call-as-list frame)))) +#-#.(swank-backend::sbcl-with-restart-frame) +(progn + (defun sb-debug-catch-tag-p (tag) + (and (symbolp tag) + (not (symbol-package tag)) + (string= tag :sb-debug-catch-tag))) + + (defimplementation return-from-frame (index form) + (let* ((frame (nth-frame index)) + (probe (assoc-if #'sb-debug-catch-tag-p + (sb-di::frame-catches frame)))) + (cond (probe (throw (car probe) (eval-in-frame form index))) + (t (format nil "Cannot return from frame: ~S" frame))))) + + (defimplementation restart-frame (index) + (let ((frame (nth-frame index))) + (return-from-frame index (sb-debug::frame-call-as-list frame))))) ;;;;; reference-conditions From heller at common-lisp.net Tue Jan 9 20:19:56 2007 From: heller at common-lisp.net (heller) Date: Tue, 9 Jan 2007 15:19:56 -0500 (EST) Subject: [slime-cvs] CVS slime Message-ID: <20070109201956.DC25E4717F@common-lisp.net> Update of /project/slime/cvsroot/slime In directory clnet:/tmp/cvs-serv21212 Modified Files: slime.el Log Message: (slime-repl-merge-histories): Use (setf (gethash ...) instead of puthash, for Emacs 20. --- /project/slime/cvsroot/slime/slime.el 2007/01/06 12:59:09 1.735 +++ /project/slime/cvsroot/slime/slime.el 2007/01/09 20:19:56 1.736 @@ -4189,15 +4189,12 @@ "Merge entries from OLD-HIST and NEW-HIST." ;; Newer items in each list are at the beginning. (let* ((ht (make-hash-table :test #'equal)) - (delete-tester #'(lambda (entry) - (if (gethash entry ht) - t - (progn - (puthash entry t ht) - nil))))) - (append - (remove-if delete-tester new-hist) - (remove-if delete-tester old-hist)))) + (test (lambda (entry) + (or (gethash entry ht) + (progn (setf (gethash entry ht) t) + nil))))) + (append (remove-if test new-hist) + (remove-if test old-hist)))) (defun slime-repl-load-history (&optional filename) "Set the current SLIME REPL history. From alendvai at common-lisp.net Wed Jan 10 09:42:48 2007 From: alendvai at common-lisp.net (alendvai) Date: Wed, 10 Jan 2007 04:42:48 -0500 (EST) Subject: [slime-cvs] CVS slime Message-ID: <20070110094248.594EB4F00F@common-lisp.net> Update of /project/slime/cvsroot/slime In directory clnet:/tmp/cvs-serv10911 Modified Files: ChangeLog slime.el Log Message: FIX: set-keymap-parents for GNU Emacs was bogus, fixed by Ariel Badichi. --- /project/slime/cvsroot/slime/ChangeLog 2007/01/07 11:45:46 1.1037 +++ /project/slime/cvsroot/slime/ChangeLog 2007/01/10 09:42:47 1.1038 @@ -1,3 +1,8 @@ +2007-01-010 Attila Lendvai + + * slime.el: FIX: set-keymap-parents for GNU Emacs was bogus, fixed + by Ariel Badichi. + 2007-01-07 Helmut Eller * swank.lisp (open-streams): Don't pass nil to make-fn-streams; --- /project/slime/cvsroot/slime/slime.el 2007/01/09 20:19:56 1.736 +++ /project/slime/cvsroot/slime/slime.el 2007/01/10 09:42:47 1.737 @@ -1060,7 +1060,7 @@ (set-keymap-parent m (cond - ((not (consp parents)) parents) + ((or (keymapp parents) (not (consp parents))) parents) ((not (cdr parents)) (car parents)) (t (let ((m (copy-keymap (pop parents)))) (set-keymap-parents m parents) From heller at common-lisp.net Wed Jan 10 15:24:07 2007 From: heller at common-lisp.net (heller) Date: Wed, 10 Jan 2007 10:24:07 -0500 (EST) Subject: [slime-cvs] CVS slime Message-ID: <20070110152407.C53CA3E057@common-lisp.net> Update of /project/slime/cvsroot/slime In directory clnet:/tmp/cvs-serv8789 Modified Files: swank.lisp Log Message: (*sldb-printer-bindings*): Add *print-right-margin*. (debug-in-emacs): Bind *sldb-printer-bindings* here. (backtrace, debugger-info-for-emacs, frame-locals-for-emacs): And remove redundant bindings here. These functions are all called in the dynamic extend of debug-in-emacs. --- /project/slime/cvsroot/slime/swank.lisp 2007/01/07 11:43:32 1.452 +++ /project/slime/cvsroot/slime/swank.lisp 2007/01/10 15:24:07 1.453 @@ -102,7 +102,8 @@ (*print-radix* . nil) (*print-array* . t) (*print-lines* . 10) - (*print-escape* . t)) + (*print-escape* . t) + (*print-right-margin* . 70)) "A set of printer variables used in the debugger.") (defvar *default-worker-thread-bindings* '() @@ -270,7 +271,7 @@ (defun make-swank-error (condition) (let ((bt (ignore-errors (call-with-debugging-environment - (lambda ()(backtrace 0 nil)))))) + (lambda () (backtrace 0 nil)))))) (make-condition 'swank-error :condition condition :backtrace bt))) (add-hook *new-connection-hook* 'notify-backend-of-connection) @@ -2808,7 +2809,9 @@ (*swank-state-stack* (cons :swank-debugger-hook *swank-state-stack*))) (force-user-output) (call-with-debugging-environment - (lambda () (sldb-loop *sldb-level*))))) + (lambda () + (with-bindings *sldb-printer-bindings* + (sldb-loop *sldb-level*)))))) (defun sldb-loop (level) (unwind-protect @@ -2871,13 +2874,10 @@ (defslimefun backtrace (start end) "Return a list ((I FRAME) ...) of frames from START to END. I is an integer describing and FRAME a string." - (with-bindings *sldb-printer-bindings* - ;; we don't want newlines in the backtrace, that makes it unreadable - (let ((*print-right-margin* most-positive-fixnum)) - (loop for frame in (compute-backtrace start end) - for i from start - collect (list i (with-output-to-string (stream) - (print-frame frame stream))))))) + (loop for frame in (compute-backtrace start end) + for i from start + collect (list i (with-output-to-string (stream) + (print-frame frame stream))))) (defslimefun debugger-info-for-emacs (start end) "Return debugger state, with stack frames from START to END. @@ -2910,11 +2910,10 @@ (\"ABORT\" \"Return to Top-Level.\")) ((0 \"(KERNEL::INTEGER-/-INTEGER 1 0)\")) (4))" - (with-bindings *sldb-printer-bindings* - (list (debugger-condition-for-emacs) - (format-restarts-for-emacs) - (backtrace start end) - *pending-continuations*))) + (list (debugger-condition-for-emacs) + (format-restarts-for-emacs) + (backtrace start end) + *pending-continuations*)) (defun nth-restart (index) (nth index *sldb-restarts*)) @@ -2960,12 +2959,11 @@ (defslimefun frame-locals-for-emacs (index) "Return a property list ((&key NAME ID VALUE) ...) describing the local variables in the frame INDEX." - (with-bindings *sldb-printer-bindings* - (mapcar (lambda (frame-locals) - (destructuring-bind (&key name id value) frame-locals - (list :name (prin1-to-string name) :id id - :value (to-string value)))) - (frame-locals index)))) + (mapcar (lambda (frame-locals) + (destructuring-bind (&key name id value) frame-locals + (list :name (prin1-to-string name) :id id + :value (to-string value)))) + (frame-locals index))) (defslimefun frame-catch-tags-for-emacs (frame-index) (mapcar #'to-string (frame-catch-tags frame-index))) From heller at common-lisp.net Wed Jan 10 15:25:58 2007 From: heller at common-lisp.net (heller) Date: Wed, 10 Jan 2007 10:25:58 -0500 (EST) Subject: [slime-cvs] CVS slime Message-ID: <20070110152558.718BC3F00D@common-lisp.net> Update of /project/slime/cvsroot/slime In directory clnet:/tmp/cvs-serv9246 Modified Files: ChangeLog Log Message: *** empty log message *** --- /project/slime/cvsroot/slime/ChangeLog 2007/01/10 09:42:47 1.1038 +++ /project/slime/cvsroot/slime/ChangeLog 2007/01/10 15:25:58 1.1039 @@ -1,8 +1,20 @@ -2007-01-010 Attila Lendvai +2007-01-10 Helmut Eller + + * swank.lisp (*sldb-printer-bindings*): Add *print-right-margin*. + (debug-in-emacs): Bind *sldb-printer-bindings* here ... + (backtrace, debugger-info-for-emacs, frame-locals-for-emacs): + ... and remove redundant bindings here. + +2007-01-10 Attila Lendvai * slime.el: FIX: set-keymap-parents for GNU Emacs was bogus, fixed by Ariel Badichi. +2007-01-09 Helmut Eller + + * slime.el (slime-repl-merge-histories): Use (setf (gethash ...) + instead of puthash, for Emacs 20. + 2007-01-07 Helmut Eller * swank.lisp (open-streams): Don't pass nil to make-fn-streams; From heller at common-lisp.net Wed Jan 10 23:50:49 2007 From: heller at common-lisp.net (heller) Date: Wed, 10 Jan 2007 18:50:49 -0500 (EST) Subject: [slime-cvs] CVS slime Message-ID: <20070110235049.C0B2656010@common-lisp.net> Update of /project/slime/cvsroot/slime In directory clnet:/tmp/cvs-serv27288 Modified Files: slime.el Log Message: Some cleanups for the debugger code: add some outline sections and docstrings. (sldb-setup): Always display the beginning of the condition text. Previously, we always showed the beginning of the backtrace. (sldb-prune-initial-frames): Do what the docstring says. Reverted to Luke's version. (sldb-dispatch-extras): Fix typo. (sldb-insert-restarts, sldb-insert-frames) (sldb-insert-frame, sldb-fetch-more-frames) (sldb-toggle-details, sldb-show-frame-details) (sldb-insert-locals): Simplified. (sldb-frame-details): New. (slime-save-coordinates, slime-coordinates) (slime-restore-coordinate, slime-count-lines): New macro and its helpers. (sldb-recenter-region): Renamed from slime-maybe-recenter-region. (sldb-enable-styled-backtrace, sldb-show-catch-tags) (sldb-highlight): Deleted. Seem to be obsolete. (sldb-add-face): Removed, because it is now the same as slime-add-face. (sldb-help-summary): Deleted. The docstring for sldb-mode is already pretty terse. (define-sldb-face): Renamed from def-sldb-face. --- /project/slime/cvsroot/slime/slime.el 2007/01/10 09:42:47 1.737 +++ /project/slime/cvsroot/slime/slime.el 2007/01/10 23:50:49 1.738 @@ -382,35 +382,23 @@ :prefix "sldb-" :group 'slime) -(defcustom sldb-enable-styled-backtrace t "Enable faces in slime backtrace" - :type '(choice - (const :tag "Enable" t) - (const :tag "Disable" nil)) - :group 'slime-debugger) - -(defcustom sldb-show-catch-tags t "Show catch tags in frames" - :type '(choice - (const :tag "Show" t) - (const :tag "Don't show" nil)) - :group 'slime-debugger) - -(defmacro def-sldb-faces (&rest faces) +(defmacro define-sldb-faces (&rest faces) "Define the set of SLDB faces. Each face specifiation is (NAME DESCRIPTION &optional PROPERTIES). NAME is a symbol; the face will be called sldb-NAME-face. DESCRIPTION is a one-liner for the customization buffer. PROPERTIES specifies any default face properties." `(progn ,@(loop for face in faces - collect `(def-sldb-face , at face)))) + collect `(define-sldb-face , at face)))) -(defmacro def-sldb-face (name description &optional default) +(defmacro define-sldb-face (name description &optional default) (let ((facename (intern (format "sldb-%s-face" (symbol-name name))))) `(defface ,facename (list (list t ,default)) ,(format "Face for %s." description) :group 'slime-debugger))) -(def-sldb-faces +(define-sldb-faces (topline "the top line describing the error") (condition "the condition class") (section "the labels of major sections in the debugger buffer") @@ -996,7 +984,6 @@ [ "Next Frame" sldb-down t ] [ "Previous Frame" sldb-up t ] [ "Toggle Frame Details" sldb-toggle-details t ] - [ "List Locals" sldb-list-locals ,C ] [ "Next Frame (Details)" sldb-details-down t ] [ "Previous Frame (Details)" sldb-details-up t ] "--" @@ -8034,46 +8021,46 @@ (defvar sldb-hook nil "Hook run on entry to the debugger.") -(defun slime-add-face (face string) - (add-text-properties 0 (length string) (list 'face face) string) - string) - -(defmacro in-sldb-face (name string) - "Return STRING propertised with face sldb-NAME-face. -If `sldb-enable-styled-backtrace' is nil, just return STRING." - (let ((facename (intern (format "sldb-%s-face" (symbol-name name)))) - (var (gensym "string"))) - `(let ((,var ,string)) - (sldb-add-face ',facename ,var) - ,var))) - ;;;;; Local variables in the debugger buffer -(make-variable-buffer-local +(slime-make-variables-buffer-local (defvar sldb-condition nil - "List of (DESCRIPTION TYPE) strings describing the condition being debugged.")) + "A list (DESCRIPTION TYPE) describing the condition being debugged.") -(make-variable-buffer-local (defvar sldb-saved-window-configuration nil - "Window configuration before the debugger was initially entered.")) + "Window configuration before the debugger was initially entered.") -(make-variable-buffer-local (defvar sldb-restarts nil - "List of (NAME DESCRIPTION) for each available restart.")) + "List of (NAME DESCRIPTION) for each available restart.") -(make-variable-buffer-local (defvar sldb-level nil - "Current debug level (recursion depth) displayed in buffer.")) + "Current debug level (recursion depth) displayed in buffer.") -(make-variable-buffer-local (defvar sldb-backtrace-start-marker nil - "Marker placed at the beginning of the backtrace text.")) + "Marker placed at the beginning of the backtrace text.") -(make-variable-buffer-local (defvar sldb-continuations nil "List of ids for pending continuation.")) - + +;;;;; SLDB macros + +;; some macros that we need to define before the first use + +(defmacro in-sldb-face (name string) + "Return STRING propertised with face sldb-NAME-face." + (let ((facename (intern (format "sldb-%s-face" (symbol-name name)))) + (var (gensym "string"))) + `(let ((,var ,string)) + (slime-add-face ',facename ,var) + ,var))) + +(put 'in-sldb-face 'lisp-indent-function 1) + +(defun slime-add-face (face string) + (add-text-properties 0 (length string) (list 'face face) string) + string) + ;;;;; sldb-mode @@ -8090,7 +8077,7 @@ table) "Syntax table for SLDB mode.") -(define-derived-mode sldb-mode fundamental-mode "sldb" +(define-derived-mode sldb-mode fundamental-mode "sldb" "Superior lisp debugger mode. In addition to ordinary SLIME commands, the following are available:\\ @@ -8101,7 +8088,6 @@ \\[sldb-pprint-eval-in-frame] - eval in frame, pretty-print result \\[sldb-disassemble] - disassemble \\[sldb-inspect-in-frame] - inspect - \\[sldb-list-locals] - list locals Commands to invoke restarts: \\[sldb-quit] - quit @@ -8128,37 +8114,13 @@ (erase-buffer) (set-syntax-table sldb-mode-syntax-table) (slime-set-truncate-lines) - (when slime-use-autodoc-mode + (when slime-use-autodoc-mode (slime-autodoc-mode 1)) ;; 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)) -(defun sldb-help-summary () - "Show summary of important sldb commands" - (interactive) - (message - (mapconcat - #'(lambda (list) - (destructuring-bind (cmd letter name name-with-letter) list - (let ((where-is (where-is-internal cmd sldb-mode-map))) - (if (or (member (vector (intern letter)) where-is) - (member (vector (string-to-char letter)) where-is)) - name-with-letter - (substitute-command-keys - (format "\\\\[%s] %s" cmd name)))))) - '((sldb-down "n" "next" "n-ext") - (sldb-up "p" "prev" "p-rev") - (sldb-toggle-details "t" "toggle details" "t-oggle details") - (sldb-eval-in-frame "e" "eval" "e-val") - (sldb-continue "c" "continue" "c-ontinue") - (sldb-abort "a" "abort" "a-bort") - (sldb-show-source "v" "view source" "v-iew source") - (describe-mode "h" "help" "h-elp")) - ", "))) - -(slime-define-keys sldb-mode-map - ("?" 'sldb-help-summary) +(slime-define-keys sldb-mode-map ("h" 'describe-mode) ("v" 'sldb-show-source) ((kbd "RET") 'sldb-default-action) @@ -8212,7 +8174,7 @@ (defmacro define-sldb-invoke-restart-keys (from to) `(progn ,@(loop for n from from to to - collect `(define-sldb-invoke-restart-key ,n + collect `(define-sldb-invoke-restart-key ,n ,(number-to-string n))))) (define-sldb-invoke-restart-keys 0 9) @@ -8220,9 +8182,6 @@ ;;;;; SLDB buffer creation & update -(defvar sldb-overlays '() - "List of overlays created in source code buffers to highlight expressions.") - (defun sldb-buffers () "Return a list of all sldb buffers." (slime-filter-buffers (lambda () (eq major-mode 'sldb-mode)))) @@ -8236,7 +8195,7 @@ (sldb-buffers)))) (defun sldb-get-default-buffer () - "Get a sldb buffer. + "Get a sldb buffer. The buffer is chosen more or less randomly." (car (sldb-buffers))) @@ -8246,7 +8205,7 @@ (or (sldb-find-buffer thread connection) (let ((name (format "*sldb %s/%s*" (slime-connection-name) thread))) (with-current-buffer (generate-new-buffer name) - (setq slime-buffer-connection connection + (setq slime-buffer-connection connection slime-current-thread thread) (current-buffer)))))) @@ -8281,11 +8240,13 @@ (sldb-insert-condition condition) (insert "\n\n" (in-sldb-face section "Restarts:") "\n") (sldb-insert-restarts restarts) - (insert "\n\n" (in-sldb-face section "Backtrace:") "\n") + (insert "\n" (in-sldb-face section "Backtrace:") "\n") (setq sldb-backtrace-start-marker (point-marker)) - (sldb-insert-frames (sldb-prune-initial-frames frames) nil) + (save-excursion + (sldb-insert-frames (sldb-prune-initial-frames frames) t)) (run-hooks 'sldb-hook) (pop-to-buffer (current-buffer)) + (sldb-recenter-region (point-min) (point)) (setq buffer-read-only t) (when (and slime-stack-eval-tags ;; (y-or-n-p "Enter recursive edit? ") @@ -8294,6 +8255,8 @@ (recursive-edit))))) (defun sldb-activate (thread level) + "Display the debugger buffer for THREAD. +If LEVEL isn't the same as in the buffer, reinitialize the buffer." (unless (let ((b (sldb-find-buffer thread))) (and b (with-current-buffer b (equal sldb-level level)))) (slime-rex (thread level) @@ -8303,6 +8266,7 @@ (apply #'sldb-setup thread level result))))) (defun sldb-exit (thread level &optional stepping) + "Exit from the debug level LEVEL." (when-let (sldb (sldb-find-buffer thread)) (with-current-buffer sldb (unless stepping @@ -8314,13 +8278,17 @@ (kill-buffer sldb)))) (defun sldb-insert-condition (condition) + "Insert the text for CONDITION. +CONDITION should be a list (MESSAGE TYPE REFERENCES EXTRAS). +REFERENCES a references to additional documentation. +EXTRAS is currently used for the stepper." (destructuring-bind (message type references extras) condition (when (> (length message) 70) (add-text-properties 0 (length message) (list 'help-echo message) message)) (slime-insert-propertized '(sldb-default-action sldb-inspect-condition) (in-sldb-face topline message) - "\n" + "\n" (in-sldb-face condition type)) (when references (insert "See also:\n") @@ -8329,188 +8297,90 @@ (insert "\n")) (sldb-dispatch-extras extras))) -(defun sldb-insert-references (references) - "Insert documentation references from a condition. -See SWANK-BACKEND:CONDITION-REFERENCES for the datatype." - (loop for ref in references do - (destructuring-bind (where type what) ref - (insert (sldb-format-reference-source where) ", ") - (slime-insert-propertized (sldb-reference-properties ref) - (sldb-format-reference-node what)) - (insert (format " [%s]" (slime-cl-symbol-name type)) "\n")))) - -(defun sldb-reference-properties (reference) - "Return the properties for a reference. -Only add clickability to properties we actually know how to lookup." - (destructuring-bind (where type what) reference - (if (or (and (eq where :sbcl) (eq type :node)) - (and (eq where :ansi-cl) - (symbolp type) - (member (slime-cl-symbol-name type) - '("function" "special-operator" "macro" - "section" "glossary" "issue")))) - `(sldb-default-action - sldb-lookup-reference - ;; FIXME: this is a hack! slime-compiler-notes and sldb are a - ;; little too intimately entwined. - slime-compiler-notes-default-action sldb-lookup-reference - sldb-reference ,reference - face sldb-reference-face - mouse-face highlight)))) - -(defun sldb-format-reference-source (where) - (case where - (:amop "The Art of the Metaobject Protocol") - (:ansi-cl "Common Lisp Hyperspec") - (:sbcl "SBCL Manual") - (t (format "%S" where)))) - -(defun sldb-format-reference-node (what) - (if (symbolp what) - (upcase (slime-cl-symbol-name what)) - (if (listp what) - (mapconcat (lambda (x) (format "%S" x)) what ".") - what))) - -(defun sldb-lookup-reference () - "Browse the documentation reference at point." - (destructuring-bind (where type what) - (get-text-property (point) 'sldb-reference) - (case where - (:ansi-cl - (case type - (:section - (browse-url (funcall common-lisp-hyperspec-section-fun what))) - (:glossary - (browse-url (funcall common-lisp-glossary-fun what))) - (:issue - (browse-url (funcall 'common-lisp-issuex what))) - (t - (hyperspec-lookup (if (symbolp what) - (slime-cl-symbol-name what) - what))))) - (t - (let ((url (format "%s%s.html" slime-sbcl-manual-root - (subst-char-in-string ?\ ?\- what)))) - (browse-url url)))))) - (defun sldb-dispatch-extras (extras) + ;; this is (mis-)used for the stepper (dolist (extra extras) (destructure-case extra - ((:short-frame-source n) + ((:show-frame-source n) (sldb-show-frame-source n))))) - + (defun sldb-insert-restarts (restarts) + "Insert RESTARTS and add the needed text props +RESTARTS should be alist ((NAME DESCRIPTION) ...)." (loop for (name string) in restarts - for number from 0 - for first-time-p = t then nil - do (progn - (unless first-time-p - (newline)) - (slime-insert-propertized - `(restart-number ,number - sldb-default-action sldb-invoke-restart - mouse-face highlight) - " " - (in-sldb-face restart-number (number-to-string number)) - ": [" (in-sldb-face restart-type name) "] " - (in-sldb-face restart string))))) - -(defun sldb-add-face (face string) - (if sldb-enable-styled-backtrace - (add-text-properties 0 (length string) (list 'face face) string) - string)) + for number from 0 do + (insert " ") + (slime-insert-propertized + `(, at nil restart-number ,number + sldb-default-action sldb-invoke-restart + mouse-face highlight) + (in-sldb-face restart-number (number-to-string number)) + ": [" (in-sldb-face restart-type name) "] " + (in-sldb-face restart string)) + (insert "\n"))) (defun sldb-prune-initial-frames (frames) "Return the prefix of FRAMES to initially present to the user. Regexp heuristics are used to avoid showing SWANK-internal frames." - (or (loop with winner = -1 - for frame in frames - for idx from 0 - for (number string) = frame - while (string-match "^\\((\\|LAMBDA \\|lambda \\)*\\(SWANK\\|swank\\)\\>" string) - do (setf winner idx) - finally (return (subseq frames (1+ winner)))) - frames)) + (let* ((case-fold-search t) + (rx "^\\([() ]\\|lambda\\)*swank\\>")) + (or (loop for frame in frames + for (_ string) = frame + until (string-match rx string) + collect frame) + frames))) -(defun sldb-insert-frame (frame &optional detailedp) +(defun sldb-insert-frames (frames more) [779 lines skipped] From heller at common-lisp.net Wed Jan 10 23:53:47 2007 From: heller at common-lisp.net (heller) Date: Wed, 10 Jan 2007 18:53:47 -0500 (EST) Subject: [slime-cvs] CVS slime Message-ID: <20070110235347.B7F4830AE@common-lisp.net> Update of /project/slime/cvsroot/slime In directory clnet:/tmp/cvs-serv27498 Modified Files: swank-cmucl.lisp swank-sbcl.lisp Log Message: (condition-extras): Fix typo. --- /project/slime/cvsroot/slime/swank-cmucl.lisp 2006/12/14 16:08:35 1.169 +++ /project/slime/cvsroot/slime/swank-cmucl.lisp 2007/01/10 23:53:47 1.170 @@ -1711,7 +1711,7 @@ (typecase condition (breakpoint ;; pop up the source buffer - `((:short-frame-source 0))) + `((:show-frame-source 0))) (t '()))) (defun signal-breakpoint (breakpoint frame) --- /project/slime/cvsroot/slime/swank-sbcl.lisp 2007/01/09 03:36:15 1.174 +++ /project/slime/cvsroot/slime/swank-sbcl.lisp 2007/01/10 23:53:47 1.175 @@ -680,7 +680,7 @@ #+#.(swank-backend::sbcl-with-new-stepper-p) (defimplementation condition-extras (condition) (when (typep condition 'sb-impl::step-form-condition) - `((:short-frame-source 0)))) + `((:show-frame-source 0)))) (defimplementation call-with-debugging-environment (debugger-loop-fn) (declare (type function debugger-loop-fn)) From heller at common-lisp.net Wed Jan 10 23:55:04 2007 From: heller at common-lisp.net (heller) Date: Wed, 10 Jan 2007 18:55:04 -0500 (EST) Subject: [slime-cvs] CVS slime Message-ID: <20070110235504.4C94730B6@common-lisp.net> Update of /project/slime/cvsroot/slime In directory clnet:/tmp/cvs-serv27575 Modified Files: ChangeLog Log Message: --- /project/slime/cvsroot/slime/ChangeLog 2007/01/10 15:25:58 1.1039 +++ /project/slime/cvsroot/slime/ChangeLog 2007/01/10 23:55:04 1.1040 @@ -1,3 +1,38 @@ +2007-01-11 Helmut Eller + + * slime.el: Some cleanups for the debugger code: add some outline + sections and docstrings. + + (sldb-setup): Always display the beginning of the condition + text. Previously, we always showed the beginning of the backtrace. + + (sldb-prune-initial-frames): Do what the docstring says. Reverted + to Luke's version. + + (sldb-dispatch-extras): Fix typo. + + (sldb-insert-restarts, sldb-insert-frames) + (sldb-insert-frame, sldb-fetch-more-frames) + (sldb-toggle-details, sldb-show-frame-details) + (sldb-insert-locals): Simplified. + (sldb-frame-details): New. + + (slime-save-coordinates, slime-coordinates) + (slime-restore-coordinate, slime-count-lines): New macro and its + helpers. + (sldb-recenter-region): Renamed from slime-maybe-recenter-region. + + (sldb-enable-styled-backtrace, sldb-show-catch-tags) + (sldb-highlight): Deleted. Seem to be obsolete. + (sldb-add-face): Removed, because it is now the same as + slime-add-face. + + (sldb-help-summary): Deleted. The docstring for sldb-mode is + already pretty terse. + (define-sldb-face): Renamed from def-sldb-face. + + * swank-sbcl.lisp, swank-cmucl.lisp (condition-extras): Fix typo + 2007-01-10 Helmut Eller * swank.lisp (*sldb-printer-bindings*): Add *print-right-margin*. From mbaringer at common-lisp.net Thu Jan 11 16:30:41 2007 From: mbaringer at common-lisp.net (mbaringer) Date: Thu, 11 Jan 2007 11:30:41 -0500 (EST) Subject: [slime-cvs] CVS slime Message-ID: <20070111163041.267E35411F@common-lisp.net> Update of /project/slime/cvsroot/slime In directory clnet:/tmp/cvs-serv21388 Modified Files: slime.el Log Message: (slime-keys): Removed binding of M-, --- /project/slime/cvsroot/slime/slime.el 2007/01/10 23:50:49 1.738 +++ /project/slime/cvsroot/slime/slime.el 2007/01/11 16:30:40 1.739 @@ -760,7 +760,6 @@ ("\M-." slime-edit-definition :inferior t :sldb t) ("\C-x4." slime-edit-definition-other-window :inferior t :sldb t) ("\C-x5." slime-edit-definition-other-frame :inferior t :sldb t) - ("\M-," slime-pop-find-definition-stack :inferior t :sldb t) ("\M-*" slime-pop-find-definition-stack :inferior t :sldb t) ("\C-q" slime-close-parens-at-point :prefixed t :inferior t) ("\C-c\M-q" slime-reindent-defun :inferior t) From mbaringer at common-lisp.net Thu Jan 11 16:30:48 2007 From: mbaringer at common-lisp.net (mbaringer) Date: Thu, 11 Jan 2007 11:30:48 -0500 (EST) Subject: [slime-cvs] CVS slime Message-ID: <20070111163048.ECDB859082@common-lisp.net> Update of /project/slime/cvsroot/slime In directory clnet:/tmp/cvs-serv21426 Modified Files: swank.lisp Log Message: (inspect-for-emacs integer): Don't die if the integer can't be expressed as a float. (Patch by: Ariel Badichi ) --- /project/slime/cvsroot/slime/swank.lisp 2007/01/10 15:24:07 1.453 +++ /project/slime/cvsroot/slime/swank.lisp 2007/01/11 16:30:48 1.454 @@ -4760,8 +4760,8 @@ (declare (ignore inspector)) (values "A number." (append - `(,(format nil "Value: ~D = #x~8,'0X = #o~O = #b~,,' ,8:B = ~E" - i i i i i) + `(,(format nil "Value: ~D = #x~8,'0X = #o~O = #b~,,' ,8:B~@[ = ~E~]" + i i i i (ignore-errors (coerce i 'float))) (:newline)) (when (< -1 i char-code-limit) (label-value-line "Code-char" (code-char i))) From mbaringer at common-lisp.net Thu Jan 11 16:30:55 2007 From: mbaringer at common-lisp.net (mbaringer) Date: Thu, 11 Jan 2007 11:30:55 -0500 (EST) Subject: [slime-cvs] CVS slime Message-ID: <20070111163055.477FA6B543@common-lisp.net> Update of /project/slime/cvsroot/slime In directory clnet:/tmp/cvs-serv21457 Modified Files: ChangeLog Log Message: --- /project/slime/cvsroot/slime/ChangeLog 2007/01/10 23:55:04 1.1040 +++ /project/slime/cvsroot/slime/ChangeLog 2007/01/11 16:30:55 1.1041 @@ -1,3 +1,11 @@ +2007-01-11 Marco Baringer + + * swank.lisp (inspect-for-emacs integer): Don't die if the integer + can't be expressed as a float. (Patch by: Ariel Badichi + ) + + * slime.el (slime-keys): Removed binding of M-, + 2007-01-11 Helmut Eller * slime.el: Some cleanups for the debugger code: add some outline From jsnellman at common-lisp.net Thu Jan 11 17:33:22 2007 From: jsnellman at common-lisp.net (jsnellman) Date: Thu, 11 Jan 2007 12:33:22 -0500 (EST) Subject: [slime-cvs] CVS slime Message-ID: <20070111173322.19271391AA@common-lisp.net> Update of /project/slime/cvsroot/slime In directory clnet:/tmp/cvs-serv31346 Modified Files: ChangeLog slime.el Log Message: * slime.el (slime-read-expression-map): restore tab completion in the minibuffer. --- /project/slime/cvsroot/slime/ChangeLog 2007/01/11 16:30:55 1.1041 +++ /project/slime/cvsroot/slime/ChangeLog 2007/01/11 17:33:21 1.1042 @@ -1,3 +1,8 @@ +2007-01-11 Juho Snellman + + * slime.el (slime-read-expression-map): restore tab completion in + the minibuffer. + 2007-01-11 Marco Baringer * swank.lisp (inspect-for-emacs integer): Don't die if the integer @@ -58,6 +63,18 @@ * slime.el (slime-repl-merge-histories): Use (setf (gethash ...) instead of puthash, for Emacs 20. +2007-01-09 Juho Snellman + + SBCL 1.0.1.15 supports restart-frame natively, and uses a different + debug catch tag interface than earlier versions. + + * swank-sbcl (sbcl-with-restart-frame): New function, detects SBCL + 1.0.1.15 or later. + (return-from-frame): Another version for 1.0.1.15, using + sb-debug:unwind-to-frame-and-call + (restart-frame): Another version for 1.0.1.15, using + sb-debug:unwind-to-frame-and-call + 2007-01-07 Helmut Eller * swank.lisp (open-streams): Don't pass nil to make-fn-streams; --- /project/slime/cvsroot/slime/slime.el 2007/01/11 16:30:40 1.739 +++ /project/slime/cvsroot/slime/slime.el 2007/01/11 17:33:21 1.740 @@ -6255,6 +6255,8 @@ (defvar slime-read-expression-map (let ((map (make-sparse-keymap))) (set-keymap-parents map (list minibuffer-local-map slime-mode-map)) + (define-key map "\t" 'slime-complete-symbol) + (define-key map "\M-\t" 'slime-complete-symbol) map) "Minibuffer keymap used for reading CL expressions.") From jsnellman at common-lisp.net Thu Jan 11 17:48:06 2007 From: jsnellman at common-lisp.net (jsnellman) Date: Thu, 11 Jan 2007 12:48:06 -0500 (EST) Subject: [slime-cvs] CVS slime Message-ID: <20070111174806.09584391AC@common-lisp.net> Update of /project/slime/cvsroot/slime In directory clnet:/tmp/cvs-serv1625 Modified Files: ChangeLog slime.el Log Message: * slime.el (slime-read-expression-map): Switch the slime-mode-map and minibuffer-local-map around, so that the minibuffer binding for return takes precedence over the slime-mode one. --- /project/slime/cvsroot/slime/ChangeLog 2007/01/11 17:33:21 1.1042 +++ /project/slime/cvsroot/slime/ChangeLog 2007/01/11 17:48:05 1.1043 @@ -1,7 +1,9 @@ 2007-01-11 Juho Snellman * slime.el (slime-read-expression-map): restore tab completion in - the minibuffer. + the minibuffer. Switch the slime-mode-map and minibuffer-local-map + around, so that the minibuffer binding for return takes precedence + over the slime-mode one. 2007-01-11 Marco Baringer --- /project/slime/cvsroot/slime/slime.el 2007/01/11 17:33:21 1.740 +++ /project/slime/cvsroot/slime/slime.el 2007/01/11 17:48:05 1.741 @@ -6254,7 +6254,7 @@ (defvar slime-read-expression-map (let ((map (make-sparse-keymap))) - (set-keymap-parents map (list minibuffer-local-map slime-mode-map)) + (set-keymap-parents map (list slime-mode-map minibuffer-local-map)) (define-key map "\t" 'slime-complete-symbol) (define-key map "\M-\t" 'slime-complete-symbol) map) From eweitz at common-lisp.net Thu Jan 11 22:26:59 2007 From: eweitz at common-lisp.net (eweitz) Date: Thu, 11 Jan 2007 17:26:59 -0500 (EST) Subject: [slime-cvs] CVS slime Message-ID: <20070111222659.EFCFC2E1B7@common-lisp.net> Update of /project/slime/cvsroot/slime In directory clnet:/tmp/cvs-serv6705 Modified Files: ChangeLog slime.el Log Message: New REPL shortcuts by Kevin Rosenberg --- /project/slime/cvsroot/slime/ChangeLog 2007/01/11 17:48:05 1.1043 +++ /project/slime/cvsroot/slime/ChangeLog 2007/01/11 22:26:59 1.1044 @@ -1,3 +1,9 @@ +2007-01-11 Edi Weitz + + * slime.el (slime-repl-test-system, slime-repl-test/force-system): + New REPL shortcuts. Patch by Kevin Rosenberg + . + 2007-01-11 Juho Snellman * slime.el (slime-read-expression-map): restore tab completion in @@ -8,8 +14,8 @@ 2007-01-11 Marco Baringer * swank.lisp (inspect-for-emacs integer): Don't die if the integer - can't be expressed as a float. (Patch by: Ariel Badichi - ) + can't be expressed as a float. Patch by Ariel Badichi + . * slime.el (slime-keys): Removed binding of M-, --- /project/slime/cvsroot/slime/slime.el 2007/01/11 17:48:05 1.741 +++ /project/slime/cvsroot/slime/slime.el 2007/01/11 22:26:59 1.742 @@ -4570,6 +4570,18 @@ (slime-oos (slime-read-system-name) "LOAD-OP"))) (:one-liner "Compile (as needed) and load an ASDF system.")) +(defslime-repl-shortcut slime-repl-test/force-system ("force-test-system") + (:handler (lambda () + (interactive) + (slime-oos (slime-read-system-name) "TEST-OP" :force t))) + (:one-liner "Compile (as needed) and force test an ASDF system.")) + +(defslime-repl-shortcut slime-repl-test-system ("test-system") + (:handler (lambda () + (interactive) + (slime-oos (slime-read-system-name) "TEST-OP"))) + (:one-liner "Compile (as needed) and test an ASDF system.")) + (defslime-repl-shortcut slime-repl-compile-system ("compile-system") (:handler (lambda () (interactive) From mbaringer at common-lisp.net Thu Jan 11 23:37:05 2007 From: mbaringer at common-lisp.net (mbaringer) Date: Thu, 11 Jan 2007 18:37:05 -0500 (EST) Subject: [slime-cvs] CVS slime Message-ID: <20070111233705.C7E186B543@common-lisp.net> Update of /project/slime/cvsroot/slime In directory clnet:/tmp/cvs-serv19829 Modified Files: slime.el Log Message: (slime-keys): Remove binding of M-*, restore binding of M-,. --- /project/slime/cvsroot/slime/slime.el 2007/01/11 22:26:59 1.742 +++ /project/slime/cvsroot/slime/slime.el 2007/01/11 23:37:05 1.743 @@ -760,7 +760,7 @@ ("\M-." slime-edit-definition :inferior t :sldb t) ("\C-x4." slime-edit-definition-other-window :inferior t :sldb t) ("\C-x5." slime-edit-definition-other-frame :inferior t :sldb t) - ("\M-*" slime-pop-find-definition-stack :inferior t :sldb t) + ("\M-," slime-pop-find-definition-stack :inferior t :sldb t) ("\C-q" slime-close-parens-at-point :prefixed t :inferior t) ("\C-c\M-q" slime-reindent-defun :inferior t) ;; Evaluating From mbaringer at common-lisp.net Thu Jan 11 23:37:12 2007 From: mbaringer at common-lisp.net (mbaringer) Date: Thu, 11 Jan 2007 18:37:12 -0500 (EST) Subject: [slime-cvs] CVS slime Message-ID: <20070111233712.248946B564@common-lisp.net> Update of /project/slime/cvsroot/slime In directory clnet:/tmp/cvs-serv19851 Modified Files: ChangeLog Log Message: --- /project/slime/cvsroot/slime/ChangeLog 2007/01/11 22:26:59 1.1044 +++ /project/slime/cvsroot/slime/ChangeLog 2007/01/11 23:37:11 1.1045 @@ -1,3 +1,8 @@ +2007-01-12 Marco Baringer + + * slime.el (slime-keys): Remove binding of M-*, restore binding of + M-,. + 2007-01-11 Edi Weitz * slime.el (slime-repl-test-system, slime-repl-test/force-system): From eweitz at common-lisp.net Fri Jan 12 00:06:57 2007 From: eweitz at common-lisp.net (eweitz) Date: Thu, 11 Jan 2007 19:06:57 -0500 (EST) Subject: [slime-cvs] CVS slime Message-ID: <20070112000657.22E8E55397@common-lisp.net> Update of /project/slime/cvsroot/slime In directory clnet:/tmp/cvs-serv26741 Modified Files: ChangeLog slime.el swank.lisp Log Message: Offer systems already know to ASDF for completion --- /project/slime/cvsroot/slime/ChangeLog 2007/01/11 23:37:11 1.1045 +++ /project/slime/cvsroot/slime/ChangeLog 2007/01/12 00:06:56 1.1046 @@ -1,3 +1,16 @@ +2007-01-12 Edi Weitz + + * slime.el (slime-find-asd): Remove file extension. + + (slime-read-system-name): Use SWANK:LIST-ASDF-SYSTEMS. + + * swank.lisp (list-all-systems-in-central-registry): Use only + pathname name. + + (list-all-systems-known-to-asdf): New function. + + (list-asdf-systems): New function. + 2007-01-12 Marco Baringer * slime.el (slime-keys): Remove binding of M-*, restore binding of --- /project/slime/cvsroot/slime/slime.el 2007/01/11 23:37:05 1.743 +++ /project/slime/cvsroot/slime/slime.el 2007/01/12 00:06:56 1.744 @@ -4723,9 +4723,11 @@ directory or in the directory belonging to the current buffer and returns it if it's in `system-names'." (let* ((asdf-systems-in-directory - (directory-files (file-name-directory (or default-directory - (buffer-file-name))) - nil "\.asd$"))) + (mapcar #'file-name-sans-extension + (directory-files + (file-name-directory (or default-directory + (buffer-file-name))) + nil "\.asd$")))) (loop for system in asdf-systems-in-directory for candidate = (file-name-sans-extension system) when (find candidate system-names :test #'string-equal) @@ -4746,9 +4748,7 @@ "Read a system name from the minibuffer, prompting with PROMPT." (setq prompt (or prompt "System: ")) (let* ((completion-ignore-case nil) - (system-names (mapcar #'file-name-sans-extension - (slime-eval - `(swank:list-all-systems-in-central-registry)))) + (system-names (slime-eval `(swank:list-asdf-systems))) (alist (slime-bogus-completion-alist system-names))) (completing-read prompt alist nil nil (or initial-value (slime-find-asd system-names) "") --- /project/slime/cvsroot/slime/swank.lisp 2007/01/11 16:30:48 1.454 +++ /project/slime/cvsroot/slime/swank.lisp 2007/01/12 00:06:56 1.455 @@ -3079,18 +3079,33 @@ (defslimefun list-all-systems-in-central-registry () "Returns a list of all systems in ASDF's central registry." - (delete-duplicates - (loop for dir in (asdf-central-registry) - for defaults = (eval dir) - when defaults - nconc (mapcar #'file-namestring - (directory - (make-pathname :defaults defaults - :version :newest - :type "asd" - :name :wild - :case :local)))) - :test #'string=)) + (mapcar #'pathname-name + (delete-duplicates + (loop for dir in (asdf-central-registry) + for defaults = (eval dir) + when defaults + nconc (mapcar #'file-namestring + (directory + (make-pathname :defaults defaults + :version :newest + :type "asd" + :name :wild + :case :local)))) + :test #'string=))) + +(defslimefun list-all-systems-known-to-asdf () + "Returns a list of all systems ASDF knows already." + ;; ugh, yeah, it's unexported - but do we really expect this to + ;; change anytime soon? + (loop for name being the hash-keys of asdf::*defined-systems* + collect name)) + +(defslimefun list-asdf-systems () + "Returns the systems in ASDF's central registry and those which ASDF +already knows." + (nunion (list-all-systems-known-to-asdf) + (list-all-systems-in-central-registry) + :test #'string=)) (defun file-newer-p (new-file old-file) "Returns true if NEW-FILE is newer than OLD-FILE." From heller at common-lisp.net Fri Jan 12 07:49:06 2007 From: heller at common-lisp.net (heller) Date: Fri, 12 Jan 2007 02:49:06 -0500 (EST) Subject: [slime-cvs] CVS slime Message-ID: <20070112074906.652371B008@common-lisp.net> Update of /project/slime/cvsroot/slime In directory clnet:/tmp/cvs-serv31430 Modified Files: swank.lisp Log Message: (handle-request): Use 'abort as restart name, but bind *sldb-quit-restart* to the restart returned by find-restart. Also use a slighly friendlier message, because newbies seem to invoke the ABORT restart instead of pressing q in the debugger. --- /project/slime/cvsroot/slime/swank.lisp 2007/01/12 00:06:56 1.455 +++ /project/slime/cvsroot/slime/swank.lisp 2007/01/12 07:49:05 1.456 @@ -595,14 +595,18 @@ (when socket (close-socket socket))))) +(defvar *sldb-quit-restart* 'abort + "What restart should swank attempt to invoke when the user sldb-quits.") + (defun handle-request (connection) "Read and process one request. The processing is done in the extent of the toplevel restart." (assert (null *swank-state-stack*)) (let ((*swank-state-stack* '(:handle-request))) (with-connection (connection) - (with-simple-restart (abort-request "Abort handling SLIME request.") - (read-from-emacs))))) + (with-simple-restart (abort "Return to SLIME's top level.") + (let ((*sldb-quit-restart* (find-restart 'abort))) + (read-from-emacs)))))) (defun current-socket-io () (connection.socket-io *emacs-connection*)) @@ -2505,7 +2509,9 @@ (let ((i (car values))) (format nil "~A~D (#x~X, #o~O, #b~B)" *echo-area-prefix* i i i i))) - (t (format nil "~A~{~S~^, ~}" *echo-area-prefix* values)))))) + (t (with-output-to-string (s) + (pprint-logical-block (s values :prefix *echo-area-prefix*) + (format s "~{~S~^, ~}" values)))))))) (defslimefun interactive-eval (string) (with-buffer-syntax () @@ -2795,9 +2801,6 @@ (defvar *sldb-stepping-p* nil "True during execution of a step command.") -(defvar *sldb-quit-restart* 'abort-request - "What restart should swank attempt to invoke when the user sldb-quits.") - (defun debug-in-emacs (condition) (let ((*swank-debugger-condition* condition) (*sldb-restarts* (compute-restarts condition)) From heller at common-lisp.net Fri Jan 12 07:50:34 2007 From: heller at common-lisp.net (heller) Date: Fri, 12 Jan 2007 02:50:34 -0500 (EST) Subject: [slime-cvs] CVS slime Message-ID: <20070112075034.631381C0B7@common-lisp.net> Update of /project/slime/cvsroot/slime In directory clnet:/tmp/cvs-serv31520 Modified Files: ChangeLog Log Message: *** empty log message *** --- /project/slime/cvsroot/slime/ChangeLog 2007/01/12 00:06:56 1.1046 +++ /project/slime/cvsroot/slime/ChangeLog 2007/01/12 07:50:34 1.1047 @@ -1,3 +1,10 @@ +2007-01-12 Helmut Eller + + * swank.lisp (handle-request): Use 'abort as restart name, but + bind *sldb-quit-restart* to the restart returned by find-restart. + Also use a slighly friendlier message, because newbies seem to + invoke the ABORT restart instead of pressing q in the debugger. + 2007-01-12 Edi Weitz * slime.el (slime-find-asd): Remove file extension. @@ -36,9 +43,9 @@ . * slime.el (slime-keys): Removed binding of M-, - + 2007-01-11 Helmut Eller - + * slime.el: Some cleanups for the debugger code: add some outline sections and docstrings. From jsnellman at common-lisp.net Fri Jan 12 10:21:01 2007 From: jsnellman at common-lisp.net (jsnellman) Date: Fri, 12 Jan 2007 05:21:01 -0500 (EST) Subject: [slime-cvs] CVS slime Message-ID: <20070112102101.B827C72085@common-lisp.net> Update of /project/slime/cvsroot/slime In directory clnet:/tmp/cvs-serv24792 Modified Files: slime.el ChangeLog Log Message: * slime.el (slime-read-expression-map): Switch the slime-mode-map and minibuffer-local-map back the way they were. The original change was made due to a misunderstanding caused by a keybinding for [(return)] apparently being more specific than one for (kbd "RET"), even when the former is in a parent keymap and the latter in the child. --- /project/slime/cvsroot/slime/slime.el 2007/01/12 00:06:56 1.744 +++ /project/slime/cvsroot/slime/slime.el 2007/01/12 10:21:01 1.745 @@ -6266,7 +6266,7 @@ (defvar slime-read-expression-map (let ((map (make-sparse-keymap))) - (set-keymap-parents map (list slime-mode-map minibuffer-local-map)) + (set-keymap-parents map (list minibuffer-local-map slime-mode-map)) (define-key map "\t" 'slime-complete-symbol) (define-key map "\M-\t" 'slime-complete-symbol) map) --- /project/slime/cvsroot/slime/ChangeLog 2007/01/12 07:50:34 1.1047 +++ /project/slime/cvsroot/slime/ChangeLog 2007/01/12 10:21:01 1.1048 @@ -1,3 +1,12 @@ +2007-01-12 Juho Snellman + + * slime.el (slime-read-expression-map): Switch the slime-mode-map + and minibuffer-local-map back the way they were. The previous change + was made due to a misunderstanding, caused by a keybinding for + [(return)] apparently being more specific than one for (kbd "RET"), + even when the former is in a parent keymap and the latter in the + child. + 2007-01-12 Helmut Eller * swank.lisp (handle-request): Use 'abort as restart name, but From alendvai at common-lisp.net Fri Jan 12 11:55:56 2007 From: alendvai at common-lisp.net (alendvai) Date: Fri, 12 Jan 2007 06:55:56 -0500 (EST) Subject: [slime-cvs] CVS slime Message-ID: <20070112115556.B884A3E053@common-lisp.net> Update of /project/slime/cvsroot/slime In directory clnet:/tmp/cvs-serv9403 Modified Files: slime.el Log Message: Fix default key binding typo for slime-repl-next-matching-input --- /project/slime/cvsroot/slime/slime.el 2007/01/12 10:21:01 1.745 +++ /project/slime/cvsroot/slime/slime.el 2007/01/12 11:55:56 1.746 @@ -4324,7 +4324,7 @@ (mimic-key-bindings slime-repl-mode-map slime-repl-history-map keys to))) (remap (list 'slime-repl-previous-matching-input (kbd "M-r")) 'slime-repl-continue-search-with-last-pattern) - (remap (list 'slime-repl-next-matching-input (kbd "M-n")) + (remap (list 'slime-repl-next-matching-input (kbd "M-s")) 'slime-repl-continue-search-with-last-pattern)) ;;;;;; REPL Read Mode From heller at common-lisp.net Fri Jan 12 15:12:23 2007 From: heller at common-lisp.net (heller) Date: Fri, 12 Jan 2007 10:12:23 -0500 (EST) Subject: [slime-cvs] CVS slime Message-ID: <20070112151223.71D642D01D@common-lisp.net> Update of /project/slime/cvsroot/slime In directory clnet:/tmp/cvs-serv10410 Modified Files: swank-clisp.lisp Log Message: Better classifacation on frames on the stack. Make variables in eval frames accessible to the debugger. (frame-type, *frame-prefixes*, frame-to-string, is-prefix-p) (frame-string-type, boring-frame-p): New. (%frame-count-vars, %frame-var-name, %frame-var-value) (frame-venv, next-venv, venv-ref, %parse-stack-values): Replaces old frame-do-venv. (extract-frame-line, extract-function-name, split-frame-string) (string-match): New code to print frames. (frame-locals, frame-var-value): Use the new stuff. (inspect-for-emacs): Fix various bugs. --- /project/slime/cvsroot/slime/swank-clisp.lisp 2006/12/23 12:58:41 1.61 +++ /project/slime/cvsroot/slime/swank-clisp.lisp 2007/01/12 15:12:23 1.62 @@ -252,60 +252,59 @@ (let* (;;(sys::*break-count* (1+ sys::*break-count*)) ;;(sys::*driver* debugger-loop-fn) ;;(sys::*fasoutput-stream* nil) - (*sldb-backtrace* (nthcdr 5 (sldb-backtrace)))) + (*sldb-backtrace* + (nthcdr 3 (member (sys::the-frame) (sldb-backtrace))))) (funcall debugger-loop-fn))) (defun nth-frame (index) (nth index *sldb-backtrace*)) -;; This is the old backtrace implementation. Not sure yet wheter the -;; new is much better. -;; -;;(defimplementation compute-backtrace (start end) -;; (let ((end (or end most-positive-fixnum))) -;; (loop for last = nil then frame -;; for frame = (nth-frame start) then (frame-up frame) -;; for i from start below end -;; until (or (eq frame last) (not frame)) -;; collect frame))) -;; -;;(defimplementation print-frame (frame stream) -;; (write-string (trim-whitespace -;; (with-output-to-string (stream) -;; (sys::describe-frame stream frame))) -;; stream)) -;; -;;(defimplementation frame-locals (frame-number) -;; (let* ((frame (nth-frame frame-number)) -;; (frame-env (sys::eval-at frame '(sys::the-environment)))) -;; (append -;; (frame-do-venv frame (svref frame-env 0)) -;; (frame-do-fenv frame (svref frame-env 1)) -;; (frame-do-benv frame (svref frame-env 2)) -;; (frame-do-genv frame (svref frame-env 3)) -;; (frame-do-denv frame (svref frame-env 4))))) -;; -;;(defimplementation frame-var-value (frame var) -;; (getf (nth var (frame-locals frame)) :value)) - -(defun format-frame (frame) - (trim-whitespace - (with-output-to-string (s) - (sys::describe-frame s frame)))) - -(defun function-frame-p (frame) - ;; We are interested in frames which like look "<5> foo ...". - ;; Ugly, I know. - (char= #\< (aref (format-frame frame) 0))) - (defun sldb-backtrace () "Return a list ((ADDRESS . DESCRIPTION) ...) of frames." - (do ((fframes '()) + (do ((frames '()) (last nil frame) - (frame (sys::the-frame) (sys::frame-up-1 frame 1))) - ((eq frame last) (nreverse fframes)) - (when (function-frame-p frame) - (push (cons frame (format-frame frame)) fframes)))) + (frame (sys::the-frame) (sys::frame-up-1 frame 1))) ; 1 = "all frames" + ((eq frame last) (nreverse frames)) + (unless (boring-frame-p frame) + (push frame frames)))) + +(defun boring-frame-p (frame) + (member (frame-type frame) '(stack-value bind-var bind-env))) + +(defun frame-to-string (frame) + (with-output-to-string (s) + (sys::describe-frame s frame))) + +(defun frame-type (frame) + ;; FIXME: should bind *print-length* etc. to small values. + (frame-string-type (frame-to-string frame))) + +(defvar *frame-prefixes* + '(("frame binding variables" bind-var) + ("<1> # # # " fun) + ("<2> " 2nd-frame))) + +(defun frame-string-type (string) + (cadr (assoc-if (lambda (pattern) (is-prefix-p pattern string)) + *frame-prefixes*))) (defimplementation compute-backtrace (start end) (let* ((bt *sldb-backtrace*) @@ -313,72 +312,137 @@ (subseq bt start (min (or end len) len)))) (defimplementation print-frame (frame stream) - (let ((desc (cdr frame))) - (write-string (subseq (cdr frame) - (+ (position #\> desc) 2) - (position #\newline desc)) + (let ((str (frame-to-string frame))) + ;;(format stream "~a " (frame-string-type str)) + (write-string (extract-frame-line str) stream))) +(defun extract-frame-line (frame-string) + (let ((s frame-string)) + (trim-whitespace + (case (frame-string-type s) + ((eval special-op) + (string-match "EVAL frame .*for form \\(.*\\)" s 1)) + (apply + (string-match "APPLY frame for call \\(.*\\)" s 1)) + ((compiled-fun sys-fun fun) + (extract-function-name s)) + (t s))))) + +(defun extract-function-name (string) + (let ((1st (car (split-frame-string string)))) + (or (string-match (format nil "^<1>[ ~%]*#<[-A-Za-z]* \\(.*\\)>") + 1st + 1) + (string-match (format nil "^<1>[ ~%]*\\(.*\\)") 1st 1) + 1st))) + +(defun split-frame-string (string) + (let ((rx (format nil "~%\\(~{~a~^\\|~}\\)" + (mapcar #'car *frame-prefixes*)))) + (loop for pos = 0 then (1+ (regexp:match-start match)) + for match = (regexp:match rx string :start pos) + if match collect (subseq string pos (regexp:match-start match)) + else collect (subseq string pos) + while match))) + +(defun string-match (pattern string n) + (let* ((match (nth-value n (regexp:match pattern string)))) + (if match (regexp:match-string string match)))) + (defimplementation format-sldb-condition (condition) (trim-whitespace (princ-to-string condition))) (defimplementation eval-in-frame (form frame-number) - (sys::eval-at (car (nth-frame frame-number)) form)) + (sys::eval-at (nth-frame frame-number) form)) -;; Don't know how to access locals. Return some strings instead. -;; Maybe we should search some frame nearby with a 'sys::the-environment? (defimplementation frame-locals (frame-number) - (let ((desc (cdr (nth-frame frame-number)))) - (list (list :name :|| :id 0 - :value (trim-whitespace - (subseq desc (position #\newline desc))))))) + (let ((frame (nth-frame frame-number))) + (loop for i below (%frame-count-vars frame) + collect (list :name (%frame-var-name frame i) + :value (%frame-var-value frame i) + :id 0)))) -(defimplementation frame-var-value (frame var) nil) +(defimplementation frame-var-value (frame var) + (%frame-var-value (nth-frame frame) var)) ;; Interpreter-Variablen-Environment has the shape ;; NIL or #(v1 val1 ... vn valn NEXT-ENV). -(defun frame-do-venv (frame venv) - (loop for i from 1 below (length venv) by 2 - as symbol = (svref venv (1- i)) - and value = (svref venv i) - collect (list :name symbol :id 0 - :value (if (eq sys::specdecl value) - ;; special variable - (sys::eval-at frame symbol) - ;; lexical variable or symbol macro - value)))) - -(defun frame-do-fenv (frame fenv) - (declare (ignore frame fenv)) - nil) - -(defun frame-do-benv (frame benv) - (declare (ignore frame benv)) - nil) - -(defun frame-do-genv (frame genv) - (declare (ignore frame genv)) - nil) - -(defun frame-do-denv (frame denv) - (declare (ignore frame denv)) - nil) +(defun %frame-count-vars (frame) + (cond ((sys::eval-frame-p frame) + (do ((venv (frame-venv frame) (next-venv venv)) + (count 0 (+ count (/ (1- (length venv)) 2)))) + ((not venv) count))) + ((member (frame-type frame) '(compiled-fun sys-fun fun special-op)) + (length (%parse-stack-values frame))) + (t 0))) + +(defun %frame-var-name (frame i) + (cond ((sys::eval-frame-p frame) + (nth-value 0 (venv-ref (frame-venv frame) i))) + (t (format nil "~D" i)))) + +(defun %frame-var-value (frame i) + (cond ((sys::eval-frame-p frame) + (let ((name (venv-ref (frame-venv frame) i))) + (multiple-value-bind (v c) (ignore-errors (sys::eval-at frame name)) + (if c + (format-sldb-condition c) + v)))) + ((member (frame-type frame) '(compiled-fun sys-fun fun special-op)) + (let ((str (nth i (%parse-stack-values frame)))) + (trim-whitespace (subseq str 2)))) + (t (break "Not implemented")))) + +(defun frame-venv (frame) + (let ((env (sys::eval-at frame '(sys::the-environment)))) + (svref env 0))) + +(defun next-venv (venv) (svref venv (1- (length venv)))) + +(defun venv-ref (env i) + "Reference the Ith binding in ENV. +Return two values: NAME and VALUE" + (let ((idx (* i 2))) + (if (< idx (1- (length env))) + (values (svref env idx) (svref env (1+ idx))) + (venv-ref (next-venv env) (- i (/ (1- (length env)) 2)))))) + +(defun %parse-stack-values (frame) + (labels ((next (fp) (sys::frame-down-1 fp 1)) + (parse (fp accu) + (let ((str (frame-to-string fp))) + (cond ((is-prefix-p "- " str) + (parse (next fp) (cons str accu))) + ((is-prefix-p "<1> " str) + ;;(when (eq (frame-type frame) 'compiled-fun) + ;; (pop accu)) + (dolist (str (cdr (split-frame-string str))) + (when (is-prefix-p "- " str) + (push str accu))) + (nreverse accu)) + (t (parse (next fp) accu)))))) + (parse (next frame) '()))) + +(defun is-prefix-p (pattern string) + (not (mismatch pattern string :end2 (min (length pattern) + (length string))))) (defimplementation frame-catch-tags (index) (declare (ignore index)) nil) (defimplementation return-from-frame (index form) - (sys::return-from-eval-frame (car (nth-frame index)) form)) + (sys::return-from-eval-frame (nth-frame index) form)) (defimplementation restart-frame (index) - (sys::redo-eval-frame (car (nth-frame index)))) + (sys::redo-eval-frame (nth-frame index))) (defimplementation frame-source-location-for-emacs (index) `(:error ,(format nil "frame-source-location not implemented. (frame: ~A)" - (car (nth-frame index))))) + (nth-frame index)))) ;;; Profiling @@ -555,8 +619,7 @@ ;;; Inspecting -(defclass clisp-inspector (inspector) - ()) +(defclass clisp-inspector (inspector) ()) (defimplementation make-default-inspector () (make-instance 'clisp-inspector)) @@ -577,12 +640,12 @@ (sys::insp-title inspection) (sys::insp-blurb inspection)) (loop with count = (sys::insp-num-slots inspection) - for i upto count - for (value name) = (multiple-value-list - (funcall (sys::insp-nth-slot - inspection) i)) - collect `((:value ,name) " = " (:value ,value) - (:newline))))))) + for i below count + append (multiple-value-bind (value name) + (funcall (sys::insp-nth-slot inspection) + i) + `((:value ,name) " = " (:value ,value) + (:newline)))))))) (defimplementation quit-lisp () #+lisp=cl (ext:quit) From heller at common-lisp.net Fri Jan 12 15:12:41 2007 From: heller at common-lisp.net (heller) Date: Fri, 12 Jan 2007 10:12:41 -0500 (EST) Subject: [slime-cvs] CVS slime Message-ID: <20070112151241.47DBF36010@common-lisp.net> Update of /project/slime/cvsroot/slime In directory clnet:/tmp/cvs-serv10457 Modified Files: ChangeLog Log Message: *** empty log message *** --- /project/slime/cvsroot/slime/ChangeLog 2007/01/12 10:21:01 1.1048 +++ /project/slime/cvsroot/slime/ChangeLog 2007/01/12 15:12:40 1.1049 @@ -1,3 +1,18 @@ +2007-01-12 Helmut Eller + + * swank-clisp.lisp: Better classifacation on frames on the stack. + Make variables in eval frames accessible to the debugger. + (frame-type, *frame-prefixes*, frame-to-string, is-prefix-p) + (frame-string-type, boring-frame-p): New. + (%frame-count-vars, %frame-var-name, %frame-var-value) + (frame-venv, next-venv, venv-ref, %parse-stack-values): Replaces + old frame-do-venv. + (extract-frame-line, extract-function-name, split-frame-string) + (string-match): New code to print frames. + (frame-locals, frame-var-value): Use the new stuff. + + (inspect-for-emacs): Fix various bugs. + 2007-01-12 Juho Snellman * slime.el (slime-read-expression-map): Switch the slime-mode-map From heller at common-lisp.net Fri Jan 12 15:14:43 2007 From: heller at common-lisp.net (heller) Date: Fri, 12 Jan 2007 10:14:43 -0500 (EST) Subject: [slime-cvs] CVS slime Message-ID: <20070112151443.0B6B75903E@common-lisp.net> Update of /project/slime/cvsroot/slime In directory clnet:/tmp/cvs-serv10873 Modified Files: ChangeLog Log Message: Fix speling. --- /project/slime/cvsroot/slime/ChangeLog 2007/01/12 15:12:40 1.1049 +++ /project/slime/cvsroot/slime/ChangeLog 2007/01/12 15:14:42 1.1050 @@ -1,6 +1,6 @@ 2007-01-12 Helmut Eller - * swank-clisp.lisp: Better classifacation on frames on the stack. + * swank-clisp.lisp: Better classification on frames on the stack. Make variables in eval frames accessible to the debugger. (frame-type, *frame-prefixes*, frame-to-string, is-prefix-p) (frame-string-type, boring-frame-p): New. From heller at common-lisp.net Fri Jan 12 15:23:48 2007 From: heller at common-lisp.net (heller) Date: Fri, 12 Jan 2007 10:23:48 -0500 (EST) Subject: [slime-cvs] CVS slime Message-ID: <20070112152348.A0D4F2F044@common-lisp.net> Update of /project/slime/cvsroot/slime In directory clnet:/tmp/cvs-serv13232 Modified Files: swank-loader.lisp Log Message: (compile-files-if-needed-serially): Don't wrap everything in a compilation unit. If we abort on load errors and it is confusing to see compiler warnings after the abort message. (handle-loadtime-error): CLISP's format implements ~< differently as everybody else, so use a explicit pprint-logical-block instead. --- /project/slime/cvsroot/slime/swank-loader.lisp 2006/11/19 21:28:16 1.63 +++ /project/slime/cvsroot/slime/swank-loader.lisp 2007/01/12 15:23:48 1.64 @@ -130,11 +130,11 @@ :type (pathname-type cfp)) binary-directory))) - (defun handle-loadtime-error (condition binary-pathname) - (format *error-output* - "~%~<;; ~@;Error while loading: ~A~% Condition: ~A~%Aborting.~:>~%" - (list binary-pathname condition)) + (pprint-logical-block (*error-output* () :per-line-prefix ";; ") + (format *error-output* + "~%Error while loading: ~A~%Condition: ~A~%Aborting.~%" + binary-pathname condition)) (when (equal (directory-namestring binary-pathname) (directory-namestring (default-fasl-directory))) (ignore-errors (delete-file binary-pathname))) @@ -144,27 +144,26 @@ "Compile each file in FILES if the source is newer than its corresponding binary, or the file preceding it was recompiled." - (with-compilation-unit () - (let ((needs-recompile nil)) - (dolist (source-pathname files) - (let ((binary-pathname (binary-pathname source-pathname - fasl-directory))) - (handler-case - (progn - (when (or needs-recompile - (not (probe-file binary-pathname)) - (file-newer-p source-pathname binary-pathname)) - ;; need a to recompile source-pathname, so we'll - ;; need to recompile everything after this too. - (setq needs-recompile t) - (ensure-directories-exist binary-pathname) - (compile-file source-pathname :output-file binary-pathname - :print nil - :verbose t)) - (load binary-pathname :verbose t)) - ;; Fail as early as possible - (serious-condition (c) - (handle-loadtime-error c binary-pathname)))))))) + (let ((needs-recompile nil)) + (dolist (source-pathname files) + (let ((binary-pathname (binary-pathname source-pathname + fasl-directory))) + (handler-case + (progn + (when (or needs-recompile + (not (probe-file binary-pathname)) + (file-newer-p source-pathname binary-pathname)) + ;; need a to recompile source-pathname, so we'll + ;; need to recompile everything after this too. + (setq needs-recompile t) + (ensure-directories-exist binary-pathname) + (compile-file source-pathname :output-file binary-pathname + :print nil + :verbose t)) + (load binary-pathname :verbose t)) + ;; Fail as early as possible + (serious-condition (c) + (handle-loadtime-error c binary-pathname))))))) #+(or cormanlisp ecl) (defun compile-files-if-needed-serially (files fasl-directory) From heller at common-lisp.net Fri Jan 12 15:26:05 2007 From: heller at common-lisp.net (heller) Date: Fri, 12 Jan 2007 10:26:05 -0500 (EST) Subject: [slime-cvs] CVS slime Message-ID: <20070112152605.B1E42391AC@common-lisp.net> Update of /project/slime/cvsroot/slime In directory clnet:/tmp/cvs-serv13502 Modified Files: swank.lisp Log Message: (list-all-systems-known-to-asdf): Don't reference asdf directly, that leads to read errors in some systems. --- /project/slime/cvsroot/slime/swank.lisp 2007/01/12 07:49:05 1.456 +++ /project/slime/cvsroot/slime/swank.lisp 2007/01/12 15:26:05 1.457 @@ -3098,9 +3098,12 @@ (defslimefun list-all-systems-known-to-asdf () "Returns a list of all systems ASDF knows already." + (unless (find-package :asdf) + (error "ASDF not loaded")) ;; ugh, yeah, it's unexported - but do we really expect this to ;; change anytime soon? - (loop for name being the hash-keys of asdf::*defined-systems* + (loop for name being the hash-keys of (read-from-string + "#.asdf::*defined-systems*") collect name)) (defslimefun list-asdf-systems () From heller at common-lisp.net Fri Jan 12 15:26:48 2007 From: heller at common-lisp.net (heller) Date: Fri, 12 Jan 2007 10:26:48 -0500 (EST) Subject: [slime-cvs] CVS slime Message-ID: <20070112152648.5DA2F49031@common-lisp.net> Update of /project/slime/cvsroot/slime In directory clnet:/tmp/cvs-serv13583 Modified Files: ChangeLog Log Message: *** empty log message *** --- /project/slime/cvsroot/slime/ChangeLog 2007/01/12 15:14:42 1.1050 +++ /project/slime/cvsroot/slime/ChangeLog 2007/01/12 15:26:47 1.1051 @@ -1,3 +1,7 @@ +2007-01-12 Helmut Eller + + + 2007-01-12 Helmut Eller * swank-clisp.lisp: Better classification on frames on the stack. @@ -13,6 +17,16 @@ (inspect-for-emacs): Fix various bugs. + * swank-loader.lisp (compile-files-if-needed-serially): Don't wrap + everything in a compilation unit. If we abort on load errors and + it is confusing to see compiler warnings after the abort message. + (handle-loadtime-error): CLISP's format implements ~< differently + as everybody else, so use a explicit pprint-logical-block instead. + + * swank.lisp (list-all-systems-in-central-registry): Don't + reference asdf directly, that leads to read errors in some + systems. + 2007-01-12 Juho Snellman * slime.el (slime-read-expression-map): Switch the slime-mode-map From heller at common-lisp.net Fri Jan 12 15:27:11 2007 From: heller at common-lisp.net (heller) Date: Fri, 12 Jan 2007 10:27:11 -0500 (EST) Subject: [slime-cvs] CVS slime Message-ID: <20070112152711.9236C5903E@common-lisp.net> Update of /project/slime/cvsroot/slime In directory clnet:/tmp/cvs-serv13643 Modified Files: ChangeLog Log Message: *** empty log message *** --- /project/slime/cvsroot/slime/ChangeLog 2007/01/12 15:26:47 1.1051 +++ /project/slime/cvsroot/slime/ChangeLog 2007/01/12 15:27:10 1.1052 @@ -1,7 +1,3 @@ -2007-01-12 Helmut Eller - - - 2007-01-12 Helmut Eller * swank-clisp.lisp: Better classification on frames on the stack. From heller at common-lisp.net Sun Jan 14 09:32:07 2007 From: heller at common-lisp.net (heller) Date: Sun, 14 Jan 2007 04:32:07 -0500 (EST) Subject: [slime-cvs] CVS slime Message-ID: <20070114093207.A3BCF4B00F@common-lisp.net> Update of /project/slime/cvsroot/slime In directory clnet:/tmp/cvs-serv25431 Modified Files: slime.el Log Message: Cleanups for the repl history code. (slime-repl-mode-map): Don't shadow M-C-d. (slime-repl-history-replace): Simplified. (slime-repl-history-search-in-progress-p): New. (slime-repl-position-in-history): If there's no match return out-of-bound positions instead of nil. (slime-repl-add-to-input-history): Never modify the argument. (slime-repl-previous-input): Renamed from slime-repl-previous-input-starting-with-current-input. (slime-repl-next-input): Renamed from slime-repl-next-input-starting-with-current-input (slime-repl-forward-input): Renamed from slime-repl-next-input. (slime-repl-backward-input): Renamed from slime-repl-previous-input. (slime-repl-history-pattern): Renamed from slime-repl-matching-input-regexp. (slime-repl-delete-from-input-history): Simplified. (slime-repl-history-map) (slime-repl-history-navigation-neutral-commands) (slime-repl-jump-to-history-item) (slime-repl-previous-or-next-input) (slime-repl-starting-with-current-input-regexp) (slime-repl-continue-search-with-last-pattern) (slime-repl-previous-or-next-matching-input): Deleted. (sldb-list-locals, sldb-list-catch-tags): Deleted. Aren't of much use anymore. --- /project/slime/cvsroot/slime/slime.el 2007/01/12 11:55:56 1.746 +++ /project/slime/cvsroot/slime/slime.el 2007/01/14 09:32:06 1.747 @@ -2876,8 +2876,6 @@ (display-buffer (current-buffer) t)) (slime-repl-show-maximum-output))) -(defsetf marker-insertion-type set-marker-insertion-type) - (defmacro slime-with-output-end-mark (&rest body) "Execute BODY at `slime-output-end'. @@ -3182,25 +3180,16 @@ ;; there is no prompt between output-end and input-start. ;; -(make-variable-buffer-local - (defvar slime-repl-package-stack nil - "The stack of packages visited in this repl.")) - -(make-variable-buffer-local - (defvar slime-repl-directory-stack nil - "The stack of default directories associated with this repl.")) - ;; Small helper. (defun slime-make-variables-buffer-local (&rest variables) (mapcar #'make-variable-buffer-local variables)) (slime-make-variables-buffer-local - ;; Local variables in the REPL buffer. - (defvar slime-repl-input-history '() - "History list of strings read from the REPL buffer.") - - (defvar slime-repl-input-history-position -1 - "Newer items have smaller indices.") + (defvar slime-repl-package-stack nil + "The stack of packages visited in this repl.") + + (defvar slime-repl-directory-stack nil + "The stack of default directories associated with this repl.") (defvar slime-repl-prompt-start-mark) (defvar slime-repl-input-start-mark) @@ -3211,12 +3200,55 @@ This property value must be unique to avoid having adjacent inputs be joined together.")) +;;;;; REPL mode setup + (defvar slime-repl-mode-map) -(defun slime-repl-buffer (&optional create connection) - "Get the REPL buffer for the current connection; optionally create." - (funcall (if create #'get-buffer-create #'get-buffer) - (format "*slime-repl %s*" (slime-connection-name connection)))) +(setq slime-repl-mode-map (make-sparse-keymap)) +(set-keymap-parent slime-repl-mode-map lisp-mode-map) + +(dolist (spec slime-keys) + (destructuring-bind (key command &key inferior prefixed + &allow-other-keys) spec + (when inferior + (let ((key (if prefixed (concat slime-prefix-key key) key))) + (define-key slime-repl-mode-map key command))))) + +(slime-define-keys slime-repl-mode-map + ("\C-m" 'slime-repl-return) + ("\C-j" 'slime-repl-newline-and-indent) + ("\C-\M-m" 'slime-repl-closing-return) + ([(control return)] 'slime-repl-closing-return) + ("\C-a" 'slime-repl-bol) + ([home] 'slime-repl-bol) + ("\C-e" 'slime-repl-eol) + ("\M-p" 'slime-repl-previous-input) + ((kbd "C-") 'slime-repl-backward-input) + ("\M-n" 'slime-repl-next-input) + ((kbd "C-") 'slime-repl-forward-input) + ("\M-r" 'slime-repl-previous-matching-input) + ("\M-s" 'slime-repl-next-matching-input) + ("\C-c\C-c" 'slime-interrupt) + ("\C-c\C-b" 'slime-interrupt) + ("\C-c:" 'slime-interactive-eval) + ("\C-c\C-e" 'slime-interactive-eval) + ("\C-cE" 'slime-edit-value) + ;("\t" 'slime-complete-symbol) + ("\t" 'slime-indent-and-complete-symbol) + (" " 'slime-space) + ("\C-c\C-d" slime-doc-map) + ("\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\C-u" 'slime-repl-kill-input) + ("\C-c\C-n" 'slime-repl-next-prompt) + ("\C-c\C-p" 'slime-repl-previous-prompt) + ("\M-\C-a" 'slime-repl-beginning-of-defun) + ("\M-\C-e" 'slime-repl-end-of-defun) + ("\C-c\C-l" 'slime-load-file) + ("\C-c\C-k" 'slime-compile-and-load-file) + ("\C-c\C-z" 'slime-nop)) (defun slime-repl-mode () "Major mode for interacting with a superior Lisp. @@ -3249,6 +3281,15 @@ 'slime-repl-mode-end-of-defun) (run-hooks 'slime-repl-mode-hook)) +(defun slime-repl-buffer (&optional create connection) + "Get the REPL buffer for the current connection; optionally create." + (funcall (if create #'get-buffer-create #'get-buffer) + (format "*slime-repl %s*" (slime-connection-name connection)))) + +(defun slime-repl () + (interactive) + (slime-switch-to-output-buffer)) + (defun slime-repl-mode-beginning-of-defun () (slime-repl-previous-prompt) t) @@ -3648,32 +3689,6 @@ 0 (next-single-property-change 0 text-property object))) -(defun slime-repl-add-to-input-history (string) - (when (and (plusp (length string)) - (eq ?\n (aref string (1- (length string))))) - (setq string (substring string 0 -1))) - (unless (or (= (length string) 0) - (equal string (car slime-repl-input-history))) - (push string slime-repl-input-history)) - (setq slime-repl-input-history-position -1)) - -(defun slime-repl-delete-from-input-history (&optional string) - "Delete STRING from the repl input history. When string is not -provided then clear the current repl input and use it as an input. -This is useful to get rid of unwanted repl history entries while -navigating the repl history." - (interactive) - (unless string - (setf string (slime-repl-current-input)) - (slime-repl-delete-current-input)) - (let ((file slime-repl-history-file)) - (message "saving history...") - (let ((merged-history (slime-repl-merge-histories slime-repl-input-history - (slime-repl-read-history file t)))) - (setf slime-repl-input-history (delete* string merged-history :test 'string=)) - (slime-repl-save-history file slime-repl-input-history))) - (slime-repl-jump-to-history-item)) - (defun slime-repl-eval-string (string) (slime-rex () ((list 'swank:listener-eval string) (slime-lisp-package)) @@ -3834,6 +3849,8 @@ (error "No input at point.")) (goto-char slime-repl-input-end-mark) (let ((end (point))) ; end of input, without the newline + (slime-repl-add-to-input-history + (buffer-substring slime-repl-input-start-mark end)) (when newline (insert "\n") (slime-repl-show-maximum-output)) @@ -3847,10 +3864,6 @@ ;; 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)) - (let ((input (slime-repl-current-input))) (goto-char slime-repl-input-end-mark) (slime-mark-input-start) @@ -4021,153 +4034,132 @@ :type 'boolean :group 'slime-repl) +(make-variable-buffer-local + (defvar slime-repl-input-history '() + "History list of strings read from the REPL buffer.")) + +(defun slime-repl-add-to-input-history (string) + "Add STRING to the input history. +Empty strings and duplicates are ignored." + (unless (or (equal string "") + (equal string (car slime-repl-input-history))) + (push string slime-repl-input-history))) + +;; These two vars contain the state of the last history search. We +;; only use them if `last-command' was 'slime-repl-history-replace, +;; otherwise we reinitialize them. + +(defvar slime-repl-input-history-position -1 + "Newer items have smaller indices.") + (defvar slime-repl-history-pattern nil "The regexp most recently used for finding input history.") -;; initialized later when slime-repl-mode-map is available -(defvar slime-repl-history-map (make-sparse-keymap) - "Map active while in the minibuffer reading repl search regexp.") - -(defvar slime-repl-history-navigation-neutral-commands - '(slime-repl-previous-matching-input - slime-repl-next-matching-input - slime-repl-previous-input-starting-with-current-input - slime-repl-next-input-starting-with-current-input - slime-repl-delete-from-input-history)) - -(defun* slime-repl-jump-to-history-item (&optional (pos slime-repl-input-history-position)) - (when (>= pos 0) - (slime-repl-replace-input (nth pos slime-repl-input-history)) - (message "History item: %d, current regexp: %s" pos slime-repl-history-pattern))) - -(defun* slime-repl-history-replace (direction &optional regexp delete-at-end-p) - "Replace the current input with the next line in DIRECTION matching REGEXP. +(defun slime-repl-history-replace (direction &optional regexp delete-at-end-p) + "Replace the current input with the next line in DIRECTION. DIRECTION is 'forward' or 'backward' (in the history list). +If REGEXP is non-nil, only lines matching REGEXP are considered. If DELETE-AT-END-P is non-nil then remove the string if the end of the -history is reached. Returns t if there were any matches." - (when regexp - (setq slime-repl-history-pattern regexp)) - (let* ((forward (eq direction 'forward)) - (history-length (length slime-repl-input-history)) - (pos (if regexp - (slime-repl-position-in-history direction regexp) - (if (>= slime-repl-input-history-position 0) - (+ slime-repl-input-history-position - (if forward -1 1)) - (unless forward - 0))))) - (when (and pos - (or (< pos 0) - (>= pos history-length))) - (setf pos nil)) - (cond (pos - (setq slime-repl-input-history-position pos) - (slime-repl-jump-to-history-item)) - ((and delete-at-end-p (not slime-repl-wrap-history)) - (cond (forward (slime-repl-replace-input "") - (message "End of history; current regexp: %s" - slime-repl-history-pattern)) - (t (message "Beginning of history; current regexp: %s" - slime-repl-history-pattern))) - (setq slime-repl-input-history-position - (if forward -1 history-length))) - ((and delete-at-end-p slime-repl-wrap-history) - (slime-repl-replace-input "") - (setq slime-repl-input-history-position - (if forward history-length -1))) - (t - (message "End of history; no matching item; current regexp: %s" - slime-repl-history-pattern) - (return-from slime-repl-history-replace nil)))) - t) +history is reached." + (setq slime-repl-history-pattern regexp) + (let* ((min-pos -1) + (max-pos (length slime-repl-input-history)) + (pos0 (cond ((slime-repl-history-search-in-progress-p) + slime-repl-input-history-position) + (t min-pos))) + (pos (slime-repl-position-in-history pos0 direction (or regexp ""))) + (msg nil)) + (cond ((and (< min-pos pos) (< pos max-pos)) + (slime-repl-replace-input (nth pos slime-repl-input-history)) + (setq msg (format "History item: %d" pos))) + ((not slime-repl-wrap-history) + (setq msg (cond ((= pos min-pos) "End of history") + ((= pos max-pos) "Beginning of history")))) + (slime-repl-wrap-history + (setq pos (if (= pos min-pos) max-pos min-pos)) + (setq msg "Wrapped history"))) + (when (or (<= pos min-pos) (<= max-pos pos)) + (when regexp + (setq msg (concat msg "; no matching item"))) + (when delete-at-end-p + (slime-repl-replace-input ""))) + ;;(message "%s [%d %d %s]" msg start-pos pos regexp) + (message "%s%s" msg (cond ((not regexp) "") + (t (format "; current regexp: %s" regexp)))) + (setq slime-repl-input-history-position pos) + (setq this-command 'slime-repl-history-replace))) + +(defun slime-repl-history-search-in-progress-p () + (eq last-command 'slime-repl-history-replace)) -(defun slime-repl-position-in-history (direction regexp) +(defun slime-repl-position-in-history (start-pos direction regexp) "Return the position of the history item matching regexp. -Return nil of no item matches" +Return -1 resp. the length of the history if no item matches" ;; Loop through the history list looking for a matching line (let* ((step (ecase direction (forward -1) (backward 1))) - (history-pos0 slime-repl-input-history-position) - (history-length (length slime-repl-input-history))) - (loop for pos = (+ history-pos0 step) then (+ pos step) - while (and (<= 0 pos) - (< pos history-length)) - do (let ((string (nth pos slime-repl-input-history))) - (when (and (string-match regexp string) - (not (string= string (slime-repl-current-input)))) - (return pos)))))) - -(defun slime-repl-previous-or-next-input (direction) - (when (< (point) (marker-position slime-repl-input-start-mark)) - (goto-char (point-max))) - (slime-repl-history-replace direction nil t)) + (history slime-repl-input-history) + (len (length history))) + (loop for pos = (+ start-pos step) then (+ pos step) + if (< pos 0) return -1 + if (<= len pos) return len + if (string-match regexp (nth pos history)) return pos))) (defun slime-repl-previous-input () + "Cycle backwards through input history. +Use the current input as search pattern. (The input is not saved.)" (interactive) - (slime-repl-previous-or-next-input 'backward)) + (slime-repl-history-replace 'backward (slime-repl-history-pattern t) t)) (defun slime-repl-next-input () + "Cycle forwards through input history. +See `slime-repl-previous-input'." (interactive) - (slime-repl-previous-or-next-input 'forward)) - -(defun slime-repl-starting-with-current-input-regexp () - (if (memq last-command slime-repl-history-navigation-neutral-commands) - slime-repl-history-pattern - (concat "^" (regexp-quote (slime-repl-current-input t))))) - -(defun slime-repl-previous-input-starting-with-current-input () - (interactive) - (slime-repl-history-replace 'backward (slime-repl-starting-with-current-input-regexp) t)) - -(defun slime-repl-next-input-starting-with-current-input () - (interactive) - (slime-repl-history-replace 'forward (slime-repl-starting-with-current-input-regexp) t)) - -(defun slime-repl-matching-input-regexp () - (if (memq last-command - '(slime-repl-previous-input-starting-with-current-input slime-repl-next-input-starting-with-current-input)) - slime-repl-history-pattern - (concat "^" (regexp-quote (slime-repl-current-input))))) - -(defun slime-repl-previous-input-starting-with-current-input () - (interactive) - (slime-repl-history-replace 'backward (slime-repl-matching-input-regexp) t)) - -(defun slime-repl-next-input-starting-with-current-input () - (interactive) - (slime-repl-history-replace 'forward (slime-repl-matching-input-regexp) t)) - -(defun slime-repl-continue-search-with-last-pattern () - (interactive) - (when slime-repl-history-pattern - (throw 'continue slime-repl-history-pattern))) - -(defun slime-repl-previous-or-next-matching-input (regexp direction prompt) - (when (< (point) (marker-position slime-repl-input-start-mark)) - (goto-char (point-max))) - (let ((command this-command)) - (unless regexp - (setf regexp (if (and slime-repl-history-pattern - (memq last-command slime-repl-history-navigation-neutral-commands)) - slime-repl-history-pattern - (catch 'continue - (slime-read-from-minibuffer - prompt :initial-value (slime-symbol-name-at-point) - :keymap slime-repl-history-map))))) - (when (and regexp (> (length regexp) 0)) - (when (slime-repl-history-replace direction regexp t) - (setf this-command command))))) - -(defun slime-repl-previous-matching-input () - (interactive) - (slime-repl-previous-or-next-matching-input - nil 'backward "Previous element matching (regexp): ")) + (slime-repl-history-replace 'forward (slime-repl-history-pattern t) t)) -(defun slime-repl-next-matching-input () +(defun slime-repl-forward-input () + "Cycle forwards through input history." (interactive) - (slime-repl-previous-or-next-matching-input - nil 'forward "Next element matching (regexp): ")) + (slime-repl-history-replace 'forward (slime-repl-history-pattern) t)) + +(defun slime-repl-backward-input () + "Cycle backwards through input history." + (interactive) + (slime-repl-history-replace 'backward (slime-repl-history-pattern) t)) + +(defun slime-repl-previous-matching-input (regexp) + (interactive "sPrevious element matching (regexp): ") + (slime-repl-history-replace 'backward regexp)) [176 lines skipped] From heller at common-lisp.net Sun Jan 14 09:33:14 2007 From: heller at common-lisp.net (heller) Date: Sun, 14 Jan 2007 04:33:14 -0500 (EST) Subject: [slime-cvs] CVS slime Message-ID: <20070114093314.38D8C83059@common-lisp.net> Update of /project/slime/cvsroot/slime In directory clnet:/tmp/cvs-serv25487 Modified Files: ChangeLog Log Message: *** empty log message *** --- /project/slime/cvsroot/slime/ChangeLog 2007/01/12 15:27:10 1.1052 +++ /project/slime/cvsroot/slime/ChangeLog 2007/01/14 09:33:13 1.1053 @@ -1,3 +1,34 @@ +2007-01-14 Helmut Eller + + * slime.el: Cleanups for the repl history code. + (slime-repl-mode-map): Don't shadow M-C-d. + (slime-repl-history-replace): Simplified. + (slime-repl-history-search-in-progress-p): New. + (slime-repl-position-in-history): If there's no match return + out-of-bound positions instead of nil. + (slime-repl-add-to-input-history): Never modify the argument. + (slime-repl-previous-input): Renamed from + slime-repl-previous-input-starting-with-current-input. + (slime-repl-next-input): Renamed from + slime-repl-next-input-starting-with-current-input + (slime-repl-forward-input): Renamed from slime-repl-next-input. + (slime-repl-backward-input): Renamed from + slime-repl-previous-input. + (slime-repl-history-pattern): Renamed from + slime-repl-matching-input-regexp. + (slime-repl-delete-from-input-history): Simplified. + + (slime-repl-history-map) + (slime-repl-history-navigation-neutral-commands) + (slime-repl-jump-to-history-item) + (slime-repl-previous-or-next-input) + (slime-repl-starting-with-current-input-regexp) + (slime-repl-continue-search-with-last-pattern) + (slime-repl-previous-or-next-matching-input): Deleted. + + (sldb-list-locals, sldb-list-catch-tags): Deleted. Aren't of much + use anymore. + 2007-01-12 Helmut Eller * swank-clisp.lisp: Better classification on frames on the stack. From jcunningham at common-lisp.net Tue Jan 16 02:01:26 2007 From: jcunningham at common-lisp.net (jcunningham) Date: Mon, 15 Jan 2007 21:01:26 -0500 (EST) Subject: [slime-cvs] CVS slime/doc Message-ID: <20070116020126.BABE23909B@common-lisp.net> Update of /project/slime/cvsroot/slime/doc In directory clnet:/tmp/cvs-serv18344/slime/doc Modified Files: slime.texi Log Message: Test check in of doc/slime.texi (jeff cunningham) --- /project/slime/cvsroot/slime/doc/slime.texi 2006/12/24 13:43:15 1.51 +++ /project/slime/cvsroot/slime/doc/slime.texi 2007/01/16 02:01:26 1.52 @@ -10,7 +10,7 @@ @set EDITION 2.0 @c @set UPDATED @today{} - at set UPDATED @code{$Date: 2006/12/24 13:43:15 $} + at set UPDATED @code{$Date: 2007/01/16 02:01:26 $} @set TITLE SLIME User Manual @settitle @value{TITLE}, version @value{EDITION} @@ -158,7 +158,7 @@ @item Steel Bank Common Lisp (@acronym{SBCL}), latest official release @item -OpenMCL, version 0.14.3 +OpenMCL, version 0.14.3 or newer @item LispWorks, version 4.3 or newer @item @@ -271,7 +271,7 @@ @iftex The snippet above also appears in the @file{README} file. You can copy&paste it from there, but remember to fill in the appropriate -path. +paths. @end iftex We recommend not loading the @acronym{ILISP} package into Emacs if you @@ -357,6 +357,10 @@ @node About key bindings, inferior-lisp, Temporary buffers, User-interface conventions @subsection About key bindings +A (near) complete list of the default keybindings set by @SLIME{} is +given in an appendix (@pxref{Index to Key Bindings}), with links to +their descriptions. + In general we try to make our key bindings fit with the overall Emacs style. We also have the following somewhat unusual convention of our own: when entering a three-key sequence, the final key can be pressed @@ -370,19 +374,29 @@ There is one exception to this rule, just to trip you up. We never bind @kbd{C-h} anywhere in a key sequence, so @kbd{C-c C-d C-h} doesn't do the same thing as @kbd{C-c C-d h}. This is because Emacs -has a builtin default so that typing a prefix followed by @kbd{C-h} +has a built-in default so that typing a prefix followed by @kbd{C-h} will display all bindings starting with that prefix, so @kbd{C-c C-d C-h} will actually list the bindings for all documentation commands. This feature is just a bit too useful to clobber! -You can assign or change default key bindings using the @code{global-set-key} +You can assign or change default key bindings globally using the @code{global-set-key} function in your @file{~/.emacs} file like this: @example -(global-set-key "\C-cs" 'slime-selector) +(global-set-key "\C-c s" 'slime-selector) @end example @noindent which binds @kbd{C-c s} to the function @code{slime-selector}. +Alternatively, if you want to assign or change a key binding in just a +particular slime mode, you can use the @code{global-set-key} function in +your @file{~/.emacs} file like this: + at example +(define-key slime-repl-mode-map (kbd "C-c ;") 'slime-insert-balanced-comments) + at end example + at noindent +which binds @kbd{C-c ;} to the function + at code{slime-insert-balanced-comments} in the REPL buffer. + @c ----------------------- @node inferior-lisp, Multithreading, About key bindings, User-interface conventions @subsection @code{*inferior-lisp*} buffer @@ -446,7 +460,7 @@ categories: @strong{Programming, Compilation, Evaluation, Recovery, Inspector, and Profiling}, discussed in separate sections below. There are also comprehensive indices to commands by function (@pxref{Index -to Functions}) and by function (@pxref{Index to Key Bindings}). +to Functions}) and by key binding (@pxref{Index to Key Bindings}). @menu * Programming:: @@ -638,7 +652,7 @@ @SLIME{}'s cross-reference commands are based on the support provided by the Lisp system, which varies widely between Lisps. For systems -with no builtin @acronym{XREF} support @SLIME{} queries a portable +with no built-in @acronym{XREF} support @SLIME{} queries a portable @acronym{XREF} package, which is taken from the @cite{CMU AI Repository} and bundled with @SLIME{}. @@ -667,7 +681,7 @@ Show all known methods specialized on a class. @fcnanchor{slime-goto-xref} -Goto the cross-referenced location at point. +Go to the cross-referenced location at point. @end table @@ -706,6 +720,7 @@ @anchor{slime-pop-find-definition-stack} @item M-, + at itemx M-* @code{slime-pop-find-definition-stack} Go back to the point where @kbd{M-.} was invoked. This gives multi-level backtracking when @kbd{M-.} has been used several times. @@ -1100,16 +1115,22 @@ Go to the beginning of the line, but stop at the @REPL{} prompt. @anchor{slime-repl-next-input} - at anchor{slime-repl-next-matching-input} @anchor{slime-repl-previous-input} - at anchor{slime-repl-previous-matching-input} @item M-n @itemx M-p + at code{slime-repl-next-input, slime-repl-previous-input}@* +Go to next/previous in command history. + + at anchor{slime-repl-next-matching-input} + at anchor{slime-repl-previous-matching-input} @itemx M-s @itemx M-r - at code{slime-repl-@{next,previous@}-input}@* - at code{slime-repl-@{next,previous@}-matching-input}@* - at code{comint}-style input history commands. + at code{slime-repl-next-matching-input, slime-repl-previous-matching-input}@* +Search forward/reverse through command history with regex + + at c @code{slime-repl-@{next,previous@}-input}@* + at c @code{slime-repl-@{next,previous@}-matching-input}@* + at c @code{comint}-style input history commands. @anchor{slime-repl-next-prompt} @anchor{slime-repl-previous-prompt} @@ -1139,10 +1160,69 @@ @REPL{} prompt and then enter the shortcut's name when prompted. Shortcuts deal with things like switching between directories and -compiling and loading Lisp systems. The exact set of shortcuts is not -currently documented in this manual, but you can use the @code{help} +compiling and loading Lisp systems. The set of shortcuts is listed +below, and you can also use the @code{help} shortcut to list them interactively. + at table @kbd + at item change-directory (aka !d, cd) +Change the current directory. + + at item change-package (aka !p) +Change the current package. + + at item compile-and-load (aka cl) +Compile (if neccessary) and load a lisp file. + + at item compile-system +Compile (but not load) an ASDF system. + + at item defparameter (aka !) +Define a new global, special, variable. + + at item force-compile-system +Recompile (but not load) an ASDF system. + + at item force-load-system +Recompile and load an ASDF system. + + at item help (aka ?) +Display the help. + + at item load-system +Compile (as needed) and load an ASDF system. + + at item pop-directory (aka -d) +Pop the current directory. + + at item pop-package (aka -p) +Pop the top of the package stack. + + at item push-directory (aka +d, pushd) +Push a new directory onto the directory stack. + + at item push-package (aka +p) +Push a package onto the package stack. + + at item pwd +Show the current directory. + + at item quit +Quit the current Lisp. + + at item resend-form +Resend the last form. + + at item restart-inferior-lisp +Restart *inferior-lisp* and reconnect SLIME. + + at item sayoonara +Quit all Lisps and close all SLIME buffers. + + at end table + + + @c ----------------------- @node Debugger, Extras, REPL, Top @chapter SLDB: the SLIME debugger @@ -1256,7 +1336,9 @@ Exit @SLDB{} and debug the condition using the Lisp system's default debugger. - at c @anchor{slime-interactive-eval} + at fcnanchor{in-sldb-face} +Return STRING propertised with face sldb-NAME-face. + @kbditem{C-c :, slime-interactive-eval} Evaluate an expression entered in the minibuffer. @end table @@ -1414,7 +1496,7 @@ Connect to a running Swank server. @fcnanchor{slime-disconnect} -Disconnect all connextions. +Disconnect all connections. @fcnanchor{slime-connection-list-mode} Connection-list. @acronym{SLIME} Connection List Mode. @@ -1541,6 +1623,7 @@ @table @code + at fcnanchor{slime-mode-hook} @item slime-mode-hook This hook is run each time a buffer enters @code{slime-mode}. It is most useful for setting buffer-local configuration in your Lisp source @@ -1621,7 +1704,7 @@ @end table The default request handling style is chosen according to the -capabilities your Lisp system. The general order of preference is +capabilities of your Lisp system. The general order of preference is @code{:SPAWN}, then @code{:SIGIO}, then @code{:FD-HANDLER}, with @code{NIL} as a last resort. You can check the default style by calling @code{SWANK-BACKEND:PREFERRED-COMMUNICATION-STYLE}. You can @@ -1744,7 +1827,7 @@ Since we're going to be tunneling our connection via ssh at footnote{there is a way to connect without an ssh tunnel, but it has the side-effect of giving the entire world access to your lisp -image, se we're not gonig to talk about it} and we'll only have on +image, se we're not gonig to talk about it} and we'll only have one port open we want to tell swank to not use an extra connection for output: @@ -1852,7 +1935,7 @@ friends outside of the @REPL{}. If you have any other threads which call @code{format}, @code{write-string}, etc. that output will be seen only in the @code{*inferior-lisp*} buffer or on the terminal, more -often than not this inconvenient. So, if you want code such as this: +often than not this is inconvenient. So, if you want code such as this: @example (run-in-new-thread @@ -1925,6 +2008,7 @@ @c ----------------------- @node Index to Key Bindings, Index to Functions, Credits, Top @appendix Index to Key Bindings +These are the keybindings set by default in Slime. @table @kbd @kbdindex{SPC, slime-space} @@ -1974,7 +2058,7 @@ @kbdindex{M-TAB, slime-complete-symbol} @kbdindex{M-*, slime-pop-find-definition-stack} @kbdindex{M-., slime-edit-definition} - at kbdindex{M-\,, slime-pop-find-definition-stack} + at kbdindex{M- at comma{}, slime-pop-find-definition-stack} @kbdindex{M-n, slime-next-note} @kbdindex{M-p, slime-previous-note} @kbdindex{C-M-i, slime-complete-symbol} @@ -1985,31 +2069,21 @@ @node Index to Functions, , Index to Key Bindings, Top @appendix Index to Functions - at c Note: the functions commented out below are in slime.el but as - at c yet unreferenced (and may or may not be -jkc-). +These functions are all available (when relevant). To find the +keybinding (if there is one) refer to the function description. + + at c Note to editors: @fcnindex{...} lines commented out below are place holders + at c ---------------- + at c They have yet to be documented + at c Please feel free to add descriptions in the text where appropriate, add the + at c appropriate anchors and uncomment them. + at c + at c [jkc] + @table @code @fcnindex{common-lisp-hyperspec-format} - at c @fcnindex{sldb-mode-hook} - at c @fcnindex{slime-mode-hook} - at c @fcnindex{slime-repl-mode-hook} - at c @fcnindex{compile} - at c @fcnindex{compile-defun} - at c @fcnindex{fboundp} - at c @fcnindex{def-sldb-face} - at c @fcnindex{def-sldb-faces} - at c @fcnindex{def-slime-selector-method} - at c @fcnindex{def-slime-test} - at c @fcnindex{define-sldb-invoke-restart-key} - at c @fcnindex{define-sldb-invoke-restart-keys} - at c @fcnindex{define-slime-dialect} - at c @fcnindex{defslime-repl-shortcut} - at c @fcnindex{destructure-case} - at c @fcnindex{in-sldb-face} - at c @fcnindex{inferior-slime-closing-return} - at c @fcnindex{inferior-slime-indent-line} - at c @fcnindex{inferior-slime-input-complete-p} - at c @fcnindex{inferior-slime-return} + at fcnindex{in-sldb-face} @fcnindex{sldb-abort} @c @fcnindex{sldb-activate} @c @fcnindex{sldb-add-face} @@ -2064,6 +2138,7 @@ @c @fcnindex{sldb-list-locals} @c @fcnindex{sldb-lookup-reference} @c @fcnindex{sldb-maybe-recenter-region} + at c @fcnindex{sldb-mode-hook} @c @fcnindex{sldb-next} @c @fcnindex{sldb-out} @fcnindex{sldb-pprint-eval-in-frame} @@ -2086,603 +2161,193 @@ @c @fcnindex{sldb-var-number-at-point} @c @fcnindex{sldb-xemacs-emulate-point-entered-hook} @c @fcnindex{sldb-xemacs-post-command-hook} + + + at c @fcnindex{inferior-slime-closing-return} + at c @fcnindex{inferior-slime-indent-line} + at c @fcnindex{inferior-slime-mode} + at c @fcnindex{inferior-slime-return} @fcnindex{slime-abort-connection} - at c @fcnindex{slime-accept-process-output} - at c @fcnindex{slime-activate-font-lock-magic} - at c @fcnindex{slime-add-face} - at c @fcnindex{slime-add-presentation-properties} - at c @fcnindex{slime-after-change-function} - at c @fcnindex{slime-alistify} @fcnindex{slime-apropos} @fcnindex{slime-apropos-all} @fcnindex{slime-apropos-package} - at c @fcnindex{slime-apropos-summary} [internal] @c @fcnindex{slime-arglist} - at c @fcnindex{slime-arglist-specializers} - at c @fcnindex{slime-at-top-level-p} - at c @fcnindex{slime-autodoc} [internal] - at c @fcnindex{slime-autodoc-global-at-point} [internal] - at c @fcnindex{slime-autodoc-message} [internal] - at c @fcnindex{slime-autodoc-message-dimensions} [internal] - at c @fcnindex{slime-autodoc-message-ok-p} [internal] @fcnindex{slime-autodoc-mode} - at c @fcnindex{slime-autodoc-pre-command-refresh-echo-area} [internal] - at c @fcnindex{slime-autodoc-start-timer} ?? - at c @fcnindex{slime-autodoc-stop-timer} [internal] - at c @fcnindex{slime-autodoc-thing-at-point} [internal] - at c @fcnindex{slime-autodoc-timer-hook} [internal] + at c @fcnindex{slime-autodoc-start-timer} @c @fcnindex{slime-background-activities-enabled-p} @c @fcnindex{slime-background-message} - at c @fcnindex{slime-batch-test} - at c @fcnindex{slime-beginning-of-comment} [internal] - at c @fcnindex{slime-beginning-of-list} [internal] - at c @fcnindex{slime-beginning-of-symbol} [internal] - at c @fcnindex{slime-bogus-completion-alist} @c @fcnindex{slime-browse-classes} @c @fcnindex{slime-browse-xrefs} - at c @fcnindex{slime-buffer-substring-with-reified-output} - at c @fcnindex{slime-busy-p} - at c @fcnindex{slime-bytecode-stale-p} @fcnindex{slime-call-defun} - at c @fcnindex{slime-call-describer} - at c @fcnindex{slime-call-with-browser-setup} @fcnindex{slime-calls-who} - at c @fcnindex{slime-changelog-date} - at c @fcnindex{slime-cheat-sheet} - at c @fcnindex{slime-cheat-sheet-table} - at c @fcnindex{slime-check} @c @fcnindex{slime-check-coding-system} - at c @fcnindex{slime-check-connected} - at c @fcnindex{slime-check-eval-in-emacs-enabled} - at c @fcnindex{slime-check-sldb-level} - at c @fcnindex{slime-check-top-level} - at c @fcnindex{slime-choose-connection} - at c @fcnindex{slime-choose-overlay-for-sexp} - at c @fcnindex{slime-choose-overlay-region} - at c @fcnindex{slime-cl-symbol-external-ref-p} - at c @fcnindex{slime-cl-symbol-name} - at c @fcnindex{slime-cl-symbol-package} @fcnindex{slime-close-all-sexp} [571 lines skipped] From mbaringer at common-lisp.net Wed Jan 17 15:44:01 2007 From: mbaringer at common-lisp.net (mbaringer) Date: Wed, 17 Jan 2007 10:44:01 -0500 (EST) Subject: [slime-cvs] CVS slime Message-ID: <20070117154401.D74AA2B13C@common-lisp.net> Update of /project/slime/cvsroot/slime In directory clnet:/tmp/cvs-serv28482 Modified Files: ChangeLog Log Message: --- /project/slime/cvsroot/slime/ChangeLog 2007/01/14 09:33:13 1.1053 +++ /project/slime/cvsroot/slime/ChangeLog 2007/01/17 15:44:01 1.1054 @@ -1,3 +1,8 @@ +2007-01-17 Christian Lynbech + + * slime.el (slime-init-command): Use expanded files when writing + the LOAD form for swank. + 2007-01-14 Helmut Eller * slime.el: Cleanups for the repl history code. From mbaringer at common-lisp.net Wed Jan 17 15:44:29 2007 From: mbaringer at common-lisp.net (mbaringer) Date: Wed, 17 Jan 2007 10:44:29 -0500 (EST) Subject: [slime-cvs] CVS slime Message-ID: <20070117154429.C6D3C3D008@common-lisp.net> Update of /project/slime/cvsroot/slime In directory clnet:/tmp/cvs-serv28562 Modified Files: slime.el Log Message: (slime-init-command): Use expanded files when writing the LOAD form for swank. --- /project/slime/cvsroot/slime/slime.el 2007/01/14 09:32:06 1.747 +++ /project/slime/cvsroot/slime/slime.el 2007/01/17 15:44:29 1.748 @@ -1731,7 +1731,7 @@ ;; Return a single form to avoid problems with buffered input. (format "%S\n\n" `(progn - (load ,loader :verbose t) + (load ,(expand-file-name loader) :verbose t) (funcall (read-from-string "swank:start-server") ,port-filename :coding-system ,encoding))))) From alendvai at common-lisp.net Sat Jan 20 14:15:18 2007 From: alendvai at common-lisp.net (alendvai) Date: Sat, 20 Jan 2007 09:15:18 -0500 (EST) Subject: [slime-cvs] CVS slime Message-ID: <20070120141518.B56A93147@common-lisp.net> Update of /project/slime/cvsroot/slime In directory clnet:/tmp/cvs-serv12557 Modified Files: slime.el Log Message: Fix slime-repl-defparameter by Kilian Sprotte --- /project/slime/cvsroot/slime/slime.el 2007/01/17 15:44:29 1.748 +++ /project/slime/cvsroot/slime/slime.el 2007/01/20 14:15:17 1.749 @@ -4473,10 +4473,11 @@ (defslime-repl-shortcut slime-repl-defparameter ("defparameter" "!") (:handler (lambda (name value) (interactive (list (slime-read-symbol-name "Name (symbol): " t) - (slime-read-from-minibuffer "Value: " "*"))) + (slime-read-from-minibuffer "Value: " + :initial-value "*"))) (insert "(cl:defparameter " name " " value " \"REPL generated global variable.\")") - (slime-repl-send-input))) + (slime-repl-send-input t))) (:one-liner "Define a new global, special, variable.")) (defslime-repl-shortcut slime-repl-compile-and-load ("compile-and-load" "cl") From lgorrie at common-lisp.net Sat Jan 20 15:49:27 2007 From: lgorrie at common-lisp.net (lgorrie) Date: Sat, 20 Jan 2007 10:49:27 -0500 (EST) Subject: [slime-cvs] CVS slime Message-ID: <20070120154927.DE6372405A@common-lisp.net> Update of /project/slime/cvsroot/slime In directory clnet:/tmp/cvs-serv7740 Modified Files: slime.el Log Message: (slime): Use COMMAND and CODING-SYSTEM parameters. Previously they were ignored. --- /project/slime/cvsroot/slime/slime.el 2007/01/20 14:15:17 1.749 +++ /project/slime/cvsroot/slime/slime.el 2007/01/20 15:49:27 1.750 @@ -1484,7 +1484,9 @@ (defun slime (&optional command coding-system) "Start an inferior^_superior Lisp and connect to its Swank server." (interactive) - (apply #'slime-start (slime-read-interactive-args))) + (let ((inferior-lisp-program (or command inferior-lisp-program)) + (slime-net-coding-system (or coding-system slime-net-coding-system))) + (apply #'slime-start (slime-read-interactive-args)))) (defun slime-read-interactive-args () "Return the list of args which should be passed to `slime-start'. From lgorrie at common-lisp.net Sat Jan 20 15:49:48 2007 From: lgorrie at common-lisp.net (lgorrie) Date: Sat, 20 Jan 2007 10:49:48 -0500 (EST) Subject: [slime-cvs] CVS slime Message-ID: <20070120154948.831612F044@common-lisp.net> Update of /project/slime/cvsroot/slime In directory clnet:/tmp/cvs-serv7892 Modified Files: ChangeLog Log Message: *** empty log message *** --- /project/slime/cvsroot/slime/ChangeLog 2007/01/17 15:44:01 1.1054 +++ /project/slime/cvsroot/slime/ChangeLog 2007/01/20 15:49:48 1.1055 @@ -1,3 +1,8 @@ +2007-01-20 Luke Gorrie + + * slime.el (slime): Use COMMAND and CODING-SYSTEM parameters + Previously they were ignored. + 2007-01-17 Christian Lynbech * slime.el (slime-init-command): Use expanded files when writing From mbaringer at common-lisp.net Wed Jan 24 15:12:04 2007 From: mbaringer at common-lisp.net (mbaringer) Date: Wed, 24 Jan 2007 10:12:04 -0500 (EST) Subject: [slime-cvs] CVS slime Message-ID: <20070124151204.A40175B075@common-lisp.net> Update of /project/slime/cvsroot/slime In directory clnet:/tmp/cvs-serv30141 Modified Files: slime.el Log Message: (slime-call-defun): Put the docstring before the (interactive) form so that "C-h f slime-call-defun" will return it. --- /project/slime/cvsroot/slime/slime.el 2007/01/20 15:49:27 1.750 +++ /project/slime/cvsroot/slime/slime.el 2007/01/24 15:12:03 1.751 @@ -7077,8 +7077,8 @@ (slime-eval-print string)) (defun slime-call-defun () - (interactive) "Insert a call to the function defined around point into the REPL." + (interactive) (let ((toplevel (slime-parse-toplevel-form))) (unless (and (consp toplevel) (member (car toplevel) '(:defun :defmethod :defgeneric)) From mbaringer at common-lisp.net Wed Jan 24 15:13:31 2007 From: mbaringer at common-lisp.net (mbaringer) Date: Wed, 24 Jan 2007 10:13:31 -0500 (EST) Subject: [slime-cvs] CVS slime Message-ID: <20070124151331.B26EB671A7@common-lisp.net> Update of /project/slime/cvsroot/slime In directory clnet:/tmp/cvs-serv30324 Modified Files: ChangeLog Log Message: --- /project/slime/cvsroot/slime/ChangeLog 2007/01/20 15:49:48 1.1055 +++ /project/slime/cvsroot/slime/ChangeLog 2007/01/24 15:13:31 1.1056 @@ -1,3 +1,9 @@ +2007-01-24 Bill Clementson + + * slime.el (slime-call-defun): Put the docstring before + the (interactive) form so that "C-h f slime-call-defun" will + return it. + 2007-01-20 Luke Gorrie * slime.el (slime): Use COMMAND and CODING-SYSTEM parameters From mbaringer at common-lisp.net Wed Jan 24 15:28:58 2007 From: mbaringer at common-lisp.net (mbaringer) Date: Wed, 24 Jan 2007 10:28:58 -0500 (EST) Subject: [slime-cvs] CVS slime/doc Message-ID: <20070124152858.EC17438013@common-lisp.net> Update of /project/slime/cvsroot/slime/doc In directory clnet:/tmp/cvs-serv1869/doc Modified Files: slime.texi Log Message: --- /project/slime/cvsroot/slime/doc/slime.texi 2007/01/16 02:01:26 1.52 +++ /project/slime/cvsroot/slime/doc/slime.texi 2007/01/24 15:28:58 1.53 @@ -10,7 +10,7 @@ @set EDITION 2.0 @c @set UPDATED @today{} - at set UPDATED @code{$Date: 2007/01/16 02:01:26 $} + at set UPDATED @code{$Date: 2007/01/24 15:28:58 $} @set TITLE SLIME User Manual @settitle @value{TITLE}, version @value{EDITION} @@ -1827,7 +1827,7 @@ Since we're going to be tunneling our connection via ssh at footnote{there is a way to connect without an ssh tunnel, but it has the side-effect of giving the entire world access to your lisp -image, se we're not gonig to talk about it} and we'll only have one +image, so we're not going to talk about it} and we'll only have one port open we want to tell swank to not use an extra connection for output: From mbaringer at common-lisp.net Wed Jan 24 16:11:34 2007 From: mbaringer at common-lisp.net (mbaringer) Date: Wed, 24 Jan 2007 11:11:34 -0500 (EST) Subject: [slime-cvs] CVS slime Message-ID: <20070124161134.9C62B5B076@common-lisp.net> Update of /project/slime/cvsroot/slime In directory clnet:/tmp/cvs-serv9914 Modified Files: ChangeLog Log Message: --- /project/slime/cvsroot/slime/ChangeLog 2007/01/24 15:13:31 1.1056 +++ /project/slime/cvsroot/slime/ChangeLog 2007/01/24 16:11:34 1.1057 @@ -3,6 +3,11 @@ * slime.el (slime-call-defun): Put the docstring before the (interactive) form so that "C-h f slime-call-defun" will return it. + + * slime.el (slime-scratch-mode-map): Changed parent keymap to + lisp-mode-map to prevent unnecessary duplication of slime-mode-map + bindings and so that lisp-mode-map key bindings are present in the + slime scratch buffer. Change identified by Ariel Badichi. 2007-01-20 Luke Gorrie From mbaringer at common-lisp.net Wed Jan 24 16:12:42 2007 From: mbaringer at common-lisp.net (mbaringer) Date: Wed, 24 Jan 2007 11:12:42 -0500 (EST) Subject: [slime-cvs] CVS slime Message-ID: <20070124161242.081D768003@common-lisp.net> Update of /project/slime/cvsroot/slime In directory clnet:/tmp/cvs-serv10059 Modified Files: slime.el Log Message: (slime-scratch-mode-map): Changed parent keymap to lisp-mode-map to prevent unnecessary duplication of slime-mode-map bindings and so that lisp-mode-map key bindings are present in the slime scratch buffer. Change identified by Ariel Badichi. --- /project/slime/cvsroot/slime/slime.el 2007/01/24 15:12:03 1.751 +++ /project/slime/cvsroot/slime/slime.el 2007/01/24 16:12:41 1.752 @@ -4584,7 +4584,7 @@ (defvar slime-scratch-mode-map (let ((map (make-sparse-keymap))) - (set-keymap-parent map slime-mode-map) + (set-keymap-parent map lisp-mode-map) map)) (defun slime-scratch-buffer () From heller at common-lisp.net Wed Jan 24 22:54:08 2007 From: heller at common-lisp.net (heller) Date: Wed, 24 Jan 2007 17:54:08 -0500 (EST) Subject: [slime-cvs] CVS slime Message-ID: <20070124225408.A463C15145@common-lisp.net> Update of /project/slime/cvsroot/slime In directory clnet:/tmp/cvs-serv17859 Modified Files: swank.lisp Log Message: (unparse-name): New function. (list-all-package-names): Use it. This fixes a bug related to readtable-case and makes package name completions look prettier. Suggested by Harald Hanche-Olsen . --- /project/slime/cvsroot/slime/swank.lisp 2007/01/12 15:26:05 1.457 +++ /project/slime/cvsroot/slime/swank.lisp 2007/01/24 22:54:08 1.458 @@ -1441,6 +1441,11 @@ (= (length string) pos) (find-package name)))) +(defun unparse-name (string) + "Print the name STRING according to the current printer settings." + ;; this is intended for package or symbol names + (subseq (prin1-to-string (make-symbol string)) 2)) + (defun guess-package-from-string (name &optional (default-package *package*)) (or (and name (or (parse-package name) @@ -2510,7 +2515,7 @@ (format nil "~A~D (#x~X, #o~O, #b~B)" *echo-area-prefix* i i i i))) (t (with-output-to-string (s) - (pprint-logical-block (s values :prefix *echo-area-prefix*) + (pprint-logical-block (s () :prefix *echo-area-prefix*) (format s "~{~S~^, ~}" values)))))))) (defslimefun interactive-eval (string) @@ -2595,11 +2600,10 @@ (defun package-string-for-prompt (package) "Return the shortest nickname (or canonical name) of PACKAGE." - (princ-to-string - (make-symbol - (or (canonical-package-nickname package) - (auto-abbreviated-package-name package) - (shortest-package-nickname package))))) + (unparse-name + (or (canonical-package-nickname package) + (auto-abbreviated-package-name package) + (shortest-package-nickname package)))) (defun canonical-package-nickname (package) "Return the canonical package nickname, if any, of PACKAGE." @@ -2663,7 +2667,8 @@ (defslimefun set-package (package) "Set *package* to PACKAGE. Return its name and the string to use in the prompt." - (let ((p (setq *package* (guess-package-from-string package)))) + (let ((p (parse-package package))) + (setq *package* p) (list (package-name p) (package-string-for-prompt p)))) (defun send-repl-results-to-emacs (values) @@ -3898,19 +3903,13 @@ "Make an apropos search for Emacs. The result is a list of property lists." (let ((package (if package - (or (find-package (string-to-package-designator package)) + (or (parse-package package) (error "No such package: ~S" package))))) (mapcan (listify #'briefly-describe-symbol-for-emacs) (sort (remove-duplicates (apropos-symbols name external-only case-sensitive package)) #'present-symbol-before-p)))) -(defun string-to-package-designator (string) - "Return a package designator made from STRING. -Uses READ to case-convert STRING." - (let ((*package* *swank-io-package*)) - (read-from-string string))) - (defun briefly-describe-symbol-for-emacs (symbol) "Return a property list describing SYMBOL. Like `describe-symbol-for-emacs' but with at most one line per item." @@ -4030,12 +4029,13 @@ ;;;; Package Commands -(defslimefun list-all-package-names (&optional include-nicknames) +(defslimefun list-all-package-names (&optional nicknames) "Return a list of all package names. -Include the nicknames if INCLUDE-NICKNAMES is true." - (loop for package in (list-all-packages) - collect (package-name package) - when include-nicknames append (package-nicknames package))) +Include the nicknames if NICKNAMES is true." + (mapcar #'unparse-name + (loop for package in (list-all-packages) + collect (package-name package) + when nicknames append (package-nicknames package)))) ;;;; Tracing From heller at common-lisp.net Wed Jan 24 22:55:20 2007 From: heller at common-lisp.net (heller) Date: Wed, 24 Jan 2007 17:55:20 -0500 (EST) Subject: [slime-cvs] CVS slime Message-ID: <20070124225520.E0B2A3D00E@common-lisp.net> Update of /project/slime/cvsroot/slime In directory clnet:/tmp/cvs-serv17932 Modified Files: slime.el Log Message: (sldb-recenter-region): Use count-screen-lines instead of count-lines. --- /project/slime/cvsroot/slime/slime.el 2007/01/24 16:12:41 1.752 +++ /project/slime/cvsroot/slime/slime.el 2007/01/24 22:55:13 1.753 @@ -4032,7 +4032,7 @@ ;;;;; History (defcustom slime-repl-wrap-history nil - "T to wrap history around when the end is reached." + "*T to wrap history around when the end is reached." :type 'boolean :group 'slime-repl) @@ -8371,7 +8371,6 @@ (interactive) (goto-char sldb-backtrace-start-marker)) - ;;;;;; SLDB recenter & redisplay @@ -8405,7 +8404,7 @@ Avoid point motions, if possible. Minimize scrolling, if CENTER is nil. If CENTER is true, scroll enough to center the region in the window." - (let ((pos (point)) (lines (count-lines start end))) + (let ((pos (point)) (lines (count-screen-lines start end t))) (assert (and (<= start pos) (<= pos end))) ;;(sit-for 0) (cond ((and (pos-visible-in-window-p start) @@ -8414,11 +8413,13 @@ (cond (center (recenter (+ (/ (- (window-height) 1 lines) 2) (slime-count-lines start pos)))) - (t (recenter (+ (- (window-height) 2 lines) + (t (recenter (+ (- (window-height) 1 lines) (slime-count-lines start pos)))))) (t - (set-window-start (selected-window) start) - (cond ((pos-visible-in-window-p pos)) + (goto-char start) + (recenter 0) + (cond ((pos-visible-in-window-p pos) + (goto-char pos)) (t (goto-char start) (next-line (- (window-height) 2)))))))) @@ -8567,15 +8568,14 @@ (let ((indent1 " ") (indent2 " ")) (insert indent1 (in-sldb-face section - (if locals "Locals:" "[No Locals]")) - "\n") + (if locals "Locals:" "[No Locals]")) "\n") (sldb-insert-locals locals indent2 frame) (when catches - (insert indent1 (in-sldb-face section "Catch-tags:\n")) + (insert indent1 (in-sldb-face section "Catch-tags:") "\n") (dolist (tag catches) (slime-propertize-region `(catch-tag ,tag) - (insert indent2 (in-sldb-face catch-tag - (format "%s\n" tag)))))) + (insert indent2 (in-sldb-face catch-tag (format "%s" tag)) + "\n")))) (setq end (point))))) (sldb-recenter-region start end))) From heller at common-lisp.net Wed Jan 24 22:56:20 2007 From: heller at common-lisp.net (heller) Date: Wed, 24 Jan 2007 17:56:20 -0500 (EST) Subject: [slime-cvs] CVS slime Message-ID: <20070124225620.628774B053@common-lisp.net> Update of /project/slime/cvsroot/slime In directory clnet:/tmp/cvs-serv18391 Modified Files: ChangeLog Log Message: *** empty log message *** --- /project/slime/cvsroot/slime/ChangeLog 2007/01/24 16:11:34 1.1057 +++ /project/slime/cvsroot/slime/ChangeLog 2007/01/24 22:56:19 1.1058 @@ -1,3 +1,13 @@ +2007-01-24 Helmut Eller + + * slime.el (sldb-recenter-region): Use count-screen-lines instead + of count-lines. + + * swank.lisp (unparse-name): New function. + (list-all-package-names): Use it. This fixes a bug related to + readtable-case and makes package name completions look prettier. + Suggested by Harald Hanche-Olsen . + 2007-01-24 Bill Clementson * slime.el (slime-call-defun): Put the docstring before From jcunningham at common-lisp.net Sat Jan 27 18:42:35 2007 From: jcunningham at common-lisp.net (jcunningham) Date: Sat, 27 Jan 2007 13:42:35 -0500 (EST) Subject: [slime-cvs] CVS slime/doc Message-ID: <20070127184235.6269B54122@common-lisp.net> Update of /project/slime/cvsroot/slime/doc In directory clnet:/tmp/cvs-serv5167/slime/doc Modified Files: slime.texi Log Message: Added brief discussion of Emacs help system as applies to Slime in the "Key bindings" section, raised the level of the "Keybindings" from subsection to section (on the same level as "Commands", and eliminated the "key bindings index". (jeff cunningham) --- /project/slime/cvsroot/slime/doc/slime.texi 2007/01/24 15:28:58 1.53 +++ /project/slime/cvsroot/slime/doc/slime.texi 2007/01/27 18:42:35 1.54 @@ -10,7 +10,7 @@ @set EDITION 2.0 @c @set UPDATED @today{} - at set UPDATED @code{$Date: 2007/01/24 15:28:58 $} + at set UPDATED @code{$Date: 2007/01/27 18:42:35 $} @set TITLE SLIME User Manual @settitle @value{TITLE}, version @value{EDITION} @@ -25,9 +25,10 @@ @c Written by Luke Gorrie. @c - at c This file has been placed in the public domain. + at c Additional contributions: Jeff Cunningham, @c - at c Modified by Jeff Cunningham. + at c This file has been placed in the public domain. + @macro SLIME @acronym{SLIME} @@ -56,6 +57,13 @@ @code{\command\}@* @end macro + at macro kbdanchorc{key, command, comment} + at anchor{\command\} + at item \key\ + at code{\command\} + at i{\comment\}@* + at end macro + @macro kbdindex{key, command} @item \key\ @xref{\command\}. @@ -95,7 +103,6 @@ * Customization:: * Tips and Tricks:: * Credits:: -* Index to Key Bindings:: * Index to Functions:: @end menu @@ -299,7 +306,8 @@ @c ----------------------- @node slime-mode, REPL, Getting started, Top - at chapter @code{slime-mode} + at c @chapter @code{slime-mode} + at chapter Using slime-mode @SLIME{}'s commands are provided via @code{slime-mode}, a minor-mode used in conjunction with Emacs's @code{lisp-mode}. This chapter @@ -307,13 +315,14 @@ @menu * User-interface conventions:: +* Key bindings:: * Commands:: * Semantic indentation:: * Reader conditionals:: @end menu @c ----------------------- - at node User-interface conventions, Commands, slime-mode, slime-mode + at node User-interface conventions, Key bindings, slime-mode, slime-mode @section User-interface conventions To use @SLIME{} comfortably it is important to understand a few @@ -322,13 +331,12 @@ @menu * Temporary buffers:: -* About key bindings:: -* inferior-lisp:: +* Inferior-lisp:: * Multithreading:: @end menu @c ----------------------- - at node Temporary buffers, About key bindings, User-interface conventions, User-interface conventions + at node Temporary buffers, Inferior-lisp, User-interface conventions, User-interface conventions @subsection Temporary buffers Some @SLIME{} commands create temporary buffers to display their @@ -354,51 +362,7 @@ function definitions, and so on. @c ----------------------- - at node About key bindings, inferior-lisp, Temporary buffers, User-interface conventions - at subsection About key bindings - -A (near) complete list of the default keybindings set by @SLIME{} is -given in an appendix (@pxref{Index to Key Bindings}), with links to -their descriptions. - -In general we try to make our key bindings fit with the overall Emacs -style. We also have the following somewhat unusual convention of our -own: when entering a three-key sequence, the final key can be pressed -either with control or unmodified. For example, the - at code{slime-describe-symbol} command is bound to @kbd{C-c C-d d}, but -it also works to type @kbd{C-c C-d C-d}. We're simply binding both key -sequences because some people like to hold control for all three keys -and others don't, and with the two-key prefix we're not afraid of -running out of keys. - -There is one exception to this rule, just to trip you up. We never -bind @kbd{C-h} anywhere in a key sequence, so @kbd{C-c C-d C-h} -doesn't do the same thing as @kbd{C-c C-d h}. This is because Emacs -has a built-in default so that typing a prefix followed by @kbd{C-h} -will display all bindings starting with that prefix, so @kbd{C-c C-d -C-h} will actually list the bindings for all documentation commands. -This feature is just a bit too useful to clobber! - -You can assign or change default key bindings globally using the @code{global-set-key} -function in your @file{~/.emacs} file like this: - at example -(global-set-key "\C-c s" 'slime-selector) - at end example - at noindent -which binds @kbd{C-c s} to the function @code{slime-selector}. - -Alternatively, if you want to assign or change a key binding in just a -particular slime mode, you can use the @code{global-set-key} function in -your @file{~/.emacs} file like this: - at example -(define-key slime-repl-mode-map (kbd "C-c ;") 'slime-insert-balanced-comments) - at end example - at noindent -which binds @kbd{C-c ;} to the function - at code{slime-insert-balanced-comments} in the REPL buffer. - - at c ----------------------- - at node inferior-lisp, Multithreading, About key bindings, User-interface conventions + at node Inferior-lisp, Multithreading, Temporary buffers, User-interface conventions @subsection @code{*inferior-lisp*} buffer @SLIME{} internally uses the @code{inferior-lisp} package to start @@ -426,7 +390,7 @@ equivalent. @c ----------------------- - at node Multithreading, , inferior-lisp, User-interface conventions + at node Multithreading, , Inferior-lisp, User-interface conventions @subsection Multithreading If the Lisp system supports multithreading, SLIME spawns a new thread @@ -453,14 +417,91 @@ @end example @c ----------------------- - at node Commands, Semantic indentation, User-interface conventions, slime-mode + at node Key bindings, Commands, User-interface conventions, slime-mode + at section Key bindings + + at quotation + at i{``Are you deliberately spiting Emacs's brilliant online help facilities? The gods will be angry!''} + at end quotation + + at noindent This is a brilliant piece of advice. The Emacs online help facilities +are your most immediate, up-to-date and complete resource for keybinding +information. They are your friends: + + at table @kbd + at kbdanchorc{C-h k , describe-key, ``What does this key do?''} +Describes current function bound to @kbd{} for focus buffer. + + at kbdanchorc{C-h b, describe-bindings, ``Exactly what bindings are available?''} +Lists the current key-bindings for the focus buffer. + + at kbdanchorc{C-h m, describe-mode, ``Tell me all about this mode''} +Shows all the available major mode keys, then the minor mode keys, for +the modes of the focus buffer. + + at kbdanchorc{C-h l, view-lossage, ``Woah at comma{} what key chord did I just do?''} +Shows you the literal sequence of keys you've pressed in order. + + at kbdanchorc{ l, , ``What starts with?''} +Lists all keybindings that begin with @code{} for the focus buffer mode. + + at end table + + at emph{Note:} In this documentation the designation @kbd{C-h} is a @dfn{cannonical key} which might actually mean Ctrl-h, or F1, or whatever you have @code{help-command} bound to in your @code{.emacs}. Here is a common situation: + + at example +(global-set-key [f1] 'help-command) +(global-set-key "\C-h" 'delete-backward-char) + at end example + + at noindent In this situation everywhere you see @kbd{C-h} in the documentation you would substitute @kbd{F1}. + +In general we try to make our key bindings fit with the overall Emacs +style. We also have the following somewhat unusual convention of our +own: when entering a three-key sequence, the final key can be pressed +either with control or unmodified. For example, the + at code{slime-describe-symbol} command is bound to @kbd{C-c C-d d}, but +it also works to type @kbd{C-c C-d C-d}. We're simply binding both key +sequences because some people like to hold control for all three keys +and others don't, and with the two-key prefix we're not afraid of +running out of keys. + +There is one exception to this rule, just to trip you up. We never +bind @kbd{C-h} anywhere in a key sequence, so @kbd{C-c C-d C-h} +doesn't do the same thing as @kbd{C-c C-d h}. This is because Emacs +has a built-in default so that typing a prefix followed by @kbd{C-h} +will display all bindings starting with that prefix, so @kbd{C-c C-d +C-h} will actually list the bindings for all documentation commands. +This feature is just a bit too useful to clobber! + +You can assign or change default key bindings globally using the @code{global-set-key} +function in your @file{~/.emacs} file like this: + at example +(global-set-key "\C-c s" 'slime-selector) + at end example + at noindent +which binds @kbd{C-c s} to the function @code{slime-selector}. + +Alternatively, if you want to assign or change a key binding in just a +particular slime mode, you can use the @code{global-set-key} function in +your @file{~/.emacs} file like this: + at example +(define-key slime-repl-mode-map (kbd "C-c ;") + 'slime-insert-balanced-comments) + at end example + at noindent +which binds @kbd{C-c ;} to the function + at code{slime-insert-balanced-comments} in the REPL buffer. + + at c ----------------------- + at node Commands, Semantic indentation, Key bindings, slime-mode @section Commands @acronym{SLIME} commands are divided into the following general categories: @strong{Programming, Compilation, Evaluation, Recovery, Inspector, and Profiling}, discussed in separate sections below. There are also comprehensive indices to commands by function (@pxref{Index -to Functions}) and by key binding (@pxref{Index to Key Bindings}). +to Functions}). @menu * Programming:: @@ -592,6 +633,9 @@ will be reindented. If the current defun has unbalanced parens, an attempt will be made to fix it before reindenting. + at kbdanchor{C-M-q, indent-sexp} +Indents the list immediately following point to match the level at point. + When given a prefix argument, the text around point will always be treated as a paragraph. This is useful for filling docstrings." @end table @@ -603,7 +647,7 @@ @SLIME{}'s online documentation commands follow the example of Emacs Lisp. The commands all share the common prefix @kbd{C-c C-d} and allow -the final key to be modified or unmodified (@pxref{About key bindings}.) +the final key to be modified or unmodified (@pxref{Key bindings}.) @table @kbd @@ -659,7 +703,7 @@ Each command operates on the symbol at point, or prompts if there is none. With a prefix argument they always prompt. You can either enter the key bindings as shown here or with the control modified on the -last key, @xref{About key bindings}. +last key, @xref{Key bindings}. @table @kbd @kbdanchor{C-c C-w c, slime-who-calls} @@ -1968,7 +2012,7 @@ @c ----------------------- - at node Credits, Index to Key Bindings, Tips and Tricks, Top + at node Credits, Index to Functions, Tips and Tricks, Top @chapter Credits @emph{The soppy ending...} @@ -2006,67 +2050,7 @@ @c ----------------------- - at node Index to Key Bindings, Index to Functions, Credits, Top - at appendix Index to Key Bindings -These are the keybindings set by default in Slime. - - at table @kbd - at kbdindex{SPC, slime-space} - at kbdindex{C-c RET, slime-macroexpand-1} - at kbdindex{C-c :, slime-interactive-eval} - at kbdindex{C-c <, slime-list-callers} - at kbdindex{C-c >, slime-list-callees} - at kbdindex{C-c E, slime-edit-value} - at kbdindex{C-c I, slime-inspect} - at kbdindex{C-c u, slime-undefine-function} - at kbdindex{C-c ~, slime-sync-package-and-default-directory} - at kbdindex{C-c C-], slime-close-all-sexp} - at kbdindex{C-c C-a, slime-nop} - at kbdindex{C-c C-b, slime-interrupt} - at kbdindex{C-c C-c, slime-compile-defun} - at kbdindex{C-c C-d d, slime-describe-symbol} - at kbdindex{C-c C-d ~, common-lisp-hyperspec-format} - at kbdindex{C-c C-e, slime-interactive-eval} - at kbdindex{C-c C-f, slime-describe-function} - at kbdindex{C-c C-i, slime-complete-symbol} - at kbdindex{C-c C-k, slime-compile-and-load-file} - at kbdindex{C-c C-l, slime-load-file} - at kbdindex{C-c C-m, slime-macroexpand-1} - at kbdindex{C-c C-p, slime-pprint-eval-last-expression} - at kbdindex{C-c C-q, slime-close-parens-at-point} - at kbdindex{C-c C-r, slime-eval-region} - at kbdindex{C-c C-s, slime-complete-form} - at kbdindex{C-c C-t, slime-toggle-trace-fdefinition} - at kbdindex{C-c C-v, slime-nop} - at kbdindex{C-c C-w s, slime-who-sets} - at kbdindex{C-c C-x c, slime-list-connections} - at kbdindex{C-c C-x t, slime-list-threads} - at kbdindex{C-c C-y, slime-call-defun} - at kbdindex{C-c C-z, slime-switch-to-output-buffer} - at kbdindex{C-c M-c, slime-remove-notes}. - at kbdindex{C-c M-d, slime-disassemble-symbol} - at kbdindex{C-c M-i, slime-fuzzy-complete-symbol} - at kbdindex{C-c M-g, slime-quit} - at kbdindex{C-c M-k, slime-compile-file} - at kbdindex{C-c M-m, slime-macroexpand-all} - at kbdindex{C-c M-p, slime-repl-set-package} - at kbdindex{C-c M-q, slime-reindent-defun} - at kbdindex{C-x 4 ., slime-edit-definition-other-window} - at kbdindex{C-x 5 ., slime-edit-definition-other-frame} - at kbdindex{C-x C-e, slime-eval-last-expression} - at kbdindex{C-x M-e, slime-eval-last-expression-display-output} - at kbdindex{M-TAB, slime-complete-symbol} - at kbdindex{M-*, slime-pop-find-definition-stack} - at kbdindex{M-., slime-edit-definition} - at kbdindex{M- at comma{}, slime-pop-find-definition-stack} - at kbdindex{M-n, slime-next-note} - at kbdindex{M-p, slime-previous-note} - at kbdindex{C-M-i, slime-complete-symbol} - at kbdindex{C-M-x, slime-eval-defun} - at end table - - at c ----------------------- - at node Index to Functions, , Index to Key Bindings, Top + at node Index to Functions, , Credits, Top @appendix Index to Functions These functions are all available (when relevant). To find the From heller at common-lisp.net Mon Jan 29 23:41:35 2007 From: heller at common-lisp.net (heller) Date: Mon, 29 Jan 2007 18:41:35 -0500 (EST) Subject: [slime-cvs] CVS slime Message-ID: <20070129234135.BD8183F00C@common-lisp.net> Update of /project/slime/cvsroot/slime In directory clnet:/tmp/cvs-serv8510 Modified Files: slime.el Log Message: (slime-start): Continue even if the user, after prompting, didn't recompile the stale .elc file. (slime-urge-bytecode-recompile) [xemacs]: Abort immediately if the user doesn't want to continue. (slime-recompile-bytecode): Don't use byte-compile-warning-types; it may not exist in XEmacs. Patch from Sean O'Rourke . --- /project/slime/cvsroot/slime/slime.el 2007/01/24 22:55:13 1.753 +++ /project/slime/cvsroot/slime/slime.el 2007/01/29 23:41:31 1.754 @@ -1549,11 +1549,11 @@ :coding-system coding-system :init init :name name :init-function init-function))) (slime-check-coding-system coding-system) - (when (or (not (slime-bytecode-stale-p)) - (slime-urge-bytecode-recompile)) - (let ((proc (slime-maybe-start-lisp program program-args buffer))) - (slime-inferior-connect proc args) - (pop-to-buffer (process-buffer proc)))))) + (when (slime-bytecode-stale-p) + (slime-urge-bytecode-recompile)) + (let ((proc (slime-maybe-start-lisp program program-args buffer))) + (slime-inferior-connect proc args) + (pop-to-buffer (process-buffer proc))))) (defun slime-connect (host port &optional coding-system) "Connect to a running Swank server." @@ -1642,21 +1642,20 @@ Warning: don't use this in XEmacs, it seems to crash it!" (interactive) (let ((sourcefile (concat (file-name-sans-extension (locate-library "slime")) - ".el")) - (byte-compile-warning-types (remove 'cl-functions - byte-compile-warning-types))) + ".el"))) (byte-compile-file sourcefile t))) (defun slime-urge-bytecode-recompile () "Urge the user to recompile slime.elc. Return true if we have been given permission to continue." - (if (featurep 'xemacs) - ;; My XEmacs crashes and burns if I recompile/reload an elisp - ;; file from itself. So they have to do it themself. - (y-or-n-p "slime.elc is older than slime.el. Continue? ") - (if (y-or-n-p "slime.elc is older than slime.el. Recompile/reload first? ") - (progn (slime-recompile-bytecode) t) - nil))) + (cond ((featurep 'xemacs) + ;; My XEmacs crashes and burns if I recompile/reload an elisp + ;; file from itself. So they have to do it themself. + (or (y-or-n-p "slime.elc is older than source. Continue? ") + (signal 'quit nil))) + ((y-or-n-p "slime.elc is older than source. Recompile first? ") + (slime-recompile-bytecode)) + (t))) (defun slime-abort-connection () "Abort connection the current connection attempt." From heller at common-lisp.net Mon Jan 29 23:43:18 2007 From: heller at common-lisp.net (heller) Date: Mon, 29 Jan 2007 18:43:18 -0500 (EST) Subject: [slime-cvs] CVS slime Message-ID: <20070129234318.1AC224F017@common-lisp.net> Update of /project/slime/cvsroot/slime In directory clnet:/tmp/cvs-serv9756 Modified Files: ChangeLog Log Message: *** empty log message *** --- /project/slime/cvsroot/slime/ChangeLog 2007/01/24 22:56:19 1.1058 +++ /project/slime/cvsroot/slime/ChangeLog 2007/01/29 23:43:17 1.1059 @@ -1,3 +1,12 @@ +2007-01-29 Sean O'Rourke + + * slime.el (slime-start): Continue even if the user, after + prompting, didn't recompile the stale .elc file. + (slime-urge-bytecode-recompile) [xemacs]: Abort immediately if the + user doesn't want to continue. + (slime-recompile-bytecode): Don't use byte-compile-warning-types; + it may not exist in XEmacs. + 2007-01-24 Helmut Eller * slime.el (sldb-recenter-region): Use count-screen-lines instead From heller at common-lisp.net Tue Jan 30 22:04:49 2007 From: heller at common-lisp.net (heller) Date: Tue, 30 Jan 2007 17:04:49 -0500 (EST) Subject: [slime-cvs] CVS slime Message-ID: <20070130220449.304F24B000@common-lisp.net> Update of /project/slime/cvsroot/slime In directory clnet:/tmp/cvs-serv18777 Modified Files: slime.el Log Message: (slime-complete-symbol-function): Restore old default. (set-keymap-parents): Deleted. (slime-startup-animation): Deleted. (slime-read-from-minibuffer): Don't use defun*. (slime-repl-terminate-history-search): New. (slime-repl-next-matching-input): Use it. --- /project/slime/cvsroot/slime/slime.el 2007/01/29 23:41:31 1.754 +++ /project/slime/cvsroot/slime/slime.el 2007/01/30 22:04:48 1.755 @@ -160,11 +160,6 @@ :type 'boolean :group 'slime-ui) -(defcustom slime-startup-animation t - "Enable the startup animation." - :type '(choice (const :tag "Enable" t) (const :tag "Disable" nil)) - :group 'slime-ui) - ;;;;; slime-lisp (defgroup slime-lisp nil @@ -260,7 +255,7 @@ :group 'slime-mode :type 'boolean) -(defcustom slime-complete-symbol-function 'slime-fuzzy-complete-symbol +(defcustom slime-complete-symbol-function 'slime-complete-symbol* "*Function to perform symbol completion." :group 'slime-mode :type '(choice (const :tag "Simple" slime-simple-complete-symbol) @@ -277,23 +272,6 @@ :group 'slime-mode :type 'boolean) -(defcustom slime-fuzzy-completion-in-place t - "When non-NIL the fuzzy symbol completion is done in place as -opposed to moving the point to the completion buffer." - :group 'slime-mode - :type 'boolean) - -(defcustom slime-fuzzy-completion-limit 300 - "Only return and present this many symbols from swank." - :group 'slime-mode - :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)" - :group 'slime-mode - :type 'integer) - (defcustom slime-space-information-p t "Have the SPC key offer arglist information." :type 'boolean @@ -527,64 +505,9 @@ ;;;; Minor modes -;;;; slime-target-buffer-fuzzy-completions-mode -;;;; NOTE: this mode has to be able to override key mappings in slime-mode - -(defun mimic-key-bindings (from-keymap to-keymap bindings-or-operation operation) - "Iterate on BINDINGS-OR-OPERATION. If an element is a symbol then -try to look it up (as an operation) in FROM-KEYMAP. Non symbols are taken -as default key bindings when none to be mimiced was found in FROM-KEYMAP. -Set the resulting list of keys in TO-KEYMAP to OPERATION." - (let ((mimic-keys nil) - (direct-keys nil)) - (dolist (key-or-operation bindings-or-operation) - (if (symbolp key-or-operation) - (setf mimic-keys (append mimic-keys (where-is-internal key-or-operation from-keymap nil t))) - (push key-or-operation direct-keys))) - (dolist (key (or mimic-keys direct-keys)) - (define-key to-keymap key operation)))) - -(defvar slime-target-buffer-fuzzy-completions-map - (let* ((map (make-sparse-keymap))) - (flet ((remap (keys to) - (mimic-key-bindings global-map map keys to))) - - (remap (list 'keyboard-quit (kbd "C-g")) 'slime-fuzzy-abort) - - (remap (list 'slime-fuzzy-indent-and-complete-symbol - 'slime-indent-and-complete-symbol - (kbd "")) - 'slime-fuzzy-select-or-update-completions) - (remap (list 'previous-line (kbd "")) 'slime-fuzzy-prev) - (remap (list 'next-line (kbd "")) 'slime-fuzzy-next) - (remap (list 'isearch-forward (kbd "C-s")) - (lambda () - (interactive) - (select-window (get-buffer-window (slime-get-fuzzy-buffer))) - (call-interactively 'isearch-forward))) - - ;; some unconditional direct bindings - (dolist (key (list (kbd "") (kbd "RET") (kbd "") "(" ")" "[" "]")) - (define-key map key 'slime-fuzzy-select-and-process-event-in-target-buffer))) - map - ) - "Keymap for slime-target-buffer-fuzzy-completions-mode. This will override the key -bindings in the target buffer temporarily during completion.") - -(define-minor-mode slime-fuzzy-target-buffer-completions-mode - "This minor mode is intented to override key bindings during fuzzy -completions in the target buffer. Most of the bindings will do an implicit select -in the completion window and let the keypress be processed in the target buffer." - nil - nil - slime-target-buffer-fuzzy-completions-map) - -(add-to-list 'minor-mode-alist - '(slime-fuzzy-target-buffer-completions-mode - " Fuzzy Target Buffer Completions")) - ;;;;; slime-mode + (define-minor-mode slime-mode "\\\ SLIME: The Superior Lisp Interaction Mode for Emacs (minor-mode). @@ -626,14 +549,6 @@ "The Lisp package to show in the modeline. This is automatically updated based on the buffer/point.")) -;; Make sure slime-fuzzy-target-buffer-completions-mode's map is -;; before everything else. -(setf minor-mode-map-alist - (stable-sort minor-mode-map-alist - (lambda (a b) - (eq a 'slime-fuzzy-target-buffer-completions-mode)) - :key #'car)) - (defun slime-update-modeline-package () (ignore-errors (when (and slime-update-modeline-package @@ -1028,30 +943,6 @@ (easy-menu-add slime-sldb-easy-menu 'sldb-mode-map))) -;;;; Emacs compatibility - -;;; Stuff only available in XEmacs -(or (fboundp 'add-local-hook) - (defun add-local-hook (hook function &optional append) - (make-local-hook hook) - (add-hook hook function append t))) - -(or (fboundp 'remove-local-hook) - (defun remove-local-hook (hook function) - (if (local-variable-p hook (current-buffer)) - (remove-hook hook function t)))) - -(or (fboundp 'set-keymap-parents) - (defun set-keymap-parents (m parents) - (set-keymap-parent - m - (cond - ((or (keymapp parents) (not (consp parents))) parents) - ((not (cdr parents)) (car parents)) - (t (let ((m (copy-keymap (pop parents)))) - (set-keymap-parents m parents) - m)))))) - ;;;; Setup initial `slime-mode' hooks (make-variable-buffer-local @@ -1244,7 +1135,7 @@ This function avoids mistaking the REPL prompt for a symbol." (cond ((or current-prefix-arg query (not (slime-symbol-name-at-point))) - (slime-read-from-minibuffer prompt :initial-value (slime-symbol-name-at-point))) + (slime-read-from-minibuffer prompt (slime-symbol-name-at-point))) (t (slime-symbol-name-at-point)))) ;; Interface @@ -2823,18 +2714,12 @@ (slime-pid))) ;; Emacs21 has the fancy persistent header-line. (use-header-p (and slime-header-line-p - (boundp 'header-line-format))) - ;; and dancing text - (animantep (and (fboundp 'animate-string) - slime-startup-animation - (zerop (buffer-size))))) + (boundp 'header-line-format)))) (when use-header-p (setq header-line-format banner)) - (when animantep - (pop-to-buffer (current-buffer)) - (animate-string (format "; SLIME %s" (or (slime-changelog-date) - "- ChangeLog file not found")) - 0 0)) + (pop-to-buffer (current-buffer)) + (insert "; SLIME " (or (slime-changelog-date) + "- ChangeLog file not found")) (slime-repl-insert-prompt))) (defun slime-init-output-buffer (connection) @@ -4093,6 +3978,9 @@ (defun slime-repl-history-search-in-progress-p () (eq last-command 'slime-repl-history-replace)) +(defun slime-repl-terminate-history-search () + (setq last-command this-command)) + (defun slime-repl-position-in-history (start-pos direction regexp) "Return the position of the history item matching regexp. Return -1 resp. the length of the history if no item matches" @@ -4109,7 +3997,9 @@ (defun slime-repl-previous-input () "Cycle backwards through input history. -Use the current input as search pattern. (The input is not saved.)" +If the `last-command' was a history navigation command use the +same search pattern for this command. +Otherwise use the current input as search pattern." (interactive) (slime-repl-history-replace 'backward (slime-repl-history-pattern t) t)) @@ -4131,10 +4021,12 @@ (defun slime-repl-previous-matching-input (regexp) (interactive "sPrevious element matching (regexp): ") + (slime-repl-terminate-history-search) (slime-repl-history-replace 'backward regexp)) (defun slime-repl-next-matching-input (regexp) (interactive "sNext element matching (regexp): ") + (slime-repl-terminate-history-search) (slime-repl-history-replace 'forward regexp)) (defun slime-repl-history-pattern (&optional use-current-input) @@ -4474,8 +4366,7 @@ (defslime-repl-shortcut slime-repl-defparameter ("defparameter" "!") (:handler (lambda (name value) (interactive (list (slime-read-symbol-name "Name (symbol): " t) - (slime-read-from-minibuffer "Value: " - :initial-value "*"))) + (slime-read-from-minibuffer "Value: " "*"))) (insert "(cl:defparameter " name " " value " \"REPL generated global variable.\")") (slime-repl-send-input t))) @@ -6199,7 +6090,7 @@ (defvar slime-read-expression-map (let ((map (make-sparse-keymap))) - (set-keymap-parents map (list minibuffer-local-map slime-mode-map)) + (set-keymap-parent map minibuffer-local-map) (define-key map "\t" 'slime-complete-symbol) (define-key map "\M-\t" 'slime-complete-symbol) map) @@ -6208,8 +6099,7 @@ (defvar slime-read-expression-history '() "History list of expressions read from the minibuffer.") -(defun* slime-read-from-minibuffer (prompt &key initial-value keymap - (history 'slime-read-expression-history)) +(defun slime-read-from-minibuffer (prompt &optional initial-value) "Read a string from the minibuffer, prompting with PROMPT. If INITIAL-VALUE is non-nil, it is inserted into the minibuffer before reading input. The result is a string (\"\" if no input was given)." @@ -6221,9 +6111,8 @@ (setq slime-buffer-connection connection) (set-syntax-table lisp-mode-syntax-table))) minibuffer-setup-hook))) - (read-from-minibuffer prompt initial-value - (or keymap slime-read-expression-map) - nil history))) + (read-from-minibuffer prompt initial-value slime-read-expression-map + nil 'slime-read-expression-history))) (defun slime-bogus-completion-alist (list) "Make an alist out of list. @@ -6279,6 +6168,23 @@ ;;;; Fuzzy completion +(defcustom slime-fuzzy-completion-in-place t + "When non-NIL the fuzzy symbol completion is done in place as +opposed to moving the point to the completion buffer." + :group 'slime-mode + :type 'boolean) + +(defcustom slime-fuzzy-completion-limit 300 + "Only return and present this many symbols from swank." + :group 'slime-mode + :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)" + :group 'slime-mode + :type 'integer) + (defvar slime-fuzzy-target-buffer nil "The buffer that is the target of the completion activities.") (defvar slime-fuzzy-saved-window-configuration nil @@ -6309,6 +6215,73 @@ "The overlay representing the current completion in the completion buffer. This is used to hightlight the text.") +;;;;;;; slime-target-buffer-fuzzy-completions-mode +;; NOTE: this mode has to be able to override key mappings in slime-mode + +;; FIXME: clean this up + +(defun mimic-key-bindings (from-keymap to-keymap bindings-or-operation operation) + "Iterate on BINDINGS-OR-OPERATION. If an element is a symbol then +try to look it up (as an operation) in FROM-KEYMAP. Non symbols are taken +as default key bindings when none to be mimiced was found in FROM-KEYMAP. +Set the resulting list of keys in TO-KEYMAP to OPERATION." + (let ((mimic-keys nil) + (direct-keys nil)) + (dolist (key-or-operation bindings-or-operation) + (if (symbolp key-or-operation) + (setf mimic-keys (append mimic-keys (where-is-internal key-or-operation from-keymap nil t))) + (push key-or-operation direct-keys))) + (dolist (key (or mimic-keys direct-keys)) + (define-key to-keymap key operation)))) + +(defvar slime-target-buffer-fuzzy-completions-map + (let* ((map (make-sparse-keymap))) + (flet ((remap (keys to) + (mimic-key-bindings global-map map keys to))) + + (remap (list 'keyboard-quit (kbd "C-g")) 'slime-fuzzy-abort) + + (remap (list 'slime-fuzzy-indent-and-complete-symbol + 'slime-indent-and-complete-symbol + (kbd "")) + 'slime-fuzzy-select-or-update-completions) + (remap (list 'previous-line (kbd "")) 'slime-fuzzy-prev) + (remap (list 'next-line (kbd "")) 'slime-fuzzy-next) + (remap (list 'isearch-forward (kbd "C-s")) + (lambda () + (interactive) + (select-window (get-buffer-window (slime-get-fuzzy-buffer))) + (call-interactively 'isearch-forward))) + + ;; some unconditional direct bindings + (dolist (key (list (kbd "") (kbd "RET") (kbd "") "(" ")" "[" "]")) + (define-key map key 'slime-fuzzy-select-and-process-event-in-target-buffer))) + map + ) + "Keymap for slime-target-buffer-fuzzy-completions-mode. This will override the key +bindings in the target buffer temporarily during completion.") + +;; Make sure slime-fuzzy-target-buffer-completions-mode's map is +;; before everything else. +(setf minor-mode-map-alist + (stable-sort minor-mode-map-alist + (lambda (a b) + (eq a 'slime-fuzzy-target-buffer-completions-mode)) + :key #'car)) + + +(define-minor-mode slime-fuzzy-target-buffer-completions-mode + "This minor mode is intented to override key bindings during fuzzy +completions in the target buffer. Most of the bindings will do an implicit select +in the completion window and let the keypress be processed in the target buffer." + nil + nil + slime-target-buffer-fuzzy-completions-map) + +(add-to-list 'minor-mode-alist + '(slime-fuzzy-target-buffer-completions-mode + " Fuzzy Target Buffer Completions")) + (define-derived-mode slime-fuzzy-completions-mode fundamental-mode "Fuzzy Completions" "Major mode for presenting fuzzy completion results. @@ -7099,12 +7072,13 @@ in Lisp when committed with \\[slime-edit-value-commit]." (interactive (list (slime-read-from-minibuffer "Edit value (evaluated): " - :initial-value (slime-sexp-at-point)))) + (slime-sexp-at-point)))) (slime-eval-async `(swank:value-for-editing ,form-string) (lexical-let ((form-string form-string) (package (slime-current-package))) (lambda (result) - (slime-edit-value-callback form-string result package))))) + (slime-edit-value-callback form-string result + package))))) (make-variable-buffer-local (defvar slime-edit-form-string nil @@ -7163,16 +7137,16 @@ (cond ((null spec) (slime-read-from-minibuffer "(Un)trace: ")) ((symbolp spec) - (slime-read-from-minibuffer "(Un)trace: " :initial-value (symbol-name spec))) + (slime-read-from-minibuffer "(Un)trace: " (symbol-name spec))) (t (destructure-case spec ((setf n) - (slime-read-from-minibuffer "(Un)trace: " :initial-value (prin1-to-string spec))) + (slime-read-from-minibuffer "(Un)trace: " (prin1-to-string spec))) (((:defun :defmacro) n) - (slime-read-from-minibuffer "(Un)trace: " :initial-value (prin1-to-string n))) + (slime-read-from-minibuffer "(Un)trace: " (prin1-to-string n))) ((:defgeneric n) (let* ((name (prin1-to-string n)) - (answer (slime-read-from-minibuffer "(Un)trace: " :initial-value name))) + (answer (slime-read-from-minibuffer "(Un)trace: " name))) (cond ((and (string= name answer) (y-or-n-p (concat "(Un)trace also all " [84 lines skipped] From heller at common-lisp.net Tue Jan 30 22:05:50 2007 From: heller at common-lisp.net (heller) Date: Tue, 30 Jan 2007 17:05:50 -0500 (EST) Subject: [slime-cvs] CVS slime Message-ID: <20070130220550.2E15C4C011@common-lisp.net> Update of /project/slime/cvsroot/slime In directory clnet:/tmp/cvs-serv18879 Modified Files: ChangeLog Log Message: *** empty log message *** --- /project/slime/cvsroot/slime/ChangeLog 2007/01/29 23:43:17 1.1059 +++ /project/slime/cvsroot/slime/ChangeLog 2007/01/30 22:05:49 1.1060 @@ -1,3 +1,12 @@ +2007-01-30 Helmut Eller + + * slime.el (slime-complete-symbol-function): Restore old default. + (set-keymap-parents): Deleted. + (slime-startup-animation): Deleted. + (slime-read-from-minibuffer): Don't use defun*. + (slime-repl-terminate-history-search): New. + (slime-repl-next-matching-input): Use it. + 2007-01-29 Sean O'Rourke * slime.el (slime-start): Continue even if the user, after From heller at common-lisp.net Tue Jan 30 22:22:25 2007 From: heller at common-lisp.net (heller) Date: Tue, 30 Jan 2007 17:22:25 -0500 (EST) Subject: [slime-cvs] CVS slime Message-ID: <20070130222225.6F02055352@common-lisp.net> Update of /project/slime/cvsroot/slime In directory clnet:/tmp/cvs-serv22671 Added Files: slime-autoloads.el Log Message: *** empty log message *** --- /project/slime/cvsroot/slime/slime-autoloads.el 2007/01/30 22:22:25 NONE +++ /project/slime/cvsroot/slime/slime-autoloads.el 2007/01/30 22:22:25 1.1 ;;; slime-autoloads.el --- autoload definitions for SLIME ;; Copyright (C) 2007 Helmut Eller ;; This file is protected by the GNU GPLv2 (or later), as distributed ;; with GNU Emacs. ;;; Commentary: ;; This code defines the necessary autoloads, so that we don't need to ;; load everything from .emacs. ;;; Code: (autoload 'slime "slime" "Start a Lisp subprocess and connect to its Swank server." t) (autoload 'slime-mode "slime" "SLIME: The Superior Lisp Interaction (Minor) Mode for Emacs." t) (autoload 'slime-connect "slime" "Connect to a running Swank server." t) (autoload 'hyperspec-lookup "hyperspec" nil t) (autoload 'slime-lisp-mode-hook "slime") (autoload 'slime-scheme-mode-hook "slime") (defvar slime-lisp-modes '(lisp-mode)) (defun slime-setup (&rest options) "Setup Emacs so that lisp-mode buffers always use SLIME. OPTIONS is a keyword list (&key AUTODOC TYPEOUT-FRAME HIGHLIGHT-EDITS): AUTODOC and HIGHLIGHT-EDITS enable `slime-autodoc-mode' resp. `slime-highlight-edits-mode'. If TYPEOUT-FRAME is true, the SLIME will use the typeout window." (when (member 'lisp-mode slime-lisp-modes) (add-hook 'lisp-mode-hook 'slime-lisp-mode-hook)) (when (member 'scheme-mode slime-lisp-modes) (add-hook 'scheme-mode-hook 'slime-scheme-mode-hook)) (when (plist-get options :typeout-frame) (add-hook 'slime-connected-hook 'slime-ensure-typeout-frame)) (setq slime-use-autodoc-mode (plist-get options :autodoc)) (setq slime-use-highlight-edits-mode (plist-get options :highlight-edits))) (provide 'slime-autoloads) ;;; slime-autoloads.el ends here From heller at common-lisp.net Tue Jan 30 22:23:40 2007 From: heller at common-lisp.net (heller) Date: Tue, 30 Jan 2007 17:23:40 -0500 (EST) Subject: [slime-cvs] CVS slime Message-ID: <20070130222340.1A2E15B059@common-lisp.net> Update of /project/slime/cvsroot/slime In directory clnet:/tmp/cvs-serv22714 Modified Files: ChangeLog Log Message: *** empty log message *** --- /project/slime/cvsroot/slime/ChangeLog 2007/01/30 22:05:49 1.1060 +++ /project/slime/cvsroot/slime/ChangeLog 2007/01/30 22:23:39 1.1061 @@ -7,6 +7,8 @@ (slime-repl-terminate-history-search): New. (slime-repl-next-matching-input): Use it. + * slime-autoloads.el: New file. + 2007-01-29 Sean O'Rourke * slime.el (slime-start): Continue even if the user, after From mbaringer at common-lisp.net Wed Jan 31 13:23:39 2007 From: mbaringer at common-lisp.net (mbaringer) Date: Wed, 31 Jan 2007 08:23:39 -0500 (EST) Subject: [slime-cvs] CVS slime Message-ID: <20070131132339.AB58E4C00A@common-lisp.net> Update of /project/slime/cvsroot/slime In directory clnet:/tmp/cvs-serv27877 Modified Files: slime.el Log Message: (slime-repl-update-banner): Restore animation. (slime-startup-animation): restore. --- /project/slime/cvsroot/slime/slime.el 2007/01/30 22:04:48 1.755 +++ /project/slime/cvsroot/slime/slime.el 2007/01/31 13:23:39 1.756 @@ -159,6 +159,11 @@ This applies to the *inferior-lisp* buffer and the network connections." :type 'boolean :group 'slime-ui) + +(defcustom slime-startup-animation t + "Enable the startup animation." + :type '(choice (const :tag "Enable" t) (const :tag "Disable" nil)) + :group 'slime-ui) ;;;;; slime-lisp @@ -2714,12 +2719,20 @@ (slime-pid))) ;; Emacs21 has the fancy persistent header-line. (use-header-p (and slime-header-line-p - (boundp 'header-line-format)))) + (boundp 'header-line-format))) + ;; and dancing text + (animantep (and (fboundp 'animate-string) + slime-startup-animation + (zerop (buffer-size))))) (when use-header-p (setq header-line-format banner)) (pop-to-buffer (current-buffer)) - (insert "; SLIME " (or (slime-changelog-date) - "- ChangeLog file not found")) + (let ((slime-hello-message (concat "; SLIME " + (or (slime-changelog-date) + "- ChangeLog file not found")))) + (if animantep + (animate-string slime-hello-message 0 0) + (insert slime-hello-message))) (slime-repl-insert-prompt))) (defun slime-init-output-buffer (connection) From mbaringer at common-lisp.net Wed Jan 31 13:23:53 2007 From: mbaringer at common-lisp.net (mbaringer) Date: Wed, 31 Jan 2007 08:23:53 -0500 (EST) Subject: [slime-cvs] CVS slime Message-ID: <20070131132353.08E634E01E@common-lisp.net> Update of /project/slime/cvsroot/slime In directory clnet:/tmp/cvs-serv27919 Modified Files: ChangeLog Log Message: --- /project/slime/cvsroot/slime/ChangeLog 2007/01/30 22:23:39 1.1061 +++ /project/slime/cvsroot/slime/ChangeLog 2007/01/31 13:23:52 1.1062 @@ -1,3 +1,8 @@ +2007-01-31 Marco Baringer + + * slime.el (slime-repl-update-banner): Restore animation. + (slime-startup-animation): restore. + 2007-01-30 Helmut Eller * slime.el (slime-complete-symbol-function): Restore old default.