From crhodes at common-lisp.net Wed Mar 14 09:49:02 2007 From: crhodes at common-lisp.net (crhodes) Date: Wed, 14 Mar 2007 04:49:02 -0500 (EST) Subject: [slime-cvs] CVS slime Message-ID: <20070314094902.6CC01310A0@common-lisp.net> Update of /project/slime/cvsroot/slime In directory clnet:/tmp/cvs-serv28576 Modified Files: ChangeLog slime.el Log Message: Handle multiple reader conditionals on the same line for font-lock. --- /project/slime/cvsroot/slime/ChangeLog 2007/02/26 09:56:06 1.1076 +++ /project/slime/cvsroot/slime/ChangeLog 2007/03/14 09:49:00 1.1077 @@ -1,3 +1,8 @@ +2007-03-14 Christophe Rhodes + + * slime.el (slime-search-suppressed-forms): handle multiple + conditionals on the same line. + 2007-02-26 Nikodemus Siivola * swank.lisp (inspect-for-emacs): Add support for inspecting --- /project/slime/cvsroot/slime/slime.el 2007/02/25 15:59:34 1.766 +++ /project/slime/cvsroot/slime/slime.el 2007/03/14 09:49:00 1.767 @@ -9744,7 +9744,7 @@ "Find reader conditionalized forms where the test is false." (when (and slime-highlight-suppressed-forms (slime-connected-p) - (re-search-forward "^\\([^;\n]*[ \t(]\\)?#[-+]" limit t)) + (re-search-forward "^\\([^;\n]*?[ \t(]\\)?#[-+]" limit t)) (ignore-errors (let* ((start (- (point) 2)) (char (char-before)) @@ -9754,7 +9754,8 @@ (if (or (and (eq char ?+) (not val)) (and (eq char ?-) val)) (progn - (forward-sexp) + (forward-sexp) (backward-sexp) + (slime-forward-sexp) (assert (<= (point) limit)) (let ((md (match-data))) (fill md nil) From crhodes at common-lisp.net Tue Mar 20 11:12:57 2007 From: crhodes at common-lisp.net (crhodes) Date: Tue, 20 Mar 2007 06:12:57 -0500 (EST) Subject: [slime-cvs] CVS slime Message-ID: <20070320111257.034E13202B@common-lisp.net> Update of /project/slime/cvsroot/slime In directory clnet:/tmp/cvs-serv27274 Modified Files: ChangeLog swank-openmcl.lisp Log Message: Fix typo in swank-openmcl HASH-TABLE-WEAKNESS, from Takehiko Abe. --- /project/slime/cvsroot/slime/ChangeLog 2007/03/14 09:49:00 1.1077 +++ /project/slime/cvsroot/slime/ChangeLog 2007/03/20 11:12:57 1.1078 @@ -1,3 +1,7 @@ +2007-03-20 Takehiko Abe + + * swank-openmcl.lisp (hash-table-weakness): fix typo + 2007-03-14 Christophe Rhodes * slime.el (slime-search-suppressed-forms): handle multiple --- /project/slime/cvsroot/slime/swank-openmcl.lisp 2006/12/19 10:47:36 1.114 +++ /project/slime/cvsroot/slime/swank-openmcl.lisp 2007/03/20 11:12:57 1.115 @@ -931,4 +931,4 @@ (apply #'make-hash-table :weak :value args)) (defimplementation hash-table-weakness (hashtable) - (ccl::hash-table-weak-p ht)) + (ccl::hash-table-weak-p hashtable)) From mkoeppe at common-lisp.net Tue Mar 20 17:44:10 2007 From: mkoeppe at common-lisp.net (mkoeppe) Date: Tue, 20 Mar 2007 12:44:10 -0500 (EST) Subject: [slime-cvs] CVS slime Message-ID: <20070320174410.4B6644051@common-lisp.net> Update of /project/slime/cvsroot/slime In directory clnet:/tmp/cvs-serv14631 Modified Files: slime.el Log Message: (slime-copy-presentation-at-mouse-to-point) (slime-copy-presentation-at-mouse-to-kill-ring): New commands. (slime-menu-choices-for-presentation): Change interface. New menu options, Copy to kill-ring, Copy to point. (slime-presentation-menu): Change call to slime-menu-choices-for-presentation. --- /project/slime/cvsroot/slime/slime.el 2007/03/14 09:49:00 1.767 +++ /project/slime/cvsroot/slime/slime.el 2007/03/20 17:44:09 1.768 @@ -3436,6 +3436,29 @@ (goto-char (point-max)) (do-insertion))))))) +(defun slime-copy-presentation-at-mouse-to-point (event) + (interactive "e") + (multiple-value-bind (presentation start end buffer) + (slime-presentation-around-click event) + (let ((presentation-text + (with-current-buffer buffer + (buffer-substring start end)))) + (when (not (string-match "\\s-" + (buffer-substring (1- (point)) (point)))) + (insert " ")) + (insert presentation-text) + (when (and (not (eolp)) (not (looking-at "\\s-"))) + (insert " "))))) + +(defun slime-copy-presentation-at-mouse-to-kill-ring (event) + (interactive "e") + (multiple-value-bind (presentation start end buffer) + (slime-presentation-around-click event) + (let ((presentation-text + (with-current-buffer buffer + (buffer-substring start end)))) + (kill-new presentation-text)))) + (defun slime-describe-presentation-at-mouse (event) (interactive "@e") (multiple-value-bind (presentation) (slime-presentation-around-click event) @@ -3466,9 +3489,8 @@ ;; 2. Let used choose ;; 3. Call back to execute menu choice, passing nth and string of choice -(defun slime-menu-choices-for-presentation (presentation from to choice-to-lambda) - "Return a menu for `presentation' at `from'--`to' in the current -buffer, suitable for `x-popup-menu'." +(defun slime-menu-choices-for-presentation (presentation buffer from to choice-to-lambda) + "Return a menu for `presentation' at `from'--`to' in `buffer', suitable for `x-popup-menu'." (let* ((what (slime-presentation-id presentation)) (choices (slime-eval `(swank::menu-choices-for-presentation-id ',what)))) @@ -3483,7 +3505,10 @@ ("Inspect" . ,(savel 'slime-inspect-presentation-at-mouse)) ("Describe" . ,(savel 'slime-describe-presentation-at-mouse)) ("Pretty-print" . ,(savel 'slime-pretty-print-presentation-at-mouse)) - ("Copy to input" . ,(savel 'slime-copy-presentation-at-mouse)) + ("Copy to REPL" . ,(savel 'slime-copy-presentation-at-mouse)) + ("Copy to kill ring" . ,(savel 'slime-copy-presentation-at-mouse-to-kill-ring)) + ,@(unless buffer-read-only + `(("Copy to point" . ,(savel 'slime-copy-presentation-at-mouse-to-point)))) ,@(let ((nchoice 0)) (mapcar (lambda (choice) @@ -3496,7 +3521,8 @@ ',what ,nchoice ,(nth (1- nchoice) choices))))))) choices))))) (symbol ; not-present - (slime-remove-presentation-properties from to presentation) + (with-current-buffer buffer + (slime-remove-presentation-properties from to presentation)) (sit-for 0) ; allow redisplay `("Object no longer recorded" ("sorry" . ,(if (featurep 'xemacs) nil '(nil))))))))) @@ -3506,17 +3532,18 @@ (let* ((point (if (featurep 'xemacs) (event-point event) (posn-point (event-end event)))) (window (if (featurep 'xemacs) (event-window event) (caadr event))) + (buffer (window-buffer window)) (choice-to-lambda (make-hash-table))) - (with-current-buffer (window-buffer window) - (multiple-value-bind (presentation from to) - (slime-presentation-around-point point) - (unless presentation - (error "No presentation at event position")) - (let ((menu (slime-menu-choices-for-presentation - presentation from to choice-to-lambda))) - (let ((choice (x-popup-menu event menu))) - (when choice - (call-interactively (gethash choice choice-to-lambda))))))))) + (multiple-value-bind (presentation from to) + (with-current-buffer buffer + (slime-presentation-around-point point)) + (unless presentation + (error "No presentation at event position")) + (let ((menu (slime-menu-choices-for-presentation + presentation buffer from to choice-to-lambda))) + (let ((choice (x-popup-menu event menu))) + (when choice + (call-interactively (gethash choice choice-to-lambda)))))))) (defun slime-repl-insert-prompt (&optional time) "Goto to point max, and insert the prompt. From mkoeppe at common-lisp.net Tue Mar 20 17:45:20 2007 From: mkoeppe at common-lisp.net (mkoeppe) Date: Tue, 20 Mar 2007 12:45:20 -0500 (EST) Subject: [slime-cvs] CVS slime Message-ID: <20070320174520.3B72913010@common-lisp.net> Update of /project/slime/cvsroot/slime In directory clnet:/tmp/cvs-serv14784 Modified Files: ChangeLog Log Message: --- /project/slime/cvsroot/slime/ChangeLog 2007/03/20 11:12:57 1.1078 +++ /project/slime/cvsroot/slime/ChangeLog 2007/03/20 17:45:19 1.1079 @@ -1,3 +1,12 @@ +2007-03-20 Matthias Koeppe + + * slime.el (slime-copy-presentation-at-mouse-to-point) + (slime-copy-presentation-at-mouse-to-kill-ring): New commands. + (slime-menu-choices-for-presentation): Change interface. New + menu options, Copy to kill-ring, Copy to point. + (slime-presentation-menu): Change call to + slime-menu-choices-for-presentation. + 2007-03-20 Takehiko Abe * swank-openmcl.lisp (hash-table-weakness): fix typo From mkoeppe at common-lisp.net Tue Mar 20 22:17:37 2007 From: mkoeppe at common-lisp.net (mkoeppe) Date: Tue, 20 Mar 2007 17:17:37 -0500 (EST) Subject: [slime-cvs] CVS slime Message-ID: <20070320221737.9D2BD36085@common-lisp.net> Update of /project/slime/cvsroot/slime In directory clnet:/tmp/cvs-serv27269 Modified Files: swank.lisp Log Message: (completion-output-symbol-converter): Fix completion for mixed-case symbols that need escaping in readtable-case :upcase or :downcase. --- /project/slime/cvsroot/slime/swank.lisp 2007/02/26 09:56:06 1.460 +++ /project/slime/cvsroot/slime/swank.lisp 2007/03/20 22:17:36 1.461 @@ -3350,9 +3350,21 @@ (let ((case-converter (completion-output-case-converter input)) (case-converter-with-escaping (completion-output-case-converter input t))) (lambda (str) - (if (some (lambda (el) - (member el '(#\: #\, #\ #\Newline #\Tab))) - str) + (if (or (multiple-value-bind (lowercase uppercase) + (determine-case str) + ;; In these readtable cases, symbols with letters from + ;; the wrong case need escaping + (case (readtable-case *readtable*) + (:upcase lowercase) + (:downcase uppercase) + (t nil))) + (some (lambda (el) + (or (member el '(#\: #\Space #\Newline #\Tab)) + (multiple-value-bind (macrofun nonterminating) + (get-macro-character el) + (and macrofun + (not nonterminating))))) + str)) (concatenate 'string "|" (funcall case-converter-with-escaping str) "|") (funcall case-converter str))))) From mkoeppe at common-lisp.net Tue Mar 20 22:18:06 2007 From: mkoeppe at common-lisp.net (mkoeppe) Date: Tue, 20 Mar 2007 17:18:06 -0500 (EST) Subject: [slime-cvs] CVS slime Message-ID: <20070320221806.139133A01F@common-lisp.net> Update of /project/slime/cvsroot/slime In directory clnet:/tmp/cvs-serv27331 Modified Files: ChangeLog Log Message: *** empty log message *** --- /project/slime/cvsroot/slime/ChangeLog 2007/03/20 17:45:19 1.1079 +++ /project/slime/cvsroot/slime/ChangeLog 2007/03/20 22:18:05 1.1080 @@ -1,5 +1,9 @@ 2007-03-20 Matthias Koeppe + * swank.lisp (completion-output-symbol-converter): Fix completion + for mixed-case symbols that need escaping in readtable-case + :upcase or :downcase. + * slime.el (slime-copy-presentation-at-mouse-to-point) (slime-copy-presentation-at-mouse-to-kill-ring): New commands. (slime-menu-choices-for-presentation): Change interface. New From heller at common-lisp.net Wed Mar 21 14:52:39 2007 From: heller at common-lisp.net (heller) Date: Wed, 21 Mar 2007 09:52:39 -0500 (EST) Subject: [slime-cvs] CVS slime Message-ID: <20070321145239.640613A01C@common-lisp.net> Update of /project/slime/cvsroot/slime In directory clnet:/tmp/cvs-serv23267 Modified Files: slime.el Log Message: (slime-repl-eval-string, slime-repl-insert-result): Support the presentation-less old protocol. (slime-goto-location-position): Use column number if available. --- /project/slime/cvsroot/slime/slime.el 2007/03/20 17:44:09 1.768 +++ /project/slime/cvsroot/slime/slime.el 2007/03/21 14:52:38 1.769 @@ -787,7 +787,7 @@ (loop for (key command) in slime-doc-bindings do (progn ;; We bind both unmodified and with control. - (define-key slime-doc-map (string key) command) + (define-key slime-doc-map (vector key) command) (unless (equal key ?h) ; But don't bind C-h (let ((modified (slime-control-modified-char key))) (define-key slime-doc-map (vector modified) command))))) @@ -798,7 +798,7 @@ (loop for (key command) in slime-who-bindings do (progn ;; We bind both unmodified and with control. - (define-key slime-who-map (string key) command) + (define-key slime-who-map (vector key) command) (let ((modified (slime-control-modified-char key))) (define-key slime-who-map (vector modified) command)))) ;; C-c C-w is the prefix for the who-xref map. @@ -3545,10 +3545,44 @@ (when choice (call-interactively (gethash choice choice-to-lambda)))))))) +(defun slime-repl-send-string (string &optional command-string) + (cond (slime-repl-read-mode + (slime-repl-return-string string)) + (t (slime-repl-eval-string string)))) + +(defun slime-repl-eval-string (string) + (slime-rex () + ((list 'swank:listener-eval string) (slime-lisp-package)) + ((:ok result) + (slime-repl-insert-result result)) + ((:abort) + (slime-repl-show-abort)))) + +(defun slime-repl-insert-result (result) + (with-current-buffer (slime-output-buffer) + (goto-char (point-max)) + (when result + (destructure-case result + ((:values &rest strings) + (unless (bolp) (insert "\n")) + (cond ((null strings) + (insert "; No value\n")) + (t + (dolist (string strings) + (slime-propertize-region `(face slime-repl-result-face) + (insert string)) + (insert "\n"))))))) + (slime-repl-insert-prompt))) + +(defun slime-repl-show-abort () + (with-current-buffer (slime-output-buffer) + (slime-with-output-end-mark + (unless (bolp) (insert-before-markers "\n")) + (insert-before-markers "; Evaluation aborted\n")) + (slime-repl-insert-prompt))) + (defun slime-repl-insert-prompt (&optional time) - "Goto to point max, and insert the prompt. -Set slime-output-end to start of the inserted text slime-input-start -to end end." + "Goto to point max, and insert the prompt." (goto-char (point-max)) (unless (bolp) (insert "\n")) (let ((prompt-start (point)) @@ -3561,7 +3595,6 @@ ;; xemacs stuff start-open t end-open t) (insert prompt)) - ;;(set-marker slime-output-end start) (set-marker slime-repl-prompt-start-mark prompt-start) (slime-mark-input-start) (let ((time (or time 0.2))) @@ -3637,28 +3670,6 @@ (if (get-text-property 0 text-property object) 0 (next-single-property-change 0 text-property object))) - -(defun slime-repl-eval-string (string) - (slime-rex () - ((list 'swank:listener-eval string) (slime-lisp-package)) - ((:ok result) - (with-current-buffer (slime-output-buffer) - (slime-repl-insert-prompt))) - ((:abort) - (slime-repl-show-abort) - (with-current-buffer (slime-output-buffer) - (slime-repl-insert-prompt))))) - -(defun slime-repl-send-string (string &optional command-string) - (cond (slime-repl-read-mode - (slime-repl-return-string string)) - (t (slime-repl-eval-string string)))) - -(defun slime-repl-show-abort () - (with-current-buffer (slime-output-buffer) - (slime-with-output-end-mark - (unless (bolp) (insert-before-markers "\n")) - (insert-before-markers "; Evaluation aborted\n")))) (defun slime-mark-input-start () (set-marker slime-repl-last-input-start-mark @@ -4587,8 +4598,8 @@ See `slime-compile-and-load-file' for further details." (interactive) - (unless (memq major-mode slime-lisp-modes) - (error "Only valid in lisp-mode")) + ;;(unless (memq major-mode slime-lisp-modes) + ;; (error "Only valid in lisp-mode")) (check-parens) (unless buffer-file-name (error "Buffer %s is not associated with a file." (buffer-name))) @@ -5230,9 +5241,10 @@ (when align-p (slime-forward-sexp) (beginning-of-sexp))) - ((:line start &optional end) + ((:line start &optional column) (goto-line start) - (skip-chars-forward " \t")) + (cond (column (move-to-column column)) + (t (skip-chars-forward " \t")))) ((:function-name name) (let ((case-fold-search t) (name (regexp-quote name))) @@ -5306,7 +5318,7 @@ | (:source-form ) ::= (:position []) ; 1 based - | (:line []) + | (:line []) | (:function-name ) | (:source-path ) | (:text-anchored ) From heller at common-lisp.net Wed Mar 21 14:52:48 2007 From: heller at common-lisp.net (heller) Date: Wed, 21 Mar 2007 09:52:48 -0500 (EST) Subject: [slime-cvs] CVS slime Message-ID: <20070321145248.1AD2052010@common-lisp.net> Update of /project/slime/cvsroot/slime In directory clnet:/tmp/cvs-serv23294 Modified Files: ChangeLog Log Message: *** empty log message *** --- /project/slime/cvsroot/slime/ChangeLog 2007/03/20 22:18:05 1.1080 +++ /project/slime/cvsroot/slime/ChangeLog 2007/03/21 14:52:47 1.1081 @@ -1,3 +1,9 @@ +2007-03-21 Helmut Eller + + * slime.el (slime-repl-eval-string, slime-repl-insert-result): + Support the presentation-less old protocol. + (slime-goto-location-position): Use column number if available. + 2007-03-20 Matthias Koeppe * swank.lisp (completion-output-symbol-converter): Fix completion From mkoeppe at common-lisp.net Wed Mar 21 15:50:11 2007 From: mkoeppe at common-lisp.net (mkoeppe) Date: Wed, 21 Mar 2007 10:50:11 -0500 (EST) Subject: [slime-cvs] CVS slime Message-ID: <20070321155011.D50F8830CD@common-lisp.net> Update of /project/slime/cvsroot/slime In directory clnet:/tmp/cvs-serv2184 Modified Files: slime.el Log Message: (slime-copy-presentation-at-mouse-to-point): Manually invoke the after-change function, so that the presentation overlay is created even if we paste to non-REPL buffers. (slime-menu-choices-for-presentation): Evaluate menu-choices-for-presentation-id in the right buffer, thus in the right Lisp thread. Reported by Attila Lendvai. (slime-menu-choices-for-presentation): Show the id of the presentation. (sldb-insert-locals): Include the thread id in the presentation id. --- /project/slime/cvsroot/slime/slime.el 2007/03/21 14:52:38 1.769 +++ /project/slime/cvsroot/slime/slime.el 2007/03/21 15:50:11 1.770 @@ -3447,6 +3447,7 @@ (buffer-substring (1- (point)) (point)))) (insert " ")) (insert presentation-text) + (slime-after-change-function (point) (point)) (when (and (not (eolp)) (not (looking-at "\\s-"))) (insert " "))))) @@ -3492,15 +3493,16 @@ (defun slime-menu-choices-for-presentation (presentation buffer from to choice-to-lambda) "Return a menu for `presentation' at `from'--`to' in `buffer', suitable for `x-popup-menu'." (let* ((what (slime-presentation-id presentation)) - (choices (slime-eval - `(swank::menu-choices-for-presentation-id ',what)))) + (choices (with-current-buffer buffer + (slime-eval + `(swank::menu-choices-for-presentation-id ',what))))) (flet ((savel (f) ;; IMPORTANT - xemacs can't handle lambdas in x-popup-menu. So give them a name (let ((sym (gensym))) (setf (gethash sym choice-to-lambda) f) sym))) (etypecase choices (list - `(,(if (featurep 'xemacs) " " "") + `(,(format "Presentation %s" what) ("" ("Inspect" . ,(savel 'slime-inspect-presentation-at-mouse)) ("Describe" . ,(savel 'slime-describe-presentation-at-mouse)) @@ -8659,7 +8661,7 @@ " = ") (slime-insert-presentation (in-sldb-face local-value value) - `(:frame-var ,(car frame) ,i)) + `(:frame-var ,slime-current-thread ,(car frame) ,i)) (insert "\n"))))) (defun sldb-hide-frame-details () From mkoeppe at common-lisp.net Wed Mar 21 15:56:24 2007 From: mkoeppe at common-lisp.net (mkoeppe) Date: Wed, 21 Mar 2007 10:56:24 -0500 (EST) Subject: [slime-cvs] CVS slime Message-ID: <20070321155624.E5F785D083@common-lisp.net> Update of /project/slime/cvsroot/slime In directory clnet:/tmp/cvs-serv2993 Modified Files: swank.lisp Log Message: (lookup-presented-object): The presentation id of frame locals now includes the thread id; ignore it for now. --- /project/slime/cvsroot/slime/swank.lisp 2007/03/20 22:17:36 1.461 +++ /project/slime/cvsroot/slime/swank.lisp 2007/03/21 15:56:24 1.462 @@ -2434,7 +2434,8 @@ (values object foundp))))) (cons (destructure-case id - ((:frame-var frame index) + ((:frame-var thread-id frame index) + (declare (ignore thread-id)) ; later (handler-case (frame-var-value frame index) (t (condition) From mkoeppe at common-lisp.net Wed Mar 21 15:56:49 2007 From: mkoeppe at common-lisp.net (mkoeppe) Date: Wed, 21 Mar 2007 10:56:49 -0500 (EST) Subject: [slime-cvs] CVS slime Message-ID: <20070321155649.E36E84141@common-lisp.net> Update of /project/slime/cvsroot/slime In directory clnet:/tmp/cvs-serv3067 Modified Files: ChangeLog Log Message: *** empty log message *** --- /project/slime/cvsroot/slime/ChangeLog 2007/03/21 14:52:47 1.1081 +++ /project/slime/cvsroot/slime/ChangeLog 2007/03/21 15:56:49 1.1082 @@ -1,3 +1,17 @@ +2007-03-21 Matthias Koeppe + + * swank.lisp (lookup-presented-object): The presentation id of + frame locals now includes the thread id; ignore it for now. + + * slime.el (slime-copy-presentation-at-mouse-to-point): Manually + invoke the after-change function, so that the presentation overlay + is created even if we paste to non-REPL buffers. + (slime-menu-choices-for-presentation): Evaluate + menu-choices-for-presentation-id in the right buffer, thus in the + right Lisp thread. Reported by Attila Lendvai. + (slime-menu-choices-for-presentation): Show the id of the presentation. + (sldb-insert-locals): Include the thread id in the presentation id. + 2007-03-21 Helmut Eller * slime.el (slime-repl-eval-string, slime-repl-insert-result): From mkoeppe at common-lisp.net Thu Mar 22 13:35:46 2007 From: mkoeppe at common-lisp.net (mkoeppe) Date: Thu, 22 Mar 2007 08:35:46 -0500 (EST) Subject: [slime-cvs] CVS slime Message-ID: <20070322133546.341D250034@common-lisp.net> Update of /project/slime/cvsroot/slime In directory clnet:/tmp/cvs-serv14563 Modified Files: slime.el Log Message: (slime-scratch-buffer): Respect the syntax text properties of presentations. --- /project/slime/cvsroot/slime/slime.el 2007/03/21 15:50:11 1.770 +++ /project/slime/cvsroot/slime/slime.el 2007/03/22 13:35:45 1.771 @@ -4561,6 +4561,9 @@ (lisp-mode) (use-local-map slime-scratch-mode-map) (slime-mode t) + (when slime-repl-enable-presentations + ;; Respect the syntax text properties of presentations. + (set (make-local-variable 'parse-sexp-lookup-properties) t)) (current-buffer)))) (defun slime-switch-to-scratch-buffer () From mkoeppe at common-lisp.net Thu Mar 22 13:35:58 2007 From: mkoeppe at common-lisp.net (mkoeppe) Date: Thu, 22 Mar 2007 08:35:58 -0500 (EST) Subject: [slime-cvs] CVS slime Message-ID: <20070322133558.70B665201E@common-lisp.net> Update of /project/slime/cvsroot/slime In directory clnet:/tmp/cvs-serv14620 Modified Files: ChangeLog Log Message: *** empty log message *** --- /project/slime/cvsroot/slime/ChangeLog 2007/03/21 15:56:49 1.1082 +++ /project/slime/cvsroot/slime/ChangeLog 2007/03/22 13:35:57 1.1083 @@ -1,3 +1,8 @@ +2007-03-22 Matthias Koeppe + + * slime.el (slime-scratch-buffer): Respect the syntax text + properties of presentations. + 2007-03-21 Matthias Koeppe * swank.lisp (lookup-presented-object): The presentation id of From heller at common-lisp.net Sat Mar 24 11:01:36 2007 From: heller at common-lisp.net (heller) Date: Sat, 24 Mar 2007 06:01:36 -0500 (EST) Subject: [slime-cvs] CVS slime Message-ID: <20070324110136.047435F01E@common-lisp.net> Update of /project/slime/cvsroot/slime In directory clnet:/tmp/cvs-serv22438 Modified Files: slime.el Log Message: (slime-read-port-and-connect): Fix race condition: retry one more time if the port file is empty. Pop up the debugger on other errors. (slime-attempt-connection): Moved to toplevel. (slime-timer-call): New. Used by slime-attempt-connection. (slime-cancel-connect-retry-timer): New. (slime-abort-connection): Use it. (slime-repl-insert-prompt): Use insert-before-markers. This fixes some redisplay problems, but I don't know why. Also: remove the timer for async output. (slime-repl-move-output-mark-before-prompt): Removed. (slime-repl-save-merged-history): Use with-temp-message. (slime-goto-location-buffer): Support Zip files. (sldb-quit): Don't print "Evaluation aborted". --- /project/slime/cvsroot/slime/slime.el 2007/03/22 13:35:45 1.771 +++ /project/slime/cvsroot/slime/slime.el 2007/03/24 11:01:36 1.772 @@ -1463,6 +1463,7 @@ (when (and (interactive-p) slime-net-processes (y-or-n-p "Close old connections first? ")) (slime-disconnect)) + (message "Connecting to Swank on port %S.." port) (let ((coding-system (or coding-system slime-net-coding-system))) (slime-check-coding-system coding-system) (message "Connecting to Swank on port %S.." port) @@ -1561,10 +1562,10 @@ (defun slime-abort-connection () "Abort connection the current connection attempt." (interactive) - (if (null slime-connect-retry-timer) - (error "Not connected") - (cancel-timer slime-connect-retry-timer) - (message "Cancelled connection attempt."))) + (cond (slime-connect-retry-timer + (slime-cancel-connect-retry-timer) + (message "Cancelled connection attempt.")) + (t (error "Not connecting")))) ;;; Starting the inferior Lisp and loading Swank: @@ -1602,7 +1603,7 @@ (defun slime-inferior-connect (process args) "Start a Swank server in the inferior Lisp and connect." - (slime-delete-swank-port-file) + (slime-delete-swank-port-file 'quiet) (slime-start-swank-server process args) (slime-read-port-and-connect process nil)) @@ -1647,44 +1648,64 @@ (t "/tmp/"))) (format "slime.%S" (emacs-pid)))) -(defun slime-delete-swank-port-file () - (condition-case nil +(defun slime-delete-swank-port-file (&optional quiet) + (condition-case data (delete-file (slime-swank-port-file)) - (error (message "Unable to delete swank port file located at %s" - (slime-swank-port-file))))) + (error + (ecase quiet + ((nil) (signal (car data) (cdr data))) + (quiet) + (message (message "Unable to delete swank port file %S" + (slime-swank-port-file))))))) (defun slime-read-port-and-connect (inferior-process retries) - (lexical-let ((process inferior-process) - (retries retries) - (attempt 0)) - (labels - ;; A small one-state machine to attempt a connection with - ;; timer-based retries. - ((attempt-connection - () - (unless (active-minibuffer-window) - (message "\ -Polling %S.. (Abort with `M-x slime-abort-connection'.)" - (slime-swank-port-file))) - (unless (slime-connected-p) - (slime-set-state (format "[polling:%S]" (incf attempt)))) - (when slime-connect-retry-timer - (cancel-timer slime-connect-retry-timer)) - (setq slime-connect-retry-timer nil) ; remove old timer - (cond ((file-exists-p (slime-swank-port-file)) - (let ((port (slime-read-swank-port)) - (args (slime-inferior-lisp-args process))) - (slime-delete-swank-port-file) - (let ((c (slime-connect slime-lisp-host port - (plist-get args :coding-system)))) - (slime-set-inferior-process c process)))) - ((and retries (zerop retries)) - (message "Failed to connect to Swank.")) - (t - (when retries (decf retries)) - (setq slime-connect-retry-timer - (run-with-timer 0.2 nil #'attempt-connection)))))) - (attempt-connection)))) + (slime-cancel-connect-retry-timer) + (slime-attempt-connection inferior-process retries 1)) + +(defun slime-attempt-connection (process retries attempt) + ;; A small one-state machine to attempt a connection with + ;; timer-based retries. + (let ((file (slime-swank-port-file))) + (unless (active-minibuffer-window) + (message "Polling %S.. (Abort with `M-x slime-abort-connection'.)" file)) + (unless (slime-connected-p) + (slime-set-state (format "[polling:%S]" attempt))) + (slime-cancel-connect-retry-timer) + (cond ((and (file-exists-p file) + (> (nth 7 (file-attributes file)) 0)) ; file size + (let ((port (slime-read-swank-port)) + (args (slime-inferior-lisp-args process))) + (slime-delete-swank-port-file 'message) + (let ((c (slime-connect slime-lisp-host port + (plist-get args :coding-system)))) + (slime-set-inferior-process c process)))) + ((and retries (zerop retries)) + (message "Failed to connect to Swank.")) + (t + (when (and (file-exists-p file) + (zerop (nth 7 (file-attributes file)))) + (message "(Zero length port file)") + ;; the file may be in the filesystem but not yet written + (unless retries (setq retries 3))) + (setq slime-connect-retry-timer + (run-with-timer 0.3 nil + #'slime-timer-call #'slime-attempt-connection + process (and retries (1- retries)) + (1+ attempt))))))) + +(defun slime-timer-call (fun &rest args) + "Call function FUN with ARGS, reporting all errors. + +The default condition handler for timer functions (see +`timer-event-handler') ignores errors." + (condition-case data + (apply fun args) + (error (debug nil (list "Error in timer" fun args data))))) + +(defun slime-cancel-connect-retry-timer () + (when slime-connect-retry-timer + (cancel-timer slime-connect-retry-timer) + (setq slime-connect-retry-timer nil))) (defun slime-read-swank-port () "Read the Swank server port number from the `slime-swank-port-file'." @@ -2729,7 +2750,7 @@ (setq slime-buffer-connection connection) (slime-reset-repl-markers) (unless noprompt - (slime-repl-insert-prompt 0)) + (slime-repl-insert-prompt)) (current-buffer))))))) (defun slime-repl-update-banner () @@ -3583,7 +3604,7 @@ (insert-before-markers "; Evaluation aborted\n")) (slime-repl-insert-prompt))) -(defun slime-repl-insert-prompt (&optional time) +(defun slime-repl-insert-prompt () "Goto to point max, and insert the prompt." (goto-char (point-max)) (unless (bolp) (insert "\n")) @@ -3596,34 +3617,21 @@ rear-nonsticky (slime-repl-prompt read-only face intangible) ;; xemacs stuff start-open t end-open t) - (insert prompt)) + (insert-before-markers prompt)) (set-marker slime-repl-prompt-start-mark prompt-start) - (slime-mark-input-start) - (let ((time (or time 0.2))) - (cond ((zerop time) - (slime-repl-move-output-mark-before-prompt (current-buffer))) - (t - (run-at-time time nil 'slime-repl-move-output-mark-before-prompt - (current-buffer)))))) + (goto-char slime-repl-prompt-start-mark) + (slime-mark-output-start) + (goto-char (point-max)) + (slime-mark-input-start)) (slime-repl-show-maximum-output)) -(defun slime-repl-move-output-mark-before-prompt (buffer) - (when (buffer-live-p buffer) - (with-current-buffer buffer - (save-excursion - (goto-char slime-repl-prompt-start-mark) - (slime-mark-output-start))))) - (defun slime-repl-show-maximum-output (&optional force) "Put the end of the buffer at the bottom of the window." (assert (eobp)) (let ((win (get-buffer-window (current-buffer)))) - (when (and win (or force (not (pos-visible-in-window-p)))) - (save-selected-window - (save-excursion - (select-window win) - (goto-char (point-max)) - (recenter -1)))))) + (when win + (with-selected-window win + (recenter -1))))) (defun slime-repl-current-input (&optional until-point-p) "Return the current input as string. @@ -3985,7 +3993,7 @@ (slime-eval `(swank:set-package ,package)) (setf (slime-lisp-package) name) (setf (slime-lisp-package-prompt-string) prompt-string) - (slime-repl-insert-prompt 0) + (slime-repl-insert-prompt) (insert unfinished-input))))) @@ -4172,10 +4180,10 @@ `slime-repl-merge-histories'." (interactive (list (slime-repl-read-history-filename))) (let ((file (or filename slime-repl-history-file))) - (message "saving history...") - (let ((hist (slime-repl-merge-histories (slime-repl-read-history file t) - slime-repl-input-history))) - (slime-repl-save-history file hist)))) + (with-temp-message "saving history..." + (let ((hist (slime-repl-merge-histories (slime-repl-read-history file t) + slime-repl-input-history))) + (slime-repl-save-history file hist))))) (defun slime-repl-save-history (&optional filename history) "Simply save the current SLIME REPL history to a file. @@ -5237,7 +5245,17 @@ (erase-buffer) (lisp-mode) (insert string) - (goto-char (point-min))))) + (goto-char (point-min))) + ((:zip file entry) + (require 'arc-mode) + (set-buffer (find-file-noselect file t)) + (goto-char (point-min)) + (re-search-forward (concat " " entry "$")) + (let ((buffer (save-window-excursion + (archive-extract) + (current-buffer)))) + (set-buffer buffer) + (goto-char (point-min)))))) (defun slime-goto-location-position (position) (destructure-case position @@ -5321,6 +5339,7 @@ ::= (:file ) | (:buffer ) | (:source-form ) + | (:zip ) ::= (:position []) ; 1 based | (:line []) @@ -8787,8 +8806,9 @@ (defun sldb-quit () "Quit to toplevel." (interactive) - (slime-eval-async '(swank:throw-to-toplevel) - (lambda (_) (error "sldb-quit returned")))) + (slime-rex () ('(swank:throw-to-toplevel)) + ((:ok _) (error "sldb-quit returned")) + ((:abort)))) (defun sldb-continue () "Invoke the \"continue\" restart." From heller at common-lisp.net Sat Mar 24 11:03:15 2007 From: heller at common-lisp.net (heller) Date: Sat, 24 Mar 2007 06:03:15 -0500 (EST) Subject: [slime-cvs] CVS slime Message-ID: <20070324110315.ED52912088@common-lisp.net> Update of /project/slime/cvsroot/slime In directory clnet:/tmp/cvs-serv23414 Modified Files: ChangeLog Log Message: --- /project/slime/cvsroot/slime/ChangeLog 2007/03/22 13:35:57 1.1083 +++ /project/slime/cvsroot/slime/ChangeLog 2007/03/24 11:03:15 1.1084 @@ -1,3 +1,20 @@ +2007-03-24 Helmut Eller + + * slime.el (slime-read-port-and-connect): Fix race condition: + retry one more time if the port file is empty. Pop up the debugger + on other errors. + (slime-attempt-connection): Moved to toplevel. + (slime-timer-call): New. Used by slime-attempt-connection. + (slime-cancel-connect-retry-timer): New. + (slime-abort-connection): Use it. + (slime-repl-insert-prompt): Use insert-before-markers. This fixes + some redisplay problems, but I don't know why. Also: remove the + timer for async output. + (slime-repl-move-output-mark-before-prompt): Removed. + (slime-repl-save-merged-history): Use with-temp-message. + (slime-goto-location-buffer): Support Zip files. + (sldb-quit): Don't print "Evaluation aborted". + 2007-03-22 Matthias Koeppe * slime.el (slime-scratch-buffer): Respect the syntax text @@ -55,6 +72,12 @@ * swank-backend.lisp (inspect-for-emacs): Remove reference to inexistent argument from docstring. +2007-02-25 Harald Hanche-Olsen + + * slime.el (slime-init-keymaps): Use vectors when defining keys, + because e.g. (define-key (string ?\C-c) ...) doesn't work in the + emacs-unicode-2 branch. Some strings are still there. + 2007-02-25 Helmut Eller * slime.el (slime-delete-swank-port-file): Don't use From mkoeppe at common-lisp.net Sat Mar 24 17:42:50 2007 From: mkoeppe at common-lisp.net (mkoeppe) Date: Sat, 24 Mar 2007 12:42:50 -0500 (EST) Subject: [slime-cvs] CVS slime Message-ID: <20070324174250.E4E721E017@common-lisp.net> Update of /project/slime/cvsroot/slime In directory clnet:/tmp/cvs-serv26004 Modified Files: swank.lisp Log Message: (menu-choices-for-presentation): Offer a "disassemble" menu item for functions. --- /project/slime/cvsroot/slime/swank.lisp 2007/03/21 15:56:24 1.462 +++ /project/slime/cvsroot/slime/swank.lisp 2007/03/24 17:42:50 1.463 @@ -5387,4 +5387,10 @@ nil))) (and (next-method-p) (call-next-method)))))) +(defmethod menu-choices-for-presentation ((ob function)) + (list (list "Disassemble" + (lambda (choice object id) + (declare (ignore choice id)) + (disassemble object))))) + ;;; swank.lisp ends here From mkoeppe at common-lisp.net Sat Mar 24 17:43:16 2007 From: mkoeppe at common-lisp.net (mkoeppe) Date: Sat, 24 Mar 2007 12:43:16 -0500 (EST) Subject: [slime-cvs] CVS slime Message-ID: <20070324174316.1B24F22038@common-lisp.net> Update of /project/slime/cvsroot/slime In directory clnet:/tmp/cvs-serv26094 Modified Files: ChangeLog Log Message: *** empty log message *** --- /project/slime/cvsroot/slime/ChangeLog 2007/03/24 11:03:15 1.1084 +++ /project/slime/cvsroot/slime/ChangeLog 2007/03/24 17:43:15 1.1085 @@ -1,3 +1,8 @@ +2007-03-24 Matthias Koeppe + + * swank.lisp (menu-choices-for-presentation): Offer a + "disassemble" menu item for functions. + 2007-03-24 Helmut Eller * slime.el (slime-read-port-and-connect): Fix race condition: From dcrosher at common-lisp.net Sun Mar 25 00:10:50 2007 From: dcrosher at common-lisp.net (dcrosher) Date: Sat, 24 Mar 2007 19:10:50 -0500 (EST) Subject: [slime-cvs] CVS slime Message-ID: <20070325001050.7AB1F7B49F@common-lisp.net> Update of /project/slime/cvsroot/slime In directory clnet:/tmp/cvs-serv5004 Modified Files: ChangeLog slime.el Log Message: * slime.el (with-selected-window): define for compatibility with Emacs 21. --- /project/slime/cvsroot/slime/ChangeLog 2007/03/24 17:43:15 1.1085 +++ /project/slime/cvsroot/slime/ChangeLog 2007/03/25 00:10:50 1.1086 @@ -1,3 +1,8 @@ +2007-03-25 Douglas Crosher + + * slime.el (with-selected-window): define for compatibility with + Emacs 21. + 2007-03-24 Matthias Koeppe * swank.lisp (menu-choices-for-presentation): Offer a --- /project/slime/cvsroot/slime/slime.el 2007/03/24 11:01:36 1.772 +++ /project/slime/cvsroot/slime/slime.el 2007/03/25 00:10:50 1.773 @@ -11351,6 +11351,11 @@ (when (get-text-property (point) 'point-entered) (funcall (get-text-property (point) 'point-entered)))) +(slime-defun-if-undefined with-selected-window (window &rest body) + `(save-selected-window + (select-window ,window) + , at body)) + ;;; Stuff only available in XEmacs (slime-defun-if-undefined add-local-hook (hook function &optional append) (make-local-hook hook) From nsiivola at common-lisp.net Thu Mar 29 17:08:48 2007 From: nsiivola at common-lisp.net (nsiivola) Date: Thu, 29 Mar 2007 12:08:48 -0500 (EST) Subject: [slime-cvs] CVS slime Message-ID: <20070329170848.4E8661A0A2@common-lisp.net> Update of /project/slime/cvsroot/slime In directory clnet:/tmp/cvs-serv1280 Modified Files: ChangeLog swank.lisp Log Message: Add *print-lines* to *macroexpand-printer-bindings*. --- /project/slime/cvsroot/slime/ChangeLog 2007/03/25 00:10:50 1.1086 +++ /project/slime/cvsroot/slime/ChangeLog 2007/03/29 17:08:47 1.1087 @@ -1,3 +1,9 @@ +2007-03-29 Nikodemus Siivola + + * swank.lisp (*macroexpand-printer-bindings*): add *print-lines* + to defaults (NIL). + (find-definitions-for-emacs): use unless instead of cond. + 2007-03-25 Douglas Crosher * slime.el (with-selected-window): define for compatibility with --- /project/slime/cvsroot/slime/swank.lisp 2007/03/24 17:42:50 1.463 +++ /project/slime/cvsroot/slime/swank.lisp 2007/03/29 17:08:48 1.464 @@ -3154,6 +3154,7 @@ '((*print-circle* . nil) (*print-pretty* . t) (*print-escape* . t) + (*print-lines* . nil) (*print-level* . nil) (*print-length* . nil))) @@ -4101,9 +4102,9 @@ DSPEC is a string and LOCATION a source location. NAME is a string." (multiple-value-bind (sexp error) (ignore-errors (values (from-string name))) - (cond (error '()) - (t (loop for (dspec loc) in (find-definitions sexp) - collect (list (to-string dspec) loc)))))) + (unless error + (loop for (dspec loc) in (find-definitions sexp) + collect (list (to-string dspec) loc))))) (defun alistify (list key test) "Partition the elements of LIST into an alist. KEY extracts the key From nsiivola at common-lisp.net Thu Mar 29 17:12:38 2007 From: nsiivola at common-lisp.net (nsiivola) Date: Thu, 29 Mar 2007 12:12:38 -0500 (EST) Subject: [slime-cvs] CVS slime Message-ID: <20070329171238.E9AA621052@common-lisp.net> Update of /project/slime/cvsroot/slime In directory clnet:/tmp/cvs-serv1914 Modified Files: ChangeLog swank-sbcl.lisp Log Message: Make M-. work better with hotpatched SBCL sources. --- /project/slime/cvsroot/slime/ChangeLog 2007/03/29 17:08:47 1.1087 +++ /project/slime/cvsroot/slime/ChangeLog 2007/03/29 17:12:38 1.1088 @@ -1,5 +1,13 @@ 2007-03-29 Nikodemus Siivola + * swank-sbcl.lisp (swank-compile-string): save the original + directory into the source plist as :emacs-directory. + (make-definition-source-location): use the :emacs-directory from + the source plist and guess-readtable-for-filename to determine the + correct readtable for string-compiled definitions. + +2007-03-29 Nikodemus Siivola + * swank.lisp (*macroexpand-printer-bindings*): add *print-lines* to defaults (NIL). (find-definitions-for-emacs): use unless instead of cond. --- /project/slime/cvsroot/slime/swank-sbcl.lisp 2007/01/10 23:53:47 1.175 +++ /project/slime/cvsroot/slime/swank-sbcl.lisp 2007/03/29 17:12:38 1.176 @@ -416,7 +416,6 @@ (concatenate 'string (tmpnam nil) ".lisp")) (defimplementation swank-compile-string (string &key buffer position directory) - (declare (ignore directory)) (let ((*buffer-name* buffer) (*buffer-offset* position) (*buffer-substring* string) @@ -425,6 +424,7 @@ (with-compilation-hooks () (with-compilation-unit (:source-plist (list :emacs-buffer buffer + :emacs-directory directory :emacs-string string :emacs-position position)) (funcall fn (compile-file filename)))))) @@ -480,22 +480,23 @@ (sb-introspect::definition-source-description source-location)) (if *debug-definition-finding* (make-definition-source-location source-location type name) - (handler-case (make-definition-source-location source-location - type name) + (handler-case + (make-definition-source-location source-location type name) (error (e) - (list :error (format nil "Error: ~A" e))))))) + (list :error (format nil "Error: ~A" e))))))) (defun make-definition-source-location (definition-source type name) (with-struct (sb-introspect::definition-source- pathname form-path character-offset plist file-write-date) definition-source - (destructuring-bind (&key emacs-buffer emacs-position + (destructuring-bind (&key emacs-buffer emacs-position emacs-directory emacs-string &allow-other-keys) plist (cond (emacs-buffer - (let* ((pos (if form-path + (let* ((*readtable* (guess-readtable-for-filename emacs-directory)) + (pos (if form-path (with-debootstrapping (source-path-string-position form-path emacs-string)) character-offset))