From jsnellman at common-lisp.net Sat Oct 1 12:00:30 2005 From: jsnellman at common-lisp.net (Juho Snellman) Date: Sat, 1 Oct 2005 14:00:30 +0200 (CEST) Subject: [slime-cvs] CVS update: slime/swank-backend.lisp slime/ChangeLog Message-ID: <20051001120030.65B81880DB@common-lisp.net> Update of /project/slime/cvsroot/slime In directory common-lisp.net:/tmp/cvs-serv14272 Modified Files: swank-backend.lisp ChangeLog Log Message: 2005-10-01 Juho Snellman * swank-backend (*gray-stream-symbols*): Add :STREAM-LINE-LENGTH to *GRAY-STREAM-SYMBOLS* on implementations that support this extension to gray streams. Reported by Matthew D Swank. Date: Sat Oct 1 14:00:28 2005 Author: jsnellman Index: slime/swank-backend.lisp diff -u slime/swank-backend.lisp:1.89 slime/swank-backend.lisp:1.90 --- slime/swank-backend.lisp:1.89 Tue Sep 27 23:50:38 2005 +++ slime/swank-backend.lisp Sat Oct 1 14:00:27 2005 @@ -167,7 +167,11 @@ :stream-unread-char :stream-clear-input :stream-line-column - :stream-read-char-no-hang)) + :stream-read-char-no-hang + ;; STREAM-LINE-LENGTH is an extension to gray streams that's apparently + ;; supported by CMUCL, OpenMCL and SBCL. + #+(or cmu openmcl sbcl) + :stream-line-length)) (defun import-from (package symbol-names &optional (to-package *package*)) "Import the list of SYMBOL-NAMES found in the package PACKAGE." Index: slime/ChangeLog diff -u slime/ChangeLog:1.790 slime/ChangeLog:1.791 --- slime/ChangeLog:1.790 Thu Sep 29 07:16:19 2005 +++ slime/ChangeLog Sat Oct 1 14:00:27 2005 @@ -1,3 +1,8 @@ +2005-10-01 Juho Snellman + * swank-backend (*gray-stream-symbols*): Add :STREAM-LINE-LENGTH + to *GRAY-STREAM-SYMBOLS* on implementations that support this + extension to gray streams. Reported by Matthew D Swank. + 2005-09-29 Luke Gorrie * swank-scheme48: Removed due to excessive whining. From heller at common-lisp.net Sun Oct 9 18:55:54 2005 From: heller at common-lisp.net (Helmut Eller) Date: Sun, 9 Oct 2005 20:55:54 +0200 (CEST) Subject: [slime-cvs] CVS update: slime/swank.lisp Message-ID: <20051009185554.487CF880E6@common-lisp.net> Update of /project/slime/cvsroot/slime In directory common-lisp.net:/tmp/cvs-serv5191 Modified Files: swank.lisp Log Message: (connection-info): Include the initial package and a more self-descriptive format. Date: Sun Oct 9 20:55:53 2005 Author: heller Index: slime/swank.lisp diff -u slime/swank.lisp:1.342 slime/swank.lisp:1.343 --- slime/swank.lisp:1.342 Wed Sep 28 00:44:28 2005 +++ slime/swank.lisp Sun Oct 9 20:55:52 2005 @@ -54,6 +54,7 @@ (in-package :swank) + ;;;; Top-level variables, constants, macros (defconstant cl-package (find-package :cl) @@ -136,6 +137,7 @@ include some arbitrary initial value like NIL." (error "A required &KEY or &OPTIONAL argument was not supplied.")) + ;;;; Hooks ;;; ;;; We use Emacs-like `add-hook' and `run-hook' utilities to support @@ -164,6 +166,7 @@ (defvar *pre-reply-hook* '() "Hook run (without arguments) immediately before replying to an RPC.") + ;;;; Connections ;;; ;;; Connection structures represent the network connections between @@ -260,6 +263,7 @@ (declare (ignore connection)) (emacs-connected)) + ;;;; Helper macros (defmacro with-io-redirection ((connection) &body body) @@ -327,6 +331,7 @@ (apply #'format *log-output* format-string args) (force-output *log-output*))) + ;;;; TCP Server (defvar *use-dedicated-output-stream* t @@ -507,12 +512,13 @@ (slime-protocol-error (e) (close-connection ,connection e)))) -(defun simple-break () +(defslimefun simple-break () (with-simple-restart (continue "Continue from interrupt.") (let ((*debugger-hook* #'swank-debugger-hook)) (invoke-debugger (make-condition 'simple-error - :format-control "Interrupt from Emacs"))))) + :format-control "Interrupt from Emacs")))) + nil) ;;;;;; Thread based communication @@ -996,8 +1002,8 @@ (prin1-to-string object)))) (defun force-user-output () - (force-output (connection.user-io *emacs-connection*)) - (force-output (connection.user-output *emacs-connection*))) + (finish-output (connection.user-io *emacs-connection*)) + (finish-output (connection.user-output *emacs-connection*))) (defun clear-user-input () (clear-input (connection.user-input *emacs-connection*))) @@ -1051,17 +1057,24 @@ ((:abort) (abort))))))))) (defslimefun connection-info () - "Return a list of the form: -\(PID IMPLEMENTATION-TYPE IMPLEMENTATION-NAME FEATURES - COMMUNICATION-STYLE IMPLEMENTATION-VERSION MACHINE-INSTANCE)." + "Return a key-value list of the form: +\(&key PID STYLE LISP-IMPLEMENTATION MACHINE FEATURES PACKAGE) +PID: is the process-id of Lisp process (or nil, depending on the STYLE) +STYLE: the communication style +LISP-IMPLEMENTATION: a list (&key TYPE TYPE-NAME VERSION) +FEATURES: a list of keywords +PACKAGE: a list (&key NAME PROMPT)" (setq *slime-features* *features*) - (list (getpid) - (lisp-implementation-type) - (lisp-implementation-type-name) - (features-for-emacs) - (connection.communication-style *emacs-connection*) - (lisp-implementation-version) - (machine-instance))) + `(:pid ,(getpid) :style ,(connection.communication-style *emacs-connection*) + :lisp-implementation (:type ,(lisp-implementation-type) + :type-name ,(lisp-implementation-type-name) + :version ,(lisp-implementation-version)) + :machine (:instance ,(machine-instance) + :type ,(machine-type) + :version ,(machine-version)) + :features ,(features-for-emacs) + :package (:name ,(package-name *package*) + :prompt ,(package-string-for-prompt *package*)))) (defslimefun io-speed-test (&optional (n 5000) (m 1)) (let* ((s *standard-output*) From heller at common-lisp.net Sun Oct 9 19:11:08 2005 From: heller at common-lisp.net (Helmut Eller) Date: Sun, 9 Oct 2005 21:11:08 +0200 (CEST) Subject: [slime-cvs] CVS update: slime/slime.el Message-ID: <20051009191108.C51FF880E6@common-lisp.net> Update of /project/slime/cvsroot/slime In directory common-lisp.net:/tmp/cvs-serv6707 Modified Files: slime.el Log Message: (slime, slime-start): Introduce a separate function for the non-interactive case. `slime-start' takes lots of keyword arguments and `slime' is reserved for interactive use. (slime-read-interactive-args): New function. (slime-maybe-start-lisp, slime-inferior-lisp) (slime-start-swank-server): Pass all argumenets needed to start the subprocess as a property list. Also store this list in a buffer-local var in the inferior-lisp buffer, so that we can cleanly restart the process. (slime-registered-lisp-implementations): Change the format and document it. M-- M-x slime can now be used select a registered implemetantion. (slime-symbolic-lisp-name): Deleted. And updated all the functions which pass it along. (slime-set-connection-info): Use the new format. (slime-output-buffer): Don't re-initialize buffer-local variables if the buffer already exists. This saves the history. From Juho Snellman. Date: Sun Oct 9 21:11:07 2005 Author: heller Index: slime/slime.el diff -u slime/slime.el:1.552 slime/slime.el:1.553 --- slime/slime.el:1.552 Wed Sep 28 00:42:55 2005 +++ slime/slime.el Sun Oct 9 21:10:59 2005 @@ -169,6 +169,16 @@ :type '(boolean) :group 'slime-lisp) +(defvar slime-net-coding-system + (find-if (cond ((featurep 'xemacs) + (if (fboundp 'find-coding-system) + #'find-coding-system + (lambda (x) (eq x 'binary)))) + (t #'coding-system-p)) + '(iso-latin-1-unix iso-8859-1-unix binary)) + "*Coding system used for network connections. +See also `slime-net-valid-coding-systems'.") + ;;;;; slime-mode (defgroup slime-mode nil @@ -1231,29 +1241,51 @@ (defvar inferior-lisp-program "lisp" "*Program name for invoking an inferior Lisp with for Inferior Lisp mode.") -(defun slime (&optional command buffer coding-system) +(defun slime (&optional command coding-system) "Start an inferior^_superior Lisp and connect to its Swank server." - (interactive (list (if current-prefix-arg - (read-string "Run lisp: " inferior-lisp-program - 'slime-inferior-lisp-program-history)) - "*inferior-lisp*" - (if (eq 16 (prefix-numeric-value current-prefix-arg)) - (read-coding-system "set slime-coding-system: " - slime-net-coding-system)))) - (let ((command (or (slime-find-lisp-implementation command) - inferior-lisp-program)) - (buffer (or buffer "*inferior-lisp*")) - (coding-system (or coding-system slime-net-coding-system))) - (let ((symbolic-lisp-name (slime-symbolic-lisp-name-p command))) - (slime-check-coding-system coding-system) - (setq slime-net-coding-system coding-system) - (when (or (not (slime-bytecode-stale-p)) - (slime-urge-bytecode-recompile)) - (let ((proc (slime-maybe-start-lisp command buffer))) - (slime-inferior-connect proc nil symbolic-lisp-name) - (pop-to-buffer (process-buffer proc))))))) + (interactive) + (apply #'slime-start (slime-read-interactive-args))) -(defun slime-connect (host port &optional kill-old-p symbolic-lisp-name) +(defun slime-read-interactive-args () + (cond ((eq current-prefix-arg '-) + (let* ((table slime-registered-lisp-implementations) + (key (completing-read + "Lisp name: " + (mapcar (lambda (x) (list (symbol-name (car x)))) table) + nil t))) + (destructuring-bind (name (prog &rest args) &rest keys) + (assoc (intern key) table) + (list* :program prog :program-args args keys)))) + (t + (destructuring-bind (program &rest program-args) + (cond (current-prefix-arg + (split-string + (read-string "Run lisp: " inferior-lisp-program + 'slime-inferior-lisp-program-history))) + (t (list inferior-lisp-program))) + (let ((coding-system + (if (eq 16 (prefix-numeric-value current-prefix-arg)) + (read-coding-system "set slime-coding-system: " + slime-net-coding-system) + slime-net-coding-system))) + (list :program program :program-args program-args + :coding-system coding-system)))))) + +(defun* slime-start (&key (program inferior-lisp-program) program-args + (buffer "*inferior-lisp*") + (coding-system slime-net-coding-system) + (init 'slime-init-command)) + (let ((args (list :program program :program-args program-args :buffer buffer + :coding-system coding-system :init init))) + (slime-check-coding-system coding-system) + (setq slime-net-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)))))) + +(defun slime-connect (host port &optional kill-old-p) "Connect to a running Swank server." (interactive (list (read-from-minibuffer "Host: " "127.0.0.1") (read-from-minibuffer "Port: " "4005" nil t) @@ -1265,23 +1297,7 @@ (message "Connecting to Swank on port %S.." port) (let* ((process (slime-net-connect host port)) (slime-dispatching-connection process)) - (slime-setup-connection process symbolic-lisp-name))) - -(defun slime48 () - "Start a Scheme48 process and connect to its Swank server." - (interactive) - (setq-default slime-lisp-package:connlocal "(scratch)") - (setq-default slime-lisp-package-prompt-string:connlocal "(scratch)") - (let ((proc (slime-start-lisp - scheme-program-name (get-buffer-create "*inferior-lisp*") - (concat ",translate =slime48/ " slime-path "swank-scheme48/\n" - ",exec ,load =slime48/load.scm\n" - ",exec " - (format "(slime48-start %S)" (slime-swank-port-file)) - "\n")))) - (switch-to-buffer (process-buffer proc)) - (goto-char (point-max)) - (slime-read-port-and-connect proc nil))) + (slime-setup-connection process))) (defun slime-start-and-load (filename &optional package) "Start Slime, if needed, load the current file and set the package." @@ -1382,61 +1398,67 @@ ;;; Starting the inferior Lisp and loading Swank: -(defun slime-maybe-start-lisp (command buffername) - "Start an inferior lisp. Instruct it to load Swank." - (cond ((not (comint-check-proc buffername)) - (slime-start-lisp command buffername (slime-init-command))) +(defun slime-maybe-start-lisp (program program-args buffer) + "Return a new or existing inferior lisp process." + (cond ((not (comint-check-proc buffer)) + (slime-start-lisp program program-args buffer)) ((y-or-n-p "Create an additional *inferior-lisp*? ") - (slime-start-lisp command (generate-new-buffer-name buffername) - (slime-init-command))) + (slime-start-lisp program program-args + (generate-new-buffer-name buffer))) (t - (when-let (conn (find (get-buffer-process buffername) + (when-let (conn (find (get-buffer-process buffer) slime-net-processes :key #'slime-inferior-process)) (slime-net-close conn)) - (get-buffer-process buffername)))) - -(defun slime-init-command () - "Return a string to initialize Lisp." - (let ((swank (slime-to-lisp-filename (if (file-name-absolute-p slime-backend) - slime-backend - (concat slime-path slime-backend))))) - (format "(load %S :verbose t)\n" swank))) - -(defun slime-start-lisp (command buffername init-string) - "Start Lisp with COMMAND in BUFFERNAME and send INIT-STRING to it. -Return the new process." - (let ((proc (slime-inferior-lisp command buffername))) - (when slime-kill-without-query-p - (process-kill-without-query proc)) - (when init-string - (comint-send-string proc init-string) - proc))) + (get-buffer-process buffer)))) -(defun slime-inferior-lisp (command buffername) +(defun slime-start-lisp (program program-args buffer) "Does the same as `inferior-lisp' but less ugly. Return the created process." - (let ((args (split-string command))) ; XXX consider: cmucl -eval '(+ 1 2)' - (with-current-buffer (get-buffer-create buffername) - (comint-mode) - (comint-exec (current-buffer) "inferior-lisp" (car args) nil (cdr args)) - (lisp-mode-variables t) - (get-buffer-process (current-buffer))))) + (with-current-buffer (get-buffer-create buffer) + (comint-mode) + (comint-exec (current-buffer) "inferior-lisp" program nil program-args) + (lisp-mode-variables t) + (let ((proc (get-buffer-process (current-buffer)))) + (when slime-kill-without-query-p + (process-kill-without-query proc)) + proc))) -(defun slime-inferior-connect (process &optional retries symbolic-lisp-name) +(defun slime-inferior-connect (process args) "Start a Swank server in the inferior Lisp and connect." (when (file-regular-p (slime-swank-port-file)) (delete-file (slime-swank-port-file))) - (slime-start-swank-server process) - (slime-read-port-and-connect process retries symbolic-lisp-name)) + (slime-start-swank-server process args) + (slime-read-port-and-connect process nil)) + +(defvar slime-inferior-lisp-args nil + "A buffer local variable in the inferior proccess.") -(defun slime-start-swank-server (process) +(defun slime-start-swank-server (process args) "Start a Swank server on the inferior lisp." - (let* ((encoding (slime-coding-system-cl-name slime-net-coding-system)) - (file (slime-to-lisp-filename (slime-swank-port-file)))) - (comint-send-string - process (format "\n(swank:start-server %S :external-format %s)\n" - file encoding)))) + (destructuring-bind (&key coding-system init &allow-other-keys) args + (with-current-buffer (process-buffer process) + (make-local-variable 'slime-inferior-lisp-args) + (setq slime-inferior-lisp-args args) + (let ((str (funcall init (slime-swank-port-file) coding-system))) + (goto-char (point-max)) (insert str) + (comint-send-input))))) + +(defun slime-inferior-lisp-args (process) + (with-current-buffer (process-buffer process) + slime-inferior-lisp-args)) + +;;; XXX load-server & start-server used to separated. maybe that was better. +(defun slime-init-command (port-filename coding-system) + "Return a string to initialize Lisp." + (let ((swank (slime-to-lisp-filename (if (file-name-absolute-p slime-backend) + slime-backend + (concat slime-path slime-backend)))) + (encoding (slime-coding-system-cl-name coding-system)) + (filename (slime-to-lisp-filename port-filename))) + (format "%S\n%S\n\n" + `(load ,swank :verbose t) + `(swank:start-server ,filename :external-format ,encoding)))) (defun slime-swank-port-file () "Filename where the SWANK server writes its TCP port number." @@ -1446,11 +1468,10 @@ (t "/tmp/"))) (format "slime.%S" (emacs-pid)))) -(defun slime-read-port-and-connect (inferior-process retries &optional symbolic-lisp-name) +(defun slime-read-port-and-connect (inferior-process retries) (lexical-let ((process inferior-process) (retries retries) - (attempt 0) - (lisp-name symbolic-lisp-name)) + (attempt 0)) (labels ;; A small one-state machine to attempt a connection with ;; timer-based retries. @@ -1468,7 +1489,7 @@ (cond ((file-exists-p (slime-swank-port-file)) (let ((port (slime-read-swank-port))) (delete-file (slime-swank-port-file)) - (let ((c (slime-connect "127.0.0.1" port nil lisp-name))) + (let ((c (slime-connect "127.0.0.1" port))) (slime-set-inferior-process c process)))) ((and retries (zerop retries)) (message "Failed to connect to Swank.")) @@ -1554,16 +1575,6 @@ "List of functions called when a slime network connection closes. The functions are called with the process as their argument.") -(defvar slime-net-coding-system - (find-if (cond ((featurep 'xemacs) - (if (fboundp 'find-coding-system) - #'find-coding-system - (lambda (x) (eq x 'binary)))) - (t #'coding-system-p)) - '(iso-latin-1-unix iso-8859-1-unix binary)) - "*Coding system used for network connections. -See also `slime-net-valid-coding-systems'.") - (defvar slime-net-valid-coding-systems '((iso-latin-1-unix nil :iso-latin-1-unix) (iso-8859-1-unix nil :iso-latin-1-unix) @@ -1622,6 +1633,8 @@ (unless props (error "Invalid slime-net-coding-system: %s. %s" coding-system (mapcar #'car slime-net-valid-coding-systems))) + (when (and (second props) (boundp 'default-enable-multibyte-characters)) + (assert default-enable-multibyte-characters)) props)) (defun slime-check-coding-system (&optional coding-system) @@ -1666,6 +1679,7 @@ (setq slime-default-connection nil)) (cond (debug (set-process-sentinel process 'ignore) + (set-process-filter process 'ignore) (delete-process process)) (t (run-hook-with-args 'slime-net-process-close-hooks process) @@ -1924,9 +1938,6 @@ (slime-def-connection-var slime-connection-name nil "The short name for connection.") -(slime-def-connection-var slime-symbolic-lisp-name nil - "The symbolic name passed to slime when starting connection.") - (slime-def-connection-var slime-inferior-process nil "The inferior process for the connection if any.") @@ -1942,14 +1953,14 @@ "The number of SLIME connections made. For generating serial numbers.") ;;; Interface -(defun slime-setup-connection (process symbolic-lisp-name) +(defun slime-setup-connection (process) "Make a connection out of PROCESS." (let ((slime-dispatching-connection process)) - (slime-init-connection-state process symbolic-lisp-name) + (slime-init-connection-state process) (slime-select-connection process) process)) -(defun slime-init-connection-state (proc symbolic-lisp-name) +(defun slime-init-connection-state (proc) "Initialize connection state in the process-buffer of PROC." ;; To make life simpler for the user: if this is the only open ;; connection then reset the connection counter. @@ -1958,11 +1969,10 @@ (slime-with-connection-buffer () (setq slime-buffer-connection proc)) (setf (slime-connection-number proc) (incf slime-connection-counter)) - (setf (slime-symbolic-lisp-name proc) - (slime-generate-symbolic-lisp-name symbolic-lisp-name)) - ;; We do our initialization asynchronously. The current function may - ;; be called from a timer, and if we setup the REPL from a timer - ;; then it mysteriously uses the wrong keymap for the first command. + ;; We do the rest of our initialization asynchronously. The current + ;; function may be called from a timer, and if we setup the REPL + ;; from a timer then it mysteriously uses the wrong keymap for the + ;; first command. (slime-eval-async '(swank:connection-info) (lexical-let ((proc proc)) (lambda (info) @@ -1971,15 +1981,22 @@ (defun slime-set-connection-info (connection info) "Initialize CONNECTION with INFO received from Lisp." (let ((slime-dispatching-connection connection)) - (destructuring-bind (pid type name features style version host) info + (destructuring-bind (&key pid style lisp-implementation machine + features package) info (setf (slime-pid) pid - (slime-lisp-implementation-type) type - (slime-lisp-implementation-type-name) name - (slime-connection-name) (slime-generate-connection-name name) - (slime-lisp-features) features (slime-communication-style) style - (slime-lisp-implementation-version) version - (slime-machine-instance) host)) + (slime-lisp-features) features) + (destructuring-bind (&key name prompt) package + (setf (slime-lisp-package) name + (slime-lisp-package-prompt-string) prompt)) + (destructuring-bind (&key type type-name version) lisp-implementation + (setf (slime-lisp-implementation-type) type + (slime-lisp-implementation-version) version + (slime-lisp-implementation-type-name) type-name + (slime-connection-name) (slime-generate-connection-name + type-name))) + (destructuring-bind (&key instance type version) machine + (setf (slime-machine-instance) instance))) (setq slime-state-name "") ; FIXME (slime-hide-inferior-lisp-buffer) (slime-init-output-buffer connection) @@ -1993,15 +2010,6 @@ :key #'slime-connection-name :test #'equal) finally (return name))) -(defun slime-generate-symbolic-lisp-name (lisp-name) - (if lisp-name - (loop for i from 1 - for name = lisp-name then (format "%s<%d>" lisp-name i) - while (find name slime-net-processes - :key #'slime-symbolic-lisp-name :test #'equal) - finally (return name)))) - - (defun slime-connection-close-hook (process) (when (eq process slime-default-connection) (when slime-net-processes @@ -2179,9 +2187,6 @@ (cond ((eq major-mode 'slime-repl-mode) (slime-lisp-package)) (slime-buffer-package) - ((and (eq major-mode 'scheme-mode) - (boundp 'scheme48-package)) - (symbol-value 'scheme48-package)) (t (save-restriction (widen) (slime-find-buffer-package))))) @@ -2330,7 +2335,7 @@ ((:debug thread level condition restarts frames conts) (assert thread) (sldb-setup thread level condition restarts frames conts)) - ((:debug-return thread level &optional stepping) + ((:debug-return thread level stepping) (assert thread) (sldb-exit thread level stepping)) ((:emacs-interrupt thread) @@ -2474,7 +2479,8 @@ (setf (slime-connection-output-buffer) (let ((connection (slime-connection))) (with-current-buffer (slime-repl-buffer t connection) - (slime-repl-mode) + (unless (eq major-mode 'slime-repl-mode) + (slime-repl-mode)) (setq slime-buffer-connection connection) (slime-reset-repl-markers) (unless noprompt @@ -2846,9 +2852,7 @@ (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*" - (or (slime-symbolic-lisp-name connection) - (slime-connection-name connection))))) + (format "*slime-repl %s*" (slime-connection-name connection)))) (defun slime-repl-mode () "Major mode for interacting with a superior Lisp. @@ -3523,7 +3527,7 @@ (defun slime-repl-clear-buffer () "Delete the entire output generated by the Lisp process." (interactive) - (slime-eval `(swank::clear-repl-results)) + (slime-eval-async `(swank:clear-repl-results)) (set-marker slime-repl-last-input-start-mark nil) (let ((inhibit-read-only t)) (delete-region (point-min) (slime-repl-input-line-beginning-position)) @@ -3721,7 +3725,7 @@ (defun slime-repl-read-break () (interactive) - (slime-eval-async `(cl:break))) + (slime-eval-async `(swank:simple-break))) (defun slime-repl-abort-read (thread tag) (with-current-buffer (slime-output-buffer) @@ -3744,9 +3748,7 @@ (defun slime-handle-repl-shortcut () (interactive) - (if (save-excursion - (goto-char slime-repl-input-start-mark) - (looking-at " *$")) + (if (= (point) slime-repl-input-start-mark) (let ((shortcut (slime-lookup-shortcut (completing-read "Command: " (slime-bogus-completion-alist @@ -3754,7 +3756,7 @@ nil t nil 'slime-repl-shortcut-history)))) (call-interactively (slime-repl-shortcut.handler shortcut))) - (insert (string slime-repl-shortcut-dispatch-char)))) + (insert (string slime-repl-shortcut-dispatch-char)))) (defun slime-list-all-repl-shortcuts () (loop for shortcut in slime-repl-shortcut-table @@ -3945,14 +3947,16 @@ Also rearrange windows." (assert (process-status process) 'closed) (let* ((proc (slime-inferior-process process)) - (args (mapconcat #'identity (process-command proc) " ")) + (args (slime-inferior-lisp-args proc)) (buffer (buffer-name (process-buffer proc))) (buffer-window (get-buffer-window buffer)) - (new-proc (slime-start-lisp args buffer (slime-init-command))) + (new-proc (slime-start-lisp (plist-get args :program) + (plist-get args :program-args) + buffer)) (repl-buffer (slime-repl-buffer nil process)) (repl-window (and repl-buffer (get-buffer-window repl-buffer)))) (slime-net-close process) - (slime-inferior-connect new-proc) + (slime-inferior-connect new-proc args) (cond ((and repl-window (not buffer-window)) (set-window-buffer repl-window buffer) (select-window repl-window)) @@ -7129,7 +7133,7 @@ (with-current-buffer (sldb-find-buffer thread) (unless (equal sldb-level level) (with-lexical-bindings (thread level) - (slime-eval-async `(swank:debugger-info-for-emacs 0 1) + (slime-eval-async `(swank:debugger-info-for-emacs 0 10) (lambda (result) (apply #'sldb-setup thread level result))))))) @@ -7433,19 +7437,13 @@ (sldb-insert-locals frame-number indent2) (when sldb-show-catch-tags (let ((catchers (sldb-catch-tags frame-number))) - (cond ((null catchers) - (insert indent1 - (in-sldb-face catch-tag "[No catch-tags]\n"))) - (t - (insert indent1 "Catch-tags:\n") - (dolist (tag catchers) - (slime-insert-propertized - '(catch-tag ,tag) - indent2 (in-sldb-face catch-tag - (format "%s\n" tag)))))))) - - (unless sldb-enable-styled-backtrace (terpri)) - (point))))) + (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))) (defun sldb-frame-region () @@ -7786,7 +7784,26 @@ ;;;;; Connection listing -(defvar slime-registered-lisp-implementations ()) +(defvar slime-registered-lisp-implementations + `((lisp (,inferior-lisp-program))) + "*A list of known Lisp implementations. +The list should have the form: + ((NAME (PROGRAM PROGRAM-ARGS...) &key INIT CODING-SYSTEM) ...) + +NAME is a symbol for the implementation. +PROGRAM and PROGRAM-ARGS are strings used to start the Lisp process. +INIT is a function that should return a string to load and start + Swank. The function will be called with the PORT-FILENAME and ENCODING as + arguments. INIT defaults to `slime-init-command'. +CODING-SYSTEM a symbol for the coding system. The default is + slime-net-coding-system + +Here's an example: + (cmucl (\"/opt/cmucl/bin/lisp\" \"-quiet\") :init slime-init-command)") + +(defvar slime-default-lisp 'lisp + "*The name of the default Lisp implementation. +See `slime-registered-lisp-implementations'") (defun slime-register-lisp-implementation (name command) (interactive "sName: \nfCommand: ") From heller at common-lisp.net Sun Oct 9 19:13:04 2005 From: heller at common-lisp.net (Helmut Eller) Date: Sun, 9 Oct 2005 21:13:04 +0200 (CEST) Subject: [slime-cvs] CVS update: slime/swank-cmucl.lisp Message-ID: <20051009191304.0E35D880E6@common-lisp.net> Update of /project/slime/cvsroot/slime In directory common-lisp.net:/tmp/cvs-serv6772 Modified Files: swank-cmucl.lisp Log Message: (sis/in): Use finish-output instead of force-output. Date: Sun Oct 9 21:13:04 2005 Author: heller Index: slime/swank-cmucl.lisp diff -u slime/swank-cmucl.lisp:1.155 slime/swank-cmucl.lisp:1.156 --- slime/swank-cmucl.lisp:1.155 Tue Sep 27 23:50:38 2005 +++ slime/swank-cmucl.lisp Sun Oct 9 21:13:03 2005 @@ -229,16 +229,7 @@ nil) (:force-output (log-stream-op stream operation) - (unless (or (zerop (sos.index stream)) - (loop with buffer = (sos.buffer stream) - for i from 0 below (sos.index stream) - always (char= (aref buffer i) #\newline))) - (let ((last (sos.last-flush-time stream)) - (now (get-internal-real-time))) - (when (> (/ (- now last) - (coerce internal-time-units-per-second 'double-float)) - 0.1) - (finish-output stream)))) + (sos/misc-force-output stream) nil) (:charpos (sos.column stream)) (:line-length 75) @@ -248,6 +239,18 @@ (:close nil) (t (format *terminal-io* "~&~Astream: ~S~%" stream operation)))) +(defun sos/misc-force-output (stream) + (unless (or (zerop (sos.index stream)) + (loop with buffer = (sos.buffer stream) + for i from 0 below (sos.index stream) + always (char= (aref buffer i) #\newline))) + (let ((last (sos.last-flush-time stream)) + (now (get-internal-real-time))) + (when (> (/ (- now last) + (coerce internal-time-units-per-second 'double-float)) + 0.1) + (finish-output stream))))) + (defstruct (slime-input-stream (:include string-stream (lisp::in #'sis/in) @@ -263,10 +266,10 @@ (index 0 :type kernel:index)) (defun sis/in (stream eof-errorp eof-value) + (finish-output (sis.sos stream)) (let ((index (sis.index stream)) (buffer (sis.buffer stream))) (when (= index (length buffer)) - (force-output (sis.sos stream)) (let ((string (funcall (sis.input-fn stream)))) (cond ((zerop (length string)) (return-from sis/in From heller at common-lisp.net Sun Oct 9 19:17:23 2005 From: heller at common-lisp.net (Helmut Eller) Date: Sun, 9 Oct 2005 21:17:23 +0200 (CEST) Subject: [slime-cvs] CVS update: slime/ChangeLog Message-ID: <20051009191723.8B33E880E6@common-lisp.net> Update of /project/slime/cvsroot/slime In directory common-lisp.net:/tmp/cvs-serv7703 Modified Files: ChangeLog Log Message: *** empty log message *** Date: Sun Oct 9 21:17:22 2005 Author: heller Index: slime/ChangeLog diff -u slime/ChangeLog:1.791 slime/ChangeLog:1.792 --- slime/ChangeLog:1.791 Sat Oct 1 14:00:27 2005 +++ slime/ChangeLog Sun Oct 9 21:17:22 2005 @@ -1,4 +1,32 @@ +2005-10-09 Helmut Eller + + * slime.el (slime, slime-start): Introduce a separate function for + the non-interactive case. `slime-start' takes lots of keyword + arguments and `slime' is reserved for interactive use. + (slime-read-interactive-args): New function. + (slime-maybe-start-lisp, slime-inferior-lisp) + (slime-start-swank-server): Pass all arguments needed to start + the subprocess as a property list. Also store this list in a + buffer-local var in the inferior-lisp buffer, so that we can + cleanly restart the process. + (slime-registered-lisp-implementations): Change the format and + document it. M-- M-x slime can now be used select a registered + implementation. + (slime-symbolic-lisp-name): Deleted. And updated all the functions + which passed it along. + (slime-set-connection-info): Use the new format. + (slime-output-buffer): Don't re-initialize buffer-local variables + if the buffer already exists. This saves the history. From Juho + Snellman. + + * swank-cmucl.lisp (sis/in): Use finish-output instead of + force-output. + + * swank.lisp (connection-info): Include the initial package and + a more self-descriptive format. + 2005-10-01 Juho Snellman + * swank-backend (*gray-stream-symbols*): Add :STREAM-LINE-LENGTH to *GRAY-STREAM-SYMBOLS* on implementations that support this extension to gray streams. Reported by Matthew D Swank. @@ -25,8 +53,7 @@ * swank-scheme48/source-location.scm: New file. For M-. * swank-scheme48/module.scm (list-all-package): New function. * swank-scheme48/interfaces.scm (module-control-interface): Export it. - * swank-scheme48/inspector.scm: Add methods for records and and - hashtables. + * swank-scheme48/inspector.scm: Add methods for records and hashtables. (swank:arglist-for-echo-area): Implement it. Only works for functions with enough debug-data (ie. only user-defined functions). * swank-scheme48/completion.scm: New file. From heller at common-lisp.net Mon Oct 10 22:23:32 2005 From: heller at common-lisp.net (Helmut Eller) Date: Tue, 11 Oct 2005 00:23:32 +0200 (CEST) Subject: [slime-cvs] CVS update: slime/slime.el Message-ID: <20051010222332.590638856A@common-lisp.net> Update of /project/slime/cvsroot/slime In directory common-lisp.net:/tmp/cvs-serv4446 Modified Files: slime.el Log Message: (slime-read-interactive-args): Split the string inferior-lisp-program to get the values for :program and :program-args. Also let slime-lisp-implementations take precedence if non-nil. (slime-lisp-implementations): Renamed from slime-registered-lisp-implementations. Date: Tue Oct 11 00:23:23 2005 Author: heller Index: slime/slime.el diff -u slime/slime.el:1.553 slime/slime.el:1.554 --- slime/slime.el:1.553 Sun Oct 9 21:10:59 2005 +++ slime/slime.el Tue Oct 11 00:23:20 2005 @@ -207,7 +207,7 @@ slime-maybe-show-xrefs-for-notes)) (defcustom slime-complete-symbol-function 'slime-complete-symbol* - "Function to perform symbol completion." + "*Function to perform symbol completion." :group 'slime-mode :type '(choice (const :tag "Simple" slime-simple-complete-symbol) (const :tag "Compound" slime-complete-symbol*) @@ -1247,29 +1247,54 @@ (apply #'slime-start (slime-read-interactive-args))) (defun slime-read-interactive-args () - (cond ((eq current-prefix-arg '-) - (let* ((table slime-registered-lisp-implementations) - (key (completing-read - "Lisp name: " - (mapcar (lambda (x) (list (symbol-name (car x)))) table) - nil t))) - (destructuring-bind (name (prog &rest args) &rest keys) - (assoc (intern key) table) - (list* :program prog :program-args args keys)))) - (t - (destructuring-bind (program &rest program-args) - (cond (current-prefix-arg - (split-string - (read-string "Run lisp: " inferior-lisp-program - 'slime-inferior-lisp-program-history))) - (t (list inferior-lisp-program))) - (let ((coding-system - (if (eq 16 (prefix-numeric-value current-prefix-arg)) - (read-coding-system "set slime-coding-system: " - slime-net-coding-system) - slime-net-coding-system))) - (list :program program :program-args program-args - :coding-system coding-system)))))) + "Return the list of args which should be passed to `slime-start'. + +The rules for selecting the arguments are rather complicated: + +- In the most common case, i.e. if there's no prefix-arg in + effect and if `slime-lisp-implementations' is nil, use + `inferior-lisp-program' as fallback. + +- If the table `slime-lisp-implementations' is non-nil use the + implementation with name `slime-default-lisp' or if that's nil + the first entry in the table. + +- If the prefix-arg is `-', prompt for one of the registered + lisps. + +- If the prefix-arg is positive, read the command to start the + process." + (let ((table slime-lisp-implementations)) + (cond ((not current-prefix-arg) + (cond (table + (slime-lookup-lisp-implementation + table (or slime-default-lisp (car (first table))))) + (t + (destructuring-bind (program &rest args) + (split-string inferior-lisp-program) + (list :program program :program-args args))))) + ((eq current-prefix-arg '-) + (let ((key (completing-read + "Lisp name: " (mapcar (lambda (x) + (list (symbol-name (car x)))) + table) + nil t))) + (slime-lookup-lisp-implementation table (intern key)))) + (t + (destructuring-bind (program &rest program-args) + (split-string (read-string "Run lisp: " inferior-lisp-program + 'slime-inferior-lisp-program-history)) + (let ((coding-system + (if (eq 16 (prefix-numeric-value current-prefix-arg)) + (read-coding-system "set slime-coding-system: " + slime-net-coding-system) + slime-net-coding-system))) + (list :program program :program-args program-args + :coding-system coding-system))))))) + +(defun slime-lookup-lisp-implementation (table name) + (destructuring-bind (name (prog &rest args) &rest keys) (assoc name table) + (list* :program prog :program-args args keys))) (defun* slime-start (&key (program inferior-lisp-program) program-args (buffer "*inferior-lisp*") @@ -4680,11 +4705,13 @@ (or (re-search-forward (format "\\s *(def\\(\\s_\\|\\sw\\)*\\s +%s\\S_" name) nil t) - (re-search-forward - (format "\\s *(def\\(\\s_\\|\\sw\\)*\\s +(*?%s\\S_" name) nil t) - (re-search-forward - ;; FIXME: Isn't this far to general? - (format "[( \t]%s\\>\\(\\s \\|$\\)" name) nil t))) + ;; ;; FIXME: this matches the same and a bit more than the last line + ;; (re-search-forward + ;; (format "\\s *(def\\(\\s_\\|\\sw\\)*\\s +(*?%s\\S_" name) nil t) + ;; (re-search-forward + ;; ;; FIXME: Isn't this far to general? + ;; (format "[( \t]%s\\>\\(\\s \\|$\\)" name) nil t) + )) (goto-char (match-beginning 0))) ((:method name specializers &rest qualifiers) (slime-search-method-location name specializers qualifiers)) @@ -7784,8 +7811,7 @@ ;;;;; Connection listing -(defvar slime-registered-lisp-implementations - `((lisp (,inferior-lisp-program))) +(defvar slime-lisp-implementations nil "*A list of known Lisp implementations. The list should have the form: ((NAME (PROGRAM PROGRAM-ARGS...) &key INIT CODING-SYSTEM) ...) @@ -7799,38 +7825,39 @@ slime-net-coding-system Here's an example: - (cmucl (\"/opt/cmucl/bin/lisp\" \"-quiet\") :init slime-init-command)") + ((cmucl (\"/opt/cmucl/bin/lisp\" \"-quiet\") :init slime-init-command) + (acl (\"acl7\") :coding-system emacs-mule))") -(defvar slime-default-lisp 'lisp +(defvar slime-default-lisp nil "*The name of the default Lisp implementation. -See `slime-registered-lisp-implementations'") +See `slime-lisp-implementations'") (defun slime-register-lisp-implementation (name command) (interactive "sName: \nfCommand: ") - (let ((cons (assoc name slime-registered-lisp-implementations))) + (let ((cons (assoc name slime-lisp-implementations))) (if cons (setf (cdr cons) command) - (push (cons name command) slime-registered-lisp-implementations))) + (push (cons name command) slime-lisp-implementations))) (if (string= inferior-lisp-program "lisp") (slime-select-lisp-implementation name))) (defun slime-select-lisp-implementation (name) (interactive "sName: ") (setq inferior-lisp-program - (cdr (assoc name slime-registered-lisp-implementations)))) + (cdr (assoc name slime-lisp-implementations)))) (defun slime-find-lisp-implementation (name) - (let ((cons (or (assoc name slime-registered-lisp-implementations) - (rassoc name slime-registered-lisp-implementations)))) + (let ((cons (or (assoc name slime-lisp-implementations) + (rassoc name slime-lisp-implementations)))) (if cons (cdr cons) name))) ;; XXX: unused function (defun slime-find-lisp-implementation-name (command) - (cdr (rassoc command slime-registered-lisp-implementations))) + (cdr (rassoc command slime-lisp-implementations))) (defun slime-symbolic-lisp-name-p (name) - (let ((cons (or (assoc name slime-registered-lisp-implementations) - (rassoc name slime-registered-lisp-implementations)))) + (let ((cons (or (assoc name slime-lisp-implementations) + (rassoc name slime-lisp-implementations)))) (if cons (car cons)))) From heller at common-lisp.net Mon Oct 10 22:24:35 2005 From: heller at common-lisp.net (Helmut Eller) Date: Tue, 11 Oct 2005 00:24:35 +0200 (CEST) Subject: [slime-cvs] CVS update: slime/swank-allegro.lisp Message-ID: <20051010222435.3B22E8856A@common-lisp.net> Update of /project/slime/cvsroot/slime In directory common-lisp.net:/tmp/cvs-serv4485 Modified Files: swank-allegro.lisp Log Message: (find-external-format): Translate :utf-8-unix to :utf8, which Allegro 7.0 understands. Date: Tue Oct 11 00:24:30 2005 Author: heller Index: slime/swank-allegro.lisp diff -u slime/swank-allegro.lisp:1.78 slime/swank-allegro.lisp:1.79 --- slime/swank-allegro.lisp:1.78 Tue Sep 27 23:50:38 2005 +++ slime/swank-allegro.lisp Tue Oct 11 00:24:28 2005 @@ -1,4 +1,4 @@ -;;;; -*- indent-tabs-mode: nil; outline-regexp: ";;;;;*"; -*- +;;;; -*- indent-tabs-mode: nil; outline-regexp: ";;;;;* "; -*- ;;; ;;; swank-allegro.lisp --- Allegro CL specific code for SLIME. ;;; @@ -12,9 +12,9 @@ (eval-when (:compile-toplevel :load-toplevel :execute) (require :sock) - (require :process) + (require :process)) - (import-from :excl *gray-stream-symbols* :swank-backend)) +(import-from :excl *gray-stream-symbols* :swank-backend) ;;; swank-mop @@ -25,6 +25,7 @@ (defun swank-mop:slot-definition-documentation (slot) (documentation slot t)) + ;;;; TCP Server (defimplementation preferred-communication-style () @@ -47,13 +48,15 @@ s)) (defun find-external-format (coding-system) - #-(version>= 6) :default #+(version>= 6) (let* ((name (ecase coding-system (:iso-latin-1-unix :latin1) - (:utf-8-unix :utf-8-unix) + (:utf-8-unix :utf8) (:emacs-mule-unix :emacs-mule)))) - (excl:crlf-base-ef (excl:find-external-format name :try-variant t)))) + (excl:crlf-base-ef (excl:find-external-format name :try-variant t))) + #-(version>= 6) + (ecase coding-system + (:iso-latin-1-unix :default))) (defun set-external-format (stream external-format) (setf (stream-external-format stream) @@ -504,8 +507,9 @@ (defun frob-allegro-field-def (object def) (with-struct (inspect::field-def- name type access) def (ecase type - ((:unsigned-word :unsigned-byte :unsigned-natural - :unsigned-half-long :unsigned-3byte) + ((:unsigned-word :unsigned-byte :unsigned-natural + :unsigned-long :unsigned-half-long + :unsigned-3byte) (label-value-line name (inspect::component-ref-v object access type))) ((:lisp :value) (label-value-line name (inspect::component-ref object access))) From heller at common-lisp.net Mon Oct 10 22:26:00 2005 From: heller at common-lisp.net (Helmut Eller) Date: Tue, 11 Oct 2005 00:26:00 +0200 (CEST) Subject: [slime-cvs] CVS update: slime/swank.lisp Message-ID: <20051010222600.7C2E38856A@common-lisp.net> Update of /project/slime/cvsroot/slime In directory common-lisp.net:/tmp/cvs-serv4517 Modified Files: swank.lisp Log Message: (force-user-output): There seems to be a bug in Allegro's two-way-streams. As a workaround we use force-output for the user-io stream. (finish-output *debug-io*) still triggers the bug. Date: Tue Oct 11 00:25:54 2005 Author: heller Index: slime/swank.lisp diff -u slime/swank.lisp:1.343 slime/swank.lisp:1.344 --- slime/swank.lisp:1.343 Sun Oct 9 20:55:52 2005 +++ slime/swank.lisp Tue Oct 11 00:25:51 2005 @@ -1002,7 +1002,7 @@ (prin1-to-string object)))) (defun force-user-output () - (finish-output (connection.user-io *emacs-connection*)) + (force-output (connection.user-io *emacs-connection*)) (finish-output (connection.user-output *emacs-connection*))) (defun clear-user-input () From heller at common-lisp.net Mon Oct 10 22:27:05 2005 From: heller at common-lisp.net (Helmut Eller) Date: Tue, 11 Oct 2005 00:27:05 +0200 (CEST) Subject: [slime-cvs] CVS update: slime/ChangeLog Message-ID: <20051010222705.7CA398856A@common-lisp.net> Update of /project/slime/cvsroot/slime In directory common-lisp.net:/tmp/cvs-serv4533 Modified Files: ChangeLog Log Message: *** empty log message *** Date: Tue Oct 11 00:27:03 2005 Author: heller Index: slime/ChangeLog diff -u slime/ChangeLog:1.792 slime/ChangeLog:1.793 --- slime/ChangeLog:1.792 Sun Oct 9 21:17:22 2005 +++ slime/ChangeLog Tue Oct 11 00:27:02 2005 @@ -1,3 +1,22 @@ +2005-10-11 Helmut Eller + + * slime.el (slime-read-interactive-args): Split the string + inferior-lisp-program to get the values for :program and + :program-args. Also let slime-lisp-implementations take + precedence if non-nil. + (slime-lisp-implementations): Renamed from + slime-registered-lisp-implementations. + + * swank.lisp (force-user-output): There seems to be a bug in + Allegro's two-way-streams. As a workaround we use force-output for + the user-io stream. (finish-output *debug-io*) still triggers the + bug. + +2005-10-10 Svein Ove Aas + + * swank-allegro.lisp (find-external-format): Translate :utf-8-unix + to :utf8, which Allegro 7.0 understands. + 2005-10-09 Helmut Eller * slime.el (slime, slime-start): Introduce a separate function for From heller at common-lisp.net Tue Oct 11 21:09:10 2005 From: heller at common-lisp.net (Helmut Eller) Date: Tue, 11 Oct 2005 23:09:10 +0200 (CEST) Subject: [slime-cvs] CVS update: slime/slime.el Message-ID: <20051011210910.CE5F188031@common-lisp.net> Update of /project/slime/cvsroot/slime In directory common-lisp.net:/tmp/cvs-serv12753 Modified Files: slime.el Log Message: Persistent REPL history. The history from REPL buffers is now saved to the file ~/.slime-history.eld. The file is read on startup and saved when a REPL buffer gets killed or when Emacs exits. There are also commands to save or read the history file. (slime-repl-save-merged-history, slime-repl-merge-histories) (slime-repl-read-history, slime-repl-save-history): New functions. (slime-repl-history-file, slime-repl-history-size): New vars. (slime-repl-mode): Add hooks to load and save the history. >From Stefan Kamphausen. Date: Tue Oct 11 23:09:09 2005 Author: heller Index: slime/slime.el diff -u slime/slime.el:1.554 slime/slime.el:1.555 --- slime/slime.el:1.554 Tue Oct 11 00:23:20 2005 +++ slime/slime.el Tue Oct 11 23:09:08 2005 @@ -2860,7 +2860,7 @@ (defvar slime-repl-input-history '() "History list of strings read from the REPL buffer.") - (defvar slime-repl-input-history-position 0 + (defvar slime-repl-input-history-position -1 "Newer items have smaller indices.") (defvar slime-repl-prompt-start-mark) @@ -2894,6 +2894,10 @@ (setq slime-current-thread :repl-thread) (set (make-local-variable 'scroll-conservatively) 20) (set (make-local-variable 'scroll-margin) 0) + (slime-repl-read-history) + (make-local-hook 'kill-buffer-hook) + (add-hook 'kill-buffer-hook 'slime-repl-save-merged-history nil t) + (add-hook 'kill-emacs-hook 'slime-repl-save-all-histories) (slime-setup-command-hooks) (run-hooks 'slime-repl-mode-hook)) @@ -3661,6 +3665,112 @@ (interactive "sNext element matching (regexp): ") (slime-repl-history-replace 'forward regexp)) +;;;;; Persistent History + +(defvar slime-repl-history-file "~/.slime-history.eld") +(defvar slime-repl-history-size 100) + +(defun slime-repl-merge-histories (old-hist new-hist) + "Merge entries from OLD-HIST and NEW-HIST such that the new items in + NEW-HIST are appended to the OLD-HIST." + (append + ;; first the new unique elements... + (remove-if #'(lambda (entry) + (member entry old-hist)) + new-hist) + ;; then the old unique elements... + (remove-if #'(lambda (entry) + (member entry new-hist)) + old-hist) + ;; and finally elements existing in both lists + (remove-if #'(lambda (entry) + (not (member entry old-hist))) + new-hist))) + +(defun slime-repl-read-history-internal (filename) + "Return the list stored in FILENAME. +The file contents are read using READ and no further error checking is +done." + (when (and file (file-readable-p file)) + (with-temp-buffer + (insert-file-contents file) + (read (current-buffer))))) + +(defun slime-repl-read-history (&optional filename) + "Set the current SLIME REPL history. +It can be read either from FILENAME or `slime-repl-history-file' or +from a user defined filename." + (interactive) + (let ((file (or filename + slime-repl-history-file + (read-file-name "Read SLIME REPL history from file: ")))) + (setq slime-repl-input-history + (slime-repl-read-history-internal file)))) + +(defun slime-repl-save-merged-history (&optional filename) + "Read the history file, merge the current REPL history and save it. +This tries to be smart in merging the history from the file and the +current history in that it tries to detect the unique entries using +`slime-repl-merge-histories'." + (interactive) + (message "saving history...") + (let ((file (or filename + slime-repl-history-file + (read-file-name "Save SLIME REPL history to file: ")))) + (cond + ((or (null file) + (null slime-repl-input-history)) + nil) + ((not (file-writable-p file)) + (error (format "Can't write SLIME REPL history file %s" file))) + (t + (let ((hist (slime-repl-read-history-internal file))) + (if (not (null hist)) + (setq hist (slime-repl-merge-histories + hist slime-repl-input-history)) + (setq hist slime-repl-input-history)) + (slime-repl-save-history hist file)))))) + +(defun slime-repl-save-history (&optional history filename) + "Simply save the current SLIME REPL history to a file. +When SLIME is setup to always load the old history and one uses only +one instance of slime all the time, there is no need to merge the +files and this function is sufficient. + +When the list is longer than `slime-repl-history-size' it will be +truncated. That part is untested, though! +" + (interactive) + (let ((file (or filename + slime-repl-history-file + (read-file-name "Save SLIME REPL history to file: ")))) + (cond + ((or (null file) + (null slime-repl-input-history)) + nil) + ((not (file-writable-p file)) + (error (format "Can't write SLIME REPL history file %s" file))) + (t + (let* ((hist (or history slime-repl-input-history)) + (len (length hist))) + (when (> len slime-repl-history-size) + (setq hist (subseq hist (- len slime-repl-history-size)))) + ;;(message "saving %s to %s\n" hist file) + (with-temp-buffer + (insert ";; History for SLIME REPL. Automatically written\n") + (insert ";; Edit only if you know what you're doing\n") + (pp (mapcar 'substring-no-properties hist) (current-buffer)) + (write-region (point-min) (point-max) file))))))) + +(defun slime-repl-save-all-histories () + "Save the history in each repl buffer." + (dolist (b (buffer-list)) + (with-current-buffer b + (when (eq major-mode 'slime-repl-mode) + (slime-repl-save-merged-history))))) + +;;;;; REPL mode setup + (defun slime-repl () (interactive) (slime-switch-to-output-buffer)) @@ -3711,6 +3821,8 @@ ("\C-c\C-k" 'slime-compile-and-load-file) ("\C-c\C-z" 'slime-nop)) +;;;;;; REPL Read Mode + (define-key slime-repl-mode-map (string slime-repl-shortcut-dispatch-char) 'slime-handle-repl-shortcut) @@ -6997,7 +7109,7 @@ ;; Make original slime-connection "sticky" for SLDB commands in this buffer (setq slime-buffer-connection (slime-connection)) (make-local-variable 'kill-buffer-hook) - (add-hook 'kill-buffer-hook 'sldb-delete-overlays)) + (add-hook 'kill-buffer-hook 'sldb-delete-overlays nil t)) (defun sldb-help-summary () "Show summary of important sldb commands" From heller at common-lisp.net Tue Oct 11 21:11:25 2005 From: heller at common-lisp.net (Helmut Eller) Date: Tue, 11 Oct 2005 23:11:25 +0200 (CEST) Subject: [slime-cvs] CVS update: slime/ChangeLog Message-ID: <20051011211125.670C788031@common-lisp.net> Update of /project/slime/cvsroot/slime In directory common-lisp.net:/tmp/cvs-serv12796 Modified Files: ChangeLog Log Message: *** empty log message *** Date: Tue Oct 11 23:11:24 2005 Author: heller Index: slime/ChangeLog diff -u slime/ChangeLog:1.793 slime/ChangeLog:1.794 --- slime/ChangeLog:1.793 Tue Oct 11 00:27:02 2005 +++ slime/ChangeLog Tue Oct 11 23:11:24 2005 @@ -1,3 +1,15 @@ +2005-10-11 Stefan Kamphausen + + * slime.el: Persistent REPL history. The history from REPL + buffers is now saved to the file ~/.slime-history.eld. The file + is read on startup and saved when a REPL buffer gets killed or + when Emacs exits. There are also commands to save or read the + history file. + (slime-repl-save-merged-history, slime-repl-merge-histories) + (slime-repl-read-history, slime-repl-save-history): New functions. + (slime-repl-history-file, slime-repl-history-size): New vars. + (slime-repl-mode): Add hooks to load and save the history. + 2005-10-11 Helmut Eller * slime.el (slime-read-interactive-args): Split the string @@ -14,7 +26,7 @@ 2005-10-10 Svein Ove Aas - * swank-allegro.lisp (find-external-format): Translate :utf-8-unix + * swank-allegro.lisp (find-external-format): Translate :utf-8-unix to :utf8, which Allegro 7.0 understands. 2005-10-09 Helmut Eller From dcrosher at common-lisp.net Fri Oct 14 18:02:24 2005 From: dcrosher at common-lisp.net (Douglas Crosher) Date: Fri, 14 Oct 2005 20:02:24 +0200 (CEST) Subject: [slime-cvs] CVS update: slime/swank-scl.lisp Message-ID: <20051014180224.2763E880DB@common-lisp.net> Update of /project/slime/cvsroot/slime In directory common-lisp.net:/tmp/cvs-serv20703 Added Files: swank-scl.lisp Log Message: Scieneer Common Lisp code for SLIME. Date: Fri Oct 14 20:02:23 2005 Author: dcrosher From dcrosher at common-lisp.net Fri Oct 14 18:05:44 2005 From: dcrosher at common-lisp.net (Douglas Crosher) Date: Fri, 14 Oct 2005 20:05:44 +0200 (CEST) Subject: [slime-cvs] CVS update: slime/swank.lisp Message-ID: <20051014180544.72692880DB@common-lisp.net> Update of /project/slime/cvsroot/slime In directory common-lisp.net:/tmp/cvs-serv20740 Modified Files: swank.lisp Log Message: o *canonical-package-nicknames*: use lowercase symbols to name the packages. This supports CL implementations with lowercase default symbol names, such as Scieneer Common Lisp, while still being compatible with ANSI-CL. Date: Fri Oct 14 20:05:43 2005 Author: dcrosher Index: slime/swank.lisp diff -u slime/swank.lisp:1.344 slime/swank.lisp:1.345 --- slime/swank.lisp:1.344 Tue Oct 11 00:25:51 2005 +++ slime/swank.lisp Fri Oct 14 20:05:43 2005 @@ -64,7 +64,7 @@ "The KEYWORD package.") (defvar *canonical-package-nicknames* - '(("COMMON-LISP-USER" . "CL-USER")) + '((:common-lisp-user . :cl-user)) "Canonical package names to use instead of shortest name/nickname.") (defvar *auto-abbreviate-dotted-packages* t From dcrosher at common-lisp.net Fri Oct 14 18:11:17 2005 From: dcrosher at common-lisp.net (Douglas Crosher) Date: Fri, 14 Oct 2005 20:11:17 +0200 (CEST) Subject: [slime-cvs] CVS update: slime/swank-loader.lisp Message-ID: <20051014181117.DA806880DB@common-lisp.net> Update of /project/slime/cvsroot/slime In directory common-lisp.net:/tmp/cvs-serv20778 Modified Files: swank-loader.lisp Log Message: Support for Scieneer Common Lisp: o *sysdep-pathnames*: swank-scl. o *implementation-features*: add :scl. o *os-features*: add :hpux. o *architecture-features*: add :amd64, :i686, :i486, :sparc64, :sparc, :hppa64, and :hppa. Date: Fri Oct 14 20:11:17 2005 Author: dcrosher Index: slime/swank-loader.lisp diff -u slime/swank-loader.lisp:1.52 slime/swank-loader.lisp:1.53 --- slime/swank-loader.lisp:1.52 Tue Sep 13 00:59:04 2005 +++ slime/swank-loader.lisp Fri Oct 14 20:11:16 2005 @@ -26,6 +26,8 @@ '("nregex") #+cmu '("swank-source-path-parser" "swank-source-file-cache" "swank-cmucl") + #+scl '("swank-source-path-parser" "swank-source-file-cache" + "swank-scl") #+sbcl '("swank-sbcl" "swank-source-path-parser" "swank-source-file-cache" "swank-gray") #+openmcl '("metering" "swank-openmcl" "swank-gray") @@ -39,17 +41,20 @@ (defparameter *implementation-features* '(:allegro :lispworks :sbcl :openmcl :cmu :clisp :ccl :corman :cormanlisp - :armedbear :gcl :ecl)) + :armedbear :gcl :ecl :scl)) (defparameter *os-features* - '(:macosx :linux :windows :mswindows :win32 :solaris :darwin :sunos :unix)) + '(:macosx :linux :windows :mswindows :win32 :solaris :darwin :sunos :hpux + :unix)) (defparameter *architecture-features* - '(:powerpc :ppc :x86 :x86-64 :i686 :pc386 :iapx386 :sparc)) + '(:powerpc :ppc :x86 :x86-64 :amd64 :i686 :i586 :i486 :pc386 :iapx386 + :sparc64 :sparc :hppa64 :hppa)) (defun lisp-version-string () #+cmu (substitute-if #\_ (lambda (x) (find x " /")) (lisp-implementation-version)) + #+scl (lisp-implementation-version) #+sbcl (lisp-implementation-version) #+ecl (lisp-implementation-version) #+openmcl (format nil "~d.~d" From dcrosher at common-lisp.net Fri Oct 14 18:14:20 2005 From: dcrosher at common-lisp.net (Douglas Crosher) Date: Fri, 14 Oct 2005 20:14:20 +0200 (CEST) Subject: [slime-cvs] CVS update: slime/swank-backend.lisp Message-ID: <20051014181420.80087880DB@common-lisp.net> Update of /project/slime/cvsroot/slime In directory common-lisp.net:/tmp/cvs-serv20834 Modified Files: swank-backend.lisp Log Message: o *gray-stream-symbols*: Scieneer Common Lisp implements stream-line-length. Date: Fri Oct 14 20:14:19 2005 Author: dcrosher Index: slime/swank-backend.lisp diff -u slime/swank-backend.lisp:1.90 slime/swank-backend.lisp:1.91 --- slime/swank-backend.lisp:1.90 Sat Oct 1 14:00:27 2005 +++ slime/swank-backend.lisp Fri Oct 14 20:14:19 2005 @@ -169,8 +169,8 @@ :stream-line-column :stream-read-char-no-hang ;; STREAM-LINE-LENGTH is an extension to gray streams that's apparently - ;; supported by CMUCL, OpenMCL and SBCL. - #+(or cmu openmcl sbcl) + ;; supported by CMUCL, OpenMCL, SBCL and SCL. + #+(or cmu openmcl sbcl scl) :stream-line-length)) (defun import-from (package symbol-names &optional (to-package *package*)) From dcrosher at common-lisp.net Fri Oct 14 18:28:07 2005 From: dcrosher at common-lisp.net (Douglas Crosher) Date: Fri, 14 Oct 2005 20:28:07 +0200 (CEST) Subject: [slime-cvs] CVS update: slime/doc/slime.texi Message-ID: <20051014182807.1268C880DB@common-lisp.net> Update of /project/slime/cvsroot/slime/doc In directory common-lisp.net:/tmp/cvs-serv21852/doc Modified Files: slime.texi Log Message: * Scieneer Common Lisp is now supported. Date: Fri Oct 14 20:28:07 2005 Author: dcrosher Index: slime/doc/slime.texi diff -u slime/doc/slime.texi:1.41 slime/doc/slime.texi:1.42 --- slime/doc/slime.texi:1.41 Sat Aug 6 16:45:31 2005 +++ slime/doc/slime.texi Fri Oct 14 20:28:07 2005 @@ -46,7 +46,7 @@ @end macro @set EDITION 1.2 - at set UPDATED @code{$Date: 2005/08/06 14:45:31 $} + at set UPDATED @code{$Date: 2005/10/14 18:28:07 $} @titlepage @title SLIME User Manual @@ -227,6 +227,8 @@ Armed Bear Common Lisp (@acronym{ABCL}) @item Corman Common Lisp (@acronym{CCL}), version 2.51 or newer with the patches from @url{http://www.grumblesmurf.org/lisp/corman-patches}) + at item +Scieneer Common Lisp (@acronym{SCL}), version 1.2.7 or newer @end itemize Most features work uniformly across implementations, but some are From dcrosher at common-lisp.net Fri Oct 14 18:51:02 2005 From: dcrosher at common-lisp.net (Douglas Crosher) Date: Fri, 14 Oct 2005 20:51:02 +0200 (CEST) Subject: [slime-cvs] CVS update: slime/ChangeLog Message-ID: <20051014185102.4A8BB880DB@common-lisp.net> Update of /project/slime/cvsroot/slime In directory common-lisp.net:/tmp/cvs-serv23907 Modified Files: ChangeLog Log Message: Scieneer Common Lisp support. Date: Fri Oct 14 20:51:01 2005 Author: dcrosher Index: slime/ChangeLog diff -u slime/ChangeLog:1.794 slime/ChangeLog:1.795 --- slime/ChangeLog:1.794 Tue Oct 11 23:11:24 2005 +++ slime/ChangeLog Fri Oct 14 20:51:01 2005 @@ -1,3 +1,22 @@ +2005-10-15 Douglas Crosher + + * swank-scl.lisp: Support for Scieneer Common Lisp. + + * swank-backend.lisp (*gray-stream-symbols*) Scieneer Common Lisp + implements stream-line-length. + + * swank-loader.lisp: Support for Scieneer Common Lisp: + (*sysdep-pathnames*) use swank-scl. + (*impl ementation-features*) add :scl. + (*os-features*) add :hpux. + (*architecture-features*) add :amd64, :i686, :i486, :sparc64, :sparc, + :hppa64, and :hppa. + + * swank.lisp: (*canonical-package-nicknames*) use lowercase + symbols to name the packages. This supports CL implementations + with lowercase default symbol names, such as Scieneer Common Lisp, + while still being compatible with ANSI-CL. + 2005-10-11 Stefan Kamphausen * slime.el: Persistent REPL history. The history from REPL From mbaringer at common-lisp.net Mon Oct 17 18:14:13 2005 From: mbaringer at common-lisp.net (Marco Baringer) Date: Mon, 17 Oct 2005 20:14:13 +0200 (CEST) Subject: [slime-cvs] CVS update: /slime/ChangeLog Message-ID: <20051017181413.4B70C880E6@common-lisp.net> Update of /project/slime/cvsroot//slime In directory common-lisp.net:/tmp/cvs-serv32123 Modified Files: ChangeLog Log Message: Date: Mon Oct 17 20:14:12 2005 Author: mbaringer From mbaringer at common-lisp.net Mon Oct 17 18:15:36 2005 From: mbaringer at common-lisp.net (Marco Baringer) Date: Mon, 17 Oct 2005 20:15:36 +0200 (CEST) Subject: [slime-cvs] CVS update: /slime/slime.el Message-ID: <20051017181536.AE375880E6@common-lisp.net> Update of /project/slime/cvsroot//slime In directory common-lisp.net:/tmp/cvs-serv32580 Modified Files: slime.el Log Message: (slime-eval-for-lisp): New API. This function now takes a single string, representing the form to evaluate, and uses emacs' read function to convert it into a form before eval'ing it. (slime-dispatch-event): The :eval event now passes a single string (instead of a string and something looking kind of like a form). Date: Mon Oct 17 20:15:36 2005 Author: mbaringer From mbaringer at common-lisp.net Mon Oct 17 18:16:02 2005 From: mbaringer at common-lisp.net (Marco Baringer) Date: Mon, 17 Oct 2005 20:16:02 +0200 (CEST) Subject: [slime-cvs] CVS update: /slime/swank.lisp Message-ID: <20051017181602.480C0880E6@common-lisp.net> Update of /project/slime/cvsroot//slime In directory common-lisp.net:/tmp/cvs-serv497 Modified Files: swank.lisp Log Message: (eval-in-emacs): Instead of taking a string and attempting to parse it emacs side the function now takes a form and converts it to a string internally. This should allow users of the function to not have to worry about quoting issues and emacs' different printed represenation for, among other things, characters. (process-form-for-emacs): New function. Converts a list into a string for passing to emacs. Date: Mon Oct 17 20:16:01 2005 Author: mbaringer From dcrosher at common-lisp.net Mon Oct 17 23:26:16 2005 From: dcrosher at common-lisp.net (Douglas Crosher) Date: Tue, 18 Oct 2005 01:26:16 +0200 (CEST) Subject: [slime-cvs] CVS update: slime/swank.lisp Message-ID: <20051017232616.E3AC3880E6@common-lisp.net> Update of /project/slime/cvsroot/slime In directory common-lisp.net:/tmp/cvs-serv25162 Modified Files: swank.lisp Log Message: * (canonical-package-nickname): always return the package name as a symbol if found. This restores the printing of package names as strings. Date: Tue Oct 18 01:26:16 2005 Author: dcrosher Index: slime/swank.lisp diff -u slime/swank.lisp:1.346 slime/swank.lisp:1.347 --- slime/swank.lisp:1.346 Mon Oct 17 20:16:01 2005 +++ slime/swank.lisp Tue Oct 18 01:26:15 2005 @@ -1905,8 +1905,9 @@ (defun canonical-package-nickname (package) "Return the canonical package nickname, if any, of PACKAGE." - (cdr (assoc (package-name package) *canonical-package-nicknames* - :test #'string=))) + (let ((name (cdr (assoc (package-name package) *canonical-package-nicknames* + :test #'string=)))) + (and name (string name)))) (defun auto-abbreviated-package-name (package) "Return an abbreviated 'name' for PACKAGE. From dcrosher at common-lisp.net Mon Oct 17 23:29:50 2005 From: dcrosher at common-lisp.net (Douglas Crosher) Date: Tue, 18 Oct 2005 01:29:50 +0200 (CEST) Subject: [slime-cvs] CVS update: slime/ChangeLog Message-ID: <20051017232950.1EF1F880E6@common-lisp.net> Update of /project/slime/cvsroot/slime In directory common-lisp.net:/tmp/cvs-serv25219 Modified Files: ChangeLog Log Message: * Restore the printing of package names as STRINGs. Date: Tue Oct 18 01:29:49 2005 Author: dcrosher Index: slime/ChangeLog diff -u slime/ChangeLog:1.796 slime/ChangeLog:1.797 --- slime/ChangeLog:1.796 Mon Oct 17 20:14:12 2005 +++ slime/ChangeLog Tue Oct 18 01:29:48 2005 @@ -1,3 +1,9 @@ +2005-10-18 Douglas Crosher + + * swank.lisp (canonical-package-nickname): always return the + package name as a STRING if found. This restores the printing of + package names as strings. + 2005-10-17 Marco Baringer * swank.lisp (eval-in-emacs): Instead of taking a string and From heller at common-lisp.net Fri Oct 21 08:05:07 2005 From: heller at common-lisp.net (Helmut Eller) Date: Fri, 21 Oct 2005 10:05:07 +0200 (CEST) Subject: [slime-cvs] CVS update: slime/slime.el Message-ID: <20051021080507.B5E5E8856F@common-lisp.net> Update of /project/slime/cvsroot/slime In directory common-lisp.net:/tmp/cvs-serv4169 Modified Files: slime.el Log Message: (slime-start-swank-server): Avoid comint-send-input here as it seems to trigger a bug in ansi-color-for-commit-mode. Date: Fri Oct 21 10:05:02 2005 Author: heller Index: slime/slime.el diff -u slime/slime.el:1.556 slime/slime.el:1.557 --- slime/slime.el:1.556 Mon Oct 17 20:15:32 2005 +++ slime/slime.el Fri Oct 21 10:05:00 2005 @@ -1466,8 +1466,9 @@ (make-local-variable 'slime-inferior-lisp-args) (setq slime-inferior-lisp-args args) (let ((str (funcall init (slime-swank-port-file) coding-system))) - (goto-char (point-max)) (insert str) - (comint-send-input))))) + (goto-char (process-mark process)) + (insert-before-markers str) + (process-send-string process str))))) (defun slime-inferior-lisp-args (process) (with-current-buffer (process-buffer process) @@ -3759,7 +3760,7 @@ (with-temp-buffer (insert ";; History for SLIME REPL. Automatically written\n") (insert ";; Edit only if you know what you're doing\n") - (pp (mapcar 'substring-no-properties hist) (current-buffer)) + (pp (mapcar #'substring-no-properties hist) (current-buffer)) (write-region (point-min) (point-max) file))))))) (defun slime-repl-save-all-histories () @@ -7944,35 +7945,6 @@ "*The name of the default Lisp implementation. See `slime-lisp-implementations'") -(defun slime-register-lisp-implementation (name command) - (interactive "sName: \nfCommand: ") - (let ((cons (assoc name slime-lisp-implementations))) - (if cons - (setf (cdr cons) command) - (push (cons name command) slime-lisp-implementations))) - (if (string= inferior-lisp-program "lisp") - (slime-select-lisp-implementation name))) - -(defun slime-select-lisp-implementation (name) - (interactive "sName: ") - (setq inferior-lisp-program - (cdr (assoc name slime-lisp-implementations)))) - -(defun slime-find-lisp-implementation (name) - (let ((cons (or (assoc name slime-lisp-implementations) - (rassoc name slime-lisp-implementations)))) - (if cons (cdr cons) name))) - -;; XXX: unused function -(defun slime-find-lisp-implementation-name (command) - (cdr (rassoc command slime-lisp-implementations))) - -(defun slime-symbolic-lisp-name-p (name) - (let ((cons (or (assoc name slime-lisp-implementations) - (rassoc name slime-lisp-implementations)))) - (if cons (car cons)))) - - (define-derived-mode slime-connection-list-mode fundamental-mode "connection-list" "SLIME Connection List Mode. @@ -9227,7 +9199,8 @@ (let ((p (slime-eval `(swank:listener-eval ,(format - "(cl:setq cl:*package* (cl:find-package %S)) + "(cl:setq cl:*print-case* :upcase) + (cl:setq cl:*package* (cl:find-package %S)) (cl:package-name cl:*package*)" package-name)) (slime-lisp-package)))) (slime-check ("slime-lisp-package is %S." package-name) From heller at common-lisp.net Fri Oct 21 08:08:25 2005 From: heller at common-lisp.net (Helmut Eller) Date: Fri, 21 Oct 2005 10:08:25 +0200 (CEST) Subject: [slime-cvs] CVS update: slime/ChangeLog Message-ID: <20051021080825.1E6D38856F@common-lisp.net> Update of /project/slime/cvsroot/slime In directory common-lisp.net:/tmp/cvs-serv4209 Modified Files: ChangeLog Log Message: Date: Fri Oct 21 10:08:24 2005 Author: heller Index: slime/ChangeLog diff -u slime/ChangeLog:1.797 slime/ChangeLog:1.798 --- slime/ChangeLog:1.797 Tue Oct 18 01:29:48 2005 +++ slime/ChangeLog Fri Oct 21 10:08:24 2005 @@ -1,3 +1,8 @@ +2005-10-21 Helmut Eller + + * slime.el (slime-start-swank-server): Avoid comint-send-input + here as it seems to trigger a bug in ansi-color-for-commit-mode. + 2005-10-18 Douglas Crosher * swank.lisp (canonical-package-nickname): always return the From heller at common-lisp.net Sun Oct 23 07:49:09 2005 From: heller at common-lisp.net (Helmut Eller) Date: Sun, 23 Oct 2005 09:49:09 +0200 (CEST) Subject: [slime-cvs] CVS update: slime/swank-sbcl.lisp Message-ID: <20051023074909.DB24588576@common-lisp.net> Update of /project/slime/cvsroot/slime In directory common-lisp.net:/tmp/cvs-serv10802 Modified Files: swank-sbcl.lisp Log Message: (make-stream-interactive, *auto-flush-streams*)[sb-thread]: Spawn a thread to flush interactive streams in reasonably short intervals. Date: Sun Oct 23 09:49:08 2005 Author: heller Index: slime/swank-sbcl.lisp diff -u slime/swank-sbcl.lisp:1.146 slime/swank-sbcl.lisp:1.147 --- slime/swank-sbcl.lisp:1.146 Thu Sep 22 22:20:43 2005 +++ slime/swank-sbcl.lisp Sun Oct 23 09:49:08 2005 @@ -1058,109 +1058,30 @@ (t (sb-thread:condition-wait (mailbox.waitqueue mbox) mutex)))))))) - ) -#+(and sb-thread - #.(cl:if (cl:find-symbol "THREAD-NAME" "SB-THREAD") '(or) '(and))) -(progn - (defimplementation spawn (fn &key name) - (declare (ignore name)) - (sb-thread:make-thread fn)) + ;;; Auto-flush streams - (defimplementation startup-multiprocessing ()) - - (defimplementation thread-id (thread) - (assert (eql (ash (ash thread -5) 5) thread)) - (ash thread -5)) - - (defimplementation find-thread (id) - (when (member (ash id 5) (all-threads)) - (ash id 5))) - - (defimplementation thread-name (thread) - (format nil "Thread ~D" (thread-id thread))) - - (defun %thread-state-slot (thread) - (sb-sys:without-gcing - (sb-kernel:make-lisp-obj - (sb-sys:sap-int - (sb-sys:sap-ref-sap (sb-thread::thread-sap-from-id thread) - (* sb-vm::thread-state-slot - sb-vm::n-word-bytes)))))) + ;; XXX race conditions + (defvar *auto-flush-streams* '()) - (defun %thread-state (thread) - (ecase (%thread-state-slot thread) - (0 :running) - (1 :stopping) - (2 :stopped) - (3 :dead))) - - (defimplementation thread-status (thread) - (string (%thread-state thread))) - - (defimplementation make-lock (&key name) - (sb-thread:make-mutex :name name)) - - (defimplementation call-with-lock-held (lock function) - (declare (type function function)) - (sb-thread:with-mutex (lock) (funcall function))) - - (defimplementation current-thread () - (sb-thread:current-thread-id)) - - (defimplementation all-threads () - (let ((tids (sb-sys:without-gcing - (sb-thread::mapcar-threads - (lambda (sap) - (sb-sys:sap-ref-32 sap - (* sb-vm:n-word-bytes - sb-vm::thread-os-thread-slot))))))) - (remove :dead tids :key #'%thread-state))) - - (defimplementation interrupt-thread (thread fn) - (sb-thread:interrupt-thread thread fn)) - - (defimplementation kill-thread (thread) - (sb-thread:terminate-thread thread)) - - (defimplementation thread-alive-p (thread) - (ignore-errors (sb-thread:interrupt-thread thread (lambda ())) t)) - - (defvar *mailbox-lock* (sb-thread:make-mutex :name "mailbox lock")) - (defvar *mailboxes* (list)) - (declaim (type list *mailboxes*)) - - (defstruct (mailbox (:conc-name mailbox.)) - thread - (mutex (sb-thread:make-mutex)) - (waitqueue (sb-thread:make-waitqueue)) - (queue '() :type list)) - - (defun mailbox (thread) - "Return THREAD's mailbox." - (sb-thread:with-mutex (*mailbox-lock*) - (or (find thread *mailboxes* :key #'mailbox.thread) - (let ((mb (make-mailbox :thread thread))) - (push mb *mailboxes*) - mb)))) - - (defimplementation send (thread message) - (let* ((mbox (mailbox thread)) - (mutex (mailbox.mutex mbox))) - (sb-thread:with-mutex (mutex) - (setf (mailbox.queue mbox) - (nconc (mailbox.queue mbox) (list message))) - (sb-thread:condition-broadcast (mailbox.waitqueue mbox))))) + (defvar *auto-flush-thread* nil) - (defimplementation receive () - (let* ((mbox (mailbox (sb-thread:current-thread-id))) - (mutex (mailbox.mutex mbox))) - (sb-thread:with-mutex (mutex) - (loop - (let ((q (mailbox.queue mbox))) - (cond (q (return (pop (mailbox.queue mbox)))) - (t (sb-thread:condition-wait (mailbox.waitqueue mbox) - mutex)))))))) + (defimplementation make-stream-interactive (stream) + (setq *auto-flush-streams* (adjoin stream *auto-flush-streams*)) + (unless *auto-flush-thread* + (setq *auto-flush-thread* + (sb-thread:make-thread #'flush-streams + :name "auto-flush-thread")))) + + (defun flush-streams () + (loop + (setq *auto-flush-streams* + (remove-if (lambda (x) + (not (and (open-stream-p x) + (output-stream-p x)))) + *auto-flush-streams*)) + (mapc #'finish-output *auto-flush-streams*) + (sleep 0.15))) ) From heller at common-lisp.net Sun Oct 23 07:54:50 2005 From: heller at common-lisp.net (Helmut Eller) Date: Sun, 23 Oct 2005 09:54:50 +0200 (CEST) Subject: [slime-cvs] CVS update: slime/ChangeLog Message-ID: <20051023075450.6E7DF8857A@common-lisp.net> Update of /project/slime/cvsroot/slime In directory common-lisp.net:/tmp/cvs-serv10861 Modified Files: ChangeLog Log Message: *** empty log message *** Date: Sun Oct 23 09:54:49 2005 Author: heller Index: slime/ChangeLog diff -u slime/ChangeLog:1.798 slime/ChangeLog:1.799 --- slime/ChangeLog:1.798 Fri Oct 21 10:08:24 2005 +++ slime/ChangeLog Sun Oct 23 09:54:49 2005 @@ -1,3 +1,9 @@ +2005-10-23 Helmut Eller + + * swank-sbcl.lisp (make-stream-interactive): Spawn a thread to + flush interactive streams in reasonably short intervals. + Remove the old backward-compatible threading implementation. + 2005-10-21 Helmut Eller * slime.el (slime-start-swank-server): Avoid comint-send-input From heller at common-lisp.net Sun Oct 23 08:47:57 2005 From: heller at common-lisp.net (Helmut Eller) Date: Sun, 23 Oct 2005 10:47:57 +0200 (CEST) Subject: [slime-cvs] CVS update: slime/swank-backend.lisp slime/swank.lisp slime/swank-sbcl.lisp slime/ChangeLog Message-ID: <20051023084757.17FF18857A@common-lisp.net> Update of /project/slime/cvsroot/slime In directory common-lisp.net:/tmp/cvs-serv14886 Modified Files: swank-backend.lisp swank.lisp swank-sbcl.lisp ChangeLog Log Message: * swank-backend.lisp (install-debugger-globally): new interface function * swank.lisp (install-debugger): call install-debugger-globally * swank-sbcl.lisp (install-debugger-globally): set sb-ext:*invoke-debugger-hook* too Date: Sun Oct 23 10:47:56 2005 Author: heller Index: slime/swank-backend.lisp diff -u slime/swank-backend.lisp:1.91 slime/swank-backend.lisp:1.92 --- slime/swank-backend.lisp:1.91 Fri Oct 14 20:14:19 2005 +++ slime/swank-backend.lisp Sun Oct 23 10:47:54 2005 @@ -430,6 +430,12 @@ ;;;; Debugging +(definterface install-debugger-globally (function) + "Install FUNCTION as the debugger for all threads/processes. This +usually involves setting *DEBUGGER-HOOK* and, if the implementation +permits, hooking into BREAK as well." + (setq *debugger-hook* function)) + (definterface call-with-debugging-environment (debugger-loop-fn) "Call DEBUGGER-LOOP-FN in a suitable debugging environment. Index: slime/swank.lisp diff -u slime/swank.lisp:1.347 slime/swank.lisp:1.348 --- slime/swank.lisp:1.347 Tue Oct 18 01:26:15 2005 +++ slime/swank.lisp Sun Oct 23 10:47:54 2005 @@ -64,11 +64,11 @@ "The KEYWORD package.") (defvar *canonical-package-nicknames* - '((:common-lisp-user . :cl-user)) + `((:common-lisp-user . :cl-user)) "Canonical package names to use instead of shortest name/nickname.") (defvar *auto-abbreviate-dotted-packages* t - "Automatically abbreviate dotted package names to their last component when T.") + "Abbreviate dotted package names to their last component if T.") (defvar *swank-io-package* (let ((package (make-package :swank-io-package :use '()))) @@ -1067,7 +1067,8 @@ (let* ((tag (incf *read-input-catch-tag*)) (value (catch (intern-catch-tag tag) (send-to-emacs - `(:eval ,(current-thread) ,tag ,(process-form-for-emacs form))) + `(:eval ,(current-thread) ,tag + ,(process-form-for-emacs form))) (loop (read-from-emacs))))) (destructure-case value ((:ok value) value) @@ -1899,9 +1900,11 @@ (defun package-string-for-prompt (package) "Return the shortest nickname (or canonical name) of PACKAGE." - (or (canonical-package-nickname package) - (auto-abbreviated-package-name package) - (shortest-package-nickname package))) + (princ-to-string + (make-symbol + (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." @@ -2055,7 +2058,7 @@ (defun install-debugger (connection) (declare (ignore connection)) (when *global-debugger* - (setq *debugger-hook* #'swank-debugger-hook))) + (install-debugger-globally #'swank-debugger-hook))) ;;;;; Debugger loop ;;; Index: slime/swank-sbcl.lisp diff -u slime/swank-sbcl.lisp:1.147 slime/swank-sbcl.lisp:1.148 --- slime/swank-sbcl.lisp:1.147 Sun Oct 23 09:49:08 2005 +++ slime/swank-sbcl.lisp Sun Oct 23 10:47:54 2005 @@ -618,6 +618,10 @@ (defvar *sldb-stack-top*) +(defimplementation install-debugger-globally (function) + (setq sb-ext:*invoke-debugger-hook* function) + (setq *debugger-hook* function)) + (defimplementation call-with-debugging-environment (debugger-loop-fn) (declare (type function debugger-loop-fn)) (let* ((*sldb-stack-top* (or sb-debug:*stack-top-hint* (sb-di:top-frame))) Index: slime/ChangeLog diff -u slime/ChangeLog:1.799 slime/ChangeLog:1.800 --- slime/ChangeLog:1.799 Sun Oct 23 09:54:49 2005 +++ slime/ChangeLog Sun Oct 23 10:47:54 2005 @@ -1,8 +1,20 @@ +2005-10-23 Gabor Melis + + * swank-backend.lisp (install-debugger-globally): new interface + function + + * swank.lisp (install-debugger): call install-debugger-globally + + * swank-sbcl.lisp (install-debugger-globally): set + sb-ext:*invoke-debugger-hook* too + 2005-10-23 Helmut Eller * swank-sbcl.lisp (make-stream-interactive): Spawn a thread to flush interactive streams in reasonably short intervals. Remove the old backward-compatible threading implementation. + + * swank.lisp (package-string-for-prompt): Respect *print-case*. 2005-10-21 Helmut Eller From heller at common-lisp.net Sun Oct 23 08:53:01 2005 From: heller at common-lisp.net (Helmut Eller) Date: Sun, 23 Oct 2005 10:53:01 +0200 (CEST) Subject: [slime-cvs] CVS update: slime/slime.el slime/ChangeLog Message-ID: <20051023085301.4EDB68857A@common-lisp.net> Update of /project/slime/cvsroot/slime In directory common-lisp.net:/tmp/cvs-serv14936 Modified Files: slime.el ChangeLog Log Message: * slime.el (slime-repl-history-size, slime-repl-history-file): Use defcustom to declare the variables. Date: Sun Oct 23 10:53:00 2005 Author: heller Index: slime/slime.el diff -u slime/slime.el:1.557 slime/slime.el:1.558 --- slime/slime.el:1.557 Fri Oct 21 10:05:00 2005 +++ slime/slime.el Sun Oct 23 10:52:59 2005 @@ -436,6 +436,16 @@ "Face for the result of an evaluation in the SLIME REPL." :group 'slime-repl) +(defcustom slime-repl-history-file "~/.slime-history.eld" + "File to save the persistent REPL history to." + :type 'string + :group 'slime-repl) + +(defcustom slime-repl-history-size 100 + "Maximum number of lines for persistent REPL history." + :type 'integer + :group 'slime-repl) + ;;;; Minor modes ;;;;; slime-mode @@ -3667,9 +3677,6 @@ (slime-repl-history-replace 'forward regexp)) ;;;;; Persistent History - -(defvar slime-repl-history-file "~/.slime-history.eld") -(defvar slime-repl-history-size 100) (defun slime-repl-merge-histories (old-hist new-hist) "Merge entries from OLD-HIST and NEW-HIST such that the new items in Index: slime/ChangeLog diff -u slime/ChangeLog:1.800 slime/ChangeLog:1.801 --- slime/ChangeLog:1.800 Sun Oct 23 10:47:54 2005 +++ slime/ChangeLog Sun Oct 23 10:53:00 2005 @@ -1,3 +1,8 @@ +2005-10-23 Stefan Kamphausen + + * slime.el (slime-repl-history-size, slime-repl-history-file): Use + defcustom to declare the variables. + 2005-10-23 Gabor Melis * swank-backend.lisp (install-debugger-globally): new interface From heller at common-lisp.net Sun Oct 30 15:07:09 2005 From: heller at common-lisp.net (Helmut Eller) Date: Sun, 30 Oct 2005 16:07:09 +0100 (CET) Subject: [slime-cvs] CVS update: slime/swank.lisp Message-ID: <20051030150709.5B824880D7@common-lisp.net> Update of /project/slime/cvsroot/slime In directory common-lisp.net:/tmp/cvs-serv15056 Modified Files: swank.lisp Log Message: (simple-serve-requests): Close the connection at the end. Date: Sun Oct 30 16:07:08 2005 Author: heller Index: slime/swank.lisp diff -u slime/swank.lisp:1.348 slime/swank.lisp:1.349 --- slime/swank.lisp:1.348 Sun Oct 23 10:47:54 2005 +++ slime/swank.lisp Sun Oct 30 16:07:07 2005 @@ -383,9 +383,7 @@ :name "Swank")) ((:fd-handler :sigio) (add-fd-handler socket (lambda () (serve)))) - ((nil) - (unwind-protect (loop do (serve) while dont-close) - (close-socket socket)))) + ((nil) (loop do (serve) while dont-close))) port))) (defun serve-connection (socket style dont-close external-format) @@ -475,7 +473,8 @@ Return an output stream suitable for writing program output. This is an optimized way for Lisp to deliver output to Emacs." - (let* ((socket (create-socket *loopback-interface* *dedicated-output-stream-port*)) + (let* ((socket (create-socket *loopback-interface* + *dedicated-output-stream-port*)) (port (local-port socket))) (encode-message `(:open-dedicated-output-stream ,port) socket-io) (accept-authenticated-connection @@ -697,7 +696,8 @@ (defun simple-serve-requests (connection) (with-reader-error-handler (connection) - (loop (handle-request connection)))) + (unwind-protect (loop (handle-request connection)) + (close-connection connection)))) (defun read-from-socket-io () (let ((event (decode-message (current-socket-io)))) From heller at common-lisp.net Sun Oct 30 15:12:52 2005 From: heller at common-lisp.net (Helmut Eller) Date: Sun, 30 Oct 2005 16:12:52 +0100 (CET) Subject: [slime-cvs] CVS update: slime/slime.el Message-ID: <20051030151252.3A589880D7@common-lisp.net> Update of /project/slime/cvsroot/slime In directory common-lisp.net:/tmp/cvs-serv15134 Modified Files: slime.el Log Message: (slime-eval): Ensure that the connection is open before waiting for input. Date: Sun Oct 30 16:12:51 2005 Author: heller Index: slime/slime.el diff -u slime/slime.el:1.558 slime/slime.el:1.559 --- slime/slime.el:1.558 Sun Oct 23 10:52:59 2005 +++ slime/slime.el Sun Oct 30 16:12:51 2005 @@ -724,7 +724,7 @@ (define-key slime-doc-map (string key) command) (unless (equal key ?h) ; But don't bind C-h (let ((modified (slime-control-modified-char key))) - (define-key slime-doc-map (string modified) command))))) + (define-key slime-doc-map (vector modified) command))))) ;; C-c C-d is the prefix for the doc map. (slime-define-key "\C-d" slime-doc-map :prefixed t :inferior t) ;; Who-xref @@ -734,14 +734,14 @@ ;; We bind both unmodified and with control. (define-key slime-who-map (string key) command) (let ((modified (slime-control-modified-char key))) - (define-key slime-who-map (string modified) command)))) + (define-key slime-who-map (vector modified) command)))) ;; C-c C-w is the prefix for the who-xref map. (slime-define-key "\C-w" slime-who-map :prefixed t :inferior t)) (defun slime-control-modified-char (char) "Return the control-modified version of CHAR." ;; Maybe better to just bitmask it? - (car (read-from-string (format "?\\C-%c" char)))) + (read (format "?\\C-%c" char))) (slime-init-keymaps) @@ -2272,8 +2272,12 @@ ((:abort) (throw tag (list #'error "Synchronous Lisp Evaluation aborted.")))) (let ((debug-on-quit t) - (inhibit-quit nil)) - (while t (accept-process-output nil 0 10000))))))) + (inhibit-quit nil) + (conn (slime-connection))) + (while t + (unless (eq (process-status conn) 'open) + (error "Lisp connection closed unexpectedly")) + (accept-process-output nil 0 10000))))))) (defun slime-eval-async (sexp &optional cont package) "Evaluate EXPR on the superior Lisp and call CONT with the result." From heller at common-lisp.net Sun Oct 30 15:14:01 2005 From: heller at common-lisp.net (Helmut Eller) Date: Sun, 30 Oct 2005 16:14:01 +0100 (CET) Subject: [slime-cvs] CVS update: slime/ChangeLog Message-ID: <20051030151401.BF7C9880D7@common-lisp.net> Update of /project/slime/cvsroot/slime In directory common-lisp.net:/tmp/cvs-serv15164 Modified Files: ChangeLog Log Message: Date: Sun Oct 30 16:14:00 2005 Author: heller Index: slime/ChangeLog diff -u slime/ChangeLog:1.801 slime/ChangeLog:1.802 --- slime/ChangeLog:1.801 Sun Oct 23 10:53:00 2005 +++ slime/ChangeLog Sun Oct 30 16:14:00 2005 @@ -1,3 +1,17 @@ +2005-10-30 Helmut Eller + + * slime.el (slime-eval): Ensure that the connection is open before + waiting for input. + + * swank.lisp (simple-serve-requests): Close the connection at the + end. + +2005-10-23 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. + 2005-10-23 Stefan Kamphausen * slime.el (slime-repl-history-size, slime-repl-history-file): Use From asimon at common-lisp.net Sun Oct 30 16:57:20 2005 From: asimon at common-lisp.net (Andras Simon) Date: Sun, 30 Oct 2005 17:57:20 +0100 (CET) Subject: [slime-cvs] CVS update: slime/swank-abcl.lisp Message-ID: <20051030165720.33F63880D7@common-lisp.net> Update of /project/slime/cvsroot/slime In directory common-lisp.net:/tmp/cvs-serv22542 Modified Files: swank-abcl.lisp Log Message: Track mop changes in ABCL Date: Sun Oct 30 17:57:19 2005 Author: asimon Index: slime/swank-abcl.lisp diff -u slime/swank-abcl.lisp:1.27 slime/swank-abcl.lisp:1.28 --- slime/swank-abcl.lisp:1.27 Tue Jul 5 22:30:59 2005 +++ slime/swank-abcl.lisp Sun Oct 30 17:57:19 2005 @@ -367,17 +367,17 @@ (defmethod inspect-for-emacs ((slot mop::slot-definition) (inspector abcl-inspector)) (declare (ignore inspector)) (values "A slot." - `("Name: " (:value ,(mop::slot-definition-name slot)) + `("Name: " (:value ,(mop::%slot-definition-name slot)) (:newline) "Documentation:" (:newline) ,@(when (slot-definition-documentation slot) `((:value ,(slot-definition-documentation slot)) (:newline))) "Initialization:" (:newline) - " Args: " (:value ,(mop::slot-definition-initargs slot)) (:newline) - " Form: " ,(if (mop::slot-definition-initfunction slot) - `(:value ,(mop::slot-definition-initform slot)) + " Args: " (:value ,(mop::%slot-definition-initargs slot)) (:newline) + " Form: " ,(if (mop::%slot-definition-initfunction slot) + `(:value ,(mop::%slot-definition-initform slot)) "#") (:newline) - " Function: " (:value ,(mop::slot-definition-initfunction slot)) + " Function: " (:value ,(mop::%slot-definition-initfunction slot)) (:newline)))) (defmethod inspect-for-emacs ((f function) (inspector abcl-inspector)) From asimon at common-lisp.net Sun Oct 30 17:07:23 2005 From: asimon at common-lisp.net (Andras Simon) Date: Sun, 30 Oct 2005 18:07:23 +0100 (CET) Subject: [slime-cvs] CVS update: slime/ChangeLog Message-ID: <20051030170723.234E78855F@common-lisp.net> Update of /project/slime/cvsroot/slime In directory common-lisp.net:/tmp/cvs-serv23895 Modified Files: ChangeLog Log Message: * swank-abcl.lisp (inspect-for-emacs): Track mop changes in ABCL. Date: Sun Oct 30 18:07:15 2005 Author: asimon Index: slime/ChangeLog diff -u slime/ChangeLog:1.802 slime/ChangeLog:1.803 --- slime/ChangeLog:1.802 Sun Oct 30 16:14:00 2005 +++ slime/ChangeLog Sun Oct 30 18:07:14 2005 @@ -1,3 +1,7 @@ +2005-10-30 Andras Simon + + * swank-abcl.lisp (inspect-for-emacs): Track mop changes in ABCL. + 2005-10-30 Helmut Eller * slime.el (slime-eval): Ensure that the connection is open before From heller at common-lisp.net Mon Oct 31 08:22:09 2005 From: heller at common-lisp.net (Helmut Eller) Date: Mon, 31 Oct 2005 09:22:09 +0100 (CET) Subject: [slime-cvs] CVS update: slime/slime.el Message-ID: <20051031082209.769878856F@common-lisp.net> Update of /project/slime/cvsroot/slime In directory common-lisp.net:/tmp/cvs-serv24003 Modified Files: slime.el Log Message: (slime-start, slime-lookup-lisp-implementation) (slime-set-connection-info): Add a :name property for the implementation and use it to derive the connection-name. (slime-lisp-implementation-name): Renamed from slime-lisp-implementation-type-name. Date: Mon Oct 31 09:22:03 2005 Author: heller Index: slime/slime.el diff -u slime/slime.el:1.559 slime/slime.el:1.560 --- slime/slime.el:1.559 Sun Oct 30 16:12:51 2005 +++ slime/slime.el Mon Oct 31 09:21:52 2005 @@ -1304,14 +1304,15 @@ (defun slime-lookup-lisp-implementation (table name) (destructuring-bind (name (prog &rest args) &rest keys) (assoc name table) - (list* :program prog :program-args args keys))) + (list* :name name :program prog :program-args args keys))) (defun* slime-start (&key (program inferior-lisp-program) program-args (buffer "*inferior-lisp*") (coding-system slime-net-coding-system) - (init 'slime-init-command)) + (init 'slime-init-command) + name) (let ((args (list :program program :program-args program-args :buffer buffer - :coding-system coding-system :init init))) + :coding-system coding-system :init init :name name))) (slime-check-coding-system coding-system) (setq slime-net-coding-system coding-system) (when (or (not (slime-bytecode-stale-p)) @@ -1968,8 +1969,8 @@ (slime-def-connection-var slime-lisp-implementation-version nil "The implementation type of the Lisp process.") -(slime-def-connection-var slime-lisp-implementation-type-name nil - "The short name for the implementation type of the Lisp process.") +(slime-def-connection-var slime-lisp-implementation-name nil + "The short name for the Lisp implementation.") (slime-def-connection-var slime-connection-name nil "The short name for connection.") @@ -2025,15 +2026,18 @@ (destructuring-bind (&key name prompt) package (setf (slime-lisp-package) name (slime-lisp-package-prompt-string) prompt)) - (destructuring-bind (&key type type-name version) lisp-implementation + (destructuring-bind (&key type name version) lisp-implementation (setf (slime-lisp-implementation-type) type (slime-lisp-implementation-version) version - (slime-lisp-implementation-type-name) type-name - (slime-connection-name) (slime-generate-connection-name - type-name))) + (slime-lisp-implementation-name) name + (slime-connection-name) (slime-generate-connection-name name))) (destructuring-bind (&key instance type version) machine (setf (slime-machine-instance) instance))) (setq slime-state-name "") ; FIXME + (when-let (p (slime-inferior-process)) + (when-let (name (plist-get (slime-inferior-lisp-args p) ':name)) + (setf (slime-connection-name) + (slime-generate-connection-name (symbol-name name))))) (slime-hide-inferior-lisp-buffer) (slime-init-output-buffer connection) (run-hooks 'slime-connected-hook) @@ -8766,7 +8770,7 @@ (show-subtree))))) (defun slime-test-should-fail-p (test) - (member (slime-lisp-implementation-type-name) + (member (slime-lisp-implementation-name) (slime-test.fails-for test))) (defun slime-execute-tests () From heller at common-lisp.net Mon Oct 31 08:22:18 2005 From: heller at common-lisp.net (Helmut Eller) Date: Mon, 31 Oct 2005 09:22:18 +0100 (CET) Subject: [slime-cvs] CVS update: slime/swank.lisp Message-ID: <20051031082218.9C0B1885A7@common-lisp.net> Update of /project/slime/cvsroot/slime In directory common-lisp.net:/tmp/cvs-serv24067 Modified Files: swank.lisp Log Message: (simple-serve-requests): Add an extra abort restart. (connection-info): Rename :type-name to :name. Date: Mon Oct 31 09:22:15 2005 Author: heller Index: slime/swank.lisp diff -u slime/swank.lisp:1.349 slime/swank.lisp:1.350 --- slime/swank.lisp:1.349 Sun Oct 30 16:07:07 2005 +++ slime/swank.lisp Mon Oct 31 09:22:11 2005 @@ -696,7 +696,9 @@ (defun simple-serve-requests (connection) (with-reader-error-handler (connection) - (unwind-protect (loop (handle-request connection)) + (unwind-protect (loop (with-simple-restart + (abort "Return to SLIME top-level.") + (handle-request connection))) (close-connection connection)))) (defun read-from-socket-io () @@ -1085,7 +1087,7 @@ (setq *slime-features* *features*) `(:pid ,(getpid) :style ,(connection.communication-style *emacs-connection*) :lisp-implementation (:type ,(lisp-implementation-type) - :type-name ,(lisp-implementation-type-name) + :name ,(lisp-implementation-type-name) :version ,(lisp-implementation-version)) :machine (:instance ,(machine-instance) :type ,(machine-type) From heller at common-lisp.net Mon Oct 31 08:26:54 2005 From: heller at common-lisp.net (Helmut Eller) Date: Mon, 31 Oct 2005 09:26:54 +0100 (CET) Subject: [slime-cvs] CVS update: slime/ChangeLog Message-ID: <20051031082654.DB91088565@common-lisp.net> Update of /project/slime/cvsroot/slime In directory common-lisp.net:/tmp/cvs-serv24143 Modified Files: ChangeLog Log Message: Date: Mon Oct 31 09:26:54 2005 Author: heller Index: slime/ChangeLog diff -u slime/ChangeLog:1.803 slime/ChangeLog:1.804 --- slime/ChangeLog:1.803 Sun Oct 30 18:07:14 2005 +++ slime/ChangeLog Mon Oct 31 09:26:54 2005 @@ -1,6 +1,17 @@ +2005-10-31 Helmut Eller + + * slime.el (slime-start, slime-lookup-lisp-implementation) + (slime-set-connection-info): Add a :name property for the + implementation and use it to derive the connection-name. + (slime-lisp-implementation-name): Renamed from + slime-lisp-implementation-type-name. + + * swank.lisp (simple-serve-requests): Add an extra abort restart. + (connection-info): Rename :type-name to :name. + 2005-10-30 Andras Simon - * swank-abcl.lisp (inspect-for-emacs): Track mop changes in ABCL. + * swank-abcl.lisp (inspect-for-emacs): Track mop changes in ABCL. 2005-10-30 Helmut Eller