From crhodes at common-lisp.net Fri Jul 1 13:52:57 2005 From: crhodes at common-lisp.net (Christophe Rhodes) Date: Fri, 1 Jul 2005 15:52:57 +0200 (CEST) Subject: [slime-cvs] CVS update: slime/ChangeLog slime/swank-sbcl.lisp Message-ID: <20050701135257.C7B3C88561@common-lisp.net> Update of /project/slime/cvsroot/slime In directory common-lisp.net:/tmp/cvs-serv29206 Modified Files: ChangeLog swank-sbcl.lisp Log Message: Patch from Gabor for new thread api support (older SBCLs may or may not work at all, but definitely don't work with threads) Date: Fri Jul 1 15:52:56 2005 Author: crhodes Index: slime/ChangeLog diff -u slime/ChangeLog:1.717 slime/ChangeLog:1.718 --- slime/ChangeLog:1.717 Tue Jun 28 10:40:07 2005 +++ slime/ChangeLog Fri Jul 1 15:52:55 2005 @@ -1,3 +1,8 @@ +2005-07-01 Gabor Melis + + * swank-sbcl.lisp (threaded stuff): make SBCL 0.9.2.9+ work while + retaining support for 0.9.2 + 2005-06-28 Gabor Melis * swank-sbcl.lisp (threaded stuff): horrible hack to make threaded Index: slime/swank-sbcl.lisp diff -u slime/swank-sbcl.lisp:1.135 slime/swank-sbcl.lisp:1.136 --- slime/swank-sbcl.lisp:1.135 Tue Jun 28 10:40:07 2005 +++ slime/swank-sbcl.lisp Fri Jul 1 15:52:55 2005 @@ -504,7 +504,8 @@ #-swank-backend::source-plist (defun function-source-location (function &optional name) "Try to find the canonical source location of FUNCTION." - (declare (type function function)) + (declare (type function function) + (ignore name)) (if (function-from-emacs-buffer-p function) (find-temp-function-source-location function) (find-function-source-location function))) @@ -512,7 +513,8 @@ #+swank-backend::source-plist (defun function-source-location (function &optional name) "Try to find the canonical source location of FUNCTION." - (declare (type function function)) + (declare (type function function) + (ignore name)) (find-function-source-location function)) (defun safe-function-source-location (fun name) @@ -1086,7 +1088,130 @@ ;;;; Multiprocessing -#+sb-thread +#+(and sb-thread + #.(cl:if (cl:find-symbol "THREAD-NAME" "SB-THREAD") '(and) '(or))) +(progn + (defvar *thread-id-counter* 0) + + (defvar *thread-id-counter-lock* + (sb-thread:make-mutex :name "thread id counter lock")) + + (defun next-thread-id () + (sb-thread:with-mutex (*thread-id-counter-lock*) + (incf *thread-id-counter*))) + + (defparameter *thread-id-map* (make-hash-table)) + + ;; This should be a thread -> id map but as weak keys are not + ;; supported it is id -> map instead. + (defvar *thread-id-map-lock* + (sb-thread:make-mutex :name "thread id map lock")) + + (defimplementation spawn (fn &key name) + (sb-thread:make-thread fn :name name)) + + (defimplementation startup-multiprocessing ()) + + (defimplementation thread-id (thread) + (sb-thread:with-mutex (*thread-id-map-lock*) + (loop for id being the hash-key in *thread-id-map* + using (hash-value thread-pointer) + do + (let ((maybe-thread (sb-ext:weak-pointer-value thread-pointer))) + (cond ((null maybe-thread) + ;; the value is gc'd, remove it manually + (remhash id *thread-id-map*)) + ((eq thread maybe-thread) + (return-from thread-id id))))) + ;; lazy numbering + (let ((id (next-thread-id))) + (setf (gethash id *thread-id-map*) (sb-ext:make-weak-pointer thread)) + id))) + + (defimplementation find-thread (id) + (sb-thread:with-mutex (*thread-id-map-lock*) + (let ((thread-pointer (gethash id *thread-id-map*))) + (if thread-pointer + (let ((maybe-thread (sb-ext:weak-pointer-value thread-pointer))) + (if maybe-thread + maybe-thread + ;; the value is gc'd, remove it manually + (progn + (remhash id *thread-id-map*) + nil))) + nil)))) + + (defimplementation thread-name (thread) + ;; sometimes the name is not a string (e.g. NIL) + (princ-to-string (sb-thread:thread-name thread))) + + (defimplementation thread-status (thread) + (if (sb-thread:thread-alive-p thread) + "RUNNING" + "STOPPED")) + + (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*) + + (defimplementation all-threads () + (sb-thread:list-all-threads)) + + (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) + (sb-thread:thread-alive-p thread)) + + (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))))) + + (defimplementation receive () + (let* ((mbox (mailbox (current-thread))) + (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)))))))) + + ) + +#+(and sb-thread + #.(cl:if (cl:find-symbol "THREAD-NAME" "SB-THREAD") '(or) '(and))) (progn (defimplementation spawn (fn &key name) (declare (ignore name)) From mbaringer at common-lisp.net Sat Jul 2 17:49:22 2005 From: mbaringer at common-lisp.net (Marco Baringer) Date: Sat, 2 Jul 2005 19:49:22 +0200 (CEST) Subject: [slime-cvs] CVS update: /slime/slime.el /slime/ChangeLog Message-ID: <20050702174922.4DF4088529@common-lisp.net> Update of /project/slime/cvsroot//slime In directory common-lisp.net:/tmp/cvs-serv3803 Modified Files: slime.el ChangeLog Log Message: Date: Sat Jul 2 19:49:18 2005 Author: mbaringer From heller at common-lisp.net Sun Jul 3 15:40:24 2005 From: heller at common-lisp.net (Helmut Eller) Date: Sun, 3 Jul 2005 17:40:24 +0200 (CEST) Subject: [slime-cvs] CVS update: slime/swank-loader.lisp Message-ID: <20050703154024.A44278852C@common-lisp.net> Update of /project/slime/cvsroot/slime In directory common-lisp.net:/tmp/cvs-serv19848 Modified Files: swank-loader.lisp Log Message: (compile-files-if-needed-serially) [corman]: force-output after each file. Date: Sun Jul 3 17:40:23 2005 Author: heller Index: slime/swank-loader.lisp diff -u slime/swank-loader.lisp:1.49 slime/swank-loader.lisp:1.50 --- slime/swank-loader.lisp:1.49 Wed Jun 1 12:31:18 2005 +++ slime/swank-loader.lisp Sun Jul 3 17:40:23 2005 @@ -129,7 +129,8 @@ (defun compile-files-if-needed-serially (files) "Corman Lisp has trouble with compiled files." (dolist (file files) - (load file :verbose t))) + (load file :verbose t) + (force-output))) (compile-files-if-needed-serially (append (list (make-swank-pathname "swank-backend")) From heller at common-lisp.net Sun Jul 3 15:49:54 2005 From: heller at common-lisp.net (Helmut Eller) Date: Sun, 3 Jul 2005 17:49:54 +0200 (CEST) Subject: [slime-cvs] CVS update: slime/slime.el Message-ID: <20050703154954.0B9678852C@common-lisp.net> Update of /project/slime/cvsroot/slime In directory common-lisp.net:/tmp/cvs-serv20786 Modified Files: slime.el Log Message: (next-single-char-property-change) (previous-single-char-property-change) [xemacs]: Only define them if not present. (next-char-property-change, previous-char-property-change): Define if needed. (slime-start-swank-server): Send an extra newline before the "(swank:start-server ...". I don't know why, but this seems to fix the problem when starting CLISP/Win32. Interrupting CLISP/W32 is still horribly broken. Date: Sun Jul 3 17:49:54 2005 Author: heller Index: slime/slime.el diff -u slime/slime.el:1.510 slime/slime.el:1.511 --- slime/slime.el:1.510 Sat Jul 2 19:49:18 2005 +++ slime/slime.el Sun Jul 3 17:49:54 2005 @@ -1418,9 +1418,9 @@ "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 "(swank:start-server %S :external-format %s)\n" - file encoding)))) + (comint-send-string + process (format "\n(swank:start-server %S :external-format %s)\n" + file encoding)))) (defun slime-swank-port-file () "Filename where the SWANK server writes its TCP port number." @@ -9096,16 +9096,7 @@ ;;;;; Portability library (when (featurep 'xemacs) - (require 'overlay) - (defun next-single-char-property-change (&rest args) - (or (apply 'next-single-property-change args) - (point-max))) - (defun previous-single-char-property-change (&rest args) - (or (apply 'previous-single-property-change args) - (point-min))) - (unless (fboundp 'string-make-unibyte) - (defalias 'string-make-unibyte #'identity)) - ) + (require 'overlay)) (eval-when (compile eval) (defmacro slime-defun-if-undefined (name &rest rest) @@ -9156,6 +9147,19 @@ (get-char-property (1- pos) prop object))) return pos)))))))) +(slime-defun-if-undefined next-char-property-change (position &optional limit) + (let ((tmp (next-overlay-change position))) + (when tmp + (setq tmp (min tmp limit))) + (next-property-change position nil tmp))) + +(slime-defun-if-undefined previous-char-property-change + (position &optional limit) + (let ((tmp (previous-overlay-change position))) + (when tmp + (setq tmp (max tmp limit))) + (previous-property-change position nil tmp))) + (slime-defun-if-undefined substring-no-properties (string &optional start end) (let* ((start (or start 0)) (end (or end (length string))) From heller at common-lisp.net Sun Jul 3 15:51:06 2005 From: heller at common-lisp.net (Helmut Eller) Date: Sun, 3 Jul 2005 17:51:06 +0200 (CEST) Subject: [slime-cvs] CVS update: slime/swank-corman.lisp Message-ID: <20050703155106.D81BD8852C@common-lisp.net> Update of /project/slime/cvsroot/slime In directory common-lisp.net:/tmp/cvs-serv20823 Modified Files: swank-corman.lisp Log Message: (default-directory): Return a namestring instead of the pathname. (inspect-for-emacs, inspect-structure): Teach the inspector how to deal with structures. (spawn, send, receive): Implement rudimentary threading support. It's now possible to connect with the :spawn communication style and to bring up a listener. Unfortunately, debugging the non-primary threads doesn't work at all. Still no support for interrupt-thread. Date: Sun Jul 3 17:51:06 2005 Author: heller Index: slime/swank-corman.lisp diff -u slime/swank-corman.lisp:1.2 slime/swank-corman.lisp:1.3 --- slime/swank-corman.lisp:1.2 Tue Jun 7 12:08:03 2005 +++ slime/swank-corman.lisp Sun Jul 3 17:51:05 2005 @@ -182,12 +182,10 @@ (format stream "~S" frame)) (defun get-frame-debug-info (frame) - (let ((info (frame-debug-info frame))) - (if info - info - (setf (frame-debug-info frame) - (db::prepare-frame-debug-info (frame-function frame) - (frame-address frame)))))) + (or (frame-debug-info frame) + (setf (frame-debug-info frame) + (db::prepare-frame-debug-info (frame-function frame) + (frame-address frame))))) (defimplementation frame-locals (frame-number) (let* ((frame (elt *frame-trace* frame-number)) @@ -255,7 +253,7 @@ (truename (merge-pathnames directory))))) (defimplementation default-directory () - (ccl:current-directory)) + (directory-namestring (ccl:current-directory))) (defimplementation macroexpand-all (form) (ccl:macroexpand-all form)) @@ -273,7 +271,8 @@ ccl:*cormanlisp-directory*)))) (make-location (list :file (namestring truename)) (if (ccl::function-source-line fspec) - (list :line (ccl::function-source-line fspec)) + (list :line + (1+ (ccl::function-source-line fspec))) (list :function-name (princ-to-string (function-name fspec)))))) (error (c) (list :error (princ-to-string c)))) @@ -461,6 +460,92 @@ (not (probe-file pathname))) (label-value-line "Truename" (truename pathname)))))) +(defimplementation inspect-for-emacs ((o t) (inspector corman-inspector)) + (cond ((cl::structurep o) (inspect-structure o)) + (t (call-next-method)))) + +(defun inspect-structure (o) + (values + (format nil "~A is a structure" o) + (let* ((template (cl::uref o 1)) + (num-slots (cl::struct-template-num-slots template))) + (cond ((symbolp template) + (loop for i below num-slots + append (label-value-line i (cl::uref o (+ 2 i))))) + (t + (loop for i below num-slots + append (label-value-line (elt template (+ 6 (* i 5))) + (cl::uref o (+ 2 i))))))))) + + +;;; Threads + +(require 'threads) + +(defstruct (mailbox (:conc-name mailbox.)) + thread + (lock (make-instance 'threads:critical-section)) + (queue '() :type list)) + +(defvar *mailbox-lock* (make-instance 'threads:critical-section)) +(defvar *mailboxes* (list)) + +(defmacro with-lock (lock &body body) + `(threads:with-synchronization (threads:cs ,lock) + , at body)) + +(defimplementation spawn (fun &key name) + (declare (ignore name)) + (threads:create-thread + (lambda () + (unwind-protect (funcall fun) + (with-lock *mailbox-lock* + (setq *mailboxes* (remove cormanlisp:*current-thread-id* + *mailboxes* :key #'mailbox.thread))))))) + +(defimplementation thread-id (thread) + thread) + +(defimplementation find-thread (thread) + (if (thread-alive-p thread) + thread)) + +(defimplementation current-thread () + cormanlisp:*current-thread-id*) + +;; XXX implement it +(defimplementation all-threads () + '()) + +(defimplementation thread-alive-p (thread) + t) + +;; XXX something here is broken +(defimplementation kill-thread (thread) + (threads:terminate-thread thread 'killed)) + +(defun mailbox (thread) + (with-lock *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))) + (with-lock (mailbox.lock mbox) + (setf (mailbox.queue mbox) + (nconc (mailbox.queue mbox) (list message)))))) + +(defimplementation receive () + (let ((mbox (mailbox cormanlisp:*current-thread-id*))) + (loop + (with-lock (mailbox.lock mbox) + (when (mailbox.queue mbox) + (return (pop (mailbox.queue mbox))))) + (sleep 0.1)))) + + ;;; This is probably not good, but it WFM (in-package :common-lisp) From heller at common-lisp.net Sun Jul 3 15:51:55 2005 From: heller at common-lisp.net (Helmut Eller) Date: Sun, 3 Jul 2005 17:51:55 +0200 (CEST) Subject: [slime-cvs] CVS update: slime/README Message-ID: <20050703155155.8306B8852C@common-lisp.net> Update of /project/slime/cvsroot/slime In directory common-lisp.net:/tmp/cvs-serv20851 Modified Files: README Log Message: Show examples for the filenames instead of the general "/the/path/to/this/directory". Suggested by Brandon J. Van Every. Date: Sun Jul 3 17:51:55 2005 Author: heller Index: slime/README diff -u slime/README:1.12 slime/README:1.13 --- slime/README:1.12 Fri Sep 3 23:07:42 2004 +++ slime/README Sun Jul 3 17:51:54 2005 @@ -10,9 +10,10 @@ Quick setup instructions ------------------------ - In Emacs Lisp: + Add this to your ~/.emacs file and fill in the appropriate filenames: - (add-to-list 'load-path "/the/path/to/this/directory") + (add-to-list 'load-path "~/hacking/lisp/slime/") ; your SLIME directory + (setq inferior-lisp-program "/opt/sbcl/bin/sbcl") ; your Lisp system (require 'slime) (slime-setup) From heller at common-lisp.net Sun Jul 3 15:53:34 2005 From: heller at common-lisp.net (Helmut Eller) Date: Sun, 3 Jul 2005 17:53:34 +0200 (CEST) Subject: [slime-cvs] CVS update: slime/swank-clisp.lisp Message-ID: <20050703155334.727408852C@common-lisp.net> Update of /project/slime/cvsroot/slime In directory common-lisp.net:/tmp/cvs-serv20890 Modified Files: swank-clisp.lisp Log Message: (describe-symbol-for-emacs): Report :setf and :type where appropriate. (getpid): Explicitly define it as foreign function on WIN32. Date: Sun Jul 3 17:53:33 2005 Author: heller Index: slime/swank-clisp.lisp diff -u slime/swank-clisp.lisp:1.49 slime/swank-clisp.lisp:1.50 --- slime/swank-clisp.lisp:1.49 Wed Jun 1 17:02:48 2005 +++ slime/swank-clisp.lisp Sun Jul 3 17:53:33 2005 @@ -80,6 +80,15 @@ (defimplementation call-without-interrupts (fn) (funcall fn)) +#+unix +(ffi:def-call-out getpid (:return-type ffi:int)) + +#+win32 +(ffi:def-call-out getpid (:name "GetCurrentProcessId") + (:library "kernel32.dll") + (:return-type ffi:uint32)) + +#+(or) (let ((getpid (or (find-symbol "PROCESS-ID" :system) ;; old name prior to 2005-03-01, clisp <= 2.33.2 (find-symbol "PROGRAM-ID" :system) @@ -157,8 +166,15 @@ ;; (type-of 'progn) -> ext:special-operator (t :special-operator))) (doc 'function))) - (maybe-push :class (when (find-class symbol nil) - (doc 'type))) ;this should be fixed + (when (or (get symbol 'system::setf-function) ; e.g. #'(setf elt) + (get symbol 'system::setf-expander)); defsetf + (maybe-push :setf (doc 'setf))) + (when (or (get symbol 'system::type-symbol); cf. clisp/src/describe.lisp + (get symbol 'system::defstruct-description) + (get symbol 'system::deftype-expander)) + (maybe-push :type (doc 'type))) ; even for 'structure + (when (find-class symbol nil) + (maybe-push :class (doc 'type))) ;; Let this code work compiled in images without FFI (let ((types (load-time-value (and (find-package "FFI") From heller at common-lisp.net Sun Jul 3 15:56:00 2005 From: heller at common-lisp.net (Helmut Eller) Date: Sun, 3 Jul 2005 17:56:00 +0200 (CEST) Subject: [slime-cvs] CVS update: slime/ChangeLog Message-ID: <20050703155600.7D6698852C@common-lisp.net> Update of /project/slime/cvsroot/slime In directory common-lisp.net:/tmp/cvs-serv20929 Modified Files: ChangeLog Log Message: *** empty log message *** Date: Sun Jul 3 17:55:59 2005 Author: heller Index: slime/ChangeLog diff -u slime/ChangeLog:1.719 slime/ChangeLog:1.720 --- slime/ChangeLog:1.719 Sat Jul 2 19:49:18 2005 +++ slime/ChangeLog Sun Jul 3 17:55:59 2005 @@ -1,3 +1,37 @@ +2005-07-03 Joerg Hoehle + + * swank-clisp (describe-symbol-for-emacs): Report :setf and :type + where appropriate. + +2005-07-03 Helmut Eller + + * slime.el (next-single-char-property-change) + (previous-single-char-property-change) [xemacs]: Only define them + if not present. + (next-char-property-change, previous-char-property-change): Define + if needed. + + * README: Show examples for the filenames instead of the general + "/the/path/to/this/directory". Suggested by Brandon J. Van Every. + + * swank-corman.lisp (default-directory): Return a namestring + instead of the pathname. + (inspect-for-emacs, inspect-structure): Teach the inspector how to + deal with structures. + (spawn, send, receive): Implement rudimentary threading support. + It's now possible to connect with the :spawn communication style + and to bring up a listener. Unfortunately, debugging the + non-primary threads doesn't work at all. Still no support for + interrupt-thread. + + * slime.el (slime-start-swank-server): Send an extra newline + before the "(swank:start-server ...". I don't know why, but this + seems to fix the problem when starting CLISP/Win32. Interrupting + CLISP/W32 is still horribly broken. + + * swank-loader.lisp (compile-files-if-needed-serially) [corman]: + force-output after each file. + 2005-07-02 Marco Baringer * slime.el (save-some-lisp-buffers): New Function. From heller at common-lisp.net Tue Jul 5 20:31:02 2005 From: heller at common-lisp.net (Helmut Eller) Date: Tue, 5 Jul 2005 22:31:02 +0200 (CEST) Subject: [slime-cvs] CVS update: slime/swank-cmucl.lisp slime/swank-sbcl.lisp slime/swank-clisp.lisp slime/swank-allegro.lisp slime/swank-openmcl.lisp slime/swank-lispworks.lisp slime/swank-corman.lisp slime/swank-abcl.lisp slime/swank-backend.lisp Message-ID: <20050705203102.24DE7880DF@common-lisp.net> Update of /project/slime/cvsroot/slime In directory common-lisp.net:/tmp/cvs-serv32240 Modified Files: swank-cmucl.lisp swank-sbcl.lisp swank-clisp.lisp swank-allegro.lisp swank-openmcl.lisp swank-lispworks.lisp swank-corman.lisp swank-abcl.lisp swank-backend.lisp Log Message: (swank-compile-file): New optional argument `external-format'. Date: Tue Jul 5 22:30:59 2005 Author: heller Index: slime/swank-cmucl.lisp diff -u slime/swank-cmucl.lisp:1.149 slime/swank-cmucl.lisp:1.150 --- slime/swank-cmucl.lisp:1.149 Fri Jun 3 13:16:45 2005 +++ slime/swank-cmucl.lisp Tue Jul 5 22:30:58 2005 @@ -299,7 +299,9 @@ (c::warning #'handle-notification-condition)) (funcall function)))) -(defimplementation swank-compile-file (filename load-p) +(defimplementation swank-compile-file (filename load-p + &optional external-format) + (declare (ignore external-format)) (clear-xref-info filename) (with-compilation-hooks () (let ((*buffer-name* nil) Index: slime/swank-sbcl.lisp diff -u slime/swank-sbcl.lisp:1.136 slime/swank-sbcl.lisp:1.137 --- slime/swank-sbcl.lisp:1.136 Fri Jul 1 15:52:55 2005 +++ slime/swank-sbcl.lisp Tue Jul 5 22:30:59 2005 @@ -123,17 +123,20 @@ (sb-bsd-sockets:socket (sb-bsd-sockets:socket-file-descriptor socket)) (file-stream (sb-sys:fd-stream-fd socket)))) +(defun find-external-format (coding-system) + (ecase coding-system + (:iso-latin-1-unix :iso-8859-1) + #+sb-unicode + (:utf-8-unix :utf-8))) + (defun make-socket-io-stream (socket external-format) - (let ((encoding (ecase external-format - (:iso-latin-1-unix :iso-8859-1) - #+sb-unicode - (:utf-8-unix :utf-8)))) + (let ((ef (find-external-format external-format))) (sb-bsd-sockets:socket-make-stream socket :output t :input t :element-type 'character #+sb-unicode :external-format - #+sb-unicode encoding + #+sb-unicode ef ))) (defun accept (socket) @@ -364,16 +367,20 @@ (defvar *trap-load-time-warnings* nil) -(defimplementation swank-compile-file (filename load-p) - (handler-case - (let ((output-file (with-compilation-hooks () - (compile-file filename)))) - (when output-file - ;; Cache the latest source file for definition-finding. - (source-cache-get filename (file-write-date filename)) - (when load-p - (load output-file)))) - (sb-c:fatal-compiler-error () nil))) +(defimplementation swank-compile-file (filename load-p + &optional external-format) + (let ((ef (if external-format + (find-external-format external-format) + :default))) + (handler-case + (let ((output-file (with-compilation-hooks () + (compile-file filename :external-format ef)))) + (when output-file + ;; Cache the latest source file for definition-finding. + (source-cache-get filename (file-write-date filename)) + (when load-p + (load output-file)))) + (sb-c:fatal-compiler-error () nil)))) ;;;; compile-string Index: slime/swank-clisp.lisp diff -u slime/swank-clisp.lisp:1.50 slime/swank-clisp.lisp:1.51 --- slime/swank-clisp.lisp:1.50 Sun Jul 3 17:53:33 2005 +++ slime/swank-clisp.lisp Tue Jul 5 22:30:59 2005 @@ -80,15 +80,6 @@ (defimplementation call-without-interrupts (fn) (funcall fn)) -#+unix -(ffi:def-call-out getpid (:return-type ffi:int)) - -#+win32 -(ffi:def-call-out getpid (:name "GetCurrentProcessId") - (:library "kernel32.dll") - (:return-type ffi:uint32)) - -#+(or) (let ((getpid (or (find-symbol "PROCESS-ID" :system) ;; old name prior to 2005-03-01, clisp <= 2.33.2 (find-symbol "PROGRAM-ID" :system) @@ -422,13 +413,17 @@ :message (princ-to-string condition) :location (compiler-note-location)))) -(defimplementation swank-compile-file (filename load-p) - (with-compilation-hooks () - (with-compilation-unit () - (let ((fasl-file (compile-file filename))) - (when (and load-p fasl-file) - (load fasl-file)) - nil)))) +(defimplementation swank-compile-file (filename load-p + &optional external-format) + (let ((ef (if external-format + (find-encoding external-format) + :default))) + (with-compilation-hooks () + (with-compilation-unit () + (let ((fasl-file (compile-file filename :external-format ef))) + (when (and load-p fasl-file) + (load fasl-file)) + nil))))) (defimplementation swank-compile-string (string &key buffer position directory) (declare (ignore directory)) Index: slime/swank-allegro.lisp diff -u slime/swank-allegro.lisp:1.73 slime/swank-allegro.lisp:1.74 --- slime/swank-allegro.lisp:1.73 Fri Apr 1 21:44:27 2005 +++ slime/swank-allegro.lisp Tue Jul 5 22:30:59 2005 @@ -1,12 +1,11 @@ -;;;; -*- Mode: lisp; indent-tabs-mode: nil; outline-regexp: ";;;;;*"; -*- +;;;; -*- indent-tabs-mode: nil; outline-regexp: ";;;;;*"; -*- ;;; ;;; swank-allegro.lisp --- Allegro CL specific code for SLIME. ;;; ;;; Created 2003 ;;; ;;; This code has been placed in the Public Domain. All warranties -;;; are disclaimed. This code was written for "Allegro CL Trial -;;; Edition "5.0 [Linux/X86] (8/29/98 10:57)". +;;; are disclaimed. ;;; (in-package :swank-backend) @@ -57,15 +56,18 @@ (set-external-format s ef) s)) -(defun set-external-format (stream external-format) - #-allegro-v5.0 +(defun find-external-format (coding-system) + #-(version>= 6) :default + #+(version>= 6) (let* ((name (ecase external-format (:iso-latin-1-unix :latin1) (:utf-8-unix :utf-8-unix) - (:emacs-mule-unix :emacs-mule))) - (ef (excl:crlf-base-ef - (excl:find-external-format name :try-variant t)))) - (setf (stream-external-format stream) ef))) + (:emacs-mule-unix :emacs-mule)))) + (excl:crlf-base-ef (excl:find-external-format name :try-variant t)))) + +(defun set-external-format (stream external-format) + (setf (stream-external-format stream) + (find-external-format external-format))) (defimplementation format-sldb-condition (c) (princ-to-string c)) @@ -287,10 +289,16 @@ ) (funcall function))) -(defimplementation swank-compile-file (*compile-filename* load-p) +(defimplementation swank-compile-file (filename load-p + &optional external-format) (with-compilation-hooks () - (let ((*buffer-name* nil)) - (compile-file *compile-filename* :load-after-compile load-p)))) + (let ((*buffer-name* nil) + (*compile-filename* filename) + (ef (if external-format + (find-external-format external-format) + :default))) + (compile-file *compile-filename* :load-after-compile load-p + :external-format ef)))) (defun call-with-temp-file (fn) (let ((tmpname (system:make-temp-file-name))) Index: slime/swank-openmcl.lisp diff -u slime/swank-openmcl.lisp:1.93 slime/swank-openmcl.lisp:1.94 --- slime/swank-openmcl.lisp:1.93 Fri May 6 18:30:02 2005 +++ slime/swank-openmcl.lisp Tue Jul 5 22:30:59 2005 @@ -262,7 +262,9 @@ (handler-bind ((ccl::compiler-warning #'handle-compiler-warning)) (funcall function))) -(defimplementation swank-compile-file (filename load-p) +(defimplementation swank-compile-file (filename load-p + &optional external-format) + (declare (ignore external-format)) (with-compilation-hooks () (let ((*buffer-name* nil) (*buffer-offset* nil)) Index: slime/swank-lispworks.lisp diff -u slime/swank-lispworks.lisp:1.73 slime/swank-lispworks.lisp:1.74 --- slime/swank-lispworks.lisp:1.73 Mon Jun 13 11:17:32 2005 +++ slime/swank-lispworks.lisp Tue Jul 5 22:30:59 2005 @@ -1,4 +1,4 @@ -;;; -*- Mode: lisp; indent-tabs-mode: nil -*- +;;; -*- indent-tabs-mode: nil -*- ;;; ;;; swank-lispworks.lisp --- LispWorks specific code for SLIME. ;;; @@ -84,6 +84,12 @@ (make-instance 'comm:socket-stream :socket fd :direction :io :element-type 'base-char))) +(defun find-external-format (coding-system &optional default) + (case coding-system + (:iso-latin-1-unix '(:latin-1 :eol-style :lf)) + (:utf-8-unix '(:utf-8 :eol-style :lf)) + (t default))) + (defun set-sigint-handler () ;; Set SIGINT handler on Swank request handler thread. #-win32 @@ -366,9 +372,13 @@ (signal-error-data-base compiler::*error-database* ,location) (signal-undefined-functions compiler::*unknown-functions* ,location))))) -(defimplementation swank-compile-file (filename load-p) +(defimplementation swank-compile-file (filename load-p + &optional external-format) (with-swank-compilation-unit (filename) - (compile-file filename :load load-p))) + (let ((ef (if external-format + (find-external-format external-format) + :default))) + (compile-file filename :load load-p :external-format ef)))) (defvar *within-call-with-compilation-hooks* nil "Whether COMPILE-FILE was called from within CALL-WITH-COMPILATION-HOOKS.") @@ -745,7 +755,7 @@ ;;; Some intergration with the lispworks environment -(defun swank-sym (name) (find-symbol (string name) (string :swank))) +(defun swank-sym (name) (find-symbol (string name) :swank)) (defimplementation emacs-connected () (when (eq (eval (swank-sym :*communication-style*)) @@ -756,8 +766,7 @@ (defmethod env-internals:environment-display-notifier (env &key restarts condition) (declare (ignore restarts)) - (funcall (find-symbol (string :swank-debugger-hook) :swank) - condition *debugger-hook*)) + (funcall (swank-sym :swank-debugger-hook) condition *debugger-hook*)) (defmethod env-internals:environment-display-debugger (env) *debug-io*))) Index: slime/swank-corman.lisp diff -u slime/swank-corman.lisp:1.3 slime/swank-corman.lisp:1.4 --- slime/swank-corman.lisp:1.3 Sun Jul 3 17:51:05 2005 +++ slime/swank-corman.lisp Tue Jul 5 22:30:59 2005 @@ -158,7 +158,7 @@ (*stack-trace* (cdr (member 'cl:invoke-debugger real-stack-trace :key #'car))) (*frame-trace* - (let* ((db::*debug-level* 1) + (let* ((db::*debug-level* (1+ db::*debug-level*)) (db::*debug-frame-pointer* (db::stash-ebp (ct:create-foreign-ptr))) (db::*debug-max-level* (length real-stack-trace)) @@ -214,6 +214,17 @@ (defimplementation frame-source-location-for-emacs (frame-number) (fspec-location (frame-function (elt *frame-trace* frame-number)))) +(defun break (&optional (format-control "Break") &rest format-arguments) + (with-simple-restart (continue "Return from BREAK.") + (let ();(*debugger-hook* nil)) + (let ((condition + (make-condition 'simple-condition + :format-control format-control + :format-arguments format-arguments))) + ;;(format *debug-io* ";;; User break: ~A~%" condition) + (invoke-debugger condition)))) + nil) + ;;; Socket communication (defimplementation create-socket (host port) @@ -354,7 +365,9 @@ (list :error "No location")))))))) (funcall fn))) -(defimplementation swank-compile-file (*compile-filename* load-p) +(defimplementation swank-compile-file (*compile-filename* load-p + &optional external-format) + (declare (ignore external-format)) (with-compilation-hooks () (let ((*buffer-name* nil)) (compile-file *compile-filename*) @@ -496,29 +509,30 @@ (defimplementation spawn (fun &key name) (declare (ignore name)) - (threads:create-thread + (th:create-thread (lambda () - (unwind-protect (funcall fun) - (with-lock *mailbox-lock* - (setq *mailboxes* (remove cormanlisp:*current-thread-id* - *mailboxes* :key #'mailbox.thread))))))) + (handler-bind ((serious-condition #'invoke-debugger)) + (unwind-protect (funcall fun) + (with-lock *mailbox-lock* + (setq *mailboxes* (remove cormanlisp:*current-thread-id* + *mailboxes* :key #'mailbox.thread)))))))) -(defimplementation thread-id (thread) +(defimplementation thread-id (thread) thread) (defimplementation find-thread (thread) (if (thread-alive-p thread) thread)) +(defimplementation thread-alive-p (thread) + (if (threads:thread-handle thread) t nil)) + (defimplementation current-thread () cormanlisp:*current-thread-id*) ;; XXX implement it (defimplementation all-threads () '()) - -(defimplementation thread-alive-p (thread) - t) ;; XXX something here is broken (defimplementation kill-thread (thread) Index: slime/swank-abcl.lisp diff -u slime/swank-abcl.lisp:1.26 slime/swank-abcl.lisp:1.27 --- slime/swank-abcl.lisp:1.26 Sat May 14 11:13:58 2005 +++ slime/swank-abcl.lisp Tue Jul 5 22:30:59 2005 @@ -271,12 +271,15 @@ (list :file *compile-filename*) (list :position 1)))))))) -(defimplementation swank-compile-file (*compile-filename* load-p) +(defimplementation swank-compile-file (filename load-p + &optional external-format) + (declare (ignore external-format)) (handler-bind ((warning #'handle-compiler-warning)) - (let ((*buffer-name* nil)) - (multiple-value-bind (fn warn fail) - (compile-file *compile-filename*) - (when load-p (unless fail (load fn))))))) + (let ((*buffer-name* nil) + (*compile-filename* filename)) + (multiple-value-bind (fn warn fail) (compile-file filename) + (when (and load-p (not fail)) + (load fn)))))) (defimplementation swank-compile-string (string &key buffer position directory) (declare (ignore directory)) Index: slime/swank-backend.lisp diff -u slime/swank-backend.lisp:1.85 slime/swank-backend.lisp:1.86 --- slime/swank-backend.lisp:1.85 Mon May 2 20:17:19 2005 +++ slime/swank-backend.lisp Tue Jul 5 22:30:59 2005 @@ -293,7 +293,7 @@ (error "Couldn't find ASDF operation ~S" operation-name)) (apply operate operation system-name keyword-args)))) -(definterface swank-compile-file (filename load-p) +(definterface swank-compile-file (filename load-p &optional external-format) "Compile FILENAME signalling COMPILE-CONDITIONs. If LOAD-P is true, load the file after compilation.") @@ -379,11 +379,12 @@ The property list has an entry for each interesting aspect of the symbol. The recognised keys are: - :VARIABLE :FUNCTION :SETF :TYPE :CLASS :MACRO :COMPILER-MACRO - :ALIEN-TYPE :ALIEN-STRUCT :ALIEN-UNION :ALIEN-ENUM + :VARIABLE :FUNCTION :SETF :SPECIAL-OPERATOR :MACRO :COMPILER-MACRO + :TYPE :CLASS :ALIEN-TYPE :ALIEN-STRUCT :ALIEN-UNION :ALIEN-ENUM The value of each property is the corresponding documentation string, -or :NOT-DOCUMENTED. It is legal to include keys not listed here. +or :NOT-DOCUMENTED. It is legal to include keys not listed here (but +slime-print-apropos in Emacs must know about them). Properties should be included if and only if they are applicable to the symbol. For example, only (and all) fbound symbols should include @@ -662,7 +663,7 @@ "Return an inspector object suitable for passing to inspect-for-emacs.") (definterface inspect-for-emacs (object inspector) - "Explain to emacs how to inspect OBJECT. + "Explain to Emacs how to inspect OBJECT. The argument INSPECTOR is an object representing how to get at the internals of OBJECT, it is usually an implementation specific @@ -695,13 +696,12 @@ Since we don't know how to deal with OBJECT we simply dump the output of CL:DESCRIBE." (declare (ignore inspector)) - (values "A value." - `("Type: " (:value ,(type-of object)) - (:newline) - "Don't know how to inspect the object, dumping output of CL:DESCIRBE:" - (:newline) (:newline) - ,(with-output-to-string (desc) - (describe object desc))))) + (values + "A value." + `("Type: " (:value ,(type-of object)) (:newline) + "Don't know how to inspect the object, dumping output of CL:DESCRIBE:" + (:newline) (:newline) + ,(with-output-to-string (desc) (describe object desc))))) ;;; Utilities for inspector methods. ;;; From heller at common-lisp.net Tue Jul 5 20:32:35 2005 From: heller at common-lisp.net (Helmut Eller) Date: Tue, 5 Jul 2005 22:32:35 +0200 (CEST) Subject: [slime-cvs] CVS update: slime/slime.el Message-ID: <20050705203235.771D5880DF@common-lisp.net> Update of /project/slime/cvsroot/slime In directory common-lisp.net:/tmp/cvs-serv362 Modified Files: slime.el Log Message: (slime-compile-file): Send the coding system if the buffer local variable `slime-coding' is bound. Date: Tue Jul 5 22:32:34 2005 Author: heller Index: slime/slime.el diff -u slime/slime.el:1.511 slime/slime.el:1.512 --- slime/slime.el:1.511 Sun Jul 3 17:49:54 2005 +++ slime/slime.el Tue Jul 5 22:32:34 2005 @@ -3773,7 +3773,10 @@ (when slime-display-compilation-output (slime-display-output-buffer)) (slime-eval-async - `(swank:compile-file-for-emacs ,lisp-filename ,(if load t nil)) + `(swank:compile-file-for-emacs + ,lisp-filename ,(if load t nil) + ,@(if (local-variable-p 'slime-coding) + (list (slime-coding-system-cl-name slime-coding)))) (slime-compilation-finished-continuation)) (message "Compiling %s.." lisp-filename))) From heller at common-lisp.net Tue Jul 5 20:34:32 2005 From: heller at common-lisp.net (Helmut Eller) Date: Tue, 5 Jul 2005 22:34:32 +0200 (CEST) Subject: [slime-cvs] CVS update: slime/ChangeLog Message-ID: <20050705203432.B7EDA880DF@common-lisp.net> Update of /project/slime/cvsroot/slime In directory common-lisp.net:/tmp/cvs-serv401 Modified Files: ChangeLog Log Message: *** empty log message *** Date: Tue Jul 5 22:34:32 2005 Author: heller Index: slime/ChangeLog diff -u slime/ChangeLog:1.720 slime/ChangeLog:1.721 --- slime/ChangeLog:1.720 Sun Jul 3 17:55:59 2005 +++ slime/ChangeLog Tue Jul 5 22:34:31 2005 @@ -1,3 +1,22 @@ +2005-07-05 Helmut Eller + + The file variable slime-coding can now be used to specify the + coding system to use for C-c C-k. E.g., if the file contains + -*- slime-coding: utf-8-unix -*- Emacs will tell the Lisp side + to call COMPILE-FILE with an external-format argument. + + * slime.el (slime-compile-file): Send the coding system if + the buffer local variable `slime-coding' is bound. + + * swank-backend.lisp, swank-sbcl.lisp, swank-clisp.lisp, + swank-lispworks.lisp, swank-cmucl, swank-allegro.lisp, + swank-abcl.lisp, swank-corman.lisp + (swank-compile-file): New optional argument `external-format'. + + * swank-clisp.lisp (getpid): Undo the last change. + + * swank-corman.lisp (spawn, thread-alive-p): More thread tweaking. + 2005-07-03 Joerg Hoehle * swank-clisp (describe-symbol-for-emacs): Report :setf and :type From heller at common-lisp.net Wed Jul 6 16:27:01 2005 From: heller at common-lisp.net (Helmut Eller) Date: Wed, 6 Jul 2005 18:27:01 +0200 (CEST) Subject: [slime-cvs] CVS update: slime/slime.el Message-ID: <20050706162701.CF13F8815E@common-lisp.net> Update of /project/slime/cvsroot/slime In directory common-lisp.net:/tmp/cvs-serv10940 Modified Files: slime.el Log Message: (slime-send-sigint): Use the symbol SIGINT stead of the signal number. Suggested by Joerg Hoehle. (slime-compile-file): XEmacs needs the buffer as argument to local-variable-p. Reported by Andy Sloane. Date: Wed Jul 6 18:27:00 2005 Author: heller Index: slime/slime.el diff -u slime/slime.el:1.512 slime/slime.el:1.513 --- slime/slime.el:1.512 Tue Jul 5 22:32:34 2005 +++ slime/slime.el Wed Jul 6 18:27:00 2005 @@ -2359,11 +2359,9 @@ (setf (slime-rex-continuations) '()) (mapc #'kill-buffer (sldb-buffers))) -(defconst +slime-sigint+ 2) - (defun slime-send-sigint () (interactive) - (signal-process (slime-pid) +slime-sigint+)) + (signal-process (slime-pid) 'SIGINT)) ;;;;; Event logging to *slime-events* ;;; @@ -3775,7 +3773,7 @@ (slime-eval-async `(swank:compile-file-for-emacs ,lisp-filename ,(if load t nil) - ,@(if (local-variable-p 'slime-coding) + ,@(if (local-variable-p 'slime-coding (current-buffer)) (list (slime-coding-system-cl-name slime-coding)))) (slime-compilation-finished-continuation)) (message "Compiling %s.." lisp-filename))) From heller at common-lisp.net Wed Jul 6 16:31:57 2005 From: heller at common-lisp.net (Helmut Eller) Date: Wed, 6 Jul 2005 18:31:57 +0200 (CEST) Subject: [slime-cvs] CVS update: slime/ChangeLog Message-ID: <20050706163157.55F988815E@common-lisp.net> Update of /project/slime/cvsroot/slime In directory common-lisp.net:/tmp/cvs-serv11780 Modified Files: ChangeLog Log Message: *** empty log message *** Date: Wed Jul 6 18:31:56 2005 Author: heller Index: slime/ChangeLog diff -u slime/ChangeLog:1.721 slime/ChangeLog:1.722 --- slime/ChangeLog:1.721 Tue Jul 5 22:34:31 2005 +++ slime/ChangeLog Wed Jul 6 18:31:56 2005 @@ -1,3 +1,10 @@ +2005-07-06 Helmut Eller + + * slime.el (slime-send-sigint): Use the symbol SIGINT stead of the + signal number. Suggested by Joerg Hoehle. + (slime-compile-file): XEmacs needs the buffer as argument to + local-variable-p. Reported by Andy Sloane. + 2005-07-05 Helmut Eller The file variable slime-coding can now be used to specify the From heller at common-lisp.net Thu Jul 14 09:12:03 2005 From: heller at common-lisp.net (Helmut Eller) Date: Thu, 14 Jul 2005 11:12:03 +0200 (CEST) Subject: [slime-cvs] CVS update: slime/swank-allegro.lisp Message-ID: <20050714091203.986EE88165@common-lisp.net> Update of /project/slime/cvsroot/slime In directory common-lisp.net:/tmp/cvs-serv26863 Modified Files: swank-allegro.lisp Log Message: (find-external-format): Fix typo. Date: Thu Jul 14 11:12:02 2005 Author: heller Index: slime/swank-allegro.lisp diff -u slime/swank-allegro.lisp:1.74 slime/swank-allegro.lisp:1.75 --- slime/swank-allegro.lisp:1.74 Tue Jul 5 22:30:59 2005 +++ slime/swank-allegro.lisp Thu Jul 14 11:12:02 2005 @@ -59,15 +59,15 @@ (defun find-external-format (coding-system) #-(version>= 6) :default #+(version>= 6) - (let* ((name (ecase external-format + (let* ((name (ecase coding-system (:iso-latin-1-unix :latin1) (:utf-8-unix :utf-8-unix) (:emacs-mule-unix :emacs-mule)))) (excl:crlf-base-ef (excl:find-external-format name :try-variant t)))) (defun set-external-format (stream external-format) - (setf (stream-external-format stream) - (find-external-format external-format))) + (setf (stream-external-format stream) + (find-external-format external-format))) (defimplementation format-sldb-condition (c) (princ-to-string c)) @@ -234,7 +234,7 @@ (member (type-of object) '(excl::compiler-note compiler::compiler-note))) (defun compiler-undefined-functions-called-warning-p (object) - #-allegro-v5.0 + #+(version>= 6) (typep object 'excl:compiler-undefined-functions-called-warning)) (deftype compiler-note () From heller at common-lisp.net Thu Jul 14 09:15:47 2005 From: heller at common-lisp.net (Helmut Eller) Date: Thu, 14 Jul 2005 11:15:47 +0200 (CEST) Subject: [slime-cvs] CVS update: slime/ChangeLog Message-ID: <20050714091547.4E84D88165@common-lisp.net> Update of /project/slime/cvsroot/slime In directory common-lisp.net:/tmp/cvs-serv27169 Modified Files: ChangeLog Log Message: *** empty log message *** Date: Thu Jul 14 11:15:46 2005 Author: heller Index: slime/ChangeLog diff -u slime/ChangeLog:1.722 slime/ChangeLog:1.723 --- slime/ChangeLog:1.722 Wed Jul 6 18:31:56 2005 +++ slime/ChangeLog Thu Jul 14 11:15:46 2005 @@ -1,3 +1,7 @@ +2005-07-14 Helmut Eller + + * swank-allegro.lisp (find-external-format): Fix typo. + 2005-07-06 Helmut Eller * slime.el (slime-send-sigint): Use the symbol SIGINT stead of the From mbaringer at common-lisp.net Fri Jul 22 10:52:33 2005 From: mbaringer at common-lisp.net (Marco Baringer) Date: Fri, 22 Jul 2005 12:52:33 +0200 (CEST) Subject: [slime-cvs] CVS update: /slime/swank-openmcl.lisp Message-ID: <20050722105233.B8B99880DF@common-lisp.net> Update of /project/slime/cvsroot//slime In directory common-lisp.net:/tmp/cvs-serv587 Modified Files: swank-openmcl.lisp Log Message: (frame-catch-tags): Remove some debugging forms which was "polluting" the repl buffer when viewing an sldb buffer. (function-source-location): Make :error messages have the proper form (exactly one string argument). This fix also removes the issues with sending unreadble lists (containing #<...> to emacs). Date: Fri Jul 22 12:52:33 2005 Author: mbaringer From mbaringer at common-lisp.net Fri Jul 22 10:53:11 2005 From: mbaringer at common-lisp.net (Marco Baringer) Date: Fri, 22 Jul 2005 12:53:11 +0200 (CEST) Subject: [slime-cvs] CVS update: /slime/ChangeLog Message-ID: <20050722105311.08225880DF@common-lisp.net> Update of /project/slime/cvsroot//slime In directory common-lisp.net:/tmp/cvs-serv624 Modified Files: ChangeLog Log Message: Date: Fri Jul 22 12:53:11 2005 Author: mbaringer From mbaringer at common-lisp.net Sun Jul 24 15:30:50 2005 From: mbaringer at common-lisp.net (Marco Baringer) Date: Sun, 24 Jul 2005 17:30:50 +0200 (CEST) Subject: [slime-cvs] CVS update: slime/ChangeLog slime/swank.lisp Message-ID: <20050724153050.8784788526@common-lisp.net> Update of /project/slime/cvsroot/slime In directory common-lisp.net:/tmp/cvs-serv8282 Modified Files: ChangeLog swank.lisp Log Message: Date: Sun Jul 24 17:30:46 2005 Author: mbaringer Index: slime/ChangeLog diff -u slime/ChangeLog:1.724 slime/ChangeLog:1.725 --- slime/ChangeLog:1.724 Fri Jul 22 12:53:11 2005 +++ slime/ChangeLog Sun Jul 24 17:30:46 2005 @@ -1,3 +1,10 @@ +2005-07-24 Tom Pierce + + * swank.lisp (format-iso8601-time): New functions. Properly + formats a universal-time as an iso8601 string. + (inspect-for-emacs integer): Use the new + format-iso8601 function when printing an integer as a date. + 2005-07-22 Marco Baringer * swank-openmcl.lisp (frame-catch-tags): Remove some debugging Index: slime/swank.lisp diff -u slime/swank.lisp:1.309 slime/swank.lisp:1.310 --- slime/swank.lisp:1.309 Tue Jun 21 20:28:58 2005 +++ slime/swank.lisp Sun Jul 24 17:30:46 2005 @@ -3659,6 +3659,26 @@ (declare (ignore inspector)) (values "A number." `("Value: " ,(princ-to-string n)))) +(defun format-iso8601-time (time-value &optional include-timezone-p) + "Formats a universal time TIME-VALUE in ISO 8601 format, with + the time zone included if INCLUDE-TIMEZONE-P is non-NIL" + ;; Taken from http://www.pvv.ntnu.no/~nsaa/ISO8601.html + ;; Thanks, Nikolai Sandved and Thomas Russ! + (flet ((format-iso8601-timezone (zone) + (if (zerop zone) + "Z" + (multiple-value-bind (h m) (truncate (abs zone) 1.0) + ;; Tricky. Sign of time zone is reversed in ISO 8601 + ;; relative to Common Lisp convention! + (format nil "~:[+~;-~]~2,'0D:~2,'0D" + (> zone 0) h (round m)))))) + (multiple-value-bind (second minute hour day month year dow dst zone) + (decode-universal-time time-value) + (declare (ignore dow dst)) + (format nil "~4,'0D-~2,'0D-~2,'0DT~2,'0D:~2,'0D:~2,'0D~:[~*~;~A~]" + year month day hour minute second + include-timezone-p (format-iso8601-timezone zone))))) + (defmethod inspect-for-emacs ((i integer) inspector) (declare (ignore inspector)) (values "A number." @@ -3671,10 +3691,7 @@ (label-value-line "Length" (integer-length i)) (ignore-errors (list "As time: " - (multiple-value-bind (sec min hour date month year) - (decode-universal-time i) - (format nil "~4,'0D-~2,'0D-~2,'0DT~2,'0D:~2,'0D:~2,'0DZ" - year month date hour min sec))))))) + (format-iso8601-time i t)))))) (defmethod inspect-for-emacs ((c complex) inspector) (declare (ignore inspector)) From mbaringer at common-lisp.net Tue Jul 26 14:59:46 2005 From: mbaringer at common-lisp.net (Marco Baringer) Date: Tue, 26 Jul 2005 16:59:46 +0200 (CEST) Subject: [slime-cvs] CVS update: slime/ChangeLog slime/swank-sbcl.lisp Message-ID: <20050726145946.470B988529@common-lisp.net> Update of /project/slime/cvsroot/slime In directory common-lisp.net:/tmp/cvs-serv1678 Modified Files: ChangeLog swank-sbcl.lisp Log Message: Date: Tue Jul 26 16:59:45 2005 Author: mbaringer Index: slime/ChangeLog diff -u slime/ChangeLog:1.725 slime/ChangeLog:1.726 --- slime/ChangeLog:1.725 Sun Jul 24 17:30:46 2005 +++ slime/ChangeLog Tue Jul 26 16:59:45 2005 @@ -1,3 +1,9 @@ +2005-07-26 Zach Beane + + * swank-sbcl.lisp (swank-compile-string): Revert to old string + compilation behavior to fix compiler note annotations. Code from + Juho Snellman. + 2005-07-24 Tom Pierce * swank.lisp (format-iso8601-time): New functions. Properly Index: slime/swank-sbcl.lisp diff -u slime/swank-sbcl.lisp:1.137 slime/swank-sbcl.lisp:1.138 --- slime/swank-sbcl.lisp:1.137 Tue Jul 5 22:30:59 2005 +++ slime/swank-sbcl.lisp Tue Jul 26 16:59:45 2005 @@ -304,7 +304,8 @@ ;; Compiling from a buffer (let ((position (+ *buffer-offset* (source-path-string-position - source-path *buffer-substring*)))) + (cons 0 (nthcdr 2 source-path)) + *buffer-substring*)))) (make-location (list :buffer *buffer-name*) (list :position position)))) ((and (pathnamep file) (null *buffer-name*)) @@ -465,8 +466,12 @@ (list :emacs-buffer buffer :emacs-string string :emacs-position position)) - (with-input-from-string (s string) - (load s)))))) + #+nil + (with-input-from-string (stream string) + (load stream)) + (funcall (compile nil + `(lambda () + ,(read-from-string string)))))))) ;;;; Definitions From heller at common-lisp.net Tue Jul 26 20:51:15 2005 From: heller at common-lisp.net (Helmut Eller) Date: Tue, 26 Jul 2005 22:51:15 +0200 (CEST) Subject: [slime-cvs] CVS update: slime/swank.lisp Message-ID: <20050726205115.E083F880DC@common-lisp.net> Update of /project/slime/cvsroot/slime In directory common-lisp.net:/tmp/cvs-serv24811 Modified Files: swank.lisp Log Message: (compile-file-for-emacs): Accept optional external-format argument. Date: Tue Jul 26 22:51:15 2005 Author: heller Index: slime/swank.lisp diff -u slime/swank.lisp:1.310 slime/swank.lisp:1.311 --- slime/swank.lisp:1.310 Sun Jul 24 17:30:46 2005 +++ slime/swank.lisp Tue Jul 26 22:51:14 2005 @@ -1,4 +1,4 @@ -;;; -*- Mode: lisp; outline-regexp: ";;;;;*"; indent-tabs-mode: nil -*-;;; +;;; -*- outline-regexp: ";;;;;*"; indent-tabs-mode: nil -*- ;;; ;;; This code has been placed in the Public Domain. All warranties ;;; are disclaimed. @@ -2197,12 +2197,13 @@ (list (to-string result) (format nil "~,2F" (/ usecs 1000000.0)))))) -(defslimefun compile-file-for-emacs (filename load-p) +(defslimefun compile-file-for-emacs (filename load-p &optional external-format) "Compile FILENAME and, when LOAD-P, load the result. Record compiler notes signalled as `compiler-condition's." (with-buffer-syntax () (let ((*compile-print* nil)) - (swank-compiler (lambda () (swank-compile-file filename load-p)))))) + (swank-compiler (lambda () (swank-compile-file filename load-p + external-format)))))) (defslimefun compile-string-for-emacs (string buffer position directory) "Compile STRING (exerpted from BUFFER at POSITION). From heller at common-lisp.net Tue Jul 26 20:56:51 2005 From: heller at common-lisp.net (Helmut Eller) Date: Tue, 26 Jul 2005 22:56:51 +0200 (CEST) Subject: [slime-cvs] CVS update: slime/ChangeLog Message-ID: <20050726205651.3AD07880DC@common-lisp.net> Update of /project/slime/cvsroot/slime In directory common-lisp.net:/tmp/cvs-serv24883 Modified Files: ChangeLog Log Message: *** empty log message *** Date: Tue Jul 26 22:56:50 2005 Author: heller Index: slime/ChangeLog diff -u slime/ChangeLog:1.726 slime/ChangeLog:1.727 --- slime/ChangeLog:1.726 Tue Jul 26 16:59:45 2005 +++ slime/ChangeLog Tue Jul 26 22:56:50 2005 @@ -1,3 +1,8 @@ +2005-07-26 Helmut Eller + + * swank.lisp (compile-file-for-emacs): Accept optional + external-format arg. I frogot to commit this file on 2005-07-05. + 2005-07-26 Zach Beane * swank-sbcl.lisp (swank-compile-string): Revert to old string From heller at common-lisp.net Tue Jul 26 21:36:06 2005 From: heller at common-lisp.net (Helmut Eller) Date: Tue, 26 Jul 2005 23:36:06 +0200 (CEST) Subject: [slime-cvs] CVS update: slime/slime.el Message-ID: <20050726213606.D7A68880DC@common-lisp.net> Update of /project/slime/cvsroot/slime In directory common-lisp.net:/tmp/cvs-serv27862 Modified Files: slime.el Log Message: (slime-goto-location-buffer): Put "SLIME Source Form" buffer into Lisp mode. (slime-input-complete-p): Skip over strings too. Date: Tue Jul 26 23:36:06 2005 Author: heller Index: slime/slime.el diff -u slime/slime.el:1.513 slime/slime.el:1.514 --- slime/slime.el:1.513 Wed Jul 6 18:27:00 2005 +++ slime/slime.el Tue Jul 26 23:36:05 2005 @@ -545,7 +545,7 @@ "Return t if the region from START to END contains a complete sexp." (save-excursion (goto-char start) - (cond ((looking-at "\\s *['`#]?(") + (cond ((looking-at "\\s *['`#]?[(\"]") (ignore-errors (save-restriction (narrow-to-region start end) @@ -3753,6 +3753,9 @@ (defvar slime-lisp-modes '(lisp-mode)) +(defvar slime-coding nil + "*The coding to use for `slime-compile-file'. Only used if buffer local.") + (defun slime-compile-file (&optional load) "Compile current buffer's file and highlight resulting compiler notes. @@ -4384,6 +4387,7 @@ ((:source-form string) (set-buffer (get-buffer-create "*SLIME Source Form*")) (erase-buffer) + (lisp-mode) (insert string) (goto-char (point-min))))) From heller at common-lisp.net Tue Jul 26 21:37:26 2005 From: heller at common-lisp.net (Helmut Eller) Date: Tue, 26 Jul 2005 23:37:26 +0200 (CEST) Subject: [slime-cvs] CVS update: slime/swank.lisp Message-ID: <20050726213726.BBC34880DC@common-lisp.net> Update of /project/slime/cvsroot/slime In directory common-lisp.net:/tmp/cvs-serv27893 Modified Files: swank.lisp Log Message: (inspect-for-emacs): Don't make whitespace surrounding :action buttons part of the highlighted region. Date: Tue Jul 26 23:37:26 2005 Author: heller Index: slime/swank.lisp diff -u slime/swank.lisp:1.311 slime/swank.lisp:1.312 --- slime/swank.lisp:1.311 Tue Jul 26 22:51:14 2005 +++ slime/swank.lisp Tue Jul 26 23:37:26 2005 @@ -3343,9 +3343,11 @@ " to the package: " (:value ,package ,(package-name package)) ,@(if (eq :internal status) - `((:action " [export it]" + `(" " + (:action "[export it]" ,(lambda () (export symbol package))))) - (:action " [unintern it]" + " " + (:action "[unintern it]" ,(lambda () (unintern symbol package))) (:newline)) '("It is a non-interned symbol." (:newline))) @@ -3357,7 +3359,8 @@ (if (find-class symbol nil) `("It names the class " (:value ,(find-class symbol) ,(string symbol)) - (:action " [remove]" + " " + (:action "[remove]" ,(lambda () (setf (find-class symbol) nil))) (:newline))) ;; @@ -3478,7 +3481,8 @@ `((:value ,method ,(inspector-princ ;; drop the name of the GF (cdr (method-for-inspect-value method)))) - (:action " [remove method]" + " " + (:action "[remove method]" ,(let ((m method)) ; LOOP reassigns method (lambda () (remove-method gf m)))) From heller at common-lisp.net Tue Jul 26 21:40:04 2005 From: heller at common-lisp.net (Helmut Eller) Date: Tue, 26 Jul 2005 23:40:04 +0200 (CEST) Subject: [slime-cvs] CVS update: slime/ChangeLog Message-ID: <20050726214004.DF844880DC@common-lisp.net> Update of /project/slime/cvsroot/slime In directory common-lisp.net:/tmp/cvs-serv27968 Modified Files: ChangeLog Log Message: *** empty log message *** Date: Tue Jul 26 23:40:04 2005 Author: heller Index: slime/ChangeLog diff -u slime/ChangeLog:1.727 slime/ChangeLog:1.728 --- slime/ChangeLog:1.727 Tue Jul 26 22:56:50 2005 +++ slime/ChangeLog Tue Jul 26 23:40:03 2005 @@ -1,8 +1,18 @@ +2005-07-26 Matthias Koeppe + + * swank.lisp (inspect-for-emacs): Don't make whitespace + surrounding :action buttons part of the highlighted region. + + * slime.el (slime-goto-location-buffer): Put "SLIME Source Form" + buffer into Lisp mode. + 2005-07-26 Helmut Eller * swank.lisp (compile-file-for-emacs): Accept optional external-format arg. I frogot to commit this file on 2005-07-05. + * slime.el (slime-input-complete-p): Skip over strings too. + 2005-07-26 Zach Beane * swank-sbcl.lisp (swank-compile-string): Revert to old string From mbaringer at common-lisp.net Fri Jul 29 12:34:57 2005 From: mbaringer at common-lisp.net (Marco Baringer) Date: Fri, 29 Jul 2005 14:34:57 +0200 (CEST) Subject: [slime-cvs] CVS update: /slime/ChangeLog Message-ID: <20050729123457.C208B880DC@common-lisp.net> Update of /project/slime/cvsroot//slime In directory common-lisp.net:/tmp/cvs-serv16058 Modified Files: ChangeLog Log Message: Date: Fri Jul 29 14:34:56 2005 Author: mbaringer From mbaringer at common-lisp.net Fri Jul 29 12:37:25 2005 From: mbaringer at common-lisp.net (Marco Baringer) Date: Fri, 29 Jul 2005 14:37:25 +0200 (CEST) Subject: [slime-cvs] CVS update: /slime/slime.el Message-ID: <20050729123725.5BA52880DC@common-lisp.net> Update of /project/slime/cvsroot//slime In directory common-lisp.net:/tmp/cvs-serv16098 Modified Files: slime.el Log Message: (slime-set-default-directory): Fix typo in doc string. Date: Fri Jul 29 14:37:24 2005 Author: mbaringer From mbaringer at common-lisp.net Fri Jul 29 12:38:22 2005 From: mbaringer at common-lisp.net (Marco Baringer) Date: Fri, 29 Jul 2005 14:38:22 +0200 (CEST) Subject: [slime-cvs] CVS update: /slime/swank.lisp Message-ID: <20050729123822.2B24F880DC@common-lisp.net> Update of /project/slime/cvsroot//slime In directory common-lisp.net:/tmp/cvs-serv16129 Modified Files: swank.lisp Log Message: (*dedicated-output-stream-port*): New variable. (open-dedicated-output-stream): Open the stream on the port *dedicated-output-stream-port*. Date: Fri Jul 29 14:38:22 2005 Author: mbaringer From mbaringer at common-lisp.net Fri Jul 29 12:40:51 2005 From: mbaringer at common-lisp.net (Marco Baringer) Date: Fri, 29 Jul 2005 14:40:51 +0200 (CEST) Subject: [slime-cvs] CVS update: /slime/doc/slime.texi Message-ID: <20050729124051.E37B8880DC@common-lisp.net> Update of /project/slime/cvsroot//slime/doc In directory common-lisp.net:/tmp/cvs-serv16156/doc Modified Files: slime.texi Log Message: (Other configurables): Document *dedicated-output-stream-port*. Date: Fri Jul 29 14:40:51 2005 Author: mbaringer